Skip to content

Commit 9c9823d

Browse files
authored
Merge pull request #669 from wdeweijer/master
Fix typos and broken links in tutorials
2 parents 507f037 + e510593 commit 9c9823d

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

examples/tutorial_coq_elpi_HOAS.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Tutorial on the HOAS for Coq terms
2020
evars in the Coq jargon).
2121
2222
This software, "coq-elpi", is a Coq plugin embedding Elpi and
23-
exposing to the extension language Coq spefic data types (e.g. terms)
23+
exposing to the extension language Coq specific data types (e.g. terms)
2424
and API (e.g. to declare a new inductive type).
2525
2626
In order to get proper syntax highlighting using VSCode please install the
@@ -52,7 +52,7 @@ Elpi Command tutorial_HOAS. (* .none *)
5252
(*|
5353
5454
The full syntax of Coq terms can be found in
55-
`coq-builtin.elpi <https://github.com/LPCIC/coq-elpi/blob/master/coq-builtin.elpi>`_
55+
`coq-builtin.elpi <https://github.com/LPCIC/coq-elpi/blob/master/builtin-doc/coq-builtin.elpi>`_
5656
together with a detailed documentation of the encoding of contexts and the
5757
APIs one can use to interact with Coq. This tutorial, and the two more
5858
that focus on commands and tactics, are a gentle introduction to all that.
@@ -65,7 +65,7 @@ syntax tree of Coq terms.
6565
Constructor :e:`global`
6666
-----------------------
6767
68-
Let's start with the :type:`gref` data type (for global rerence).
68+
Let's start with the :type:`gref` data type (for global reference).
6969
7070
.. code:: elpi
7171
@@ -382,7 +382,7 @@ Elpi Query lp:{{
382382
383383
It is quite frequent to put Coq variables in the scope of an Elpi
384384
unification variable, and this can be done by simply writing
385-
`lp:(X a b)` which is a shorhand for `lp:{{ X {{ a }} {{ b }} }}`.
385+
`lp:(X a b)` which is a shorthand for `lp:{{ X {{ a }} {{ b }} }}`.
386386
387387
.. warning:: writing `lp:X a b` (without parentheses) would result in a
388388
Coq application, not an Elpi one

examples/tutorial_coq_elpi_command.v

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Tutorial on Coq commands
2020
evars in the Coq jargon).
2121
2222
This software, "coq-elpi", is a Coq plugin embedding Elpi and
23-
exposing to the extension language Coq spefic data types (e.g. terms)
23+
exposing to the extension language Coq specific data types (e.g. terms)
2424
and API (e.g. to declare a new inductive type).
2525
2626
In order to get proper syntax highlighting using VSCode please install the
@@ -63,7 +63,7 @@ The first one `Elpi Command hello.` sets the current program to hello.
6363
Since it is declared as a `Command` some code is loaded automatically:
6464
6565
* APIs (eg :builtin:`coq.say`) and data types (eg Coq :type:`term` s) are loaded from
66-
`coq-builtin.elpi <https://github.com/LPCIC/coq-elpi/blob/master/coq-builtin.elpi>`_
66+
`coq-builtin.elpi <https://github.com/LPCIC/coq-elpi/blob/master/builtin-doc/coq-builtin.elpi>`_
6767
* some utilities, like :lib:`copy` or :libred:`whd1` are loaded from
6868
`elpi-command-template.elpi <https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-command-template.elpi>`_
6969
@@ -168,7 +168,7 @@ Finally note that the type of the second field
168168
sees :e:`c0` (the value of the first field).
169169
170170
See the :type:`argument` data type
171-
for a detailed decription of all the arguments a command can receive.
171+
for a detailed description of all the arguments a command can receive.
172172
173173
------------------------
174174
Processing raw arguments
@@ -179,7 +179,7 @@ so that no elaboration has been performed.
179179
This can be achieved by using the
180180
`#[arguments(raw)]` attributed when the command is declared.
181181
182-
Then, thre are two ways to process term arguments:
182+
Then, there are two ways to process term arguments:
183183
typechecking and elaboration.
184184
185185
|*)
@@ -267,7 +267,7 @@ Synthesizing a term
267267
268268
Synthesizing a term typically involves reading an existing declaration
269269
and writing a new one. The relevant APIs are in the `coq.env.*` namespace
270-
and are named after the global refence they manipulate, eg :builtin:`coq.env.const`
270+
and are named after the global reference they manipulate, eg :builtin:`coq.env.const`
271271
for reading and :builtin:`coq.env.add-const` for writing.
272272
273273
Here we implement a little command that given an inductive type name
@@ -612,7 +612,7 @@ Elpi Accumulate lp:{{
612612
613613
The first attribute, :e:`elpi.loc` is always present and corresponds to the
614614
location in the source file of the command. Then we find an attribute for
615-
:e:`"this"` holding the emptry string and an attribute for :e:`"more.stuff"` holding
615+
:e:`"this"` holding the empty string and an attribute for :e:`"more.stuff"` holding
616616
the string :e:`"33"`.
617617
618618
Attributes are usually validated (parsed) and turned into regular options
@@ -699,7 +699,7 @@ Fail Go nowhere. (* .fails *)
699699
Reporting errors
700700
----------------
701701
702-
Last, (good) Elpi programs should fail reporting intellegible error messages,
702+
Last, (good) Elpi programs should fail reporting intelligible error messages,
703703
as the previous one.
704704
705705
|*)

examples/tutorial_coq_elpi_tactic.v

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Tutorial on Coq tactics
2020
evars in the Coq jargon).
2121
2222
This software, "coq-elpi", is a Coq plugin embedding Elpi and
23-
exposing to the extension language Coq spefic data types (e.g. terms)
23+
exposing to the extension language Coq specific data types (e.g. terms)
2424
and API (e.g. to declare a new inductive type).
2525
2626
In order to get proper syntax highlighting using VSCode please install the
@@ -74,7 +74,7 @@ The first one `Elpi Tactic show.` sets the current program to `show`.
7474
Since it is declared as a `Tactic` some code is loaded automatically:
7575
7676
* APIs (eg :builtin:`coq.say`) and data types (eg Coq :type:`term` s) are loaded from
77-
`coq-builtin.elpi <https://github.com/LPCIC/coq-elpi/blob/master/coq-builtin.elpi>`_
77+
`coq-builtin.elpi <https://github.com/LPCIC/coq-elpi/blob/master/builtin-doc/coq-builtin.elpi>`_
7878
* some utilities, like :lib:`copy` or :libred:`whd1` are loaded from
7979
`elpi-command-template.elpi <https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-tactic-template.elpi>`_
8080
@@ -112,7 +112,7 @@ Abort.
112112
113113
In the Elpi code up there :e:`Proof` is the hole for the current goal,
114114
:e:`Type` the statement to be proved and :e:`Ctx` the proof context (the list of
115-
hypotheses). Since we don't assign :e:`Proof` the tactic makes no progess.
115+
hypotheses). Since we don't assign :e:`Proof` the tactic makes no progress.
116116
Elpi prints somethinglike this:
117117
118118
.. mquote:: .s(elpi).msg{Goal:*X0 c0 c1*}
@@ -135,7 +135,7 @@ the variable has :e:`c0` and :e:`c1` in scope (the proof term can use them).
135135
Finally we see the type of the goal `x + 1 = y`.
136136
137137
The :e:`_Trigger` component, which we did not print, is a variable that, when
138-
assigned, trigger the elaboration of its value against the type of the goal
138+
assigned, triggers the elaboration of its value against the type of the goal
139139
and obtains a value for :e:`Proof` this way.
140140
141141
Keeping in mind that the :builtin:`solve` predicate relates one goal to a list of
@@ -225,7 +225,7 @@ the statement features an explicit conjunction.
225225
226226
|*)
227227

