fmtore


Name

fmtore -- convert a machine to a regular expression

Synopsis

fmtore fm

fmtore <fm


Description

fmtore computes a regular expression that accepts the same language as fm, and writes the result on standard output. The input need not be deterministic. All unreachable states will be removed.

fmtore uses the state elimination method for producing the regular expression.

fm must conform to the Grail format for machines.


Examples

% cat dfm5
(START) |- 0
0 a 1
1 c 2
2 e 3
3 -| (FINAL)
1 b 0
2 d 0

% fmtore <dfm5
a(ba)*c(da(ba)*c)*e

% cat nfm1
(START) |- 1
1 a 2
1 a 3
2 b 2
3 b 3
2 c 4
3 c 5
4 d 4
5 d 5
4 -| (FINAL)
5 -| (FINAL)

% fmtore nfm1
ab*cd*

Authors

Darrell Raymond and Derick Wood, the Grail project

See also

fm(5), re(5), retofm(1)