Tree Normal Form: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
(Add table of TNF sizes.)
(Prepare Category move of BB-domains)
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''Tree Normal Form (TNF)''' is the unique standard [[Turing machine]] transition table representation for a class of functionally equivalent TMs (for the purposes of the Busy Beaver problem). TNF is also often used to to describe the process first described by Allen Brady which enumerates all TMs in TNF.
'''Tree Normal Form (TNF)''' is the unique standard [[Turing machine]] transition table representation for a class of functionally equivalent TMs (for the purposes of the Busy Beaver problem). TNF is also often used to describe the process for enumerating all TMs in Tree Normal Form. This process was first introduced by Allen Brady in his 1964 PhD dissertation<ref>Allen Brady. 1964. PhD dissertation. "[https://ir.library.oregonstate.edu/concern/graduate_thesis_or_dissertations/zk51vk21c Solutions of restricted cases of the halting problem applied to the determination of particular values of a non-computable function]"</ref> and thus it has been called '''Brady's algorithm'''.


== Background ==
== Background ==
Line 24: Line 24:
** One option for transition is always the single halting transition <code>1RZ</code>.
** One option for transition is always the single halting transition <code>1RZ</code>.
** If there is at least one more undefined transition (besides this one being filled in now) then we also allow all combinations of transitions with the following restrictions:
** If there is at least one more undefined transition (besides this one being filled in now) then we also allow all combinations of transitions with the following restrictions:
*** The first direction must be Right,
*** The next state may be any previously visited state or the next unvisited state.
*** The next state may be any previously visited state or the next unvisited one,
*** The write symbol may be any previously used symbol or the next unused symbol.
*** The write symbol may be any previously used symbol or the next unused one.
*** If we are expanding the first transition of the machine, the direction must be Right.
*Repeat this on every leaf node (which contains at least one undefined transition).  
*Repeat this on every leaf node (which contains at least one undefined transition).  
This enumeration is complete if every leaf node is either a halting TM or an infinite TM that never reaches it's undefined transitions. Unfortunately, there is no programatic way to ensure you are done because that would involve solving the halting problem. Instead it is often helpful to think of TNF enumeration as an iterated process in which the tree is expanded as much as possible early on, but then iteratively refined over time as new leafs are proven to reach undefined transitions.
This enumeration is complete if every leaf node is either a halting TM or an infinite TM that never reaches its undefined transitions. Unfortunately, there is no programmatic way to ensure you are done because that would require solving the halting problem. Instead it is often helpful to think of TNF enumeration as an iterated process in which the tree is expanded as much as possible early on, but then iteratively refined over time as new leafs are proven to reach undefined transitions.


== TNF-1RB ==
== TNF-1RB ==
One common additional restriction is that the initial transition is <code>A0→1RB</code>. This is mainly done to exclude <code>A0→0RB</code> TMs. For any TM starting from <code>A0→0RB</code>, the TM starts in state B will have the same exact sigma score and run for exactly one step longer. Many early enumerations used this restriction because they were specifically searching for Σ. It can also be used when searching for the step champion, but requires some post-processing to check for any state permutations that might lead to a few more steps.
One common additional restriction is that the initial transition is <code>A0→1RB</code>. This is mainly done to exclude <code>A0→0RB</code> TMs. For any TM starting from <code>A0→0RB</code>, the TM that starts in state B instead will have the same exact Σ score and run for exactly one step less. By iterating this process at most <math>n - 1</math> times, any <math>n</math>-state <code>A0→0RB</code> machine can be transformed into a corresponding <code>A0→1RB</code> machine with the same Σ score and (at most) <math>n-1</math> shorter runtime.
 
Many early enumerations chose to use the <code>A0→1RB</code> restriction because they were specifically searching for Σ. It can also be used when searching for the step champion, but requires some post-processing to check the near-champions for any state permutations that might lead to a few more steps.


== Number of TNF TMs ==
== Number of TNF TMs ==
The table below lists known TM counts for TNF, TNF-1RB alongside total counts of all TMs in each 2-symbol [[:Category:BB Domains|domain]].
* # Total TMs is the function <math>N(n,m) = (2m(n+1))^{mn}</math> of all TMs with every combination of halting transition.
* # Simple Halt TMs is a slight simplification where the only allowed halt transition is <code>1RZ</code>. There are <math>(2mn + 1)^{mn}</math> Simple Halt TMs.
{| class="wikitable" style="text-align: right;"
{| class="wikitable" style="text-align: right;"
|+
|+TNF TM counts vs Total TM counts
!
!
!Total TMs
!# Total TMs ([[oeis:A052200|OEIS A052200]])
!TNF TMs
!# Simple Halt TMs
!TNF-1RB TMs
!# TNF TMs
!# TNF-1RB TMs
|-
|-
|[[BB(2)]]
|[[BB(2)]]
|20,736
|20,736
|
|6,561
|61
|41
|41
|-
|-
|[[BB(3)]]
|[[BB(3)]]
|16,777,216
|16,777,216
|
|4,826,809
|5,417
|4,057
|4,057
|-
|-
|[[BB(4)]]
|[[BB(4)]]
|25,600,000,000
|25,600,000,000
|
|6,975,757,441
|858,909
|620,261
|620,261
|-
|-
|[[BB(5)]]
|[[BB(5)]]
|63,403,380,965,376
|63,403,380,965,376
|
|16,679,880,978,201
|181,385,789
|126,891,605
|126,891,605
|-
|-
|[[BB(6)]]
|[[BB(6)]]
|232,218,265,089,212,416
|232,218,265,089,212,416
|59,604,644,775,390,625
|
|
|~33,436,000,000
|~33,436,000,000
|}
|}
== See Also ==
* Something Something Programming, "[https://nickdrozd.github.io/2022/01/14/bradys-algorithm.html Brady's Algorithm for Program Generation]" (2022).
== References ==
<references />

