• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
        • Type-prescription
        • Rewrite
        • Meta
          • Force
          • Syntaxp
          • Extended-metafunctions
          • Meta-extract
          • Backchain-limit
          • Magic-ev-fncall
          • Evaluator-restrictions
          • Meta-implicit-hypothesis
          • Transparent-functions
          • Set-skip-meta-termp-checks
          • Case-split
          • Term-table
          • Magic-ev
          • Meta-lemmas
            • Meta-functions
              • Expand-member-meta
              • Reduce-nth-meta
              • Beta-reduce
              • Formal-member
                • Formal-true-listp
                • Formal-consp
                • Formal-nth
              • Meta-lemma-theory
            • Set-skip-meta-termp-checks!
          • Linear
          • Definition
          • Clause-processor
          • Tau-system
          • Forward-chaining
          • Equivalence
          • Congruence
          • Free-variables
          • Executable-counterpart
          • Induction
          • Type-reasoning
          • Compound-recognizer
          • Rewrite-quoted-constant
          • Elim
          • Well-founded-relation-rule
          • Built-in-clause
          • Well-formedness-guarantee
          • Patterned-congruence
          • Rule-classes-introduction
          • Guard-holders
          • Refinement
          • Type-set-inverter
          • Generalize
          • Corollary
          • Induction-heuristics
          • Backchaining
          • Default-backchain-limit
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Meta-functions

    Formal-member

    The definition of member for any x on an eqlable-listp constant l.

    This definition reposes the question (MEMBER x l) as a set of nested IFs.

    Definitions and Theorems

    Function: formal-member

    (defun formal-member (x l)
     (declare (xargs :guard (and (pseudo-termp x)
                                 (eqlable-listp l))))
     (cond
      ((endp l) *nil*)
      (t (cons 'if
               (cons (cons 'eql
                           (cons x
                                 (cons (cons 'quote (cons (car l) 'nil))
                                       'nil)))
                     (cons (cons 'quote (cons l 'nil))
                           (cons (formal-member x (cdr l))
                                 'nil)))))))