Skip to content

Commit

Permalink
Merge branch 'main' into ext/prop-eq
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailrun committed Oct 1, 2024
2 parents 522b9c6 + 53fff5a commit 604391b
Show file tree
Hide file tree
Showing 75 changed files with 228 additions and 231 deletions.
9 changes: 6 additions & 3 deletions scripts/generate_dep.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import re, sys, textwrap
import itertools, re, sys, textwrap
from pathlib import Path
from typing import Iterable

Expand Down Expand Up @@ -48,8 +48,9 @@ def module_name_of_path(path: str) -> str:

def node_of_path(path: str) -> str:
parts = module_parts_of_path(path)
color = next((COLORS[parts[i]] for i in range(len(parts)-1,-1,-1) if parts[i] in COLORS),COLORS["others"])
subgraph_names = ["/".join(parts[:partindex]) for partindex in range(1,len(parts))]
dedupe_parts = list(dict.fromkeys(parts))
color = next((COLORS[part] for part in reversed(dedupe_parts) if part in COLORS),COLORS["others"])
subgraph_names = list(itertools.accumulate(parts[:-1], func="{0}/{1}".format))
module_name = module_name_of_module_parts(parts)
node_label = parts[-1]

Expand All @@ -59,6 +60,8 @@ def node_of_path(path: str) -> str:
result = under_subgraph(f"Core/{node_label}", f""""{module_name}"[label="{node_label}",tooltip="{module_name}",color={color},fillcolor=white];""")
elif module_name == "Mcltt.LibTactics":
result = f"""{{ graph[cluster=false,rank=min]; "{module_name}"[label="{node_label}",tooltip="{module_name}",fillcolor={color}]; }}"""
elif module_name == "Mcltt.Core.Semantic.Consequences":
result = f"""{{ cluster=false; rank=max; "{module_name}"[label="{node_label}",tooltip="{module_name}",fillcolor={color}]; }}"""
else:
result = f""""{module_name}"[label="{node_label}",tooltip="{module_name}",fillcolor={color}];"""

Expand Down
1 change: 1 addition & 0 deletions theories/Algorithmic/Subtyping.v
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
From Mcltt.Algorithmic.Subtyping Require Export Definitions Lemmas.
6 changes: 3 additions & 3 deletions theories/Algorithmic/Subtyping/Definitions.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From Mcltt Require Import Base.
From Mcltt.Core Require Import System.Definitions NbE.
From Mcltt Require Export Syntax.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Export NbE.
From Mcltt.Core.Syntactic Require Export SystemOpt.
Import Syntax_Notations.

