• 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
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
        • Language
          • Abstract-syntax
          • Dynamic-semantics
          • Concrete-syntax
          • Static-soundness
          • Static-semantics
            • Static-safety-checking
              • Check-safe-statements/blocks/cases/fundefs
              • Check-safe-expressions
              • Check-safe-fundef-list
              • Check-safe-variable-multi
              • Check-safe-variable-single
              • Check-safe-assign-multi
              • Check-safe-assign-single
              • Check-safe-path
              • Check-safe-extends-varset
              • Vars+modes
              • Add-vars
              • Add-var
              • Add-funtypes
              • Check-safe-literal
              • Funtype
              • Get-funtype
              • Check-var
              • Check-safe-top-block
              • Check-safe-path-list
              • Vars+modes-result
              • Funtype-result
              • Funtable-result
              • Funtable-for-fundefs
                • Funtype-for-fundef
                • Funtable
              • Static-shadowing-checking
              • Mode-set-result
              • Literal-evaluation
              • Static-identifier-checking
              • Static-safety-checking-evm
              • Mode-set
              • Modes
            • Errors
          • Yul-json
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Static-safety-checking

    Funtable-for-fundefs

    Function table for a list of function definitions.

    Signature
    (funtable-for-fundefs fundefs) → funtab
    Arguments
    fundefs — Guard (fundef-listp fundefs).
    Returns
    funtab — Type (funtable-resultp funtab).

    We go through the list and form a function table for the functions. It is an error if there are two functions with the same name.

    Definitions and Theorems

    Function: funtable-for-fundefs

    (defun funtable-for-fundefs (fundefs)
      (declare (xargs :guard (fundef-listp fundefs)))
      (let ((__function__ 'funtable-for-fundefs))
        (declare (ignorable __function__))
        (b* (((when (endp fundefs)) nil)
             ((okf funtab)
              (funtable-for-fundefs (cdr fundefs)))
             (fundef (car fundefs))
             (fun (fundef->name fundef))
             ((when (consp (omap::assoc fun funtab)))
              (reserrf (list :duplicate-function fun))))
          (omap::update fun (funtype-for-fundef fundef)
                        funtab))))

    Theorem: funtable-resultp-of-funtable-for-fundefs

    (defthm funtable-resultp-of-funtable-for-fundefs
      (b* ((funtab (funtable-for-fundefs fundefs)))
        (funtable-resultp funtab))
      :rule-classes :rewrite)

    Theorem: funtable-for-fundefs-of-fundef-list-fix-fundefs

    (defthm funtable-for-fundefs-of-fundef-list-fix-fundefs
      (equal (funtable-for-fundefs (fundef-list-fix fundefs))
             (funtable-for-fundefs fundefs)))

    Theorem: funtable-for-fundefs-fundef-list-equiv-congruence-on-fundefs

    (defthm funtable-for-fundefs-fundef-list-equiv-congruence-on-fundefs
      (implies (fundef-list-equiv fundefs fundefs-equiv)
               (equal (funtable-for-fundefs fundefs)
                      (funtable-for-fundefs fundefs-equiv)))
      :rule-classes :congruence)