The universal machine evaluates formulas: the frame of the proof #
The universal machine keeps trees in its heap (Uni.Represents). To evaluate the formula coded by
the tree at register 1 at the tree at register 2 (Uni.EvalReady), it reads the opcode of the
code, evaluates the subformulas, and returns the value to the frame whose address is in
register 3 (Uni.Returns). Uni.EvalsTo θ supp c x l says that this is correct for the code c
at x if l is the list of the accepting runs of the formula: the sum of the weights of the runs
of the machine is the sum over the runs r in l without named constants of the weight of r
times the sum after the return of the value of r (Uni.plainValue), and one step of the
formula costs at most Uni.codeCost supp steps of the machine.
All steps but the guesses are forced (Uni.sumTo_rule). Uni.InMode.sumTo_step is the one form
of a forced step that the proofs use: the rule is found by unification from the mode and the
loaded record, and the state after the step is Uni.step, whose mode, registers and heap are
computed by rfl.
This file has the constructs whose evaluation uses no subformula (quote, id, guess, fail,
and mul, at which the machine stops).
Main definitions #
Uni.Represents,Uni.InMode,Uni.Returns,Uni.EvalReady,Uni.EvalsTo.Uni.nameLength,Uni.codeCost,Uni.plainWeight,Uni.plainValue.
Main results #
Uni.InMode.sumTo_rule,Uni.InMode.sumTo_step,Uni.InMode.sumTo_zero: forced steps.Uni.EvalReady.sumTo_decode: reading the opcode, and the step after it.Uni.sumTo_readName: reading the name of a constant.Uni.plainValue_map_tick,Uni.plainValue_seq,Uni.plainValue_seq₃: the sums over the runs of a formula, from the sums over the runs of its subformulas.Uni.EvalsTo.nil,Uni.EvalsTo.quote,Uni.EvalsTo.id,Uni.EvalsTo.fail,Uni.EvalsTo.mul,Uni.EvalsTo.guess.
References #
- Anthropic, VP ≠ VNP over every field, paper and Lean formalization,
Appendix I (the proof of Proposition I.1, "The pointer machine"), modules
Nc.Uni.EvalUandNc.Uni.EvThm
The address a represents the tree in the heap H.
The record at an address that represents a tree.
A record of H is in the heap; its address may be given by an equation.
The record that a step allocated, at its address.
A forced step: in the mode md with the record of kind κ loaded, the run sum is the
weight of the rule nextRule supp md κ times the run sum after the step.
A forced step with a rule of weight 1.
No rule applies.
What happens when the value o is returned to the frame at the address k: the run sum
is S, within B steps.
Reading a name: from the mode thetaHead p with the rest w of the name at register 1,
the machine multiplies by θ (p ++ w.path) and returns nil to the frame at register 2.
The weight of a run that names no constants; the other runs count 0.
The sum, over the runs r without named constants, of the weight of r times m r.
One run after the other.
Three runs, one after the other.
Reading the opcode j and the step after it, by the rule for the mode decode j.
The machine evaluates the code c at x correctly, if l is the list of the accepting
runs: from a state that is ready, the run sum is plainValue m l within B steps, if for every
run r in l without named constants the run sum after the return of the value of r is m r
within B - codeCost supp * r.cost steps.
Naming a constant stops the machine: such runs do not count.