{"id":26659813,"url":"https://github.com/rocq-community/coq-dpdgraph","last_synced_at":"2025-10-05T18:07:58.153Z","repository":{"id":14491272,"uuid":"17204088","full_name":"rocq-community/coq-dpdgraph","owner":"rocq-community","description":"Build dependency graphs between Coq objects [maintainers=@Karmaki,@ybertot]","archived":false,"fork":false,"pushed_at":"2025-09-01T13:56:31.000Z","size":386,"stargazers_count":90,"open_issues_count":22,"forks_count":30,"subscribers_count":7,"default_branch":"coq-master","last_synced_at":"2025-09-01T15:32:07.149Z","etag":null,"topics":["coq","coq-ci","coq-platform","dependency-analysis","dependency-graph","docker-coq-action"],"latest_commit_sha":null,"homepage":"","language":"Rocq Prover","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocq-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-02-26T08:30:23.000Z","updated_at":"2025-09-01T13:56:35.000Z","dependencies_parsed_at":"2023-02-16T20:45:51.464Z","dependency_job_id":"7d9989c9-bbad-45ba-aecb-501b9f5bbfe4","html_url":"https://github.com/rocq-community/coq-dpdgraph","commit_stats":{"total_commits":197,"total_committers":27,"mean_commits":7.296296296296297,"dds":0.6294416243654822,"last_synced_commit":"2a7a8f7a7c16817b55257f77bd1207ea4758aaa5"},"previous_names":["karmaki/coq-dpdgraph","rocq-community/coq-dpdgraph","coq-community/coq-dpdgraph"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/rocq-community/coq-dpdgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fcoq-dpdgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fcoq-dpdgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fcoq-dpdgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fcoq-dpdgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocq-community","download_url":"https://codeload.github.com/rocq-community/coq-dpdgraph/tar.gz/refs/heads/coq-master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fcoq-dpdgraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278494644,"owners_count":25996414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coq","coq-ci","coq-platform","dependency-analysis","dependency-graph","docker-coq-action"],"created_at":"2025-03-25T11:15:29.490Z","updated_at":"2025-10-05T18:07:58.147Z","avatar_url":"https://github.com/rocq-community.png","language":"Rocq Prover","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!---\nThis file was generated from `meta.yml`, please do not edit manually.\nFollow the instructions on https://github.com/coq-community/templates to regenerate.\n---\u003e\n# coq-dpdgraph\n\n[![Docker CI][docker-action-shield]][docker-action-link]\n[![Contributing][contributing-shield]][contributing-link]\n[![Code of Conduct][conduct-shield]][conduct-link]\n[![Zulip][zulip-shield]][zulip-link]\n\n[docker-action-shield]: https://github.com/rocq-community/coq-dpdgraph/actions/workflows/docker-action.yml/badge.svg?branch=coq-master\n[docker-action-link]: https://github.com/rocq-community/coq-dpdgraph/actions/workflows/docker-action.yml\n\n[contributing-shield]: https://img.shields.io/badge/contributions-welcome-%23f7931e.svg\n[contributing-link]: https://github.com/coq-community/manifesto/blob/master/CONTRIBUTING.md\n\n[conduct-shield]: https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-%23f15a24.svg\n[conduct-link]: https://github.com/coq-community/manifesto/blob/master/CODE_OF_CONDUCT.md\n\n[zulip-shield]: https://img.shields.io/badge/chat-on%20zulip-%23c1272d.svg\n[zulip-link]: https://coq.zulipchat.com/#narrow/stream/237663-coq-community-devs.20.26.20users\n\n\n\nRocq plugin that extracts the dependencies between Coq objects,\nand produces files with dependency information. Includes tools\nto visualize dependency graphs and find unused definitions.\n\n## Meta\n\n- Author(s):\n  - Anne Pacalet\n  - Yves Bertot\n  - Olivier Pons\n- Rocq-community maintainer(s):\n  - Yves Bertot ([**@ybertot**](https://github.com/ybertot))\n- License: [GNU Lesser General Public License v2.1](LICENSE)\n- Compatible OCaml versions: 4.09.0 or later\n- Additional dependencies:\n  - [OCamlgraph](https://github.com/backtracking/ocamlgraph)\n- Rocq/Coq namespace: `dpdgraph`\n- Related publication(s): none\n\n## What's inside?\n\nFirst of all, it is a small tool (a Rocq plugin) that extracts the\ndependencies between Rocq objects, and produces a file (we suggest using\nthe suffix .dpd) with this information.\n\nThe idea is that other small tools can be then developed to process\nthe .dpd files. At the moment, there is:\n- `dpd2dot` that reads these .dpd files and produces a graph file\nusing .dot format (cf. http://www.graphviz.org/) that makes possible to view\nthem;\n- `dpdusage`: to find unused definitions.\n\nHope other tools later on to do more things. Feel free to contribute!\n\n## How to get it\n\nYou can:\n- either clone it from GitHub at: https://github.com/rocq-community/coq-dpdgraph\n- or get the opam package named `coq-dpdgraph` from the rocq opam archive (repository \"released\")\n- or get the [latest distributed version](https://github.com/rocq-community/coq-dpdgraph/releases)\n\n### Compilation\n\nTo perform you own compilation, you need that `ocamlgraph` is installed\n(for instance using `opam install ocamlgraph`).\nDownload the archive and unpack it (or clone the repository),\nand change directory to the `coq-dpdgraph` directory.  The `coq-master`\nbranch of the repository is maintained to compile with the development\nversion of `rocq`.  To compile with a released version of `rocq`, you need\nto download the corresponding tagged version from the `git` repository.\nFor instance, the version that is compatible with `rocq` version 9 is\navailable at the tag `v1.0+9.0`.\n\nTo just compile, you should type the following command\n\n    $ make\n\nWhen this compilation succeeds, the plugin is located in the compilation\ndirectory and can be used by relying on\n`-I *the directory* -R *the directory* dpdgraph`\n\nTo compile and install the plugin, type the following command\n\n    $ make \u0026\u0026 make install\n\nWhen this compilation succeeds, the plugin can be used directly, and the\ncompilation directory can be safely removed.\n\n### Install using opam\n\nIf you use opam with recent versions of Rocq or Coq you can install\n`coq-dpdgraph` and `ocamlgraph` using\n\n    $ opam repo add coq-released https://rocq-prover.org/opam/released\n    $ opam install coq-dpdgraph\n\nTo install a specific release of `coq-dpdgraph` for a previous version of\nRocq or Coq, add the appropriate suffix, for example,\n\n    $ opam install coq-dpdgraph.1.0+9.0\n\n### Test\n\nIf you install the archive by cloning the git repository, you have\na sub-directory containing test files.  These can be tested using the\nfollowing command.\n\n    $ make -s test\n\nto check if everything is ok.\n\n## How to use it\n\n### Requirements\n\n- to have compiled the tools (see above)\n- a compiled Coq file.\n  You can for instance use `tests/Test.v` (a modified clone of Rocq `List.v`)\n  and compile it doing :\n```shell\n  $ rocq compile tests/Test.v\n```\n  \n### Generation of .dpd files\n\nThe available commands are :\n- Generate dependencies between a list of objects:\n\n        Print FileDependGraph \u003cmodule name list\u003e.\n\n    A module can be a file, or a sub-module in a file.\n    Example :\n\n        Print FileDependGraph M M2.A.B.\n\n    Take all the objects of the specified modules and build the dependencies\n    between them.\n\n- Generate the dependencies of one objects:\n\n        Print DependGraph my_lemma.\n\n  Analyse recursively the dependencies of ``my_lemma``.\n\n- Change the name of the generated file (default is ``graph.dpd``):\n\n        Set DependGraph File \"f.dpd\".\n\n  Useful when one needs to build several files in one session.\n\n**Advice:**\nyou need to use ``Require`` to load the module that you want to explore,\n    but don't use any ``Import``/``Export``\n   command because the tool is then unable\n    to properly group the nodes by modules.\n\n**Example:**\n```\n$ rlwrap rocq repl -R . dpdgraph -I .\nWelcome to Rocq 9.0.0\n\nRocq \u003c Require dpdgraph.dpdgraph.\n[Loading ML file coq-dpdgraph.plugin ... done]\n\nCoq \u003c From Stdlib Require List.\nCoq \u003c Print FileDependGraph List.\nPrint FileDependGraph List.\nFetching opaque proofs from disk for Stdlib.Lists.List\nInfo: output dependencies in file graph.dpd\nCoq \u003c Set DependGraph File \"graph2.dpd\".\n^D\n```\n\n### dpd2dot: from a .dpd file to a .dot file\n\n#### Graph generation\n\n```\n$ ./dpd2dot graph.dpd\nInfo: read file graph.dpd\nInfo: Graph output in graph.dot\n```\n\nThere are some options :\n```\n$ ./dpd2dot -help\nUsage : ./dpd2dot [options]\n  -o : name of output file (default: name of input file .dot)\n  -with-defs : show everything (default)\n  -without-defs : show only Prop objects\n  -rm-trans : remove transitive dependencies (default)\n  -keep-trans : keep transitive dependencies\n  -debug : set debug mode\n  -help  Display this list of options\n  --help  Display this list of options\n```\nIf the name of the output file finishes with ``.dot``, then the name before\nthe ``.dot`` suffix is used as the graph name in the dot syntax.  There\nare two exceptions: ``graph`` and ``digraph`` will be replaced with\n``escaped_graph`` and ``escaped_digraph`` respectively.\n\nThe only useful option at the moment is ``-without-defs`` that export only\n``Prop`` objects to the graph (``Axiom``, ``Theorem``, ``Lemma``, etc).\n\n#### Graph visualisation\n\nYou need :\n\n- [graphviz](http://www.graphviz.org/) (ie. dot tool)\n- a visualizer:\n  we tested [zgrviewer](http://zvtm.sourceforge.net/zgrviewer.html),\n  [xdot](https://pypi.python.org/pypi/xdot),\n  [kgraphviewer](https://extragear.kde.org/apps/kgraphviewer/),\n  but there are others.\n\nYou can also convert .dot file to .svg file using :\n```\n$ dot -Tsvg file.dot \u003e file.svg\n```\nYou can then use ``firefox`` or ``inskape`` to view the ``.svg`` graph.\n\nThe main advantage of using ``firefox`` is that the nodes are linked to\nthe ``coqdoc`` pages if they have been generated in the same directory.\nBut the navigation (zoom, moves) is very poor and slow.\n\n#### Graph interpretation\n\nThe graph can be interpreted like this :\n- edge n1 --\u003e n2 : n1 uses n2\n- node :\n  - green : proved lemma\n  - orange :  axiom/admitted lemma\n  - dark pink : Definition, etc\n  - light pink : Parameter, etc\n  - violet : inductive,\n  - blue : constructor,\n  - multi-circled : not used (no predecessor in the graph)\n- yellow box : module\n- objects that are not in a yellow box are Coq objects.\n\n### dpdusage: find unused definitions via .dpd file\n\nYou can use ``dpdusage`` command to find unused definitions.\nExample:\n\n```\n$ ./dpdusage tests/graph2.dpd\nInfo: read file tests/graph2.dpd\nPermutation_app_swap\t(0)\n```\n\nIn the example above it reports that ``Permutation_app_swap`` was\nreferenced 0 times.  You can specify max number of references allowed\n(default 0) via ``-threshold`` command line option.\n\n## Development information\n\n### Generated ``.dpd`` format description\n\n```\ngraph : obj_list\nobj : node | edge\n\nnode : \"N: \" node_id node_name node_attributes ';'\nnode_id : [0-9]+\nnode_name : '\"' string '\"'\nnode_attributes :\n   | empty\n   | '[' node_attribute_list ']'\nnode_attribute_list :\n   | empty\n   | node_attribute ',' node_attribute_list\nnode_attribute :\n   | kind=[cnst|inductive|construct]\n   | prop=[yes|no]\n   | path=\"m0.m1.m2\"\n   | body=[yes|no]\n\nedge : \"E: \"  node_id node_id edge_attributes ';'\nedge_attributes :\n   | empty\n   | '[' edge_attribute_list ']'\nedge_attribute_list :\n   | empty\n   | edge_attribute ',' edge_attribute_list\nedge_attribute :\n   | weight=NUM\n```\n\nThe parser accept .dpd files as described above,\n  but also any attribute for nodes and edges having the form :\n  ``prop=val`` or ``prop=\"string...\"`` or ``prop=NUM``\n  so that the generated ``.dpd`` can have new attributes without having to change\n  the other tools.\nEach tool can then pick the attributes that it is able to handle;\n  they are not supposed to raise an error whenever there is\n  an unknown attribute.\n\n## More information\n\nAlso see:\n- [CHANGES](CHANGES.md)\n- [distributed versions](https://anne.pacalet.fr/dev/dpdgraph/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocq-community%2Fcoq-dpdgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocq-community%2Fcoq-dpdgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocq-community%2Fcoq-dpdgraph/lists"}