Function:
(defun sum-with-cin (cin x y) (declare (xargs :guard (and (bitp cin) (integerp x) (integerp y)))) (let ((__function__ 'sum-with-cin)) (declare (ignorable __function__)) (+ (lbfix cin) (lifix x) (lifix y))))
Theorem:
(defthm integerp-of-sum-with-cin (b* ((sum (sum-with-cin cin x y))) (integerp sum)) :rule-classes :type-prescription)
Theorem:
(defthm logext-of-sum-with-cin-simplify-arg1 (implies (and (equal xx (logext width x)) (bind-free (case-match xx (('logext w xxx) (if (equal w width) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (logext width xxx) (logext width xx))) (equal (logext width (sum-with-cin cin x y)) (logext width (sum-with-cin cin xxx y)))))
Theorem:
(defthm logext-of-sum-with-cin-simplify-arg2 (implies (and (equal xx (logext width x)) (bind-free (case-match xx (('logext w xxx) (if (equal w width) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (logext width xxx) (logext width xx))) (equal (logext width (sum-with-cin cin y x)) (logext width (sum-with-cin cin y xxx)))))
Theorem:
(defthm loghead-of-sum-with-cin-simplify-arg1 (implies (and (equal xx (loghead width x)) (bind-free (case-match xx (('acl2::loghead$inline w xxx) (if (equal w width) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (loghead width xxx) (loghead width xx))) (equal (loghead width (sum-with-cin cin x y)) (loghead width (sum-with-cin cin xxx y)))))
Theorem:
(defthm loghead-of-sum-with-cin-simplify-arg2 (implies (and (equal xx (loghead width x)) (bind-free (case-match xx (('acl2::loghead$inline w xxx) (if (equal w width) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (loghead width xxx) (loghead width xx))) (equal (loghead width (sum-with-cin cin y x)) (loghead width (sum-with-cin cin y xxx)))))
Theorem:
(defthm logapp-of-sum-with-cin-simplify-arg1 (implies (and (equal xx (loghead width x)) (bind-free (case-match xx (('acl2::loghead$inline w xxx) (if (equal w width) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (loghead width xxx) (loghead width xx))) (equal (logapp width (sum-with-cin cin x y) z) (logapp width (sum-with-cin cin xxx y) z))))
Theorem:
(defthm logapp-of-sum-with-cin-simplify-arg2 (implies (and (equal xx (loghead width x)) (bind-free (case-match xx (('acl2::loghead$inline w xxx) (if (equal w width) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (loghead width xxx) (loghead width xx))) (equal (logapp width (sum-with-cin cin y x) z) (logapp width (sum-with-cin cin y xxx) z))))
Theorem:
(defthm logbitp-of-sum-with-cin-simplify-arg1 (implies (and (equal ww (+ 1 (nfix width))) (equal xx (loghead ww x)) (bind-free (case-match xx (('acl2::loghead$inline w xxx) (if (equal w ww) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (loghead ww xxx) (loghead ww xx))) (equal (logbitp width (sum-with-cin cin x y)) (logbitp width (sum-with-cin cin xxx y)))))
Theorem:
(defthm logbitp-of-sum-with-cin-simplify-arg2 (implies (and (equal ww (+ 1 (nfix width))) (equal xx (loghead ww x)) (bind-free (case-match xx (('acl2::loghead$inline w xxx) (if (equal w ww) (if (equal xxx x) nil (cons (cons 'xxx xxx) 'nil)) (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil)))) (& (and (not (equal xx x)) (cons (cons 'xxx xx) 'nil))))) (equal (loghead ww xxx) (loghead ww xx))) (equal (logbitp width (sum-with-cin cin y x)) (logbitp width (sum-with-cin cin y xxx)))))
Theorem:
(defthm sum-with-cin-of-bfix-cin (equal (sum-with-cin (bfix cin) x y) (sum-with-cin cin x y)))
Theorem:
(defthm sum-with-cin-bit-equiv-congruence-on-cin (implies (bit-equiv cin cin-equiv) (equal (sum-with-cin cin x y) (sum-with-cin cin-equiv x y))) :rule-classes :congruence)
Theorem:
(defthm sum-with-cin-of-ifix-x (equal (sum-with-cin cin (ifix x) y) (sum-with-cin cin x y)))
Theorem:
(defthm sum-with-cin-int-equiv-congruence-on-x (implies (int-equiv x x-equiv) (equal (sum-with-cin cin x y) (sum-with-cin cin x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm sum-with-cin-of-ifix-y (equal (sum-with-cin cin x (ifix y)) (sum-with-cin cin x y)))
Theorem:
(defthm sum-with-cin-int-equiv-congruence-on-y (implies (int-equiv y y-equiv) (equal (sum-with-cin cin x y) (sum-with-cin cin x y-equiv))) :rule-classes :congruence)