next up previous
Next: Composition Up: Operations on Finite Automata Previous: Minimization

Finite-state Transducers

If the option -transduce Words is used, the system produces all possible transductions of Words on the basis of the finite-state transducer read from standard input. This transducer can be specified in compiled format (a .pl file resulting from the -ct option presented below).


% fsa -transduce a a b b <a2b.td  
a b b b
(25)

If multiple output strings are possible, then all strings are produced. Consider the -compose_string option (discussed below) as an alternative in such cases: this produces a single automaton.

If the option -ta File is used, the system reads lines from standard input and writes for each line the line(s) as produced by the transducer (in File) to standard output.

If the option -tp is used, a finite state transducer is read from standard input. This transducer need not be deterministic. All pairs of sentences in the mapping defined by the transducer are written to standard output. Pairs are produced in increasing length of the input string.


% fsa -td <a2b.a2b.tnd |fsa -tp
==>                            b ==> b
a ==> a                        b b ==> b b
b a ==> b a                    a b ==> b b
a a ==> a a                    b b b ==> b b b
b b a ==> b b a                b a b ==> b b b
b a a ==> b a a                a b b ==> b b b
a b a ==> b b a                a a b ==> b b b
...
(26)

The -ct option is used to compile a transducer into a set of Prolog clauses (similar to the -compile option for acceptors). Standard input consists of the finite-state automaton to be compiled. The compiled clauses are written to standard output. If the input is a deterministic transducer, then the compiled clauses can be used by Prolog deterministically for transduction (clauses are indexed such that the Prolog compiler is able to recognize that the application of each clause is deterministic); transduction time is then independent of the size of the automaton. Examples:


% fsa -ct <a2b.td >a2b.pl
(27)

The options -domain and -range can be used to obtain the domain (range) of the mapping defined by the transducer read from standard input. The -identity option can be used to obtain a transducer defining the identity relation for the language defined by the finite-state automaton read from standard input:


% fsa -domain <a2b.a2b.tnd |fsa -d |fsa -m
start(q0).           final(q0).           trans(q0,a,q0).
trans(q0,b,q0).
% fsa -identity <aabb.nd
start(q0).           final(q1).           trans(q0,a/a,q2).
trans(q2,a/a,q0).    trans(q1,b/b,q3).    trans(q3,b/b,q1).
jump(q0,q1).
(28)


next up previous
Next: Composition Up: Operations on Finite Automata Previous: Minimization
Noord G.J.M. van
1998-09-28