@@ -3,7 +3,12 @@ Elaborator Reflection - Tactics
33
44The Idris part of the code for elaborator reflection is in
55Elab.idr `<https://github.com/idris-lang/Idris-dev/blob/master/libs/prelude/Language/Reflection/Elab.idr>`_
6−Before we look at the Elab monad we need to know how to construct terms.
6+Before looking at the Elab monad we need to know how to construct terms.
7+
8+Holes
9+=====
10+
11+For more information about holes and guesses see `Dependently Typed Functional Programs and their Proofs McBride 1999`_.
712
813Proof State
914===========
@@ -24,7 +29,7 @@ There are many other pieces of information in the proof state such as the names
2429Names TTName
2530------------
2631
27−Names in an Idris program are evaluated at runtime but sometimes we need a 'variable name' which can be referred to as an unevaluated symbol.
32+Names in an Idris program are evaluated at runtime but sometimes a 'variable name' is needed, which can be referred to as an unevaluated symbol.
2833The names used in terms have different constructors depending on their type:
2934
3035+---------------------------+-----------------------------------------------+
@@ -120,7 +125,7 @@ Since names are used frequently in elaborator reflection there is a shortcut for
120125 P Ref (UN "a") (TConst (AType (ATInt ITBig))) : TT
121126
122127
123− * - If we want the vale we can escape from quasiquotation by using anti-quotation (tilde)
128+ * - If we want the value we can escape from quasiquotation by using anti-quotation (tilde)
124129 - example
125130
126131 .. code-block:: idris
@@ -151,7 +156,7 @@ quasiquotation summary:
151156TT
152157==
153158
154−There is a notation for a term in TT as it is being constructed (based on a BNF-like grammar), this is used for example in the debug output, it is a compact way to see the state of the term so we use it here.
159+There is a notation for a term in TT as it is being constructed (based on a BNF-like grammar), this is used for example in the debug output, it is a compact way to see the state of the term so it is used here.
155160So internally the program is stored as a tree structure using the following syntax:
156161
157162+------------+-------+-------------+---------------------------------------------+
@@ -169,8 +174,9 @@ So internally the program is stored as a tree structure using the following synt
169174| binding | | | binding. |
170175+------------+-------+-------------+---------------------------------------------+
171176| application| t ::= | t t | As with Idris, juxtaposition indicates |
172−| | | | function application. Note: we use the same |
173−| | | | symbol 't' for terms |
177+| | | | function application. Note: the same symbol |
178+| | | | 't' is used for both terms, this does not |
179+| | | | imply they are the same term. |
174180+------------+-------+-------------+---------------------------------------------+
175181| Type | t ::= | T | |
176182| constructor| | | |
@@ -429,3 +435,5 @@ However this would cause the application of f to be ill-typed, as it expects an
429435
430436 letbind : (n : TTName) -> (ty, tm : Raw) -> Elab ()
431437
438+... target-notes::
439+. _`Dependently Typed Functional Programs and their Proofs McBride 1999`: https://www.era.lib.ed.ac.uk/handle/1842/374