• 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
              • 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
                • Tyname-fix
                  • Tynamep
                  • Tyname-equiv
                  • Make-tyname
                  • Tyname->tyspec
                  • Tyname->declor
                  • Change-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
    • Tyname

    Tyname-fix

    Fixing function for tyname structures.

    Signature
    (tyname-fix x) → new-x
    Arguments
    x — Guard (tynamep x).
    Returns
    new-x — Type (tynamep new-x).

    Definitions and Theorems

    Function: tyname-fix$inline

    (defun tyname-fix$inline (x)
     (declare (xargs :guard (tynamep x)))
     (let ((__function__ 'tyname-fix))
      (declare (ignorable __function__))
      (mbe
          :logic
          (b* ((tyspec (tyspecseq-fix (cdr (std::da-nth 0 (cdr x)))))
               (declor (obj-adeclor-fix (cdr (std::da-nth 1 (cdr x))))))
            (cons :tyname (list (cons 'tyspec tyspec)
                                (cons 'declor declor))))
          :exec x)))

    Theorem: tynamep-of-tyname-fix

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

    Theorem: tyname-fix-when-tynamep

    (defthm tyname-fix-when-tynamep
      (implies (tynamep x)
               (equal (tyname-fix x) x)))

    Function: tyname-equiv$inline

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

    Theorem: tyname-equiv-is-an-equivalence

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

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

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

    Theorem: tyname-fix-under-tyname-equiv

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

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

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

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

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

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

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

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

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