@@ -182,14 +182,39 @@ In order to load Coq-Elpi use `From elpi Require Import elpi`.
182
182
It understands the ` #[phase] ` attribute, see [ synterp-vs-interp] ( README.md#separation-of-parsing-from-execution-of-vernacular-commands ) .
183
183
- ` Elpi Program <qname> <code> ` lower level primitive letting one crate a
184
184
command/tactic with a custom preamble ` <code> ` .
185
- - ` From some.load.path Extra Dependency <filename> as <fname> ` .
186
- - ` Elpi Accumulate [<dbname>|<qname>] [<code>|File <fname>|Db <dbname>] `
185
+ - ` From some.load.path Extra Dependency <filename> as <fname> ` declares ` <fname> `
186
+ as a piece of code that can be accumulated via ` Elpi Accumulate File ` .
187
+ The content is given in the external file ` <filename> ` to be found in
188
+ the Coq load path ` some.load.path ` .
189
+ - ` Elpi File <fname> <code>. ` declares ` <fname> `
190
+ as a piece of code that can be accumulated via ` Elpi Accumulate File ` .
191
+ This time the code is given in the .v file.
192
+ It understands the ` #[phase] ` attribute, see [ synterp-vs-interp] ( README.md#separation-of-parsing-from-execution-of-vernacular-commands ) .
193
+ - ` Elpi Accumulate [<dbname>|<qname>] [<code>|File [Signature] <fname>|Db [Header] <dbname>] `
187
194
adds code to the current program (or ` <dbname> ` or ` <qname> ` if specified).
188
195
The code can be verbatim, from a file or a Db.
189
- File names ` <fname> ` must have been previously declared with the above command.
196
+ File names ` <fname> ` must have been previously declared with
197
+ ` Extra Dependency ` or ` Elpi File ` .
198
+ Accumulating ` File Signature <fname> ` only adds the signautre declarations
199
+ (kinds, types, modes, type abbreviations) from ` <fname> ` skipping the code
200
+ (clauses/rules).
201
+ Accumulating ` Db Header <dbname> ` , instead of ` Db <dbname> ` , accumulates
202
+ only the first chunk of code associated with Db, typically the type
203
+ declaration of the predicates that live in the Db. When defining a command
204
+ or tactic it can be useful to first accumulate the Db header, then some
205
+ code (possibly calling the predicate living in the Db), and finally
206
+ accumulating the (full) Db.
207
+ Note that when a command is executed it may need to be (partially)
208
+ recompiled, e.g. if the Db was updated. In this case all the code accumulated
209
+ after the Db (but not after its header) may need to be recompiled. Hence
210
+ we recommend to accumulate Dbs last.
190
211
It understands the ` #[skip="rex"] ` and ` #[only="rex"] ` which make the command
191
212
a no op if the Coq version is matched (or not) by the given regular expression.
192
- It understands the ` #[phase] ` attribute, see [ synterp-vs-interp] ( README.md#separation-of-parsing-from-execution-of-vernacular-commands )
213
+ It understands the ` #[phase] ` attribute, see [ synterp-vs-interp] ( README.md#separation-of-parsing-from-execution-of-vernacular-commands ) .
214
+ It understands the ` #[local] ` , ` #[global] ` , and ` #[superglobal] ` scope attributes,
215
+ although only when accumulating to a ` <dbname> ` (all accumulations to a program
216
+ are ` #[superglobal] ` ). Default accumulation to db is the equivalent of ` #[export] ` .
217
+ See the Coq reference manual for the meaning of these scopes.
193
218
- ` Elpi Typecheck [<qname>] ` typechecks the current program (or ` <qname> ` if
194
219
specified).
195
220
It understands the ` #[phase] ` attribute, see [ synterp-vs-interp] ( README.md#separation-of-parsing-from-execution-of-vernacular-commands )
@@ -204,10 +229,9 @@ In order to load Coq-Elpi use `From elpi Require Import elpi`.
204
229
tracing for Elpi's [ trace browser] ( ) .
205
230
- ` Elpi Bound Steps <number> ` limits the number of steps an Elpi program can
206
231
make.
207
- - ` Elpi Print <qname> [<string> <filter>*] ` prints the program ` <qname> ` to an
208
- HTML file named ` <qname>.html ` and a text file called ` <qname>.txt `
209
- (or ` <string> ` if provided) filtering out clauses whose file or clause-name
210
- matches ` <filter> ` .
232
+ - ` Elpi Print <qname> [<string> <filter>*] ` prints the program ` <qname> ` to
233
+ a text file called ` <qname>.txt ` (or ` <string> ` if provided) filtering out
234
+ clauses whose file or clause-name matches ` <filter> ` .
211
235
It understands the ` #[phase] ` attribute, see [ synterp-vs-interp] ( README.md#separation-of-parsing-from-execution-of-vernacular-commands )
212
236
213
237
where:
@@ -220,6 +244,8 @@ where:
220
244
` lp:{{ coq.say "hello!" }} ` becomes ` " coq.say ""hello!"" " ` ).
221
245
- ` <filename> ` is a string containing the path of an external file, e.g.
222
246
` "this_file.elpi" ` .
247
+ - ` <fname> ` is a qualified Coq name, eg ` foo.elpi ` (note that ` Extra Dependency `
248
+ only allows simple identifiers).
223
249
- ` <start> ` and ` <stop> ` are numbers, e.g. ` 17 24 ` .
224
250
- ` <predicate-filter> ` is a regexp against which the predicate name is matched,
225
251
e.g. ` "derive.*" ` .
0 commit comments