Changes between Version 59 and Version 60 of IR


Ignore:
Timestamp:
11/25/15 16:26:56 (10 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v59 v60  
    1313 * a sequence of labeled statements.   Each clause in the labeled statement is a `\when` statement with some guard and a primitive statement, followed by a `\goto` statement
    1414* an array is declared without any length expression.  When it is initialized it can specify length.
    15 * curly braces are used only to indicate scopes
     15* curly braces are used only to indicate scopes, as in { // new scope ... }
     16* parentheses are used to indicate function invocations, as in \add(x,y)
     17* angular brackets are used to delimit tuples or sequences
     18* square brackets are used to delimit parameters in types
    1619
    1720Example:
     
    148151 * 123, -123, 3.1415, etc. : values of type `Integer`, `Int`, `Real`, `Float`.   **NEED TO BE MORE SPECIFIC**
    149152 * 'a', 'b', ... : Char values.  **UNICODE?**
    150  * `\array(T, (e0, ..., en-1))`: value of type `Array[T, n]`, a literal array
     153 * `\array(T, <e0, ..., en-1>)`: value of type `Array[T, n]`, a literal array
    151154 * `\array(T, n, e)`: value of type `Array[T,n]` in which each of the n elements is `e`
    152  * `\tuple(S, (e0, e1, ...))` : value of tuple type `S` (tuple literal)
     155 * `\tuple(S, <e0, e1, ...>)` : value of tuple type `S` (tuple literal)
    153156 * `\range(e1,e2,e3)` : value of type `Range` consisting of the integers e1, e1+e3, e1+2*e3, ... that are less than or equal to e2.
    154  * `\domain(r1,...,rn)` : value of type `Domain[n]`, the ordered Cartesian product of the n ranges (dictionary order)
     157 * `\domain(<r1,...,rn>)` : value of type `Domain[n]`, the ordered Cartesian product of the n ranges (dictionary order)
    155158 * `"abc"` : string literals: value of type `Array[Char, n+1]`, where n is the length of the string (the last element is the character `\0`)
    156159 * `\root`, `\here` : values of type `Scope`
     
    162165* `\new(t)` : new (default) value of dynamic type t
    163166* `\defined(e)` : is `e` defined? Type is `Bool`
    164 * `\has_next(dom, (i, j, …))`: an expression of boolean type, testing if the domain `dom` contains any element after `(i, j, ...)`
     167* `\has_next(dom, <i, j, …>)`: an expression of boolean type, testing if the domain `dom` contains any element after `<i, j, ...>`
    165168* `\add(e1, e2)` : numeric addition. 
    166169 * `e1` and `e2` have the same numeric type.  Note that there are no "automatic conversions" as there are in C.  If the original expressions have different types, explicit casts must be inserted. 
    167 * `\padd(e1, e2)`: pointer addition. `e1` has pointer type and `e2` has an integer type.
     170* `\padd(e1, e2)`: pointer addition. `e1` has pointer type and `e2` has an integer type or range type.  If `e2` has integer type the result has pointer type.   Otherwise, the result has `Mem` type.
    168171* `\sub(e1, e2)` : subtraction
     172* `\psub(e1,e2)`: pointer subtraction
    169173* `\mul(e1, e2)` : multiplication
    170174* `\div(e1, e2)` : division
     
    173177* `\asub(e1, e2)` : array subscript expression.  Note that `e1` must have array type, not pointer type. (This is different from C.)   If `e1` has pointer type, use `\deref(\padd(e1, e2))` instead. 
    174178* `\deref(e)` : pointer dereference
    175 * `\addressof(e)` : address-of operator
     179* `\addr(e)` : address-of operator
    176180* `\not(e)` : logical not
    177181* `\neg(e)` : negative
     
    189193* `\bit_and(e1, e2)`, `\bit_or(e1, e2)`, `\bit_xor(e1, e2)`, `\bit_comp(e1)` : bit-wise operations: arguments are arrays of booleans
    190194* a left-hand-side expression, when used in certain contexts, is automatically converted to `Mem`.  The contexts are: arguments to the built-in functions `\access`, `\read`, and `\write` described below, or occurrence in the list of an `\assigns` clause
    191 * `\array_chunk(a, dom)`, where `a` is an expression of array type and `dom` is an expression of `Domain` type.   The dimension of the array must match the dimension of the domain.   This represents all memory units which are the cells in the array indexed by a tuple in `dom`.
     195* `\array_slice(a, dom)`, where `a` is an expression of array type and `dom` is an expression of `Domain` type.   The dimension of the array must match the dimension of the domain.   This represents all memory units which are the cells in the array indexed by a tuple in `dom`.
    192196* `\region(ptr)`, where `ptr` is an expression with a pointer type.  This represents the set of all memory units reachable from `ptr`, including the memory unit pointed to by `ptr` itself.
    193197 * **\mem_reach ?**
     
    199203== The Primitive Statements ==
    200204
    201 * Assign:  `e1:=e2;`
    202 * Call: `\call f, (e1,...,en);` and `\call e, f, (e1,...,en);`
    203  * regular function (one with flow graph)
    204  * ** distinguish this kind of call from an expression involving a pure system or abstract call???**
     205* Assign:  `assign e1,e2;`
     206* Call: `call f, <e1,...,en>;` and `\call e, f, <e1,...,en>;`
     207 * call to a function which is not abstract and is not a pure system function
    205208* Spawn: `\spawn f, (e1,...,en);` and `\spawn e, f, (e1,...,en);`
    206209* Wait: `\wait e;`
     
    222225* Atomic_exit: `\atomic_exit;`
    223226* Parfor_spawn: `\parspawn p, d, f;` where `p` is pointer to process reference, `d` has `Domain` type and `f` has `Function` type.
    224 * Domain iterator: `\next dom, (i,j,…)` updates `i`, `j`, ... to be the value of the inter tuple in `dom` after `(i, j, ...)`
     227* Domain iterator: `\next dom, <i,j,…>` updates `i`, `j`, ... to be the value of the inter tuple in `dom` after `<i, j, ...>`
    225228* For_dom_enter (for domains): `\for_enter dom;`
    226229