• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
      • Std/util
      • Defdata
      • Defrstobj
      • Seq
      • Match-tree
      • Defrstobj
      • With-supporters
      • Def-partial-measure
      • Template-subst
      • Soft
        • Soft-future-work
        • Soft-macros
        • Updates-to-workshop-material
        • Soft-implementation
          • Soft-implementation-core
            • Sothm-inst-facts
            • Ext-fun-subst-term/terms/function
            • Fun-subst-function
            • Sothm-inst-pairs
            • Funvars-of-term/terms
            • Funvars-of-plain-fn
              • Sothm-inst-proof
              • Fun-subst-term/terms
              • Get-sof-instance
              • Sof-instancesp
              • Put-sof-instance
              • Fun-substp
              • Sofun-kindp
              • Funvar-listp
              • *-listp
              • Funvars-of-quantifier-fn
              • No-trivial-pairsp
              • Funvars-of-choice-fn
              • Funvar-instp
              • Funvars-of-thm
              • Sofunp
              • Funvarp
              • Sof-instances
              • Sothmp
              • Quant-sofunp
              • Plain-sofunp
              • Funvar-inst-listp
              • Choice-sofunp
              • Sofun-funvars
              • Sofun-kind
              • Function-variables-table
              • Sof-instances-table
              • Second-order-functions-table
            • Gen-macro2-of-macro
            • Defun-inst-implementation
            • Defthm-inst-implementation
            • Defsoft-implementation
            • Defunvar-implementation
            • Defund-sk2-implementation
            • Defun-sk2-implementation
            • Define-sk2-implementation
            • Defchoose2-implementation
            • Defund2-implementation
            • Defun2-implementation
            • Define2-implementation
          • Soft-notions
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Soft-implementation-core

    Funvars-of-plain-fn

    Function variables depended on by a plain second-order function or by an instance of it.

    Signature
    (funvars-of-plain-fn fun wrld) → funvars
    Arguments
    fun — Guard (symbolp fun).
    wrld — Guard (plist-worldp wrld).
    Returns
    funvars — A funvar-listp.

    Plain second-order functions and their instances may depend on function variables via their defining bodies, via their measures (absent in non-recursive functions), and via their guards. For now recursive second-order functions (which are all plain) and their instances are only allowed to use o< as their well-founded relation, and so plain second-order functions and their instances may not depend on function variables via their well-founded relations.

    Note that if the function is recursive, the variable measure in the following code is nil, and funvars-of-term applied to that yields nil.

    The returned list may contain duplicates.

    Definitions and Theorems

    Function: funvars-of-plain-fn

    (defun funvars-of-plain-fn (fun wrld)
      (declare (xargs :guard (and (symbolp fun)
                                  (plist-worldp wrld))))
      (let ((__function__ 'funvars-of-plain-fn))
        (declare (ignorable __function__))
        (let* ((body (ubody fun wrld))
               (measure (if (recursivep fun nil wrld)
                            (get-measure fun wrld)
                          nil))
               (guard (uguard fun wrld))
               (body-funvars (funvars-of-term body wrld))
               (measure-funvars (funvars-of-term measure wrld))
               (guard-funvars (funvars-of-term guard wrld)))
          (append body-funvars
                  measure-funvars guard-funvars))))