Implements svex-argmasks for
(svmask-for-lsh mask args) → argmasks
See svmask-for-rsh. This is entirely similar, just for left shifts instead of right shifts.
Function:
(defun svmask-for-lsh (mask args) (declare (xargs :guard (and (4vmask-p mask) (svexlist-p args)))) (let ((__function__ 'svmask-for-lsh)) (declare (ignorable __function__)) (b* (((svex-nths n x) args) (mask (4vmask-fix mask))) (b* (((when (4vmask-empty mask)) (list 0 0)) (nval (svex-s4xeval n)) ((when (s4vec-2vec-p nval)) (list -1 (sparseint-ash mask (sparseint-val (sparseint-unary-minus (s4vec->upper nval))))))) (list -1 -1)))))
Theorem:
(defthm 4vmasklist-p-of-svmask-for-lsh (b* ((argmasks (svmask-for-lsh mask args))) (4vmasklist-p argmasks)) :rule-classes :rewrite)
Theorem:
(defthm svmask-for-lsh-of-4vmask-fix-mask (equal (svmask-for-lsh (4vmask-fix mask) args) (svmask-for-lsh mask args)))
Theorem:
(defthm svmask-for-lsh-4vmask-equiv-congruence-on-mask (implies (4vmask-equiv mask mask-equiv) (equal (svmask-for-lsh mask args) (svmask-for-lsh mask-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-lsh-of-svexlist-fix-args (equal (svmask-for-lsh mask (svexlist-fix args)) (svmask-for-lsh mask args)))
Theorem:
(defthm svmask-for-lsh-svexlist-equiv-congruence-on-args (implies (svexlist-equiv args args-equiv) (equal (svmask-for-lsh mask args) (svmask-for-lsh mask args-equiv))) :rule-classes :congruence)
Theorem:
(defthm svmask-for-lsh-correct (implies (and (equal (4veclist-mask (svmask-for-lsh mask args) (svexlist-eval args env)) (4veclist-mask (svmask-for-lsh mask args) args1)) (syntaxp (not (equal args1 (cons 'svexlist-eval (cons args (cons env 'nil))))))) (equal (4vec-mask mask (svex-apply 'lsh args1)) (4vec-mask mask (svex-apply 'lsh (svexlist-eval args env))))))