• Keine Ergebnisse gefunden

Operationale vs. denotationale Semantik

N/A
N/A
Protected

Academic year: 2022

Aktie "Operationale vs. denotationale Semantik"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Korrekte Software: Grundlagen und Methoden Vorlesung 4 vom 24.04.18: Äquivalenz der Operationalen und

Denotationalen Semantik

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

11:50:49 2018-06-05 1 [14]

Fahrplan

I Einführung

I Operationale Semantik I Denotationale Semantik

I Äquivalenz der Operationalen und Denotationalen Semantik I Die Floyd-Hoare-Logik

I Invarianten und die Korrektheit des Floyd-Hoare-Kalküls I Strukturierte Datentypen

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

I Ausblick und Rückblick

Korrekte Software 2 [14]

Operationale vs. denotationale Semantik

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

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

x∈Loc xDom(σ)

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

a1a2

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

n,m6=⊥

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

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

◦ ∈ {+,∗,−}

Korrekte Software 3 [14]

Operationale vs. denotationale Semantik

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

a1/a2

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

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

0}

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

ha1/a2, σi →Aexp

Korrekte Software 4 [14]

Äquivalenz operationale und denotationale Semantik

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

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

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

I Beweis Prinzip?per struktureller Induktion übera. (Warum?)

Korrekte Software 5 [14]

Operationale vs. denotationale Semantik

Operationalhb, σi →Bexp0|1 DenotationalB[[b]]

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

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

Korrekte Software 6 [14]

Operationale vs. denotationale Semantik

Operat.hb, σi →Bexp0|1 DenotationalB[[b]]

a0==a1

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

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

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

{(σ,1)|σ∈Σ, (σ,n0)∈ A[[a0]], (σ,n1)∈ A[[a1]], n0=n1}

{(σ,0)|σ∈Σ, (σ,n0)∈ A[[a0]], (σ,n1)∈ A[[a1]], n06=n1}

a1<=a2 analog

Korrekte Software 7 [14]

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 8 [14]

(2)

Äquivalenz 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 Prinzip?per struktureller Induktion überb(unter Verwendung der Äquivalenz für AExp). (Warum?)

Korrekte Software 9 [14]

Operationale vs. denotationale Semantik

Operational hc, σi →Stmtσ0|⊥

DenotationalC[[c]]

{ } h{}, σi →Stmtσ C[[{ }]] =Id

c1;c2

hc1, σi →Stmtσ06=⊥ hc2, σ0i →Stmtσ00 hc1;c2, σi →Stmtσ00

hc1, σi →Stmt⊥ hc1;c2, σi →Stmt

C[[c2]]◦ C[[c1]]

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

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

{(σ, σ[n/x])|(σ,n)∈ A[[a]]}

Korrekte Software 10 [14]

Operationale vs. denotationale Semantik

Operational hc, σi →Stmtσ0|⊥

DenotationalC[[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)∈ C[[c0]]}

elsec1

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

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

Korrekte Software 11 [14]

Operationale vs. denotationale Semantik

Operational hc, σi →Stmtσ0|⊥

DenotationalC[[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)∈ϕ◦ C[[c]]}

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

Korrekte Software 12 [14]

Äquivalenz operationale und denotationale Semantik

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

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

I ⇒Beweis Prinzip?per Induktion über die Ableitung in der operationalen Semantik (Warum?)

I ⇐Beweis Prinzip?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. (Warum?)

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

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

Korrekte Software 13 [14]

Fahrplan

I Einführung

I Operationale Semantik I Denotationale Semantik

I Äquivalenz der Operationalen und Denotationalen Semantik I Die Floyd-Hoare-Logik

I Invarianten und die Korrektheit des Floyd-Hoare-Kalküls I Strukturierte Datentypen

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

I Ausblick und Rückblick

Korrekte Software 14 [14]

Referenzen

ÄHNLICHE DOKUMENTE

Für die While-Schleife Rückgriff auf Definition des Fixpunkts und Induktion über die Teilmengen Γ i (∅)

Für die While-Schleife Rückgriff auf Definition des Fixpunkts und Induktion über die Teilmengen Γ i (∅)

Korrekte Software: Grundlagen und Methoden Vorlesung 5 vom 04.05.17: Äquivalenz der Operationalen und..

klmem ; Sc llli lervaci ar^' periculiserepu »ciekita exolvioaug voca. III» enim tervire pium, illi vora exolvere urile t&gt;!eminL cerce fraucli suie illi servire illi odeclire!

ober ~öd)ftena in feinem lYriebrid) ~U~elm TI. 3el;}t fommt ea barauf an, jene beiben ffiid)tungen au einer einaigen ~ö~mn au berfd)melaen; alfo baß im beften ~inne beforattbe

ID1an ljat f 0 lange gefragt, maß bn\'S beutfd)e lBntedanb ift, biß bie ®efd)icJ?te barauf eine mntmort gab; man loUte nun einmal fragen, l1)a\'S unb mo bet beutfd)e @eift ift, um

@50 ift aud} eine rein ~iftorifcge, rüdltlärtß geltlenbete 58etrad}tung ber geiftigen l,ßerfönHd}feit 9?emllranbt'ß Itlie feineß ~olfetl 31tlar niel}t u&gt;ert~lotl i aber fie

@50 ift aud} eine rein ~iftorifcge, rüdltlärtß geltlenbete 58etrad}tung ber geiftigen l,ßerfönHd}feit 9?emllranbt'ß Itlie feineß ~olfetl 31tlar niel}t u&gt;ert~lotl i aber fie