Documentation

CslibFrontier.Computability.PointerMachine.Symbols

Symbols and integers #

[Tar79], §2, p. 112 calls symbols the data on which no operation is permitted except testing for equality. This data basis combines symbols with integers, as in the weighted-union representation of §3, pp. 114–115: arithmetic and order apply to integers only, and no primitive produces a symbol or converts between symbols and integers.

Main definitions #

Main results #

References #

[Tar77], §2–§3, and [Tar79], §2–§3.

A datum is undefined, a symbol or an integer.

  • undefined {Symbol : Type} : Value Symbol

    The undefined value.

  • symbol {Symbol : Type} (a : Symbol) : Value Symbol

    A symbol.

  • int {Symbol : Type} (n : ℤ) : Value Symbol

    An integer.

@[instance_reducible]
def Cslib.PointerMachine.Symbols.instDecidableEqValue.decEq {Symbol✝ : Type} [DecidableEq Symbol✝] (x✝ x✝¹ : Value Symbol✝) :
Decidable (x✝ = x✝¹)

Integer operations.

  • const (n : ℤ) : Op

    An integer constant, ignoring its operands.

  • add : Op

    Addition.

  • sub : Op

    Subtraction.

Predicates.

  • eq : Test

    Equality of any two data.

  • less : Test

    Strict order of integers.

def Cslib.PointerMachine.Symbols.evalOp {Symbol : Type} :
Op → Value Symbol → Value Symbol → Value Symbol

Arithmetic on integers; the result is undefined for any other operands.

def Cslib.PointerMachine.Symbols.evalTest {Symbol : Type} [DecidableEq Symbol] :
Test → Value Symbol → Value Symbol → Bool

Equality of data and order of integers; order is false for any other operands.

@[reducible, inline]

Symbols with equality and integers with constants, addition, subtraction and order. Each primitive costs one unit whatever the size of the integers.

def Cslib.PointerMachine.Symbols.predicate {Symbol : Type} (A : Symbol → Prop) :
Value Symbol → Prop

Require a property of symbols, leaving other data unrestricted.

theorem Cslib.PointerMachine.Symbols.closed {Symbol : Type} [DecidableEq Symbol] (A : Symbol → Prop) :
(model Symbol).Closed (predicate A)

The primitives preserve every property of symbols: they produce no symbol.

def Cslib.PointerMachine.Symbols.HasSymbol {Symbol : Type} [DecidableEq Symbol] {L : Layout} (x : State (model Symbol) L) (a : Symbol) :

A symbol occurs in a data register or in a record.

theorem Cslib.PointerMachine.Symbols.hasSymbol_of_runs {Symbol : Type} [DecidableEq Symbol] {L : Layout} {code : List (Instr (model Symbol) L)} {x y : State (model Symbol) L} {n : ℕ} (h : Runs code x y n) {a : Symbol} (ha : HasSymbol y a) :

Every symbol in a register or record after a run was already in one before it.

def Cslib.PointerMachine.Symbols.Value.map {Symbol : Type} (π : Symbol → Symbol) :
Value Symbol → Value Symbol

Apply a permutation to the symbols.

Every permutation of the symbols is a renaming: no primitive can tell symbols apart except by equality.

theorem Cslib.PointerMachine.Symbols.hasSymbol_of_executes {Symbol : Type} [DecidableEq Symbol] {L : Layout} {code : List (Instr (model Symbol) L)} {x y : State (model Symbol) L} {time : ℕ} (h : Executes code x y time) {a : Symbol} (ha : HasSymbol y a) :

Successful execution introduces no symbol absent from the input.