ppRegEqns
functor
signature PPREGEQNS
functor ppRegEqns
(NAMES) : PPREGEQNS
This functor generates printing functions for regular recursion equations, using the printnames for constants and variables provided by the argument structure.
include REGEQNS
eqtype alph
val printExp : alph re -> unit
val printEqns : alph re eqns -> unit
eqtype alph
printExp r
printEqns eqs
Example:
structure R = let structure Names = struct type alph = string fun atomName (a : alph) = a : string fun varName i = if i=6 then "x" else "y("^ Int.toString i ^")" end in ppRegEqns (Names) end; let open R in printEqns [(1,Star (Plus [Atom "ab",Var 0])), (0,Times[Atom "a",Atom "ba",Plus [Var 0,Var 1]]), (2,Plus [Atom "abc",Var 6,Var 10])] end;The equation system is printed as:Equation system: y(1) = (ab + y(0))* y(0) = a;ba;(y(0) + y(1)) y(2) = (abc + x + y(10))