Slides from seminar at RMIT, November, 2009

advertisement

Proving Termination and

Non-Termination of Busy Beaver Machines

Using an otter to catch a beaver to chase a

James Harland james.harland@rmit.edu.au

platypus

Otter -> Beaver -> Platypus 20 th November, 2009

What?

Turing Machines of a particular type:

 Deterministic

 Symbols are only 0 (blank) and 1 (initially)

 Only consider blank input

 n states plus a halt state means size is n

11R a

01R b

10R c

00L 01L

11R h

Otter -> Beaver -> Platypus 20 th November, 2009

What?

What is the largest number of 1’s that can be printed by a terminating n-state machine?

n #1’s (productivity) #steps

1 1 1

2 4

3 6

6

21

4 13

5 ≥ 4098

6 ≥ 4.64

× 10 1439

107

≥ 47,176,870 (??)

≥ 2.58

× 10 2879 (!!)

Otter -> Beaver -> Platypus 20 th November, 2009

What? n

5

2

2

3

2

4

2

3

3

2

6

4 m

2

5

4

3

3

2

2

2

4

6

2

3

Otter -> Beaver -> Platypus

#1’s

4

6

9

13

2,050

374,676,383

≥ 4098

≥ 1.7 × 10 352

≥ 4.64 × 10 1439

≥ 1.383 × 10 7036

≥ 3.743 × 10 6518

≥ 1.903 × 10 4933

#steps

6

21

38

107

3,932,964

119,112,334,170,342,540

≥ 47,176,870

≥ 1.9 × 10 704

≥ 2.58 × 10 2879

≥ 1.025 × 10 14072

≥ 5.254 × 10 13036

≥ 2.415 × 10 9866

20 th November, 2009

What?

 Busy Beaver function is non-computable; it grows faster than any computable function (!!)

 Various mathematical bounds known

 All surpassed in practice

 Seems hopeless for n ≥ 7

 Values for n ≤ 5 seem settled (but as yet unproven)

Otter -> Beaver -> Platypus 20 th November, 2009

Why?

 Some enormous numbers here!

 `… the poetry of logical ideas’ (Einstein)

 Evidence for results is somewhat lacking

(“The remaining 250+ cases were checked by hand”)

 Should have test data and evidence available

 Should be able to automate entire test

`Nothing capable of proof should be accepted as true without it’ (Frege)

`Nothing capable of automation should be accepted as finished without it’

Otter -> Beaver -> Platypus 20 th November, 2009

Why?

An n-state (2-symbol) machine of productivity k shows that

 bb(n,2) ≥ k

 at most n states are needed to print k 1’s

What is the minimum number of states (for an n-state 2symbol machine) needed to print k 1’s?

We call this the placid platypus problem [ pp(k) ]

Otter -> Beaver -> Platypus 20 th November, 2009

Why?

bb(n,2) = k means that pp(k) ≤ n and pp(k+1) n+1 pp(2) = pp(3) = pp(4) = 2 pp(5) = pp(6) = 3 pp(k) = 4 for k є {7,8,9,10,11,12,13} pp(k) ≥ 5 for k ≥ 14

…???

There seem to be no 5-state 2-symbol machines with productivity 74, 85, 92-7, 100-110, 113, 114, 115, …

Need complete classification to be sure

Otter -> Beaver -> Platypus 20 th November, 2009

How?

Easy! :-) To find bb(n,m):

1.

Generate all n -state m -symbol machines

2.

Classifying them as terminating or non-terminating

3.

Find the terminating one which produces the largest number of 1’s (or non-zero characters)

Only problem is that there are lots of traps …

Otter -> Beaver -> Platypus 20 th November, 2009

How?

There is a finite but very large set of machines for each size …

Number of machines of size n is O(n n ) [ > O(n!) > O(2 n ) !!]

`Free’ generation of machines quickly becomes impractical

`Free’ generation creates too many trivial machines

11R a

01R

00L, 10R b

Otter -> Beaver -> Platypus

01R c

10R h

20 th November, 2009

How?

First transition is fixed

Run partial machine

Add a new transition when a `missing’ case happens

