Slow function to look up the 4vmask for a variable in a 4vmask-alist, with proper fty-discipline.
(4vmask-assoc var alist) → mask
Any unbound variables are treated as having mask
Function:
(defun 4vmask-assoc (var alist) (declare (xargs :guard (and (svar-p var) (4vmask-alist-p alist)))) (let ((__function__ '4vmask-assoc)) (declare (ignorable __function__)) (mbe :logic (4vmask-fix (cdr (hons-assoc-equal (svar-fix var) (4vmask-alist-fix alist)))) :exec (let ((look (assoc-equal (svar-fix var) (4vmask-alist-fix alist)))) (if look (cdr look) -1)))))
Theorem:
(defthm 4vmask-p-of-4vmask-assoc (b* ((mask (4vmask-assoc var alist))) (4vmask-p mask)) :rule-classes :type-prescription)
Theorem:
(defthm 4vmask-assoc-of-svar-fix-var (equal (4vmask-assoc (svar-fix var) alist) (4vmask-assoc var alist)))
Theorem:
(defthm 4vmask-assoc-svar-equiv-congruence-on-var (implies (svar-equiv var var-equiv) (equal (4vmask-assoc var alist) (4vmask-assoc var-equiv alist))) :rule-classes :congruence)
Theorem:
(defthm 4vmask-assoc-of-4vmask-alist-fix-alist (equal (4vmask-assoc var (4vmask-alist-fix alist)) (4vmask-assoc var alist)))
Theorem:
(defthm 4vmask-assoc-4vmask-alist-equiv-congruence-on-alist (implies (4vmask-alist-equiv alist alist-equiv) (equal (4vmask-assoc var alist) (4vmask-assoc var alist-equiv))) :rule-classes :congruence)
Theorem:
(defthm 4vmask-assoc-of-nil (equal (4vmask-assoc var nil) -1))