Catalog: comparisons and the conversion to an index
Library · Source module
Catalog: comparisons and the conversion to an index
Queries are the names a program uses in a test (ite, whileFuel) or as an index (bindIdx). They are primitives of the access model, which imposes their exactness; no table implements them.
* NLAlib.Ops.CmpOp compares decoded inputs and writes a flag cell. A table can implement this call. The access model's NLAlib.Ops.FlagTst.isSet query reads the flag cell using the same Boolean decoding. * NLAlib.Ops.CmpTst: the comparisons lt, le, eq of two cells and isZero, isPos of one cell. Contract NLAlib.Ops.IsCmp dec: each is decided exactly on the decoded values (NLAlib.Ops.Interp.IsTest). * NLAlib.Ops.IdxTst.toNat: the conversion of a cell to a number. Contract NLAlib.Ops.IsToNat dec: the number is the floor of the decoded value, and the conversion fails on a negative value (NLAlib.Ops.Interp.IsIndex, whose function is Option-valued). Nothing is clamped: a program that wants a clamp tests first.
Witness: NLAlib.Ops.exists_isCmp, on the real numbers.
Main results
* NLAlib.Ops.IsCmpOp and NLAlib.Ops.IsFlagTest specify a comparison call and flag read. NLAlib.Ops.exists_isCmpOp_isFlagTest witnesses both contracts on the real numbers. * NLAlib.Ops.IsCmp, NLAlib.Ops.IsToNat: the contracts. * NLAlib.Ops.IsCmp.test_lt and its analogues, NLAlib.Ops.IsToNat.index_eq, NLAlib.Ops.IsToNat.index_neg: what a query returns on readable cells. * NLAlib.Ops.exists_isCmp: the contracts can be met.
Declarations
- NLAlib.Ops.CmpOp
- NLAlib.Ops.CmpTst
- NLAlib.Ops.CmpTst.fn
- NLAlib.Ops.CmpTst.lens
- NLAlib.Ops.CmpTst.ofNat
- NLAlib.Ops.CmpTst.ofNat_ctorIdx
- NLAlib.Ops.FlagTst
- NLAlib.Ops.FlagTst.fn
- NLAlib.Ops.FlagTst.ofNat
- NLAlib.Ops.FlagTst.ofNat_ctorIdx
- NLAlib.Ops.IdxTst
- NLAlib.Ops.IdxTst.ofNat
- NLAlib.Ops.IdxTst.ofNat_ctorIdx
- NLAlib.Ops.IsCmp
- NLAlib.Ops.IsCmp.test_eq
- NLAlib.Ops.IsCmp.test_isPos
- NLAlib.Ops.IsCmp.test_isZero
- NLAlib.Ops.IsCmp.test_le
- NLAlib.Ops.IsCmp.test_lt
- NLAlib.Ops.IsCmpOp
- NLAlib.Ops.IsFlagTest
- NLAlib.Ops.IsFlagTest.test_isSet
- NLAlib.Ops.IsToNat
- NLAlib.Ops.IsToNat.index_eq
- NLAlib.Ops.IsToNat.index_neg
- NLAlib.Ops.cmpInterp
- NLAlib.Ops.cmpRel
- NLAlib.Ops.cmpRel_dom
- NLAlib.Ops.cmpRel_inLens
- NLAlib.Ops.cmpRel_nd
- NLAlib.Ops.cmpRel_outLens
- NLAlib.Ops.cmpRel_rel
- NLAlib.Ops.cmpRel_stream
- NLAlib.Ops.cmpRel_win
- NLAlib.Ops.exists_isCmp
- NLAlib.Ops.exists_isCmpOp_isFlagTest
- NLAlib.Ops.instDecidableEqCmpOp.decEq
- NLAlib.Ops.toNatFn