Negate a UBDD.
(q-not x) builds a new UBDD representing
(equal (eval-bdd (q-not x) values) (not (eval-bdd x values)))
Note: memoized for efficiency.
Function:
(defun q-not (x) (declare (xargs :guard t)) (if (atom x) (if x nil t) (hons (q-not (car x)) (q-not (cdr x)))))
Function:
(defun q-not-memoize-condition (x) (declare (ignorable x) (xargs :guard 't)) (and (consp x) (or (consp (car x)) (consp (cdr x)))))
Theorem:
(defthm consp-of-q-not (equal (consp (q-not x)) (consp x)))
Theorem:
(defthm equal-t-and-q-not (equal (equal t (q-not x)) (not x)))
Theorem:
(defthm equal-nil-and-q-not (equal (equal nil (q-not x)) (and (atom x) (if x t nil))))
Theorem:
(defthm q-not-under-iff (iff (q-not x) (if (consp x) t (if x nil t))))
Theorem:
(defthm ubddp-of-q-not (implies (force (ubddp x)) (equal (ubddp (q-not x)) t)))
Theorem:
(defthm eval-bdd-of-q-not (equal (eval-bdd (q-not x) values) (not (eval-bdd x values))))
Theorem:
(defthm canonicalize-q-not (implies (force (ubddp x)) (equal (q-not x) (q-ite x nil t))) :rule-classes :definition)