André Hirschowitz and Marco Maggesi.

Description of our formalization

We present a partial solution to the POPLmark Challenge [1] based on Nested Datatypes in the Coq proof assistant. Our formalization addresses part (1A) of the Challenge. This work is a radical improvement of our previous attempt.

The use of the Nested Datatypes to encode higher order syntax is an already established discipline [2][3][4]. Some advantages on using this technique include:

Other random considerations about our formalization:

This formalization is part of our effort to put Modules over Monads and Nested Datatypes at work for reasoning about languages with bindings. The theory supporting our vision is exposed in [3].

Our formalization takes place in the standard Coq environment without axioms or specialized libraries. Yet it is very compact. We estimate the total amount of the information contained in our code by measuring the size of the gzipped sources. We tried to compare the GZib Kbytes size of our code with some other available formalizations. The results obtained are summarized in the following table.

Contribution Part 1A Extras
B.Aydemir et al. [5] 2.5 Kb 16.4 Kb
A.Hirschowitz & M.Maggesi [6] 2.7 Kb 0 Kb
X.Leroy [7] 5.0 Kb 1.0 Kb
J.Vouillon [8] 4.6 Kb 0 Kb

These statistics have been obtained by removing comments and code which does not appear to be necessary for addressing part 1A and by compressing the files with gzip with the option "—best". The whole process has been carried on mostly by hand, which means that it can be affected by errors. Some formalizations are built on top of some kind of general purpose library, in which case we tried to evaluate the size of the library (reported in the column Extras) separately from the size of the code specific for the solution of the Challenge.

This new version is about 5-6 times smaller than our previous attempt published in may 2006. One of the most important difference between the two versions resides in the formalisation of statements involving concatenation of environments. In the new formalization concatenation of environments is not explicitly defined and the notion of relative well-formedness is used instead. For instance, every judgement of the form

Gamma,Delta |- s <: t

has been rephrased systematically by as a conjunction

Delta' |- s <: t      /\      WF Gamma Delta' f

(where Delta' plays the role of Gamma,Delta).

Source code

  1. The sources for Coq version 8.1: Part1a.v.

  2. The html formatted sources: Part1a.html.

  3. The source of our earlier solution: fsub-2006-05-19.tar.gz.

References