• 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
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
              • Exec
              • Find-fun
              • Init-local
              • Write-vars-values
              • Add-vars-values
              • Add-funs
              • Eoutcome
              • Soutcome
              • Ensure-funscope-disjoint
              • Write-var-value
              • Restrict-vars
              • Add-var-value
              • Funinfo
              • Exec-top-block
              • Values
              • Cstate
              • Funinfo+funenv
              • Read-vars-values
              • Read-var-value
              • Funenv
              • Funscope-for-fundefs
              • Exec-path
              • Path-to-var
              • Funinfo+funenv-result
              • Exec-literal
              • Soutcome-result
              • Mode-set-result
              • Literal-evaluation
              • Funscope-result
              • Funinfo-result
              • Funenv-result
              • Eoutcome-result
              • Cstate-result
              • Paths-to-vars
              • Funinfo-for-fundef
              • Lstate
              • Funscope
                • Funscopep
                  • Funscope-fix
                  • Funscope-equiv
                • Mode-set
                • Modes
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • 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
    • Funscope

    Funscopep

    Recognizer for funscope.

    Signature
    (funscopep x) → *

    Definitions and Theorems

    Function: funscopep

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

    Theorem: booleanp-of-funscopep

    (defthm booleanp-of-funscopep
      (booleanp (funscopep x)))

    Theorem: mapp-when-funscopep

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

    Theorem: funscopep-of-tail

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

    Theorem: identifierp-of-head-key-when-funscopep

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

    Theorem: funinfop-of-head-val-when-funscopep

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

    Theorem: funscopep-of-update

    (defthm funscopep-of-update
      (implies (and (funscopep x)
                    (identifierp k)
                    (funinfop v))
               (funscopep (omap::update k v x))))

    Theorem: funscopep-of-update*

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

    Theorem: funscopep-of-delete

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

    Theorem: funscopep-of-delete*

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

    Theorem: identifierp-when-assoc-funscopep-binds-free-x

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

    Theorem: identifierp-of-car-of-assoc-funscopep

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

    Theorem: funinfop-of-cdr-of-assoc-funscopep

    (defthm funinfop-of-cdr-of-assoc-funscopep
      (implies (and (funscopep x) (omap::assoc k x))
               (funinfop (cdr (omap::assoc k x)))))

    Theorem: funinfop-of-lookup-when-funscopep

    (defthm funinfop-of-lookup-when-funscopep
      (implies (and (funscopep x) (omap::assoc k x))
               (funinfop (omap::lookup k x))))