Thread View: comp.specification
5 messages
5 total messages
Started by Gary Leavens
Wed, 27 Jun 1990 15:14
Proof rules for angelic choice?
Author: Gary Leavens
Date: Wed, 27 Jun 1990 15:14
Date: Wed, 27 Jun 1990 15:14
32 lines
1503 bytes
1503 bytes
Has anyone written a relatively complete Hoare-style proof rule for the angelic choice construct? (See Broy's article in TCS, Vol. 45, Number 1, 1986.) The idea is that E1 -ac- E2 executes either E1 or E2, but will angelically choose the one that terminates if there one. This is like running both E1 and E2 in parallel, and picking the result of the first to terminate. For example, (print 3) -ac- (loop-forever) will print 3, and (print 3) -ac- (print-or-loop-forever 4) may print either 3 or 4, but will not loop forever. The obvious proof rule is that the desired post-condition has to follow from the desired pre-condition for both E1 and E2. But such a rule is incomplete if one is reasoning about total-correctness, as one cannot, for example, prove that the expression (print 3) -ac- (loop-forever) will print 3. Has anyone done better? Gary Leavens P.S. I realize that this is more of a verification question, as opposed to a specification question. But there's no comp.verification :-). -- 229 Atanasoff Hall, Department of Computer Science Iowa State University, Ames, Iowa 50011-1040, USA phone: (515) 294-1580
Re: Proof rules for angelic choice?
Author: Brendan Mahony
Date: Thu, 28 Jun 1990 02:11
Date: Thu, 28 Jun 1990 02:11
63 lines
2571 bytes
2571 bytes
leavens@cs.iastate.edu (Gary Leavens) writes:
>Has anyone written a relatively complete Hoare-style proof
>rule for the angelic choice construct?
>(See Broy's article in TCS, Vol. 45, Number 1, 1986.)
>The idea is that
> E1 -ac- E2
>executes either E1 or E2, but will angelically choose
>the one that terminates if there one.
>This is like running both E1 and E2
>in parallel, and picking the result of the first
>to terminate. For example,
> (print 3) -ac- (loop-forever)
>will print 3, and
> (print 3) -ac- (print-or-loop-forever 4)
>may print either 3 or 4, but will not loop forever.
Weakest pre-condition semantics.
wp(E1 -ac- E2, P) = wp(E1,P) or wp(E1,P)
Hoare-style
{Q}E1{P} or {Q}E2{P}
--------------------
{Q}(E1 -ac- E2){P}
This operator is usually termed "or". It is not the same as running in
parallel, but rather can be liken to backtracking.
For more information I suggest you read:
@techreport{Back:RefCal,
Author = "R. J. R. Back and J. {von Wright}",
title = "Refinement Calculus, Part {I}: Sequential Nondeterministic Programs",
institution = {Institute f\"{o}r
Informationsbehandling, Lemmink\"{a}inengatan},
type = {Technical Report},
number = {Ser. A, No 92},
year = 1989
}
>The obvious proof rule is that the desired post-condition
>has to follow from the desired pre-condition for both
>E1 and E2. But such a rule is incomplete if one
>is reasoning about total-correctness, as one cannot,
>for example, prove that the expression
> (print 3) -ac- (loop-forever)
>will print 3. Has anyone done better?
wp((print 3) -ac- (loop-forever), output = 3)
= wp((print 3), output = 3) or wp((loop-forever), output = 3)
= true or false
= true
Getting a semantics for an operator that correspond to running the
programs in parallel is a bit harder.
--
Brendan Mahony | brendan@batserver.cs.uq.oz |
Department of Computer Science |
University of Queensland |
Australia |
Re: Proof rules for angelic choice?
Author: J{rvinen Hannu-Matti
Date: Thu, 28 Jun 1990 06:40
Date: Thu, 28 Jun 1990 06:40
32 lines
1710 bytes
1710 bytes
In article <4106@uqcspe.cs.uq.oz.au> brendan@batserver.cs.uq.oz.au writes:
>leavens@cs.iastate.edu (Gary Leavens) writes:
>For more information I suggest you read:
>
>@techreport{Back:RefCal,
> Author = "R. J. R. Back and J. {von Wright}",
> title = "Refinement Calculus, Part {I}: Sequential Nondeterministic Programs",
> institution = {Institute f\"{o}r
> Informationsbehandling, Lemmink\"{a}inengatan},
> type = {Technical Report},
> number = {Ser. A, No 92},
> year = 1989
>}
The Institution line is not complete, and seems to be in Swedish
(although in Finland, Swedish is used in Abo Akademi). The
complete English version is:
Abo Akademi University,
Department of Computer Science,
Lemmink{inengatan 14,
20520 Abo,
Finland
({ is a with two dots, i.e., a diaresis or "umlaut a")
You may also be interested in the second part:
R. J. R. Back, Refinement Calculus, Part II, Parallel and Reactive Programs
-----
Hannu-Matti Jarvinen, hmj@tut.fi
Opinions of tut != opinions of mine, and vice versa.
TTKK on samaa mielt{ kanssani siit{, ett{ en edusta sen mielipidett{.
Re: Proof rules for angelic choice?
Author: Arshad Mahmood
Date: Sat, 30 Jun 1990 10:11
Date: Sat, 30 Jun 1990 10:11
33 lines
1431 bytes
1431 bytes
Sorry for wasting bandwidth with this extension to my earlier message.
>Hoare-style
>
> {Q}E1{P} or {Q}E2{P}
> --------------------
> {Q}(E1 -ac- E2){P}
I think you mean
{Q}E1{P} {Q}E2{P}
-------------------
{Q}(E1 -ac- E2){P}
The rule as given has silly behaviours like {Q}((x := 3) -ac- (x:=4)){x=3}
is valid, and of course {Q}((x:=3) -ac- (loop)){ANYTHING} is valid since
a looping program vacously satisfies any post-condition.
> wp((print 3) -ac- (loop-forever), output = 3)
> = wp((print 3), output = 3) or wp((loop-forever), output = 3)
> = true or false
> = true
This tableau is not quite correct, the reason is as given above the looping
part of it will be vacously true.
>Brendan Mahony
A. Mahmood
LFCS
Edinburgh University
Scotland
---------------------------------
Re: Proof rules for angelic choice?
Author: Brendan Mahony
Date: Wed, 04 Jul 1990 04:48
Date: Wed, 04 Jul 1990 04:48
25 lines
1555 bytes
1555 bytes
arshad@lfcs.ed.ac.uk (Arshad Mahmood) writes:
>The rule as given has silly behaviours like {Q}((x := 3) -ac- (x:=4)){x=3}
>is valid, and of course {Q}((x:=3) -ac- (loop)){ANYTHING} is valid since
>a looping program vacously satisfies any post-condition.
>> wp((print 3) -ac- (loop-forever), output = 3)
>> = wp((print 3), output = 3) or wp((loop-forever), output = 3)
>> = true or false
>> = true
>This tableau is not quite correct, the reason is as given above the looping
>part of it will be vacuously true.
Actually the term is miraculous behaviour. My semantics of loop would be
wp(loop,R) = false, for all predicates R
that is loop never terminates, and vacuously fails any post-condition.
The tableau is correct and is not vacuous.
--
Brendan Mahony | brendan@batserver.cs.uq.oz |
Department of Computer Science |
University of Queensland |
Australia |
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads