{"id":1171,"date":"2016-11-16T19:25:27","date_gmt":"2016-11-16T18:25:27","guid":{"rendered":"http:\/\/www.mimuw.edu.pl\/~bojan\/?page_id=1171"},"modified":"2016-12-28T15:30:33","modified_gmt":"2016-12-28T14:30:33","slug":"tree-automata-and-interpretations","status":"publish","type":"page","link":"https:\/\/www.mimuw.edu.pl\/~bojan\/20152016-2\/jezyki-automaty-i-obliczenia-2\/monadic-second-order-logic-and-courcelles-theorem\/tree-automata-and-interpretations","title":{"rendered":"Mso and automata on finite trees"},"content":{"rendered":"<p><b>Finite trees and their automata.<\/b><\/p>\n<p>Apart from graphs, we will also use mso to define properties of trees (and their special case, words). Define a\u00a0<em>ranked alphabet\u00a0<\/em>to be a finite set <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;\"\/> where every element <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c93137d159f5917ab3023aedf59219c8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#32;&#92;&#105;&#110;&#32;&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"38\" style=\"vertical-align: -1px;\"\/> has an associated arity in <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-399f9b8ded66096de747352754f474d8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#101;&#116;&#123;&#48;&#44;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"61\" style=\"vertical-align: -4px;\"\/>. Here is a picture of a ranked alphabet:<\/p>\n<p><a href=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/mso-courcelle.svg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1153\" src=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/mso-courcelle.svg\" alt=\"mso-courcelle\" width=\"377\" height=\"130\" \/><\/a><\/p>\n<p>A <em>tree over a ranked alphabet<\/em> <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;\"\/> is defined to be a (rooted) tree where every node has a label from <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;\"\/>. Furthermore, for each node the number of children is the same as the rank of the label, and we assume that these children are ordered, i.e. one can speak of the first child, second child, etc. Here is a picture of a tree over the alphabet from the example above:<\/p>\n<p><a href=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/mso-courcelle-02.svg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1156\" src=\"http:\/\/www.mimuw.edu.pl\/~bojan\/upload\/mso-courcelle-02.svg\" alt=\"mso-courcelle-02\" width=\"198\" height=\"428\" \/><\/a><\/p>\n<p>A tree <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-3374f32a602fe8fdc50593fbb0e5bde1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#116;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"6\" style=\"vertical-align: 0px;\"\/> \u00a0over an 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;\"\/> can be viewed as a logical structure, call it <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60c69d15402b779be9fc3cc7000b0a6f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#117;&#110;&#100;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#116;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: -2px;\"\/>. The universe of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60c69d15402b779be9fc3cc7000b0a6f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#117;&#110;&#100;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#116;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: -2px;\"\/> is the nodes. For every <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-677b6ccb1500d566b97e93c56bf0a51a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;&#32;&#92;&#105;&#110;&#32;&#92;&#115;&#101;&#116;&#123;&#48;&#44;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"87\" style=\"vertical-align: -4px;\"\/> there is a binary predicate <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0503d863ce65c8e88eb9802cf733b15d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#99;&#104;&#105;&#108;&#100;&#95;&#105;&#40;&#120;&#44;&#121;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"74\" style=\"vertical-align: -4px;\"\/> which says that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a9d05aadf12895a71c6d64568ec8994d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"8\" style=\"vertical-align: -3px;\"\/> is 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 child of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2780ef1cb525460253e4d12a2fa56ea2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/>, and for every <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c93137d159f5917ab3023aedf59219c8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#32;&#92;&#105;&#110;&#32;&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"38\" style=\"vertical-align: -1px;\"\/> there is a predicate <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-de97c49c7704d697b778b2dd92d2913e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#40;&#120;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"28\" style=\"vertical-align: -4px;\"\/> which says that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2780ef1cb525460253e4d12a2fa56ea2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> has label <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>. Using mso, one can define a descendant predicate: a node <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a9d05aadf12895a71c6d64568ec8994d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"8\" style=\"vertical-align: -3px;\"\/> is a descendant of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2780ef1cb525460253e4d12a2fa56ea2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> if and only if every <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a9d05aadf12895a71c6d64568ec8994d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"8\" style=\"vertical-align: -3px;\"\/> belongs to every set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-985853afefa0f9d11b09264aa12867af_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"14\" style=\"vertical-align: 0px;\"\/> that contains <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2780ef1cb525460253e4d12a2fa56ea2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> and is closed under children.<\/p>\n<p>We say that a set of trees <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> over a ranked 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;\"\/> is <em>mso definable<\/em> if there is an mso formula <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8cb1ea867e2888b522709f63bc7b588a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#118;&#97;&#114;&#112;&#104;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"10\" style=\"vertical-align: -3px;\"\/> such that <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 16px;\"><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-48fe22868256c5073336d42c208ae97c_l3.png\" height=\"16\" width=\"301\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#117;&#110;&#100;&#101;&#114;&#108;&#105;&#110;&#101;&#32;&#116;&#32;&#92;&#109;&#111;&#100;&#101;&#108;&#115;&#32;&#92;&#118;&#97;&#114;&#112;&#104;&#105;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#105;&#102;&#102;&#125;&#32;&#92;&#113;&#117;&#97;&#100;&#32;&#116;&#32;&#92;&#105;&#110;&#32;&#76;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#92;&#109;&#98;&#111;&#120;&#123;&#102;&#111;&#114;&#32;&#101;&#118;&#101;&#114;&#121;&#32;&#116;&#114;&#101;&#101;&#32;&#36;&#116;&#36;&#32;&#111;&#118;&#101;&#114;&#32;&#36;&#92;&#83;&#105;&#103;&#109;&#97;&#36;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> Examples of mso definable sets of trees include: &#8220;the number of nodes is divisible by 3&#8221; or &#8220;some root-to-leaf path has even length&#8221;.<\/p>\n<hr \/>\n<p><strong>Tree automata<\/strong><\/p>\n<p>Apart from mso, another mechanism of defining sets of trees (also known as tree languages) is to use automata. There also exist regular expressions for trees, but we do not discuss those here.<\/p>\n<p>A <em>(nondeterministic)\u00a0tree automaton\u00a0<\/em>consists of:<\/p>\n<ul>\n<li>an <em>input alphabet<\/em> <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;\"\/>, which is a ranked alphabet<\/li>\n<li>a finite set of <em>states<\/em> <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 accepting subset <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-dea6cf2e5e55791b81849aed68f104f0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#70;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"45\" style=\"vertical-align: -3px;\"\/><\/li>\n<li>for every letter <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c93137d159f5917ab3023aedf59219c8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#32;&#92;&#105;&#110;&#32;&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"38\" style=\"vertical-align: -1px;\"\/> of rank <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1581bd603826320b358d867162d09127_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/>, a <em>transition\u00a0relation<\/em> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-47bdb74f6088d3436fdd563912f52c27_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#97;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#81;&#94;&#110;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"86\" style=\"vertical-align: -3px;\"\/>.<\/li>\n<\/ul>\n<p>An automaton is called <em>deterministic<\/em> if every transition relation is actually a function <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-69e5688288593ebd35f80cd7832260a7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#81;&#94;&#110;&#32;&#92;&#116;&#111;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"57\" style=\"vertical-align: -3px;\"\/>. A run of the automaton over an input tree <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-3374f32a602fe8fdc50593fbb0e5bde1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#116;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"6\" style=\"vertical-align: 0px;\"\/> is a labelling of tree nodes by states which is consistent with the transition relation in the following sense: if a node <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2780ef1cb525460253e4d12a2fa56ea2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> has label <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> and its children have states <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c44b04a440fee530c542d31faa0e0a67_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#113;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#113;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"62\" style=\"vertical-align: -3px;\"\/> then the state in node <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2780ef1cb525460253e4d12a2fa56ea2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> satisfies <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 16px;\"><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-9d19e4058e30f43f59cdf3666c9f935f_l3.png\" height=\"16\" width=\"125\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#32;&#40;&#113;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#113;&#95;&#110;&#44;&#113;&#41;&#32;&#92;&#105;&#110;&#32;&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#97;&#46;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> Note that that this definition covers the special case of leaves; if a leaf has label <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> then the transition relation <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8401627d62be64bb5ff9db385b4e90d1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#100;&#101;&#108;&#116;&#97;&#95;&#97;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#81;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"47\" style=\"vertical-align: -3px;\"\/> indicates what are the states allowed in leaves with state <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>. Therefore, the transition relations for labels of rank zero can be viewed as initial states in the automaton. A tree is <em>accepted<\/em> by the automaton if there is some run which has an accepting state in the root. Therefore, one can view the run of the automaton as a bottom-up pass through the tree, which is considered accepting if the last state (the root) has an accepting state. That is why the\u00a0automaton model described above is sometimes called a\u00a0<em>bottom-up automaton;<\/em>\u00a0although the distinction between top-down or bottom-up makes most sense\u00a0when talking about deterministic automata.<\/p>\n<p>The same proof as for automata on words, i.e. the subset construction, shows that tree automata can be determinised. The proof of the following theorem is skipped, it is a straightforward induction on the size of an mso formula. The\u00a0proof uses the fact that tree automata have all the closure properties that correspond to operators in mso formulas, such as Boolean combinations and projections (guessing).<\/p>\n<p><strong>Theorem<\/strong>. If a tree language <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-03219660efcf9fac380a5a44bdcdac15_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#92;&#109;&#97;&#116;&#104;&#115;&#102;&#123;&#116;&#114;&#101;&#101;&#115;&#125;&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"73\" style=\"vertical-align: -2px;\"\/> is definable in mso, then it is recognised by some tree automaton.<\/p>\n<p>The converse of the above theorem is also true, i.e. every language definable by a tree automaton can be defined in mso.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finite trees and their automata. Apart from graphs, we will also use mso to define properties of trees (and their special case, words). Define a\u00a0ranked alphabet\u00a0to be a finite set where every element has an associated arity in . Here is a picture of a ranked alphabet: A tree over a ranked alphabet is defined [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1140,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-1171","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/1171"}],"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=1171"}],"version-history":[{"count":5,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/1171\/revisions"}],"predecessor-version":[{"id":1210,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/1171\/revisions\/1210"}],"up":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/1140"}],"wp:attachment":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/media?parent=1171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}