|
|
|
|
|
|
|
|
|
|
|
|
“Not a mere matter of programming”:
|
|
|
an
example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• |
Proving
programs correct
|
|
|
has
a 30+ year history
|
|
|
|
– |
Given
a specification (in a
|
|
|
formal
logic) and
|
|
|
|
– |
an implementation
(in a
|
|
|
programming
language),
|
|
|
|
– |
prove
that the
|
|
|
implementation
satisfies the
|
|
specification
|
|
|
• |
This
has often been
|
|
|
considered
to be the key
|
|
|
problem
in software
|
|
|
engineering
|
|
|
|
|
|
|
|
|
|
|
|
{
true }
|
|
|
x: int;
|
|
|
read(x);
|
|
|
if
(mod(x,2) = 1) then
|
|
x := x + 1;
|
|
|
fi
|
|
|
{
even(x) }
|
|
|
|
|
|
|
|
|
|
|