Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Σχετικά έγγραφα
ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

2 Composition. Invertible Mappings

C.S. 430 Assignment 6, Sample Solutions

The Simply Typed Lambda Calculus

Lecture 2. Soundness and completeness of propositional logic

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

4.6 Autoregressive Moving Average Model ARMA(1,1)

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Chap. 6 Pushdown Automata

Finite Field Problems: Solutions

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Section 8.3 Trigonometric Equations

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

Statistical Inference I Locally most powerful tests

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Models for Probabilistic Programs with an Adversary

Fractional Colorings and Zykov Products of graphs

Homework 3 Solutions

Inverse trigonometric functions & General Solution of Trigonometric Equations

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Homomorphism in Intuitionistic Fuzzy Automata

Sequent Calculi for the Modal µ-calculus over S5. Luca Alberucci, University of Berne. Logic Colloquium Berne, July 4th 2008

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

Matrices and Determinants

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

Approximation of distance between locations on earth given by latitude and longitude

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

ST5224: Advanced Statistical Theory II

Math221: HW# 1 solutions

5. Choice under Uncertainty

w o = R 1 p. (1) R = p =. = 1

Section 7.6 Double and Half Angle Formulas

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

Other Test Constructions: Likelihood Ratio & Bayes Tests

Areas and Lengths in Polar Coordinates

Areas and Lengths in Polar Coordinates

LTL to Buchi. Overview. Buchi Model Checking LTL Translating LTL into Buchi. Ralf Huuck. Buchi Automata. Example

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Capacitors - Capacitance, Charge and Potential Difference

derivation of the Laplacian from rectangular to spherical coordinates

Example Sheet 3 Solutions

Chapter 3: Ordinal Numbers

Srednicki Chapter 55

Solutions to Exercise Sheet 5

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

A Note on Intuitionistic Fuzzy. Equivalence Relation

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Instruction Execution Times

Partial Trace and Partial Transpose

12. Radon-Nikodym Theorem

Durbin-Levinson recursive method

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

EE512: Error Control Coding

Problem Set 3: Solutions

Every set of first-order formulas is equivalent to an independent set

Solution Series 9. i=1 x i and i=1 x i.

CHAPTER 101 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Second Order RLC Filters

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2)

MATH423 String Theory Solutions 4. = 0 τ = f(s). (1) dτ ds = dxµ dτ f (s) (2) dτ 2 [f (s)] 2 + dxµ. dτ f (s) (3)

Partial Differential Equations in Biology The boundary element method. March 26, 2013

D Alembert s Solution to the Wave Equation

CRASH COURSE IN PRECALCULUS

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Appendix to On the stability of a compressible axisymmetric rotating flow in a pipe. By Z. Rusak & J. H. Lee

6.3 Forecasting ARMA processes

From the finite to the transfinite: Λµ-terms and streams

