• 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
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
              • Tyspecseq
              • Expr
              • Binop
              • Fileset
              • Obj-declor
              • Ident
                • Identp
                • Ident-fix
                  • Ident-equiv
                  • Make-ident
                  • Change-ident
                  • Ident->name
                • Iconst
                • Obj-adeclor
                • Const
                • Fundef
                • Unop
                • File
                • Tag-declon
                • Fun-declor
                • Obj-declon
                • Iconst-length
                • Abstract-syntax-operations
                • Label
                • Struct-declon
                • Initer
                • Ext-declon
                • Fun-adeclor
                • Expr-option
                • Iconst-base
                • Initer-option
                • Iconst-option
                • Tyspecseq-option
                • Stmt-option
                • Scspecseq
                • Param-declon
                • Obj-declon-option
                • File-option
                • Tyname
                • Transunit
                • Fun-declon
                • Transunit-result
                • Param-declon-list
                • Struct-declon-list
                • Expr-list
                • Tyspecseq-list
                • Ident-set
                • Ident-list
                • Ext-declon-list
                • Unop-list
                • Tyname-list
                • Fundef-list
                • Fun-declon-list
                • Binop-list
                • Stmt-fixtypes
                • Expr-fixtypes
              • Integer-ranges
              • Implementation-environments
              • Dynamic-semantics
              • Static-semantics
              • Grammar
              • Integer-formats
              • Types
              • Portable-ascii-identifiers
              • Values
              • Integer-operations
              • Computation-states
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • 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
    • Ident

    Ident-fix

    Fixing function for ident structures.

    Signature
    (ident-fix x) → new-x
    Arguments
    x — Guard (identp x).
    Returns
    new-x — Type (identp new-x).

    Definitions and Theorems

    Function: ident-fix$inline

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

    Theorem: identp-of-ident-fix

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

    Theorem: ident-fix-when-identp

    (defthm ident-fix-when-identp
      (implies (identp x)
               (equal (ident-fix x) x)))

    Function: ident-equiv$inline

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

    Theorem: ident-equiv-is-an-equivalence

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

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

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

    Theorem: ident-fix-under-ident-equiv

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

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

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

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

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

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

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

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

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