Fixed control for the serial unary-register NOR interpreter.
The only control data are the first operand bit or the computed NOR bit.
Every variable address is compared on paper by compareTable.
The physical command table is obtained by localTable norTable.
Equations
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.first MindFormal.A595Paper.Access.first = isTrue ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.first (MindFormal.A595Paper.Access.second firstBit) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.first (MindFormal.A595Paper.Access.store answer) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.first MindFormal.A595Paper.Access.answer = isFalse MindFormal.A595Paper.instDecidableEqAccess.decEq._proof_3
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.second firstBit) MindFormal.A595Paper.Access.first = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.second a) (MindFormal.A595Paper.Access.second b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.second firstBit) (MindFormal.A595Paper.Access.store answer) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.second firstBit) MindFormal.A595Paper.Access.answer = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.store answer) MindFormal.A595Paper.Access.first = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.store answer) (MindFormal.A595Paper.Access.second firstBit) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.store a) (MindFormal.A595Paper.Access.store b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq (MindFormal.A595Paper.Access.store answer) MindFormal.A595Paper.Access.answer = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.answer MindFormal.A595Paper.Access.first = isFalse MindFormal.A595Paper.instDecidableEqAccess.decEq._proof_14
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.answer (MindFormal.A595Paper.Access.second firstBit) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.answer (MindFormal.A595Paper.Access.store answer) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqAccess.decEq MindFormal.A595Paper.Access.answer MindFormal.A595Paper.Access.answer = isTrue ⋯
Instances For
@[instance_reducible]
@[instance_reducible]
- next (access : Access) : ReturnAction
- advance : ReturnAction
- report (answer : Bool) : ReturnAction
Instances For
@[instance_reducible]
Equations
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq (MindFormal.A595Paper.ReturnAction.next a) (MindFormal.A595Paper.ReturnAction.next b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq (MindFormal.A595Paper.ReturnAction.next access) MindFormal.A595Paper.ReturnAction.advance = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq (MindFormal.A595Paper.ReturnAction.next access) (MindFormal.A595Paper.ReturnAction.report answer) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq MindFormal.A595Paper.ReturnAction.advance (MindFormal.A595Paper.ReturnAction.next access) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq MindFormal.A595Paper.ReturnAction.advance MindFormal.A595Paper.ReturnAction.advance = isTrue ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq MindFormal.A595Paper.ReturnAction.advance (MindFormal.A595Paper.ReturnAction.report answer) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq (MindFormal.A595Paper.ReturnAction.report answer) (MindFormal.A595Paper.ReturnAction.next access) = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq (MindFormal.A595Paper.ReturnAction.report answer) MindFormal.A595Paper.ReturnAction.advance = isFalse ⋯
- MindFormal.A595Paper.instDecidableEqReturnAction.decEq (MindFormal.A595Paper.ReturnAction.report a) (MindFormal.A595Paper.ReturnAction.report b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
- findInstruction : NorState
- activateFirst : NorState
- toBank (access : Access) : NorState
- nextCandidate (access : Access) : NorState
- seekSource (access : Access) : NorState
- compare (access : Access) (phase : CompareState) : NorState
- rejectBack (access : Access) : NorState
- readWrite (access : Access) : NorState
- unmarkCandidate (action : ReturnAction) : NorState
- returnSource (action : ReturnAction) : NorState
- nextField (access : Access) : NorState
- clearInstruction : NorState
- advance : NorState
- lastField : NorState
- answerBank (answer : Bool) : NorState
- answerTail (answer : Bool) : NorState
- answerBit (answer : Bool) : NorState
- answerKind : NorState
- halt : NorState
- failed : NorState
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Equations
- MindFormal.A595Paper.afterSource (MindFormal.A595Paper.ReturnAction.next a) = (MindFormal.A595Paper.NorState.nextField a, true)
- MindFormal.A595Paper.afterSource MindFormal.A595Paper.ReturnAction.advance = (MindFormal.A595Paper.NorState.clearInstruction, false)
- MindFormal.A595Paper.afterSource (MindFormal.A595Paper.ReturnAction.report a) = (MindFormal.A595Paper.NorState.answerBank a, false)
Instances For
Equations
- MindFormal.A595Paper.accessReturn MindFormal.A595Paper.Access.first bit = MindFormal.A595Paper.ReturnAction.next (MindFormal.A595Paper.Access.second bit)
- MindFormal.A595Paper.accessReturn (MindFormal.A595Paper.Access.second a) bit = MindFormal.A595Paper.ReturnAction.next (MindFormal.A595Paper.Access.store !(a || bit))
- MindFormal.A595Paper.accessReturn (MindFormal.A595Paper.Access.store a) bit = MindFormal.A595Paper.ReturnAction.advance
- MindFormal.A595Paper.accessReturn MindFormal.A595Paper.Access.answer bit = MindFormal.A595Paper.ReturnAction.report bit
Instances For
Equations
- One or more equations did not get rendered due to their size.
- MindFormal.A595Paper.norTable (MindFormal.A595Paper.NorState.answerTail bit) x✝ = some (MindFormal.A595Paper.NorState.answerBit bit, { atom := MindFormal.A595Paper.Atom.blank }, false)
- MindFormal.A595Paper.norTable (MindFormal.A595Paper.NorState.answerBit bit) x✝ = some (MindFormal.A595Paper.NorState.answerKind, { atom := MindFormal.A595Paper.Atom.bit bit }, false)
- MindFormal.A595Paper.norTable MindFormal.A595Paper.NorState.answerKind x✝ = some (MindFormal.A595Paper.NorState.halt, { atom := MindFormal.A595Paper.Atom.report }, true)
- MindFormal.A595Paper.norTable MindFormal.A595Paper.NorState.halt x✝ = none
- MindFormal.A595Paper.norTable MindFormal.A595Paper.NorState.failed x✝ = none
Instances For
def
MindFormal.A595Paper.Configuration.mapControl
{Q : Type u_1}
{R : Type u_2}
{A : Type u_3}
(φ : Q → R)
(c : Configuration Q A)
:
Configuration R A
Equations
Instances For
theorem
MindFormal.A595Paper.MachineRun.map_control
{Q : Type u_1}
{R : Type u_2}
{A : Type u_3}
{δ : Transition Q A}
{ε : Transition R A}
(φ : Q → R)
(hδ :
∀ (q : Q) (c : A) (q' : Q) (s : A) (right : Bool), δ q c = some (q', s, right) → ε (φ q) c = some (φ q', s, right))
{c d : Configuration Q A}
{n : ℕ}
(h : MachineRun δ c n d)
:
MachineRun ε (Configuration.mapControl φ c) n (Configuration.mapControl φ d)
theorem
MindFormal.A595Paper.nor_compare_transition
(access : Access)
(q : CompareState)
(c : Cell)
(q' : CompareState)
(s : Cell)
(right : Bool)
(h : compareTable q c = some (q', s, right))
:
theorem
MindFormal.A595Paper.nor_compare_correct
{f : ℤ → Cell}
{a b : ℤ}
{na nb L : ℕ}
(hf : CompareFields f a b na nb)
(hb : 0 ≤ b)
(hL : a + ↑na + 2 ≤ ↑L)
(access : Access)
:
∃ n ≤ 8 * (L + 1) ^ 2,
MachineRun norTable { tape := { cells := f, head := a + 1 }, control := NorState.compare access CompareState.scanA } n
{ tape := { cells := f, head := b + ↑nb + 2 },
control := NorState.compare access (CompareState.finish (decide (na = nb))) }