• 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
                • Flatten-statements/branches
                • Simplify-flattened-if
                • Flatten-expression
                • Fenv-option
                • Flatten-fundecl
                • Fenv-const-add
                • Fenv
                • Fenv-const-lookup
                  • Init-fenv
                  • Const-fenv
                • Abstract-syntax
                • Dynamic-semantics
                • 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
    • Flattening

    Fenv-const-lookup

    Look up a constant in a flattening environment.

    Signature
    (fenv-const-lookup const env) → val
    Arguments
    const — Guard (identifierp const).
    env — Guard (fenvp env).
    Returns
    val — Type (value-optionp val).

    We return the associated value if the constant is found in the constant flattening environment of the flattening environment. Otherwise we return nil.

    Definitions and Theorems

    Function: fenv-const-lookup

    (defun fenv-const-lookup (const env)
      (declare (xargs :guard (and (identifierp const) (fenvp env))))
      (let ((__function__ 'fenv-const-lookup))
        (declare (ignorable __function__))
        (cdr (omap::assoc (identifier-fix const)
                          (fenv->constants env)))))

    Theorem: value-optionp-of-fenv-const-lookup

    (defthm value-optionp-of-fenv-const-lookup
      (b* ((val (fenv-const-lookup const env)))
        (value-optionp val))
      :rule-classes :rewrite)

    Theorem: fenv-const-lookup-of-identifier-fix-const

    (defthm fenv-const-lookup-of-identifier-fix-const
      (equal (fenv-const-lookup (identifier-fix const)
                                env)
             (fenv-const-lookup const env)))

    Theorem: fenv-const-lookup-identifier-equiv-congruence-on-const

    (defthm fenv-const-lookup-identifier-equiv-congruence-on-const
      (implies (identifier-equiv const const-equiv)
               (equal (fenv-const-lookup const env)
                      (fenv-const-lookup const-equiv env)))
      :rule-classes :congruence)

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

    (defthm fenv-const-lookup-of-fenv-fix-env
      (equal (fenv-const-lookup const (fenv-fix env))
             (fenv-const-lookup const env)))

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

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