Perfect Developer basic tutorial 6 This page last modified 2011-10-31 (JAC)

Combining Postconditions

There are four ways of combining postconditions:

To combine postconditions with "&", first put brackets around any change...satisfy or forall postconditions that you wish to combine; then write "&" between the postconditions.
For example, the following swaps the values of variables x and y:

x! = y & y! = x

Postconditions combined with "&" are satisfied in parallel, but where you prime a variable this refers to the final value of a variable in the entire combined postcondition, so you can make one of the component postconditions depend on a final value that is defined by another.
So, the postcondition:

y! = e & z! = y'

sets both y and z to the value e, as does the postcondition:

z! = y' & y! = e

since the order of postconditions combined using "&" is immaterial to the meaning.

The frames of postconditions combined with "&" must be disjoint, so:

x! = y & x! = y

is illegal, and:

array[i]! = y & array[j]! = x

is valid subject to i ~= j.

Next:  Combining postconditions sequentially

 

Save My Place Glossary Language Reference Manual
Tutorials Overview Main site   
Copyright © 1997-2012 Escher Technologies Limited. All rights reserved. Information is subject to change without notice.