Sets of runes to enable/disable in concert
Example: '((:definition app) ; or (:d app) (:executable-counterpart app) (:i app) rv (rv) (:r assoc-of-app))
See:
A theory is a list of ``runic designators'' as described below. Each runic
designator denotes a set of ``runes'' (see rune) and by unioning
together the runes denoted by each member of a theory we define the set of
runes corresponding to a theory. Theories are used to control which rules are
``enabled,'' i.e., available for automatic application by the theorem
prover. There is always a ``current'' theory. A rule is enabled
precisely if its rune is an element of the set of runes
corresponding to the current theory. At the top-level, the current theory is
the theory selected by the most recent in-theory event, extended with
the rule names introduced since then. Inside the theorem prover, the
Theories are generally constructed by ``theory expressions.'' Formally, a theory expression is any term, containing at most the single free variable world, that when evaluated with world bound to the current ACL2 world (see world) produces a theory. ACL2 provides various functions for the convenient construction and manipulation of theories. These are called ``theory functions'' (see theory-functions). For example, the theory function union-theories takes two theories and produces their union. The theory function universal-theory returns the theory containing all known rule names as of the introduction of a given logical name. But a theory expression can contain constants, e.g.,
'(len (len) (:rewrite car-cons) car-cdr-elim)
and user-defined functions. The only important criterion is that a theory expression mention no variable freely except world and evaluate to a theory.
More often than not, theory expressions typed by the user do not mention the variable world. This is because user-typed theory expressions are generally composed of applications of ACL2's theory functions. These ``functions'' are actually macros that expand into terms in which world is used freely and appropriately. Thus, the technical definition of ``theory expression'' should not mislead you into thinking that interesting theory expressions must mention world; they probably do and you just didn't know it!
One aspect of this arrangement is that theory expressions cannot generally
be evaluated at the top-level of ACL2, because world is not bound. To
see the value of a theory expression,
ACL2 !>(LET ((WORLD (W STATE))) expr).
However, because the built-in theories are quite long, you may be sorry you printed the value of a theory expression!
A theory is a true list of runic designators and to each theory there corresponds a set of runes, obtained by unioning together the sets of runes denoted by each runic designator. For example, the theory constant
'(len (len) (:e nth) (:rewrite car-cons) car-cdr-elim)
corresponds to the set of runes
{(:definition len) (:induction len) (:executable-counterpart len) (:executable-counterpart nth) (:rewrite car-cons) (:elim car-cdr-elim)} .
Observe that the theory contains five elements but its runic correspondent
contains six. That is because runic designators can denote sets of several
runes, as is the case for the first designator,
We now precisely define the runic designators and the set of runes
denoted by each. When we refer below to the ``macro-aliases dereference of''
a symbol,
Note that including a function name, e.g., len, in the current
theory enables that function but does not enable the executable-counterpart. Similarly, including
Because a rune is a runic designator denoting the set containing that rune, a list of runes is a theory and denotes itself. There is a natural ``canonical'' ordering of runes by order of their creation. We call a canonically ordered true list of runes a ``runic theory.'' To every theory there corresponds a runic theory, sometimes called its runic correspondent, obtained by unioning together the sets denoted by each designator in the theory. When a theory is selected as ``current'' it is actually its runic correspondent that is effectively used. That is, a rune is enabled iff it is a member of the runic correspondent of the current theory. The value of a theory defined with deftheory is the runic correspondent of the theory computed by the defining theory expression. The theory manipulation functions, e.g., union-theories, actually convert their theory arguments to their runic correspondents before performing the required set operation. The manipulation functions always return runic theories. Thus, it is sometimes convenient to think of (non-runic) theories as merely abbreviations for their runic correspondents, abbreviations which are ``expanded'' at the first opportunity by theory manipulation functions and the ``theory consumer'' functions such as in-theory and deftheory.