Implements svex-argmasks for
(svmask-for-override mask args) → argmasks
We are considering a
It doesn't seem like we can do any better than
However, we definitely don't care about the value of
Function:
(defun svmask-for-override (mask args) (declare (xargs :guard (and (4vmask-p mask) (svexlist-p args)))) (let ((__function__ 'svmask-for-override)) (declare (ignorable __function__)) (b* (((svex-nths stronger weaker) args) (mask (4vmask-fix mask))) (b* (((s4vec sval) (svex-s4xeval stronger)) (strong-nonbool (sparseint-bitxor sval.upper sval.lower)) (weak-mask (sparseint-bitand mask strong-nonbool))) (list mask weak-mask)))))
Theorem:
(defthm 4vmasklist-p-of-svmask-for-override (b* ((argmasks (svmask-for-override mask args))) (4vmasklist-p argmasks)) :rule-classes :rewrite)
Theorem:
(defthm svmask-for-override-of-4vmask-fix-mask (equal (svmask-for-override (4vmask-fix mask) args) (svmask-for-override mask args)))
Theorem:
(defthm svmask-for-override-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (svmask-for-override mask args) (svmask-for-override mask-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-override-of-svexlist-fix-args (equal (svmask-for-override mask (svexlist-fix args)) (svmask-for-override mask args)))
Theorem:
(defthm svmask-for-override-svexlist-equiv-congruence-on-args (implies (svexlist-equiv args args-equiv) (equal (svmask-for-override mask args) (svmask-for-override mask args-equiv))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-override-correct (implies (and (equal (4veclist-mask (svmask-for-override mask args) (svexlist-eval args env)) (4veclist-mask (svmask-for-override mask args) args1)) (syntaxp (not (equal args1 (cons 'svexlist-eval (cons args (cons env 'nil))))))) (equal (4vec-mask mask (svex-apply 'override args1)) (4vec-mask mask (svex-apply 'override (svexlist-eval args env))))))