Implements svex-argmasks for
(svmask-for-blkrev mask args) → argmasks
Function:
(defun svmask-for-blkrev (mask args) (declare (xargs :guard (and (4vmask-p mask) (svexlist-p args)))) (let ((__function__ 'svmask-for-blkrev)) (declare (ignorable __function__)) (b* (((svex-nths n b x) args) (mask (4vmask-fix mask))) (b* (((when (4vmask-empty mask)) (list 0 0 0)) (nval (svex-s4xeval n)) (bval (svex-s4xeval b)) (mask mask) ((when (and (s4vec-2vec-p nval) (s4vec-2vec-p bval) (not (sparseint-< (s4vec->upper nval) 0)) (sparseint-< 0 (s4vec->upper bval)))) (b* ((n (sparseint-val (s4vec->upper nval))) (b (sparseint-val (s4vec->upper bval)))) (list -1 -1 (sparseint-unrev-blocks n b mask))))) (list -1 -1 -1)))))
Theorem:
(defthm 4vmasklist-p-of-svmask-for-blkrev (b* ((argmasks (svmask-for-blkrev mask args))) (4vmasklist-p argmasks)) :rule-classes :rewrite)
Theorem:
(defthm svmask-for-blkrev-of-4vmask-fix-mask (equal (svmask-for-blkrev (4vmask-fix mask) args) (svmask-for-blkrev mask args)))
Theorem:
(defthm svmask-for-blkrev-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (svmask-for-blkrev mask args) (svmask-for-blkrev mask-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-blkrev-of-svexlist-fix-args (equal (svmask-for-blkrev mask (svexlist-fix args)) (svmask-for-blkrev mask args)))
Theorem:
(defthm svmask-for-blkrev-svexlist-equiv-congruence-on-args (implies (svexlist-equiv args args-equiv) (equal (svmask-for-blkrev mask args) (svmask-for-blkrev mask args-equiv))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-blkrev-correct (implies (and (equal (4veclist-mask (svmask-for-blkrev mask args) (svexlist-eval args env)) (4veclist-mask (svmask-for-blkrev mask args) args1)) (syntaxp (not (equal args1 (cons 'svexlist-eval (cons args (cons env 'nil))))))) (equal (4vec-mask mask (svex-apply 'blkrev args1)) (4vec-mask mask (svex-apply 'blkrev (svexlist-eval args env))))))