flprod


Name

flprod -- compute the product of two finite languages

Synopsis

flprod fl1 fl2

flprod fl2 <fl1


Description

flprod computes the product of the finite languages fl1 and fl2, writing the resulting finite language on the standard output. Both languages may be specified on the command line, or one may be read from standard input. fl2 can, if desired, be the same file as fl1.

If two finite languages are not specified, flprod returns 0. fl1 and fl2 must conform to the Grail format for finite languages.

The product of the two languages is formed by catenated every string in the first language with every string in the second lanuage. The product of a language and the empty language is the empty language. The catenation of a string and the empty string is the first string.


Examples

% cat fl1
aa
bb

% cat fl2
test

run

% flprod fl1 fl1
aaaa
aabb
bbaa
bbbb

% flprod fl1 fl2
aatest
bbtest
aa
bb
aarun
bbrun 


Authors

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

See also

fl(5), fllq(1), flrq(1)