• 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
          • Xargs
          • Mutual-recursion
          • Defun-mode
          • Rulers
          • Defun-inline
          • Defun-nx
          • Defund
            • Set-ignore-ok
            • Set-well-founded-relation
            • Set-measure-function
            • Set-irrelevant-formals-ok
            • Defun-notinline
            • Set-bogus-defun-hints-ok
            • Defund-nx
            • Defun$
            • Defund-notinline
            • Defnd
            • Defn
            • Defund-inline
            • Set-bogus-measure-ok
          • Verify-guards
          • Table
          • Mutual-recursion
          • Memoize
          • Make-event
          • Include-book
          • Encapsulate
          • Defun-sk
          • 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
      • Events

      Defund

      Define a function symbol and then disable it

      Use defund instead of defun when you want to disable a function immediately after its definition in :logic mode. This macro has been provided for users who prefer working in a mode where functions are only enabled when explicitly directed by :in-theory. Specifically, the form

      (defund NAME FORMALS ...)

      expands to the following, except that some output is inhibited for the in-theory event:

      (progn
        (defun NAME FORMALS ...)
        (in-theory (disable NAME))
        (value-triple '(:defund NAME))).

      Only the :definition rule and, for recursively defined functions, the :induction rule are disabled for the function. In particular, defund does not disable either the :type-prescription or the :executable-counterpart rule.

      If the function is defined in :program mode, either because the default-defun-mode is :program or because :mode :program has been specified in an xargs form of a declare form, then no in-theory event is executed. (More precisely, in-theory events are ignored when the default-defun-mode is :program, and if :mode :program is specified then defund does not generate an in-theory event.)

      Defund events are generally not redundant, because the generated in-theory event is not redundant. This default can be changed; see set-in-theory-redundant-okp.

      See defun for documentation of defun.