• 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

    Expand-member-meta

    Meta function for member-equal.

    This meta function is designed to quickly rewrite (MEMBER-EQUAL x l) to a set of nested IFs. This will happen if l is a EQLABLE-LISTP constant. Terms of this form arise for example in case macros.

    Definitions and Theorems

    Function: expand-member-meta

    (defun expand-member-meta (term)
      (declare (xargs :guard (pseudo-termp term)))
      (case-match term
        (('member-equal x ('quote l))
         (if (eqlable-listp l)
             (formal-member x l)
           term))
        (& term)))

    This meta rule rewrites (MEMBER-EQUAL x l) to a set of nested IFs. If l is an eqlable-listp constant, then we rewrite (MEMBER-EQUAL x l) to a set of nested IFs. This lemma is used for example to rewrite expressions generated by case macros for multiple choices, without the necessity of enableing member-equal and eqlable-listp.

    Theorem: expand-member-meta-correct

    (defthm expand-member-meta-correct
      (implies (and (pseudo-termp term) (alistp a))
               (equal (meta-ev term a)
                      (meta-ev (expand-member-meta term) a)))
      :rule-classes ((:meta :trigger-fns (member))))