Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Tree automaton
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Bottom-up automaton accepting boolean lists=== Employing coloring to distinguish members of ''F'' and ''Q'', and using the ranked alphabet ''F''={ {{color|#800000|''false''}},{{color|#800000|''true''}},{{color|#800000|''nil''}},{{color|#800000|''cons''}}(.,.) }, with {{color|#800000|''cons''}} having arity 2 and all other symbols having arity 0, a bottom-up tree automaton accepting the set of all finite lists of boolean values can be defined as (''Q'', ''F'', ''Q''<sub>''f''</sub>, Ξ) with {{math|1=''Q'' = { {{color|#008000|''Bool''}},{{color|#008000|''BList''}} }, ''Q''<sub>''f''</sub> = { {{color|#008000|''BList''}} },}} and Ξ consisting of the rules <!-- -tabular alignment chosen intentionally - please don't change without understanding the example or without proper reason- --> :{| |- | {{color|#800000|''false''}} || β || {{color|#008000|''Bool''}}({{color|#800000|''false''}}) || (1), |- | {{color|#800000|''true''}} || β || {{color|#008000|''Bool''}}({{color|#800000|''true''}}) || (2), |- | {{color|#800000|''nil''}} || β || {{color|#008000|''BList''}}({{color|#800000|''nil''}}) || (3), and |- | {{color|#800000|''cons''}}({{color|#008000|''Bool''}}(x<sub>1</sub>),{{color|#008000|''BList''}}(x<sub>2</sub>)) || β || {{color|#008000|''BList''}}({{color|#800000|''cons''}}(x<sub>1</sub>,x<sub>2</sub>)) || (4). |} In this example, the rules can be understood intuitively as assigning to each term its type in a bottom-up manner; e.g. rule (4) can be read as "A term {{color|#800000|''cons''}}(''x''<sub>1</sub>,''x''<sub>2</sub>) has type {{color|#008000|''BList''}}, provided ''x''<sub>1</sub> and ''x''<sub>2</sub> has type {{color|#008000|''Bool''}} and {{color|#008000|''BList''}}, respectively". An accepting example run is <!-- -tabular alignment chosen intentionally - please don't change without understanding the example or without proper reason- --> :{| |- | | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''true''}}, | ALIGN=RIGHT | {{color|#800000|''nil''}} | )) |- | β | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''true''}}, | ALIGN=RIGHT | {{color|#008000|''BList''}}({{color|#800000|''nil''}}) | )) | by (3) |- | β | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#008000|''Bool''}}({{color|#800000|''true''}}), | ALIGN=RIGHT | {{color|#008000|''BList''}}({{color|#800000|''nil''}}) | )) | by (2) |- | β | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#008000|''BList''}}({{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''true''}}, | ALIGN=RIGHT | {{color|#800000|''nil''}} | ))) | by (4) |- | β | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#008000|''Bool''}}({{color|#800000|''false''}}), | ALIGN=RIGHT | {{color|#008000|''BList''}}({{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''true''}}, | ALIGN=RIGHT | {{color|#800000|''nil''}} | ))) | by (1) |- | β | ALIGN=RIGHT | {{color|#008000|''BList''}}({{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''true''}}, | ALIGN=RIGHT | {{color|#800000|''nil''}} | ))) | by (4), accepted. |} Cf. the derivation of the same term from a regular tree grammar corresponding to the automaton, shown at [[Regular tree grammar#Examples]]. A rejecting example run is <!-- -tabular alignment chosen intentionally - please don't change without understanding the example or without proper reason- --> :{| |- | | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#800000|''true''}} | ) |- | β | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#800000|''false''}}, | ALIGN=RIGHT | {{color|#008000|''Bool''}}({{color|#800000|''true''}}) | ) | by (1) |- | β | ALIGN=RIGHT | {{color|#800000|''cons''}}( | ALIGN=RIGHT | {{color|#008000|''Bool''}}({{color|#800000|''false''}}), | ALIGN=RIGHT | {{color|#008000|''Bool''}}({{color|#800000|''true''}}) | ) | by (2), no further rule applicable. |} Intuitively, this corresponds to the term {{color|#800000|''cons''}}({{color|#800000|''false''}},{{color|#800000|''true''}}) not being well-typed.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)