The RegMod functor


Synopsis

signature REGMOD
functor RegMod ( ... ) : REGMOD

This functor generates models of (regular or) Kleenean algebra, i.e. an interpretation of regular expressions (with free variables) in a given Kleenean algebra. This algebra has to come with a fixed interpretation of constants.


Functor argument interface

structure K : KA
eqtype alph
val envAtom : alph -> K.t

Description

structure K : KA
a Kleenean algebra.

eqtype alph
an alphabet of constants.

envAtom a
returns an element of K, which is used to interpret the atomic expression E.Atom a.



Functor result interface

structure K : KA
structure Exp : REGEXP
datatype re = datatype Exp.re
eqtype alph
type exp = alph re
type t = K.t
val eval : (int -> t) -> exp -> t

Description

datatype re = datatype Exp.re

eqtype alph

type exp = alph re
the regular expressions over the alphabet alph.

type t = K.t

eval env e
returns the value of expression e in K in the environment env. In particular, eval env (Var i) gives env i, and eval env (Atom a) gives envAtom a.


See Also

REGEXP, Reg

Discussion

The name RegMod may change. Here it means ``model of regular algebra'', but we may reserve it for ``module over a regular algebra'' (which is useful for linear languages).