Skip to content

Commit 02e7998

Browse files
author
Andrei Popescu
committed
Merge branch 'popl2025' of github.com:jvanbruegge/binder_datatypes into popl2025
2 parents e0dd593 + 0a37b54 commit 02e7998

File tree

128 files changed

+58570
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+58570
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ After downloading Isabelle, a good starting point is to issue the following comm
1717
/<Isabelle/installation/path>/bin/isabelle jedit -d . -l Prelim thys/Untyped_Lambda_Calculus/LC_Beta.thy
1818
```
1919

20-
in the folder of the artifact. This will open `Isabelle/jEdit` and load our formalization of beta reduction for the untyped lambda calculus and the associated strong rule induction principle. Using the`Isabelle/jEdit` menu, one can then browse through the subdirectories of `thys` and open any other theories; or one can start directly with another theory, for example:
20+
in the folder of the artifact. This will open `Isabelle/jEdit` and load our formalization of beta reduction for the untyped lambda calculus and the associated strong rule induction principle. Using the `Isabelle/jEdit` menu, one can then browse through the subdirectories of `thys` and open any other theories; or one can start directly with another theory, for example:
2121

2222
```
2323
/<Isabelle/installation/path>/bin/isabelle jedit -d . -l Prelim thys/Infinitary_Lambda_Calculus/Iso_LC_ILC.thy
@@ -38,6 +38,7 @@ without running Isabelle. The file html/index.html provides a good starting poin
3838
/<Isabelle/installation/path>/bin/isabelle build -vD . -o browser_info
3939
```
4040

41+
The resulting html files are placed in `~/.isabelle/Isabelle2024/browser_info`.
4142

4243
### Overview
4344

@@ -75,7 +76,7 @@ The formalization uses notations that are close to those from the paper, but mak
7576

7677
Another specificity of the formalization is that the datatypes are defined to have more generic/polymorphic types than in the paper, after which they are instantiated to the exact types from the paper. Namely, instead of working with a fixed set of variables of suitable cardinality (which in the finitary case is just the cardinal of natural numbers aleph0), that set is kept as a parameter -- and in Isabelle, taking advantage of polymorphism, this is a type variable 'var of type class that specifies the cardinality constraint. (Our `binder_datatype` command automatically assigns 'var to have the suitable type class.) This allows more flexibility in case we want to nest the given datatype inside another datatype that perhaps requires larger collections of variables. But once the exact datatypes needed for a case study have been decided, one can instantiate 'var with a fixed type, var, of suitable cardinality. And this is what we do in all our example datatypes: First define the polymorphic version, then instantiate it to the monomorphic version (which matches the one described in the paper). We consistently use the suffix `P` for the polymorphic version. For example, we introduce `ltermP` as the type of lambda-terms polymorphic in the type of variables, then we take `lterm` to be the instance `var ltermP` for some fixed countable type of variables `var`. (The paper's implementation section 9 and the appendix implementation section G have some ad hoc choices of names, e.g., `type` versus `typ` and `term` versus `trm`, which we have decided to amend to the notation scheme explained above -- and will of course update the paper accordingly.)
7778

78-
Another place where the formalization uses different notations is that of pi-calculusm (Sect. 7.1). Namely we prefer ASCII notations with self-explanatory names, such as `Sum`, `Inp`, `Out` etc. The same is true for the dirrent versions of beta-reduction, where we use the notations `step`, `pstep` (for the parallel version) etc. instead of arrow notation. Finally, we sometimes inrtoduce small variations to help parsing, e.g., double comma rather than comma for context-append in System F subtyping (Sect. 7.2).
79+
Another place where the formalization uses different notations is that of pi-calculusm (Sect. 7.1). Namely we prefer ASCII notations with self-explanatory names, such as `Sum`, `Inp`, `Out` etc. The same is true for the dirrent versions of beta-reduction, where we use the notations `step`, `pstep` (for the parallel version) etc. instead of arrow notation. Finally, we sometimes introduce small variations to help parsing, e.g., double comma rather than comma for context-append in System F subtyping (Sect. 7.2).
7980

8081

8182
### Formalization of the abstract results
@@ -125,7 +126,7 @@ Most of our examples and case studies consist of three distinct types of theorie
125126
* theory thys/Infinitary_FOL/InfFmla.thy dedicated to the datatype of infinitary FOL formulas described in Sect. 8.1 and App. D.4; here we work parametrically on two infinite regular cardinals `k1` and `k2`, which we axiomatize;
126127
* theory thys/Infinitary_Lambda_Calculus/ILC.thy dedicated to the datatype of infinitary lambda-terms described in Sect. 8.3 and App. D.2.
127128

128-
An exception to the rule of using `binding_datatype` is the (non-recursive) datatype of commitments for the pi-calculus (described in Sect. 7.1), for which we use some Isabelle/ML tactics to the same effect in thys/Pi_Calculus/Commitments.thy (the reason being that our parser does not yet cover the degenerate case of non-recursive binders).
129+
An exception to the rule of using `binding_datatype` is the (non-recursive) datatype of commitments for the pi-calculus (described in Sect. 7.1), for which we use some Isabelle/ML tactics to the same effect in thys/Pi_Calculus/Commitments.thy (the reason being that our parser currently does not yet cover the degenerate case of non-recursive binders).
129130

130131
(2) Those introducing the relevant binding-aware inductive predicates, usually via our `binder_inductive` command described in Sect. 9 and App. G.2) -- the exceptions being the instances of the binder-explicit Thm. 22, where we instantiate the locale manually. In particular, we have:
131132
* In thys/Untyped_Lambda_Calculus, the theories LC_Beta.thy and LC_Parallel_Beta.thy, containing the inductive definitions of lambda-calculus beta-reduction and parallel beta-reduction respectively, referred to in Sects. 2 and 5. In particular, Prop. 2 from the paper (in the enhanced version described in Remark 8) is generated and proved via the `binder_inductive` command from LC_Beta.thy; it is called `step.strong_induct`. The corresponding theorem for parallel-beta is called `pstep.strong_induct`, which is generated and proved from the `binder-inductive` command from LC_Parallel_Beta.thy. A variant of parallel-beta decorated with the counting of the number applicative redexes (which is needed in the Mazza case study) is also defined in LG_Beta-depth.thy (and its strong rule induction follows the same course).

html/.browser_info/index.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{"kind": "chapter",
2+
"items":
3+
[{"name": "Binders", "description": ""},
4+
{"name": "Infinitary_FOL", "description": ""},
5+
{"name": "Infinitary_Lambda_Calculus", "description": ""},
6+
{"name": "Isabelle_Prelim", "description": ""},
7+
{"name": "Prelim", "description": ""},
8+
{"name": "Process_Calculus", "description": ""},
9+
{"name": "System_Fsub", "description": ""},
10+
{"name": "Untyped_Lambda_Calculus", "description": ""}]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
785da145-7f99-4401-8912-50097c36170b

html/Binders/Customization.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml">
4+
5+
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><link rel="stylesheet" type="text/css" href="isabelle.css"/>
6+
<title>Theory Customization</title>
7+
</head>
8+
9+
10+
<body>
11+
<div class="head">
12+
<h1>Theory Customization</h1>
13+
</div>
14+
15+
<pre class="source"><span class="keyword1"><span class="command"><span>theory</span></span></span><span> </span><a href="Customization.html"><span>Customization</span></a><span>
16+
</span><span class="keyword2"><span class="keyword"><span>imports</span></span></span><span> </span><span class="quoted"><span>"</span><a href="MRBNF_Recursor.html"><span>MRBNF_Recursor</span></a><span>"</span></span><span>
17+
</span><span class="keyword2"><span class="keyword"><span>begin</span></span></span><span>
18+
19+
</span><span class="keyword1"><span class="command"><span>lemma</span></span></span><span> </span><span class="entity_def" id="Customization.id_upd_same|fact"><span class="entity_def" id="Customization.id_upd_same|thm"><span>id_upd_same</span></span></span><span class="main"><span>[</span></span><span class="operator"><span>simp</span></span><span class="main"><span>]</span></span><span class="main"><span>:</span></span><span> </span><span class="quoted"><span class="quoted"><span>"</span><a class="entity_ref" href="../../HOL/HOL/Fun.html#Fun.id|const"><span>id</span></a><span class="main"><span>(</span></span><span class="free"><span>y</span></span><span> </span><span class="main"><span>:=</span></span><span> </span><span class="free"><span>y</span></span><span class="main"><span>)</span></span><span> </span><span class="main"><a class="entity_ref" href="../../HOL/HOL/HOL.html#HOL.eq|const"><span>=</span></a></span><span> </span><a class="entity_ref" href="../../HOL/HOL/Fun.html#Fun.id|const"><span>id</span></a><span>"</span></span></span><span>
20+
</span><span class="keyword1"><span class="command"><span>by</span></span></span><span> </span><a class="entity_ref" href="../../HOL/HOL/ISABELLE_HOME/src/Provers/clasimp.ML.html#HOL.auto|method"><span class="operator"><span>auto</span></span></a><span>
21+
22+
</span><span class="keyword1"><span class="command"><span>lemmas</span></span></span><span> </span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.supp_inv_bound|fact"><span>supp_inv_bound</span></a><span class="main"><span>[</span></span><span class="operator"><span>simp</span></span><span class="main"><span>]</span></span><span>
23+
</span><span class="keyword1"><span class="command"><span>lemmas</span></span></span><span> </span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.bij_swap|fact"><span>bij_swap</span></a><span class="main"><span>[</span></span><span class="operator"><span>simp</span></span><span class="main"><span>]</span></span><span>
24+
</span><span class="keyword1"><span class="command"><span>lemmas</span></span></span><span> </span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.supp_id_bound|fact"><span>supp_id_bound</span></a><span class="main"><span>[</span></span><span class="operator"><span>simp</span></span><span class="main"><span>]</span></span><span>
25+
26+
</span><span class="keyword1"><span class="command"><span>lemma</span></span></span><span> </span><span class="entity_def" id="Customization.fvars_subset_id_on|fact"><span class="entity_def" id="Customization.fvars_subset_id_on|thm"><span>fvars_subset_id_on</span></span></span><span class="main"><span>:</span></span><span> </span><span class="quoted"><span class="quoted"><span>"</span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.supp|const"><span>supp</span></a><span> </span><span class="free"><span>f</span></span><span> </span><span class="main"><a class="entity_ref" href="../../HOL/HOL/Set.html#Set.subset_eq|const"><span></span></a></span><span> </span><span class="free"><span>A</span></span><span> </span><span class="main"><span></span></span><span> </span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.id_on|const"><span>id_on</span></a><span> </span><span class="main"><span>(</span></span><span class="free"><span>B</span></span><span> </span><span class="main"><a class="entity_ref" href="../../HOL/HOL/Groups.html#Groups.minus_class.minus|const"><span>-</span></a></span><span> </span><span class="free"><span>A</span></span><span class="main"><span>)</span></span><span> </span><span class="free"><span>f</span></span><span>"</span></span></span><span>
27+
</span><span class="keyword1"><span class="command"><span>unfolding</span></span></span><span> </span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.supp_def|fact"><span>supp_def</span></a><span> </span><a class="entity_ref" href="../Prelim/Prelim.html#Prelim.id_on_def|fact"><span>id_on_def</span></a><span> </span><span class="keyword1"><span class="command"><span>by</span></span></span><span> </span><a class="entity_ref" href="../../HOL/HOL/ISABELLE_HOME/src/Provers/blast.ML.html#HOL.blast|method"><span class="operator"><span>blast</span></span></a><span>
28+
</span><span class="comment1"><span>(* lemma finite_singleton: "finite {x}" by blast *)</span></span><span>
29+
30+
31+
32+
33+
</span><span class="keyword2"><span class="keyword"><span>end</span></span></span></pre>
34+
</body>
35+
36+
</html>

0 commit comments

Comments
 (0)