Equivalence checking of prefix-free transducers and deterministic two-tape automata V.A. Zakharov Lomonosov Moscow State University December 14, 2018
Preliminaries A word over alphabet A is any finite sequence w = a 1 a 2 . . . a k of letters in A . The empty word is denoted by ε . Given a pair of words u and v , we write uv for their concatenation. The set of all words over an alphabet A is denoted by A ∗ . A language over A is any subset of A ∗ . Concatenation of languages L 1 and L 2 is the language L 1 L 2 = { uv : u ∈ L 1 , v ∈ L 2 } . If L 1 = ∅ or L 2 = ∅ then L 1 L 2 = ∅ . A transduction over alphabets A and B is any subset of A ∗ × B ∗ .
Real Time Finite Transducers A Real Time Finite Transducer over an input alphabet Σ and an output alphabet ∆ is a quadruple π = � Q , q 0 , F , − →� , where ◮ Q is a finite set of states , ◮ q 0 is an initial state , ◮ F ⊆ Q is a subset of final states , and → is a finite transition relation of the type Q × Σ × ∆ ∗ × Q . ◮ − We will write π ( q 0 ) to emphasize that q 0 is the initial state of π . a / u → q ′ . Transitions ( q , a , u , q ′ ) in − → are depicted as q − A run of π on an input word w = a 1 a 2 . . . a n is any finite sequence a 1 / u 1 a 2 / u 2 a n − 1 / u n − 1 a n / u n → q ′ . of transitions q − → q 1 − → · · · − → − q n − 1 The pair ( w , u ) , where u = u 1 u 2 . . . u n , is a label of this run. w / u → ∗ q ′ when a transducer π has a run labeled with We write q − ( w , u ) from a state q to a state q ′ . If q ′ ∈ F then a run is final . A transduction relation realized by a transducer π at its state q is w / u → ∗ q ′ , q ′ ∈ F } . the set of pairs TR ( π, q ) = { ( w , u ) : q −
Real Time Finite Transducers Transducers π 1 ( q 1 ) and π 2 ( q 2 ) are called equivalent ( π 1 ( q 1 ) ∼ π 2 ( q 2 ) in symbols) iff TR ( π 1 , q 1 ) = TR ( π 2 , q 2 ) . Equivalence checking problem for transducers is that of checking, given a pair of transducers π 1 and π 2 , whether π 1 ∼ π 2 holds. A transducer π is called ◮ deterministic if for every letter a and a state q it has at most a / u → q ′ , one transition of the form q − ◮ k -ambiguous if for every input word w there is at most k final runs of π on w from the initial state q 0 , ◮ k -valued if for every input word w the transduction relation TR ( π, q 0 ) contains at most k images of w , ◮ of length-degree k if for every input word w , the number of distinct lengths of the images u of w in Tr ( π, q 0 ) is at most k .
Real Time Finite Transducers Equivalence checking problem is undecidable for ◮ transducers with ε -transitions (Fisher P.S., Rozenberg A.L., 1966) ◮ real time transducers (Griffiths T., 1968) ◮ transducers over one-letter alphabet (Ibarra O., 1972). Equivalence checking problem is decidable for ◮ deterministic transducers (Blattner M, Head T., 1979): PTime ◮ single-valued transducers (Schutzenberger M. P., 1977): PSpace ◮ unambiguous transducers (Gurari E., Ibarra O., 1983): PTime ◮ k -ambiguous transducers (Gurari E., Ibarra O., 1983) ◮ k -valued transducers (Culik K., Karhumaki J., 1986): Time 2 O ( n 2 ) ◮ transducers of length-degree k (Weber A., 1992): Time 2 2 2 n
Two-tape finite automata A Two-tape Finite State Automaton (2-FSA) over disjoint alphabets Σ and ∆ is a 5-tuple M = � S 1 , S 2 , s 0 , F , →� such that ◮ S 1 , S 2 is a partitioning of a finite set S of states , ◮ s 0 ∈ S 1 is an initial state , ◮ F ⊆ S is a subset of final states , and ◮ → is a transition relation of the type ( S 1 × Σ × S ) ∪ ( S 2 × ∆ × S ) . A run of 2-FSA M is any sequence of transitions z n − 1 z 1 z 2 z n → s 1 → · · · → s n − 1 − → s ′ . s A run is complete if s = s 0 and s ′ ∈ F . A 2-FSA M accepts a pair of words ( w , u ) ∈ Σ ∗ × ∆ ∗ if there is a complete run of M such that w is the projection of the word z 1 z 2 . . . z n − 1 z n on the alphabet Σ and u is the projection of the same word z 1 z 2 . . . z n − 1 z n on the alphabet ∆ .
Two-tape finite automata A transduction relation recognized by a 2-FSA M is the set TR ( M ) of all pairs of words accepted by M . 2-FSAs M ′ and M ′′ are equivalent if TR ( M ′ ) = TR ( M ′′ ) . A 2-FSA M is called deterministic (2-DFSA) if for every letter a → s ′ . a − and a state s it has at most one transition of the form s Equivalence checking problem is undecidable for 2-FSAs (Fisher P.S., Rozenberg A.L., 1966) Equivalence checking problem is decidable for ◮ 2-DFSA (Bird M., 1973; Valiant L.G., 1974) ◮ 2-DFSA in polynomial time (Friedman E.P., Greibach S.A., 1982) ◮ deterministic multi-tape automata (Harju T., Karhumaki J., 1991)
Prefix-free transducers: preliminaries A word u is a prefix of a word w if w = uv holds for some word v . In this case w is called an extension of u and v = u \ w a left quotient of u with w . Two words u 1 and u 2 are compatible if one of them is a prefix of the other. A language L is called prefix-free if all its words are pairwise incompatible. Two languages L ′ and L ′′ are compatible if every word in any of these languages is compatible with some word in the other. Given a word u and a language L , we denote by Pref ( L ) the set of all prefixes of the words in L , u \ L a left quotient { v : uv ∈ L } of u with L . Notice, that if u / ∈ Pref ( L ) then u \ L = ∅ .
Prefix-free transducers: preliminaries Proposition 1. Let L ′ and L ′′ be finite prefix-free compatible languages. � n � n Then there exists the unique partitions L ′ = i and L ′′ = L ′ L ′′ i i =1 i =1 such that for every i , 1 ≤ i ≤ n , one of the subsets L ′ i or L ′′ i is a singleton { u } and all words from the other are extensions of u . Such partitioning of a compatible pair of prefix-free languages L ′ and L ′′ will be called its splitting . The pairs of corresponding subsets L ′ i and L ′′ i , 1 ≤ i ≤ n , will be called its fractions .
Prefix-free transducers: preliminaries Proposition 1. Let L ′ and L ′′ be finite prefix-free compatible languages. � n � n Then there exists the unique partitions L ′ = i and L ′′ = L ′ L ′′ i i =1 i =1 such that for every i , 1 ≤ i ≤ n , one of the subsets L ′ i or L ′′ i is a singleton { u } and all words from the other are extensions of u . Such partitioning of a compatible pair of prefix-free languages L ′ and L ′′ will be called its splitting . The pairs of corresponding subsets L ′ i and L ′′ i , 1 ≤ i ≤ n , will be called its fractions . Example. L ′ = { aaabb , bcc , aaabab , bcaca } , L ′′ = { bca , bccaa , aaab , bccc }
Prefix-free transducers: preliminaries Proposition 1. Let L ′ and L ′′ be finite prefix-free compatible languages. � n � n Then there exists the unique partitions L ′ = i and L ′′ = L ′ L ′′ i i =1 i =1 such that for every i , 1 ≤ i ≤ n , one of the subsets L ′ i or L ′′ i is a singleton { u } and all words from the other are extensions of u . Such partitioning of a compatible pair of prefix-free languages L ′ and L ′′ will be called its splitting . The pairs of corresponding subsets L ′ i and L ′′ i , 1 ≤ i ≤ n , will be called its fractions . Example. L ′ = { aaabb , bcc , aaabab , bcaca } , L ′′ = { bca , bccaa , aaab , bccc } L ′ 1 = { aaabb , aaabab } , L ′′ 1 = { aaab } ; L ′ 2 = { bcc } , L ′′ 2 = { bccaa , bccc } ; L ′ 3 = { bcaca } , L ′′ 3 = { bca } .
Prefix-free transducers: preliminaries Given a transducer π = � Q , q , F , − →� over languages Σ and ∆ , a state q ∈ Q and a letter x ∈ Σ , we denote by x / u Out π ( q , x ) = { ( u , q ′ ) : q → q ′ } . − A transducer π is called prefix-free if for every q ∈ Q and x ∈ Σ the language L π ( q , x ) = { u : ∃ p ( u , p ) ∈ Out π ( q , x ) } is prefix-free. Prefix-free transducers have certain “deterministic” property: for every state q of a prefix-free transducer π and for every pair ( w , u ) ∈ Tr ( π, q ) there is the only run of π from the state q labeled with ( u , w ) .
Prefix-free transducers: equivalence checking ✓✏ ✬ ✩ a / hgh ✲ ✒✑ q 2 ✒ ■ a / ggh b / hg ✓✏ ✓✏ ✓✏ ✓✏ b / hhg ❄ ❘ ✒✑ ✒✑ ✒✑ ✒✑ q 1 q 4 ■ b / h a / ghg a / ghh ✓✏ ✫ ❘ ✠ ✪ ✒✑ ✛ q 3 a /ε a / g
Prefix-free transducers: equivalence checking Idea The equivalence checking technique for prefix-free transducers is based on manipulations with regular expressions. 1. We introduce for every state q of a transducer π a variable X q . 2. We associate with a transducer π a system of linear regular expression equations E ( π ) over variables X q , q ∈ Q , which specifies the behaviour of π . 3. To check the equivalence π ( q ′ ) ∼ π ( q ′′ ) we add to the set of equations E ( π ) the equivalence requirement which is an equation of the form X q ′ = X q ′′ 4. Then we verify whether the resulting system of equations has a solution.
Equivalence checking: assumptions For the sake of clarity we will assume that: ◮ the input alphabet Σ = { a 1 , . . . , a k } and Γ ∩ ∆ = ∅ ; symbols x , y , z will denote arbitrary letters from Σ , and symbols u , v , w will denote words from ∆ ∗ . ◮ π ′ = π ( q ′ ) and π ′′ = π ( q ′′ ) , ◮ the transducer π is trim , i.e. a final state is reachable from each state of π .
Recommend
More recommend