Teaching semantics of programming languages with modular SOS

  • Authors:
  • Peter D. Mosses

  • Affiliations:
  • Department of Computer Science, Swansea University, Swansea, UK

  • Venue:
  • TFM'06 Proceedings of the 2006 conference on Teaching Formal Methods: practice and experience
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Most undergraduate courses on formal semantics are based on conventional Structural Operational Semantics (SOS) and/or Denotational Semantics. Typically, they give semantic descriptions of a series of small programming languages, starting from a very simple one, and subsequently extending it with various new features. For each extension, however, it is usually necessary to revisit the description of the constructs of the initial language, and reformulate it to take account of the new features - although the required reformulation is often so routine that it may be left as an exercise. In contrast, a course based on Modular SOS gives an independent description of each language construct, and no reformulation at all is needed when adding new features. Such a course has been given for 3rd-year undergraduates at the University of Aarhus, Denmark, 2001-2004. A further novelty of the course was to use substantial fragments of a real programming language (Standard ML) for illustration and exercises. Moreover, tool support for Modular SOS enabled the students to add their own descriptions of new constructs to a given language description, and to check empirically whether the resulting semantics of programs in the extended language was as intended.