Symbolic version of 4vec-bit-extract.
Function:
(defun a4vec-bit-extract (n x) (declare (xargs :guard (and (a4vec-p n) (a4vec-p x)))) (let ((__function__ 'a4vec-bit-extract)) (declare (ignorable __function__)) (b* (((a4vec x)) ((a4vec n))) (a4vec-ite (aig-andc2 (a2vec-p n) (aig-sign-s n.upper)) (b* ((ubit (aig-logbitp-n2v 1 n.upper x.upper)) (lbit (aig-logbitp-n2v 1 n.upper x.lower))) (a4vec (aig-scons ubit (aig-sterm nil)) (aig-scons lbit (aig-sterm nil)))) (a4vec-1x)))))
Theorem:
(defthm a4vec-p-of-a4vec-bit-extract (b* ((res (a4vec-bit-extract n x))) (a4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm a4vec-bit-extract-correct (equal (a4vec-eval (a4vec-bit-extract n x) env) (4vec-bit-extract (a4vec-eval n env) (a4vec-eval x env))))
Theorem:
(defthm a4vec-bit-extract-of-a4vec-fix-n (equal (a4vec-bit-extract (a4vec-fix n) x) (a4vec-bit-extract n x)))
Theorem:
(defthm a4vec-bit-extract-a4vec-equiv-congruence-on-n (implies (a4vec-equiv n n-equiv) (equal (a4vec-bit-extract n x) (a4vec-bit-extract n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm a4vec-bit-extract-of-a4vec-fix-x (equal (a4vec-bit-extract n (a4vec-fix x)) (a4vec-bit-extract n x)))
Theorem:
(defthm a4vec-bit-extract-a4vec-equiv-congruence-on-x (implies (a4vec-equiv x x-equiv) (equal (a4vec-bit-extract n x) (a4vec-bit-extract n x-equiv))) :rule-classes :congruence)