Function:
(defun s4vec-quotient (x y) (declare (xargs :guard (and (s4vec-p x) (s4vec-p y)))) (let ((__function__ 's4vec-quotient)) (declare (ignorable __function__)) (b* (((unless (and (s4vec-2vec-p x) (s4vec-2vec-p y))) (s4vec-x)) ((when (sparseint-equal (s4vec->upper y) 0)) (s4vec-x)) (xval (s4vec-sparseint-val (s4vec->upper x))) (yval (s4vec-sparseint-val (s4vec->upper y)))) (s2vec (int-to-sparseint (truncate xval yval))))))
Theorem:
(defthm s4vec-p-of-s4vec-quotient (b* ((res (s4vec-quotient x y))) (s4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm s4vec-quotient-correct (b* ((?res (s4vec-quotient x y))) (equal (s4vec->4vec res) (4vec-quotient (s4vec->4vec x) (s4vec->4vec y)))))
Theorem:
(defthm s4vec-quotient-of-s4vec-fix-x (equal (s4vec-quotient (s4vec-fix x) y) (s4vec-quotient x y)))
Theorem:
(defthm s4vec-quotient-s4vec-equiv-congruence-on-x (implies (s4vec-equiv x x-equiv) (equal (s4vec-quotient x y) (s4vec-quotient x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm s4vec-quotient-of-s4vec-fix-y (equal (s4vec-quotient x (s4vec-fix y)) (s4vec-quotient x y)))
Theorem:
(defthm s4vec-quotient-s4vec-equiv-congruence-on-y (implies (s4vec-equiv y y-equiv) (equal (s4vec-quotient x y) (s4vec-quotient x y-equiv))) :rule-classes :congruence)