• Keine Ergebnisse gefunden

denotationale Semantik

N/A
N/A
Protected

Academic year: 2022

Aktie "denotationale Semantik"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Korrekte Software: Grundlagen und Methoden Vorlesung 5 vom 2.05.16: Äquivalenz operationale und

denotationale Semantik

Serge Autexier, Christoph Lüth Universität Bremen Sommersemester 2016

18:10:58 2016-07-07 1 [12]

Operationale vs. denotationale Semantik

Operationalha, σi →Aexpn DenotationalE[[a]]

m∈N hm, σi →Aexpm {(σ,m)|σ∈Σ}

x∈Loc xDom(σ)

hx, σi →Aexpσ(x) {(σ, σ(x))|σ∈Σ,xDom(σ)}

a1a2

ha1, σi →Aexpn ha2, σi →Aexpm

n,m6=⊥

ha1a2, σi →AexpnIm {(σ,nIm)|σ∈Σ,(σ,n)∈ E[[a1]],(σ,m)∈ E[[a2]]}

ha1, σi →Aexpn ha2, σi →Aexpm n=⊥oderm=⊥ ha1a2, σi →Aexp

◦ ∈ {+,×,−}

Korrekte Software 2 [12]

Operationale vs. denotationale Semantik

Operationalha, σi →Aexpn DenotationalE[[a]]

a1/a2

ha1, σi →Aexpn ha2, σi →Aexpm m6= 0 m,n6=⊥

ha1a2, σi →AexpnIm {(σ,n/m)|σ∈Σ,(σ,n)∈ E[[a1]],(σ,m)∈ E[[a2]],m6=

0}

ha1, σi →Aexpn ha2, σi →Aexpm n=⊥,m=⊥oderm= 0

ha1/a2, σi →Aexp

Korrekte Software 3 [12]

Equivalenz operationale und denotationale Semantik

I Für alleaAexp, für allenN, für alle Zuständeσ:

ha, σi →Aexpn⇔(σ,n)∈ E[[a]]

ha, σi →Aexp⊥ ⇔σ6∈Dom(E[[a]])

I Beweis per struktureller Induktion übera.

Korrekte Software 4 [12]

Operationale vs. denotationale Semantik

Operationalha, σi →Bexpb DenotationalB[[b]]

1 h1, σi →Bexp1 {(σ,1)|σ∈Σ}

0 h0, σi →Bexp0 {(σ,0)|σ∈Σ}

Korrekte Software 5 [12]

Operationale vs. denotationale Semantik

Operationalha, σi →Bexpb DenotationalB[[b]]

a0==a1

ha0, σi →Aexpn ha1, σi →Aexpm n,m6=⊥ n=m ha0==a1, σi →Aexp1

ha0, σi →Aexpn ha1, σi →Aexpm n,m6=⊥ n6=m ha0==a1, σi →Aexp0

{(σ,1)|σ∈Σ,(σ,n0)∈ E[[a0]](σ),(σ,n1)∈

E[[a1]],n0=n1} ∪ {(σ,0)|σ∈Σ,(σ,n0)∈

E[[a0]](σ),(σ,n1)∈ E[[a1]],n06=n1} ha0, σi →Aexpn

ha1, σi →Aexpm n=⊥oderm=⊥ ha0==a1, σi →Aexp

<= analog

Korrekte Software 6 [12]

Operationale vs. denotationale Semantik

Operationalha, σi →Bexpb DenotationalB[[b]]

b1&&b0

hb1, σi →Bexp0

hb1&&b2, σi →0 {(σ,0)|(σ,0)∈ B[[b1]]}

hb1, σi →Bexp1 hb2, σi →Bexpb

hb1&&b2, σi →b {(σ,b)|(σ,1)∈ B[[b1]],(σ,b)∈ B[[b2]]}

hb1, σi →Bexp⊥ hb1&&b2, σi → ⊥

b1||b2 analog

!n . . .

Korrekte Software 7 [12]

Equivalenz operationale und denotationale Semantik

I Für allebBexp, für alletB, for alle Zuständeσ:

hb, σi →Bexpt⇔(σ,t)∈ B[[b]]

