• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
      • Bdd
      • Faig
      • Bed
      • 4v
        • 4v-sexprs
          • 4v-sexpr-vars
          • 4v-sexpr-eval
          • 4v-sexpr-to-faig
          • 4v-sexpr-restrict-with-rw
          • 4vs-constructors
          • 4v-sexpr-compose-with-rw
          • 4v-sexpr-restrict
          • 4v-sexpr-alist-extract
          • 4v-sexpr-compose
          • 4v-nsexpr-p
          • 4v-sexpr-purebool-p
          • 4v-sexpr-<=
          • Sfaig
          • Sexpr-equivs
            • 4v-sexpr-alist-equiv
            • 4v-env-equiv
            • 4v-sexpr-list-equiv
            • 4v-sexpr-equiv
            • 4v-alists-agree
              • 4v-alists-disagree-witness
              • Key-and-env-equiv
              • 4v-sexpr-alist-equiv-alt
              • 4v-sexpr-alist-pair-equiv
              • 4v-cdr-consp-equiv
              • 4v-cdr-equiv
            • 3v-syntax-sexprp
            • Sexpr-rewriting
            • 4v-sexpr-ind
            • 4v-alist-extract
          • 4v-monotonicity
          • 4v-operations
          • Why-4v-logic
          • 4v-<=
          • 4vp
          • 4vcases
          • 4v-fix
          • 4v-lookup
      • Projects
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • 4v-alists-agree

    4v-alists-disagree-witness

    Try to find a key for which two four-valued alists don't agree.

    Definitions and Theorems

    Function: 4v-alists-disagree-witness

    (defun 4v-alists-disagree-witness (keys al1 al2)
      (declare (xargs :guard t))
      (if (atom keys)
          nil
        (if (equal (4v-lookup (car keys) al1)
                   (4v-lookup (car keys) al2))
            (4v-alists-disagree-witness (cdr keys)
                                        al1 al2)
          (car keys))))

    Theorem: 4v-alists-witness-correct

    (defthm 4v-alists-witness-correct
      (iff (4v-alists-agree keys al1 al2)
           (let ((witness (4v-alists-disagree-witness keys al1 al2)))
             (or (not (member-equal witness keys))
                 (equal (4v-lookup witness al1)
                        (4v-lookup witness al2))))))