def u32_eq
bendtorch-core@0.1.0.0 · src/tensor/axis_algebra.bend:45
import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
45def u32_eq(+a: U32, +b: U32) -> {U32.is_eq(a, b) == Nat.is_eq(U32.to_nat(a), U32.to_nat(b)) : Bool}:
46 match a b:
47 case U32{+x} U32{+y}:
48 Equal.sym(Bool, Cmp.is_eq(Nat.cmp(Word.to_nat(32n, x), Word.to_nat(32n, y))), Cmp.is_eq(Word.cmp(32n, x, y)),
49 Equal.cong(Cmp, Bool, Cmp.is_eq, Nat.cmp(Word.to_nat(32n, x), Word.to_nat(32n, y)), Word.cmp(32n, x, y), Arith.word_cmp(32n, x, y)))