• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
        • Implemented-opcodes
        • To-do
        • Proof-utilities
          • System-level-marking-view-proof-utilities
          • Non-marking-view-proof-utilities
          • App-view-proof-utilities
          • Subset-p
          • Disjoint-p
          • Pos
          • Member-p
            • No-duplicates-p
            • Common-system-level-utils
            • Debugging-code-proofs
            • General-memory-utils
            • X86-row-wow-thms
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Proof-utilities

    Member-p

    Signature
    (member-p e x) → *
    Arguments
    x — Guard (true-listp x).

    Definitions and Theorems

    Function: member-p

    (defun member-p (e x)
      (declare (xargs :guard (true-listp x)))
      (let ((__function__ 'member-p))
        (declare (ignorable __function__))
        (if (atom x)
            nil
          (if (equal e (car x))
              t
            (member-p e (cdr x))))))

    Theorem: member-p-of-not-a-consp

    (defthm member-p-of-not-a-consp
      (implies (not (consp x))
               (equal (member-p e x) nil)))

    Theorem: member-p-of-nil

    (defthm member-p-of-nil
      (equal (member-p e nil) nil))

    Theorem: member-p-cons

    (defthm member-p-cons
      (equal (member-p e1 (cons e2 x))
             (if (equal e1 e2) t (member-p e1 x))))

    Theorem: member-p-append

    (defthm member-p-append
      (equal (member-p e (append x y))
             (or (member-p e x) (member-p e y))))

    Theorem: member-p-cdr

    (defthm member-p-cdr
      (implies (member-p e (cdr x))
               (member-p e x))
      :rule-classes ((:rewrite :backchain-limit-lst (0))))

    Theorem: member-p-iff-member-equal

    (defthm member-p-iff-member-equal
      (iff (member-p e x) (member-equal e x)))