• 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
      • Debugging
      • Projects
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Ubdd-constructors

    Q-or-c2

    (q-or-c2 x y) constructs a UBDD representing (or x (not y)).

    Definitions and Theorems

    Function: q-or-c2-fn

    (defun q-or-c2-fn (x y)
           (declare (xargs :guard t))
           (cond ((atom y) (if y x t))
                 ((atom x) (if x t (q-not y)))
                 ((hons-equal x y) t)
                 (t (qcons (q-or-c2-fn (car x) (car y))
                           (q-or-c2-fn (cdr x) (cdr y))))))

    Function: q-or-c2-macro-fn

    (defun
     q-or-c2-macro-fn (x y)
     (cond
      ((and (or (quotep x) (atom x))
            (or (quotep y) (atom y)))
       (cons 'q-or-c2-fn
             (cons x (cons y 'nil))))
      ((or (quotep y) (atom y))
       (cons
        'mbe
        (cons
         ':logic
         (cons
          (cons 'q-or-c2-fn
                (cons x (cons y 'nil)))
          (cons
           ':exec
           (cons
            (cons
             'let
             (cons
              (cons (cons 'q-or-c2-y-do-not-use-elsewhere
                          (cons y 'nil))
                    'nil)
              (cons
               (cons
                'if
                (cons
                 '(not q-or-c2-y-do-not-use-elsewhere)
                 (cons
                  't
                  (cons
                   (cons
                    'prog2$
                    (cons
                     '(last-chance-wash-memory)
                     (cons
                       (cons 'q-or-c2-fn
                             (cons x '(q-or-c2-y-do-not-use-elsewhere)))
                       'nil)))
                   'nil))))
               'nil)))
            'nil))))))
      (t
       (cons
        'mbe
        (cons
         ':logic
         (cons
          (cons 'q-or-c2-fn
                (cons x (cons y 'nil)))
          (cons
           ':exec
           (cons
            (cons
             'let
             (cons
              (cons (cons 'q-or-c2-x-do-not-use-elsewhere
                          (cons x 'nil))
                    'nil)
              (cons
               (cons
                'if
                (cons
                 '(eq q-or-c2-x-do-not-use-elsewhere t)
                 (cons
                  't
                  (cons
                   (cons
                    'prog2$
                    (cons
                       '(last-chance-wash-memory)
                       (cons (cons 'q-or-c2-fn
                                   (cons 'q-or-c2-x-do-not-use-elsewhere
                                         (cons y 'nil)))
                             'nil)))
                   'nil))))
               'nil)))
            'nil))))))))

    Function: q-or-c2-fn-memoize-condition

    (defun q-or-c2-fn-memoize-condition (x y)
           (declare (ignorable x y)
                    (xargs :guard 't))
           (and (consp x) (consp y)))

    Theorem: ubddp-of-q-or-c2

    (defthm ubddp-of-q-or-c2
            (implies (and (force (ubddp x))
                          (force (ubddp y)))
                     (equal (ubddp (q-or-c2 x y)) t)))

    Theorem: eval-bdd-of-q-or-c2

    (defthm eval-bdd-of-q-or-c2
            (equal (eval-bdd (q-or-c2 x y) values)
                   (implies (eval-bdd y values)
                            (eval-bdd x values))))

    Theorem: canonicalize-q-or-c2

    (defthm canonicalize-q-or-c2
            (implies (and (force (ubddp x))
                          (force (ubddp y)))
                     (equal (q-or-c2 x y) (q-ite y x t))))

    Theorem: q-or-c2-of-t

    (defthm q-or-c2-of-t
            (and (equal (q-or-c2 t x) t)
                 (equal (q-or-c2 x t) x)))

    Theorem: q-or-c2-of-nil

    (defthm q-or-c2-of-nil
            (and (equal (q-or-c2 nil x) (q-not x))
                 (equal (q-or-c2 x nil) t)))