Differences
This shows you the differences between two versions of the page.
sav08:semantics_of_field_reads_and_writes [2008/04/08 23:43] vkuncak |
sav08:semantics_of_field_reads_and_writes [2015/04/21 17:30] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Semantics of Field Reads and Writes ====== | ||
- | |||
- | How to model $x.f$ ? ++|term $f(x)$++ | ||
- | |||
- | How to model field assignment $x.f=y$ ? | ||
- | ++++| | ||
- | Use function update construct: | ||
- | \[ | ||
- | f = f(x:=y) | ||
- | \] | ||
- | State variable $f$, which denotes a function, is assigned an updated version of this function. | ||
- | ++++ | ||
- | |||
- | What about null pointer checks? | ||
- | |||
- | Examples: | ||
- | y = x.next.next | ||
- | x.next.next.prev = y | ||
- | (x = null | x.next == y) | ||
- | |||
- | Statement simplification. | ||
- | |||
- | Short-circuit evaluation. | ||
- | |||
- | Type and definition sketch of a recursive (Scala) function that simplifies expressions and statements. | ||