Chapter 3 An Object-Oriented View of Action Systems.

Slides:



Advertisements
Similar presentations
More on Algorithms and Problem Solving
Advertisements

Models of Concurrency Manna, Pnueli.
1 Integrity Ioan Despi Transactions: transaction concept, transaction state implementation of atomicity and durability concurrent executions serializability,
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Statement-Level Control Structures
Control Structures Any mechanism that departs from straight-line execution: –Selection: if-statements –Multiway-selection: case statements –Unbounded iteration:
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
The Fundamental Rule for Testing Methods Every method should be tested in a program in which every other method in the testing program has already been.
Introduction to C Programming
ISBN Chapter 3 Describing Syntax and Semantics.
Weakest pre-conditions and towards machine consistency Saima Zareen.
Page 1 Building Reliable Component-based Systems Chapter 7 - Role-Based Component Engineering Chapter 7 Role-Based Component Engineering.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
Chapter 8 . Sequence Control
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Database Management Systems I Alex Coman, Winter 2006
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
Chapter 10 Classes Continued
Introduction to C Programming
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
C How to Program, 6/e Summary © by Pearson Education, Inc. All Rights Reserved.
Fundamentals of Python: From First Programs Through Data Structures
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
The University of Texas – Pan American
Sequence Control Chapter 6. 2 l Control structures: the basic framework within which operations and data are combined into programs. Sequence control.
Formal Models of Computation Part II The Logic Model
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Ryan Chu. Arithmetic Expressions Arithmetic expressions consist of operators, operands, parentheses, and function calls. The purpose is to specify an.
Introduction to Scheme Lectures on The Scheme Programming Language, 2 nd Ed. R. Kent Dybvig.
Transaction Lectured by, Jesmin Akhter, Assistant professor, IIT, JU.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 15: Transactions.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Mr. Dave Clausen1 La Cañada High School Chapter 6: Repetition Statements.
Chapter 04 Control Statements: Part II. OBJECTIVES In this part you will learn: if…else Double-Selection Statement. while Repetition Statement.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
A Discipline of Multiprogramming: Programming Theory for Distributed Applications by Jayadev Misra Chapter 1, Mikhail Nesterenko.
Chapter 5: Sequences, Mathematical Induction, and Recursion 5.5 Application: Correctness of Algorithms 1 [P]rogramming reliability – must be an activity.
1 Chapter Four Creating and Using Classes. 2 Objectives Learn about class concepts How to create a class from which objects can be instantiated Learn.
Computing & Information Sciences Kansas State University Wednesday, 05 Nov 2008CIS 560: Database System Concepts Lecture 28 of 42 Wednesday, 05 November.
ISBN Chapter 3 Describing Syntax and Semantics.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
©Silberschatz, Korth and Sudarshan14.1Database System Concepts - 6 th Edition Chapter 14: Transactions Transaction Concept Transaction State Concurrent.
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Flow of Control Joe McCarthy CSS 161: Fundamentals of Computing1.
Copyright 2006 Pearson Addison-Wesley, 2008, 2012 Joey Paquet 1 Concordia University Department of Computer Science and Software Engineering SOEN6441 –
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 2: Control Structures (Selection & Repetition)
Chapter 7 JavaScript: Control Statements, Part 1
Chapter 3 of Programming Languages by Ravi Sethi
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Chapter 3 Loops Section 3.3 Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Database Management System
Chapter 3: Using Methods, Classes, and Objects
TIM 58 Chapter 8: Class and Method Design
Chapter 6: Conditional Statements and Loops
Programming Languages 2nd edition Tucker and Noonan
Defining A Formal Semantics For The Rosetta Specification Language
Chapter 3 Describing Syntax and Semantics.
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

Chapter 3 An Object-Oriented View of Action Systems

Introduction Details of program composition Process Interaction Chp 2.  Shared Variables Chp 3.  RPC

Fundamentals Of Method Call A caller should not wait indefinitely(Unbound number of computational steps ) Reject call if there is no guarantee of successful execution Guaranteed termination of a method call Every action terminates. This requirement can be met only if every method called by an action is also guaranteed to terminate.

Overview of the model Program  set of boxes+cats Box  set of variables+set of procedures Object Cat(category)  Generic box from which box(es) are instantiated. Class Procedure  Action or Method Variables  only local to the boxes

Method vs Action Called by procedure of another box. Can change the state of their own box and other boxes. Parameters  Yes. Only mechanism of interaction among boxes. Partial or Total. Executed from time to time. Can change the state of their own box and other boxes. Parameters  No(?). Partial or Total. MethodAction

Seuss syntax BNF notation Non terminating symbols ::= {} [] () V {} syntactic unit enclosed occur one or more time in production.considered as comments in program [] syntactic unit enclosed zero or one time () To avoid confusion V alternation Terminating symbols | ; : ::  Keywords If else endif do while

