def native_subtract

stelliferous@0.0.2.0 · proofs/bounded_u32_arithmetic.bend:81

import stelliferous@0.0.2.0/proofs/bounded_u32_arithmetic.bend as BoundedU32Arithmetic
import Base
import stelliferous@0.0.2.0/proofs/word_subtraction.bend as Subtraction

81def native_subtract(+a: U32,+b: U32,h: {Nat.is_le(U32.to_nat(b),U32.to_nat(a)) == True{} : Bool}) -> {U32.sub(a,
82    b) == U32.from_nat(Nat.sub(U32.to_nat(a),U32.to_nat(b))) : U32}:
83  %native_roundtrip(a) : {U32.sub(_,b) == U32.from_nat(Nat.sub(U32.to_nat(a),U32.to_nat(b))) : U32}
84  %native_roundtrip(b) : {U32.sub(U32.from_nat(U32.to_nat(a)),_) == U32.from_nat(Nat.sub(U32.to_nat(a),U32.to_nat(b))) : U32}
85  Subtraction.encoded_subtract(U32.to_nat(a),U32.to_nat(b),h)

Uses (9)

Used by (2)