228-
About conj. (* remak the implicit arguments *)
228+
About conj. (* remark the implicit arguments *)
229229

230230
Elpi Tactic split.
231231
Elpi Accumulate lp:{{
@@ -236,16 +236,16 @@ Elpi Accumulate lp:{{
236236

237237
solve _ _ :-
238238
% This signals a failure in the Ltac model. A failure
239-
% in Elpi, that is no more cluases to try, is a fatal
240-
% error that cannot be catch by Ltac combinators like repeat.
239+
% in Elpi, that is no more clauses to try, is a fatal
240+
% error that cannot be caught by Ltac combinators like repeat.
241241
coq.ltac.fail _ "not a conjunction".
242242
}}.
243243
Elpi Typecheck.
244244

245245
Lemma test_split : exists t : Prop, True /\ True /\ t.
246246
Proof. (* .in *)
247247
eexists.
248-
repeat elpi split. (* The failure is catched by Ltac's repeat *)
248+
repeat elpi split. (* The failure is caught by Ltac's repeat *)
249249
(* Remark that the last goal is left untouched, since
250250
it did not match the pattern {{ _ /\ _ }}. *)
251251
all: elpi blind.
@@ -269,7 +269,7 @@ of code passing to it the desired
269269
arguments. Then it builds the list of subgoals.
270270
271271
Here we pass an integer, which in turn is passed to `fail`, and a term,
272-
which is turn is passed to `apply`.
272+
which in turn is passed to `apply`.
273273
274274
|*)
275275

@@ -327,7 +327,7 @@ have to be put between parentheses.
327327
:e:`X0`.
328328
329329
See the :type:`argument` data type
330-
for a detailed decription of all the arguments a tactic can receive.
330+
for a detailed description of all the arguments a tactic can receive.
331331
332332
Now let's write a tactic which behaves pretty much like the :libtac:`refine`
333333
one from Coq, but prints what it does using the API :builtin:`coq.term->string`.
@@ -368,7 +368,7 @@ It is customary to use the Tactic Notation command to attach a nicer syntax
368368
to Elpi tactics.
369369
370370
In particular `elpi tacname` accepts as arguments the following `bridges
371-
for Ltac values <https://coq.inria.fr/doc/proof-engine/ltac.html#syntactic-values>`_ :
371+
for Ltac values <https://coq.inria.fr/doc/master/refman/proof-engine/ltac.html#syntactic-values>`_ :
372372
373373
* `ltac_string:(v)` (for `v` of type `string` or `ident`)
374374
* `ltac_int:(v)` (for `v` of type `int` or `integer`)
@@ -410,16 +410,16 @@ Failure
410410
========
411411
412412
The :builtin:`coq.error` aborts the execution of both
413-
Elpi and any enclosing LTac context. This failure cannot be catched
414-
by LTac.
413+
Elpi and any enclosing Ltac context. This failure cannot be caught
414+
by Ltac.
415415
416416
On the contrary the :builtin:`coq.ltac.fail` builtin can be used to
417-
abort the execution of Elpi code in such a way that LTac can catch it.
418-
This API takes an integer akin to LTac's fail depth together with
417+
abort the execution of Elpi code in such a way that Ltac can catch it.
418+
This API takes an integer akin to Ltac's fail depth together with
419419
the error message to be displayed to the user.
420420
421421
Library functions of the `assert!` family call, by default, :builtin:`coq.error`.
422-
The flag `@ltacfail! N` can be set to alter this behavior and turn erros into
422+
The flag `@ltacfail! N` can be set to alter this behavior and turn errors into
423423
calls to `coq.ltac.fail N`.
424424
425425
|*)
@@ -485,8 +485,8 @@ As we hinted before, Elpi's equality is alpha equivalence. In the second
485485
goal the assumption has type `Q` but the goal has type `id Q` which is
486486
convertible (unifiable, for Coq's unification) to `Q`.
487487
488-
Let's improve our tactic looking for an assumption which is unifiable with
489-
the goal, an not just alpha convertible. The :builtin:`coq.unify-leq`
488+
Let's improve our tactic by looking for an assumption which is unifiable with
489+
the goal, and not just alpha convertible. The :builtin:`coq.unify-leq`
490490
calls Coq's unification for types (on which cumulativity applies, hence the
491491
`-leq` suffix). The :stdlib:`std.mem` utility, thanks to backtracking,
492492
eventually finds an hypothesis that satisfies the following predicate
@@ -571,7 +571,7 @@ Abort.
571571
(*|
572572
573573
This first approximation only prints the term it found, or better the first
574-
intance of the given term.
574+
instance of the given term.
575575
576576
Now lets focus on :lib:`copy`. An excerpt:
577577
@@ -904,7 +904,7 @@ tactic, here the precise type definition:
904904
905905
typeabbrev tactic (sealed-goal -> (list sealed-goal -> prop)).
906906
907-
A few tacticals can be fond in the
907+
A few tacticals can be found in the
908908
`elpi-ltac.elpi file <https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-ltac.elpi>`_.
909909
For example this is the code of :libtac:`try`:
910910

examples/tutorial_elpi_lang.v

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ hence unification succeeds.
185185
186186
See also the `Wikipedia page on Unification <https://en.wikipedia.org/wiki/Unification_(computer_science)#Syntactic_unification_of_first-order_terms>`_.
187187
188-
Since the first part of the query is succesful the rest of
188+
Since the first part of the query is successful the rest of
189189
the query is run: the value of :e:`P` is printed as well as
190190
the :e:`"is 23 years old"` string.
191191
@@ -232,7 +232,7 @@ but the third one has no solution, so unification fails.
232232
Backtracking
233233
------------
234234
235-
When failure occurs all assignements are undone (i.e. :e:`P` is unset again)
235+
When failure occurs all assignments are undone (i.e. :e:`P` is unset again)
236236
and the next rule in the program is tried. This operation is called
237237
*backtracking*.
238238
@@ -248,7 +248,7 @@ This one also fails. The unification problem for the last rule is:
248248
249249
age P 20 = age alice 20
250250
251-
This one works, and the assigment :e:`P = alice` is kept as the result
251+
This one works, and the assignment :e:`P = alice` is kept as the result
252252
of the first part of the query. Then :e:`P` is printed and the program
253253
ends.
254254
@@ -293,7 +293,7 @@ Elpi Query lp:{{
293293
294294
The :e:`not(P)` predicate tries to solve the query :e:`P`: it fails if
295295
:e:`P` succeeds, and succeeds if :e:`P` fails. In any case no trace is left
296-
of the computation for :e:`P`. E.g. :e:`not(X = 1, 2 < 1)` suceeds, but
296+
of the computation for :e:`P`. E.g. :e:`not(X = 1, 2 < 1)` succeeds, but
297297
the assignment for :e:`X` is undone. See also the section
298298
about the `foundations`_ of λProlog.
299299
@@ -562,7 +562,7 @@ Elpi Bound Steps 0.
562562
:e:`pi x\ ` and :e:`=>`
563563
-----------------------
564564
565-
We have seen how to implement subtitution using the binders of λProlog.
565+
We have seen how to implement substitution using the binders of λProlog.
566566
More often than not we need to move under binders rather than remove them by
567567
substituting some term in place of the bound variable.
568568
@@ -653,7 +653,7 @@ universally quantified, we use :e:`A2`, :e:`B2`... this time):
653653
* the :e:`=>` connective adds the rule :e:`of c2 A2` the program
654654
* the new query :e:`of c1 B2` is run.
655655
656-
The (hypotetical) rule :e:`of c1 A1` is used:
656+
The (hypothetical) rule :e:`of c1 A1` is used:
657657
658658
* unification assigns :e:`A1` to :e:`B2`
659659
@@ -686,7 +686,7 @@ First, the rule for elpi:`fun` is selected:
686686
687687
Then it's the turn of typing the application:
688688
689-
* the query :e:`of c1 (arr A2 B2)` assignes to :e:`A1` the
689+
* the query :e:`of c1 (arr A2 B2)` assigns to :e:`A1` the
690690
value :e:`arr A2 B2`. This means that the
691691
hypothetical rule is now :e:`of c1 (arr A2 B2)`.
692692
* the query :e:`of c1 A2` fails because the unification
@@ -915,7 +915,7 @@ Elpi Query lp:{{ sum X (s z) (s (s z)), (X = z ; X = s z) }}.
915915

916916
(*|
917917
918-
In this example the computation suspends, then makes progess,
918+
In this example the computation suspends, then makes progress,
919919
then suspends again...
920920
921921
|*)
@@ -1296,7 +1296,7 @@ Debugging
12961296
=========
12971297
12981298
The most sophisticated debugging feature can be used via
1299-
the Visual Sudio Code extension ``gares.elpi-lang`` and its
1299+
the Visual Studio Code extension ``gares.elpi-lang`` and its
13001300
``Elpi Tracer`` tab.
13011301
13021302
---------------
@@ -1328,7 +1328,7 @@ the load icon, in the upper right corner of the Elpi Tracer panel.
13281328
the extension settings in order to get a correct display.
13291329
13301330
The trace browser displays, on the left column, a list of cards corresponding
1331-
to a step perfoemd by the interpreter. The right side of the
1331+
to a step performed by the interpreter. The right side of the
13321332
panel gives more details about the selected step. In the image below one
13331333
can see the goal, the rule being applied, the assignments performed by the
13341334
unification of the rule's head with the goal, the subgoals generated.
@@ -1539,7 +1539,7 @@ fails, because :e:`X` cannot be at the same time 3 and 9. Initially
15391539
asserting that 3 (the value hold by :e:`X`) is equal to 9.
15401540
The second call to :e:`is` does not change the value carried by :e:`X`!
15411541
1542-
Unification, and hence the :e:`=` pradicate, plays two roles.
1542+
Unification, and hence the :e:`=` predicate, plays two roles.
15431543
When :e:`X` is unset, :e:`X = v` sets the variable.
15441544
When :e:`X` is set to :e:`u`, :e:`X = v` checks if the value
15451545
of :e:`X` is equal to :e:`u`: it is equivalent to :e:`u = v`.

0 commit comments

Comments
 (0)