Skip to content

Commit

Permalink
cherry-picking the dependency graph building recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
MevenBertrand committed Jan 4, 2024
1 parent 423e19f commit 28e1b98
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
# to avoid a warning at cleanup time
if: ${{ always() }}
run: sudo chown -R 1001:116 . # <--
- name: Install graphviz
uses: ts-graphviz/setup-graphviz@v1

- name: Build dependency graph
run: make depgraph

- name: Build doc overview
uses: docker://pandoc/core:2.9
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ Makefile.coq.conf
*.cache

_opam

*.dot
13 changes: 11 additions & 2 deletions Makefile.coq.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Taken from https://github.com/coq-community/reglang
#Inspired from https://github.com/coq-community/reglang

GLOBFILES = $(VFILES:.v=.glob)
COQDOCJS_DIR ?= coqdocjs
Expand All @@ -22,4 +22,13 @@ coqdoc: $(GLOBFILES) $(VFILES) $(HEADER) $(FOOTER) $(RESOURCES) $(FRONTPAGE)
.PHONY: coqdoc

clean::
$(HIDE)rm -rf $(COQDOCDIR)
$(HIDE)rm -rf $(COQDOCDIR)/*.html

$(DOCDIR)/dependency_graph.dot: $(VFILES)
coqdep -Q theories LogRel -R coq-partialfun/theories PartialFun $(VFILES) | perl generate_deps.pl | tred > $(DOCDIR)/dependency_graph.dot

$(DOCDIR)/dependency_graph.png: $(DOCDIR)/dependency_graph.dot
dot -T png $(DOCDIR)/dependency_graph.dot -o $(DOCDIR)/dependency_graph.png

depgraph: $(DOCDIR)/dependency_graph.png
.PHONY: depgraph
Binary file added docs/dependency_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Browsing the sources
============================

The table of content of the development is accessible [here](./coqdoc/toc.html).
The full table of content of the development is accessible [here](https://coqhott.github.io/logrel-coq/coqdoc/toc.html).

File description
==========
Expand Down
28 changes: 28 additions & 0 deletions generate_deps.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
print "digraph logrel_deps {\n";
print " node [shape = ellipse,style=filled];\n";
print " subgraph cluster_autosubst { label=\"AutoSubst\" \n}";
print " subgraph cluster_logrel { label=\"LogicalRelation\" \n}";
print " subgraph cluster_subst { label=\"Validity\" \n}";
print " subgraph cluster_dec { label=\"Decidability\" \n}";
while (<>) {
if (m/.*?theories\/([^\s]*)\.vo.*:(.*)/) {
$dests = $2 ;
($path,$src) = ($1 =~ s/\//\./rg =~ m/(.*\.)?([^.]*)$/);
if ($path =~ m/AutoSubst\./) {
print "subgraph cluster_autosubst { \"$path$src\"[label=\"$src\",fillcolor=firebrick]}"
}elsif ($path =~ m/LogicalRelation\./) {
print "subgraph cluster_logrel { \"$path$src\"[label=\"$src\",fillcolor=forestgreen]}"
}elsif ($path =~ m/Substitution\./) {
print "subgraph cluster_subst { \"$path$src\"[label=\"$src\",fillcolor=goldenrod1]}"
}elsif ($path =~ m/Decidability\./) {
print "subgraph cluster_dec { \"$path$src\"[label=\"$src\",fillcolor=deeppink3]}"
}else {
print "\"$path$src\"[label=\"$src\",fillcolor=dodgerblue1]"
}
for my $dest (split(" ", $dests)) {
$dest =~ s/\//\./g ;
print " \"$1\" -> \"$path$src\";\n" if ($dest =~ m/theories\.(.*)\.vo/);
}
}
}
print "}\n";
2 changes: 1 addition & 1 deletion theories/AlgorithmicTyping.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(** * LogRel.AlgorithmicTyping: definition of algorithmic conversion and typing. *)
From Coq Require Import ssrbool.
From LogRel.AutoSubst Require Import core unscoped Ast Extra.
From LogRel Require Import Utils BasicAst Notations Context NormalForms Weakening UntypedReduction GenericTyping DeclarativeTyping.
From LogRel Require Import Utils BasicAst Notations Context NormalForms Weakening UntypedReduction GenericTyping.

Section Definitions.

Expand Down
2 changes: 1 addition & 1 deletion theories/Decidability/Functions.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
From Coq Require Import Nat Lia List.
From Equations Require Import Equations.
From LogRel.AutoSubst Require Import core unscoped Ast Extra.
From LogRel Require Import Utils BasicAst Context DeclarativeTyping.
From LogRel Require Import Utils BasicAst Context.
From PartialFun Require Import Monad PartialFun.

Import MonadNotations.
Expand Down
6 changes: 3 additions & 3 deletions theories/Decidability/Soundness.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
From Coq Require Import Nat List Lia Arith ssrbool.
From Equations Require Import Equations.
From LogRel.AutoSubst Require Import core unscoped Ast Extra.
From LogRel Require Import Utils BasicAst Context Notations UntypedReduction GenericTyping NormalForms.
From LogRel Require Import AlgorithmicTyping.
From LogRel Require Import Utils BasicAst Context Notations UntypedReduction DeclarativeTyping DeclarativeInstance GenericTyping NormalForms.
From LogRel Require Import Validity LogicalRelation Fundamental DeclarativeSubst TypeConstructorsInj AlgorithmicTyping BundledAlgorithmicTyping Normalisation TypeUniqueness.
From LogRel.Decidability Require Import Functions.
From PartialFun Require Import Monad PartialFun.

Import DeclarativeTypingProperties.
Import AlgorithmicTypingData.
Import IndexedDefinitions.

Set Universe Polymorphism.
Expand Down Expand Up @@ -293,8 +295,6 @@ Ltac funelim_typing :=

Section TypingCorrect.

Import AlgorithmicTypingData.

#[local]Existing Instance ty_errors.

Lemma ty_view1_small_can T n : build_ty_view1 T = ty_view1_small n -> ~ isCanonical T.
Expand Down

0 comments on commit 28e1b98

Please sign in to comment.