Function:
(defun s4vec-zero-ext (x y) (declare (xargs :guard (and (s4vec-p x) (s4vec-p y)))) (let ((__function__ 's4vec-zero-ext)) (declare (ignorable __function__)) (b* (((unless (s4vec-index-p x)) (s4vec-x)) (xval (s4vec-sparseint-val (s4vec->upper x)))) (if-s2vec-p (y) (s2vec (sparseint-concatenate xval (s2vec->val y) 0)) (b* (((s4vec y))) (s4vec (sparseint-concatenate xval y.upper 0) (sparseint-concatenate xval y.lower 0)))))))
Theorem:
(defthm s4vec-p-of-s4vec-zero-ext (b* ((res (s4vec-zero-ext x y))) (s4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm s4vec-zero-ext-correct (b* ((?res (s4vec-zero-ext x y))) (equal (s4vec->4vec res) (4vec-zero-ext (s4vec->4vec x) (s4vec->4vec y)))))
Theorem:
(defthm s4vec-zero-ext-of-s4vec-fix-x (equal (s4vec-zero-ext (s4vec-fix x) y) (s4vec-zero-ext x y)))
Theorem:
(defthm s4vec-zero-ext-s4vec-equiv-congruence-on-x (implies (s4vec-equiv x x-equiv) (equal (s4vec-zero-ext x y) (s4vec-zero-ext x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm s4vec-zero-ext-of-s4vec-fix-y (equal (s4vec-zero-ext x (s4vec-fix y)) (s4vec-zero-ext x y)))
Theorem:
(defthm s4vec-zero-ext-s4vec-equiv-congruence-on-y (implies (s4vec-equiv y y-equiv) (equal (s4vec-zero-ext x y) (s4vec-zero-ext x y-equiv))) :rule-classes :congruence)