{"id":22686445,"url":"https://github.com/dwarfmaster/commutative-diagrams","last_synced_at":"2025-05-07T23:07:34.866Z","repository":{"id":45813715,"uuid":"494483299","full_name":"dwarfmaster/commutative-diagrams","owner":"dwarfmaster","description":"A coq plugin to deal with commutative diagrams","archived":false,"fork":false,"pushed_at":"2024-06-29T11:08:08.000Z","size":1231,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T23:07:29.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwarfmaster.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-05-20T13:51:54.000Z","updated_at":"2024-12-18T01:44:47.000Z","dependencies_parsed_at":"2024-06-29T09:27:14.201Z","dependency_job_id":"4ce8f7cb-a20e-4d9e-9310-0102a726d227","html_url":"https://github.com/dwarfmaster/commutative-diagrams","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Fcommutative-diagrams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Fcommutative-diagrams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Fcommutative-diagrams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarfmaster%2Fcommutative-diagrams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwarfmaster","download_url":"https://codeload.github.com/dwarfmaster/commutative-diagrams/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833251,"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","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":[],"created_at":"2024-12-09T23:01:31.028Z","updated_at":"2025-05-07T23:07:34.842Z","avatar_url":"https://github.com/dwarfmaster.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Commutative Diagrams Interface\n\nThis is a coq plugin that allows a user to do the diagrammatic reasonnings parts\nof categoretical proofs in a graphical manner. It can analyze the proof context\nto deduct the categorical diagram being working on, to display it and enable a\ngraphical way to progress the proof.\n\n## Architecture\n\nThis tool is split in two parts. The most important one, the interface itself,\nis a standalone program that handles displaying the graph and acting on it. It\ninteracts with the proof assistant with an homemade protocol over its\nstdin/stdout. Then there is a Coq plugin, that analyze the Coq goal and exposes\nfeatures and information from Coq to the interface through the protocol.\n\nThe Coq plugin is also responsible for starting the interface, and thus it must\nbe able to find it. If there is a `COMDIAG_ENGINE` environment variable, it\nassumes it contains a path to the interface. Otherwise it looks for a\n`commutative-diagrams-engine` in `$PATH`.\n\n## Installation\n\n### For usage within UniMath\n\n\u003e [!NOTE]\n\u003e Since this plugin is made of maby moving parts in different languages and\n\u003e ecosystem, only the nix installation method is supported for now.\n\nUsing [Nix](https://nixos.org/) is the easiest way to quickly try the plugin if\nyou have nix installed and [flakes enabled](https://nixos.wiki/wiki/Flakes). Simply run the following command:\n```sh\nnix develop \"github:dwarfmaster/commutative-diagrams#unimath-user\"\n```\n\nThis will drop you in a shell with the right coq version installed, and\n`OCAMLPATH`, `COQPATH` and `COMDIAG_ENGINE` setup the right way.\n\nThe, you need to copy the\n[Loader.v](https://github.com/dwarfmaster/commutative-diagrams/blob/main/coq/theories/Loader.v)\nto `UniMath/CategoryTheory/CommutativeDiagrams.v` and add\n`CommutativeDiagrams.v` to the `UniMath/CategoryTheory/.package/files`. You can\nnow build UniMath using `make`.\n\nOnce this is finished, you can open any file in your UniMath clone, import the\nplugin with:\n```coq\nRequire Import UniMath.CategoryTheory.CommutativeDiagrams.\n```\nAnd use the tactics as described in the [usage section](#usage).\n\n### For usage outside of unimath\n\n\u003e [!WARNING]\n\u003e For some reason this is broken for now.\n\nOnce the installation has succeeded, you can use the following to make the\ntactic available in the Coq file you're developping:\n```coq\nFrom CommutativeDiagrams Require Import Loader.\n```\n\n\n#### With Nix\n\n\u003e [!WARNING]\n\u003e Right now the nix option is only available on linux due to the way I wrote the\n\u003e nix file.\n\n\u003e [!NOTE]\n\u003e Nix is packaged in many distributions. If it is not for your distribution,\n\u003e see [here](https://nixos.org/download) for installation instruction.\n\nUsing [Nix](https://nixos.org/) is the easiest way to quickly try the plugin if\nyou have nix installed and [flakes enabled](https://nixos.wiki/wiki/Flakes). Simply run the following command:\n```sh\nnix develop \"github:dwarfmaster/commutative-diagrams#user\"\n```\n\nThis will drop you in a shell with the right coq version installed, and\n`OCAMLPATH`, `COQPATH` and `COMDIAG_ENGINE` setup the right way. You can then\nstart `coqide` from this shell and use it to edit any file you're interested in.\n\nIf you want to use other interfaces like proof-general, you can use the\n[direnv](https://direnv.net/) integrationg of Emacs/VScode to have them load the\nflake automatically.\n\n#### With Cargo and Opam\n\n\u003e [!NOTE]\n\u003e If you're not using nix to install this plugin, the installation is a lot\n\u003e more complicated. You need to make sure you have a recent enough rust\n\u003e version, a recent enough dune version, and the right system packages\n\u003e installed.\n\n##### The interface\n\nThe interface is written in rust and packaged using\n[cargo](https://doc.rust-lang.org/cargo/). You can install it using:\n\n```sh\ncargo install --git https://github.com/dwarfmaster/commutative-diagrams.git\n```\n\nThe directory it will be installed in depends of your setup. On Linux, by\ndefault, it is installed in `$HOME/.cargo/bin`. Wherever it actually ends up,\nthe `cargo install` command should warn you of which directory to add to the\npath to be able to run the command.\n\n##### The plugin\n\nThe plugin is written in OCaml and can be installed using\n[opam](https://opam.ocaml.org).\n\n\u003e [!WARNING]\n\u003e Due to a [bug](https://github.com/coq/coq/pull/17697) in Coq under linux,\n\u003e installing unimath with opam will fail until coq 8.18 is out (and I have\n\u003e ported the plugin to it). Until then please use [nix](#nix) to install coq and\n\u003e unimath. As such I haven't been able to fully test to following procedure.\n\nFirst you need to add the coq plugin repository to opam:\n```sh\nopam repo add coq-released https://coq.inria.fr/opam/released\n```\n\nThen you need to install the necessary dependencies. You also need to make sure\nthe current opam switch is using an ocaml version that is at least `4.14.1`.\n```sh\nopam install dune coq.8.17.1 coq-unimath.20230321\n```\n\nFinally build and install the plugin:\n```sh\nopam pin add coq-commutative-diagrams https://github.com/dwarfmaster/commutative-diagrams.git\n```\n\nFinally, import opam environment in the current shell. Unless you use a mecanism\nto automate it, you need to do this for every shell you open.\n```sh\neval $(opam env)\n```\n\n## Usage\n\nThe two main tactics are `diagram run` and `diagram edit`.\n\nThe `diagram run \"file\"` tactic tries to read commands from file and execute\nthem on the current goal. If it succeeds, the interface is never opened. If it\nfails, or if the the file is empty, the interface is opened to graphically solve\nthe goal. If there where commands in the file, they are not executed but can be\nreplayed using the `Edit\u003eRedo` button.\n\nThe `diagram edit \"file\"` always open the interface, allowing to redo part of\nthe proof and change other, even if it would have succeeded.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwarfmaster%2Fcommutative-diagrams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwarfmaster%2Fcommutative-diagrams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwarfmaster%2Fcommutative-diagrams/lists"}