Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3 An Object-Oriented View of Action Systems.

Similar presentations


Presentation on theme: "Chapter 3 An Object-Oriented View of Action Systems."— Presentation transcript:

1 Chapter 3 An Object-Oriented View of Action Systems

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

3 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.

4 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

5 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

6 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

7 Seuss syntax contd… Program section 3.2.1

8 Seuss syntax contd… Procedure section 3.2.2 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.

9 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 3.2.3 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

10 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

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

12 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

13 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

14 Seuss semantics contd… Procedure execution Each procedure is executed when called Total-procedure : always accepts calls Partial-procedure : accepts or reject a call Section 3.3.2 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

15 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

16 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

17 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.

18 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

19 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


Download ppt "Chapter 3 An Object-Oriented View of Action Systems."

Similar presentations


Ads by Google