LAWS.digits_view: law of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/LAWS.bend as LAWS Lines 90-100 of lawful-fields@0.1.1.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-fields@0.1.1.0/LAWS.bend&start_line=90&end_line=100 import Base import lawful-bytes@0.1.1.0/defs.bend as D import lawful-fields@0.1.1.0/defs.bend as F import lawful-fields@0.1.1.0/fields.bend as C # digits says the bytes are one or more decimal digits, a number of any size # (num answers None both for non-numbers and for numbers of 2^32 or more). law digits_view: for b: D.Bytes for d: Nat for from: U32 for to: U32 for h: {D.ok(b, d) == True{} : Bool} for hft: {U32.is_le(from, to) == True{} : Bool} for ht: {Nat.is_le(U32.to_nat(to), D.size(b)) == True{} : Bool} {Pair.snd(D.Bytes, Bool, C.digits(b, from, to)) == F.all_digits(D.slice(D.view(b), U32.to_nat(from), Nat.sub(U32.to_nat(to), U32.to_nat(from)))) : Bool} Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair.snd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=ok https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=size https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=slice https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=view https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=bmirror https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/PROOF.bend&name=digits_view.go https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/defs.bend&name=all_digits https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/fields.bend&name=digits