From fe6c6e420a2803159f9ca7739ece8ec119bbe5c2 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Mon, 23 Dec 2013 21:22:58 -0600
Subject: [PATCH] Document ISL syntax

---
 doc/reference.rst | 59 +++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 2 deletions(-)

diff --git a/doc/reference.rst b/doc/reference.rst
index f35af329b..355088a6b 100644
--- a/doc/reference.rst
+++ b/doc/reference.rst
@@ -120,6 +120,52 @@ Arguments
 
 .. _temporaries:
 
+Loop domains
+^^^^^^^^^^^^
+
+TODO: Explain the domain tree
+
+.. _isl-syntax:
+
+ISL syntax
+~~~~~~~~~~
+
+The general syntax of an ISL set is the following::
+
+    {[VARIABLES]: CONDITIONS}
+
+``VARIABLES`` is a simple list of identifiers representing loop indices,
+or, as loopy calls them, inames. Example::
+
+    {[i, j, k]: CONDITIONS}
+
+The following constructs are supported for ``CONDITIONS``:
+
+* Simple conditions: ``i <= 15``, ``i>0``
+
+* Conjunctions: ``i > 0 and i <= 15``
+
+* Two-sided conditions: ``0 < i <= 15`` (equivalent to the previous
+  example)
+
+* Identical conditions on multiple variables:
+  ``0 < i,j <= 15``
+
+* Equality constraints: ``i = j*3`` (**Note:** ``=``, not ``==``.)
+
+* Modulo: ``i mod 3 = 0``
+
+* Existential quantifiers: ``(exists l: i = 3*l)`` (equivalent to the
+  previous example)
+
+Examples of constructs that are **not** allowed:
+
+* Multiplication by non-constants: ``j*k``
+
+* Disjunction: ``(i=1) or (i=5)``
+  (**Note:** This may be added in a future version of loopy.
+  For now, loop domains have to be convex.)
+
 Temporary Variables
 ^^^^^^^^^^^^^^^^^^^
 
@@ -133,10 +179,10 @@ have the lifetime of a kernel invocation.
 Instructions
 ^^^^^^^^^^^^
 
-.. _assignments:
-
 .. autoclass:: UniqueName
 
+.. _assignments:
+
 Assignments
 ~~~~~~~~~~~
 
@@ -233,6 +279,15 @@ These are usually key-value pairs. The following attributes are recognized:
 
 .. autoclass:: ExpressionInstruction
 
+
+.. _expression-syntax:
+
+Expression Syntax
+~~~~~~~~~~~~~~~~~
+
+TODO: Functions
+TODO: Reductions
+
 C Block Instructions
 ~~~~~~~~~~~~~~~~~~~~
 
-- 
GitLab