• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Fty-extensions
        • Defsubtype
        • Defset
        • Deftypes
        • Specific-types
        • Defflatsum
        • Deflist-of-len
        • Defbytelist
        • Fty::basetypes
          • Any-p
          • Symbol-fix
            • Maybe-integerp-fix
            • Maybe-integer-equiv
            • Maybe-posp-fix
            • Maybe-natp-fix
            • Maybe-bit-fix
            • Bool-fix
            • Maybe-pos-equiv
            • Maybe-nat-equiv
            • Maybe-bit-equiv
            • Maybe-lit-fix
            • Symbol-equiv
            • True-equiv
            • Pos-equiv
            • Lposfix
            • True-p
            • True-fix
          • Defomap
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • 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)))