Add `halt’ transition last

01R 10R

11L a b c

00L

{a} 0 -> 1 {b} 0 -> {a} 1 -> {a} 01 -> 1 {b} 1 -> 10 {c} 0

Generates machines in tree normal form (tnf) h

Otter -> Beaver -> Platypus 20 th November, 2009

How Many?

n m tnf free

2 2 32

3 2 3,288

2 3 2,280

4 2 527,952

2 4 447,664

3 3 24,711,336

5 2 110,537,360 ??

2 5 176,293,040 ??

128

82,944

82,944

100,663,296

100,663,296

??

Otter -> Beaver -> Platypus 20 th November, 2009

How?

Some non-termination cases are easy perennial pigeon: repeats a particular configuration phlegmatic phoenix: tape returns to blank road runner: “straight to the end of the tape” meandering meerkat: terminal transition cannot be reached

Hence we check for these first

Otter -> Beaver -> Platypus 20 th November, 2009

How?

Otherwise .. (ie all the easy cases have been checked):

Run the machine for a given number of steps

If it halts, done.

Examine the execution trace for non-termination conjectures

Attempt to show that the hypothesis pattern repeats infinitely

Execute machine for a large number of steps

Give up!

Otter -> Beaver -> Platypus 20 th November, 2009

How?

11{C}1 → 11{C}111 → 11{C}11111 …

Conjecture 11{C} 1 (11) N → 11{C} 1(11) N+1

Start engine in 11{C} 1 (11) N

Terminate with success if we reach 11{C} 1 (11) N+1

(or 11{C} 1 (11) N+2 or …)

Halt with failure after a certain number of steps

Main trick is how to deal with (11) N case where N is a variable

Otter -> Beaver -> Platypus 20 th November, 2009

Observant Otter

Some surprises can be in store ....

1 6 {D}0 → 1 18 {D}0 → 1 42 {D}0 (!!!) → 1 90 {D}0

1 30 {D}0 does not occur …

(this is why two previous instances are needed)

Conjecture in this case is 1 N {D}0 → 1 2N+6 {D}0 or alternatively

1 N {D}0 → (11) N 111111{D}0

These are known as killer kangaroos ...

Otter -> Beaver -> Platypus 20 th November, 2009

How?

Three main cases:

1) Wild Wombat

2) Stretching Stork

3) Observant Otter

4) (soon also the Ossified Ocelet) slithering snake resilient reptile maniacal monkey

Otter -> Beaver -> Platypus 20 th November, 2009

Wild Wombat

X {S} I N Y → ?? {S} I → J {S}

Pointer remains within I

First exits I to the right

State on exit is S

``Context-free''

X {S} I N Y → X J N {S} Y X I N {S} Y → X {S} J N Y

11 {C} (11) N 011 → 11 (00) N {C} 011 if

{C}11 → 0{D}1 → {B}01 → 0{B}1 → 00 {C}

Otter -> Beaver -> Platypus 20 th November, 2009

Stretching Stork

X {S} I N Y → ??

If the wombat doesn't apply and N > 0

X {S} I N Y → X {S} I I N-1 Y

Condition N > 0 required to stop this being infinitely applicable

11 {C} (11) N 011 → 11 {C} 11 (11) N-1 011

Otter -> Beaver -> Platypus 20 th November, 2009

Observant Otter

11 {C} (11) N 01 → … →

111 {C} 1(11) N-1 01 → … →

1111 {C} 1(11) N-2 01 → … →

Oi! There is a pattern here!

11 (1) N {C} 01 → …

Otter -> Beaver -> Platypus 20 th November, 2009

Observant Otter

X {S} I N Y → ??

 Looks through execution history to find a similar pattern

 Requires two previous instances before a match is made

 Currently only allows decrement of 1 

 Calculates new state from patterns

 Ossified Ocelet will store these patterns for potential future use

 This technique used by Wood in 2008 to evaluate monsters ...

Otter -> Beaver -> Platypus 20 th November, 2009

Observant Otter

1111{C}11

1011{C}111

110{C}1111

111111{C}11

101111{C}111

11011{C}1111

1110{C}11111

11111111{C}11

Sometimes this is not as simple as it may seem …

Otter -> Beaver -> Platypus 20 th November, 2009

Implementation

 Around 8,000 lines of Ciao Prolog

 Needs a thorough clean up; necessary code is around

40% of this size

 Versions available at my website

 Data available as well

 Documentation is a little lacking …

 Intention is that other researchers can use data and verify results (this is empirical science!)

Otter -> Beaver -> Platypus 20 th November, 2009

Blue Bilby n -state m -symbol machines, n x m ≤ 6 tnf n

2

3

2 m

2

2

3

Total

32

3,288

2,280

Terminated Going

8 24

831

616

2,457

1,664 free n

2

3

2 m

2

2

3

Total

128

Terminated Going

35

82,944 22,034

93

60,910

82,944 18,613 64,331

Otter -> Beaver -> Platypus 20 th November, 2009

Unclassified

0

0

0

Unclassified

0

0

0

Ebony Elephant n -state m -symbol machines, n x m = 8 n

4

2 m Total

2 527,952

4 447,664

Terminated Going

118,348 408,876

Unclassified

728

??

??

??

1's 1

#

2 3 4 5 6

3836 23161 37995 31023 15131 5263

7 8 9 10 11 12 13

1487 357 74 11 5 3 2

Otter -> Beaver -> Platypus 20 th November, 2009

White Whale n -state m -symbol machines, n x m = 9 or 10 n m Total

3 3 24,711,336

5 2 110,537,360

2 5 176,293,040 (??)

Need to improve the technology before taking this on ...

Otter -> Beaver -> Platypus 20 th November, 2009

Demon Duck of Doom n m Total

6 2 ??

4 3 ??

3 4 ??

2 6 ??

Otter -> Beaver -> Platypus 20 th November, 2009

Universal Turing machines

 Quest for the smallest universal TM goes on …

 Involves searching similar spaces

Alain Colmerauer (KR’08 talk)

 U on code(M)code(w) simulates M on w

 Let M = U

 U on code(U)code(w) simulates U on w

 Let w = blank (and assume code(blank) = blank)

 U on code(U) simulates U on blank

Hence pseudo-universality test : M is pseudo-universal if

M on code(M) simulates M on blank

Otter -> Beaver -> Platypus 20 th November, 2009

2-D machines

Otter -> Beaver -> Platypus

0

1

1

2

0

20 th November, 2009

2-D machines

 Can interpret numbers as images …

 Have generated some of the smaller cases here

 Very basic implementation of emulation

 Potentially very interesting loop behaviour here

 Strict generalisation of one-dimensional case

 No existing work that I have been able to find …

Otter -> Beaver -> Platypus 20 th November, 2009

Learning?

Ebony Elephant case suggests that `most' machines are boring …

Only 2,667 are either high productivity or unclassified

At most 100,000 of the non-terminators are difficult

The remaining 80% are unexceptional …

Can we find a criterion to identify (at least a substantial fraction) of the unexceptional machines?

Need to identify possible features of machines ...

Otter -> Beaver -> Platypus 20 th November, 2009

Conclusions & Further Work

Otter still needs some refinements

 needs to `dovetail’ with the rest of the engine

 some small number of machines resistant to otter (so far)

 Some parameters (eg maximum search steps) need to be tweaked

Connections to universal Turing machines and 2-D machines need investigation

New (journal) paper will be out `soon’ 

Otter -> Beaver -> Platypus 20 th November, 2009

Conclusions & Further Work

Ebony elephant is close to capture

White whale should be alert and alarmed (``Call me

Ishmael’’  )

Demon Duck of Doom should be alert but not alarmed yet

Machine learning techniques may identify criteria which can reduce search space

Duality between n-state 2-symbol and 2-state n-symbol cases

Lock away the beaver and play with the platypus 

Otter -> Beaver -> Platypus 20 th November, 2009

Download