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:29] 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 (t notin S); | ||
x := t; | x := t; | ||
S = S U {t}; | S = S U {t}; | ||
+ | ++++ | ||
- | We will obtain formulas with sets, in FOL eliminate them using quantifiers. | + | We obtain formulas with sets, in FOL eliminate them using quantifiers. |