Example: tests and index binders, run on words
Library · Source module
Example: tests and index binders, run on words
A concrete interpretation on natural-number words, with a test (nz) and an index conversion (toNat), and the runs of three small programs checked by evaluation:
Main results
* whileFuel runs while the test holds and fails when the fuel is exhausted; * bindIdx binds the number returned and fails when it exceeds the bound (nothing is clamped); * ite branches on the test.
NLAlib.Ops.Examples.isTest_ctlInterp_nz and NLAlib.Ops.Examples.index_ctlInterp_toNat: the interpretation meets the exactness clauses that an access model imposes on tests and index conversions.
Declarations
- NLAlib.Ops.Examples.COp
- NLAlib.Ops.Examples.COp.ofNat
- NLAlib.Ops.Examples.COp.ofNat_ctorIdx
- NLAlib.Ops.Examples.CTst
- NLAlib.Ops.Examples.CTst.ofNat
- NLAlib.Ops.Examples.CTst.ofNat_ctorIdx
- NLAlib.Ops.Examples.addIdx
- NLAlib.Ops.Examples.branchOnPositive
- NLAlib.Ops.Examples.countRounds
- NLAlib.Ops.Examples.countdown
- NLAlib.Ops.Examples.countdownStrict
- NLAlib.Ops.Examples.ctlInterp
- NLAlib.Ops.Examples.incIf
- NLAlib.Ops.Examples.index_ctlInterp_toNat
- NLAlib.Ops.Examples.isTest_ctlInterp_nz
- NLAlib.Ops.Examples.twoCells