2.3 Events and Definitions
ACL2 events are special terms which define new functions or logical rules. Defined names are in scope within their own definition and below; forward references are not allowed. Use the mutual-recursion event for mutually recursive functions.
Raises an error if the given test fails.
Examples: |
> (assert$ (< 0 1) t) |
t |
> (assert$ (< 1 0) t) |
assert$: Assertion failed! stx |
(defaxiom name term :rule-classes rule-classes :doc doc-string) |
Defines an axiom. Using defaxiom is not recommended.
Examples: | |||
|
Defines a label, for adding a landmark and/or adding a documentation topic.
Examples: | ||
|
Defines a theory (to enable or disable a set of rules)
Examples: | ||||
|
|
Defines a theorem to be proved and named.
Examples: |
> (defthm x+x=2x (= (+ x x) (* 2 x))) |
Examples: | |||
|
(include-book file options )
Imports reusable definitions to the current program. See the section on Books and Teachpacks for details on include-book in Dracula.
For defining mutually-recursive functions.
Examples: | |||||
|
Defines a constant value. The name must begin and end with asterisks.
Examples: |
> (defconst *PI* 22/7) |
> (* 2 *PI*) |
44/7 |
Defines a function.
Examples: | ||||
| ||||
> (absolute-value 5) | ||||
5 | ||||
> (absolute-value -5) | ||||
5 |
Used in defun to give ACL2 extra information about a function.