• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                • Values
                • Dynamic-environments
                  • Call-dinfo
                  • Denv
                  • Update-var/const-dinfo-in-scope-list
                  • Update-var/const-dinfo-in-scope
                  • Var/const-dinfo
                  • Update-var/const-dinfo
                  • Add-var/const-dinfo-to-scope
                  • Add-var/const-dinfo
                  • Var/const-dinfo-option
                  • Get-var/const-dinfo-from-scope-list
                  • Denv-option
                  • Get-var/const-dinfo-from-scope
                    • Vcscope-dinfo-option
                    • Vcscope-dinfo-list-option
                    • Vcscope-dinfo
                    • Screens
                    • Get-var/const-dinfo
                    • Vcscope-dinfo-option-result
                    • Vcscope-dinfo-list-result
                    • Vcscope-dinfo-result
                    • Dynamic-struct-environments
                    • Dynamic-function-environments
                    • Denv-result
                    • Init-denv
                    • Vcscope-dinfo-list
                    • Call-dinfo-list
                  • Arithmetic-operations
                  • Curve-parameterization
                  • Shift-operations
                  • Errors
                  • Value-expressions
                  • Locations
                  • Input-execution
                  • Edwards-bls12-generator
                  • Equality-operations
                  • Logical-operations
                  • Program-execution
                  • Ordering-operations
                  • Bitwise-operations
                  • Literal-evaluation
                  • Type-maps-for-struct-components
                  • Output-execution
                  • Tuple-operations
                  • Struct-operations
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Dynamic-environments

    Get-var/const-dinfo-from-scope

    Get the information about a variable or constant from a scope.

    Signature
    (get-var/const-dinfo-from-scope name scope) → dinfo
    Arguments
    name — Guard (identifierp name).
    scope — Guard (vcscope-dinfop scope).
    Returns
    dinfo — Type (var/const-dinfo-optionp dinfo).

    We return nil if there is no variable of constant with that name.

    Definitions and Theorems

    Function: get-var/const-dinfo-from-scope

    (defun get-var/const-dinfo-from-scope (name scope)
      (declare (xargs :guard (and (identifierp name)
                                  (vcscope-dinfop scope))))
      (let ((__function__ 'get-var/const-dinfo-from-scope))
        (declare (ignorable __function__))
        (cdr (omap::assoc (identifier-fix name)
                          (vcscope-dinfo-fix scope)))))

    Theorem: var/const-dinfo-optionp-of-get-var/const-dinfo-from-scope

    (defthm var/const-dinfo-optionp-of-get-var/const-dinfo-from-scope
      (b* ((dinfo (get-var/const-dinfo-from-scope name scope)))
        (var/const-dinfo-optionp dinfo))
      :rule-classes :rewrite)

    Theorem: get-var/const-dinfo-from-scope-of-identifier-fix-name

    (defthm get-var/const-dinfo-from-scope-of-identifier-fix-name
      (equal (get-var/const-dinfo-from-scope (identifier-fix name)
                                             scope)
             (get-var/const-dinfo-from-scope name scope)))

    Theorem: get-var/const-dinfo-from-scope-identifier-equiv-congruence-on-name

    (defthm
     get-var/const-dinfo-from-scope-identifier-equiv-congruence-on-name
     (implies (identifier-equiv name name-equiv)
              (equal (get-var/const-dinfo-from-scope name scope)
                     (get-var/const-dinfo-from-scope name-equiv scope)))
     :rule-classes :congruence)

    Theorem: get-var/const-dinfo-from-scope-of-vcscope-dinfo-fix-scope

    (defthm get-var/const-dinfo-from-scope-of-vcscope-dinfo-fix-scope
     (equal
         (get-var/const-dinfo-from-scope name (vcscope-dinfo-fix scope))
         (get-var/const-dinfo-from-scope name scope)))

    Theorem: get-var/const-dinfo-from-scope-vcscope-dinfo-equiv-congruence-on-scope

    (defthm
     get-var/const-dinfo-from-scope-vcscope-dinfo-equiv-congruence-on-scope
     (implies (vcscope-dinfo-equiv scope scope-equiv)
              (equal (get-var/const-dinfo-from-scope name scope)
                     (get-var/const-dinfo-from-scope name scope-equiv)))
     :rule-classes :congruence)