Term Rewriting, Termination, and Confluence

Recognize a branching rewrite system and determine whether different legal reduction orders give a common result.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A rule can apply at several positions
  2. Termination alone can leave several normal forms

A rule can apply at several positions

A term rewriting rule replaces an instance of its left-hand pattern by the corresponding instance of its right-hand term. A rule removing addition of zero can reduce a term inside a larger expression as well as at the root. A termination proof can use a measure such as the number of syntax nodes when every step strictly decreases it. That ensures the reduction eventually reaches a normal form.

Termination alone can leave several normal forms

With rules \(f(a)\to b\) and \(a\to c\), the term \(f(a)\) can become \(b\) or \(f(c)\). If neither reduces further, the fork demonstrates nonconfluence. Confluence asks for a common descendant from any two reductions of the same start. Local overlap analysis and a termination argument can help prove it. Equality saturation represents equivalent alternatives together, allowing selection by cost without requiring one oriented normal form.[1][2]

References

  1. Shriram Krishnamurthi, Programming Languages: Application and Interpretation ↩
  2. Robert Nystrom, Crafting Interpreters ↩