Like loghead for 4vecs; the width is also a 4vec.
When
When
Function:
(defun 4vec-zero-ext (n x) (declare (xargs :guard (and (4vec-p n) (4vec-p x)))) (let ((__function__ '4vec-zero-ext)) (declare (ignorable __function__)) (if (and (2vec-p n) (<= 0 (2vec->val n))) (if (mbe :logic nil :exec (and (>= (2vec->val n) (4vec-bit-limit)) (b* (((4vec x))) (or (< x.upper 0) (< x.lower 0))) (4vec-very-large-integer-warning (2vec->val n)))) (4vec-x) (if-2vec-p (x) (2vec (loghead (2vec->val n) (2vec->val x))) (b* (((4vec x)) (nval (2vec->val n))) (4vec (loghead nval x.upper) (loghead nval x.lower))))) (4vec-x))))
Theorem:
(defthm 4vec-p-of-4vec-zero-ext (b* ((x-ext (4vec-zero-ext n x))) (4vec-p x-ext)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-zero-ext-of-4vec-fix-n (equal (4vec-zero-ext (4vec-fix n) x) (4vec-zero-ext n x)))
Theorem:
(defthm 4vec-zero-ext-4vec-equiv-congruence-on-n (implies (4vec-equiv n n-equiv) (equal (4vec-zero-ext n x) (4vec-zero-ext n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm 4vec-zero-ext-of-4vec-fix-x (equal (4vec-zero-ext n (4vec-fix x)) (4vec-zero-ext n x)))
Theorem:
(defthm 4vec-zero-ext-4vec-equiv-congruence-on-x (implies (4vec-equiv x x-equiv) (equal (4vec-zero-ext n x) (4vec-zero-ext n x-equiv))) :rule-classes :congruence)