Effective compilation of total Boolean families #
This file packages the parameter theorem (s-m-n) for the promised presentation
of recursive languages. A Boolean predicate test a w which is computable jointly
in a parameter a and a word w can be compiled into a raw partial-recursive code.
The compiler is itself computable in a, and every code it produces satisfies the
semantic RecursiveDeciderCode.Valid promise.
The construction is useful for reductions to semantic questions about recursive languages: it ensures that a reduction never queries the putative algorithm on an invalid (non-total) code.
The unary partial function which evaluates a jointly computable Boolean family after decoding its parameter/word pair.
Equations
- RecursiveDeciderCode.compileBoolJoint test n = (↑(Encodable.decode n)).bind fun (p : A × List T) => Part.some (Encodable.encode (test p.1 p.2))
Instances For
A fixed code for the joint evaluator underlying compileBool.
Equations
- RecursiveDeciderCode.compileBoolBase test htest = Classical.choose ⋯
Instances For
Compile a parameterized total Boolean predicate into a raw decider code.
Although a base universal program is chosen noncomputably once, specialization in
the parameter is the computable syntactic Code.curry operation.
Equations
- RecursiveDeciderCode.compileBool test htest a = (RecursiveDeciderCode.compileBoolBase test htest).curry (Encodable.encode a)
Instances For
Specializing the joint program is computable in the parameter.
The compiled raw program returns the encoded Boolean result.
evalBool of a compiled code is exactly the original total Boolean test.
Every code produced by compileBool satisfies the always-halting promise.
Membership in a compiled language is the source Boolean test.
The language of a compiled code is the language selected by the Boolean test.