The artifact contains the Coq formalization of Fi+, as described in the paper "Distributive Disjoint Polymorphism for Compositional Programming". We document in detail how to build and compile the Coq proofs, as well as the proof structure and organization.
Our Coq proofs are verified in Coq 8.8.2. We rely on two Coq libraries:
metalib
for the locally nameless
representation in our proofs; and
coq-equations
for defining
logical relations using pattern matching.
-
Install Coq 8.8.2. The recommended way to install Coq is via
OPAM
. Refer to here for detailed steps. Or one could download the pre-built packages for Windows and MacOS via here. Choose a suitable installer according to your platform. -
Make sure
Coq
is installed (typecoqc
in the terminal, if you see "command not found" this means you have not properly installed Coq), then installmetalib
:- Open terminal
git clone https://github.com/plclub/metalib
cd metalib/Metalib
make install
-
Install
coq-equations.1.0+8.8
, refer to here.opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-equations.1.0+8.8
-
Type
make
in the terminal to build and compile the proofs. -
You should see something like the following (suppose
>
is the prompt):coq_makefile -arg '-w -variable-collision,-meta-collision,-require-in-module' -f _CoqProject -o CoqSrc.mk COQC Syntax_ott.v COQC TypeSystems.v COQC LibTactics.v COQC SystemF_inf.v COQC Fii_inf.v COQC Infrastructure.v COQC Algorithm.v COQC Assumed.v COQC SourceProperty.v COQC Disjoint.v COQC TargetProperty.v COQC LR.v COQC Compatibility.v COQC Coherence.v COQC SoundComplete.v
Syntax_ott.v
contains the locally nameless definitions of the calculi.TypeSystems.v
contains the type systems of the calculi.SourceProperty.v
contains some properties of the source language.TargetProperty.v
contains some properties of the target language.LR.v
contains definition of the logical relationDisjoint.v
contains some properties of the disjointness relation.Compatibility.v
contains the compatibility lemmas.Coherence.v
contains the proofs of the coherence property.Algorithm.v
contains the definition of the algorithmic subtyping.SoundComplete.v
contains the soundness and completeness proofs of the algorithmic subtyping.Fii_inf.v
contains auxiliary lemmas of the source language.SystemF_inf.v
contains auxiliary lemmas of the target language.Infrastructure.v
contains some auxiliary lemmas.Assumed.v
contains axioms (e.g., strong normalization) that are well-known in the literature.