Sign-extend the given sparseint at the given (positive) position
(sparseint-sign-ext n x) → ext
Function:
(defun sparseint-sign-ext (n x) (declare (xargs :guard (and (posp n) (sparseint-p x)))) (let ((__function__ 'sparseint-sign-ext)) (declare (ignorable __function__)) (b* ((x (sparseint-fix x)) ((mv ans ?height) (sparseint$-sign-ext n x (sparseint$-height x)))) ans)))
Theorem:
(defthm sparseint-p-of-sparseint-sign-ext (b* ((ext (sparseint-sign-ext n x))) (sparseint-p ext)) :rule-classes :rewrite)
Theorem:
(defthm sparseint-sign-ext-correct (b* nil (equal (sparseint-val (sparseint-sign-ext n x)) (logext n (sparseint-val x)))))
Theorem:
(defthm sparseint-sign-ext-of-pos-fix-n (equal (sparseint-sign-ext (pos-fix n) x) (sparseint-sign-ext n x)))
Theorem:
(defthm sparseint-sign-ext-pos-equiv-congruence-on-n (implies (pos-equiv n n-equiv) (equal (sparseint-sign-ext n x) (sparseint-sign-ext n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm sparseint-sign-ext-of-sparseint-fix-x (equal (sparseint-sign-ext n (sparseint-fix x)) (sparseint-sign-ext n x)))
Theorem:
(defthm sparseint-sign-ext-sparseint-equiv-congruence-on-x (implies (sparseint-equiv x x-equiv) (equal (sparseint-sign-ext n x) (sparseint-sign-ext n x-equiv))) :rule-classes :congruence)