Documentation

Cvc.Typed.Theory.BitVec

Bit-vectors, typed #

A result's width is computed from its arguments' and indices: bvConcat is Term (BitVec n) → Term (BitVec m) → Env (Term (BitVec (n + m))), matching BitVec.append.

def Cvc.Typed.Term.bvNeg [Ω] {n : Nat} (bv : Term (BitVec n)) :

Two's-complement negation.

Equations
Instances For
    def Cvc.Typed.Term.bvUsubo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

    Whether unsigned subtraction overflows.

    Equations
    Instances For
      def Cvc.Typed.Term.bvIte [Ω] {n : Nat} (cnd : Term (BitVec 1)) (thn els : Term (BitVec n)) :

      Bit-vector conditional, selecting on a one-bit condition.

      Equations
      Instances For
        def Cvc.Typed.Term.bvSgt [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

        Signed greater-than.

        Equations
        Instances For
          def Cvc.Typed.Term.bvSdivo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

          Whether signed division overflows.

          Equations
          Instances For
            def Cvc.Typed.Term.bvUmulo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

            Whether unsigned multiplication overflows.

            Equations
            Instances For
              def Cvc.Typed.Term.bvUge [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

              Unsigned greater-than-or-equal-to.

              Equations
              Instances For
                def Cvc.Typed.Term.bvNego [Ω] {n : Nat} (bv : Term (BitVec n)) :

                Whether two's-complement negation overflows.

                Equations
                Instances For

                  Conversion to an integer, reading the bit-vector as unsigned.

                  Equations
                  Instances For
                    def Cvc.Typed.Term.bvXor [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                    Bitwise exclusive disjunction.

                    Equations
                    Instances For
                      def Cvc.Typed.Term.bvUaddo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                      Whether unsigned addition overflows.

                      Equations
                      Instances For
                        def Cvc.Typed.Term.bvRedand [Ω] {n : Nat} (bv : Term (BitVec n)) :

                        Conjunction of all the bits, as a one-bit bit-vector.

                        Equations
                        Instances For
                          def Cvc.Typed.Term.bvRotateRight [Ω] (count : Nat) {n : Nat} (bv : Term (BitVec n)) :

                          Rotation to the right by the given number of bits.

                          Equations
                          Instances For
                            def Cvc.Typed.Term.intToBv [Ω] (size : Nat) (arg : Term Int) :
                            Env (Term (BitVec size))

                            Conversion of an integer to a bit-vector of the given size, modulo 2 ^ size.

                            Equations
                            Instances For
                              def Cvc.Typed.Term.bvMul [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                              Multiplication modulo 2 ^ n.

                              Equations
                              Instances For
                                def Cvc.Typed.Term.bvComp [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                Bit-level comparison, 1 when both arguments are equal and 0 otherwise.

                                Equations
                                Instances For
                                  def Cvc.Typed.Term.bvSaddo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                  Whether signed addition overflows.

                                  Equations
                                  Instances For
                                    def Cvc.Typed.Term.bvShl [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                    Logical left shift of lft by rgt bits.

                                    Equations
                                    Instances For
                                      def Cvc.Typed.Term.bvUgt [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                      Unsigned greater-than.

                                      Equations
                                      Instances For
                                        def Cvc.Typed.Term.bvAshr [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                        Arithmetic right shift of lft by rgt bits.

                                        Equations
                                        Instances For
                                          def Cvc.Typed.Term.bvNot [Ω] {n : Nat} (bv : Term (BitVec n)) :

                                          Bitwise negation.

                                          Equations
                                          Instances For
                                            def Cvc.Typed.Term.bvRedor [Ω] {n : Nat} (bv : Term (BitVec n)) :

                                            Disjunction of all the bits, as a one-bit bit-vector.

                                            Equations
                                            Instances For
                                              def Cvc.Typed.Term.bvSle [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                              Signed less-than-or-equal-to.

                                              Equations
                                              Instances For
                                                def Cvc.Typed.Term.bvZeroExtend [Ω] (extra : Nat) {n : Nat} (bv : Term (BitVec n)) :
                                                Env (Term (BitVec (n + extra)))

                                                Extension with the given number of zeroes.

                                                Equations
                                                Instances For
                                                  def Cvc.Typed.Term.bvExtract [Ω] (hi lo : Nat) {n : Nat} (bv : Term (BitVec n)) :
                                                  Env (Term (BitVec (hi - lo + 1)))

                                                  Bits hi down to lo of bv, bit 0 being the least significant; needs lo ≤ hi < n.

                                                  Equations
                                                  Instances For
                                                    def Cvc.Typed.Term.bvConcat [Ω] {n m : Nat} (lft : Term (BitVec n)) (rgt : Term (BitVec m)) :
                                                    Env (Term (BitVec (n + m)))

                                                    Concatenation, lft giving the most significant bits.

                                                    Equations
                                                    Instances For
                                                      def Cvc.Typed.Term.bvOr [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                      Bitwise disjunction.

                                                      Equations
                                                      Instances For
                                                        def Cvc.Typed.Term.bvUlt [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                        Unsigned less-than.

                                                        Equations
                                                        Instances For
                                                          def Cvc.Typed.Term.bvUle [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                          Unsigned less-than-or-equal-to.

                                                          Equations
                                                          Instances For
                                                            def Cvc.Typed.Term.bvAnd [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                            Bitwise conjunction.

                                                            Equations
                                                            Instances For
                                                              def Cvc.Typed.Term.bvSdiv [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                              Signed division, truncating towards zero.

                                                              On a zero divisor: -1 for a non-negative dividend, 1 for a negative one.

                                                              Equations
                                                              Instances For
                                                                def Cvc.Typed.Term.bvSge [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                Signed greater-than-or-equal-to.

                                                                Equations
                                                                Instances For
                                                                  def Cvc.Typed.Term.bvRotateLeft [Ω] (count : Nat) {n : Nat} (bv : Term (BitVec n)) :

                                                                  Rotation to the left by the given number of bits.

                                                                  Equations
                                                                  Instances For
                                                                    def Cvc.Typed.Term.bvSignExtend [Ω] (extra : Nat) {n : Nat} (bv : Term (BitVec n)) :
                                                                    Env (Term (BitVec (n + extra)))

                                                                    Extension with the given number of copies of the sign bit.

                                                                    Equations
                                                                    Instances For
                                                                      def Cvc.Typed.Term.bvNand [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                      Bitwise negated conjunction.

                                                                      Equations
                                                                      Instances For
                                                                        def Cvc.Typed.Term.bvAdd [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                        Addition modulo 2 ^ n.

                                                                        Equations
                                                                        Instances For
                                                                          def Cvc.Typed.Term.bvUltbv [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                          Unsigned less-than, as a one-bit bit-vector.

                                                                          Equations
                                                                          Instances For
                                                                            def Cvc.Typed.Term.bvSsubo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                            Whether signed subtraction overflows.

                                                                            Equations
                                                                            Instances For
                                                                              def Cvc.Typed.Term.bvUrem [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                              Unsigned remainder; the dividend on a zero divisor.

                                                                              Equations
                                                                              Instances For
                                                                                def Cvc.Typed.Term.bvSltbv [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                Signed less-than, as a one-bit bit-vector.

                                                                                Equations
                                                                                Instances For
                                                                                  def Cvc.Typed.Term.bvSmulo [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                  Whether signed multiplication overflows.

                                                                                  Equations
                                                                                  Instances For
                                                                                    def Cvc.Typed.Term.bvLshr [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                    Logical right shift of lft by rgt bits.

                                                                                    Equations
                                                                                    Instances For
                                                                                      def Cvc.Typed.Term.bvSlt [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                      Signed less-than.

                                                                                      Equations
                                                                                      Instances For
                                                                                        def Cvc.Typed.Term.bvUdiv [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                        Unsigned division, truncating towards zero; all ones on a zero divisor.

                                                                                        Equations
                                                                                        Instances For
                                                                                          def Cvc.Typed.Term.bvXnor [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                          Bitwise negated exclusive disjunction.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Conversion to an integer, reading the bit-vector as signed.

                                                                                            Equations
                                                                                            Instances For
                                                                                              def Cvc.Typed.Term.mkBitVec [Ω] (size : Nat) (value : UInt64) :
                                                                                              Env (Term (BitVec size))

                                                                                              A bit-vector literal of the given size, keeping the low size bits of value.

                                                                                              Equations
                                                                                              Instances For
                                                                                                def Cvc.Typed.Term.bvNor [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                                Bitwise negated disjunction.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  def Cvc.Typed.Term.bvSrem [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                                  Signed remainder, sign following the dividend; the dividend on a zero divisor.

                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    def Cvc.Typed.Term.mkBitVecOfString [Ω] (size : Nat) (repr : String) (base : UInt32) :
                                                                                                    Env (Term (BitVec size))

                                                                                                    A bit-vector literal of the given size, read in base, which must be 2, 10 or 16.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      def Cvc.Typed.Term.bvSub [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                                      Subtraction modulo 2 ^ n.

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        def Cvc.Typed.Term.bvSmod [Ω] {n : Nat} (lft rgt : Term (BitVec n)) :

                                                                                                        Signed remainder, sign following the divisor; the dividend on a zero divisor.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          def Cvc.Typed.Term.bvRepeat [Ω] (count : Nat) {n : Nat} (bv : Term (BitVec n)) :
                                                                                                          Env (Term (BitVec (n * count)))

                                                                                                          The given number of copies of a bit-vector, concatenated.

                                                                                                          Equations
                                                                                                          Instances For

                                                                                                            BitVec's operators with a result of sort BitVec.

                                                                                                            Instances For

                                                                                                              BitVec's operators with a result of sort Int.

                                                                                                              • bvUbvToInt [Ω] (n : Nat) (bv : Term (BitVec n)) : OnInt

                                                                                                                Conversion to an integer, reading the bit-vector as unsigned.

                                                                                                              • bvSbvToInt [Ω] (n : Nat) (bv : Term (BitVec n)) : OnInt

                                                                                                                Conversion to an integer, reading the bit-vector as signed.

                                                                                                              Instances For
                                                                                                                inductive Cvc.Typed.View.BitVec [Ω] :
                                                                                                                Typ → Type

                                                                                                                BitVec's operators, taken apart one level, indexed by the sort each produces.

                                                                                                                Instances For

                                                                                                                  Takes a term apart one level, at its sort, if BitVec owns its operator and the term's sort fits it.

                                                                                                                  Equations
                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                  Instances For

                                                                                                                    BitVec's operators with a result of sort Bool.

                                                                                                                    Instances For

                                                                                                                      Values #

                                                                                                                      def Cvc.Typed.Term.isBitVecValue [Ω] {size : Nat} (term : Term (BitVec size)) :

                                                                                                                      Determine if this term is a bit-vector value.

                                                                                                                      Equations
                                                                                                                      Instances For
                                                                                                                        def Cvc.Typed.Term.getBitVecValue [Ω] {size : Nat} (term : Term (BitVec size)) :
                                                                                                                        Env (BitVec size)

                                                                                                                        The bit-vector a constant term denotes, failing unless it has the expected size.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          @[instance_reducible]
                                                                                                                          Equations
                                                                                                                          • One or more equations did not get rendered due to their size.