fun_prop rules for list, option, number and test operations #
These rules assemble Turing.MultiTapeTM.ComputableInO certificates with explicit time and
charged-space bounds. fun_prop composes the primitives through
Turing.MultiTapeTM.ComputableInO.comp'; Turing.MultiTapeTM.ComputableInO.mono then compares
the assembled bounds with the client's target bounds.
The list, option and unary-number primitives are linear in their encoded arguments. The
registered binary natSucc and natPred certificates instead have quadratic time and linear
charged space. General equality eq' adds its explicit product-of-lengths time charge and
encoded-pair space charge; clients enable it locally. Tests against a fixed value of a finite
type and binary zero retain the tested computation's bounds, whereas isEmpty' adds the
computed list's encoded length to both time and space. A test takes that computation as a
premise, since its Boolean result does not determine the tested value's encoding.
Main results #
Turing.MultiTapeTM.ComputableInO.take',.drop': prefixes and suffixes, with a unary count.Turing.MultiTapeTM.ComputableInO.not',.and',.or': Boolean connectives.Turing.MultiTapeTM.ComputableInO.decideEq',.natIsZero': tests against a constant.Turing.MultiTapeTM.ComputableInO.eq': equality of computed values, enabled locally by a client.Turing.MultiTapeTM.ComputableInO.iteDecide: case distinction on a decidable proposition.
The first n x elements of l x, with the count in unary.
All but the first n x elements of l x, with the count in unary.
The negation of a computed Boolean.
The conjunction of two computed Booleans.
The disjunction of two computed Booleans.
Whether two computed values agree. This is not a global fun_prop rule, since it would also
apply to tests against a constant, which have cheaper rules; a client enables it locally.
Whether a computed option is empty, within the bounds of the option.
Whether a computed value of a finite type equals a fixed value.
Whether a computed binary number is zero.
Case distinction on a decidable proposition, through its computed decide.