• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Html-encoding
        • Character-kinds
        • Substrings
        • Strtok
        • Equivalences
        • Url-encoding
        • Lines
        • Ordering
        • Numbers
        • Pad-trim
        • Coercion
        • Std/strings-extensions
        • Std/strings/digit-to-char
        • Substitution
        • Symbols
          • Intern-list
          • Symbol-list-names
        • Std/io
        • Std/osets
        • Std/system
        • Std/basic
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Symbols
    • Symbol-name
    • Symbol-listp

    Symbol-list-names

    Extract the name of every symbol in a list.

    (symbol-list-names x) just maps symbol-name across the list x, returning a new list that has the names of all the symbols in x.

    Example:

    (symbol-list-names '(:foo acl2::bar str::baz))
      -->
    ("foo" "bar" "baz")

    Definitions and Theorems

    Function: symbol-list-names

    (defun symbol-list-names (x)
           (declare (xargs :guard (symbol-listp x)))
           (if (atom x)
               nil
               (cons (symbol-name (car x))
                     (symbol-list-names (cdr x)))))

    Theorem: symbol-list-names-when-atom

    (defthm symbol-list-names-when-atom
            (implies (atom x)
                     (equal (symbol-list-names x) nil)))

    Theorem: symbol-list-names-of-cons

    (defthm symbol-list-names-of-cons
            (equal (symbol-list-names (cons a x))
                   (cons (symbol-name a)
                         (symbol-list-names x))))

    Theorem: string-listp-of-symbol-list-names

    (defthm string-listp-of-symbol-list-names
            (string-listp (symbol-list-names x)))

    Theorem: list-equiv-implies-equal-symbol-list-names-1

    (defthm list-equiv-implies-equal-symbol-list-names-1
            (implies (list-equiv x x-equiv)
                     (equal (symbol-list-names x)
                            (symbol-list-names x-equiv)))
            :rule-classes (:congruence))

    Theorem: symbol-list-names-of-append

    (defthm symbol-list-names-of-append
            (equal (symbol-list-names (append x y))
                   (append (symbol-list-names x)
                           (symbol-list-names y))))

    Theorem: symbol-list-names-of-revappend

    (defthm symbol-list-names-of-revappend
            (equal (symbol-list-names (revappend x y))
                   (revappend (symbol-list-names x)
                              (symbol-list-names y))))

    Theorem: symbol-list-names-of-rev

    (defthm symbol-list-names-of-rev
            (equal (symbol-list-names (rev x))
                   (rev (symbol-list-names x))))