Proof-indexed checked operations #
Application lemmas for operations returning Option. A refinement proof shows that represented
finite inputs cannot take the failure branch, with optional scalar preconditions when required.
These lemmas connect an executable checker to a proof-indexed caller. At the raw-code level,
failure remains explicit. Once the caller supplies represented finite inputs and, for the On
variants, the scalar precondition, the refinement theorem proves that none is impossible and
returns a value carrying its denotation proof.
Unary, binary, and ternary versions provide map_denote for the denotation equation and
applyAt for constructing a proof-indexed result. The unconditional contracts also provide
exists_result to recover a successful code and its denotation.
Extract the successful code from a checked computation whose refinement proof rules out failure.
This is the shared implementation of the arity-specific applyAt functions below. Inlining
preserves the direct checked-operation runtime path after proof erasure.
Instances For
Checked operations with no additional precondition #
Observe a checked unary operation on a proof-indexed finite input.
Observe a checked unary operation with an independently stated result.
A checked unary refinement succeeds on every represented finite input.
Apply a checked unary refinement to a represented input, discharging the impossible failure.
Instances For
Observe a checked two-input operation on proof-indexed finite inputs.
Observe a checked two-input operation with an independently stated result.
A checked two-input refinement succeeds on represented finite inputs.
Apply a checked two-input refinement, discharging the impossible failure.
Instances For
Observe a checked three-input operation on proof-indexed finite inputs.
Observe a checked three-input operation with an independently stated result.
A checked three-input refinement succeeds on represented finite inputs.
Apply a checked three-input refinement, discharging the impossible failure.
Instances For
Checked operations under a scalar precondition #
Observe a preconditioned checked unary operation on a proof-indexed finite input.
Observe a preconditioned checked unary operation with an independent result.
Apply a preconditioned checked unary refinement to a represented input.
Instances For
Observe a preconditioned checked two-input operation on proof-indexed finite inputs.
Observe a preconditioned checked two-input operation with an independent result.
Apply a preconditioned checked two-input refinement to represented inputs.
Instances For
Observe a preconditioned checked three-input operation on proof-indexed finite inputs.
Observe a preconditioned checked three-input operation with an independent result.
Apply a preconditioned checked three-input refinement to represented inputs.