One step of the evaluation machine #
The representation of a configuration of the CEK machine on the tapes (RepOf), the
dispatcher, and, for each case of Machine.step, the run of the case program from the
representation of m to that of step m, charging stepCost m (StepTo), or halting
silently when the budget is short.
The tape names are distinct #
The representation #
The descriptions representing the machine configuration m with budget r: the
control followed by garbage g (its head at pC), the environment and the stack exactly
(the stack head at pK), a scratch tape with its head inside its content, an empty
counter, a unary budget.
Instances For
The representation, as an explicit description (the scratch tape as it is).
The size of the representation of m.
Equations
Instances For
c reaches, within B silent steps, the control q with tapes representing m'
(budget r', heads of C and K at pC, pK), its scratch tape of length at most xl.
Equations
- One or more equations did not get rendered due to their size.
Instances For
c reaches, within B silent steps, the dispatcher representing m' with budget r',
its scratch tape of length at most xl.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The control words #
List facts #
Normalize a description after a routine.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- MIPRE.TM.Interp.tacticNorm_ds_goal = Lean.ParserDescr.node `MIPRE.TM.Interp.tacticNorm_ds_goal 1024 (Lean.ParserDescr.nonReservedSymbol "norm_ds_goal" false)
Instances For
The dispatcher on ev #
One round of evDispatch: two moves and a branch on the bit two cells right.
The case program of a control to evaluate, and the position of the final 0 of its tag.
Equations
- MIPRE.TM.Interp.evTarget (MIPRE.Cost.Prog.var i) = MIPRE.TM.Interp.ProgId.evVar
- MIPRE.TM.Interp.evTarget MIPRE.Cost.Prog.nil = MIPRE.TM.Interp.ProgId.evNil
- MIPRE.TM.Interp.evTarget (h.cons t) = MIPRE.TM.Interp.ProgId.evCons
- MIPRE.TM.Interp.evTarget (MIPRE.Cost.Prog.elim i n c) = MIPRE.TM.Interp.ProgId.evElim
- MIPRE.TM.Interp.evTarget (e.let_ b) = MIPRE.TM.Interp.ProgId.evLet
- MIPRE.TM.Interp.evTarget b.loop = MIPRE.TM.Interp.ProgId.evLoop
- MIPRE.TM.Interp.evTarget (MIPRE.Cost.Prog.const d) = MIPRE.TM.Interp.ProgId.evConst
Instances For
Equations
- MIPRE.TM.Interp.evHead (MIPRE.Cost.Prog.var i) = 2
- MIPRE.TM.Interp.evHead MIPRE.Cost.Prog.nil = 4
- MIPRE.TM.Interp.evHead (h.cons t) = 6
- MIPRE.TM.Interp.evHead (MIPRE.Cost.Prog.elim i n c) = 8
- MIPRE.TM.Interp.evHead (e.let_ b) = 10
- MIPRE.TM.Interp.evHead b.loop = 12
- MIPRE.TM.Interp.evHead (MIPRE.Cost.Prog.const d) = 14
Instances For
From the dispatcher, a control ev p reaches its case program with the head of C on the
final 0 of the tag.
The cases: ev #
The bound on the steps of a case program.
Equations
- MIPRE.TM.Interp.caseBound m xl = 100 * (MIPRE.TM.Interp.sz m + xl + 1)
Instances For
The common tail of evCons and evLet: after the frame is pushed, rebuild the control
from the scratch tape and charge. Stated inline in each case.
Finishing a case: the charge and the jump #
ev elim #
elim when the value is nil: evaluate n.
elim when the value is a pair: push its components, evaluate cc.
ev let and ev loop #
The dispatcher on ret #
The case program of a return to a frame.
Equations
- MIPRE.TM.Interp.retTarget (MIPRE.Cost.Machine.Frame.cons1 t env) = MIPRE.TM.Interp.ProgId.retCons1
- MIPRE.TM.Interp.retTarget (MIPRE.Cost.Machine.Frame.cons2 a) = MIPRE.TM.Interp.ProgId.retCons2
- MIPRE.TM.Interp.retTarget (MIPRE.Cost.Machine.Frame.let1 b env) = MIPRE.TM.Interp.ProgId.retLet1
- MIPRE.TM.Interp.retTarget (MIPRE.Cost.Machine.Frame.loop1 b env) = MIPRE.TM.Interp.ProgId.retLoop1
Instances For
From the dispatcher, a return to a frame reaches its case program with the head of C
on the value and the head of K on the second tag bit.
Popping the innermost environment entry #
The cases: ret #
ret to a loop1 frame #
The final check #
The control and the tape C alone (the stack head may sit before the tape).
Equations
- MIPRE.TM.Interp.CDesc c q s = (c.state = q ∧ MIPRE.TM.Interp.TapeIs (c.workTapes MIPRE.TM.Interp.C) (c.workTapePos MIPRE.TM.Interp.C) s)
Instances For
U accepts from c within n silent steps followed by the output 1.
Equations
- MIPRE.TM.Interp.AcceptsFrom c n = ∃ (c' : MIPRE.TM.Interp.Cfg input), MIPRE.TM.Interp.Reach c n c' [MIPRE.TM.Interp.Sym.one] ∧ c'.state = none
Instances For
The final check on ret v with an empty stack: accept iff v = encode true.
The step #
The bound on the steps of U simulating one step of the machine from a representation with
a scratch tape of length xl.
Equations
- MIPRE.TM.Interp.stepBound m xl = MIPRE.TM.Interp.caseBound m xl + MIPRE.TM.Interp.sz m + 30
Instances For
One step of the machine, when the budget covers its cost: from the dispatcher
representing m, U reaches the dispatcher representing step m with the cost charged.
One step of the machine, when the budget is short: U halts silently.