• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • 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
        • Program-wrapper
        • Get-internal-time
        • Basics
        • Packages
        • Oracle-eval
        • Defmacro-untouchable
        • <<
        • Primitive
        • Revert-world
        • Unmemoize
        • Set-duplicate-keys-action
        • Symbols
          • Symbol-listp
          • Symbolp
            • Intern
            • Intern-in-package-of-symbol
            • Symbol-fix
              • Intern$
              • Symbol-equiv
            • Symbol-name
            • Keywordp
            • Symbol-package-name
            • Add-to-set
            • Symbol<
            • Packn
            • Packn-pos
            • Symbol-name-lst
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Fty::basetypes
    • Symbolp

    Symbol-fix

    (symbol-fix x) is a fixing function for symbolp; it is the identity for symbols and coerces non-symbols to acl2::||, i.e., the empty symbol in the ACL2 package.

    Unfortunately it's not currently possible to come up with a good symbol-fixing function that induces the proper congruences for both symbol-name and symbol-package-name. This definition at least gives us a congruence for symbol-name.

    BOZO consider adding a symbolp guard, inlining it, and turning it into an identity function for execution.

    Definitions and Theorems

    Function: symbol-fix

    (defun symbol-fix (x)
      (declare (xargs :guard t))
      (if (symbolp x) x '||))

    Theorem: symbolp-of-symbol-fix

    (defthm symbolp-of-symbol-fix
      (symbolp (symbol-fix x))
      :rule-classes :type-prescription)

    Theorem: symbol-fix-when-symbolp

    (defthm symbol-fix-when-symbolp
      (implies (symbolp x)
               (equal (symbol-fix x) x)))