123456789101112131415161718192021222324252627282930313233343536373839404142434445(** {2 transform circuits to a different representation} *)open!ImportmoduletypeMakePureCombTransform_arg=sigincludeComb.Primitivesvalwire:int->tval(<==):t->t->unitendmoduletypeTransform=sigtype'atransform_fn'=(Signal.Uid.t->'a)->Signal.t->'atypetransform_fn=Signal.ttransform_fn'moduletypeTransformFn'=sigtypetvaltransform:ttransform_fn'valrewrite:ttransform_fn'->Signal.tSignal.Uid_map.t->Signal.tlist->tlistvalrewrite_signals:ttransform_fn'->Signal.tlist->tlistendmoduletypeTransformFn=sig(** function which will map signals to a new representation *)valtransform:transform_fnendmoduletypeMakePureCombTransform_arg=MakePureCombTransform_arg(** functor to build the function to map a signal to a new combinatorial signal
representation *)moduleMakePureCombTransform(B:MakePureCombTransform_arg):TransformFn'withtypet=B.t(** functor to build the function to map a signal to a new combinatorial signal
representation *)moduleMakeCombTransform(B:Comb.Primitiveswithtypet=Signal.t):TransformFn(** simple copying transform *)moduleCopyTransform:TransformFn(** rewrites the list of signals based on the given function *)valrewrite_signals:transform_fn->Signal.tlist->Signal.tlistend