Changes between Version 51 and Version 52 of IR
- Timestamp:
- 11/24/15 18:49:13 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR
v51 v52 116 116 {{{ 117 117 // type definitions 118 Type S:=Tuple[Array[Integer]]; 119 _dynamic_S: Dytype; 118 \type S=Tuple[Array[Integer]]; 120 119 121 120 // variable decls 122 121 n: Integer; 123 _S_init: S;122 S_d: Dytype[S]; 124 123 x1: S; 125 124 x2: S; … … 127 126 // statements (leaving out the chooses and whens for brevity) 128 127 n:=10; 129 _dynamic_S:=\dtype(Tuple[Array[Integer, n]]);130 x1:=\new( _dynamic_S);128 S_d:=\dytype(Tuple[Array[Integer, n]]); 129 x1:=\new(S_d); 131 130 n:=20; 132 x2:=\new( _dynamic_S);131 x2:=\new(S_d); 133 132 }}} 134 133 … … 148 147 == Expressions == 149 148 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`.149 In the following list of expressions, `e`, `e0`, `e1`, etc., are expressions. `T` is a type name. `t` is an expression of type `Dytype`. 151 150 152 151 * literals … … 164 163 * `NULL` : value of type `void*` 165 164 * variables 166 * `\sizeof_type( T)` : the size of the named type165 * `\sizeof_type(t)` : the size of the dynamic type t 167 166 * `\sizeof(e)` : the size of the value of expression `e` 168 * `\new( T)` : initial value of the namedtype167 * `\new(t)` : new (default) value of specified dynamic type 169 168 * `\defined(e)` : is `e` defined? Type is `Bool` 170 169 * `\has_next(dom, i, j, k, …)`: an expression of boolean type, testing if the domain `dom` contains any element after `(i, j, k, ...)` … … 200 199 * `\mem_union(mem1, mem2)`, where `mem1` and `mem2` are expressions of type `Memory`. This is the union of the two sets. 201 200 * **could we use Frama-C notation `p+(e1..e2)` for example?** 202 * **are there conversions between pointers and mems?**203 201 204 202 Pointers: 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)))`. … … 216 214 * `e:=\allocate(h,t,e);`, where 217 215 * `h` as type `Heap` 218 * `t` has type ` Type`216 * `t` has type `Dytype` 219 217 * `e` has integer type. 220 218 * Allocates `e` objects of type `t` on heap `h`
