Documentation

LeanPool.PureNock.PaperReference

Derived OP₀–OP₁₀ evaluator #

Fuel-indexed evalPaper from the opcode equations at main.tex:1054–1076 (rejects OP₁₁; refines evalN).

*[subject formula], fuel-indexed, paper fragment only (OP₀..OP₁₀ + cons). Identical to evalN except an OP₁₁ head (op = 11) is an unknown opcode and crashes, matching the paper's opHeadOk (op < 11) and the small-step machine runProgram.

Equations
Instances For
    theorem Nock.evalPaper_succ {n : Nat} {s form r : Noun} (h : evalPaper n s form = some r) :
    evalPaper (n + 1) s form = some r

    Fuel monotonicity (single step) for evalPaper (same shape as evalN_succ).

    theorem Nock.evalPaper_mono {n m : Nat} {s form r : Noun} (hle : n ≤ m) (h : evalPaper n s form = some r) :
    evalPaper m s form = some r

    Fuel monotonicity for evalPaper.

    theorem Nock.evalPaper_deterministic {n m : Nat} {s form r₁ r₂ : Noun} (h₁ : evalPaper n s form = some r₁) (h₂ : evalPaper m s form = some r₂) :
    r₁ = r₂

    evalPaper is a partial function (output uniqueness). Two successful paper-fragment evaluations of the same subject/formula, at any fuel budgets, return the same noun.

    theorem Nock.evalPaper_le_evalN {n : Nat} {s form r : Noun} (h : evalPaper n s form = some r) :
    evalN n s form = some r

    evalPaper refines evalN. Every paper-fragment evaluation is a standard Nock evaluation with the same result: evalPaper and evalN differ only where evalN fires OP₁₁ (which evalPaper crashes on). Proof: functional induction; every clause is identical except OP₁₁, where evalPaper returns none so the hypothesis is absurd.