Documentation

SSA.Experimental.Bits.AutoStructs.Defs

Term Language #

This file defines the term language the decision procedure operates on, and the denotation of these terms into operations on bitstreams

A Term is an expression in the language our decision procedure operates on, it represent an infinite bitstream (with free variables)

Instances For

    t.arity is the max free variable id that occurs in the given term t, and thus is an upper bound on the number of free variables that occur in t.

    Note that the upper bound is not perfect: a term like var 10 only has a single free variable, but its arity will be 11

    Equations
    Instances For
      def AutoStructs.Term.evalFin {w : } (t : AutoStructs.Term) (vars : Fin t.arityBitVec w) :

      Evaluate a term t to the BitVec it represents.

      This differs from Term.eval in that Term.evalFin uses Term.arity to determine the number of free variables that occur in the given term, and only require that many bitstream values to be given in vars.

      Equations
      Instances For
        def AutoStructs.Term.evalNat {w : } (t : AutoStructs.Term) (vars : BitVec w) :
        Equations
        • (AutoStructs.Term.var n).evalNat vars = vars (Fin.last n)
        • AutoStructs.Term.zero.evalNat vars = BitVec.zero w
        • AutoStructs.Term.one.evalNat vars = 1
        • AutoStructs.Term.negOne.evalNat vars = -1
        • (t₁.and t₂).evalNat vars = t₁.evalNat vars &&& t₂.evalNat vars
        • (t₁.or t₂).evalNat vars = t₁.evalNat vars ||| t₂.evalNat vars
        • (t₁.xor t₂).evalNat vars = t₁.evalNat vars ^^^ t₂.evalNat vars
        • t_1.not.evalNat vars = ~~~t_1.evalNat vars
        • (t₁.add t₂).evalNat vars = t₁.evalNat vars + t₂.evalNat vars
        • (t₁.sub t₂).evalNat vars = t₁.evalNat vars - t₂.evalNat vars
        • t_1.neg.evalNat vars = -t_1.evalNat vars
        • t_1.incr.evalNat vars = t_1.evalNat vars + 1
        • t_1.decr.evalNat vars = t_1.evalNat vars - 1
        Instances For
          Equations
          Instances For
            Instances For
              Equations
              Instances For
                def AutoStructs.Formula.sat {w : } (φ : AutoStructs.Formula) (ρ : Fin φ.arityBitVec w) :
                Equations
                Instances For
                  Equations
                  Instances For
                    def AutoStructs.envOfArray {w : } (a : Array (BitVec w)) :
                    BitVec w
                    Equations
                    Instances For