{"id":817,"date":"2015-12-15T11:51:59","date_gmt":"2015-12-15T10:51:59","guid":{"rendered":"http:\/\/www.mimuw.edu.pl\/~bojan\/?page_id=817"},"modified":"2016-12-29T16:24:25","modified_gmt":"2016-12-29T15:24:25","slug":"two-way-transducers","status":"publish","type":"page","link":"https:\/\/www.mimuw.edu.pl\/~bojan\/20152016-2\/jezyki-automaty-i-obliczenia-2\/6-transducers\/two-way-transducers","title":{"rendered":"Two-way transducers"},"content":{"rendered":"<p><b>Two-way transducers<\/b><\/p>\n<p>A <em>deterministic two-way transducer<\/em> consists of:<br \/>\n\u2022 an input alphabet <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-aeb6fee794feaade92eebde4e9865fd9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>;<br \/>\n\u2022 an output alphabet <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6a76799f4c1833cdbda79a51e7a1783f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#71;&#97;&#109;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -1px;\"\/>;<br \/>\n\u2022 a set of states <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> with a distinguished initial state and final state;<br \/>\n\u2022 a transition function<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 17px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-55a7417d91a6cadbc58e693d425fbc71_l3.png\" height=\"17\" width=\"290\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#58;&#32;&#81;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#40;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#99;&#117;&#112;&#32;&#92;&#115;&#101;&#116;&#123;&#92;&#118;&#100;&#97;&#115;&#104;&#44;&#92;&#100;&#97;&#115;&#104;&#118;&#125;&#41;&#32;&#92;&#116;&#111;&#32;&#81;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#115;&#101;&#116;&#123;&#45;&#49;&#44;&#48;&#44;&#49;&#125;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#71;&#97;&#109;&#109;&#97;&#94;&#42;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>The semantics of the transducer\u00a0are defined similarly to Turing machines, as follows. (Actually, the model is equivalent to a Turing machine where there is one read-only input tape and one write-once output tape.) If the input word is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-e28aacf97ca23d2be338aa4a40157c90_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#95;&#49;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"53\" style=\"vertical-align: -3px;\"\/>, the we embellish it with start and end markers as follows: <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 14px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d1eda52fd76ad9f749604681c70a6ebf_l3.png\" height=\"14\" width=\"81\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#118;&#100;&#97;&#115;&#104;&#32;&#97;&#95;&#49;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#97;&#95;&#110;&#32;&#92;&#100;&#97;&#115;&#104;&#118;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> The head of the automaton is then placed over the start marker <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d9fbdbb5015818b442594bb18c9acfaf_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#118;&#100;&#97;&#115;&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"8\" style=\"vertical-align: 0px;\"\/> with the initial state. (For two-way automata, the head is over a letter, as opposed to one-way automata, where the head is between letters.) At any given moment, the automaton applies its transition function to its current state and the symbol under the head, yielding a new state, a direction to move the head, and some output letters that to be appended to the output. The output letters are used in chronological order, i.e. those which are output at the beginning of the run are at the beginning of the output, regardless of the position of the head when executing the transition. The run of the automaton might fail, either by moving out of the word (i.e. doing a <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bf525c2f472713447a09ad0f51cb5348_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#45;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"18\" style=\"vertical-align: -1px;\"\/> move on the start marker <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d9fbdbb5015818b442594bb18c9acfaf_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#118;&#100;&#97;&#115;&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"8\" style=\"vertical-align: 0px;\"\/>, or doing a <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2807c0cf30a938b52105c42c9e2dd2db_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: -1px;\"\/> move on the end marker <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-19ea320cd660355415292de99c96acce_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#100;&#97;&#115;&#104;&#118;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/>), or by\u00a0entering an infinite loop; such failing runs do not produce any output, and therefore the semantics of the automaton is a partial function from <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-dd9e926acd5eebf940a5272c41665efa_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#83;&#105;&#103;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"17\" style=\"vertical-align: 0px;\"\/> to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6b34c29bc1760fef871b13181b0520be_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#71;&#97;&#109;&#109;&#97;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"16\" style=\"vertical-align: -1px;\"\/>.<\/p>\n<p>The run of the automaton ends when the final state is reached. If the final state is never reached, or if the automaton moves out of the input tape (by crossing a marker <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d9fbdbb5015818b442594bb18c9acfaf_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#118;&#100;&#97;&#115;&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"8\" style=\"vertical-align: 0px;\"\/> or <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-19ea320cd660355415292de99c96acce_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#100;&#97;&#115;&#104;&#118;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> in the wrong direction), then the automaton produces no input, i.e. its value is undefined. Therefore, the semantics of the machine is a partial function.<\/p>\n<p>Typical things that can be done using a two-way transducer are duplication or reversing the input.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Past oracle<\/b><\/p>\n<p>A <em>two-way automaton with<\/em>\u00a0<em>a past oracle\u00a0<\/em>is defined the same way as above, with the following difference. There is an additional DFA, which is called the\u00a0<em>past oracle.\u00a0<\/em>If the states of the past oracle are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4ea9c849f1f3ffe3aee17ed595d147c0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/>, then the transition function of the two-way automaton which uses this past oracle is of the form\u00a0<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 17px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7a9af6077df413770d09563adbae9fc2_l3.png\" height=\"17\" width=\"321\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#100;&#101;&#108;&#116;&#97;&#32;&#58;&#32;&#81;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#80;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#40;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#99;&#117;&#112;&#32;&#92;&#115;&#101;&#116;&#123;&#92;&#118;&#100;&#97;&#115;&#104;&#44;&#92;&#100;&#97;&#115;&#104;&#118;&#125;&#41;&#32;&#92;&#116;&#111;&#32;&#81;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#115;&#101;&#116;&#123;&#45;&#49;&#44;&#48;&#44;&#49;&#125;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#92;&#71;&#97;&#109;&#109;&#97;&#94;&#42;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>The following theorem shows that past oracles can be eliminated.\u00a0Other features that can also be eliminated are nondeterminism and future oracles.<\/p>\n<p><strong>Theorem.\u00a0<\/strong><em>For every two-way automaton with a past oracle, there is a two-way automaton (without any oracle), which defines the same partial function from words to words.<\/em><\/p>\n<p><strong>Proof. <\/strong>The idea for this proof comes from Hopcroft and Ullman.\u00a0Suppose that we have a two-way automaton with a past oracle, such that the states of the two-way automaton are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-bed8547872890507f19a89d0b85aac65_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"12\" style=\"vertical-align: -3px;\"\/> and the states of the past oracle are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4ea9c849f1f3ffe3aee17ed595d147c0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/>. The general idea for the simulation is straightforward: the simulating automaton knows both the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0991b5d6a91d915d474e3f0a453be8ab_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#32;&#92;&#105;&#110;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"39\" style=\"vertical-align: -3px;\"\/> of the two-way automaton and the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-00f61e7c182e930c3c4ec11e80bc5876_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#32;&#92;&#105;&#110;&#32;&#80;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"40\" style=\"vertical-align: -3px;\"\/> of the oracle. The question is how to maintain this information.<\/p>\n<p>The key insight is to consider the graph which describes the states of the past oracle and how they are updated by the transition function of the past oracle. This graph looks likes this:<\/p>\n<p><a href=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/past-oracle1.svg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-849\" src=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/past-oracle1.svg\" alt=\"past oracle\" \/><\/a><\/p>\n<p>The vertices of the graph are configurations of the past oracle, i.e. pairs (state of the past oracle, column\u00a0between positions in the word), and the edges correspond to transitions of the automaton. We number the columns beginning with 1. Because the past oracle is a deterministic automaton, the graph is a forest.<\/p>\n<p>Let us define <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-dc2b571e1b0b1777ecb47b56b498b626_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"13\" style=\"vertical-align: -3px;\"\/> to be the state of the past oracle when in the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-94b2245f3ac0472586363dd0fde68eb5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"5\" style=\"vertical-align: 0px;\"\/>-th column, i.e. after reading the first <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-20678c7ca426a344e3bdd948bd4e033c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;&#45;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"31\" style=\"vertical-align: -1px;\"\/> letters of the input word. The two-way automaton which uses the past oracle uses the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-56df17540a38fd3208b61127f8cc745f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#123;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"13\" style=\"vertical-align: -3px;\"\/> to make its decision when its head is over the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-94b2245f3ac0472586363dd0fde68eb5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"5\" style=\"vertical-align: 0px;\"\/>-the position. Suppose that the head of the two-way automaton is over some position <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-94b2245f3ac0472586363dd0fde68eb5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"5\" style=\"vertical-align: 0px;\"\/> in the input word, and the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-56df17540a38fd3208b61127f8cc745f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#123;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"13\" style=\"vertical-align: -3px;\"\/> of the oracle is known, as indicated by a red circle in the following picture:<\/p>\n<p><a href=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/two-way-conf.svg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-845\" src=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/two-way-conf.svg\" alt=\"two-way-conf\" \/><\/a><\/p>\n<p>We want to show that the state of the oracle can be maintained when doing one transition of the two-way automaton. If the transition of the two-way automaton does not move the head, there is no problem. If the transition of the two-way automaton moves the head to the right, there is also no problem, since the transition function of the past oracle can be simply applied.<\/p>\n<p>The issue is when the two-way automaton wants to move the head to the left, and we need to compute the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-dcc80f87048b7e33ce746024bd8a282e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#123;&#105;&#45;&#49;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"28\" style=\"vertical-align: -3px;\"\/>. Here is the solution. In terms of the forest in the pictures above, the state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-56df17540a38fd3208b61127f8cc745f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#112;&#95;&#123;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"13\" style=\"vertical-align: -3px;\"\/> corresponds to the configuration <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-dedfe58bbfd9e5292c0671c0796292bb_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#112;&#95;&#123;&#105;&#125;&#44;&#105;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"35\" style=\"vertical-align: -4px;\"\/> in the forest. We are going to inspect\u00a0the\u00a0subtree of this configuration, which contains the initial configuration <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-09da8ea1e6242ea1a80d18d0bcb28644_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#112;&#95;&#49;&#44;&#49;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"40\" style=\"vertical-align: -4px;\"\/>, and therefore goes all the way to the left side of the input.<\/p>\n<p>We start by moving the head one step to the left, which identifies all possible candidates for the predecessor configurations. Here is the picture, with the candidates being coloured yellow:<\/p>\n<p><a href=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/grow-collapse1.svg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-852\" src=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/grow-collapse1.svg\" alt=\"grow-collapse\" \/><\/a><\/p>\n<p>If there is only one yellow configuration, i.e. only one candidate for the predecessor, then we are done. The more interesting case is when there is more than one yellow configuration. In this case, we keep moving to the left, and colour all descendants of the yellow configuration\u00a0(and therefore of the red configuration as well) using a green colour.<\/p>\n<p>Two things may happen. In one case, we might reach a moment when all green configurations are descendants of a unique yellow configuration, as in this picture:<a href=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/unique-predecessor1.svg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-854\" src=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/unique-predecessor1.svg\" alt=\"unique predecessor\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>In this case, the unique yellow configuration is the one that we want to compute. The question is how to return to this unique configuration? The solution is this: since we have stopped in the first column when the yellow configuration was uniquely identified, in the previous column there were at least two candidates for the yellow configurations. Therefore, if we remember the previous column, we can start moving to the right until the first time that the whole subtree reaches a single node, this way we will reach the red configuration again. But in our state we can keep the yellow configuration that was the actual predecessor.<\/p>\n<p>The remaining case is when we reach the first column at the beginning of the input. Here we do the same trick to return to the red configuration, and we can keep in our state which branch of the subtree corresponds to the computation of the past oracle. <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b06cee67d5b1a769f0a344ace98d5692_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#66;&#111;&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two-way transducers A deterministic two-way transducer consists of: \u2022 an input alphabet ; \u2022 an output alphabet ; \u2022 a set of states with a distinguished initial state and final state; \u2022 a transition function &nbsp; &nbsp; The semantics of the transducer\u00a0are defined similarly to Turing machines, as follows. (Actually, the model is equivalent to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":789,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-817","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/817"}],"collection":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/comments?post=817"}],"version-history":[{"count":19,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/817\/revisions"}],"predecessor-version":[{"id":1397,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/817\/revisions\/1397"}],"up":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/789"}],"wp:attachment":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/media?parent=817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}