{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Notes #6

# Notes #6 - Operational Semantics References Kurtz(Ch 8.4...

This preview shows pages 1–5. Sign up to view the full content.

Operational Semantics References: Kurtz (Ch. 8.4, 8.5, 8.6) Many ways to deﬁne o.s.: 1. Deﬁne an interpreter for the language. 2. Deﬁne a compiler for the language, plus an interpreter for the assembly language used. 3. Specify how the state changes as various commands are executed. We will discuss the third approach now. 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Notation for o.s.: h c,σ i → σ 0 h ae,σ i → n ( ae : an arithmetic exp.) h be,σ i → bv ( be : boolean exp.) Examples: h skip i → σ h ( x + 5) i → 10 if σ ( x ) is 5 Notation: σ [ m/X ]: same as σ except value of X is m . σ [ m/X ]( Y ) = m if X Y and σ ( Y ) if X 6≡ Y σ [ m/X ] is also written σ [ X m ]. 2
Semantics is deﬁned inductively: h a 0 i → n 0 , h a 1 i → n 1 h a 0 + a 1 i → n where n is the sum of n 0 and n 1 . (Why not write n 0 + n 1 ?) h a,σ i → m h X := i → σ [ m/X ] h c 0 i → σ 0 , h c 1 0 i → σ 00 h c 0 ; c 1 i → σ 00 Semantics of read? write? 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
h b,σ i → true , h c,σ i → σ 0 , h while b do 0 i → σ 00 h while b do i → σ 00 (Need another rule for the case that h i is false .) This type of sem. is called ‘natural semantics’.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 10

Notes #6 - Operational Semantics References Kurtz(Ch 8.4...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online