Seuss syntax contd… Program section 3.2.1

Seuss syntax contd… Procedure section Method – head - procedure name followed by a list of parameters and their types. Action – label – no effect on program execution Parameter-passing by value-result.

Seuss syntax contd… Procedure body Partial-body or total-body Total-body is any sequential program:it may include calls upon total-body of other boxes. Partial-body : section Pre-condition is a predicate that may name only the procedure parameters and local variables of the box Partial-method-call is a partial method of some other box

Seuss syntax contd… Multiple alternatives Alternative is positive or negative:the first is always positive At the most one alternative holds at a time(disjoint pre-conditions) A procedure none of whose alternative has a true pre-condition rejects the call If an alternative has a pre-condition true then its pre-procedure is called. If pre-procedure rejects the alternative rejects;and if pre-procedure accepts then the body of alternative is executed The distinction between negative and positive alternative plays a role only after execution of body Negative alternative – reject the call Positive alternative - accept the call Negative alternative allows the state of called box to be changed but the caller’s state remains unchanged Required that value of any argument should not be modify. Useful to devise starvation free solution

Seuss syntax contd… Multiple alternatives Use of positive alternatives Use of negative alternatives Section 3.2.5

Seuss syntax contd… Constraints on programs Procedure call A total-body can call only total methods A partial-method cannot be called by total-body (?) A partial-method can appear only as pre-procedure in alternative A partial-method can have at the most one pre-procedure Partial order of boxes Every procedure p should impose a partial order >= p over the boxes of the program During an execution of p a procedure of box b can call a procedure p’ of b’ provided that b>p b’ A procedure calls a procedure on lower box in the order defined by >=p. In most cases, all procedure impose the same partial order over the boxes ( 3.2.3).However exception allowed to impose different partial orders over box(3.4.4) Termination condition Execution of each total body terminates;the programmer has to prove this requirement is met by the program

Seuss semantics (operational) Execution style Tight execution : one action is executed at a time. No concept of concurrent execution Each action completes before the next action is started. Consists of infinite number of steps In each step an action of a box is chosen arbitrary and executed Programmer understands design and logic of a program Loose execution : Actions may be executed concurrently Implementation my choose loose execution to maximize resource utilization

Seuss semantics contd… Procedure execution Each procedure is executed when called Total-procedure : always accepts calls Partial-procedure : accepts or reject a call Section Effective execution Calls to total procedures and accepted calls to partial procedures are always effective. A rejected call may or may not be effective A call is ineffective iff its execution calls a partial procedure whose alternatives’ pre-condition are all false Any call that causes a state change is effective An ineffective execution always causes no state change.However not every effective execution causes a state change

Discussion Total vs. partial procedures Are they interchangeable Total procedure to partial procedure True -> f Partial procedure to total procedure Can be coded as a total procedure where the outcome of the call – acceptance or rejection– is coded explicitly as an argument that can be tested by caller The distinction between them is fundamental Total procedure model terminating computations, I.e. transformational aspects of programming Partial procedures model potentially none terminating computations, or reactive aspects of programming

Discussion Total procedures Wait free program. A total procedure may call only total procedures. When a total procedure is called,its execution may 1. Terminate normally 2. Continue forever 3. Fail 2 is result of programming error 3 is also caused by programming error Failure is interpreted to mean that resulting state is arbitrary;any step taken in failed state results in a failed state Example on page 52

Discussion Partial procedures Each execution of a partial procedure terminates although the procedure may be called over and over. A partial procedure can call at the most one partial procedure,and then as a pre-procedure only. Partial action execute:: true ; s.P;t.P  …… is illegal. This is required because if s.P accepts and t.P reject the call then execute has to reject the call and for this it has to rollback the effects of s.P. Rollback requires an elaborate implementation and is avoided. Partial procedure only appears in pre-procedure because this policy avoids rollback in case the pre-procedure rejects the call. The state of caller remains unchanged if the call is rejected.

The Seuss Programmin Methodology Multiprogram is viewd as a set of actions Each action deals with one aspect of system functionality Execution of each action is wait free Additionally the conditions under which an action is to be executed is specified Seuss partitions the multiprogramming into Programming of action bodies whose execution are wait free Traditional sequential programming language is used Specification of the conditions for orchestrating executions of the action bodies. Multiprogramming theory Seuss addresses the design aspects of multiprogramming only I.e. how to combine actions and not the design of action bodies Seuss greatly restricts the amount of control available to the programmers at the multiprogramming level There is no control on action execution.It can be executed only through infinite repetitions

Seuss semantics contd… Partial order on boxes A partial order on the boxes of program is imposed by each procedure rather then each having a single partial order that is obeyed by all the procedure calls. Example on page 55