The ppRegEqns functor


Synopsis

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.


Functor result interface

include REGEQNS
eqtype alph
val printExp : alph re -> unit
val printEqns : alph re eqns -> unit

Description

eqtype alph
the type of letters or constants admitted in regular expressions.

printExp r
prints the regular expression r, using RegExp.printExp.

printEqns eqs
prints the regular equation system eqs.


Discussion

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))