• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
          • Transformations
          • Language
            • Abstract-syntax
              • Escape
              • Swcase-list->value-list
              • Hex-digit-list->chars
              • Fundef-list->name-list
              • Literal
              • Path
              • Hex-string-rest-element
              • Plain-string
              • String-element
              • Hex-string-content-option
              • Hex-string-content
              • Identifier
                • Identifier-fix
                  • Identifierp
                  • Identifier-equiv
                  • Make-identifier
                  • Identifier->get
                  • Change-identifier
                • Funcall-option
                • Expression-option
                • Statement-option
                • Literal-option
                • Identifier-option
                • Hex-string
                • Hex-quad
                • Hex-digit
                • Hex-pair
                • Data-value
                • Data-item
                • Statements-to-fundefs
                • String-element-list-result
                • Identifier-identifier-map-result
                • Swcase-result
                • String-element-result
                • Statement-result
                • Literal-result
                • Identifier-set-result
                • Identifier-result
                • Identifier-list-result
                • Fundef-result
                • Funcall-result
                • Expression-result
                • Escape-result
                • Path-result
                • Block-result
                • Objects
                • Statements/blocks/cases/fundefs
                • Identifier-list
                • Identifier-set
                • Identifier-identifier-map
                • Identifier-identifier-alist
                • Hex-string-rest-element-list
                • String-element-list
                • Path-list
                • Hex-digit-list
                • Literal-list
                • Fundef-list
                • Expressions/funcalls
                • Abstract-syntax-induction-schemas
              • Dynamic-semantics
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Identifier

    Identifier-fix

    Fixing function for identifier structures.

    Signature
    (identifier-fix x) → new-x
    Arguments
    x — Guard (identifierp x).
    Returns
    new-x — Type (identifierp new-x).

    Definitions and Theorems

    Function: identifier-fix$inline

    (defun identifier-fix$inline (x)
      (declare (xargs :guard (identifierp x)))
      (let ((__function__ 'identifier-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((get (acl2::str-fix (cdr (std::da-nth 0 (cdr x))))))
               (cons :identifier (list (cons 'get get))))
             :exec x)))

    Theorem: identifierp-of-identifier-fix

    (defthm identifierp-of-identifier-fix
      (b* ((new-x (identifier-fix$inline x)))
        (identifierp new-x))
      :rule-classes :rewrite)

    Theorem: identifier-fix-when-identifierp

    (defthm identifier-fix-when-identifierp
      (implies (identifierp x)
               (equal (identifier-fix x) x)))

    Function: identifier-equiv$inline

    (defun identifier-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (identifierp acl2::x)
                                  (identifierp acl2::y))))
      (equal (identifier-fix acl2::x)
             (identifier-fix acl2::y)))

    Theorem: identifier-equiv-is-an-equivalence

    (defthm identifier-equiv-is-an-equivalence
      (and (booleanp (identifier-equiv x y))
           (identifier-equiv x x)
           (implies (identifier-equiv x y)
                    (identifier-equiv y x))
           (implies (and (identifier-equiv x y)
                         (identifier-equiv y z))
                    (identifier-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: identifier-equiv-implies-equal-identifier-fix-1

    (defthm identifier-equiv-implies-equal-identifier-fix-1
      (implies (identifier-equiv acl2::x x-equiv)
               (equal (identifier-fix acl2::x)
                      (identifier-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: identifier-fix-under-identifier-equiv

    (defthm identifier-fix-under-identifier-equiv
      (identifier-equiv (identifier-fix acl2::x)
                        acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-identifier-fix-1-forward-to-identifier-equiv

    (defthm equal-of-identifier-fix-1-forward-to-identifier-equiv
      (implies (equal (identifier-fix acl2::x) acl2::y)
               (identifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-identifier-fix-2-forward-to-identifier-equiv

    (defthm equal-of-identifier-fix-2-forward-to-identifier-equiv
      (implies (equal acl2::x (identifier-fix acl2::y))
               (identifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: identifier-equiv-of-identifier-fix-1-forward

    (defthm identifier-equiv-of-identifier-fix-1-forward
      (implies (identifier-equiv (identifier-fix acl2::x)
                                 acl2::y)
               (identifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: identifier-equiv-of-identifier-fix-2-forward

    (defthm identifier-equiv-of-identifier-fix-2-forward
      (implies (identifier-equiv acl2::x (identifier-fix acl2::y))
               (identifier-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)