Reserved Notation "Γ ⊢a A ⊆ A'" (in custom judg at level 80, Γ custom exp, A custom exp, A' custom exp).
Expand Down
10 changes: 5 additions & 5 deletions theories/Algorithmic/Subtyping/Lemmas.v
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import Evaluation Readback NbE CoreTypeInversions Presup CtxSub SystemOpt.
From Mcltt.Core.Completeness Require Import Consequences.Rules.
From Mcltt Require Import Completeness Soundness.
From Mcltt.Algorithmic Require Import Subtyping.Definitions.
From Mcltt Require Import LibTactics.
From Mcltt.Algorithmic.Subtyping Require Import Definitions.
From Mcltt.Core Require Import Base Soundness.
From Mcltt.Core.Syntactic Require Import SystemOpt.
From Mcltt.Core.Completeness.Consequences Require Import Rules.
Import Syntax_Notations.

#[local]
Expand Down
1 change: 1 addition & 0 deletions theories/Algorithmic/Typing.v
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
From Mcltt.Algorithmic.Typing Require Export Definitions Lemmas.
8 changes: 2 additions & 6 deletions theories/Algorithmic/Typing/Definitions.v
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Algorithmic Require Export Subtyping.Definitions.
From Mcltt.Core Require Import Soundness Completeness.
From Mcltt.Core.Semantic Require Import NbE.
From Mcltt.Core.Syntactic Require Import System.Definitions.
From Mcltt.Core.Syntactic Require Export Syntax.
From Mcltt.Algorithmic.Subtyping Require Export Definitions.
From Mcltt.Core Require Import Base.
Import Domain_Notations.

Reserved Notation "Γ '⊢a' M ⟹ A" (in custom judg at level 80, Γ custom exp, M custom exp, A custom nf).
Expand Down
9 changes: 4 additions & 5 deletions theories/Algorithmic/Typing/Lemmas.v
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Algorithmic Require Import Typing.Definitions.
From Mcltt.Algorithmic Require Export Subtyping.Lemmas.
From Mcltt.Core Require Import Soundness Completeness.
From Mcltt Require Import LibTactics.
From Mcltt.Algorithmic.Typing Require Import Definitions.
From Mcltt.Algorithmic.Subtyping Require Export Lemmas.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import Consequences.Rules.
From Mcltt.Core.Semantic Require Import Consequences.
From Mcltt.Core.Syntactic Require Export SystemOpt.
From Mcltt.Frontend Require Import Elaborator.
Import Domain_Notations.

Expand Down
5 changes: 3 additions & 2 deletions theories/Core/Completeness.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Core.Completeness Require Import FundamentalTheorem.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Export FundamentalTheorem.
From Mcltt.Core.Semantic Require Import Realizability.
From Mcltt.Core.Semantic Require Export NbE.
From Mcltt.Core.Syntactic Require Export SystemOpt.
Expand Down
35 changes: 0 additions & 35 deletions theories/Core/Completeness/Consequences/Inversions.v

This file was deleted.

7 changes: 4 additions & 3 deletions theories/Core/Completeness/Consequences/Rules.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From Coq Require Import RelationClasses.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import Completeness Completeness.FundamentalTheorem Completeness.LogicalRelation Semantic.Realizability PER.
From Mcltt.Core Require Export SystemOpt.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core Require Export Completeness.
From Mcltt.Core.Semantic Require Import Realizability.
Import Domain_Notations.

Lemma ctxeq_nbe_eq : forall Γ Γ' M A,
Expand Down
7 changes: 4 additions & 3 deletions theories/Core/Completeness/Consequences/Types.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From Coq Require Import RelationClasses.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import Completeness Completeness.FundamentalTheorem Completeness.LogicalRelation Semantic.Realizability.
From Mcltt.Core Require Export SystemOpt.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core Require Export Completeness.
From Mcltt.Core.Semantic Require Import Realizability.
Import Domain_Notations.

Lemma exp_eq_typ_implies_eq_level : forall {Γ i j k},
Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/ContextCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation UniverseCases.
Import Domain_Notations.

Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/FunctionCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations Relation_Definitions.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation TermStructureCases UniverseCases.
Import Domain_Notations.

Expand Down
2 changes: 1 addition & 1 deletion theories/Core/Completeness/LogicalRelation.v
Original file line number Diff line number Diff line change
@@ -1 +1 @@
From Mcltt.Core.Completeness Require Export LogicalRelation.Definitions LogicalRelation.Lemmas LogicalRelation.Tactics.
From Mcltt.Core.Completeness.LogicalRelation Require Export Definitions Lemmas Tactics.
4 changes: 2 additions & 2 deletions theories/Core/Completeness/LogicalRelation/Definitions.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From Coq Require Import Relations.
From Mcltt Require Import Base.
From Mcltt.Core Require Export PER.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Export PER.
Import Domain_Notations.

Inductive rel_exp M ρ M' ρ' (R : relation domain) : Prop :=
Expand Down
6 changes: 4 additions & 2 deletions theories/Core/Completeness/LogicalRelation/Lemmas.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
From Coq Require Import Morphisms Morphisms_Relations RelationClasses Relation_Definitions.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core.Completeness Require Import LogicalRelation.Definitions LogicalRelation.Tactics.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness.LogicalRelation Require Import Definitions Tactics.
Import Domain_Notations.

Add Parametric Morphism M ρ M' ρ' : (rel_exp M ρ M' ρ')
Expand Down
5 changes: 3 additions & 2 deletions theories/Core/Completeness/LogicalRelation/Tactics.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import PER.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Import PER.
Import Domain_Notations.

Ltac eexists_rel_exp :=
Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/NatCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation SubstitutionCases TermStructureCases UniverseCases.
From Mcltt.Core.Semantic Require Import Realizability.
Import Domain_Notations.
Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/SubstitutionCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations RelationClasses.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import ContextCases LogicalRelation UniverseCases.
Import Domain_Notations.

Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/SubtypingCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations RelationClasses.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation FunctionCases.
Import Domain_Notations.

Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/TermStructureCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations RelationClasses.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation UniverseCases.
Import Domain_Notations.

Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/UniverseCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations RelationClasses.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation.
Import Domain_Notations.

Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Completeness/VariableCases.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Coq Require Import Morphisms_Relations.

From Mcltt Require Import Base LibTactics.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Completeness Require Import LogicalRelation.
From Mcltt.Core.Syntactic Require Import SystemOpt.
Import Domain_Notations.
Expand Down
9 changes: 4 additions & 5 deletions theories/Core/Semantic/Consequences.v
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import Completeness Soundness.
From Mcltt.Core.Completeness Require Import Consequences.Types LogicalRelation.
From Mcltt.Core.Semantic Require Import NbE.
From Mcltt.Core.Syntactic Require Export SystemOpt.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core Require Export Soundness.
From Mcltt.Core.Completeness.Consequences Require Export Types.
Import Domain_Notations.

Lemma adjust_exp_eq_level : forall {Γ A A' i j},
Expand Down
3 changes: 2 additions & 1 deletion theories/Core/Semantic/Domain.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
From Mcltt Require Export Syntax.
From Equations Require Import Equations.

From Mcltt.Core.Syntactic Require Export Syntax.

Reserved Notation "'env'".

Inductive domain : Set :=
Expand Down
2 changes: 1 addition & 1 deletion theories/Core/Semantic/Evaluation.v
Original file line number Diff line number Diff line change
@@ -1 +1 @@
From Mcltt Require Export Evaluation.Definitions Evaluation.Lemmas Evaluation.Tactics.
From Mcltt.Core.Semantic.Evaluation Require Export Definitions Lemmas Tactics.
4 changes: 2 additions & 2 deletions theories/Core/Semantic/Evaluation/Definitions.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From Mcltt Require Import Base.
From Mcltt Require Export Domain.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Export Domain.
Import Domain_Notations.

Reserved Notation "'⟦' M '⟧' ρ '↘' r" (in custom judg at level 80, M custom exp at level 99, ρ custom domain at level 99, r custom domain at level 99).
Expand Down
5 changes: 4 additions & 1 deletion theories/Core/Semantic/Evaluation/Lemmas.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
From Coq Require Import Lia PeanoNat Relations.
From Mcltt Require Import Base LibTactics Evaluation.Definitions.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic.Evaluation Require Import Definitions.
Import Domain_Notations.

Section functional_eval.
Expand Down
4 changes: 3 additions & 1 deletion theories/Core/Semantic/Evaluation/Tactics.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
From Mcltt Require Import Base LibTactics Evaluation.Definitions Evaluation.Lemmas.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic.Evaluation Require Import Definitions Lemmas.
Import Domain_Notations.

Ltac simplify_evals :=
Expand Down
5 changes: 3 additions & 2 deletions theories/Core/Semantic/NbE.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Export Domain Evaluation Readback.
From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Export Domain Evaluation Readback.
Import Domain_Notations.

Generalizable All Variables.
Expand Down
2 changes: 1 addition & 1 deletion theories/Core/Semantic/PER.v
Original file line number Diff line number Diff line change
@@ -1 +1 @@
From Mcltt Require Export PER.Definitions PER.Lemmas PER.CoreTactics.
From Mcltt.Core.Semantic.PER Require Export CoreTactics Definitions Lemmas.
6 changes: 4 additions & 2 deletions theories/Core/Semantic/PER/CoreTactics.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
From Coq Require Import Lia PeanoNat Relation_Definitions RelationClasses.
From Equations Require Import Equations.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import PER.Definitions.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Import PER.Definitions.
Import Domain_Notations.

Ltac destruct_rel_by_assumption in_rel H :=
Expand Down
6 changes: 4 additions & 2 deletions theories/Core/Semantic/PER/Definitions.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
From Coq Require Import Lia PeanoNat Relation_Definitions RelationClasses.
From Equations Require Import Equations.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Export Domain Evaluation Readback.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Export Domain Evaluation Readback.
Import Domain_Notations.

Notation "'Dom' a ≈ b ∈ R" := ((R a b : Prop) : Prop) (in custom judg at level 90, a custom domain, b custom domain, R constr).
Expand Down
6 changes: 4 additions & 2 deletions theories/Core/Semantic/PER/Lemmas.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
From Coq Require Import Equivalence Lia Morphisms Morphisms_Prop Morphisms_Relations PeanoNat Relation_Definitions RelationClasses.
From Equations Require Import Equations.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import PER.Definitions PER.CoreTactics.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Import PER.CoreTactics PER.Definitions.
Import Domain_Notations.

Add Parametric Morphism R0 `(R0_morphism : Proper _ ((@relation_equivalence domain) ==> (@relation_equivalence domain)) R0) A ρ A' ρ' : (rel_mod_eval R0 A ρ A' ρ')
Expand Down
2 changes: 1 addition & 1 deletion theories/Core/Semantic/Readback.v
Original file line number Diff line number Diff line change
@@ -1 +1 @@
From Mcltt Require Export Readback.Definitions Readback.Lemmas.
From Mcltt.Core.Semantic.Readback Require Export Definitions Lemmas.
5 changes: 3 additions & 2 deletions theories/Core/Semantic/Readback/Definitions.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
From Mcltt.Core Require Import Base Evaluation.
From Mcltt Require Export Domain.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Import Evaluation.
From Mcltt.Core.Semantic Require Export Domain.
Import Domain_Notations.

Reserved Notation "'Rnf' m 'in' s ↘ M" (in custom judg at level 80, m custom domain, s constr, M custom nf).
Expand Down
7 changes: 5 additions & 2 deletions theories/Core/Semantic/Readback/Lemmas.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
From Coq Require Import Lia PeanoNat Relations.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Import Evaluation Readback.Definitions.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Import Evaluation.
From Mcltt.Core.Semantic.Readback Require Import Definitions.
Import Domain_Notations.

Section functional_read.
Expand Down
6 changes: 4 additions & 2 deletions theories/Core/Semantic/Realizability.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
From Coq Require Import Lia Morphisms_Relations PeanoNat Relation_Definitions.
From Equations Require Import Equations.
From Mcltt Require Import Base LibTactics.
From Mcltt.Core Require Export NbE PER.

From Mcltt Require Import LibTactics.
From Mcltt.Core Require Import Base.
From Mcltt.Core.Semantic Require Export NbE PER.
Import Domain_Notations.

Lemma per_nat_then_per_top : forall {n m},
Expand Down
Loading

0 comments on commit 604391b

Please sign in to comment.