• 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
                • Obj-declor-case
                • Obj-declor-fix
                  • Obj-declorp
                  • Obj-declor-count
                  • Obj-declor-equiv
                  • Obj-declor-array
                  • Obj-declor-pointer
                  • Obj-declor-ident
                  • Obj-declor-kind
                • 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
                • 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
    • Obj-declor

    Obj-declor-fix

    Fixing function for obj-declor structures.

    Signature
    (obj-declor-fix x) → new-x
    Arguments
    x — Guard (obj-declorp x).
    Returns
    new-x — Type (obj-declorp new-x).

    Definitions and Theorems

    Function: obj-declor-fix$inline

    (defun obj-declor-fix$inline (x)
     (declare (xargs :guard (obj-declorp x)))
     (let ((__function__ 'obj-declor-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (case (obj-declor-kind x)
        (:ident (b* ((get (ident-fix (std::da-nth 0 (cdr x)))))
                  (cons :ident (list get))))
        (:pointer (b* ((decl (obj-declor-fix (std::da-nth 0 (cdr x)))))
                    (cons :pointer (list decl))))
        (:array (b* ((decl (obj-declor-fix (std::da-nth 0 (cdr x))))
                     (size (iconst-option-fix (std::da-nth 1 (cdr x)))))
                  (cons :array (list decl size)))))
       :exec x)))

    Theorem: obj-declorp-of-obj-declor-fix

    (defthm obj-declorp-of-obj-declor-fix
      (b* ((new-x (obj-declor-fix$inline x)))
        (obj-declorp new-x))
      :rule-classes :rewrite)

    Theorem: obj-declor-fix-when-obj-declorp

    (defthm obj-declor-fix-when-obj-declorp
      (implies (obj-declorp x)
               (equal (obj-declor-fix x) x)))

    Function: obj-declor-equiv$inline

    (defun obj-declor-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (obj-declorp acl2::x)
                                  (obj-declorp acl2::y))))
      (equal (obj-declor-fix acl2::x)
             (obj-declor-fix acl2::y)))

    Theorem: obj-declor-equiv-is-an-equivalence

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

    Theorem: obj-declor-equiv-implies-equal-obj-declor-fix-1

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

    Theorem: obj-declor-fix-under-obj-declor-equiv

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

    Theorem: equal-of-obj-declor-fix-1-forward-to-obj-declor-equiv

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

    Theorem: equal-of-obj-declor-fix-2-forward-to-obj-declor-equiv

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

    Theorem: obj-declor-equiv-of-obj-declor-fix-1-forward

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

    Theorem: obj-declor-equiv-of-obj-declor-fix-2-forward

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

    Theorem: obj-declor-kind$inline-of-obj-declor-fix-x

    (defthm obj-declor-kind$inline-of-obj-declor-fix-x
      (equal (obj-declor-kind$inline (obj-declor-fix x))
             (obj-declor-kind$inline x)))

    Theorem: obj-declor-kind$inline-obj-declor-equiv-congruence-on-x

    (defthm obj-declor-kind$inline-obj-declor-equiv-congruence-on-x
      (implies (obj-declor-equiv x x-equiv)
               (equal (obj-declor-kind$inline x)
                      (obj-declor-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-obj-declor-fix

    (defthm consp-of-obj-declor-fix
      (consp (obj-declor-fix x))
      :rule-classes :type-prescription)