• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
          • Expression-sizing
          • Occform
          • Oprewrite
          • Expand-functions
          • Delayredux
          • Unparameterization
          • Caseelim
          • Split
          • Selresolve
          • Weirdint-elim
          • Vl-delta
          • Replicate-insts
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
          • Trunc
          • Always-top
          • Gatesplit
          • Gate-elim
          • Expression-optimization
          • Elim-supplies
          • Wildelim
            • Vl-design-wildelim
            • Vl-expr-wildelim
              • Vl-wildeq-replacement-expr
              • Vl-wildneq-replacement-expr
              • Vl-wildeq-rewrite-main
              • Vl-wildeq-decompose-rhs
              • Vl-wildeq-rewrite-exprlist
              • Vl-wildeq-rewrite-expr
          • Drop-blankports
          • Clean-warnings
          • Addinstnames
          • Custom-transform-hooks
          • Annotate
          • Latchcode
          • Elim-unused-vars
          • Problem-modules
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Wildelim

Vl-expr-wildelim

Top-level wrapper for eliminating ==? and !=? from an expression. Avoids reconsing when there are no ==? or !=? operators.

Signature
(vl-expr-wildelim x ctx warnings) → (mv new-warnings new-x)
Arguments
x — Guard (vl-expr-p x).
ctx — Guard (vl-context-p ctx).
warnings — Guard (vl-warninglist-p warnings).
Returns
new-warnings — Type (vl-warninglist-p new-warnings).
new-x — Type (vl-expr-p new-x).

Definitions and Theorems

Function: vl-expr-wildelim

(defun vl-expr-wildelim (x ctx warnings)
 (declare (xargs :guard (and (vl-expr-p x)
                             (vl-context-p ctx)
                             (vl-warninglist-p warnings))))
 (let ((__function__ 'vl-expr-wildelim))
  (declare (ignorable __function__))
  (mbe
   :logic
   (vl-wildeq-rewrite-expr x ctx warnings)
   :exec
   (if (not (vl-expr-has-ops '(:vl-binary-wildeq :vl-binary-wildneq)
                             x))
       (mv warnings x)
     (vl-wildeq-rewrite-expr x ctx warnings)))))

Theorem: vl-warninglist-p-of-vl-expr-wildelim.new-warnings

(defthm vl-warninglist-p-of-vl-expr-wildelim.new-warnings
  (b* (((mv ?new-warnings ?new-x)
        (vl-expr-wildelim x ctx warnings)))
    (vl-warninglist-p new-warnings))
  :rule-classes :rewrite)

Theorem: vl-expr-p-of-vl-expr-wildelim.new-x

(defthm vl-expr-p-of-vl-expr-wildelim.new-x
  (b* (((mv ?new-warnings ?new-x)
        (vl-expr-wildelim x ctx warnings)))
    (vl-expr-p new-x))
  :rule-classes :rewrite)

Theorem: vl-expr-wildelim-of-vl-expr-fix-x

(defthm vl-expr-wildelim-of-vl-expr-fix-x
  (equal (vl-expr-wildelim (vl-expr-fix x)
                           ctx warnings)
         (vl-expr-wildelim x ctx warnings)))

Theorem: vl-expr-wildelim-vl-expr-equiv-congruence-on-x

(defthm vl-expr-wildelim-vl-expr-equiv-congruence-on-x
  (implies (vl-expr-equiv x x-equiv)
           (equal (vl-expr-wildelim x ctx warnings)
                  (vl-expr-wildelim x-equiv ctx warnings)))
  :rule-classes :congruence)

Theorem: vl-expr-wildelim-of-vl-context-fix-ctx

(defthm vl-expr-wildelim-of-vl-context-fix-ctx
  (equal (vl-expr-wildelim x (vl-context-fix ctx)
                           warnings)
         (vl-expr-wildelim x ctx warnings)))

Theorem: vl-expr-wildelim-vl-context-equiv-congruence-on-ctx

(defthm vl-expr-wildelim-vl-context-equiv-congruence-on-ctx
  (implies (vl-context-equiv ctx ctx-equiv)
           (equal (vl-expr-wildelim x ctx warnings)
                  (vl-expr-wildelim x ctx-equiv warnings)))
  :rule-classes :congruence)

Theorem: vl-expr-wildelim-of-vl-warninglist-fix-warnings

(defthm vl-expr-wildelim-of-vl-warninglist-fix-warnings
  (equal (vl-expr-wildelim x ctx (vl-warninglist-fix warnings))
         (vl-expr-wildelim x ctx warnings)))

Theorem: vl-expr-wildelim-vl-warninglist-equiv-congruence-on-warnings

(defthm vl-expr-wildelim-vl-warninglist-equiv-congruence-on-warnings
  (implies (vl-warninglist-equiv warnings warnings-equiv)
           (equal (vl-expr-wildelim x ctx warnings)
                  (vl-expr-wildelim x ctx warnings-equiv)))
  :rule-classes :congruence)

Subtopics

Vl-wildeq-replacement-expr
Construct the expression to replace lhs ==? rhs.
Vl-wildneq-replacement-expr
Construct the expression to replace lhs !=? rhs.
Vl-wildeq-rewrite-main
Vl-wildeq-decompose-rhs
Compute the care mask and zapped right-hand side for an ==? or !=? operator.
Vl-wildeq-rewrite-exprlist
Eliminate ==? and !=? operators from an expression list.
Vl-wildeq-rewrite-expr
Eliminate ==? and !=? operators from an expression.