Function:
(defun s4vec-rsh (amt x) (declare (xargs :guard (and (s4vec-p amt) (s4vec-p x)))) (let ((__function__ 's4vec-rsh)) (declare (ignorable __function__)) (b* (((unless (s4vec-2vec-p amt)) (s4vec-x)) (amtval (s4vec-sparseint-val (sparseint-unary-minus (s4vec->upper amt))))) (s4vec-shift-core amtval x))))
Theorem:
(defthm s4vec-p-of-s4vec-rsh (b* ((res (s4vec-rsh amt x))) (s4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm s4vec-rsh-correct (b* ((?res (s4vec-rsh amt x))) (equal (s4vec->4vec res) (4vec-rsh (s4vec->4vec amt) (s4vec->4vec x)))))
Theorem:
(defthm s4vec-rsh-of-s4vec-fix-amt (equal (s4vec-rsh (s4vec-fix amt) x) (s4vec-rsh amt x)))
Theorem:
(defthm s4vec-rsh-s4vec-equiv-congruence-on-amt (implies (s4vec-equiv amt amt-equiv) (equal (s4vec-rsh amt x) (s4vec-rsh amt-equiv x))) :rule-classes :congruence)
Theorem:
(defthm s4vec-rsh-of-s4vec-fix-x (equal (s4vec-rsh amt (s4vec-fix x)) (s4vec-rsh amt x)))
Theorem:
(defthm s4vec-rsh-s4vec-equiv-congruence-on-x (implies (s4vec-equiv x x-equiv) (equal (s4vec-rsh amt x) (s4vec-rsh amt x-equiv))) :rule-classes :congruence)