• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • 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
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)