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

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

View Full Document Right Arrow Icon
Operational Semantics References: Kurtz (Ch. 8.4, 8.5, 8.6) Many ways to define o.s.: 1. Define an interpreter for the language. 2. Define 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
Semantics is defined 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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’.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/10/2008 for the course CSE 755 taught by Professor Neelamsoundarajan during the Winter '05 term at Ohio State.

Page1 / 10

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online