This module contains the definition of signed fixed width integer types as well as basic arithmetic and bitwise operations on top of it.
@[extern lean_int8_of_int]
Equations
- Int8.ofInt i = { toUInt8 := { toBitVec := BitVec.ofInt 8 i } }
Instances For
@[extern lean_int8_of_int]
Equations
- Int8.ofNat n = { toUInt8 := { toBitVec := BitVec.ofNat 8 n } }
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- instToStringInt8 = { toString := fun (i : Int8) => toString i.toInt }
Equations
- instOfNatInt8 = { ofNat := Int8.ofNat n }
@[extern lean_int8_shift_right]
Equations
- a.shiftRight b = { toUInt8 := { toBitVec := a.toBitVec.sshiftRight' (b.mod 8).toBitVec } }
Instances For
Equations
- instComplementInt8 = { complement := Int8.complement }
Equations
- instShiftLeftInt8 = { shiftLeft := Int8.shiftLeft }
Equations
- instShiftRightInt8 = { shiftRight := Int8.shiftRight }
@[extern lean_int8_dec_lt]
Equations
- a.decLt b = inferInstanceAs (Decidable (a.toBitVec.slt b.toBitVec = true))
Instances For
@[extern lean_int8_dec_le]
Equations
- a.decLe b = inferInstanceAs (Decidable (a.toBitVec.sle b.toBitVec = true))
Instances For
Equations
- instDecidableLtInt8 a b = a.decLt b
Equations
- instDecidableLeInt8 a b = a.decLe b