(vl-gencase-match x y ss scopes warnings) → (mv errmsg warnings equalp)
Function:
(defun vl-gencase-match (x y ss scopes warnings) (declare (xargs :guard (and (vl-expr-p x) (vl-expr-p y) (vl-scopestack-p ss) (vl-elabscopes-p scopes) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-gencase-match)) (declare (ignorable __function__)) (b* ((eq-expr (make-vl-binary :op :vl-binary-ceq :left x :right y)) (warnings (ok)) ((wmv warnings res) (vl-consteval eq-expr ss scopes)) ((mv ok result) (vl-expr-case res :vl-literal (vl-value-case res.val :vl-constint (mv t (not (eql 0 res.val.value))) :otherwise (mv nil nil)) :otherwise (mv nil nil)))) (if ok (mv nil warnings result) (mv (vmsg "Failed to evaluate: ~a0." eq-expr) warnings nil)))))
Theorem:
(defthm return-type-of-vl-gencase-match.errmsg (b* (((mv ?errmsg ?warnings common-lisp::?equalp) (vl-gencase-match x y ss scopes warnings))) (iff (vl-msg-p errmsg) errmsg)) :rule-classes :rewrite)
Theorem:
(defthm vl-warninglist-p-of-vl-gencase-match.warnings (b* (((mv ?errmsg ?warnings common-lisp::?equalp) (vl-gencase-match x y ss scopes warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-gencase-match-of-vl-expr-fix-x (equal (vl-gencase-match (vl-expr-fix x) y ss scopes warnings) (vl-gencase-match x y ss scopes warnings)))
Theorem:
(defthm vl-gencase-match-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-gencase-match x y ss scopes warnings) (vl-gencase-match x-equiv y ss scopes warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gencase-match-of-vl-expr-fix-y (equal (vl-gencase-match x (vl-expr-fix y) ss scopes warnings) (vl-gencase-match x y ss scopes warnings)))
Theorem:
(defthm vl-gencase-match-vl-expr-equiv-congruence-on-y (implies (vl-expr-equiv y y-equiv) (equal (vl-gencase-match x y ss scopes warnings) (vl-gencase-match x y-equiv ss scopes warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gencase-match-of-vl-scopestack-fix-ss (equal (vl-gencase-match x y (vl-scopestack-fix ss) scopes warnings) (vl-gencase-match x y ss scopes warnings)))
Theorem:
(defthm vl-gencase-match-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-gencase-match x y ss scopes warnings) (vl-gencase-match x y ss-equiv scopes warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gencase-match-of-vl-elabscopes-fix-scopes (equal (vl-gencase-match x y ss (vl-elabscopes-fix scopes) warnings) (vl-gencase-match x y ss scopes warnings)))
Theorem:
(defthm vl-gencase-match-vl-elabscopes-equiv-congruence-on-scopes (implies (vl-elabscopes-equiv scopes scopes-equiv) (equal (vl-gencase-match x y ss scopes warnings) (vl-gencase-match x y ss scopes-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-gencase-match-of-vl-warninglist-fix-warnings (equal (vl-gencase-match x y ss scopes (vl-warninglist-fix warnings)) (vl-gencase-match x y ss scopes warnings)))
Theorem:
(defthm vl-gencase-match-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-gencase-match x y ss scopes warnings) (vl-gencase-match x y ss scopes warnings-equiv))) :rule-classes :congruence)