• 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
        • 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
    • Events

    Defstub

    Stub-out a function symbol

    Examples:
    ACL2 !>(defstub subr1 (* * state) => (mv * state))
    ACL2 !>(defstub add-hash (* * hashtable) => hashtable)
    ACL2 !>(defstub inv (*) => * :formals (x) :guard (fieldp x))
    
    General Forms:
    (defstub name (i1 ... ik) => outputs :kwd1 val1 ... :kwdn valn) ; new style
    (defstub name (i1 ... ik) outputs :kwd1 val1 ... :kwdn valn)    ; old style

    where name is a new function symbol, and (i1 ... ik), outputs, :kwdi, and vali must be as follows, respectively.

    • New style: ((name i1 ... ik) => outputs :kwd1 val1 ... :kwdn valn) is a valid new-style signature.
    • Old style: (name (i1 ... ik) outputs :kwd1 val1 ... :kwdn valn) is a valid old-style signature.

    Also see signature. Note that (i1 ... ik) is the list of formal parameters of the newly-defined function symbol, name.

    Note that while the defstub syntax resembles a signature, it is different: name occurs outside the parentheses containing (i1 ... ik) in the defstub syntax, but inside in the signature syntax.

    A defstub macro call expands into an encapsulate event (see encapsulate). Thus, no axioms are available about name but it may be used wherever a function of the given signature is permitted. Exception: if outputs is of the form (mv ...), then a :type-prescription rule is introduced stating that name returns a value satisfying true-listp.