Changes between Version 89 and Version 90 of IR


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

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v89 v90  
    181181* `forall(<i1:T1,i2:T2,...>,e)` : universal quantification.  For all i1 in type T1, i2 in type T2, ..., e2 holds.
    182182* `exists(<i1:T1,i2:T2,...>,e)`: existential quantification.  There is some i1 in type T1, i2 in type T2, ..., such that e holds.
     183
    183184Numeric
    184185* 123, -123, 3.1415, etc. : values of type `Integer`, `Int`, `Real`, `Float`.   **NEED TO BE MORE SPECIFIC**
     
    188189* `mul(e1,e2)` : multiplication
    189190* `div(e1,e2)` : division
    190  * If both are integer types, the result is integer division.  Otherwise it is real division.  Need to define what happens for negative integers.
    191 * `mod(e1,e2)` : integer modulus
    192 * `neg(e)` : negative
    193 * `lt(e1,e2)`, `lte(e1,e2)`: less than/less than or equal to
     191 * If both are integral types, the result is integer division.  Otherwise it is real division.  Need to define what happens for negative integers.
     192* `mod(e1,e2)` : integer modulus.  Arguments may be `Integer` or any `Int` type.  They must have the same type, which is also the type of the result.
     193* `neg(e)` : negative.  Argument may have any numeric type; result has same type.
     194* `lt(e1,e2)`, `lte(e1,e2)`: less than/less than or equal to.  Arguments must have same numeric type.
     195* `round(e)`: given a real or floating number, returns the nearest `Integer`.  The argument may be any real or floating type.  n+1/2 is rounded to ?.  (Could add a rounding mode.)
     196* `floor(e)`: given a real or floating number, returns the greatest `Integer` less that or equal to it.
     197* `ceil(e)`
     198* `abs(e)`: given any numeric expression e, returns the absolute value; result is same type as `e`.
     199* `pow(e,n)`: given any numeric expression e and expression `n` of any integral type, returns e to the n-th power.  `n` must evaluate to a nonnegative integer.
     200
    194201Characters and Strings
    195202* 'a', 'b', ... : Char values.  **UNICODE?**
     
    199206* `domain(<r1,...,rn>)` : value of type `Domain[n]`, the Cartesian product of the n ranges, with dictionary order
    200207* `hasnext(dom, <i,j,…>)`: an expression of boolean type, testing if the domain `dom` contains any element after `<i,j,...>`
     208
    201209Arrays
    202210* `array(T,<e0,...,en-1>)`: value of type `Array[T, n]`, a literal array
     
    207215* `seq_remove(a,i)` : array obtained by removing element at position i from a.  Original array a not modified.
    208216* `bit_and(e1, e2)`, `bit_or(e1, e2)`, `bit_xor(e1, e2)`, `bit_comp(e1)` : bit-wise operations: arguments are arrays of booleans of equal length.
     217
    209218Tuples
    210219* `tuple(S,<e0,e1,...>)` : value of tuple type `S` (tuple literal)
    211220* `tsel(e1,i)` : tuple selection of component i of e1.  i must be a literal natural number.
    212221Unions
     222
    213223* `union_inj(U,i,x)` : `x` is in `Ti`, result is in the union type `U`
    214224* `union_sel(U,i,y)` : `y` is in `U`, result is in `Ti` (or exception if `y` is not in image of injection from `Ti`)
    215225* `union_test(U,i,y)` : `y` is in `U`; determines if `y` is in the image under injection of `Ti`.  Returns a Boolean.
     226
    216227Pointers and Memory
    217228* `NULL` : value of type `void*`
     
    225236* `mem_comp(mem1)` : set complement (everything not in `mem1`)
    226237* `mem_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`.
     238
    227239Scopes and Processes
    228240* `root`, `here` : values of type `Scope`
     
    232244* `scope_lt(e1,e2)` : is first scope a proper subscope of second?
    233245* `scope_lte(e1,e2)`: is first scope a subscope or equal to second?
     246
    234247Other expressions
    235248* `"x"` : x is an identifier, naming either a type, variable, or function
     
    239252* `new(t)` : new (default) value of `Dytype` t
    240253* `defined(e)` : is `e` defined? `Bool` type
    241 * `cast(e,T)` : casts `e` to a value of the named type
    242  * need to list all of the legal casts and what they mean exactly
     254* `cast(e,T)` : casts `e` to a value of the named type.  `T` must name a subtype of the static type of `e`.
    243255 * cast of integer to array-of-boolean, and vice-versa?
    244256 * **Instead of casts would it be better to have explicit functions for each legal kind of cast?**