• 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

    Heapp

    Recognizer for heap.

    Signature
    (heapp x) → *

    Definitions and Theorems

    Function: heapp

    (defun heapp (x)
      (declare (xargs :guard t))
      (if (atom x)
          (null x)
        (and (consp (car x))
             (addressp (caar x))
             (valuep (cdar x))
             (or (null (cdr x))
                 (and (consp (cdr x))
                      (consp (cadr x))
                      (acl2::fast-<< (caar x) (caadr x))
                      (heapp (cdr x)))))))

    Theorem: booleanp-of-heapp

    (defthm booleanp-of-heapp
      (booleanp (heapp x)))

    Theorem: mapp-when-heapp

    (defthm mapp-when-heapp
      (implies (heapp x) (omap::mapp x))
      :rule-classes (:rewrite :forward-chaining))

    Theorem: heapp-of-tail

    (defthm heapp-of-tail
      (implies (heapp x)
               (heapp (omap::tail x))))

    Theorem: addressp-of-head-key-when-heapp

    (defthm addressp-of-head-key-when-heapp
      (implies (and (heapp x) (not (omap::emptyp x)))
               (addressp (mv-nth 0 (omap::head x)))))

    Theorem: valuep-of-head-val-when-heapp

    (defthm valuep-of-head-val-when-heapp
      (implies (and (heapp x) (not (omap::emptyp x)))
               (valuep (mv-nth 1 (omap::head x)))))

    Theorem: heapp-of-update

    (defthm heapp-of-update
      (implies (and (heapp x) (addressp k) (valuep v))
               (heapp (omap::update k v x))))

    Theorem: heapp-of-update*

    (defthm heapp-of-update*
      (implies (and (heapp x) (heapp y))
               (heapp (omap::update* x y))))

    Theorem: heapp-of-delete

    (defthm heapp-of-delete
      (implies (heapp x)
               (heapp (omap::delete k x))))

    Theorem: heapp-of-delete*

    (defthm heapp-of-delete*
      (implies (heapp x)
               (heapp (omap::delete* k x))))

    Theorem: addressp-when-assoc-heapp-binds-free-x

    (defthm addressp-when-assoc-heapp-binds-free-x
      (implies (and (omap::assoc k x) (heapp x))
               (addressp k)))

    Theorem: addressp-of-car-of-assoc-heapp

    (defthm addressp-of-car-of-assoc-heapp
      (implies (and (heapp x) (omap::assoc k x))
               (addressp (car (omap::assoc k x)))))

    Theorem: valuep-of-cdr-of-assoc-heapp

    (defthm valuep-of-cdr-of-assoc-heapp
      (implies (and (heapp x) (omap::assoc k x))
               (valuep (cdr (omap::assoc k x)))))

    Theorem: valuep-of-lookup-when-heapp

    (defthm valuep-of-lookup-when-heapp
      (implies (and (heapp x) (omap::assoc k x))
               (valuep (omap::lookup k x))))