HepLean Documentation

Init.Data.BitVec.BasicAux

This module exists to provide the very basic BitVec definitions required for Init.Data.UInt.BasicAux.

@[match_pattern]
def BitVec.ofNat (n i : Nat) :

The BitVec with value i mod 2^n.

Equations
Instances For
    instance BitVec.instOfNat {n i : Nat} :
    Equations
    theorem BitVec.isLt {w : Nat} (x : BitVec w) :
    x.toNat < 2 ^ w

    Return the bound in terms of toNat.

    def BitVec.add {n : Nat} (x y : BitVec n) :

    Addition for bit vectors. This can be interpreted as either signed or unsigned addition modulo 2^n.

    SMT-Lib name: bvadd.

    Equations
    Instances For
      instance BitVec.instAdd {n : Nat} :
      Equations
      • BitVec.instAdd = { add := BitVec.add }
      def BitVec.sub {n : Nat} (x y : BitVec n) :

      Subtraction for bit vectors. This can be interpreted as either signed or unsigned subtraction modulo 2^n.

      Equations
      Instances For
        instance BitVec.instSub {n : Nat} :
        Equations
        • BitVec.instSub = { sub := BitVec.sub }