{"id":20859372,"url":"https://github.com/engineeringsoftware/roosterize","last_synced_at":"2026-02-21T20:30:46.075Z","repository":{"id":56158284,"uuid":"256885691","full_name":"EngineeringSoftware/roosterize","owner":"EngineeringSoftware","description":"Tool for suggesting lemma names in Coq verification projects","archived":false,"fork":false,"pushed_at":"2022-09-06T18:37:43.000Z","size":276,"stargazers_count":21,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-13T13:10:36.386Z","etag":null,"topics":["coq","deep-learning","machine-learning","mathcomp","name-generation","neural-networks","pytorch","serapi"],"latest_commit_sha":null,"homepage":"","language":"Python","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/EngineeringSoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-19T01:04:11.000Z","updated_at":"2025-07-29T12:36:38.000Z","dependencies_parsed_at":"2022-08-15T13:50:26.933Z","dependency_job_id":null,"html_url":"https://github.com/EngineeringSoftware/roosterize","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/EngineeringSoftware/roosterize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Froosterize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Froosterize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Froosterize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Froosterize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngineeringSoftware","download_url":"https://codeload.github.com/EngineeringSoftware/roosterize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineeringSoftware%2Froosterize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29692520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"last_error":"SSL_read: 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","deep-learning","machine-learning","mathcomp","name-generation","neural-networks","pytorch","serapi"],"created_at":"2024-11-18T04:49:38.850Z","updated_at":"2026-02-21T20:30:46.058Z","avatar_url":"https://github.com/EngineeringSoftware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Roosterize\n\nRoosterize is a tool for suggesting lemma names in verification\nprojects that use the [Coq proof assistant](https://coq.inria.fr).\nThe tool leverages neural networks that take serialized Coq\nlemma statements and elaborated terms as input; see the [Technique](#Technique)\nsection below.\n\n## Requirements\n\n- Linux or macOS\n- [OCaml 4.07.1](https://ocaml.org)\n- [SerAPI 0.7.1](https://github.com/ejgallego/coq-serapi)\n- [Coq 8.10.2](https://coq.inria.fr/download)\n- [Python 3.7](https://www.python.org)\n- [PyTorch 1.1.0](https://pytorch.org/get-started/previous-versions/#v110)\n\n## Installation\n\nYou can install Roosterize from source code by cloning this GitHub\nrepository and setting up the dependencies following steps 1 \u0026 2.\n(Alternatively, you can download the a [binary\ndistribution](https://github.com/EngineeringSoftware/roosterize/releases)\nwhich already contains the Python dependencies, and then you only need\nstep 1.)\n\n```\ngit clone https://github.com/EngineeringSoftware/roosterize.git\ncd roosterize\n```\n\n### 1. Installation of OCaml, Coq, and SerAPI\n\nWe strongly recommend installing the required versions of OCaml, Coq,\nand SerAPI via the [OPAM package manager](https://opam.ocaml.org),\nversion 2.0.7 or later.\n\nTo set up the OPAM-based OCaml environment, use:\n```\nopam switch create roosterize 4.07.1\nopam switch roosterize\neval $(opam env)\n```\nThen, install Coq and SerAPI, pinning them to avoid unintended upgrades:\n```\nopam update\nopam pin add coq 8.10.2\nopam pin add coq-serapi 8.10.0+0.7.1\n```\n\n### 2. Installation of PyTorch and Python libraries\n\nWe strongly recommend installing the required versions of Python and\nPyTorch using [Conda](https://docs.conda.io/en/latest/miniconda.html).\n\nTo set up the Conda environment, use one of the following command\nsuitable for your operating system and whether you want to use it on a\nCPU or GPU.\n\n- Linux, CPU:\n```\nconda env create --name roosterize --file conda-envs/cpu.yml\n```\n\n- Linux, GPU w/ CUDA 10.0:\n```\nconda env create --name roosterize --file conda-envs/gpu-cuda10.yml\n```\n\n- Linux, GPU w/ CUDA 9.0:\n```\nconda env create --name roosterize --file conda-envs/gpu-cuda9.yml\n```\n\n- Mac, CPU:\n```\nconda env create --name roosterize --file conda-envs/mac-cpu.yml\n```\n\nFinally, activate the Conda environment before using Roosterize:\n```\nconda activate roosterize\n```\n\n### Installation of trained models\n\nNext, you need to obtain a pre-trained model that capture naming\nconventions.  The default pre-trained model, which was trained using\nour [corpus][math-comp-corpus] and follows the conventions used in the\n[Mathematical Components][math-comp-website] family of projects, can\nbe obtained by running the command:\n\n```\n./bin/roosterize download_global_model\n```\n\nThe model will be downloaded to `$HOME/.roosterize/`. To use a\ndifferent model (that we [released][latest-release] or you trained),\nsimply put it in `$HOME/.roosterize/`.\n\n## Usage\n\nTo use Roosterize on a Coq verification project, you first need to\nbuild the Coq project using a command provided by the project (usually\n`make`).  Then, run this command to get the lemma name suggestions for\nthe lemmas in a Coq document (.v file):\n\n```\npython -m roosterize.main suggest_naming --file=PATH_TO_FILE\n```\n\nRoosterize automatically infers the root directory of the project by\nfinding `_CoqProject`, and reads `_CoqProject` to infer the SerAPI\ncommand line options (for mapping logical paths to directories, see\n[SerAPI's documentation][serapi-faq-link]).  If you don't have a\n`_CoqProject` file, you need to provide an additional argument\n`--project_root=PATH_TO_PROJECT_ROOT`.\n\n\u003c!-- where `$PATH_TO_PROJECT` should be replaced with the path to the --\u003e\n\u003c!-- Coq project, and `$SERAPI_OPTIONS` should be replaced with the SerAPI --\u003e\n\u003c!-- command line options for mapping logical paths to directories --\u003e\n\u003c!-- (see [SerAPI's documentation][serapi-faq-link]). For example, --\u003e\n\u003c!-- if the logical path (inside Coq) for the project is `Verified`, --\u003e\n\u003c!-- you should set `SERAPI_OPTIONS=\"-R $PATH_TO_PROJECT,Verified\"`. --\u003e\n\nThe above command extracts all lemmas from the file, uses the\npre-trained model to generate likely lemma names for each lemma, and\nfinally prints the lemma name update suggestions, i.e., the generated\nlemma names that are different from to the existing ones.  See an\n[example suggestion report](./docs/example-suggestion.txt).\n\nFor other usages and command line interfaces of Roosterize, please\ncheck the help:\n```\npython -m roosterize.main help\n```\n\n[latest-release]: https://github.com/EngineeringSoftware/roosterize/releases/latest\n[serapi-faq-link]: https://github.com/ejgallego/coq-serapi/blob/v8.10/FAQ.md#does-serapi-support-coqs-command-line-flags\n\n## Technique\n\nRoosterize learns and suggests lemma names using neural networks\nthat take serialized Coq lemma statements and elaborated terms as input.\nFor example, the Coq lemma sentence\n```coq\nLemma mg_eq_proof L1 L2 (N1 : mgClassifier L1) : L1 =i L2 -\u003e nerode L2 N1.\n```\nis serialized into the following tokens (simplified):\n```lisp\n(Sentence((IDENT Lemma)(IDENT mg_eq_proof)(IDENT L1)(IDENT L2)\n  (KEYWORD\"(\")(IDENT N1)(KEYWORD :)(IDENT mgClassifier)\n  (IDENT L1)(KEYWORD\")\")(KEYWORD :)(IDENT L1)(KEYWORD =i)(IDENT L2)\n  (KEYWORD -\u003e)(IDENT nerode)(IDENT L2)(IDENT N1)(KEYWORD .)))\n```\nand the corresponding elaborated term (simplified):\n```lisp\n(Prod (Name (Id char)) ... (Prod (Name (Id L1)) ...\n (Prod (Name (Id L2)) ... (Prod (Name (Id N1)) ...\n  (Prod Anonymous (App (Ref (DirPath ((Id ssrbool) (Id ssr) (Id Coq))) (Id eq_mem)) ...\n   (Var (Id L1)) ... (Var (Id L2)))\n  (App (Ref (DirPath ((Id myhill_nerode) (Id RegLang))) (Id nerode)) ...\n   (Var (Id L2)) ... (Var (Id N1))))))))\n```\n\nThe diagram below illustrates Roosterize's neural network\narchitecture, as applied to this example:\n\n\u003cimg src=\"seqtoseq-arch.svg\" width=\"700\" title=\"Roosterize architecture\"\u003e\n\nOur [research paper][arxiv-paper] outlines the design of Roosterize,\nand describes an evaluation on a [corpus][math-comp-corpus]\nof serialized Coq code derived from the [Mathematical Components][math-comp-website]\nfamily of projects. The training, validation, and testing sets of Coq files from the corpus\nused in the evaluation are defined in the `training` directory.\n\nIf you have used Roosterize in a research project, please cite\nthe research paper in any related publication:\n```bibtex\n@inproceedings{NieETAL20Roosterize,\n  author = {Nie, Pengyu and Palmskog, Karl and Li, Junyi Jessy and Gligoric, Milos},\n  title = {Deep Generation of {Coq} Lemma Names Using Elaborated Terms},\n  booktitle = {International Joint Conference on Automated Reasoning},\n  pages = {97--118},\n  doi = {10.1007/978-3-030-51054-1_6},\n  year = {2020},\n}\n```\n\n[arxiv-paper]: https://arxiv.org/abs/2004.07761\n[math-comp-corpus]: https://github.com/EngineeringSoftware/math-comp-corpus\n[math-comp-website]: https://math-comp.github.io\n\n## Authors\n\n- [Pengyu Nie](https://pengyunie.github.io)\n- [Karl Palmskog](https://setoid.com)\n- [Emilio Jesús Gallego Arias](https://www.irif.fr/~gallego/)\n- [Junyi Jessy Li](https://jessyli.com)\n- [Milos Gligoric](https://users.ece.utexas.edu/~gligoric/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineeringsoftware%2Froosterize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineeringsoftware%2Froosterize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineeringsoftware%2Froosterize/lists"}