You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,12 @@
1
1
# Changelog
2
2
3
+
## 2.2.3
4
+
5
+
- Fix critical issue with proof checking. Before, when the choices parameter was high, sometimes the wrong proof could be generated and not identified as incorrect.
6
+
- Updated CI with a build for MacOS.
7
+
- Deploy the README to gh-pages from CI using jekyll.
8
+
- Fix and extend README, benchmarking report.
9
+
3
10
## 2.2.2
4
11
5
12
- Fix and refactor CI. Publishing a new release is now a manual process.
Copy file name to clipboardExpand all lines: README.md
+62-23Lines changed: 62 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
# coqpilot
1
+
# CoqPilot
2
2
3
3
*Authors:* Andrei Kozyrev, Gleb Solovev, Nikita Khramov, and Anton Podkopaev, [Programming Languages and Tools Lab](https://lp.jetbrains.com/research/plt_lab/) at JetBrains Research.
4
4
5
-
`Coqpilot` is a [Visual Studio Code](https://code.visualstudio.com/) extension that is designed to help automate writing of Coq proofs. It uses Large Language Models to generate multiple potential proofs and then uses [coq-lsp](https://github.com/ejgallego/coq-lsp) to typecheck them. It substitutes the proof in the editor only if a valid proof is found.
5
+
`CoqPilot` is a [Visual Studio Code](https://code.visualstudio.com/) extension that is designed to help automate writing of Coq proofs. It uses Large Language Models to generate multiple potential proofs and then uses [coq-lsp](https://github.com/ejgallego/coq-lsp) to typecheck them. It substitutes the proof in the editor only if a valid proof is found.
- 🧩 [Integrating other solutions](#integrating-other-solutions)
24
+
- 🧠 [Tactician](#tactician)
25
+
- 🔨 [CoqHammer](#coqhammer)
23
26
- 🔜 [Future Plans](#future-plans)
24
27
- 📜 [Release Notes](#release-notes)
25
28
@@ -29,9 +32,9 @@
29
32
30
33
## Brief technical overview
31
34
32
-
`Coqpilot` fetches proofs from multiple completion services. Now we support:
35
+
`CoqPilot` fetches proofs from multiple completion services. Now we support:
33
36
- a service that always returns a list of pre-defined in the settings tactics/coq sentances.
34
-
- an [open-ai](https://openai.com) gpt service.
37
+
- an [OpenAI](https://openai.com) gpt service.
35
38
- a service that fetches completions from the model, running locally in LM Studio.
36
39
- a service that uses Grazie platform (only for JetBrains employees for now).
37
40
@@ -43,19 +46,19 @@ For each `admit.` present in the file, an independent completion process is issu
43
46
44
47
As soon as at least one valid proof is found, it is substituted in the editor and the process is finished.
45
48
46
-
**Notice:** By default, coqpilot sets only `predefinedProofs` and `open-ai` services. The first one tries `auto.` tactic and the second one has one model -- `gpt-3.5`. By default the `apiKey` for open-ai is not set, i.e. set to `None`. Do not forget to change that in the settings before using this service.
49
+
**Notice:** By default, CoqPilot sets only `PredefinedProofs` and `OpenAI` services. The first one tries `auto.` tactic and the second one has one model -- `gpt-3.5`. By default the `apiKey` for OpenAI is not set, i.e. set to `None`. Do not forget to change that in the settings before using this service.
47
50
48
-
**Notice:** File `settings.json` declares not all the settings, but those that are overriden from the defaults. Keep that in mind, if you want, for example, to turn off the `open-ai` service. For that, you would need to override the corresponding setting with an empty array, but not delete this property from the file.
51
+
**Notice:** File `settings.json` declares not all the settings, but those that are overriden from the defaults. Keep that in mind, if you want, for example, to turn off the `OpenAI` service. For that, you would need to override the corresponding setting with an empty array, but not delete this property from the file.
49
52
50
53
## Example usage
51
54
52
-
`Coqpilot` only runs on an opened `coq` file. User can:
53
-
- Run `coqpilot` with some chosen selection to try substitute all admits in this selection.
55
+
`CoqPilot` only runs on an opened `coq` file. User can:
56
+
- Run `CoqPilot` with some chosen selection to try substitute all admits in this selection.
54
57
55
58
<imgsrc="./etc/gif/solve-in-selection.gif"/>
56
59
57
-
- Run `coqpilot` to try substitute all admits in the file.
58
-
- Run `coqpilot` to substitute the proof for the admit if there is one under the cursor.
60
+
- Run `CoqPilot` to try substitute all admits in the file.
61
+
- Run `CoqPilot` to substitute the proof for the admit if there is one under the cursor.
59
62
60
63
## Installation
61
64
@@ -72,13 +75,13 @@ With coq-lsp, extension should have everything it needs to run.
72
75
73
76
### Building locally
74
77
75
-
First, clone the Coqpilot repository and navigate into its directory.
78
+
First, clone the CoqPilot repository and navigate into its directory.
To build the extension locally, you'll need Node.js installed. The recommended way to manage Node.js versions is by using `nvm`. From the Coqpilot root directory, execute:
84
+
To build the extension locally, you'll need Node.js installed. The recommended way to manage Node.js versions is by using `nvm`. From the CoqPilot root directory, execute:
82
85
```bash
83
86
nvm use
84
87
```
@@ -105,15 +108,15 @@ The extension's architecture overview is stored in the [ARCHITECTURE.md](https:/
105
108
106
109
## Important
107
110
108
-
Coqpilot generates aux files with `_cp_aux.v` suffix. Sometimes when generation fails with exception, it is possible that such file will not be deleted. When a project is open, extension shall show a window that asks if you want to add such files to the local project gitignore.
111
+
CoqPilot generates aux files with `_cp_aux.v` suffix. Sometimes when generation fails with exception, it is possible that such file will not be deleted. When a project is open, extension shall show a window that asks if you want to add such files to the local project gitignore.
109
112
110
113
Moreover, this repository contains a script for your convenience that adds the format of such files to the global gitignore file on your system.
111
114
- Copy the [`set_gitignore.sh`](https://github.com/K-dizzled/coqpilot/blob/main/set_gitignore.sh) file to your computer. Then:
112
115
```bash
113
116
chmod +x set_gitignore.sh
114
117
./set_gitignore.sh
115
118
```
116
-
It will add the format of coqpilot aux files to your global gitignore file on the system, so that even if coqpilot forgets to clean files up, they will not be marked as new files in git.
119
+
It will add the format of CoqPilot aux files to your global gitignore file on the system, so that even if CoqPilot forgets to clean files up, they will not be marked as new files in git.
117
120
Comment: Such files are not visible in the vscode explorer, because plugin adds them to the `files.exclude` setting on startup.
118
121
119
122
## Extension Settings
@@ -125,11 +128,11 @@ This extension contributes the following settings:
125
128
126
129
*`coqpilot.predefinedProofsModelsParameters`, `coqpilot.openAiModelsParameters`, `coqpilot.grazieModelsParameters` and `coqpilot.lmStudioModelsParameters`:
127
130
128
-
Each of these settings are modified in `settings.json` and contain an array of models from this service. Each model will be used for generation independantly. Multiple models for a single service could be defined. For example, you can define parameters for two open-ai gpt models. One would be using `gpt-3.5` and the other one `gpt-4`. CoqPilot will first try to generate proofs using the first model, and if it doesn't succeed, it will try the second one. This way coqpilot iterates over all services (currently 4 of them) and for each service it iterates over all models.
131
+
Each of these settings are modified in `settings.json` and contain an array of models from this service. Each model will be used for generation independantly. Multiple models for a single service could be defined. For example, you can define parameters for two OpenAI gpt models. One would be using `gpt-3.5` and the other one `gpt-4`. CoqPilot will first try to generate proofs using the first model, and if it doesn't succeed, it will try the second one. This way CoqPilot iterates over all services (currently 4 of them) and for each service it iterates over all models.
129
132
130
133
## Guide to Model Configuration
131
134
132
-
### How VsCode settings work
135
+
### How VSCode settings work
133
136
134
137
A common way to change the settings, contributed by the extension, is to open the `settings.json` file, or click `Edit in settings.json` on some field in settings UI. Say, by default extension contributes field (setting) `A` with default state `a'`. When you click edit, this field is being copied to the `settings.json` file with the value `a'`:
135
138
```json
@@ -143,11 +146,11 @@ From that moment and until you completely remove this field from the `settings.j
143
146
144
147
As mentioned in the previous section, at the moment, four services are supported.
145
148
146
-
By default, only `predefinedProofs` and `open-ai` services are enabled. The first one tries `auto.` tactic and the second one has one model -- `gpt-3.5`. Models for other services are defaulted with empty arrays. That denotes that we do not create any models from these services.
149
+
By default, only `PredefinedProofs` and `OpenAI` services are enabled. The first one tries `auto.` tactic and the second one has one model -- `gpt-3.5`. Models for other services are defaulted with empty arrays. That denotes that we do not create any models from these services.
147
150
148
151
Each and every service is configured with an array of independent models. This was made to easily experiment with different models and their parameters.
149
152
150
-
The simplest service to configure is `predefinedProofs`:
153
+
The simplest service to configure is `PredefinedProofs`:
151
154
```json
152
155
{
153
156
"coqpilot.predefinedProofsModelsParameters": [
@@ -164,7 +167,7 @@ The simplest service to configure is `predefinedProofs`:
164
167
```
165
168
The `modelId` property may be any string you like, but it should be unique for each model. This way, CoqPilot will be able to correctly tell you which model might have configuration issues.
166
169
167
-
The most commonly used service is `open-ai` (`grazie` and `lmStudio` are configured very similarly).
170
+
The most commonly used service is `OpenAI` (`Grazie` and `LmStudio` are configured very similarly).
168
171
```json
169
172
{
170
173
"coqpilot.openAiModelsParameters": [
@@ -186,7 +189,7 @@ The most commonly used service is `open-ai` (`grazie` and `lmStudio` are configu
186
189
],
187
190
}
188
191
```
189
-
Don't forget to set up the `apiKey` field, by default it is set to `None`. Moreover, make sure that your open-ai key is valid and has enough credits to run the models. If you create a free version of the key, it will not work (it has some weird limitations like 5 requests per inf). You can check you key here: https://platform.openai.com/playground/chat. If the playground works, the key is probably valid.
192
+
Don't forget to set up the `apiKey` field, by default it is set to `None`. Moreover, make sure that your OpenAI key is valid and has enough credits to run the models. If you create a free version of the key, it will not work (it has some weird limitations like 5 requests per inf). You can check you key here: https://platform.openai.com/playground/chat. If the playground works, the key is probably valid.
190
193
191
194
Multi-round profile setting configures the number of attempts to fix the proof if it is incorrect. If the proof is incorrect, the compiler message is sent to the LLM with a request to repair it. The number of round attempts for one proof is set by `maxRoundsNumber`. The number of choices for the proof fixing is set by `proofFixChoices`. By default, values are set to 1 and that means that **NO** attempts to fix the proof are made. That means that proof is only being generated once. That's equivalent to say that multi-round fixing is turned off. 0 is not a valid value for `maxRoundsNumber` nor for `proofFixChoices`.
192
195
@@ -236,6 +239,42 @@ First things first, the process of running the benchmark is not perfectly automa
236
239
npm run benchmark
237
240
```
238
241
242
+
## Integrating other solutions
243
+
244
+
As CoqPilot supports adding predefined commands to try as completion both in the plugin and the benchmark, you can integrate `Coq` generation methods, that contribute a specific tactic and are triggered from OCaml.
245
+
246
+
### Tactician
247
+
248
+
[Tactician](https://coq-tactician.github.io) is a tactic learner and prover for the Coq Proof Assistant. To install:
[CoqHammer](https://coqhammer.github.io) is an automated reasoning tool for Coq. To install:
267
+
```bash
268
+
opam install coq-hammer
269
+
```
270
+
271
+
Import the tactics:
272
+
```coq
273
+
From Hammer Require Import Hammer.
274
+
```
275
+
276
+
Then add the `hammer.`, `sauto.` or any other tactic from `CoqHammer` to the predefined tactics in the settings.
277
+
239
278
## Future plans
240
279
241
280
- Currently the user needs to manually enter the nix shell to get the correct environment for the benchmarks. We are working on automating this process.
@@ -244,4 +283,4 @@ First things first, the process of running the benchmark is not perfectly automa
244
283
245
284
## Release Notes
246
285
247
-
Release notes could be found in the [CHANGELOG.md](https://github.com/JetBrains-Research/coqpilot/blob/refactor/CHANGELOG.md) file.
286
+
Release notes could be found in the [CHANGELOG.md](https://github.com/JetBrains-Research/coqpilot/blob/main/CHANGELOG.md) file.
0 commit comments