• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
          • Functions
          • 4vmask
          • Why-infinite-width
          • Svex-vars
          • Evaluation
            • Svex-xeval
            • Svex-mono-eval
            • Svex-eval
              • Svex-eval-basics
            • Svex-apply
            • Svex-env
            • Svex-alist-eval
            • Svar-boolmasks-lookup
            • Svex-s4eval
            • Svexlist-unquote
            • Svex-alist-eval-for-symbolic
            • Svexlist-eval
            • Svexlist-quotesp
            • Svar-boolmasks
            • Svexlist-s4eval
            • Svexlist-eval-for-symbolic
          • Values
        • Symbolic-test-vector
        • Vl-to-svex
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Evaluation

Svex-eval

Evaluate an svex in some environment.

Signature
(svex-eval x env) → val
Arguments
x — Expression to evaluate.
    Guard (svex-p x).
env — Variable bindings. Must be a fast-alist.
    Guard (svex-env-p env).
Returns
val — Value of x under this environment.
    Type (4vec-p val).

svex-eval is a straightforward evaluator for svex formulas. It takes as arguments an svex object to evaluate, and an environment mapping variables (svar objects) to 4vec values. It returns the 4vec value of the formula, under this assignment, in the obvious way:

  • Constants evaluate to themselves.
  • Variables are looked up using svex-env-fastlookup. Note that any unbound variables evaluate to an infinite-width X.
  • Functions applications are handled with svex-apply.

We typically expect svexes to be constructed with hons. To take advantage of this structure sharing, we memoize svex-eval.

Theorem: return-type-of-svex-eval.val

(defthm return-type-of-svex-eval.val
  (b* ((?val (svex-eval x env)))
    (4vec-p val))
  :rule-classes :rewrite)

Theorem: return-type-of-svexlist-eval.vals

(defthm return-type-of-svexlist-eval.vals
  (b* ((?vals (svexlist-eval x env)))
    (4veclist-p vals))
  :rule-classes :rewrite)

Function: svex-eval-memoize-condition

(defun svex-eval-memoize-condition (x env)
  (declare (ignorable x env)
           (xargs :guard (if (svex-p x) (svex-env-p env) 'nil)))
  (eq (svex-kind x) :call))

Subtopics

Svex-eval-basics
Very basic lemmas about svex-eval.