• 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
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
              • Init-fun-env
              • Fun-info
              • Fun-info-option
              • Fun-env-extend
              • Fun-env-result
              • Fun-env-lookup
                • Fun-info-from-fundef
                • Fun-env
              • 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
    • Function-environments

    Fun-env-lookup

    Look up a function in an environment by name.

    Signature
    (fun-env-lookup name fenv) → info?
    Arguments
    name — Guard (identp name).
    fenv — Guard (fun-envp fenv).
    Returns
    info? — Type (fun-info-optionp info?).

    Definitions and Theorems

    Function: fun-env-lookup

    (defun fun-env-lookup (name fenv)
      (declare (xargs :guard (and (identp name) (fun-envp fenv))))
      (let ((__function__ 'fun-env-lookup))
        (declare (ignorable __function__))
        (cdr (omap::assoc (ident-fix name)
                          (fun-env-fix fenv)))))

    Theorem: fun-info-optionp-of-fun-env-lookup

    (defthm fun-info-optionp-of-fun-env-lookup
      (b* ((info? (fun-env-lookup name fenv)))
        (fun-info-optionp info?))
      :rule-classes :rewrite)

    Theorem: fun-env-lookup-of-ident-fix-name

    (defthm fun-env-lookup-of-ident-fix-name
      (equal (fun-env-lookup (ident-fix name) fenv)
             (fun-env-lookup name fenv)))

    Theorem: fun-env-lookup-ident-equiv-congruence-on-name

    (defthm fun-env-lookup-ident-equiv-congruence-on-name
      (implies (ident-equiv name name-equiv)
               (equal (fun-env-lookup name fenv)
                      (fun-env-lookup name-equiv fenv)))
      :rule-classes :congruence)

    Theorem: fun-env-lookup-of-fun-env-fix-fenv

    (defthm fun-env-lookup-of-fun-env-fix-fenv
      (equal (fun-env-lookup name (fun-env-fix fenv))
             (fun-env-lookup name fenv)))

    Theorem: fun-env-lookup-fun-env-equiv-congruence-on-fenv

    (defthm fun-env-lookup-fun-env-equiv-congruence-on-fenv
      (implies (fun-env-equiv fenv fenv-equiv)
               (equal (fun-env-lookup name fenv)
                      (fun-env-lookup name fenv-equiv)))
      :rule-classes :congruence)