• 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-and

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

    Definitions and Theorems

    Function: match-aig-and$inline

    (defun match-aig-and$inline (x)
      (declare (xargs :guard t))
      (let ((__function__ 'match-aig-and))
        (declare (ignorable __function__))
        (if (and (not (aig-atom-p x)) (cdr x))
            (mv t (car x) (cdr x))
          (mv nil nil nil))))

    Theorem: match-aig-and-correct

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

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

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

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

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

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

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

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

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