• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
        • Defun
        • Verify-guards
        • Table
        • Mutual-recursion
        • Memoize
        • Make-event
        • Include-book
        • Encapsulate
        • Defun-sk
          • Define-sk
          • Quantifier-tutorial
          • Defun-sk-queries
            • Defun-sk-matrix
            • Defun-sk-p
              • Defun-sk-namep
              • Defun-sk-body
              • Defun-sk-imatrix
              • Defun-sk-definition-name
              • Defun-sk-witness
              • Defun-sk-classicalp
              • Defun-sk-rewrite-kind
              • Defun-sk-rewrite-name
              • Defun-sk-rewrite-kind-p
              • Defun-sk-quantifier
              • Defun-sk-options
              • Defun-sk-bound-vars
              • Defun-sk-strengthen
              • Defun-sk-quantifier-p
            • Quantifiers
            • Defun-sk-example
            • Defund-sk
            • Forall
            • Def::un-sk
            • Equiv
            • Exists
            • Congruence
          • Defttag
          • Defstobj
          • Defpkg
          • Defattach
          • Defabsstobj
          • Defchoose
          • Progn
          • Verify-termination
          • Redundant-events
          • Defmacro
          • Defconst
          • Skip-proofs
          • In-theory
          • Embedded-event-form
          • Value-triple
          • Comp
          • Local
          • Defthm
          • Progn!
          • Defevaluator
          • Theory-invariant
          • Assert-event
          • Defun-inline
          • Project-dir-alist
          • Partial-encapsulate
          • Define-trusted-clause-processor
          • Defproxy
          • Defexec
          • Defun-nx
          • Defthmg
          • Defpun
          • Defabbrev
          • Set-table-guard
          • Name
          • Defrec
          • Add-custom-keyword-hint
          • Regenerate-tau-database
          • Defcong
          • Deftheory
          • Defaxiom
          • Deftheory-static
          • Defund
          • Evisc-table
          • Verify-guards+
          • Logical-name
          • Profile
          • Defequiv
          • Defmacro-untouchable
          • Add-global-stobj
          • Defthmr
          • Defstub
          • Defrefinement
          • Deflabel
          • In-arithmetic-theory
          • Unmemoize
          • Defabsstobj-missing-events
          • Defthmd
          • Fake-event
          • Set-body
          • Defun-notinline
          • Functions-after
          • Macros-after
          • Dump-events
          • Defund-nx
          • Defun$
          • Remove-global-stobj
          • Remove-custom-keyword-hint
          • Dft
          • Defthy
          • Defund-notinline
          • Defnd
          • Defn
          • Defund-inline
          • Defmacro-last
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defun-sk-queries

    Defun-sk-p

    Check if a named function has been introduced via defun-sk, returning the function's defun-sk form if the check succeeds.

    Signature
    (defun-sk-p fn wrld) → defun-sk-form?
    Arguments
    fn — Guard (symbolp fn).
    wrld — Guard (plist-worldp wrld).
    Returns
    defun-sk-form? — A maybe-pseudo-event-formp.

    If the check fails, nil is returned.

    As explained here, we consult the pe-table. If the defun-sk is generated by some other macros that also extends the table, the defun-sk form is not the only one associated to fn in the table. But it should be always the last one in the table entry for fn (which is an alist from absolute event numbers to forms), because none of the forms generated by defun-sk extends the table, and newer forms (generated by the hypothesized other macro that generates the defun-sk) are consed onto the entry.

    This utility causes an error if called on a symbol that is not a function symbol.

    Definitions and Theorems

    Function: defun-sk-p

    (defun defun-sk-p (fn wrld)
      (declare (xargs :guard (and (symbolp fn) (plist-worldp wrld))))
      (let ((__function__ 'defun-sk-p))
        (declare (ignorable __function__))
        (b* (((unless (function-symbolp fn wrld))
              (raise "The symbol ~x0 does not name a function."
                     fn))
             (table (table-alist 'pe-table wrld))
             (entry (cdr (assoc-eq fn table)))
             (last-number+form (car (last entry)))
             (last-form (cdr last-number+form)))
          (if (eq (car last-form) 'defun-sk)
              last-form
            nil))))