Bounded walks over lists, in the ambient model #
The programs with which the wrapper decider of Halting/Wrapper.lean performs the paper's
format checks: the questions must be bit strings of the sampler's length, the answers bit
strings within the answer-length budget, and equal questions must carry equal answers. All of
them walk their input under a budget, so that their cost is the budget times the size of the
input — the shape T · (|input| + 1) of Decider.TimeBoundAt — rather than a power of it.
Prog.bitWalkProg: oncons l u, walklagainst the budgetu(a list, typically a unary numeral), checking that each element passed is a bit; the result isnilon a non-bit element, and otherwise the pair of what remains ofland ofu(Data.bitWalk). Both format checks read off it:|l| = |u|is the resultcons nil nil,|l| ≤ |u|a resultcons nil _.Prog.eqBitsProg: equality of two bit lists (Data.eqBits).Prog.normBinProg: the normalizationData.normBinof a parameter, by a walk recording the last bit seen (Data.canonWalk).
Every walk copies the remainder of the lists at each step, which is what the ambient model
charges; the cost bounds are (budget + 1) · (S + c) for S the size of the input.
Walk l against the budget u, checking that every element passed is a bit: nil on a
non-bit, otherwise the pair of the remainders.
Equations
- MIPRE.Cost.Data.nil.bitWalk x✝ = MIPRE.Cost.Data.nil.cons x✝
- (h.cons l').bitWalk MIPRE.Cost.Data.nil = (h.cons l').cons MIPRE.Cost.Data.nil
- (h.cons l').bitWalk (a.cons u') = if h.isBit = true then l'.bitWalk u' else MIPRE.Cost.Data.nil
Instances For
The walk of the normalization: last records whether the string so far is empty or ends
in true.
Equations
Instances For
The walk computes the normalization test.
Close a cost bound after the run has been built: unfold the sizes of the small constants
and let omega finish.
Equations
- MIPRE.Cost.Prog.tacticCost_omega = Lean.ParserDescr.node `MIPRE.Cost.Prog.tacticCost_omega 1024 (Lean.ParserDescr.nonReservedSymbol "cost_omega" false)
Instances For
The bounded bit walk #
Body of bitWalkProg, on the state cons l u: stop with cons nil u if l is empty,
with cons l nil if the budget is exhausted, with nil if the head of l is not a bit, and
otherwise continue with the two tails.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bounded bit walk: on cons l u, compute bitWalk l u.
Instances For
Equality of bit lists #
Body of eqBitsProg, on the state cons l₁ l₂.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equality of two bit lists: on cons l₁ l₂, compute encode (eqBits l₁ l₂).
Instances For
Normalization of the parameter #
Body of the canonicity walk, on the state cons rest last.
Equations
- One or more equations did not get rendered due to their size.
Instances For
normBinProg on d computes normBin d: the input itself if it is a canonical binary
numeral, nil otherwise.
Equations
- One or more equations did not get rendered due to their size.