(* Stage 1 *) functor T_CODETOBLOCK( structure C:CodeSig structure B:BlockSig ) = CODETOBLOCK ( structure C = C structure B = B ) (* Stage 2 *) functor T_BLOCKTOCODE( structure C : CodeSig structure B : BlockSig ) = let structure DB = BLOCKASDAG( structure B = B ) in OPTBLOCKTOCODE ( structure C = C structure B = B structure S = TOPSORT( structure G = DB.G ) structure D = ASSOCLIST( type Key = B.Expn type Item = string) ) end; (* Stage 3 *) functor T_FLOWGRAPH( structure C2B : CodeToBlockSig ) = FLOWGRAPH( structure C2B = C2B structure Basic = BASIC()); structure Interp = INTERP( structure C = Prac6.Code structure D = ASSOCLIST(type Item = real type Key = string)); (* dummy functors hide my solutions *) functor BLOCKTOCODE() = struct end functor CODETOBLOCK() = struct end functor FLOWGRAPH () = struct end functor ASSOCLIST () = struct end functor BLOCKASDAG () = struct end; PolyML.make "DAGOPT2FLOWOPT"; structure Test = TEST(structure P6 = Prac6); open Test;