Basic rewriting of q-ite expressions.
When using the canonicalize-to-q-ite strategy, you generally end up with big nests of q-ite calls. Afterward, these basic sorts of reductions can be useful.
Theorem:
(defthm |(q-ite x (q-ite y nil t) z)| (implies (and (syntaxp (not (equal z ''t))) (force (ubddp x)) (force (ubddp y)) (force (ubddp z))) (equal (q-ite x (q-ite y nil t) z) (q-ite y (q-ite x nil z) (q-ite x t z)))))
Theorem:
(defthm |(q-ite x (q-ite y nil t) t)| (implies (and (force (ubddp x)) (force (ubddp y)) (force (ubddp z))) (equal (q-ite x (q-ite y nil t) t) (q-ite y (q-ite x nil t) t))))
Theorem:
(defthm |(q-ite (q-ite a b c) x y)| (implies (and (force (ubddp a)) (force (ubddp b)) (force (ubddp c)) (force (ubddp x)) (force (ubddp y))) (equal (q-ite (q-ite a b c) x y) (q-ite a (q-ite b x y) (q-ite c x y)))))
Theorem:
(defthm |(q-ite x y y)| (equal (q-ite x y y) y))
Theorem:
(defthm |(q-ite x x y)| (implies (and (force (ubddp x)) (force (ubddp y))) (equal (q-ite x x y) (q-ite x t y))))
Theorem:
(defthm |(q-ite x y x)| (equal (q-ite x y x) (q-ite x y nil)))
Theorem:
(defthm |(q-ite x t nil)| (implies (force (ubddp x)) (equal (q-ite x t nil) x)))
Theorem:
(defthm |(q-ite non-nil y z)| (implies (and (atom x) x) (equal (q-ite x y z) y)))
Theorem:
(defthm |(q-ite t x y)| (equal (q-ite t x y) x))
Theorem:
(defthm |(q-ite nil x y)| (equal (q-ite nil x y) y))