Abstract

In this paper we explain how recursion operators can be used to structure and reason about program semantics within a functional language. In particular, we show how the recursion operator fold can be used to structure denotational semantics, how the dual recursion operator unfold can be used to structure operational semantics, and how algebraic properties of these operators can be used to reason about program semantics. The techniques are explained with the aid of two main examples, the first concerning arithmetic expressions, and the second concerning Milner's concurrent language CCS. The aim of the paper is to give functional programmers new insights into recursion operators, program semantics, and the relationships between them.

Highlights

  • Arithmetic expressionsThe grammar for expressions can be directly translated into a Haskell datatype de nition, parameterised over the type of values for exibility: data Expr a = Val a | Add Expr a Expr a

  • In this paper we explain how recursion operators can be used to structure and reason about program semantics within a functional language

  • To avoid repeating the same patterns of program and proof again and again, special recursion operators and proof principles that abstract out the common patterns can be introduced, allowing us to concentrate on the details that are speci c to each di erent application

Read more

Summary

Arithmetic expressions

The grammar for expressions can be directly translated into a Haskell datatype de nition, parameterised over the type of values for exibility: data Expr a = Val a | Add Expr a Expr a. The expression 1+2+3 is represented by the value Add Val 1 Add Val 2 Val 3. Int as the evaluation function for expressions de ned recursively as follows: Val Add n x y. This de nition satis es the compositionality requirement, because the meaning of compound expressions of the form. Add the x y is de ned subexpressions pxuraenlyd yb.y applying + to The evaluation the meanings function can of be translated directly into a Haskell function de nition: eval

B C BB CC eval Val 1
Universality for expressions
Concurrent processes in CCS
Operational semantics of CCS
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call