Changes between Version 66 and Version 67 of IR


Ignore:
Timestamp:
11/25/15 21:55:04 (10 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v66 v67  
    1717* angular brackets are used to delimit tuples or sequences
    1818* square brackets are used to delimit parameters in types
     19* unlike C, there is no "array-pointer pun".   If an array `a` needs to be converted to a pointer, you must use \addr(\asub(a, 0))`.
     20* there are no automatic conversions.  All conversions must be by explicit casts or other functions.   Operations such as numeric addition (`\add`) require that both operands have the exact same type.
     21
    1922
    2023Example:
     
    8992 * IEEE754 floating point numbers
    9093* `HerbrandReal` : Herbrand real numbers.  Values are unsimplified symbolic expressions.
    91 * `Tuple[<T0, T1, ...>]`: a tuple type, the Cartesian product of T0, T1, ...
     94* `Tuple[<T0, T1, ...>]`: a tuple type, the Cartesian product of `T0`, `T1`, ...
    9295 * **What about bit-widths?**
    93 * `Union[<T0, T1, ...>]`: union type, the disjoint union of T0, T1, ...
     96* `Union[<T0, T1, ...>]`: union type, the disjoint union of `T0`, `T1`, ...
    9497* `Array[T]` : arrays of any length whose elements belong to T
    9598* `Function[<T0,T1,...>,T]` : functions consuming T0,T1,... and returning T.  T can be `void` to indicate nothing is returned.
     
    170173* `"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`)
    171174Ranges and Domains
    172 * `\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.
    173 * `\domain(<r1,...,rn>)` : value of type `Domain[n]`, the ordered Cartesian product of the n ranges (dictionary order)
     175* `\range(e1,e2,e3)` : value of type `Range`.  If `e3` is positive, the integers e1, e1+e3, e1+2*e3, ... that are less than or equal to `e2`.  If `e3` is negative, the integers e1, e1+e3, e1+2*e3, ... that are greater than or equal to `e2`.  Exception if `e3` is 0.
     176* `\domain(<r1,...,rn>)` : value of type `Domain[n]`, the Cartesian product of the n ranges, with dictionary order
    174177* `\hasnext(dom, <i,j,…>)`: an expression of boolean type, testing if the domain `dom` contains any element after `<i,j,...>`
    175178Arrays
     
    179182* `\seq_add(a,e)` : array obtained by adding element e to the end of the array.  Original array a is not modified.
    180183* `\seq_append(a1,a2)` : array obtained by concatenating two arrays.  Original array not modified.
    181 * `\seq_remove(a,i)` : array obtained by removing element at position i from a.  Original array a not modified.  **WHAT HAPPENS TO REFERENCES INTO A**
     184* `\seq_remove(a,i)` : array obtained by removing element at position i from a.  Original array a not modified.
    182185* `\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.
    183186Tuples
    184187* `\tuple(S,<e0,e1,...>)` : value of tuple type `S` (tuple literal)
    185188* `\tsel(e1,i)` : tuple selection of component i of e1.  i must be a literal natural number.
     189Unions
     190* `\union_inj(U,i,x)` : `x` is in `Ti`, result is in the union type `U`
     191* `\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`)
     192* `\union_test(U,i,y)` : `y` is in `U`; determines if `y` is in the image under injection of `Ti`.  Returns a Boolean.
    186193Pointers and Memory
    187194* `NULL` : value of type `void*`
     
    211218* `e0(e1,...,en)` : a function invocation where `e` must evaluate to either an abstract or pure system function
    212219
    213 Notes
    214 * unlike C, there is no "array-pointer pun".   If an array `a` needs to be converted to a pointer, you must use \addr(\asub(a, 0))`.
    215 
    216220== The Primitive Statements ==
    217221