Changes between Version 58 and Version 59 of IR
- Timestamp:
- 11/25/15 16:14:44 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR
v58 v59 51 51 a: Array[Integer]; 52 52 L1: 53 when (\true) x:=3*y; goto L2;53 when (\true) assign x, \mul(3,y); goto L2; 54 54 L2: 55 when(\true) a _t:=\dytype(Array[Integer, x+1]); goto L3; // Array[Integer] is refined here using x+155 when(\true) assign a_t, \dytype(Array[Integer, \add(x,1)]); goto L3; // Array[Integer] is refined here using x+1 56 56 L3: 57 when (\true) a :=\new(a_t); goto L4;57 when (\true) assign a, \new(a_t); goto L4; 58 58 L4: 59 59 } … … 119 119 120 120 {{{ 121 // type definitions122 121 typedef S=Tuple[Array[Integer]]; 123 122 124 // variable decls125 123 n: Integer; 126 124 S_d: Dytype[S]; … … 128 126 x2: S; 129 127 130 // statements (leaving out the chooses and whens for brevity) 131 n:=10; 132 S_d:=\dytype(Tuple[Array[Integer, n]]); 133 x1:=\new(S_d); 134 n:=20; 135 x2:=\new(S_d); 128 L0: 129 when (\true) assign n, 10; goto L1; 130 L1: 131 when (\true) assign S_d, \dytype(Tuple[Array[Integer, n]]); goto L2; 132 L2: 133 when (\true) assign x1, \new(S_d); goto L3; 134 L3: 135 when (\true) assign n, 20; goto L4; 136 L4: 137 when (\true) assign x2, \new(S_d); goto L5; 138 L5: 136 139 }}} 137 140 … … 224 227 == Declarations and Function Definitions == 225 228 226 Declarations follow the C notation.Function prototypes are considered to be declarations similar to variable declarations.229 Function prototypes are considered to be declarations similar to variable declarations. 227 230 228 231 Example of declaration of a function: 229 232 {{{ 230 f( Real x, Bool y; Integer);233 f(x: Real, b: Bool): Float[32,33]; 231 234 }}} 232 235
