Handlers, code substitution and the Turing join #
This file connects the handlers of Cslib.ClockedComp.subst with the code-level reductions of
RecursiveInJoin through the compiler Nat.RecursiveIn.Code.toClocked.
- Code substitution. The compiled program of a code
dimplements the functiondcomputes, against every partial oracle (Code.implements_toClocked). Substituting it into the compiled program ofccomputes the substituted codec.subst d(Code.eval_subst_toClocked). Through codes, computability by clocked programs with computable dialogue is transitive (Code.exists_clockedComp_trans): the composite is the compiled program of a substituted code. - Two oracles and their join. A program over the sum interface
natOracleSpec ⊕ₒ natOracleSpec, run with the oraclespandx, computes the same as its substitution byCode.joinHandlerrun with the single oraclep ⊕ x(Code.eval_subst_joinHandler). The handler answers the two kinds of query by the compiled programs ofCode.joinLeftandCode.joinRight. Conversely, a program overnatOracleSpecrun withp ⊕ xcomputes the same as its substitution byCode.splitHandler, which reads the join from the two oracles, run withpandx(Code.eval_subst_splitHandler). ComposingsplitHandlerwith the compiled programs of codesaandbimplements the join codeCode.join a b(Code.implements_subst_splitHandler).
Main definitions #
Nat.RecursiveIn.Code.joinHandler: answer the two oracles of the sum interface from their join.Nat.RecursiveIn.Code.splitHandler: answer the join from the two oracles of the sum interface.
Main results #
Nat.RecursiveIn.Code.implements_toClocked,Nat.RecursiveIn.Code.eval_subst_toClocked.Nat.RecursiveIn.Code.exists_clockedComp_trans: computability by clocked programs with computable dialogue is transitive.Nat.RecursiveIn.Code.implements_joinHandler,Nat.RecursiveIn.Code.eval_subst_joinHandler.Nat.RecursiveIn.Code.implements_splitHandler,Nat.RecursiveIn.Code.eval_subst_splitHandler.Nat.RecursiveIn.Code.implements_subst_splitHandler: the clocked form ofCode.eval_join.
The compiled program of a code implements, against every partial oracle g, the function the
code computes relative to g.
Transitivity of clocked reducibility. If F is computed against g, and g against
h, by families of clocked programs with computable dialogue, then so is F against h. The
family is the compiled program of a substituted code, so its dialogue is computable even when the
given families are not stable.
Two oracles and their join #
Answer a query of the left oracle by the compiled program of joinLeft and a query of the
right oracle by that of joinRight, both querying the join.
Answer a query of the join from the two oracles: an even query 2 * n asks the left oracle at
n, an odd query 2 * n + 1 asks the right oracle at n.
Against p ⊕ x, joinHandler implements the oracles p and x of the sum interface.
Against the oracles p and x, splitHandler implements their join p ⊕ x.
A program over two oracles p and x, with each query answered through the join, computes
the same relative to p ⊕ x.
A program relative to p ⊕ x, with each query of the join answered from p and x,
computes the same relative to the two oracles.
Answering the two oracles of splitHandler by the compiled programs of codes a and b
implements the join code Code.join a b, against every partial oracle: the clocked form of
Code.eval_join.