@@ -3,7 +3,12 @@ Elaborator Reflection - Tactics
4The Idris part of the code for elaborator reflection is in
4The Idris part of the code for elaborator reflection is in
5Elab.idr `<https://github.com/idris-lang/Idris-dev/blob/master/libs/prelude/Language/Reflection/Elab.idr>`_
5Elab.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.
11+For more information about holes and guesses see `Dependently Typed Functional Programs and their Proofs McBride 1999`_.
8Proof State
13Proof State
9===========
14===========
@@ -24,7 +29,7 @@ There are many other pieces of information in the proof state such as the names
24Names TTName
29Names TTName
25------------
30------------
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.
28The names used in terms have different constructors depending on their type:
33The names used in terms have different constructors depending on their type:
30+---------------------------+-----------------------------------------------+
35+---------------------------+-----------------------------------------------+
@@ -120,7 +125,7 @@ Since names are used frequently in elaborator reflection there is a shortcut for
120 P Ref (UN "a") (TConst (AType (ATInt ITBig))) : TT
125 P Ref (UN "a") (TConst (AType (ATInt ITBig))) : TT
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)
124 - example
129 - example
126 .. code-block:: idris
131 .. code-block:: idris
@@ -151,7 +156,7 @@ quasiquotation summary:
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.
155So internally the program is stored as a tree structure using the following syntax:
160So internally the program is stored as a tree structure using the following syntax:
157+------------+-------+-------------+---------------------------------------------+
162+------------+-------+-------------+---------------------------------------------+
@@ -169,8 +174,9 @@ So internally the program is stored as a tree structure using the following synt
169| binding | | | binding. |
174| binding | | | binding. |
170+------------+-------+-------------+---------------------------------------------+
175+------------+-------+-------------+---------------------------------------------+
171| application| t ::= | t t | As with Idris, juxtaposition indicates |
176| application| t ::= | t t | As with Idris, juxtaposition indicates |
172−| | | | function application. Note: we use the same |
177+| | | | function application. Note: the same symbol |
173−| | | | symbol 't' for terms |
178+| | | | 't' is used for both terms, this does not |
179+| | | | imply they are the same term. |
174+------------+-------+-------------+---------------------------------------------+
180+------------+-------+-------------+---------------------------------------------+
175| Type | t ::= | T | |
181| Type | t ::= | T | |
176| constructor| | | |
182| constructor| | | |
@@ -429,3 +435,5 @@ However this would cause the application of f to be ill-typed, as it expects an
430 letbind : (n : TTName) -> (ty, tm : Raw) -> Elab ()
436 letbind : (n : TTName) -> (ty, tm : Raw) -> Elab ()
439+. _`Dependently Typed Functional Programs and their Proofs McBride 1999`: https://www.era.lib.ed.ac.uk/handle/1842/374