• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • 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
          • 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
    • Static-soundness

    Funscope-to-funtable

    Turn a function scope into a function table.

    Signature
    (funscope-to-funtable funscope) → funtab
    Arguments
    funscope — Guard (funscopep funscope).
    Returns
    funtab — Type (funtablep funtab).

    We turn the function information values of the omap into function types. They keys of the omap are unchanged.

    See funenv-to-funtable for more explanation on the purpose of this computation.

    Definitions and Theorems

    Function: funscope-to-funtable

    (defun funscope-to-funtable (funscope)
      (declare (xargs :guard (funscopep funscope)))
      (let ((__function__ 'funscope-to-funtable))
        (declare (ignorable __function__))
        (b* ((funscope (funscope-fix funscope))
             ((when (omap::emptyp funscope)) nil)
             ((mv name funinfo)
              (omap::head funscope))
             (funtab (funscope-to-funtable (omap::tail funscope))))
          (omap::update name (funinfo-to-funtype funinfo)
                        funtab))))

    Theorem: funtablep-of-funscope-to-funtable

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

    Theorem: in-of-funscope-to-funtable

    (defthm in-of-funscope-to-funtable
      (iff (omap::assoc fun (funscope-to-funtable funscope))
           (omap::assoc fun (funscope-fix funscope))))

    Theorem: consp-of-assoc-of-funscope-to-funtable

    (defthm consp-of-assoc-of-funscope-to-funtable
      (equal (consp (omap::assoc fun (funscope-to-funtable funscope)))
             (consp (omap::assoc fun (funscope-fix funscope)))))

    Theorem: keys-of-funscope-to-funtable

    (defthm keys-of-funscope-to-funtable
      (equal (omap::keys (funscope-to-funtable funscope))
             (omap::keys (funscope-fix funscope))))

    Theorem: funscope-to-funtable-of-update

    (defthm funscope-to-funtable-of-update
     (implies
          (and (identifierp fun)
               (funinfop info)
               (funscopep funscope))
          (equal (funscope-to-funtable (omap::update fun info funscope))
                 (omap::update fun (funinfo-to-funtype info)
                               (funscope-to-funtable funscope)))))

    Theorem: funscope-to-funtable-of-funscope-fix-funscope

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

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

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