• 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
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
              • Objdesign
                • Objdesign-fix
                  • Objdesign-case
                  • Objdesignp
                  • Objdesign-count
                  • Objdesign-equiv
                  • Objdesign-auto
                  • Objdesign-member
                  • Objdesign-element
                  • Objdesign-static
                  • Objdesign-alloc
                  • Objdesign-kind
                • Address
                • Object-disjointp
                • Objdesign-option
              • 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
    • Objdesign

    Objdesign-fix

    Fixing function for objdesign structures.

    Signature
    (objdesign-fix x) → new-x
    Arguments
    x — Guard (objdesignp x).
    Returns
    new-x — Type (objdesignp new-x).

    Definitions and Theorems

    Function: objdesign-fix$inline

    (defun objdesign-fix$inline (x)
     (declare (xargs :guard (objdesignp x)))
     (let ((__function__ 'objdesign-fix))
      (declare (ignorable __function__))
      (mbe
        :logic
        (case (objdesign-kind x)
          (:static (b* ((name (ident-fix (std::da-nth 0 (cdr x)))))
                     (cons :static (list name))))
          (:auto (b* ((name (ident-fix (std::da-nth 0 (cdr x))))
                      (frame (nfix (std::da-nth 1 (cdr x))))
                      (scope (nfix (std::da-nth 2 (cdr x)))))
                   (cons :auto (list name frame scope))))
          (:alloc (b* ((get (address-fix (std::da-nth 0 (cdr x)))))
                    (cons :alloc (list get))))
          (:element (b* ((super (objdesign-fix (std::da-nth 0 (cdr x))))
                         (index (nfix (std::da-nth 1 (cdr x)))))
                      (cons :element (list super index))))
          (:member (b* ((super (objdesign-fix (std::da-nth 0 (cdr x))))
                        (name (ident-fix (std::da-nth 1 (cdr x)))))
                     (cons :member (list super name)))))
        :exec x)))

    Theorem: objdesignp-of-objdesign-fix

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

    Theorem: objdesign-fix-when-objdesignp

    (defthm objdesign-fix-when-objdesignp
      (implies (objdesignp x)
               (equal (objdesign-fix x) x)))

    Function: objdesign-equiv$inline

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

    Theorem: objdesign-equiv-is-an-equivalence

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

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

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

    Theorem: objdesign-fix-under-objdesign-equiv

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

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

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

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

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

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

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

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

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

    Theorem: objdesign-kind$inline-of-objdesign-fix-x

    (defthm objdesign-kind$inline-of-objdesign-fix-x
      (equal (objdesign-kind$inline (objdesign-fix x))
             (objdesign-kind$inline x)))

    Theorem: objdesign-kind$inline-objdesign-equiv-congruence-on-x

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

    Theorem: consp-of-objdesign-fix

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