• 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
              • Write-object
              • Objdesign-of-var
              • Compustate-scopes-numbers
              • Create-var
              • Read-object
              • Compustate
                • Compustatep
                • Compustate-fix
                  • Compustate-equiv
                  • Make-compustate
                  • Compustate->frames
                  • Change-compustate
                  • Compustate->static
                  • Compustate->heap
                • Frame
                • Enter-scope
                • Compustate-scopes-numbers-aux
                • Compustate-option
                • Push-frame
                • Exit-scope
                • Compustate-frames-number
                • Compustate-option-result
                • Scope-list-result
                • Pop-frame
                • Compustate-result
                • Scope-result
                • Compustate-top-frame-scopes-number
                • Top-frame
                • Heap
                • Scope
                • Scope-list
                • Frame-list
              • 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
    • Compustate

    Compustate-fix

    Fixing function for compustate structures.

    Signature
    (compustate-fix x) → new-x
    Arguments
    x — Guard (compustatep x).
    Returns
    new-x — Type (compustatep new-x).

    Definitions and Theorems

    Function: compustate-fix$inline

    (defun compustate-fix$inline (x)
      (declare (xargs :guard (compustatep x)))
      (let ((__function__ 'compustate-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((static (scope-fix (cdr (std::da-nth 0 x))))
                  (frames (frame-list-fix (cdr (std::da-nth 1 x))))
                  (heap (heap-fix (cdr (std::da-nth 2 x)))))
               (list (cons 'static static)
                     (cons 'frames frames)
                     (cons 'heap heap)))
             :exec x)))

    Theorem: compustatep-of-compustate-fix

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

    Theorem: compustate-fix-when-compustatep

    (defthm compustate-fix-when-compustatep
      (implies (compustatep x)
               (equal (compustate-fix x) x)))

    Function: compustate-equiv$inline

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

    Theorem: compustate-equiv-is-an-equivalence

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

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

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

    Theorem: compustate-fix-under-compustate-equiv

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

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

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

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

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

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

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

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

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