Symbolic version of 4vec-mask.
Function:
(defun a4vec-mask (mask x) (declare (xargs :guard (and (4vmask-p mask) (a4vec-p x)))) (let ((__function__ 'a4vec-mask)) (declare (ignorable __function__)) (b* (((a4vec x)) (mask (4vmask-fix mask)) ((when (and (a4vec-mask-check mask 0 x.upper t) (a4vec-mask-check mask 0 x.lower nil))) (a4vec-fix x)) (dontcare (sparseint-val (sparseint-bitnot mask))) (dc-aigs (aig-i2v dontcare)) (ans (a4vec (aig-logior-ss dc-aigs x.upper) (aig-logandc1-ss dc-aigs x.lower)))) ans)))
Theorem:
(defthm a4vec-p-of-a4vec-mask (b* ((masked-a4vec (a4vec-mask mask x))) (a4vec-p masked-a4vec)) :rule-classes :rewrite)
Theorem:
(defthm a4vec-mask-correct (equal (a4vec-eval (a4vec-mask mask x) env) (4vec-mask mask (a4vec-eval x env))))
Theorem:
(defthm a4vec-mask-of-4vmask-fix-mask (equal (a4vec-mask (4vmask-fix mask) x) (a4vec-mask mask x)))
Theorem:
(defthm a4vec-mask-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (a4vec-mask mask x) (a4vec-mask mask-equiv x))) :rule-classes :congruence)
Theorem:
(defthm a4vec-mask-of-a4vec-fix-x (equal (a4vec-mask mask (a4vec-fix x)) (a4vec-mask mask x)))
Theorem:
(defthm a4vec-mask-a4vec-equiv-congruence-on-x (implies (a4vec-equiv x x-equiv) (equal (a4vec-mask mask x) (a4vec-mask mask x-equiv))) :rule-classes :congruence)