## Relational Programming, Program Inversion and the Derivation of Parsing Algorithms (1993)

Citations: | 1 - 0 self |

### BibTeX

@MISC{Knapen93relationalprogramming,,

author = {Ed Knapen and Supervisor Prof. Dr. Rol},

title = {Relational Programming, Program Inversion and the Derivation of Parsing Algorithms},

year = {1993}

}

### OpenURL

### Abstract

The spec calculus is a programming algebra that supports and even encourages the derivation of relational programs in a clear and calculational style. After a brief introduction of the spec calculus two particular uses are investigated. First, the notion of program inversion is introduced. This notion from imperative programming allows one to construct from a given program R that satisfies fPg R fQg a program R 1 that satis es fQg R 1 fPg . It is shown that, as may be expected, a relational framework allows easy definition of and calculation with inverses of arbitrary programs. Several examples are discussed and used to introduce different methods to calculate implementable inverses. The second topic is the derivation of precedence parsing algorithms. A simple algorithm for the calculation of the inorder traversal of a tree is transformed in two steps into an algorithm for precedence parsing. The first transformation is the use of program inversion to obtain an algorithm that constru...