NFA
Module
signature NFA
structure NFA
:> NFA
This module defines the abstract type of nondeterministic finite automata (NFAs).
type nfa
val injToFA : nfa -> FA.fa
val injToEFA : nfa -> EFA.efa
val valid : FA.fa -> bool
val projFromFA : FA.fa -> nfa
val projFromEFA : EFA.efa -> nfa
val fromString : string -> nfa
val input : string -> nfa
val toPP : nfa -> PP.pp
val toString : nfa -> string
val output : string * nfa -> unit
val states : nfa -> Sym.sym Set.set
val startState : nfa -> Sym.sym
val acceptingStates : nfa -> Sym.sym Set.set
val transitions : nfa -> Tran.tran Set.set
val compare : nfa Sort.total_ordering
val equal : nfa * nfa -> bool
val numStates : nfa -> int
val numTransitions : nfa -> int
val alphabet : nfa -> Sym.sym Set.set
val sub : nfa * nfa -> bool
val transitionFun : nfa -> Sym.sym * Str.str -> Sym.sym Set.set
val transitionFunBackwards : nfa -> Sym.sym * Str.str -> Sym.sym Set.set
val processStr : nfa -> Sym.sym Set.set * Str.str -> Sym.sym Set.set
val accepted : nfa -> Str.str -> bool
val reachableStates : nfa -> Sym.sym Set.set
val liveStates : nfa -> Sym.sym Set.set
val deadStates : nfa -> Sym.sym Set.set
val renameStates : nfa * SymRel.sym_rel -> nfa
val renameStatesCanonically : nfa -> nfa
val isomorphism : nfa * nfa * SymRel.sym_rel -> bool
val findIsomorphismOpt : nfa * nfa -> SymRel.sym_rel option
val findIsomorphism : nfa * nfa -> SymRel.sym_rel
val isomorphic : nfa * nfa -> bool
val renameAlphabet : nfa * SymRel.sym_rel -> nfa
val checkLP : nfa -> LP.lp -> unit
val validLP : nfa -> LP.lp -> bool
val findLPOpt : nfa -> Sym.sym Set.set * Str.str * Sym.sym Set.set -> LP.lp option
val findLP : nfa -> Sym.sym Set.set * Str.str * Sym.sym Set.set -> LP.lp
val findAcceptingLPOpt : nfa -> Str.str -> LP.lp option
val findAcceptingLP : nfa -> Str.str -> LP.lp
val emptyStr : nfa
val emptySet : nfa
val fromSym : Sym.sym -> nfa
val simplify : nfa -> nfa
val simplified : nfa -> bool
val inter : nfa * nfa -> nfa
val genInter : nfa list -> nfa
val prefix : nfa -> nfa
val fromEFA : EFA.efa -> nfa
type nfa
injToFA nfa
nfa
to have type FA.fa
.
injToEFA nfa
nfa
to have type EFA.efa
.
valid fa
fa
is an NFA.
projFromFA fa
fa
to have type nfa
. Issues an error message if fa
is not an NFA.
projFromEFA efa
efa
to have type nfa
. Issues an error message if efa
is not an NFA.
fromString s
input fil
fil
.
toPP fa
nfa
. (Inherited from FA
.)
toString nfa
nfa
to a string. (Inherited from FA
.)
output(fil, nfa)
nfa
to the file fil
. (Inherited from FA
.)
states nfa
nfa
. (Inherited from FA
.)
startState nfa
nfa
. (Inherited from FA
.)
acceptingStates nfa
nfa
. (Inherited from FA
.)
transitions nfa
nfa
. (Inherited from FA
.)
compare(nfa1, nfa2)
nfa1
and nfa2
in the total ordering on FAs. (Inherited from FA
.)
equal(nfa1, nfa2)
nfa1
and nfa2
are equal. (Inherited from FA
.)
numStates nfa
nfa
. (Inherited from FA
.)
numTransitions nfa
nfa
. (Inherited from FA
.)
alphabet nfa
nfa
. (Inherited from FA
.)
sub(nfa1, nfa2)
nfa1
is a sub-NFA of nfa2
. (Inherited from FA
.)
transitionFun nfa (q, x)
r
such that (q, x, r)
is a transition of nfa
. Issues an error message if q
is not a state of nfa
. (Inherited from FA
.)
transitionFunBackwards nfa (r, x)
q
such that (q, x, r)
is a transition of nfa
. Issues an error message if r
is not a state of nfa
. (Inherited from FA
.)
processStr nfa (qs, x)
x
from qs
in nfa
. Issues an error message if qs
has an element that's not a state of nfa
. (Inherited from FA
.)
accepted nfa x
x
is accepted by nfa
. (Inherited from FA
.)
reachableStates nfa
nfa
.
liveStates nfa
nfa
.
deadStates nfa
nfa
.
renameStates(nfa, rel)
nfa
using the bijection rel
. Issues an error message if rel
is not a bijection from the states of nfa
to some set. (Inherited from FA
.)
renameStatesCanonically nfa
nfa
. (Inherited from FA
.)
isomorphism(nfa1, nfa2, rel)
rel
is an isomorphism from nfa1
to nfa2
. (Inherited from FA
.)
findIsomorphismOpt(nfa1, nfa2)
SOME
of an isomorphism from nfa1
to nfa2
, if nfa1
and nfa2
are isomorphic, and NONE
, if nfa1
and nfa2
are not isomorphic.
findIsomorphism(nfa1, nfa2)
nfa1
to nfa2
. Issues an error message if such an isomorphism doesn't exist. (Inherited from FA
.)
isomorphic(nfa1, nfa2)
nfa1
and nfa2
are isomorphic. (Inherited from FA
.)
renameAlphabet(nfa, rel)
nfa
using the bijection rel
. Issues an error message if rel
is not a bijection from a superset of the alphabet of nfa
to some set. (Inherited from FA
.)
checkLP nfa lp
lp
is valid for nfa
, silently returning ()
, if it is, and explaining why it isn't, if it's not. (Inherited from FA
.)
validLP nfa lp
lp
is valid for nfa
. (Inherited from FA
.)
findLPOpt nfa (qs, x, rs)
SOME
of a minimal labeled path for nfa
, taking qs
to rs
with label x
, if such a labeled path exists, and NONE
, if such a labeled path does not exist.
findLP nfa (qs, x, rs)
nfa
, taking qs
to rs
with label x
. Issues an error message if there is an element of qs
or rs
that isn't a state of nfa
, or such a labeled path doesn't exist. (Inherited from FA
.)
findAcceptingLPOpt nfa x
SOME
of a minimal, accepting labeled path for nfa
and x
, if such a labeled path exists, and NONE
, if such a labeled path doesn't exist.
findAcceptingLP nfa x
nfa
and x
. Issues an error message if such a labeled path doesn't exist. (Inherited from FA
.)
emptyStr
FA
.)
emptySet
FA
.)
fromSym a
a
. (Inherited from FA
.)
simplify nfa
nfa
. (Inherited from FA
.)
simplified nfa
nfa
is simplified. (Inherited from FA
.)
inter(nfa1, nfa2)
nfa1
and nfa2
. (Inherited from EFA
.)
genInter
fun genInter nil = (* issues an error message *) | genInter [nfa] = nfa | genInter (nfa :: nfas) = inter(inter, genInter nfas)
prefix nfa
nfa
. (Inherited from EFA
.)
fromEFA efa
efa
to an NFA.
Forlan Version 4.15
Copyright © 2022 Alley Stoughton