Reading a string as a normal form verifier: the wrapper decider #
Blueprint rem:compression-abstract, item 1: a string of the compressibility criterion is a
pair (Ξ», π) of a parameter and a decider program, read as the verifier
(S^compr_Ξ», wrap π). The wrapper is what makes the pair a normal form verifier: the one
structural requirement of def:normal-verifier is Verifier.accepts_length, that the decider
accept only questions of the sampler's dimension β the paper's step 1, "compute the dimension
s(n) of the sampler and check |x| = |y| = s(n); if not, reject".
Nothing else has to be enforced. Synchronicity at an index and the answer-length bound are
conditions on membership in the classes (Verifier.InClassA, InClassB), not on
well-formedness, so the wrapper leaves them to the class definition; and the paper's timeout
counter is likewise not needed here, since a decider that fails to halt simply fails to be
n-bounded, and its string then lies in neither class.
Prog.wrapCore univ sampProg dec: on input(N, x, y, a, b), runsampProgon(N, dimension)through the universal machineuniv, convert the dimension to unary, compare it with the lengths ofxand ofy, and rundecon the whole input throughunivif both match, rejecting otherwise.- The three forward runs (
wrapCore_runs_of_eq,wrapCore_runs_of_ne_left,wrapCore_runs_of_ne_right) and the inversionwrapCore_halts_of, which is what turns them into the characterization of acceptance. Decider.wrap,Decider.wrap_accepts, andVerifier.ofSamplerDeciderD, the normal form verifier a pair denotes. The decider component is a datum run by the universal machine, not a program: a string carries data, a datum that is not the encoding of any program still has to name a verifier, and reading it as a program would need a decoder with a fallback (onceCost.progNorm, in a module since removed) that the compressor's decider of obligation O4 would then have to reimplement in the ambient model β its tree-grammar check as a worklist program β only to reproduce a fallback nobody wanted. On the encoding of a program the two readings agree (wrap_accepts_prog, byUniversalMachine.time_leandhalts_of), andVerifier.ofSamplerDecideris that special case, which the two distinguished strings use.
The program #
One length check, reusable for both questions: read the length of the bit string at index
i, compare it with the unary numeral at index j, and continue with c if they agree,
rejecting otherwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The last step: run the string's decider β the datum decD, which the string carries and
which need not be the encoding of any program β on the whole input, through univ. At this
point the input sits at index 19.
Equations
- univ.wrapTail decD = ((MIPRE.Cost.Prog.const decD).cons (MIPRE.Cost.Prog.var 19)).let_ (MIPRE.Cost.Prog.callVar 0 univ)
Instances For
The head: compute the sampler's dimension at the input index, in unary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The prefix: the head, then the two questions taken apart.
Equations
- univ.wrapPre sampProg c = univ.wrapHead sampProg (MIPRE.Cost.Prog.elim 4 MIPRE.Cost.Prog.nil (MIPRE.Cost.Prog.elim 1 MIPRE.Cost.Prog.nil c))
Instances For
The wrapper's program. Input: encode (N, x, y, a, b).
Equations
- univ.wrapCore sampProg decD = univ.wrapPre sampProg (MIPRE.Cost.Prog.wrapCheck 2 4 (MIPRE.Cost.Prog.wrapCheck 5 9 (univ.wrapTail decD)))
Instances For
The length check #
Inversion. A run of the check either fails the comparison and returns nil, or passes
it and is a run of the continuation.
The whole run #
The environment the prefix hands to the first length check.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The prefix runs, whatever the continuation does.
The three outcomes #
The wrapper halts only if the universal machine does on the string's decider.
The wrapped decider and the verifier a pair denotes #
The decider a string denotes: the datum decD the string carries, run by the universal
machine, wrapped in the question-length check against the sampler S. The datum need not be
the encoding of a program; when it is, encode dec, the run is a run of dec
(wrap_accepts_prog).
Instances For
Acceptance of the wrapped decider: the two questions have the sampler's dimension and
the universal machine, run on the string's decider and the input, returns true.
Acceptance when the datum is the encoding of a program dec: the universal machine's run
is a run of dec (UniversalMachine.time_le, halts_of).
The wrapped decider accepts only questions of the sampler's dimension: the one structural
requirement of def:normal-verifier.
The verifier a pair (S, d) denotes: the sampler S, and the datum d β the string's
decider, run by the universal machine β wrapped in the question-length check. Every pair
denotes one, well formed or not.
Equations
- MIPRE.Verifier.ofSamplerDeciderD U S decD = { sampler := S, decider := MIPRE.Decider.wrap U S decD, accepts_length := β― }
Instances For
The verifier a pair (S, π) of a sampler and a decider program denotes:
ofSamplerDeciderD at the program's encoding.
Equations
- MIPRE.Verifier.ofSamplerDecider U S dec = MIPRE.Verifier.ofSamplerDeciderD U S (MIPRE.Cost.encode dec)
Instances For
The wrapper at the level of data #
Decider.wrap is what Verifier.IsBounded bounds, and it is therefore what a tabulation has
to run: the bound says nothing about the inner decider, the datum the string carries, since
UniversalMachine.halts_of produces a run with no bound on its cost. So the tabulation needs
encode (wrapCore univ sampProg decD) as a primitive recursive function of the encoded
sampler program and the datum β which it can be, because wrapCore mentions the sampler
program only under Prog.const (encode Β·) and the datum only under Prog.const.
ProgD is that mirror: the constructors of Prog at the level of Data, and the wrapper
rebuilt from them. Every _eq lemma is rfl, Prog.toData being structural, and
dWrapCore_eq is rfl too β nothing here is a second definition to keep in step with the
first, it is the same definition seen through the encoding. The existing wrapCheck,
wrapHead, wrapTail, wrapCore and everything proved about them are untouched.
Equations
Instances For
Instances For
Equations
- MIPRE.Cost.Prog.ProgD.dC h t = (MIPRE.Cost.Data.ofNat 2).cons (h.cons t)
Instances For
Equations
- MIPRE.Cost.Prog.ProgD.dE i n c = (MIPRE.Cost.Data.ofNat 3).cons ((MIPRE.Cost.Data.ofNat i).cons (n.cons c))
Instances For
Equations
- MIPRE.Cost.Prog.ProgD.dL e b = (MIPRE.Cost.Data.ofNat 4).cons (e.cons b)
Instances For
Equations
Instances For
The wrapper, at the level of data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.