• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
      • Bdd
      • Faig
      • Bed
        • Bed-op-p
        • Bed-from-aig
          • Match-aig-var-ite
          • Match-aig-var-ite-aux
          • Match-aig-xor-1
          • Match-aig-iff-2
          • Match-aig-xor-2
          • Match-aig-iff-1
          • Bed-from-aig-aux
          • Match-aig-nor
            • Match-aig-andc2
            • Match-aig-andc1
            • Match-aig-xor
            • Match-aig-or
            • Match-aig-iff
            • Match-aig-and
            • Match-aig-not
          • Bed-mk1
          • Bed-eval
          • Up
          • Aig-translation
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bed-from-aig

    Match-aig-nor

    Signature
    (match-aig-nor x) → (mv okp arg1 arg2)
    Arguments
    x — AIG to pattern match.
    Returns
    okp — Whether x matches (nor arg1 arg2).
    arg1 — On success, arg1 from the match.
    arg2 — On success, arg2 from the match.

    Definitions and Theorems

    Function: match-aig-nor

    (defun match-aig-nor (x)
      (declare (xargs :guard t))
      (let ((__function__ 'match-aig-nor))
        (declare (ignorable __function__))
        (b* (((mv okp na nb) (match-aig-and x))
             ((unless okp) (mv nil nil nil))
             ((mv okp a) (match-aig-not na))
             ((unless okp) (mv nil nil nil))
             ((mv okp b) (match-aig-not nb))
             ((unless okp) (mv nil nil nil)))
          (mv t a b))))

    Theorem: match-aig-nor-correct

    (defthm match-aig-nor-correct
      (b* (((mv okp arg1 arg2) (match-aig-nor x)))
        (implies okp
                 (equal (aig-eval x env)
                        (not (or (aig-eval arg1 env)
                                 (aig-eval arg2 env)))))))

    Theorem: acl2-count-of-match-aig-nor-weak-1

    (defthm acl2-count-of-match-aig-nor-weak-1
      (b* (((mv & arg1 &) (match-aig-nor x)))
        (<= (acl2-count arg1) (acl2-count x)))
      :rule-classes ((:rewrite) (:linear)))

    Theorem: acl2-count-of-match-aig-nor-weak-2

    (defthm acl2-count-of-match-aig-nor-weak-2
      (b* (((mv & & arg2) (match-aig-nor x)))
        (<= (acl2-count arg2) (acl2-count x)))
      :rule-classes ((:rewrite) (:linear)))

    Theorem: acl2-count-of-match-aig-nor-strong-1

    (defthm acl2-count-of-match-aig-nor-strong-1
      (b* (((mv okp arg1 &) (match-aig-nor x)))
        (implies okp
                 (< (acl2-count arg1) (acl2-count x))))
      :rule-classes ((:rewrite) (:linear)))

    Theorem: acl2-count-of-match-aig-nor-strong-2

    (defthm acl2-count-of-match-aig-nor-strong-2
      (b* (((mv okp & arg2) (match-aig-nor x)))
        (implies okp
                 (< (acl2-count arg2) (acl2-count x))))
      :rule-classes ((:rewrite) (:linear)))