This module provides a consistent interface to the internal format of finite automata. A finite automaton is a term
fa(Symbols,States,Starts,Finals,Transs,Jumps)
Symbols is a term r(Sig) (for recognizers) or t(SigD,SigR) for transducers. Here Sig, SigD, SigR are the predicate modules.
States is an integer indicating the number of states in the automaton.
Starts is an ordered list of integers indicating the start states of the automaton.
Finals is an ordered list of integers indicating the final states of the automaton.
Transs is an ordered list of triples trans(A,B,C) where A and C are integers indicating source and target state, and B is a symbol (recognizers) or a symbol pair InSym/OutSym (transducers). InSym is a symbol or the empty list. OutSym is a symbol or a (possibly empty) list of symbols.
Jumps is an ordered list of pairs jump(A,B) where A and B are integers indicating source and target state. This implies there is an epsilon transition from A to B.
This section lists the predicates defined by this module.
The number of states in Fa is Integer.
States is an ordered list of integers: all states in Fa.
State is a state in Fa.
StartStates is the ordered list of start states of Fa.
StartState is a start states of Fa.
FinalStates is the ordered list of final states of Fa.
FinalState is a final states of Fa.
Trans is the ordered list of transitions of Fa.
In Fa there is a transition from P to Q with symbol(pair) Sym.
Jumps is the ordered list of jumps of Fa.
In Fa there is a jump from P to Q.
Predicate to construct a finite automaton on the basis of lists of start states, final states, transitions and jumps. These lists need not be ordered. It's somewhat more efficient to specify the number of states, if known. It's even more efficient if you also know the symbols data-structure you want for Fa.
Predicate to construct an automaton on the basis of its components, or to query the components of a given automaton. The difference with fsa_construct/7 is that Starts, Finals, Trans and Jumps must be sorted already.
Predicate to construct a finite automaton on the basis of lists of start states, final states, transitions and jumps. These lists need not be ordered. Moreover, state names can be arbitrary Prolog terms. These state names will be renamed to integers. Symbol list is computed on the basis of Trans. Sigma is determined by the current default predicate module (i.e. by flag *pred_module*).. It's more efficient if you also know the symbols data-structure you want for Fa. Some checking on these symbols is performed nevertheless.
This predicate unifies Fa0 and Fa1 except for the part specified by Key. Part must be one of the atoms symbols, states, start_states, final_states, transitions, jumps. Part0 and Part1 are the corresponding parts in Fa0 and Fa1.
Type is the type of the automaton Fa, where type is one of recognizer, transducer(letter), transducer(sequence)