Documentation

CslibFrontier.Foundations.Data.BiTape.OfCells

Tapes holding a finite list of cells #

Cslib.Turing.BiTape.ofCells cells pos is the tape that holds the list cells of optional symbols, blanks allowed anywhere, with its head on cell pos: cell i of the list is at displacement i - pos from the head and every other cell is blank (Cslib.Turing.BiTape.read_ofCells). It loads a finite window of a tape, such as the blocks around a head, into finite storage.

Main definitions #

Main results #

@[simp]
theorem Cslib.Turing.StackTape.read_ofList {Symbol : Type u_1} (l : List (Option Symbol)) (position : ℕ) :
(ofList l).read position = l.getD position none

A stack tape built from a list reads the list, and blank past its end.

def Cslib.Turing.BiTape.ofCells {Symbol : Type u_1} (cells : List (Option Symbol)) (pos : ℕ) :
BiTape Symbol

The tape holding cells with its head on cell pos: cell i of cells is at displacement i - pos from the head, and every other cell is blank.

theorem Cslib.Turing.BiTape.read_ofCells {Symbol : Type u_1} (cells : List (Option Symbol)) (pos : ℕ) (z : ℤ) :
(ofCells cells pos).read z = if 0 ≤ ↑pos + z then cells.getD (↑pos + z).toNat none else none

The cells of ofCells cells pos: the cell at displacement z is cell pos + z of cells, blank when that is negative or past the end.