Changes between Version 51 and Version 52 of IR


Ignore:
Timestamp:
11/24/15 18:49:13 (10 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v51 v52  
    116116{{{
    117117// type definitions
    118 Type S:=Tuple[Array[Integer]];
    119 _dynamic_S: Dytype;
     118\type S=Tuple[Array[Integer]];
    120119
    121120// variable decls
    122121n: Integer;
    123 _S_init: S;
     122S_d: Dytype[S];
    124123x1: S;
    125124x2: S;
     
    127126// statements (leaving out the chooses and whens for brevity)
    128127n:=10;
    129 _dynamic_S:=\dtype(Tuple[Array[Integer, n]]);
    130 x1:=\new(_dynamic_S);
     128S_d:=\dytype(Tuple[Array[Integer, n]]);
     129x1:=\new(S_d);
    131130n:=20;
    132 x2:=\new(_dynamic_S);
     131x2:=\new(S_d);
    133132}}}
    134133
     
    148147== Expressions ==
    149148
    150 In the following list of expressions, `e`, `e0`, `e1`, etc., are expressions.  `T` is a type name. `t` is an expression of type `Type`.
     149In the following list of expressions, `e`, `e0`, `e1`, etc., are expressions.  `T` is a type name. `t` is an expression of type `Dytype`.
    151150
    152151* literals
     
    164163 * `NULL` : value of type `void*`
    165164* variables
    166 * `\sizeof_type(T)` : the size of the named type
     165* `\sizeof_type(t)` : the size of the dynamic type t
    167166* `\sizeof(e)` : the size of the value of expression `e`
    168 * `\new(T)` : initial value of the named type
     167* `\new(t)` : new (default) value of specified dynamic type
    169168* `\defined(e)` : is `e` defined? Type is `Bool`
    170169* `\has_next(dom, i, j, k, …)`: an expression of boolean type, testing if the domain `dom` contains any element after `(i, j, k, ...)`
     
    200199 * `\mem_union(mem1, mem2)`, where `mem1` and `mem2` are expressions of type `Memory`.  This is the union of the two sets.
    201200 * **could we use Frama-C notation `p+(e1..e2)` for example?**
    202  * **are there conversions between pointers and mems?**
    203201
    204202Pointers: unlike C, there is no "array-pointer pun".   If an array `a` needs to be converted to a pointer, you must use `\address_of(\address_of(\array_subscript(a, 0)))`.
     
    216214 * `e:=\allocate(h,t,e);`, where
    217215  * `h` as type `Heap`
    218   * `t` has type `Type`
     216  * `t` has type `Dytype`
    219217  * `e` has integer type.
    220218 * Allocates `e` objects of type `t` on heap `h`