Rule Systems
Rule systems are seen in almost every programming languages paper. They are a tool for conveying very precise notions of computation. In general, is not easy to give a succinct definition of a rule system, but one can be described easily by adopting a specific representation.
A rule system consists of a set of statements of the form
where
In an acceptable interpretation that I prefer,
So a rule can be read: if
In essence, rule systems describes the objects of sets. For example,
are the rules that may be used to describe the set of natural numbers. This shows how an inductive set may be defined via a rule system. Though, here we are interested in the case of relations.
When the set
where
For ease of reference, we will refere to
TODO: more examples
Proof System
How do you know if a given judgment is true? A judgment is true when you can derive it from the axioms using the rules in the rule system. A good way to check if judgment is true for a rule system is to start with the conclusion, then attempt to recursively apply the rules by pattern matching on the conclusions, filling out each of the premises. This process results in a proof tree for the original judmgnent, and the truth is known if the leaves of the tree are axioms, and each rule is correctly applied. Check out this article by Daniel.
For an example, here is a proof tree for
using the rules
where
Interestingly, not all rule systems can be checked against in this way, such as propositional logic. The systems for which this proof tree generation process works are called syntax directed rule systems.
Computation
Since a function is just a special kind of relation, it is possible for a function to be defined via a rule system. Computer scientists are mostly interested in rule systems that describe functional relations, as these are often descriptions for how the function is computed.
As an example, suppose
Note that
So, every judgment that we derive in this system,