PARTIAL NOTES for 6.1 Trigonometric Identities

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Assalamu `alaikum wr. wb.

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

1 String with massive end-points

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

[1] P Q. Fig. 3.1

Elements of Information Theory

TMA4115 Matematikk 3

1) Formulation of the Problem as a Linear Programming Model

Mean bond enthalpy Standard enthalpy of formation Bond N H N N N N H O O O

The challenges of non-stable predicates

Bounding Nonsplitting Enumeration Degrees

SCITECH Volume 13, Issue 2 RESEARCH ORGANISATION Published online: March 29, 2018

Homework 8 Model Solution Section

Distances in Sierpiński Triangle Graphs

An Inventory of Continuous Distributions

UNIVERSITY OF CALIFORNIA. EECS 150 Fall ) You are implementing an 4:1 Multiplexer that has the following specifications:

New bounds for spherical two-distance sets and equiangular lines

Second Order Partial Differential Equations

Ψηφιακή Επεξεργασία Εικόνας

Problem Set 9 Solutions. θ + 1. θ 2 + cotθ ( ) sinθ e iφ is an eigenfunction of the ˆ L 2 operator. / θ 2. φ 2. sin 2 θ φ 2. ( ) = e iφ. = e iφ cosθ.

Abstract Storage Devices

Transcript:

Overview Transition Semantics Configurations and the transition relation Executions and computation Inference rules for small-step structural operational semantics for the simple imperative language Transition semantics of failure Labeled transition semantics of input and output Relationship with (direct) denotational semantics

Operational (or Transition) Semantics Idea: Define the execution of a program as a sequence γ 0, γ 1,... of configurations γ i Γ. Configurations are either terminal or nonterminal: e.g. for the SIL Γ = Γ T Γ N Γ T Γ N = {} Γ T = Σ Γ N = comm Σ [x : 42] Γ T x:= x+1, [x : 41] Γ N Define a transition relation from Γ N to Γ: informally, γ γ if γ is obtained in one step from γ, e.g. x:= x+1, [x : 41] [x : 42]

Executions and Computation An execution is a (finite or infinite) sequence of configurations γ 0, γ 1,... such that γ i γ i+1 whenever γ i and γ i+1 are in the sequence. The relation of computation is the reflexive and transitive closure of γ γ if there is a finite execution starting with γ and ending with γ. For the SIL we will define which is a total function from Γ N to Γ, for every γ Γ there is a longest execution starting with γ; if it is infinite, then γ diverges: γ ; otherwise there is a unique γ Γ T such that γ γ.

Plotkin Style Small-Step Structural Operational Semantics for the SIL We define the relation in terms of inference rules. Example: (skip) (assgn) (seq t) (seq s) skip, σ σ v:= e, σ [σ v : [[e]] intexp σ] c 0, σ σ c 0 ; c 1, σ c 1, σ c 0, σ c 0, σ c 0 ; c 1, σ c 0 ; c 1, σ (by (seq s)) (by (assgn)) x:= x+1, [x : 4 y : 6] [x : 5 y : 6] (by (seq t)) x:= x+1 ; y:= y+x, [x : 4 y : 6] y:= y+x, [x : 5 y : 6] x:= x+1 ; y:= y+x ; skip, [x : 4 y : 6] y:= y+x ; skip, [x : 5 y : 6]

More SOS Rules (cond t) (cond f) (while t) (while f) if b then c else c, σ c, σ if b then c else c, σ c, σ while b do c, σ c ; while b do c, σ while b do c, σ σ when [[b]] boolexp σ = true when [[b]] boolexp σ = false when [[b]] boolexp σ = true when [[b]] boolexp σ = false However the naïve rule for variable declaration newvar v:=e in c, σ c ; v:= n, [σ v : [[e]] intexp σ] where n = σ v exposes the local variable name in the result, which becomes a problem when we extend the language.

SOS Rule for Local Variable Declaration Idea: Use the declaration to reflect changes in the value of the variable. (decl t) (decl s) c, [σ v : [[e]] intexp σ] σ newvar v:=e in c, σ [σ v : σ v] c, [σ v : [[e]] intexp σ] c, σ newvar v:=e in c, σ newvar v:=σ v in c, [σ v : σ v] (decl s) (seq t) (assgn) x:= x+1, [x : 24 y : 10] [x : 25 y : 10] x:= x+1 ; y:= x+2, [x : 24 y : 10] y:= x+2, [x : 25 y : 10] newvar x:=x+3 in x:= x+1 ; y:= x+2, [x : 21 y : 10] newvar x:=25 in y:= x+2, [x : 21 y : 10]

Inference Rules for the Computation The reflexive and transitive closure of can also be defined using inference rules: (incl) (refl) (trans) γ γ γ γ γ γ γ γ γ γ γ γ

Meaning of Commands Γ N Γ (total function) γ Γ there is a longest execution starting from γ, either infinite or ending with a γ Γ T = Σ. [[c]] comm σ =, if c, σ σ, if c, σ σ

Transition Semantics of Failure Define Γ T = Σ ({abort} Σ). Then Propagation of failure: (fail) fail, σ abort, σ (seq x) c 0, σ abort, σ c 0 ; c 1, σ abort, σ c, [σ v : [[e]] intexp σ] abort, σ (decl x) newvar v:=e in c, σ abort, [σ v : σ v] The semantics of commands becomes [[c]] comm σ =, if c, σ σ, if c, σ σ abort σ, if c, σ abort σ

Labeled Transition Semantics of Input and Output Informally: Write labels on transitions to show input or output. Rules: (output) (input)!e, σ!n σ?v, σ?n [σ v : n] when n = [[e]] intexp σ Formally, the transition relation becomes ternary: Γ N Λ Γ, where Λ = {ɛ} {?n n Z} {!n n Z} (ɛ is silent ) and c, σ λ γ stands for c, σ, λ, γ.

Labeled Transition Semantics cont d The other rules are generalized to propagate the labels, e.g. (seq t) (seq s) (seq x) c 0, σ λ σ c 0 ; c 1, σ λ c 1, σ c 0, σ λ c 0, σ c 0 ; c 1, σ λ c 0 ; c 1, σ c 0, σ λ abort, σ c 0 ; c 1, σ λ abort, σ

Properties of the Labeled Transition Semantics If γ = c, σ Γ N, then exactly one of these holds:!γ Γ such that γ γ (silent transition)!γ Γ, n Z such that γ!n γ {λ Λ γ Γ and γ λ γ } = {?n n Z} Hence for every γ Γ there is a longest sequence of silent transitions which is either infinite ends with a γ Γ T ends with a γ Γ N such that!γ Γ, n Z such that γ!n γ ends with a γ Γ N such that n Z. γ Γ. γ?n γ.

Relationship with the Denotational Semantics So, for every γ Γ there is a longest sequence of silent transitions which is either infinite ends with a γ Γ T ends with a γ Γ N such that!γ Γ, n Z such that γ!n γ ends with a γ Γ N such that n Z. γ Γ. γ?n γ. If Ω = ( ˆΣ + (Z Ω) + [Z Ω]) and F [Γ Ω] is the least solution of F γ = then [[c]] comm σ = F c, σ., if γ ι term σ, if γ σ ι abort σ, if γ abort, σ ι out n, F γ, if γ. γ γ and γ!n γ ι in (λn Z. F γ n ), if γ Γ. n Z. γ γ and γ?n γn