• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
        • Equal-by-eval-bdds
        • Ubdd-constructors
          • Q-and
          • Q-ite
          • Q-or
          • Q-implies
          • Q-iff
          • Q-and-c2
          • Q-and-c1
          • Q-or-c2
          • Q-not
          • Q-ite-fn
          • Q-xor
          • Q-and-is-nil
            • Cheap-and-expensive-arguments
            • Q-compose-list
            • Q-compose
            • Qv
            • Q-and-is-nilc2
            • Q-nor
            • Q-nand
          • Eval-bdd
          • Ubddp
          • Ubdd-fix
          • Q-sat
          • Bdd-sat-dfs
          • Eval-bdd-list
          • Qcdr
          • Qcar
          • Q-sat-any
          • Canonicalize-to-q-ite
          • Ubdd-listp
          • Qcons
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Ubdd-constructors

    Q-and-is-nil

    (q-and-is-nil x y) determines whether (q-and x y) is always false.

    You could ask the same question in other ways, say for instance

    (not (q-and x y))

    But q-and-is-nil is especially efficient and doesn't need to construct an intermediate UBDD.

    Definitions and Theorems

    Function: q-and-is-nil

    (defun q-and-is-nil (x y)
           (declare (xargs :guard t))
           (cond ((eq x t) (eq y nil))
                 ((atom x) t)
                 ((eq y t) nil)
                 ((atom y) t)
                 (t (and (q-and-is-nil (qcar x) (qcar y))
                         (q-and-is-nil (qcdr x) (qcdr y))))))

    Function: q-and-is-nil-memoize-condition

    (defun q-and-is-nil-memoize-condition (x y)
           (declare (ignorable x y)
                    (xargs :guard 't))
           (and (consp x) (consp y)))

    Theorem: q-and-is-nil-removal

    (defthm q-and-is-nil-removal
            (implies (and (force (ubddp x))
                          (force (ubddp y)))
                     (equal (q-and-is-nil x y)
                            (not (q-and x y)))))