Polynomial-time option operations #
Option elimination reuses the degree-bounded encoding operations. Both the optional value and its fallback may be computed from the input; no inhabitant of the value type is required.
Main results #
Turing.MultiTapeTM.ComputableTidilyInPolyTime.optionSome: construct an optional value.Turing.MultiTapeTM.ComputableTidilyInPolyTime.optionGetD: read an option with a fallback supplied as part of the input.Turing.MultiTapeTM.ComputableTidilyInPolyTime.optionGetDWithInput: the composition rule.Turing.MultiTapeTM.ComputableTidilyInPolyTime.optionIsSome: test a computed optional value.Turing.MultiTapeTM.ComputableTidilyInPolyTime.optionElimWithInput: branch on an optional value while retaining the original input, including empty value types.
The plain forms Turing.MultiTapeTM.ComputableInPolyTime.optionSome, .optionGetD,
.optionGetDWithInput, .optionIsSome and .optionElimWithInput are in
CslibFrontier.Computability.Machines.Turing.MultiTape.Internal.PolyTimeOptionPrimitives, which
this file publicly imports. So is Turing.MultiTapeTM.ComputableInPolyTime.optionMapWithInput,
which maps an optional value with a callback certified jointly with its captured original input;
it has no tidy form here.
References #
Uses Christian Reitwiessner's option encoding and degree-bounded machine calculus.
Construct an optional value with the standard option encoding.
Test whether a computed option contains a value, without requiring a default value.
Read a computed option with a computed fallback, using their shared value encoding.
Branch on a computed option, charging its full value and any captured original input.