NLA-lib Explorer

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