Generate
Function:
(defun vl-replicate-constint-value (n width x) (declare (xargs :guard (and (natp n) (posp width) (natp x)))) (let ((__function__ 'vl-replicate-constint-value)) (declare (ignorable __function__)) (let ((width (lposfix width))) (if (zp n) 0 (+ (ash (lnfix x) (* width (1- n))) (vl-replicate-constint-value (- n 1) width x))))))
Theorem:
(defthm natp-of-vl-replicate-constint-value (b* ((replicated (vl-replicate-constint-value n width x))) (natp replicated)) :rule-classes :type-prescription)
Theorem:
(defthm vl-replicate-constint-value-of-nfix-n (equal (vl-replicate-constint-value (nfix n) width x) (vl-replicate-constint-value n width x)))
Theorem:
(defthm vl-replicate-constint-value-nat-equiv-congruence-on-n (implies (acl2::nat-equiv n n-equiv) (equal (vl-replicate-constint-value n width x) (vl-replicate-constint-value n-equiv width x))) :rule-classes :congruence)
Theorem:
(defthm vl-replicate-constint-value-of-pos-fix-width (equal (vl-replicate-constint-value n (pos-fix width) x) (vl-replicate-constint-value n width x)))
Theorem:
(defthm vl-replicate-constint-value-pos-equiv-congruence-on-width (implies (acl2::pos-equiv width width-equiv) (equal (vl-replicate-constint-value n width x) (vl-replicate-constint-value n width-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-replicate-constint-value-of-nfix-x (equal (vl-replicate-constint-value n width (nfix x)) (vl-replicate-constint-value n width x)))
Theorem:
(defthm vl-replicate-constint-value-nat-equiv-congruence-on-x (implies (acl2::nat-equiv x x-equiv) (equal (vl-replicate-constint-value n width x) (vl-replicate-constint-value n width x-equiv))) :rule-classes :congruence)