Implements svex-argmasks for
(svmask-for-zerox mask args) → argmasks
We are considering a
For
For
Function:
(defun svmask-for-zerox (mask args) (declare (xargs :guard (and (4vmask-p mask) (svexlist-p args)))) (let ((__function__ 'svmask-for-zerox)) (declare (ignorable __function__)) (b* (((svex-nths n x) args) (mask (4vmask-fix mask))) (b* ((nmask (4vmask-all-or-none mask)) (nval (svex-s4xeval n)) ((unless (s4vec-2vec-p nval)) (list nmask mask)) (nv (s4vec->upper nval)) ((when (sparseint-< nv 0)) (list nmask 0))) (list nmask (sparseint-concatenate (sparseint-val nv) mask 0))))))
Theorem:
(defthm 4vmasklist-p-of-svmask-for-zerox (b* ((argmasks (svmask-for-zerox mask args))) (4vmasklist-p argmasks)) :rule-classes :rewrite)
Theorem:
(defthm svmask-for-zerox-of-4vmask-fix-mask (equal (svmask-for-zerox (4vmask-fix mask) args) (svmask-for-zerox mask args)))
Theorem:
(defthm svmask-for-zerox-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (svmask-for-zerox mask args) (svmask-for-zerox mask-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-zerox-of-svexlist-fix-args (equal (svmask-for-zerox mask (svexlist-fix args)) (svmask-for-zerox mask args)))
Theorem:
(defthm svmask-for-zerox-svexlist-equiv-congruence-on-args (implies (svexlist-equiv args args-equiv) (equal (svmask-for-zerox mask args) (svmask-for-zerox mask args-equiv))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-zerox-correct (implies (and (equal (4veclist-mask (svmask-for-zerox mask args) (svexlist-eval args env)) (4veclist-mask (svmask-for-zerox mask args) args1)) (syntaxp (not (equal args1 (cons 'svexlist-eval (cons args (cons env 'nil))))))) (equal (4vec-mask mask (svex-apply 'zerox args1)) (4vec-mask mask (svex-apply 'zerox (svexlist-eval args env))))))