+ All Categories
Home > Documents > C LAUS B RABRAND S EMANTICS (Q1,’06) S EP 21, 2006 C LAUS B RABRAND © 2005--2006, University of...

C LAUS B RABRAND S EMANTICS (Q1,’06) S EP 21, 2006 C LAUS B RABRAND © 2005--2006, University of...

Date post: 22-Dec-2015
Category:
View: 218 times
Download: 0 times
Share this document with a friend
Popular Tags:
54
CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006 CLAUS BRABRAND © 2005--2006, University of Aarhus [ [email protected] ] [ http://www.daimi.au.dk/~brabrand/ ] SEMANTICS (Q1,’06) WEEK 4: STR. IND., DEFINITIONS, STATIC AND DYN. SEM.
Transcript

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

CLAUS BRABRAND

© 2005--2006, University of Aarhus

[ [email protected] ] [ http://www.daimi.au.dk/~brabrand/ ]

SEMANTICS (Q1,’06)

WEEK 4: ”STR. IND., DEFINITIONS, STATIC AND DYN. SEM.”

CLAUS BRABRAND[ 2 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Outline

Competition Results Feedback from T.A.s Structural Induction (and Proof Structure) Comprehensive Structural Induction Example Finite vs. Infinite Stores Functional Languages (Let) Definitions (Let++) Type-Checking Definitions (LetB++)

CLAUS BRABRAND[ 3 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Hand-in 2 Competition

Hand-in 2 Competition:

CLAUS BRABRAND[ 4 ]

SEMANTICS (Q1,’06) SEP 21, 2006

And the winner is...

And the winner is...

1.

3.2.

RikkeBendlin Emil

RennerBerthingJannick

Bitsch(for introduction)

CLAUS BRABRAND[ 5 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Feedback from T.A.s

Live exercises...(!!) Activation (both during + after lecture)

Getting a fish vs. learning to fish... Exercise = Exam Training (really nice to have)

Non-canonical (using your suggestions) 'Improvisation' (depending on feedback in auditorium) Otherwise: ask specific questions on the webboard...

Curriculum...(?) Not unfair that lectures may actually be useful (!!) Exam questions are based on written material Notes + presentation slides + exercises

CLAUS BRABRAND[ 6 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Exam Preliminary Date

October 18, 2006 (Wednesday) 5 ECTS 4 hours All usual materials 13-scale

And yes, there will be at least one exercise onStructural Induction.

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

STRUCTURAL INDUCTION

A Detailed Example:

Determinism of SOS for L-Expressions

CLAUS BRABRAND[ 8 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Structural Induction (for Exp)

Given: Arithmetic Expressions (e Exp)

e ::= n | v | e0+e1

e Exp : P(e)

P(n)

composite (inductive) casebase cases

Principle of structural induction:

P(e0) P(e1) P(e0+e1) P(v) and

CLAUS BRABRAND[ 9 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Intuition: Induction vs. Str’ Induction

Induction: Holds for ?

Structural Induction: Holds for ?

P(0) P(0) => P(1) P(1) => P(2) P(2) => P(3)

P(3)

P(7+(x+y))

P(7)

P(x) P(y)

P(x+y)

P(7+(x+y))

CLAUS BRABRAND[ 10 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Structural Induction Examples

Given: Arithmetic Expressions (e Exp)

Determinism of SOS* for L-expressions : “One-step evaluation of expressions is deterministic”

e ::= n | v | e0+e1

P(e) ,’: [ ( |_ e |_ e ’ ) => = ’ ]

e: P(e)

*/ using the (side-effectless) small-step operational semantics

Let be given: Prove: (i.e., “prove property, P, holds for all expressions”)

CLAUS BRABRAND[ 11 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Proof Structure (according to SI)

Base cases: Case [n]; show :

Case [v]; show :

Inductive case: Case [e0+e1]; show :

assume induction hypothesis [lhs]: P(e0) P(e1)

show inductive step [rhs]: P(e0+e1)

P(n) ,’: ( |_ n |_ n ’ ) => = ’

P(v) ,’: ( |_ v |_ v ’ ) => = ’

P(e0) ,’: ( |_ e0 |_ e0 ’ ) => = ’

P(e1) ,’: ( |_ e1 |_ e1 ’ ) => = ’

P(e0+e1) ,’: ( |_ e0+e1 |_ e0+e1 ’ ) => = ’

P(n)

P(v)

P(e0) P(e1) => P(e0+e1)

CLAUS BRABRAND[ 12 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Proof: Base Case [n] Case [n]; show :

Show implication “=>” (assume [lhs], show [rhs]): However, since [lhs] is trivially false (no rules for constants), the whole

thing is trivially true (aka. “vacuously true”) Recall that: [explanation]

P(n) ,’: ( |_ n |_ n ’ ) => = ’

P(n)

b : (false => b) true

P Q P Q

P Q P Q

false false true

false true true

true false false

true true true

CLAUS BRABRAND[ 13 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Proof: Base Case [v] Case [v]; show :

Show implication “=>” (assume [lhs], show [rhs]): assume [lhs]: and for some ,’ show [rhs]:

could only be because ; thus, = (v) …and similarly:

could only be because ; thus, ’ = (v)

Thus, we have that: = (v) = ’ (as required)

P(v) ,’: ( |_ v |_ v ’ ) => = ’

P(v)

|_ v

= ’

|_ v ’

|_ v |_ v (v)

|_ v ’ |_ v (v)

CLAUS BRABRAND[ 14 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Proof: Inductive Case [e0+e1]

Case [e0+e1]; show : assume induction hypothesis: P(e0) P(e1)

show inductive step: P(e0+e1)

Show implication “=>” (assume [lhs], show [rhs]): Assume [lhs]: and for some ,’ Show [rhs]:

When could we have that: (?) Case Analysis (on e0+e1)

Three possibilities ( [SUM1], [SUM2], and [SUM3] )…

P(e0) ,’: ( |_ e0 |_ e0 ’ ) => = ’

P(e1) ,’: ( |_ e1 |_ e1 ’ ) => = ’

P(e0+e1) ,’: ( |_ e0+e1 |_ e0+e1 ’ ) => = ’

P(e0) P(e1) => P(e0+e1)

|_ e0+e1 |_ e0+e1 ’

= ’

|_ e0+e1

CLAUS BRABRAND[ 15 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Proof: Case Analysis (on e0+e1)

Case Analysis (on e0+e1):

Case [SUM1 (e0 Z)]: could only be because could only be because

But from our induction hypothesis, P(e0); i.e. … :

… we get that: and implies that: e0’ = e0”

Thus we have that: = e0’+e1 = e0”+e1 = ’ (as required)

|_ e0+e1

|_ e0 e0’

|_ e0+e1 e0’+e1 =

|_ e0 e0”

|_ e0+e1 e0”+e1 = ’

|_ e0+e1 ’

|_ e0 e0’ |_ e0 e0”

P(e0) ,’: ( |_ e0 |_ e0 ’ ) => = ’

CLAUS BRABRAND[ 16 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Proof: Case Analysis (on e0+e1)

Case [SUM2 (e0 Z , e1 Z)]: (analoguous)

Case [SUM3 (e0 Z , e1 Z)]: could only be because could only be because

Thus, we have that: = m = n0+n1 = m’ = ’ (as required)

|_ n0+n1

|_ n0+n1 ’

|_ e0+e1 m =

|_ e0+e1 m’ = ’

m = n0+n1

m’ = n0+n1

CLAUS BRABRAND[ 17 ]

SEMANTICS (Q1,’06) SEP 21, 2006

What did we do: Proof Structure

Base cases: Case [n]; showed :

Case [v]; showed :

Inductive case: Case [e0+e1]; showed :

assumed induction hypothesis [lhs]: P(e0) P(e1)

showed inductive step [rhs] via case analysis: P(e0+e1)

P(n) ,’: ( |_ n |_ n ’ ) => = ’

P(v) ,’: ( |_ v |_ v ’ ) => = ’

P(e0) ,’: ( |_ e0 |_ e0 ’ ) => = ’

P(e1) ,’: ( |_ e1 |_ e1 ’ ) => = ’

P(e0+e1) ,’: ( |_ e0+e1 |_ e0+e1 ’ ) => = ’

P(n)

P(v)

P(e0) P(e1) => P(e0+e1)

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

INFINITE vs. FINITE STORES

CLAUS BRABRAND[ 19 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Problem: Infinite Stores

Problem: (Var infinite)

Solution: (for V FIN Var)

Now define finite configurations:

Store = Var Z

v StoreV = V Z

V,E := { <e, > | VarE(e) V StoreV }

appropriate storeall vars in “V”

CLAUS BRABRAND[ 20 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Finite Typeable Configurations

Configurations (Exp):

Transitions (using “V,E”):

Configurations (Com):

Transitions (using “V,C”):

V.C := { <c, > | VarC(c) V StoreV |_

wfc c }

V,E := { <e, > | VarE(e) V StoreV : |_ e: }

< e0 + e1 , > V,E < e0’ + e1 , ’ >

< e0 , > V,E < e0’ , ’ >[SUM1]

< c0 ; c1 , > V,C < c0’ ; c1 , ’ >

< c0 , > V,C < c0’ , ’ >[SEQ1]

{ | StoreV }

CLAUS BRABRAND[ 21 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Variable Extraction Functions

VarE: Exp P(Var) VarE(n) = Ø

VarE(t) = Ø

VarE(v) = { v }

VarE(~ e) = VarE(e)

VarE(e e’) = VarE(e) VarE(e’)

VarC: Com P(Var) VarC(nil) = Ø

VarC(x := e) = { x } VarE(e)

VarC(c ; c’) = VarC(c) VarC(c’)

VarC(if e then c else c’) = VarE(e) VarC(c) VarC(c’)

VarC(while e do c) = VarE(e) VarC(c)

e ::= n | v | ~ e | e e’

c ::= nil | v := e | c ; c’ | if b then c else c’ | while b do c

CLAUS BRABRAND[ 22 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Finite Typeable Configurations

Configurations (Exp):

Transitions (using “V,E”):

Configurations (Com):

Transitions (using “V,C”):

V.C := { <c, > | VarC(c) V StoreV |_

wfc c }

V,E := { <e, > | VarE(e) V StoreV : |_ e: }

< e0 + e1 , > V,E < e0’ + e1 , ’ >

< e0 , > V,E < e0’ , ’ >[SUM1]

< c0 ; c1 , > V,C < c0’ ; c1 , ’ >

< c0 , > V,C < c0’ , ’ >[SEQ1]

{ | StoreV }

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

DEFINITIONS (FUNCTIONAL LANGs)

CLAUS BRABRAND[ 24 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Introducing Binding Constructs

Consider the language ”Let”:

Expressions (e Exp):

Example Let program:

Note: the actual identifier names are irrellevant (only the use-def links are significant)

e ::= n | x | e e’ | let x = e in e’

{ +, -, * }…where:

x + let x = 5 in x + let x = 1 + x in x * x

Definition (def) Usage (use): Free use Bound use

use-def linkTerminology

definition scope for 'x'

CLAUS BRABRAND[ 25 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Free Variables

Determine the free variables?

FV: Exp P(Var) FV(n) = Ø FV(x) = { x } FV(e e’) = FV(e) FV(e’) FV(let x=e in e’) = FV(e) ( FV(e’) \ { x } )

e ::= n | x | e e’ | let x = e in e'

CLAUS BRABRAND[ 26 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Semantics (Trans. Sys.)

Define (family of) environments: recall terminology (no side-effects)

Configurations: i.e., numbers

Transition relation: ; writing for

V = { <e, > | EnvV FV(e) V }

TV = { <z, > | EnvV z Z }

v EnvV = V Z

Note: this is done slightly differently in the note [SOS]:through “relative transition systems” that are (implicitly) relative to an environment.

V V V |- e V e (<e,>,<e,>) ‘V’

CLAUS BRABRAND[ 27 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Semantics [n] | [x] | [ee]

Structural Operational Semantics:

[BOP1]

[BOP2]

[BOP3]

[VAR]

|- e0 e1 V e0’ e1

|- e0 V e0’

|- z0 z1 V zz = z0 z1

|- z0 e1 V z0 e1’

|- e1 V e1’

|- x V zz = (x)

EnvV = V Z

CLAUS BRABRAND[ 28 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Semantics [let-in]

Structural Operational Semantics:

Note: the premisis works in the extended environment

Live exercise: eval in env:

[LET2]

[LET3]

[LET1]

|- let x = e0 in e1 V let x = e0’ in e1

|- e0 V e0’

|- let x = z in n V n

|- let x = z in e1 V let x = z in e1’

[xz] |- e1 V{x} e1’

let x=y in x [y7]

EnvV = V Z

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

COMPOUND DEFINITIONS

CLAUS BRABRAND[ 30 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Compound Definitions

Consider language Let++: Expressions (e Exp):

Definitions (d Def):

e ::= n | x | e e’ | let d in e

d ::= nil | x = e | d ; d’ | d and d’ | d in d’

x + 3 y = x+7Graphically:

Val Env{x} Env{y}

[x1]

Env{x}

[x1] [y8]4

{ +, -, * }…where:

CLAUS BRABRAND[ 31 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Graphically: [x = e] | [d ; d’]

Definition block:

E.g.:

Sequential definition:

E.g.:

let d in e

d0 ; d1

let x=a ; y=bin b * c + y

a

b

c

x

ybc

<< exercise >>

CLAUS BRABRAND[ 32 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Graphically: [d and d’] | [d in d’]

Simultaneous definition:

E.g.:

Private definition:

E.g.:

d0 and d1

d0 in d1

<< exercise >>

<< exercise >>

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

COMPOUND DEFINITIONS

Semantics of Let++

CLAUS BRABRAND[ 34 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Static Semantics: Let++

Problem: I.e. non-disjoint simultaneous definitions!

Solution: static semantics def / exp “well-formedness relations”: ‘|-wfd’ / ‘|-wfe’:

let x = 1 and x = 2 in x

|_wfe e |_

wfe e’

|_wfe e e’

Exp well-formedness:

|_wfe n

|_wfe x

|_wfd d |_

wfe e

|_wfe let d in e

Definition well-formedness:|_wfd nil

|_wfe e

|_wfd x = e

|_wfd d |_

wfd d’

|_wfd d ; d’

|_wfd d |_

wfd d’

|_wfd d and d’

|_wfd d |_

wfd d’

|_wfd d in d’

DV(d) DV(d’) = Ø

CLAUS BRABRAND[ 35 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Recall: Free Variables for Let

Let: FV(n) = Ø FV(x) = { x } FV(e e’) = FV(e) FV(e’)

FV(let x=e in e’) = FV(e) ( FV(e’) \ { x } )

Let++: FV(let d in e’) = FV(d) ( FV(e’) \ DV(d) )

So we need FV(d) and DV(d) …

CLAUS BRABRAND[ 36 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Defining Variables and Free Variables

DV: Def P(Var) DV(nil) = Ø DV(x = e) = { x } DV(d ; d’) = DV(d) DV(d’) DV(d and d’) = DV(d) DV(d’) DV(d in d’) = DV(d’)

FV: Def P(Var) FV(nil) = Ø FV(x = e) = FV(e) FV(d ; d’) = FV(d) ( FV(d’) \ DV(d) ) FV(d and d’) = FV(d) FV(d’) FV(d in d’) = FV(d) ( FV(d’) \ DV(d) )

+ should be disjoint union

d ::= nil | x = e | d ; d’ | d and d’ | d in d’

d ::= nil | x = e | d ; d’ | d and d’ | d in d’

CLAUS BRABRAND[ 37 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Semantics

Expression Configurations:

Problem: what should definitions evaluate to? Environments (like expressions evaluate to numbers)

Solution: “environments as results” (add intermediate syntax):

Definition Configurations:

V,E = { <e, > | EnvV FV(e) V |-wfe e }

TV,E = { <z, > | EnvV z Z }only well-formed exps

d ::= nil | x = e | d ; d’ | d and d’ | d in d’ | 0

V,D = { <d, > | EnvV FV(d) V |-wfd d }

TV,D = { <0, > | EnvV }only well-formed defs

CLAUS BRABRAND[ 38 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Semantics: Exp

Structural Operational Semantics:

Note: the premisis works in the 0-extended environment

[LET2]E

[LET3]E

[LET1]E

EnvV = V Z

|- let d in e V let d’ in e

|- d V d’

|- let 0 in n V n

|- let 0 in e V let 0 in e’

[0] |- e VDV(0) e’

CLAUS BRABRAND[ 39 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Sem.: Def [nil] | [x=e]

Structural Operational Semantics:

[NIL]D

|- nil V [] the empty environment, []

[DEF1]D |- x = e V x = e’

|- e V e’

[DEF2]D |- x = n V [xn] the environment, [xn]

EnvV = V Z

CLAUS BRABRAND[ 40 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Sem.: Def [d;d’]

Structural Operational Semantics:

Note: the premisis works in the 0-extended environment

Note: the result is the combined environment, 0[1]

[SEQ2]D

[SEQ3]D

[SEQ1]D

|- d0 ; d1 V d0’ ; d1

|- d0 V d0’

|- 0 ; 1 V 0[1]

|- 0 ; d1 V 0 ; d1’

[0] |- d1 VDV(0) d1’

EnvV = V Z

Live exercise: evaluate in environment:x = 2 ; x = x+y [ y = 1]

CLAUS BRABRAND[ 41 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Sem.: Def [d and d’]

Structural Operational Semantics:

Notice the independence of the two operands (d0 & d1)

Note: the result is the disj. combined environment, 01

[AND2]D

[AND3]D

[AND1]D

|- d0 and d1 V d0’ and d1

|- d0 V d0’

|- 0 and 1 V 01

|- 0 and d1 V 0 and d1’

|- d1 V d1’

EnvV = V Z

Q: what happens if operands do not contain disjoint definitions (e.g. "x=1 and x=2")A: trans. sys. was only def'd for well-formed exps/defs! Hence, no such runtime errors!

CLAUS BRABRAND[ 42 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Sem.: Def [d in d’]

Structural Operational Semantics:

Note: the premisis works in the 0-extended environment

Note: the result is only the last environment, 1

[IN2]D

[IN3]D

[IN1]D

|- d0 in d1 V d0’ in d1

|- d0 V d0’

|- 0 in 1 V 1

|- 0 in d1 V 0 in d1’

[0] |- d1 VDV(0) d1’

EnvV = V Z

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

TYPE CHECKING DEFINITIONS

CLAUS BRABRAND[ 44 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Adding Boolean Variables: LetB++

Consider language LetB++: Mixed Expressions (e Exp):

Definitions (d Def):

Note: The type of a var is now context dependent I.e. a context-free (grammar) approach will not suffice

Examples: ? ? …

e ::= n | t | x | ~ e | e e’ | e ? e’ : e” | let d in e

d ::= nil | x = e | d ; d’ | d and d’ | d in d’

{ +, -, * , =, or }…where:

x or tt x * x

type definition (annotation) { bool, int }…where:

CLAUS BRABRAND[ 45 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Static Semantics: LetB++

FVE, DVD and FVD as before …adding:

We now need type environments: Type = { bool, int }

Define static semantics (type checking rel’s): “e has type (given type environment )”

provided

“d yields type env. (given type env. )” provided

FVE(e ? e’: e”) = FVE(e) FVE(e’) FVE(e”)

TEnvV = V Type

|-V e :

|-V d :

FVE(e) V

FVD(d) V

CLAUS BRABRAND[ 46 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Static Semantics (expressions)

Expressions:[NUM]E |-V

n : int |-V t : bool[TVL]E

[VAR]E |-V x : (x)

[VAR]E |-V ~ e : bool

|-V e : bool[LET]E |-V let d in e :

|-V d : [] |-VDV{} e :

[IFE]E |-V e0 ? e1 : e2 :

|-V e0 : bool |-V e1 : 1 |-V e2 : 2 = 1 =2

[BOP]E |-V e0 e1 : type(0,1)

|-V e0 : 0 |-V e1 : 1

CLAUS BRABRAND[ 47 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Static Semantics (definitions)

Definitions:[NIL]D |-V

nil : [] [DEF]D |-V x = e : [x]

|-V e : ’ = ’

[SEQ]D |-V d0 ; d1 : 0[1]

|-V d0 : 0 [0] |-VDV{0} d1 : 1

[AND]D |-V d0 and d1 : 01

|-V d0 : 0 |-V d1 : 1

[IN]D |-V d0 in d1 : 1

|-V d0 : 0 [0] |-VDV{0} d1 : 1

DV(d0) DV(d1) = Ø

Note:combined environment

Note:only last environment

Note:disjointenvironment

Note: type check

CLAUS BRABRAND[ 48 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Dynamic Semantics: LetB++

Type Environment (Compile-time): Type = { bool, int }

Environment (Runtime): Val = B Z, B = { tt, ff }

Define type correspondence relation ‘~’:

Note:

v TEnvV = V Type

v EnvV = V Val

v ~ v x V: v(x) = bool v(x) B v(x) = int v(x) Z

( 0 ~ 0 1 ~ 1 ) 0[1] ~ 0[1]

CLAUS BRABRAND[ 49 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Exp. Transition System for LetB++

Let++ Expression Configurations:

LetB++ Expression Configurations: V Type:

Env := i.e., “only type corresponding runtime environments”

V = { <e, > | EnvV FV(e) V |-wfe e }

TV = { <z, > | EnvV z Z } only well-formed exps

= { <e, > | Env FV(e) V : |-V e : }

T = { <r, > | Env r B Z }

{ ( V B Z ) | ~ }

CLAUS BRABRAND[ 50 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Def. Transition System for LetB++

Let++ Definition Configurations:

LetB++ Definition Configurations: V Type:

Env := i.e., “only type corresponding runtime environments”

V = { <d, > | EnvV FV(d) V |-wfd d }

only well-formed defsTV = { <0, ’> | EnvV }

= { <d, > | Env FV(d) V : |-V d : }

T = { <0, > | Env }

{ ( V B Z ) | ~ }

CLAUS BRABRAND[ 51 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Exp. Dynamic Semantics: LetB++

SOS of Expressions for LetB++: E.g. [LET]:

- Basically substituting for V (from dyn. sem. of Let++)

[LET2]

[LET3]

[LET1]

Env

|- let d in e let d’ in e

|- d d’

|- let 0 in r r

|- let 0 in e let 0 in e’

[0] |- e [0] e’ 0 ~ 0

CLAUS BRABRAND[ 52 ]

SEMANTICS (Q1,’06) SEP 21, 2006

Def. Dynamic Semantics: LetB++

SOS of Definitions for LetB++: E.g [SEQ]:

- Again, basically substituting for V (from dyn. sem. of Let++)

[SEQ2]

[SEQ3]

[SEQ1]

|- d0 ; d1 d0’ ; d1

|- d0 d0’

|- 0 ; 1 0[1]

|- 0 ; d1 0 ; d1’

[0] |- d1 [0] d1’

Env

0 ~ 0

CLAUS BRABRAND[ 53 ]

SEMANTICS (Q1,’06) SEP 21, 2006

"Three minutes paper"

Please spend three minutes writing down the most important things that you have learned today (now).

After 1 dayAfter 1 week

After 3 weeksAfter 2 weeks

Immediately

CLAUS BRABRAND SEMANTICS (Q1,’06) SEP 21, 2006

Next week (CCS): Concurrency and Communication

Any Questions?


Recommended