• 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
                  • Exec-expressions/statements
                  • Init-for-loop
                  • Exec-file-main
                  • Update-variable-value-in-scope-list
                  • Step-for-loop
                  • Update-variable-value-in-scope
                  • Expr-value-to-value
                  • Exec-binary
                  • Exec-expression
                  • Init-vcscope-dinfo-call
                  • Value?+denv
                  • Exec-statement
                  • End-of-for-loop-p
                  • Expr-value
                  • Evalue+denv
                  • Write-location
                  • Read-location
                  • Exec-for-loop-iterations
                  • Update-variable-value
                  • Exec-unary
                  • Values+denv
                  • Init-vcscope-dinfo-loop
                  • Extend-denv-with-structdecl
                  • Exec-var/const
                  • Valuemap+denv
                  • Namevalue+denv
                  • Extend-denv-with-fundecl
                  • Ensure-boolean
                  • Int+denv
                  • Push-vcscope-dinfo
                  • Extend-denv-with-topdecl-list
                    • Exec-literal
                    • Build-denv-from-file
                    • Namevalue+denv-result
                    • Extend-denv-with-topdecl
                    • Evalue+denv-result
                    • Value?+denv-result
                    • Values+denv-result
                    • Valuemap+denv-result
                    • Int+denv-result
                    • Push-call-dinfo
                    • Exec-print
                    • Pop-vcscope-dinfo
                    • Exec-if
                    • Exec-function
                    • Pop-call-dinfo
                    • Exec-statement-list
                    • Exec-block
                    • Exec-struct-init-list
                    • Exec-struct-init
                    • Exec-expression-list
                  • Values
                  • Dynamic-environments
                  • 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
    • Execution

    Extend-denv-with-topdecl-list

    Extend a dynamic environment with a list of top-level declarations.

    Signature
    (extend-denv-with-topdecl-list decls env) → new-env
    Arguments
    decls — Guard (topdecl-listp decls).
    env — Guard (denvp env).
    Returns
    new-env — Type (denv-resultp new-env).

    Definitions and Theorems

    Function: extend-denv-with-topdecl-list

    (defun extend-denv-with-topdecl-list (decls env)
      (declare (xargs :guard (and (topdecl-listp decls)
                                  (denvp env))))
      (let ((__function__ 'extend-denv-with-topdecl-list))
        (declare (ignorable __function__))
        (b* (((when (endp decls)) (denv-fix env))
             ((okf env)
              (extend-denv-with-topdecl (car decls)
                                        env)))
          (extend-denv-with-topdecl-list (cdr decls)
                                         env))))

    Theorem: denv-resultp-of-extend-denv-with-topdecl-list

    (defthm denv-resultp-of-extend-denv-with-topdecl-list
      (b* ((new-env (extend-denv-with-topdecl-list decls env)))
        (denv-resultp new-env))
      :rule-classes :rewrite)

    Theorem: extend-denv-with-topdecl-list-of-topdecl-list-fix-decls

    (defthm extend-denv-with-topdecl-list-of-topdecl-list-fix-decls
      (equal (extend-denv-with-topdecl-list (topdecl-list-fix decls)
                                            env)
             (extend-denv-with-topdecl-list decls env)))

    Theorem: extend-denv-with-topdecl-list-topdecl-list-equiv-congruence-on-decls

    (defthm
     extend-denv-with-topdecl-list-topdecl-list-equiv-congruence-on-decls
     (implies (topdecl-list-equiv decls decls-equiv)
              (equal (extend-denv-with-topdecl-list decls env)
                     (extend-denv-with-topdecl-list decls-equiv env)))
     :rule-classes :congruence)

    Theorem: extend-denv-with-topdecl-list-of-denv-fix-env

    (defthm extend-denv-with-topdecl-list-of-denv-fix-env
      (equal (extend-denv-with-topdecl-list decls (denv-fix env))
             (extend-denv-with-topdecl-list decls env)))

    Theorem: extend-denv-with-topdecl-list-denv-equiv-congruence-on-env

    (defthm extend-denv-with-topdecl-list-denv-equiv-congruence-on-env
      (implies (denv-equiv env env-equiv)
               (equal (extend-denv-with-topdecl-list decls env)
                      (extend-denv-with-topdecl-list decls env-equiv)))
      :rule-classes :congruence)