fmunion


Name

fmunion -- compute the union of two machines

Synopsis

fmunion fm1 fm2

fmunion fm2 <fm1


Description

fmunion computes the union of fm1 and fm2. This is done by renumbering the states of fm2 and then appending its instructions to those of fm1. The input need not be deterministic.

fm1 and fm2 must conform to the Grail format for machines.


Examples

% cat dfm1
(START) |- 0
0 a 1
1 b 2
2 -| (FINAL)

% cat dfm3
(START) |- 0
0 a 1
0 b 4
1 c 2
2 d 3
3 -| (FINAL)
4 e 5
5 f 6
6 -| (FINAL)

% fmunion dfm1 dfm3
(START) |- 0
(START) |- 3
0 a 1
1 b 2
3 a 4
3 b 7
4 c 5
5 d 6
7 e 8
8 f 9
2 -| (FINAL)
6 -| (FINAL)
9 -| (FINAL)


Authors

Darrell Raymond and Derick Wood, the Grail project

See also

fm(5), fmrenum(1)