Semantics Engineering with PLT Redex

Overview

The first half of the course will present an overview of operational semantics (specifically context-sensitive rewriting semantics) and PLT Redex. It will cover the basic mathematics behind operational semantics as well as basic properties that semantics should have and how they are used.

In the second half of the course, students will be required to find a paper from a programming languages conference that models some aspect of a programming language that interests them, implement the model from the paper, test it using Redex's automatic test suite generation support, and give a presentation on the paper and their model, or to do the same for a board game (theorems to test to be negotiated, at least to include termination properties of the game).


MeetingTech L361; MF 2-4pm

TextSemantics Engineering with PLT Redex by Felleisen, Findler, and Flatt (awaiting publication; readings from the text will be given to students in class)

SoftwarePLT Redex (distributed with PLT Scheme).

Schedule
Week 7FContracts:
Behavioral Contracts and Behavioral Subtyping
Contracts for Higher-Order Functions
Contracts as Pairs of Projections
Week 8MRedex II.6
Week 8FFRP
Elliott, Hudak: Functional Reactive Animation
Cooper, Krishnamurthi: Embedding Dynamic Dataflow in a Call-by-Value Language
Pucella: Reactive Programming in Standard ML
Week 9MBackgammon
Week 9FParcheesi
Week 10MFRP
Week 10FSensor networks

Backgammon Assignment

Come up with 5 legal boards and, for each of those boards, one illegal move and one legal move (ie, a total of 15 instances of G).

(define-language bgm
  (G (B ... (B D ...) ... color)) ; Game state
  (B (HB HB)) ;; white pieces, then black pieces
  (HB (C ...)) ;; one C for each checker
  (C N home bar) ;; where the checker currently is
  (N number)
  (D 1 2 3 4 5 6) ;; die rolls 
  (color b w))

Notes:

  • To be legal for their game, there must be at least one B in a game state, but ignore this for your test cases
  • White moves by addition, and black by subtraction
  • With the exception of bopping, taking a die roll is always a complete move
  • Bopping happens in stages; first the white & black piece sit on the same spot and the die roll is removed. In the second stage the bopped piece is moved to the bar and the color changes.
  • This is the initial B for the actual game:
    ((1 1 12 12 12 12 12 17 17 17 19 19 19 19 19)
     (24 24 13 13 13 13 13 8 8 8 6 6 6 6 6))


Possible Projects
Abadi and Plotkin: A Model of Cooperative Threads
Pucella: Reactive Programming in Standard ML
Ariola and Felleisen: Lazy Evaluation
Flanagan and Felleisen: Futures
Morrisett, Felleisen, Harper: Memory and GC
Findler and Blume: Contracts as Pairs of Projections
Parcheesi
Carcassonne

Robby Findler