fmexec [-d] string <fm
The -d option causes fmexec to print each instruction that it executes for each character of string that is processed. In the case of nondeterministic machines, fmexec will print the set of instructions that are executed for each character of string.
fm must conform to the Grail format for machines. string should probably be protected from the shell by double quotes.
% 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) % fmexec nfm1 "abc" accepted % fmexec nfm1 "abbbbbbbbbbcdddddddddddd" accepted % fmexec nfm1 "x" not accepted % fmexec -d "abbcd" <nfm1 on a take instructions 1 a 2 1 a 3 on b take instructions 2 b 2 3 b 3 on b take instructions 2 b 2 3 b 3 on c take instructions 2 c 4 3 c 5 on d take instructions 4 d 4 5 d 5 terminate on final states 4 5 accepted