{"id":14966251,"url":"https://github.com/marigold-dev/easier-proofs","last_synced_at":"2026-03-01T19:32:22.492Z","repository":{"id":45116013,"uuid":"425758688","full_name":"marigold-dev/easier-proofs","owner":"marigold-dev","description":"A project which aim to help engineers to make proves easily","archived":false,"fork":false,"pushed_at":"2022-03-03T12:35:29.000Z","size":271,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-07T07:36:59.373Z","etag":null,"topics":["coq","ocaml","proof-assistant","safety"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marigold-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-08T08:39:45.000Z","updated_at":"2024-11-04T23:38:07.000Z","dependencies_parsed_at":"2022-09-12T02:11:51.921Z","dependency_job_id":null,"html_url":"https://github.com/marigold-dev/easier-proofs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marigold-dev/easier-proofs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marigold-dev%2Feasier-proofs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marigold-dev%2Feasier-proofs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marigold-dev%2Feasier-proofs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marigold-dev%2Feasier-proofs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marigold-dev","download_url":"https://codeload.github.com/marigold-dev/easier-proofs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marigold-dev%2Feasier-proofs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29981413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","ocaml","proof-assistant","safety"],"created_at":"2024-09-24T13:36:04.888Z","updated_at":"2026-03-01T19:32:22.469Z","avatar_url":"https://github.com/marigold-dev.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easier-proofs\nThis project aims to help making proofs easier by providing a DSL which can express assertions and proof. This tool is using the `Coq` Proof Assistance.\n\n## Use easier-proof as a library in your project.\n\nYou have to clone easier-proof and install it locally with `opam install .` at the root of the project.\nAfter that you can add \"easier_proof\" in your dune \"librairies\" stanza.\n\n\n## How to use it\n\nThe [`crush`](https://github.com/jwiegley/coq-haskell/blob/master/src/Crush.v) custom tactic of [Adam Chlipala](http://adam.chlipala.net/) from certified programming with dependent types is widely use in this project.\n\nLet us consider this simple example with the commutative property of addition on natural numbers.\n\nFirst of all, we have this OCaml code in a \"proof\" directory, into your entire project.\n\n```ocaml\ntype nat =\n  | Zero\n  | S of nat\n\nlet pred (n : nat) : nat = match n with\n  | Zero -\u003e Zero\n  | S p -\u003e p\n\nlet rec add (n : nat) (m : nat) : nat = match n with\n  | Zero -\u003e m\n  | S p -\u003e S (add p m)\n```\n\nWe generate the Coq code for this Ocaml code by using the tool [**coq-of-ocaml**](https://github.com/foobar-land/coq-of-ocaml).\n\n```coq\nInductive nat : Set :=\n| Zero : nat\n| S : nat -\u003e nat.\n\nDefinition pred (n : nat) : nat :=\n  match n with\n  | Zero =\u003e Zero\n  | S p =\u003e p\n  end.\n\nFixpoint add (n : nat) (m : nat) : nat :=\n  match n with\n  | Zero =\u003e m\n  | S p =\u003e S (add p m)\n  end.\n```\n\nIn order to prove the commutative property of the addition, we have to prove these two lemmas first:\n  - n + 0 = n\n  - S (x + y) = x + (S y)\n\nWe are using the [DSL](https://en.wikipedia.org/wiki/Domain-specific_language) (Domain-specific language) to express properties that we want to prove.\n\nThis OCaml code \n\n```ocaml\nopen Easier_proof.DslProp\n\n\nlet t = to_proofs [\n  block \"commutative property of Nat addition\" [\n    prop \"add_right_zero\" ~context:(forall [(\"n\",\"nat\")]) ((atom \"add n Zero\" =.= atom \"n\") \u003e\u003e induction \"n\");\n\n    prop \"add_s\" ~context:(forall [(\"x\",\"nat\");(\"y\",\"nat\")]) ((atom \"S (add x y)\" =.= atom \"add x (S y)\") \u003e\u003e induction \"x\");\n\n    prop \"add_commut\"\n      ~context:(forall [(\"x\",\"nat\");(\"y\",\"nat\")])\n      ((atom \"add x y\" =.= atom \"add y x\") \u003e\u003e induction \"x\")\n      ~hints:[\"add_right_zero\";\"add_s\"]\n  ]\n]\n\nlet _ = run t\n```\nexpress the two needed lemmas above and the commutative, and run the translation.\n\nThe code below is the Coq proof automatically generated from the OCaml DSL code above.\n\n```coq\nFrom Test Require Import CpdtTactics.\n(* ----PROOFS---- *)\n(* Proofs for commutativity of nat addition *)\n\nFact add_right_zero : forall  (n:nat) , add n Zero = n.\n                                        \ninduction n;crush.\nQed.\n\nFact add_s : forall  (x:nat) (y:nat) , S (add x y) = add x (S y).\n           \ninduction x;crush.\nQed.\n\nFact add_commut : forall  (x:nat) (y:nat) , add x y = add y x.\n           \n#[local] Hint Rewrite add_right_zero.\n#[local] Hint Rewrite add_s.\ninduction x;crush.\nQed.\n (**END OF PROOFS**)\n\n```\n\n## Documentation\n\nWe need to install odoc (\u003e 2.0.0), to build the document do `make; make doc`.\n\nThis is a document for private library and it can be found at `_build/default/_doc/_html/\u003clibrary\u003e`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarigold-dev%2Feasier-proofs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarigold-dev%2Feasier-proofs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarigold-dev%2Feasier-proofs/lists"}