• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
          • Process-syntheto-toplevel-fn
          • Translation
          • Language
            • Static-semantics
              • Check-expression-fns
              • Subtypep
              • Match-type
              • Check-product-update-expression
              • Get-builtin-function-in/out/pre-post
              • Check-sum-update-expression
              • Check-sum-field-expression
              • Check-strict-binary-expression
              • Check-lt/le/gt/ge-expression
              • Check-eq/ne-expression
              • Check-div/rem-expression
              • Check-add/sub/mul-expression
              • Align-let-vars-values
              • Check-iff-expression
              • Check-function-definition-top/nontop
              • Check-sum-construct-expression
              • Check-rem-expression
              • Check-mul-expression
              • Check-sub-expression
              • Check-div-expression
              • Check-add-expression
              • Check-ne-expression
              • Check-lt-expression
              • Check-le-expression
              • Check-gt-expression
              • Check-ge-expression
              • Check-eq-expression
              • Check-function-specifier
              • Type-result
              • Check-product-construct-expression
              • Supremum-type
              • Check-call-expression
              • Check-product-field-expression
              • Check-function-definer
              • Make-subproof-obligations
              • Get-function-in/out/pre/post
              • Check-sum-test-expression
              • Match-field
              • Decompose-expression
              • Match-to-target
              • Check-unary-expression
              • Max-supertype
              • Match-type-list
              • Check-minus-expression
              • Check-type-definition
              • Check-not-expression
              • Check-type-product
              • Match-field-list
              • Check-type-subset
              • Check-type-definition-in-recursion
              • Align-let-vars-values-aux
              • Non-trivial-proof-obligation
              • Check-type-recursion
              • Check-function-specification
              • Check-toplevel
              • Supremum-type-list
              • Check-component-expression
              • Check-branch-list
              • Check-function-recursion
              • Check-function-definition
              • Binding
              • Check-function-header
              • Check-function-definition-list
              • Check-type-definition-list-in-recursion
              • Check-theorem
              • Check-nonstrict-binary-expression
              • Context-add-variables
              • Decompose-expression-aux
              • Check-alternative
              • Check-multi-expression
              • Check-type-sum
              • Check-type
              • Check-alternative-list
              • Context-add-condition
              • Check-type-definer
              • Check-transform
              • Check-variable
              • Check-transform-args
              • Check-toplevel-list
              • Context-add-condition-list
              • Check-if/when/unless-expression
              • Initializers-to-variable-substitution
              • Context-add-binding
              • Check-function-header-list
              • Context-add-toplevel
              • Ensure-single-type
              • Max-supertypes
              • Check-bind-expression
              • Check-type-list
              • Check-literal
              • Literal-type
              • Check-expression-list
              • Variable-context
                • Variable-context-fix
                • Variable-contextp
                  • Variable-context-equiv
                  • Typed-variables-to-variable-context
                • Check-cond-expression
                • Check-branch
                • Args-without-defaults
                • Check-expression
                • *builtin-function-names*
                • Function-called-in
              • Abstract-syntax
              • Outcome
              • Abstract-syntax-operations
              • Outcome-list
              • Outcomes
            • Process-syntheto-toplevel
            • Shallow-embedding
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Variable-context

    Variable-contextp

    Recognizer for variable-context.

    Signature
    (variable-contextp x) → *

    Definitions and Theorems

    Function: variable-contextp

    (defun variable-contextp (x)
      (declare (xargs :guard t))
      (if (atom x)
          (null x)
        (and (consp (car x))
             (identifierp (caar x))
             (typep (cdar x))
             (or (null (cdr x))
                 (and (consp (cdr x))
                      (consp (cadr x))
                      (acl2::fast-<< (caar x) (caadr x))
                      (variable-contextp (cdr x)))))))

    Theorem: booleanp-of-variable-contextp

    (defthm booleanp-of-variable-contextp
      (booleanp (variable-contextp x)))

    Theorem: mapp-when-variable-contextp

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

    Theorem: variable-contextp-of-tail

    (defthm variable-contextp-of-tail
      (implies (variable-contextp x)
               (variable-contextp (omap::tail x))))

    Theorem: identifierp-of-head-key-when-variable-contextp

    (defthm identifierp-of-head-key-when-variable-contextp
      (implies (and (variable-contextp x)
                    (not (omap::emptyp x)))
               (identifierp (mv-nth 0 (omap::head x)))))

    Theorem: typep-of-head-val-when-variable-contextp

    (defthm typep-of-head-val-when-variable-contextp
      (implies (and (variable-contextp x)
                    (not (omap::emptyp x)))
               (typep (mv-nth 1 (omap::head x)))))

    Theorem: variable-contextp-of-update

    (defthm variable-contextp-of-update
      (implies (and (variable-contextp x)
                    (identifierp k)
                    (typep v))
               (variable-contextp (omap::update k v x))))

    Theorem: variable-contextp-of-update*

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

    Theorem: variable-contextp-of-delete

    (defthm variable-contextp-of-delete
      (implies (variable-contextp x)
               (variable-contextp (omap::delete k x))))

    Theorem: variable-contextp-of-delete*

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

    Theorem: identifierp-when-assoc-variable-contextp-binds-free-x

    (defthm identifierp-when-assoc-variable-contextp-binds-free-x
      (implies (and (omap::assoc k x)
                    (variable-contextp x))
               (identifierp k)))

    Theorem: identifierp-of-car-of-assoc-variable-contextp

    (defthm identifierp-of-car-of-assoc-variable-contextp
      (implies (and (variable-contextp x)
                    (omap::assoc k x))
               (identifierp (car (omap::assoc k x)))))

    Theorem: typep-of-cdr-of-assoc-variable-contextp

    (defthm typep-of-cdr-of-assoc-variable-contextp
      (implies (and (variable-contextp x)
                    (omap::assoc k x))
               (typep (cdr (omap::assoc k x)))))

    Theorem: typep-of-lookup-when-variable-contextp

    (defthm typep-of-lookup-when-variable-contextp
      (implies (and (variable-contextp x)
                    (omap::assoc k x))
               (typep (omap::lookup k x))))