• 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
              • 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
                • Heap-fix
                  • Heapp
                  • Heap-equiv
                • 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
    • Heap

    Heap-fix

    (heap-fix x) is a usual ACL2::fty omap fixing function.

    Signature
    (heap-fix x) → *
    Arguments
    x — Guard (heapp x).

    Definitions and Theorems

    Function: heap-fix

    (defun heap-fix (x)
      (declare (xargs :guard (heapp x)))
      (mbe :logic (if (heapp x) x nil)
           :exec x))

    Theorem: heapp-of-heap-fix

    (defthm heapp-of-heap-fix
      (heapp (heap-fix x)))

    Theorem: heap-fix-when-heapp

    (defthm heap-fix-when-heapp
      (implies (heapp x)
               (equal (heap-fix x) x)))

    Theorem: emptyp-heap-fix

    (defthm emptyp-heap-fix
      (implies (or (omap::emptyp x) (not (heapp x)))
               (omap::emptyp (heap-fix x))))

    Theorem: emptyp-of-heap-fix-to-not-heap-or-emptyp

    (defthm emptyp-of-heap-fix-to-not-heap-or-emptyp
      (equal (omap::emptyp (heap-fix x))
             (or (not (heapp x)) (omap::emptyp x))))

    Function: heap-equiv$inline

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

    Theorem: heap-equiv-is-an-equivalence

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

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

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

    Theorem: heap-fix-under-heap-equiv

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

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

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

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

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

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

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

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

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