• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Mutual-recursion
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Loop$-primer
        • Fast-alists
        • Defmacro
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Irrelevant-formals
        • Efficiency
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
        • Program-wrapper
        • Get-internal-time
        • Basics
        • Packages
        • Defmacro-untouchable
        • Primitive
        • <<
        • Revert-world
        • Set-duplicate-keys-action
        • Unmemoize
        • Symbols
          • Symbol-listp
          • Symbolp
          • Symbol-name
          • Symbol-package-name
          • Keywordp
          • Add-to-set
          • Symbol<
            • Packn
            • Packn-pos
            • Symbol-name-lst
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Defopen
          • Sleep
        • Start-here
        • Real
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Symbols
    • ACL2-built-ins

    Symbol<

    Less-than test for symbols

    (symbol< x y) is non-nil if and only if either the symbol-name of the symbol x lexicographically precedes the symbol-name of the symbol y (in the sense of string<) or else the symbol-names are equal and the symbol-package-name of x lexicographically precedes that of y (in the same sense). So for example, (symbol< 'abcd 'abce) and (symbol< 'acl2::abcd 'foo::abce) are true.

    The guard for symbol specifies that its arguments are symbols.

    Function: symbol<

    (defun symbol< (x y)
           (declare (xargs :guard (and (symbolp x) (symbolp y))))
           (let ((x1 (symbol-name x))
                 (y1 (symbol-name y)))
                (or (string< x1 y1)
                    (and (equal x1 y1)
                         (string< (symbol-package-name x)
                                  (symbol-package-name y))))))