• 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
              • Scope
                • Scope-fix
                • Scopep
                  • Scope-equiv
                • 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
    • Scope

    Scopep

    Recognizer for scope.

    Signature
    (scopep x) → *

    Definitions and Theorems

    Function: scopep

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

    Theorem: booleanp-of-scopep

    (defthm booleanp-of-scopep
      (booleanp (scopep x)))

    Theorem: mapp-when-scopep

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

    Theorem: scopep-of-tail

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

    Theorem: identp-of-head-key-when-scopep

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

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

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

    Theorem: scopep-of-update

    (defthm scopep-of-update
      (implies (and (scopep x) (identp k) (valuep v))
               (scopep (omap::update k v x))))

    Theorem: scopep-of-update*

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

    Theorem: scopep-of-delete

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

    Theorem: scopep-of-delete*

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

    Theorem: identp-when-assoc-scopep-binds-free-x

    (defthm identp-when-assoc-scopep-binds-free-x
      (implies (and (omap::assoc k x) (scopep x))
               (identp k)))

    Theorem: identp-of-car-of-assoc-scopep

    (defthm identp-of-car-of-assoc-scopep
      (implies (and (scopep x) (omap::assoc k x))
               (identp (car (omap::assoc k x)))))

    Theorem: valuep-of-cdr-of-assoc-scopep

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

    Theorem: valuep-of-lookup-when-scopep

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