(continued from ARS 1)
Now let us see that even on the abstract level of ARSs, there is a bit of interesting theory that helps to clarify what happens in the examples.
Notation:
We write
Definition: Let
Remark: Sometimes canonical form is used to mean unique normal form. [2]
Exercise: Write out Church-Rosser and confluence in symbolic notation.
Exercise: Does terminating implies normalising? What about the converse?
Theorem: An ARS is Church-Rosser if and only if it is confluent.
Is this obvious? Can we prove it?
Corollary: Let
Thus, confluence implies that normal forms are unique as long as they exist in the first place.
Yet another way to say this:
Corollary: An ARS is confluent and normalising if and only if there exist unique normal forms.
But how do we show that normal forms exist?
Theorem: If an ARS is confluent and terminating then all elements reduce to a unique normal form.
Remark (local confluence): Confluence as defined above says that for every "peak"
The last theorem and remark highlights the importance of termination. But termination is of course a very important topic in programming in general (ever since one learned about the while loop). So this is the topic of the next lecture.
(to be continued at ARS 3)
Baader, Nipkow. Term Rewriting and All That. 1999
This is my main reference for ARSs and term rewriting. I will mainly use material from the following sections:
โโโโโโ Chapters
โโ 2.1 confluence, normal forms, etc
โโ 2.3 termination
โโ 2.4 lexicographic ordering
The book above should be in the library now. You may also look at Chapter 1.1 of
which has the advantage of being available online and an abridged version of the standard reference on term rewriting.
Another valuable resource, in particular with an eye to what is coming later on
We also say that
For example, we may rewrite arithmetic expressions in the language
exp ::= 1 | x | exp + exp | exp * exp
by expanding expressions of the form X*(Y+Z)
to X*Y+X*Z
. This gives us normal forms we know from high-school algebra (think of the familiar expansion of (x+1)*(x+1)
to x*x + 2*x + 1
). But these normal forms are not unique as we may write the summands and products in any order (we could, eg, write as well 1 + x*x + x*2
).
Other similar examples of normal forms that may be familiar are the disjunctive and conjunctive normal form in Boolean logic. โฉ๏ธ