Skip to content

Commit 1e1af19

Browse files
committed
Bump README
1 parent fd6516f commit 1e1af19

File tree

1 file changed

+38
-69
lines changed

1 file changed

+38
-69
lines changed

README.md

Lines changed: 38 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,63 @@
11
Presentation
22
=======
33

4-
This repo contains formalisation work on implementing a logical relation over MLTT with one universe.
5-
This formalisation follows the [work done by Abel et al.]((https://github.com/mr-ohman/logrel-mltt/)) (described in [Decidability of conversion for Type Theory in Type Theory, 2018](https://dl.acm.org/doi/10.1145/3158111)), and [Loïc Pujet's work](https://github.com/loic-p/logrel-mltt) on removing induction-recursion from the previous formalization, making it feasible to translate it from Agda to Coq.
4+
This repo contains the formalisation work accompanying the paper "In Cantor Space No One Can Hear You Stream".
65

7-
The definition of the logical relation (**LR**) ressembles Loïc's in many ways, but also had to be modified for a few reasons :
8-
- Because of universe constraints and the fact that functors cannot be indexed by terms in Coq whereas it is possible in Agda, the relevant structures had to be parametrized by a type level and a recursor, and the module system had to be dropped out entirely.
9-
- Since Coq and Agda's positivity checking for inductive types is different, it turns out that **LR**'s definition, even though it does not use any induction-induction or induction-recursion in Agda, is not accepted in Coq. As such, the predicate over Π-types for **LR** has been modified compared to Agda. You can find a MWE of the difference in positivity checking in the two systems in [Positivity.v] and [Positivity.agda].
6+
The formalization is based on a [previous work](https://github.com/coqhott/logrel-coq/) by Adjej et al ([*Martin-Löf à la Coq*, CPP'24](https://arxiv.org/abs/2310.06376)), which itself follows a similar [Agda formalization](https://github.com/mr-ohman/logrel-mltt/) (described in [*Decidability of conversion for Type Theory in Type Theory*, 2018](https://dl.acm.org/doi/10.1145/3158111)). In order to avoid some work on the syntax, this project uses the [AutoSubst](https://github.com/uds-psl/autosubst-ocaml) project to generate syntax-related boilerplate.
107

11-
In order to avoid some work on the syntax, this project uses the [AutoSubst](https://github.com/uds-psl/autosubst-ocaml) project to generate syntax-related boilerplate.
8+
TL;DR HOWTO INSTALL
9+
===================
10+
11+
- Install opam through your favourite means.
12+
- Double-check that no Coq-related environment variables like COQBIN or COQPATH are set.
13+
- Launch the following commands in the folder of this development.
14+
```
15+
opam switch create . --empty
16+
eval $(opam env)
17+
opam install ocaml-base-compiler=4.14.3
18+
opam repo --this-switch add coq-released https://coq.inria.fr/opam/released
19+
opam install . --deps-only
20+
make
21+
```
22+
23+
IMPORTANT NOTE
24+
==============
25+
26+
The coqdocjs subfolder is **not** part of this development, but an independent project vendored here for simplicity of the build process. The upstream repository can be found at https://github.com/coq-community/coqdocjs/.
1227

1328
Building
1429
===========
1530

16-
The project builds with Coq version `8.16.1`. It needs the opam package `coq-smpl`. Once these have been installed, you can simply issue `make` in the root folder.
31+
The project builds on Coq version `8.19.2`, see the [opam](./opam) file for complete dependencies. Since they are not available as opam packages, [coqdocjs](https://github.com/coq-community/coqdocjs/) is simply included.
32+
33+
Once the dependencies have been installed, you can simply issue `make` in the root folder. The development should build within 10 minutes (around 3 minutes on a modern laptop).
1734

18-
The syntax has been generated using AutoSubst OCaml with the options `-s ucoq -v ge813 -allfv` (see the [AutoSubst OCaml documentation](https://github.com/uds-psl/autosubst-ocaml) for installation instructions for it). Currently, this package works only with older version of Coq (8.13), so we cannot add a recipe to the MakeFile for automatically
19-
re-generating the syntax.
35+
Apart from a few harmless warnings, and the output of some examples, the build reports on the assumptions of our main theorems, using `Print Assumptions`.
2036

21-
**In order to regenerate the syntax**, install autosubst paying attention to [this issue](https://github.com/uds-psl/autosubst-ocaml/issues/1) -- in an opam installation do a `cp -R $OPAM_SWITCH_PREFIX/share/coq-autosubst-ocaml $OPAM_SWITCH_PREFIX/share/autosubst`--, modify the syntax file `AutoSubst/PiUniv.sig`, run autosubst on it (`autosubst -s ucoq -v ge813 -allfv PiUniv.sig -o Ast.v`) and patch the resulting files using the checked in patch (`git apply -R autosubst-patch.diff`).
37+
For simplicity, the html documentation built using `coqdoc` is included in the artefact. It can be built again by invoking `make coqdoc`.
2238

23-
Browsing the Development
39+
Browsing the development
2440
==================
2541

26-
The development, rendered using `coqdoc`, can be [browsed online](https://coqhott.github.io/logrel-coq/coqdoc/toc.html).
42+
The development, rendered using the [coqdoc](https://coq.inria.fr/refman/using/tools/coqdoc.html) utility, can be then browsed (as html files). To start navigating the sources, the best entry point is probably the [the table of content](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/toc.html). A [short description of the file contents](https://ppedrot.github.io/quote-mltt-lics24/index.md) is also provided to make the navigation easier.
2743

28-
Getting Started
44+
Files of interest
2945
=================
3046

31-
A few things to get accustomed to if you want to use the development.
47+
Definitions
48+
--------
3249

33-
Notations and refolding
34-
-----------
50+
The abstract syntax tree of terms is in [Ast](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.AutoSubst.Ast.html), the declarative typing and conversion predicates are in [DeclarativeTyping](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.DeclarativeTyping.html), reduction is in [UntypedReduction](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.UntypedReduction.html).
3551

36-
In a style somewhat similar to the [Math Classes](https://math-classes.github.io/) project,
37-
generic notations for typing, conversion, renaming, etc. are implemented using type-classes.
38-
While some care has been taken to try and respect the abstractions on which the notations are
39-
based, they might still be broken by carefree reduction performed by tactics. In this case,
40-
the `refold` tactic can be used, as the name suggests, to refold all lost notations.
52+
The logical relation is defined with respect to a generic notion of typing, given in [GenericTyping](https://ppedrot.github.io/quote-mltt-lics24/LogRel.GenericTyping.html).
4153

42-
Induction principles
54+
Proofs
4355
----------
4456

45-
The development relies on large, mutually-defined inductive relations. To make proofs by induction
46-
more tractable, functions `XXXInductionConcl` are provided. These take the predicates
47-
to be mutually proven, and construct the type of the conclusion of a proof by mutual induction.
48-
Thus, a typical induction proof looks like the following:
57+
The toplevel results are exposed in a standalone file [Main](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.Main.html).
4958

50-
``` coq-lang
51-
Section Foo.
59+
The logical relation is defined in [LogicalRelation](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.LogicalRelation.html). It is first defined component by component, before the components are all brought together by inductive `LR` at the end of the file. The fundamental lemma of the logical relation, saying that every well-typed term is reducible, is in [Fundamental](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.Fundamental.html).
5260

53-
Let P := … .
54-
61+
Injectivity and no-confusion of type constructor, and subject reduction, are proven in [TypeConstructorsInj](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.TypeConstructorsInj.html).
5562

56-
Theorem Foo : XXXInductionConcl P … .
57-
Proof.
58-
apply XXXInduction.
59-
60-
End Section.
61-
```
62-
The names of the arguments printed when querying `About XXXInductionConcl` should make it clear
63-
to which mutually-defined relation each predicate corresponds.
64-
65-
[Utils]: ./theories/Utils.v
66-
[BasicAst]: ./theories/BasicAst.v
67-
[Context]: ./theories/Context.v
68-
[AutoSubst/]: ./theories/AutoSubst/
69-
[AutoSubst/Extra]: ./theories/AutoSubst/Extra.v
70-
[Notations]: ./theories/Notations.v
71-
[Automation]: ./theories/Automation.v
72-
[NormalForms]: ./theories/NormalForms.v
73-
[UntypedReduction]: ./theories/UntypedReduction.v
74-
[GenericTyping]: ./theories/GenericTyping.v
75-
[DeclarativeTyping]: ./theories/DeclarativeTyping.v
76-
[Properties]: ./theories/Properties.v
77-
[DeclarativeInstance]: ./theories/DeclarativeInstance.v
78-
[LogicalRelation]: ./theories/LogicalRelation.v
79-
[Induction]: ./theories/LogicalRelation/Induction.v
80-
[Escape]: ./theories/Escape.v
81-
[Reflexivity]: ./theories/Reflexivity.v
82-
[Irrelevance]: ./theories/Irrelevance.v
83-
[ShapeView]: ./theories/ShapeView.v
84-
[Positivity.v]: ./theories/Positivity.v
85-
[Weakening]: ./theories/Weakening.v
86-
[Substitution]: ./theories/Substitution.v
87-
[AlgorithmicTyping]: ./theories/AlgorithmicTyping.v
88-
[AlgorithmicConvProperties]: ./theories/AlgorithmicConvProperties.v
89-
[AlgorithmicTypingProperties]: ./theories/AlgorithmicTypingProperties.v
90-
[LogRelConsequences]: ./theories/LogRelConsequences.v
91-
[BundledAlgorithmicTyping]: ./theories/BundledAlgorithmicTyping.v
92-
93-
[autosubst-ocaml]: https://github.com/uds-psl/autosubst-ocaml
94-
[Positivity.agda]: ./theories/Positivity.agda
63+
Consistency and canonicity are derived in [Consequences](https://ppedrot.github.io/quote-mltt-lics24/coqdoc/LogRel.Consequences.html).

0 commit comments

Comments
 (0)