• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defconst
        • Fast-alists
        • Defmacro
        • Loop$-primer
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
          • Std/strings
            • Pretty-printing
            • Printtree
            • Base64
            • Charset-p
            • Strtok!
            • Cases
            • Concatenation
            • Character-kinds
            • Html-encoding
            • Substrings
              • Istrpos
              • Strrpos
              • Strpos
              • Collect-syms-with-isubstr
                • Istrprefixp
                • Collect-strs-with-isubstr
                • Iprefixp
                • Strsuffixp
                • Firstn-chars
                • Strprefixp
                • Isubstrp
                • Substrp
              • Strtok
              • Equivalences
              • Url-encoding
              • Lines
              • Explode-implode-equalities
              • Ordering
              • Numbers
              • Pad-trim
              • Coercion
              • Std/strings/digit-to-char
              • Substitution
              • Symbols
            • String-listp
            • Stringp
            • Length
            • Search
            • Remove-duplicates
            • Position
            • Coerce
            • Concatenate
            • Reverse
            • String
            • Subseq
            • Substitute
            • String-upcase
            • String-downcase
            • Count
            • Char
            • String<
            • String-equal
            • String-utilities
            • String-append
            • String>=
            • String<=
            • String>
            • Hex-digit-char-theorems
            • String-downcase-gen
            • String-upcase-gen
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Substrings

    Collect-syms-with-isubstr

    Gather symbols whose names have some (case-insensitive) substring.

    (collect-syms-with-isubstr a x) returns a list of all the symbols in the list x that have a as a case-insensitve substring of their symbol-name. The substring tests are carried out with isubstrp.

    See also collect-strs-with-isubstr, which is similar but for string lists instead of symbol lists.

    Definitions and Theorems

    Function: collect-syms-with-isubstr

    (defun collect-syms-with-isubstr (a x)
      (declare (xargs :guard (and (stringp a) (symbol-listp x))))
      (cond ((atom x) nil)
            ((isubstrp a (symbol-name (car x)))
             (cons (car x)
                   (collect-syms-with-isubstr a (cdr x))))
            (t (collect-syms-with-isubstr a (cdr x)))))

    Theorem: istreqv-implies-equal-collect-syms-with-isubstr-1

    (defthm istreqv-implies-equal-collect-syms-with-isubstr-1
      (implies (istreqv a a-equiv)
               (equal (collect-syms-with-isubstr a x)
                      (collect-syms-with-isubstr a-equiv x)))
      :rule-classes (:congruence))

    Theorem: collect-syms-with-isubstr-when-atom

    (defthm collect-syms-with-isubstr-when-atom
      (implies (atom x)
               (equal (collect-syms-with-isubstr a x)
                      nil)))

    Theorem: collect-syms-with-isubstr-of-cons

    (defthm collect-syms-with-isubstr-of-cons
      (equal (collect-syms-with-isubstr a (cons b x))
             (if (isubstrp a (symbol-name b))
                 (cons b (collect-syms-with-isubstr a x))
               (collect-syms-with-isubstr a x))))

    Theorem: member-equal-collect-syms-with-isubstr

    (defthm member-equal-collect-syms-with-isubstr
      (iff (member-equal b (collect-syms-with-isubstr a x))
           (and (member-equal b x)
                (isubstrp a (symbol-name b)))))

    Theorem: subsetp-equal-of-collect-syms-with-isubstr

    (defthm subsetp-equal-of-collect-syms-with-isubstr
      (implies (subsetp-equal x y)
               (subsetp-equal (collect-syms-with-isubstr a x)
                              y)))

    Theorem: subsetp-equal-collect-syms-with-isubstr-self

    (defthm subsetp-equal-collect-syms-with-isubstr-self
      (subsetp-equal (collect-syms-with-isubstr a x)
                     x))