Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Internal.NativeCompiler.Conditional

Named native conditionals #

This module retains the existing direct conditional machine as a NativeCompiler. Its Boolean condition is encoded by encTest, so an empty word selects the false branch and a nonempty word selects the true branch. The resulting compiler records the actual nested finite state, its constructive encoding, and every constant in the kernel conditional theorem.

Main definitions #

def Turing.MultiTapeTM.Internal.NativeCompiler.ite {Alpha : Type u_1} {Beta : Type u_2} {condition : Alpha → Bool} {ifTrue ifFalse : Alpha → Beta} {encIn : Alpha ↪ List Bool} {encOut : Beta ↪ List Bool} (conditionCompiler : NativeCompiler condition encIn encTest) (trueCompiler : NativeCompiler ifTrue encIn encOut) (falseCompiler : NativeCompiler ifFalse encIn encOut) :
NativeCompiler (fun (input : Alpha) => if condition input = true then ifTrue input else ifFalse input) encIn encOut

Direct conditional composition of a named condition and two named branches. The condition emits encTest; no semantic Boolean callback is hidden behind the assembled machine.