• 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
          • 3v-syntax-sexprp
          • Sexpr-rewriting
            • 4v-shannon-expansion
            • Onehot-rewriting
              • 4v-onehot-sexpr-list-prime
              • 4v-onehot-sexpr-prime
              • 4v-onehot-rw-sexpr-alist-aux
              • 4v-onehot-rw-sexpr-alist
              • 4v-onehot-rw-sexpr
              • 4vs-onehot
              • 4vs-ite*-list-dumb
              • 4v-onehot-filter
              • 4v-onehot-list-p
              • 4v-sexpr-restrict-with-rw
              • 4v-sexpr-compose-with-rw
              • Sexpr-rewrite
              • Sexpr-rewrite-default
              • Sexpr-rewriting-internals
              • *sexpr-rewrites*
            • 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
    • 4vs-onehot
    • Onehot-rewriting

    4v-onehot-list-p

    (4v-onehot-list-p x) determines if a list of 4vps has exactly one member that is T while the rest are F.

    Definitions and Theorems

    Function: 4v-onehot-list-p

    (defun 4v-onehot-list-p (x)
      (declare (xargs :guard t))
      (if (atom x)
          nil
        (4vcases (car x)
                 (f (4v-onehot-list-p (cdr x)))
                 (t (all-equalp *4vf* (cdr x)))
                 (& nil))))

    Theorem: 4v-onehot-list-p-when-atom

    (defthm 4v-onehot-list-p-when-atom
      (implies (atom x)
               (equal (4v-onehot-list-p x) nil)))

    Theorem: 4v-onehot-list-p-of-cons

    (defthm 4v-onehot-list-p-of-cons
      (equal (4v-onehot-list-p (cons a x))
             (4vcases a (f (4v-onehot-list-p x))
                      (t (all-equalp *4vf* x))
                      (& nil))))