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: examples/tutorial_elpi_lang.v
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -185,7 +185,7 @@ hence unification succeeds.
185
185
186
186
See also the `Wikipedia page on Unification <https://en.wikipedia.org/wiki/Unification_(computer_science)#Syntactic_unification_of_first-order_terms>`_.
187
187
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
189
189
the query is run: the value of :e:`P` is printed as well as
190
190
the :e:`"is 23 years old"` string.
191
191
@@ -232,7 +232,7 @@ but the third one has no solution, so unification fails.
232
232
Backtracking
233
233
------------
234
234
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)
236
236
and the next rule in the program is tried. This operation is called
237
237
*backtracking*.
238
238
@@ -248,7 +248,7 @@ This one also fails. The unification problem for the last rule is:
248
248
249
249
age P 20 = age alice 20
250
250
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
252
252
of the first part of the query. Then :e:`P` is printed and the program
253
253
ends.
254
254
@@ -293,7 +293,7 @@ Elpi Query lp:{{
293
293
294
294
The :e:`not(P)` predicate tries to solve the query :e:`P`: it fails if
295
295
: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
297
297
the assignment for :e:`X` is undone. See also the section
298
298
about the `foundations`_ of λProlog.
299
299
@@ -562,7 +562,7 @@ Elpi Bound Steps 0.
562
562
:e:`pi x\ ` and :e:`=>`
563
563
-----------------------
564
564
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.
566
566
More often than not we need to move under binders rather than remove them by
567
567
substituting some term in place of the bound variable.
568
568
@@ -653,7 +653,7 @@ universally quantified, we use :e:`A2`, :e:`B2`... this time):
653
653
* the :e:`=>` connective adds the rule :e:`of c2 A2` the program
654
654
* the new query :e:`of c1 B2` is run.
655
655
656
-
The (hypotetical) rule :e:`of c1 A1` is used:
656
+
The (hypothetical) rule :e:`of c1 A1` is used:
657
657
658
658
* unification assigns :e:`A1` to :e:`B2`
659
659
@@ -686,7 +686,7 @@ First, the rule for elpi:`fun` is selected:
686
686
687
687
Then it's the turn of typing the application:
688
688
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
690
690
value :e:`arr A2 B2`. This means that the
691
691
hypothetical rule is now :e:`of c1 (arr A2 B2)`.
692
692
* 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) }}.
915
915
916
916
(*|
917
917
918
-
In this example the computation suspends, then makes progess,
918
+
In this example the computation suspends, then makes progress,
919
919
then suspends again...
920
920
921
921
|*)
@@ -1296,7 +1296,7 @@ Debugging
1296
1296
=========
1297
1297
1298
1298
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
1300
1300
``Elpi Tracer`` tab.
1301
1301
1302
1302
---------------
@@ -1328,7 +1328,7 @@ the load icon, in the upper right corner of the Elpi Tracer panel.
1328
1328
the extension settings in order to get a correct display.
1329
1329
1330
1330
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
1332
1332
panel gives more details about the selected step. In the image below one
1333
1333
can see the goal, the rule being applied, the assignments performed by the
1334
1334
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
1539
1539
asserting that 3 (the value hold by :e:`X`) is equal to 9.
1540
1540
The second call to :e:`is` does not change the value carried by :e:`X`!
1541
1541
1542
-
Unification, and hence the :e:`=` pradicate, plays two roles.
1542
+
Unification, and hence the :e:`=` predicate, plays two roles.
1543
1543
When :e:`X` is unset, :e:`X = v` sets the variable.
1544
1544
When :e:`X` is set to :e:`u`, :e:`X = v` checks if the value
1545
1545
of :e:`X` is equal to :e:`u`: it is equivalent to :e:`u = v`.
0 commit comments