LARA

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sav08:semantics_of_array_manipulations [2008/04/08 20:20]
vkuncak
sav08:semantics_of_array_manipulations [2008/04/08 23:45]
vkuncak
Line 4: Line 4:
  
 Example: Example:
-++++|+
   a = new T[10];   a = new T[10];
   b = new T[10];   b = new T[10];
 +++++|
   a = b;   a = b;
   i = j;   i = j;
 ++++ ++++
- 
   a[i] = 1;   a[i] = 1;
   b[j] = 2;   b[j] = 2;
   assert a[i]==1;   assert a[i]==1;
  
 +One possible model: ++| arrays :: $Obj \times Int \to Obj$ ++
 +
 +What is desugaring of a[i]=x ?
 +++++|
 +  array = array((a,i) := x);
 +++++