Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
sav08:semantics_of_dynamic_object_allocation [2008/04/08 17:12] vkuncak |
sav08:semantics_of_dynamic_object_allocation [2008/04/08 23:30] vkuncak |
||
---|---|---|---|
Line 3: | Line 3: | ||
x = new() | x = new() | ||
+ | Example program we wish we can prove: | ||
+ | x = new(); | ||
+ | y = new(); | ||
+ | assert (x != y); | ||
+ | |||
+ | Also: | ||
+ | assume (ALL n. next n != x); | ||
+ | y = new(); | ||
+ | assert (ALL n. next n != x); | ||
+ | |||
+ | Solution: ++++| | ||
+ | x = new(); | ||
Becomes: | Becomes: | ||
- | assume (t notin S); | + | assume (x1 notin S); |
- | x := t; | + | x := x1; |
- | S = S U {t}; | + | S = S U {x1}; |
+ | for fresh variable x1. | ||
+ | ++++ | ||
- | We will obtain formulas with sets, in FOL eliminate them using quantifiers. | + | We obtain formulas with sets, in FOL eliminate them using quantifiers. |