def les

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/f64cmp.bend:282

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64cmp.bend as F64cmp
import Base
import bend-collections-laws-math@1.0.0.0/spec/math/f64.bend as SF
import bend-collections-laws-math@1.0.0.0/src/math/f64.bend as F
import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as X

282def les(+xl: U32, +xh: U32, +yl: U32, +yh: U32, +sa: Bool, +sb: Bool, +mc: Cmp, +h: {X.lt(F.mag(F.Bits{xl, xh}), F.mag(F.Bits{yl, yh})) == Cmp.is_lt(mc) : Bool}, +h2: {X.lt(F.mag(F.Bits{yl, yh}), F.mag(F.Bits{xl, xh})) == Cmp.is_lt(SF.flip(mc)) : Bool}) -> {F.le_s(F.Bits{xl, xh}, F.Bits{yl, yh}, sa, sb) == Cmp.is_le(SF.pick(Cmp, Bool.not(Bool.xor(sa, sb)), SF.pick(Cmp, sa, SF.flip(mc), mc), SF.pick(Cmp, sa, LT{}, GT{}))) : Bool}:
283  match sa sb:
284    case True{} False{}:
285      {==}
286    case False{} True{}:
287      {==}
288    case False{} False{}:
289      Equal.trans(Bool, Bool.not(X.lt(F.mag(F.Bits{yl, yh}), F.mag(F.Bits{xl, xh}))), Bool.not(Cmp.is_lt(SF.flip(mc))), Cmp.is_le(mc), Equal.cong(Bool, Bool, t => Bool.not(t), X.lt(F.mag(F.Bits{yl, yh}), F.mag(F.Bits{xl, xh})), Cmp.is_lt(SF.flip(mc)), h2), nlf(mc))
290    case True{} True{}:
291      Equal.trans(Bool, Bool.not(X.lt(F.mag(F.Bits{xl, xh}), F.mag(F.Bits{yl, yh}))), Bool.not(Cmp.is_lt(mc)), Cmp.is_le(SF.flip(mc)), Equal.cong(Bool, Bool, t => Bool.not(t), X.lt(F.mag(F.Bits{xl, xh}), F.mag(F.Bits{yl, yh})), Cmp.is_lt(mc), h), nlc(mc))

Uses (17)

Used by (1)