BB(6) hunt
Module 3 of 8 · about 15 minutes

Counters: digits as cells, words, and blocks with fuel

The answer

A counter is a binary number written on the tape that the machine keeps adding 1 to. Adding 1 works as on paper: the head walks over the low 1-digits, turns the first 0-digit into a 1, and turns the 1-digits it walked over into 0s. Machines differ in how they write a digit: as one cell, as a two-cell word, or (in #11) as two runs, where the number of 01s is fuel that every carry burns.

In all three, the lowest digit is the digit nearest the head: every count starts there.

1Digits as cells: the Example.v counter

1RB1LA_0LA0RB is the counter from busycoq's tutorial file Example.v. Whenever B stands on cell 1 reading a blank, the cells to its left spell a binary number, and brackets appear under them. From a blank tape, every step:

It reads 1 at step 1, 10 at step 5, 11 at step 7 and 100 at step 13. Steps 7 to 13 add 1 to 11: B0 turns the head left as A, A walks over the 1s and leaves them alone (A1 = 1LA), writes a 1 on the first 0 (A0 = 1RB), and B walks back right turning each 1 into 0 (B1 = 0RB).

That is the whole carry. Over k low 1s it takes 2k + 2 steps: 6 here.

Keep just the reading moments and the history is binary counting: 1, 10, 11, 100, … up to 1111 at step 51. Tap a row to see its tape.

The tape grows only when every digit is 1 and the carry runs off the end. That happens at steps 3, 10, 25, 56, 119, … (the n-th new cell at step 2n+2 − n − 4), so each new cell takes about twice as long as the last. After 100,000 steps the tape spans just 16 cells.

2Digits as words: W5-3's counter

W5-3 (1RB1RA_1LC1LE_1RF1LD_1RE0LD_0LB0RA_---0RC, one of our kills) keeps its counter right of the head. A digit is two cells: 11 is 1 and 00 is 0. The lowest digit is again the one next to the head, so the number reads backwards: 11 11 00 11 is 1011 in binary, 11.

The rows read 4, 5, 6, … 11. Between two rows the head makes a trip into the word on the left (module 4) and adds 1 on its way back.

Rows 606 to 636 are the trip into the word on the left (module 4); the jump buttons skip it. Each step below names the rule the widget shows as rule used on that row:

So 11 11 11 (7) became 00 00 00 11 (8). It is the Example.v carry, mirrored and two cells at a time. W5-3's Coq file calls this counter busycoq's BinInc [1;1] N, where [1;1] is the word for digit 1.

3Digits as blocks with fuel: #11

#11 (1RB0LE_1RC0RC_1LD0RB_1LA0LE_1LD1LF_1LD---, accepted upstream) writes each digit as two runs: 10 10 …, then 01 01 …. If the runs touch, the digit is 1. If a 00 sits between them, the digit is 0. The number of 01s is the digit's fuel.

Two more parts frame the digits. The start is a fixed 10 01 at the far left. The end block is (10)^a 000 (10)^b, between the low digit and the head: a run of 10s, three blanks, another run of 10s. ((10)^4 means 10 four times.)

Compare the chips. Both digits the carry touched have one 01 less (fuel 3 → 2 and 2 → 1). The digit that flipped to 1 lost its 00 and gained a 10.

The end block grew too, from (10)^4 000 10 to (10)^5 000 (10)^3, and the head now stands 4 cells further right. That happens on every carry, so #11's tape keeps widening.

The jump buttons stop at each part of the carry:

Each row is one counter reading. Three kinds of move take one row to the next:

So #11 is not a plain binary counter: its digits come and go. Its rules fail only if a carry reaches a 0-digit with no fuel at all, and its proof is an invariant showing that never happens (module 5).

4Where "Skelet 1-like" comes from

The holdout list files #11, #3 and W4-3 under the class "Skelet 1-like Class 2". The name comes from Skelet #1, the BB(5) machine 1RB1RD_1LC0RC_1RA1LD_0RE0LB_---1RC, which busycoq proves never halts in Skelet1.v, following sligocki's 2023 post.

What they share: the post shows that Skelet #1 spends almost all its time counting up a base-4 counter whose digits (C0 to C3 in Skelet1.v) are short blocks of cells, with filler between them. Its digits are blocks of cells, not single cells, and so are the digits of #11 (two runs), #3 (pairs of blocks) and W4-3 (a chain of digit blocks).

W4-3's counter counts in base 3 and lives in its defects (module 2 shows them). Its proof is a 2,583-line Coq file, so this guide stops at the name.

Recap
  1. A counter is a binary number on the tape. Adding 1: walk over the low 1-digits, flip the first 0-digit to 1, turn the walked-over digits to 0. The lowest digit sits next to the head.
  2. A digit can be one cell (Example.v), a two-cell word 11/00 (W5-3), or a run of 10s plus a run of 01s (#11). In #11 every carry burns one 01 of each digit it touches, an overflow turns 10s into fresh fuel, and a digit flipped with its last 01 drops out.
  3. Proofs track the digits (and in #11 their fuel), not the cells. The tape can still grow: Example.v gains a cell only when it overflows (16 cells after 100,000 steps), but #11's end block grows on every carry (647 cells after 100,000 steps).