Programming in ACL2
This documentation topic is a parent topic under which we
include documentation topics for built-in functions, macros, and special
forms, as well as topics for notions important to programming with ACL2. If
you don't find what you're looking for, see the Index or see individual topics
that may be more directly appropriate; for example, see events for
top-level event constructors like defun. A subtopic, ACL2-built-ins, contains as subtopics (displayed in a flat list) most of the
topics in the documentation hierarchy that appear under this
If you are already familiar with Common Lisp (or even some other Lisp
variant), then you may find it helpful to start with the topic, introduction-to-programming-in-ACL2-for-those-who-know-lisp.
Also see debugging for utilities that can aid in programming.
- Define a function symbol
- Extra declarations that can occur in function definitions, let
bindings, and so forth.
- Single-threaded objects or ``von Neumann bottlenecks''
- The von Neumannesque ACL2 state object
- Turn on memoization for a specified function
- Attach code for execution
- Input/output facilities in ACL2
- Apply a badged function or tame lambda to arguments
- Some built-in programming utilities pertaining to the ACL2 system
- Define a new symbol package
- Define some mutually recursive functions
- ACL2 arrays and operations on them
- Programming using the von Neumannesque ACL2 state object
- Characters in ACL2 and operations on them
- Iteration with an analogue of the Common Lisp loop macro
- Time an evaluation
- Define a macro
- Define a constant
- Restricting the domain of a function
- Evaluating ACL2 expressions
- Versions of a function using different equality tests
- Alists with hidden hash tables for faster execution
- Compiling ACL2 functions
- (hons x y) returns a normed object equal to (cons x
- ''Catch-all'' topic for built-in ACL2 functions
- Some advanced features of ACL2
- Affect certain program-mode updates to stobjs or arrays
- Guide for ACL2 developers
- Numbers in ACL2 and operations on them
- Formals that are used but only insignificantly
- Efficiency considerations
- Introduction to programming in ACL2 for Lisp users
- An explanation of why we restrict redefinitions
- Lists of objects, the classic Lisp data structure.
- Potential slowdown for program-mode updates to stobjs
- Support for causing runtime errors, breaks, assertions, etc.
- A convenient form of macro definition for simple expansions
- A cons is an ordered pair. In ACL2, data structures like
lists, alists, etc., are made up of conses.
- Operations on association lists, which bind keys to values.
- Avoid invariant-risk checking for specified functions
- Strings are atomic objects that contain character sequences,
like "Hello World".
- Avoiding expensive guard checks using program-mode functions
- Runtime vs. realtime in ACL2 timings
- Basic control structures for programming like if and
cond, binding operators like let and flet, multiple-value
constructs like mv, and so forth.
- Collections of symbols that act as namespaces.
- System-level algorithms that users can modify with attachments
- Define an ``untouchable'' macro
- Primitive functions built into ACL2 without definitions
- A total ordering on ACL2 objects.
- Evaluate without (ultimately) changing the world
- Control action for macro calls with duplicate keyword arguments
- Turn off memoization for the specified function
- Symbols in ACL2 and operations on them
- Define function that constructs a list, just by giving the length and
how to compute the Nth element in terms of the formals and index.
- A simple interface for simplifying a term, perhaps under a hypothesis
and equivalence context, and with optional guidance from a hint.
- Define a simple for-loop-style iteration, counting up over some
- A simple event generator that creates a theorem by finding out what a
term simplifies to under some hyp and with some hint.
- Sleep for some number of seconds