fltofm


Name

fltofm -- convert a finite language to a machine

Synopsis

fltofm fl

fltofm <fl


Description

fltofm computes a finite-state machine that accepts the same language as fl, and writes it on standard output. The result is guaranteed to be deterministic.

fl must conform to the Grail format for finite languages.

Empty languages will produce empty machines. If the empty string belongs to the language, then the machine's start state is also an end state.

The machine is generated as a trie, but will likely be non-minimal.


Examples

% cat fl1
abcf
abff
ab

cde

% fltofm <fl1
(START) |- 0
0 a 1
1 b 2
2 c 3
3 f 4
2 f 5
5 f 6
0 c 7
7 d 8
8 e 9
4 -| (FINAL)
6 -| (FINAL) 
2 -| (FINAL)
0 -| (FINAL)
9 -| (FINAL)


Authors

Roger Robson, Darrell Raymond and Derick Wood, the Grail project

See also

fl(5), fm(5), fmtofl(1)