hb, σi →Bexp⊥ ⇔σ6∈Dom(B[[b]])

I Beweis per struktureller Induktion überb(unter Verwendung der Äquivalenz für AExp).

Korrekte Software 8 [12]

(2)

Operationale vs. denotationale Semantik

Operationalha, σi →Stmtc DenotationalD[[c]]

{c1. . .cn}

hc1, σi →Stmtσ006=⊥ h{c2. . .cn}, σ0i →Stmtσ00 h{c1. . .cn}, σi →Stmtσ00

hc1, σi →Stmt⊥ h{c1. . .cn}, σi →Stmt

B[[cn]]◦. . .B[[c1]]◦Id

x=a ha, σi →Aexpn hx=a, σi →Stmtσ[n/x]

ha, σi →Aexp⊥ hx=a, σi →Stmt

{(σ, σ[n/X])|(σ,n)∈ E[[a]]}

Korrekte Software 9 [12]

Operationale vs. denotationale Semantik

Operationalha, σi →Stmtc DenotationalD[[c]]

if (b)c0

hb, σi →Bexp1 hc0, σi →Stmtσ0

hc, σi →Stmtσ0 hb, σi →Bexp⊥ hc, σi →Stmt

{(σ, σ0)|(σ,1)∈ B[[b]],(σ, σ0)∈ D[[c0]]}

elsec1

hb, σi →Bexp0 hc1, σi →Stmtσ0

hc, σi →Stmtσ0 {(σ, σ0)|(σ,0)∈ B[[b]],(σ, σ0)∈ D[[c1]]}

Korrekte Software 10 [12]

Operationale vs. denotationale Semantik

Operationalhc,Σi →StmtΣ|⊥ DenotationalD[[c]]

while(b)c

| {z }

w

hb, σi →Bexp0 hw, σi →Stmtσ

hb, σi →Bexp⊥ hw, σi →Stmt

hb, σi →Bexp1 hc, σi →Stmtσ06=⊥ hw, σ0i →Stmtσ00 hw, σi →Stmtσ00

fix(Γ)

hb, σi →Bexp1 hc, σi →Stmt⊥ hw, σi →Stmt⊥ mit

Γ(ϕ) = {(σ, σ0)|(σ,1)∈ B[[b]],(σ, σ0)∈ϕ◦ D[[c]]}

∪{(σ, σ)|(σ,0)∈ B[[b]]}

Korrekte Software 11 [12]

Equivalenz operationale und denotationale Semantik

I Für allecStmt, für alle Zuständeσ, σ0: hc, σi →Stmtσ0⇔(σ, σ0)∈ D[[c]]

hc, σi →Stmt⊥ ⇒σ6∈Dom(D[[c]])

I ⇒Beweis per Induktion über die Ableitung in der operationalen Semantik

I ⇐Beweis per struktureller Induktion überc(Verwendung der Äquivalenz für arithmetische und boolsche Ausdrücke). Für die While-Schleife Rückgriff auf Definition des Fixpunkts und Induktion über die Teilmengen Γi(∅) des Fixpunkts.

IGegenbeispiel für⇐in der zweiten Aussage: wählecwhile(1){}:

D[[c]] =∅aberhc, σi →Stmt⊥gilt nicht (sondern?).

Korrekte Software 12 [12]

Referenzen

ÄHNLICHE DOKUMENTE

Zu zeigen ist, dass sowohl w also auch if (b) {c; w} else { } zu dem selben Programmzustand auswerten oder beide zu

Korrekte Software: Grundlagen und Methoden Vorlesung 3 vom 17.04.18: Denotationale Semantik.. Serge Autexier,

[r]

I Modellierung und Spezifikation I Verifikationsbedingungen I Vorwärts mit Floyd und Hoare I Funktionen und Prozeduren I Referenzen. I Ausblick

sie die gleichen

Korrekte Software: Grundlagen und Methoden Vorlesung 4 vom 24.04.17: Denotationale Semantik.. Serge Autexier,

[r]

Vorlesung 5 vom 04.05.17: Äquivalenz der Operationalen und Denotationalen Semantik. Serge Autexier,