• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • 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
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • 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::empty 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::in fun (funscope-to-funtable funscope))
                 (omap::in fun (funscope-fix funscope))))

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

    (defthm
         consp-of-in-of-funscope-to-funtable
         (equal (consp (omap::in fun (funscope-to-funtable funscope)))
                (consp (omap::in 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)