• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
        • Language
          • Abstract-syntax
          • Dynamic-semantics
          • Concrete-syntax
          • Static-soundness
            • Static-soundess-of-execution
            • Theorems-about-cstate-to-vars-and-execution
            • Static-soundness-theorems-about-add-funs
            • Static-soundness-theorems-about-modes
            • Static-soundness-theorems-about-init-local
            • Check-var-list
            • Funinfo-safep
            • Static-soundness-theorems-about-find-fun
            • Funenv-to-funtable
              • Theorems-about-checking-expression-lists-in-reverse
              • Static-soundness-of-variable-writing
              • Funscope-to-funtable
              • Funenv-safep
              • Funscope-safep
              • Cstate-to-vars
              • Funinfo-to-funtype
              • Static-soundness-of-variable-addition
              • Static-soundness-of-variable-reading
              • Static-soundness-of-literal-execution
              • Exec-top-block-static-soundness
              • Static-soundness-of-path-execution
            • Static-semantics
            • Errors
          • Yul-json
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Static-soundness

    Funenv-to-funtable

    Turn a function environment into a function table.

    Signature
    (funenv-to-funtable funenv) → funtab
    Arguments
    funenv — Guard (funenvp funenv).
    Returns
    funtab — Type (funtablep funtab).

    In formulating the static soundness theorems, we need to relate the ACL2 dynamic execution functions, which take function environments as arguments, with the ACL2 static safety checking functions, which take function tables as arguments: the function tables are the static counterparts of the function environments. This ACL2 function carries out this mapping, by creating function tables for the function scopes and joining them together. It is a run-time invariant that the function scopes in a function environment have disjoint keys; thus, the use of omap::update* is not going to overwrite any mappings. However, we do not need to require this invariant here, as this ACL2 function can be well-defined without it.

    Definitions and Theorems

    Function: funenv-to-funtable

    (defun funenv-to-funtable (funenv)
      (declare (xargs :guard (funenvp funenv)))
      (let ((__function__ 'funenv-to-funtable))
        (declare (ignorable __function__))
        (b* (((when (endp funenv)) nil)
             (funtab-cdr (funenv-to-funtable (cdr funenv)))
             (funtab-car (funscope-to-funtable (car funenv))))
          (omap::update* funtab-car funtab-cdr))))

    Theorem: funtablep-of-funenv-to-funtable

    (defthm funtablep-of-funenv-to-funtable
      (b* ((funtab (funenv-to-funtable funenv)))
        (funtablep funtab))
      :rule-classes :rewrite)

    Theorem: funenv-to-funtable-of-funenv-fix-funenv

    (defthm funenv-to-funtable-of-funenv-fix-funenv
      (equal (funenv-to-funtable (funenv-fix funenv))
             (funenv-to-funtable funenv)))

    Theorem: funenv-to-funtable-funenv-equiv-congruence-on-funenv

    (defthm funenv-to-funtable-funenv-equiv-congruence-on-funenv
      (implies (funenv-equiv funenv funenv-equiv)
               (equal (funenv-to-funtable funenv)
                      (funenv-to-funtable funenv-equiv)))
      :rule-classes :congruence)