Changes between Version 89 and Version 90 of IR
- Timestamp:
- 11/29/15 16:26:54 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR
v89 v90 181 181 * `forall(<i1:T1,i2:T2,...>,e)` : universal quantification. For all i1 in type T1, i2 in type T2, ..., e2 holds. 182 182 * `exists(<i1:T1,i2:T2,...>,e)`: existential quantification. There is some i1 in type T1, i2 in type T2, ..., such that e holds. 183 183 184 Numeric 184 185 * 123, -123, 3.1415, etc. : values of type `Integer`, `Int`, `Real`, `Float`. **NEED TO BE MORE SPECIFIC** … … 188 189 * `mul(e1,e2)` : multiplication 189 190 * `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 194 201 Characters and Strings 195 202 * 'a', 'b', ... : Char values. **UNICODE?** … … 199 206 * `domain(<r1,...,rn>)` : value of type `Domain[n]`, the Cartesian product of the n ranges, with dictionary order 200 207 * `hasnext(dom, <i,j,…>)`: an expression of boolean type, testing if the domain `dom` contains any element after `<i,j,...>` 208 201 209 Arrays 202 210 * `array(T,<e0,...,en-1>)`: value of type `Array[T, n]`, a literal array … … 207 215 * `seq_remove(a,i)` : array obtained by removing element at position i from a. Original array a not modified. 208 216 * `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 209 218 Tuples 210 219 * `tuple(S,<e0,e1,...>)` : value of tuple type `S` (tuple literal) 211 220 * `tsel(e1,i)` : tuple selection of component i of e1. i must be a literal natural number. 212 221 Unions 222 213 223 * `union_inj(U,i,x)` : `x` is in `Ti`, result is in the union type `U` 214 224 * `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`) 215 225 * `union_test(U,i,y)` : `y` is in `U`; determines if `y` is in the image under injection of `Ti`. Returns a Boolean. 226 216 227 Pointers and Memory 217 228 * `NULL` : value of type `void*` … … 225 236 * `mem_comp(mem1)` : set complement (everything not in `mem1`) 226 237 * `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 227 239 Scopes and Processes 228 240 * `root`, `here` : values of type `Scope` … … 232 244 * `scope_lt(e1,e2)` : is first scope a proper subscope of second? 233 245 * `scope_lte(e1,e2)`: is first scope a subscope or equal to second? 246 234 247 Other expressions 235 248 * `"x"` : x is an identifier, naming either a type, variable, or function … … 239 252 * `new(t)` : new (default) value of `Dytype` t 240 253 * `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`. 243 255 * cast of integer to array-of-boolean, and vice-versa? 244 256 * **Instead of casts would it be better to have explicit functions for each legal kind of cast?**
