52 3 Rules and Inference
growth, proliferation, and differentiation. It is common for this binding to
be somewhat imprecise, so that the resulting binding is not too tight. This
allows genes to be turned on and off dynamically in response to chemical
signals.
Both of these situations illustrate a common theme in protein-mediated bi-
ological processes. Proteins match targets, and when a match takes place (i.e.,
the protein forms a complex with its target), then the protein exerts a biolog-
ical effect (e.g., catalysis or gene regulation). The match can be exquisitely
precise, as in the classic Fischer lock-and-key model that characterizes many
enzymes, or it can be less precise, as in the Koshland induced-fit model or in
transcription factor bindings.
Not surprisingly, a similar theme is used in many computer systems. This
style of programming goes by various names, such as the “pattern-action
paradigm,” “expert systems,” “rule-based inferencing,” or “declarative pro-
gramming.” When programming in this style, one specifies a collection of
rules. Each rule has two parts:
- Thepattern, also called theantecedentor thehypothesis. This part of the rule
specifies the match condition. - Theaction,consequent,orconclusion. This part of the rule specifies the
effect that is exerted when the match condition holds.
A rule can be regarded as a logical statement of the form “if the match con-
dition holds, then perform the action.” When considered from this point of
view, the match condition is a “hypothesis,” and the action is a “conclusion.”
Just as in organisms, match conditions range from being very precise to being
very generic.
The condition of a rule is a Boolean combination of elementary facts, each
of which may include constants as well as one or more variables. A query is
essentially a rule with no conclusion, just a condition. At the other extreme, a
fact is a rule with no condition, just a conclusion. The result of a query is the
set of assignments to the variables that cause the rule to fire. From the point
of view of relational databases, a query can be regarded as a combination
of selections, projections, and joins. The variables in a rule engine query
correspond to the output variables (i.e., the projection) and join conditions of
a relational query. The constants occurring in a rule engine query correspond
to the selection criteria of a relational query. Both rule engines and relational
databases support complex Boolean selection criteria.
When the match condition of a rule is found to hold and the consequent