Skip to content

Commit 257e0ab

Browse files
committed
update README.md focusing on opam and conda
1 parent bde2977 commit 257e0ab

File tree

1 file changed

+47
-36
lines changed

1 file changed

+47
-36
lines changed

README.md

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ section below.
1111
- [OCaml 4.07.1](https://ocaml.org)
1212
- [SerAPI 0.7.1](https://github.com/ejgallego/coq-serapi)
1313
- [Coq 8.10.2](https://coq.inria.fr/download)
14-
- [Python 3.7.7+](https://www.python.org)
14+
- [Python 3.7](https://www.python.org)
1515
- [PyTorch 1.1.0](https://pytorch.org/get-started/previous-versions/#v110)
1616

17-
## Installation and usage
17+
## Installation
1818

1919
### Installation of OCaml, Coq, and SerAPI
2020

2121
We strongly recommend installing the required versions of OCaml, Coq,
2222
and SerAPI via the [OPAM package manager](https://opam.ocaml.org),
23-
version 2.0.6 or later.
23+
version 2.0.7 or later.
2424

2525
To set up the OPAM-based OCaml environment, use:
2626
```
27-
opam switch create 4.07.1
28-
opam switch 4.07.1
27+
opam switch create roosterize 4.07.1
28+
opam switch roosterize
2929
eval $(opam env)
3030
```
3131
Then, install Coq and SerAPI, pinning them to avoid unintended upgrades:
@@ -35,51 +35,60 @@ opam pin add coq 8.10.2
3535
opam pin add coq-serapi 8.10.0+0.7.1
3636
```
3737

38-
### Installation of Python and PyTorch
38+
### Installation of PyTorch and Python libraries
3939

40-
We recommend installing the required versions of Python and PyTorch
40+
We strongly recommend installing the required versions of Python and PyTorch
4141
using [Conda](https://docs.conda.io/en/latest/miniconda.html).
4242

43-
Then, install PyTorch by following the instructions
44-
[here](https://pytorch.org/get-started/previous-versions/#v110), using
45-
the installation command suitable for your operating system, Python
46-
package manager, and whether you want to use it on a CPU or GPU.
47-
48-
Next, either download a Roosterize [release][releases-link]
49-
or clone the Roosterize repository and enter the directory:
43+
First, create a Python 3.7 environment using Conda:
5044
```
51-
git clone https://github.com/EngineeringSoftware/roosterize.git
52-
cd roosterize
45+
conda create --name roosterize python=3.7 pip
46+
conda activate roosterize
5347
```
5448

55-
To install other required Python libraries (`pip` is included with
56-
Python installation):
49+
Then, install PyTorch 1.1.0 by following the
50+
[official instructions](https://pytorch.org/get-started/previous-versions/#conda-5),
51+
using the command suitable for your operating system and whether you want to use
52+
it on a CPU or GPU. For example, the following command installs PyTorch for
53+
CPU-only use on Linux or Windows:
54+
```
55+
conda install pytorch-cpu==1.1.0 torchvision-cpu==0.3.0 cpuonly -c pytorch
56+
```
57+
Finally, install the required Python libraries:
5758
```
58-
pip install -r requirements.txt
59+
conda install configargparse nltk future seutil==0.4.12 six torchtext==0.4.0 tqdm==4.30.*
5960
```
6061

61-
[releases-link]: https://github.com/EngineeringSoftware/roosterize/releases
62+
### Installation of Roosterize and trained models
6263

63-
### Download pre-trained models
64+
To install Roosterize itself, clone the GitHub repository and enter the root directory:
65+
```
66+
git clone https://github.com/EngineeringSoftware/roosterize.git
67+
cd roosterize
68+
```
6469

65-
We have trained several models using our [corpus][math-comp-corpus], which
66-
follows the lemma naming conventions used in the [Mathematical Components][math-comp-website]
67-
family of projects. The pre-trained models are available for separate [download][models-link].
70+
Next, you need to obtain pre-trained models that capture
71+
naming conventions. We have trained several models using our
72+
[corpus][math-comp-corpus], which follows the conventions
73+
used in the [Mathematical Components][math-comp-website]
74+
family of projects. These models are available for separate
75+
[download][models-link].
6876

69-
Put the archive with the models (`models.tgz`) in the Roosterize root
70-
directory, and then uncompress it:
77+
To use our pre-trained models, go to the Roosterize
78+
root directory, and download and unpack the archive (`models.tgz`):
7179
```
80+
wget https://github.com/EngineeringSoftware/roosterize/releases/download/v8.10.0/models.tgz
7281
tar xzf models.tgz
7382
```
7483

7584
[models-link]: https://github.com/EngineeringSoftware/roosterize/releases/download/v8.10.0/models.tgz
7685

77-
### Usage
86+
## Usage
7887

79-
To use Roosterize on a Coq verification project, you need to first
80-
build and install the project with the command provided by the project
81-
(usually `make` followed by `make install`). Then, at the root directory of
82-
the project repository, run the command
88+
To use Roosterize on a Coq verification project, you first need to
89+
build the Coq project using a command provided by the project
90+
(usually `make`). Then, at the root directory of
91+
the Roosterize project repository, run the command
8392
```
8493
python -m roosterize.main suggest_lemmas \
8594
--project=$PATH_TO_PROJECT \
@@ -88,13 +97,13 @@ python -m roosterize.main suggest_lemmas \
8897
--output=./output
8998
```
9099
where `$PATH_TO_PROJECT` should be replaced with the path to the
91-
project, and `$SERAPI_OPTIONS` should be replaced with the SerAPI
92-
command line options for mapping logical paths to directories (see [SerAPI's
93-
documentation](https://github.com/ejgallego/coq-serapi/blob/v8.11/FAQ.md#does-serapi-support-coqs-command-line-flags)).
94-
For example, if the logical path (inside Coq) for the project is `Verified`,
100+
Coq project, and `$SERAPI_OPTIONS` should be replaced with the SerAPI
101+
command line options for mapping logical paths to directories
102+
(see [SerAPI's documentation][serapi-faq-link]). For example,
103+
if the logical path (inside Coq) for the project is `Verified`,
95104
you should set `SERAPI_OPTIONS="-R $PATH_TO_PROJECT,Verified"`.
96105

97-
The command extracts all lemmas from the project, uses Roosterize's
106+
The above command extracts all lemmas from the project, uses Roosterize's
98107
pre-trained model (at `./models/roosterize-ta`) to predict a lemma name
99108
for each lemma, and finally prints the lemma name update suggestions,
100109
i.e., the predicted lemma names that are different from to the existing ones.
@@ -113,6 +122,8 @@ check the help:
113122
python -m roosterize.main help
114123
```
115124

125+
[serapi-faq-link]: https://github.com/ejgallego/coq-serapi/blob/v8.10/FAQ.md#does-serapi-support-coqs-command-line-flags
126+
116127
## Technique
117128

118129
Roosterize learns and suggests lemma names using neural networks

0 commit comments

Comments
 (0)