Latest revision as of 23:40, 10 August 2025

Tree Normal Form (TNF) is the unique standard Turing machine transition table representation for a class of functionally equivalent TMs (for the purposes of the Busy Beaver problem). TNF is also often used to describe the process for enumerating all TMs in Tree Normal Form. This process was first introduced by Allen Brady in his 1964 PhD dissertation[1] and thus it has been called Brady's algorithm.

Background

Radó's original definition of a Busy Beaver TM allows any choice of (write symbol, move direction, next state) for every (current state, read symbol) combination. For n-states, m-symbols that leads to distinct TMs (Note: there are next states for the n run states and 1 halt state). But for the purposes of searching for Busy Beavers, these contain a lot of redundant TMs. Some notable redundancies are:

  1. Permutations: Any permutation of non-start states, non-blank symbols or directions leads to a functionally equivalent TM.
  2. Unused transitions: If the TM (when started on a blank tape) does not actually use all transitions, then the behavior of this TM is identical for all choices of those transitions.
  3. Halting transitions: Any of the 2m choices for halting transitions lead to the same runtime (and any of lead to same sigma score).
  4. Number of halting transitions: Any TM without any halting transitions can (obviously) never halt, so they can be ignored for the purposes of solving the Busy Beaver problem.

In order to (significantly) reduce the search space, TNF requires that the TM satisfy the following:

  1. Canonical permutation: All states (and symbols) are used in order when run on a blank tape. The first move direction is Right.
  2. Undefined transitions: All unused transitions are marked as blank/undefined ---.
  3. Unique halting transition: All halting transitions are of the form 1RZ.
  4. Require halting transition: TMs must have at least one undefined (---) or halting (1RZ) transition.

TNF Enumeration

TNF enumeration is a process for enumerating all TMs in TNF by recursively expanding a "family tree" of machines:

  • Start with a completely undefined TM of the desired size, this is the root node. Ex ------_------ for BB(2).
  • For each unexplored node, run that TM on a blank tape until it reaches an undefined transition (or you give up searching).
  • If you reach an undefined transition, then create children nodes from this node for all choices of transitions.
    • One option for transition is always the single halting transition 1RZ.
    • If there is at least one more undefined transition (besides this one being filled in now) then we also allow all combinations of transitions with the following restrictions:
      • The next state may be any previously visited state or the next unvisited state.
      • The write symbol may be any previously used symbol or the next unused symbol.
      • If we are expanding the first transition of the machine, the direction must be Right.
  • Repeat this on every leaf node (which contains at least one undefined transition).

This enumeration is complete if every leaf node is either a halting TM or an infinite TM that never reaches its undefined transitions. Unfortunately, there is no programmatic way to ensure you are done because that would require solving the halting problem. Instead it is often helpful to think of TNF enumeration as an iterated process in which the tree is expanded as much as possible early on, but then iteratively refined over time as new leafs are proven to reach undefined transitions.

TNF-1RB

One common additional restriction is that the initial transition is A0→1RB. This is mainly done to exclude A0→0RB TMs. For any TM starting from A0→0RB, the TM that starts in state B instead will have the same exact Σ score and run for exactly one step less. By iterating this process at most times, any -state A0→0RB machine can be transformed into a corresponding A0→1RB machine with the same Σ score and (at most) shorter runtime.

Many early enumerations chose to use the A0→1RB restriction because they were specifically searching for Σ. It can also be used when searching for the step champion, but requires some post-processing to check the near-champions for any state permutations that might lead to a few more steps.

Number of TNF TMs

The table below lists known TM counts for TNF, TNF-1RB alongside total counts of all TMs in each 2-symbol domain.

  • # Total TMs is the function of all TMs with every combination of halting transition.
  • # Simple Halt TMs is a slight simplification where the only allowed halt transition is 1RZ. There are Simple Halt TMs.
TNF TM counts vs Total TM counts
# Total TMs (OEIS A052200) # Simple Halt TMs # TNF TMs # TNF-1RB TMs
BB(2) 20,736 6,561 61 41
BB(3) 16,777,216 4,826,809 5,417 4,057
BB(4) 25,600,000,000 6,975,757,441 858,909 620,261
BB(5) 63,403,380,965,376 16,679,880,978,201 181,385,789 126,891,605
BB(6) 232,218,265,089,212,416 59,604,644,775,390,625 ~33,436,000,000

See Also

References