• Keine Ergebnisse gefunden

Aufgabe 12.3 (Weakest Preconditions) a) Zeigen Sie folgende ¨Aquivalenz: wp(if bthen c1 else c2 end, p) |==|wp(if ∗ then assume b

N/A
N/A
Protected

Academic year: 2021

Aktie "Aufgabe 12.3 (Weakest Preconditions) a) Zeigen Sie folgende ¨Aquivalenz: wp(if bthen c1 else c2 end, p) |==|wp(if ∗ then assume b"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

WS 2015/2016 26.01.2016 Ubungen zur Vorlesung¨

B¨aume, Ordnungen und Anwendungen Blatt 12

Prof. Dr. Roland Meyer Abgabe bis 02.02.2016 um 14h

Aufgabe 12.1 (Pr¨ufungstermine)

Informieren Sie sich ¨uber m¨ogliche Pr¨ufungstermine, indem Sie die Website zur Vorlesung konsultieren.

Aufgabe 12.2 (Pr¨adikatenabstraktion) Zeigen Sie folgende Aussagen.

a) Bei q1∨q2 handelt es sich tats¨achlich um q1tq2 in Abs(P).

b) Es gilt V

{q∈Abs(P)|b|=q} |==|V

{l∈P∨ ¬P |b|=l} f¨ur beliebigesb.

Aufgabe 12.3 (Weakest Preconditions) a) Zeigen Sie folgende ¨Aquivalenz:

wp(if bthen c1 else c2 end, p)

|==|wp(if ∗ then assume b; c1 else assume ¬b; c2 end, p), wobei

wp(assumeb, p) :=p∨ ¬b

wp(ifb thenc1 else c2 end, p) := (b→wp(c1, p))∧(¬b→wp(c2, p)) wp(if ∗ thenc1 else c2 end, p) := (true→wp(c1, p))∧(true →wp(c2, p)) gilt. Beiif∗handelt es sich um eine nicht-deterministische Auswahl. Diese Transfor- mation ist beim Erzeugen von Gegenbeispielen hilfreich, da man bei jeder bedingten Anweisung erkennen kann, welcher Ausf¨uhrungszweig gew¨ahlt wurde.

b) ¨Ubertragen Sie obiges Prinzip aufwhileSchleifen und geben Sie eine entsprechende Aquivalenz an.¨

c) Berechnen Sie wp(com,false), wobei com definiert ist als:

com≡z:= 0; assumex >0; assumey >0;

assume¬(x >0); assumez= 0; skip;

Aufgabe 12.4 (Control-State-Reachability)

Eine Safety-Eigenschaft oder Invariante eines Programms ist eine Menge Safe ⊆ Prog ×State von Konfigurationen. Man sagt, die Eigenschaft ist erf¨ullt, falls alle erreichbaren Konfigurationen in Safe liegen, anderenfalls ist sie verletzt. Beispiele f¨ur Safety-Eigenschaften sind:

”Es gibt keine Divisionen durch 0“ oder

”Die Variable x ist immer positiv“.

Erkl¨aren Sie, wie man die ¨Uberpr¨ufung von Safety-Eigenschaften eines Programms auf einen Erreichbarkeitscheck f¨ur einen Kontrollzustandcbad reduzieren kann. Machen Sie Ihre Vorgehensweise an einem der obigen Beispiele deutlich.

Abgabe bis 02.02.2016 um 14h im Kasten neben Raum 34-401.4

Referenzen

ÄHNLICHE DOKUMENTE

On read Record: In indicates the M5B of record-type code from data field address mark. On any Write Track: It indicates a Write Protect This bit is reset

Transmissions that are received with correct parity and valid type field are indicated by asserting ACK on the bus during the second time slot after the

of file name display on page - default default is ON, so turns off name display Htext - Define Heading text to appear at the top of each page deliin = for example user Files

(Useful if you lose the link!) For configurations which are not likely to change, replacing the links with wire wrapped connections may provide a higher degree

If no damage is apparent, open the shipping container and remove documentation, mounting hardware, and cables.. Check materials received in option

the Instant-C program, the library source files, a stand-alone version of the Instant-C editor, and screen programs your keyboard for configuring PC have IBM an or compatible, if

Multiple program statements may appear on a single line, if separated by a (:) colon.. When the user types a left-arrow (under-line or RUBOUT on some

If a single protection domain is not established, then any user who does not have an account on a particular remote machine running TRFS can nonetheless access