The RegExpFm structure


signature REGEXPFM
structure RegExpFm : REGEXPFM

This structure combines the structures RegExp for regular expressions and the structure Fm for finite machines, and adds translations between expressions and machines.


structure E : REGEQNS
structure M : FM
type ''a machine = ''a M.machine
datatype re = datatype
val accept : ''a machine -> ''a list -> bool
val retofm : ''a re -> ''a machine
val retominfm : ''a re -> ''a machine
val fmtore : ''a machine -> ''a re


type ''a machine = ''a M.machine

datatype re = datatype

accept m l
returns true if m reaches an accepting state after executing instructions l.

retofm r
returns a finite automaton m accepting the language defined by expression r. The expression r must not have free variables. (no error message yet)

retominfm r
returns a state-minimal (total) deterministic finite automation m accepting the language defined by r. (Expression r must not have free variables.)

fmtore m
returns a regular expression r definining the language accepted by machine m.

See Also

RegExp, Fm, ppRegExpFm, RegEqnsFm, ppRegEqnsFm


Since the translation from machines to expressions goes via equation systems, the structure RegEqnsFm may sometimes be more appropriate.