international workshop on software design and architecture...

Click here to load reader

Upload: others

Post on 22-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 1 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INTERACTIVE SYSTEMS: PRINCIPLES AND ARCHITECTURES

    Tutorial

    International Workshop on Software Design andArchitecture (SoDA 04)

    Srinath SrinivasaIndian Institute of Information Technology, Bangalore

    India 560100

    [email protected]

    http://http://www.iiitb.ac.in/mailto:[email protected]

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 2 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    OUTLINE

    • Interactive dynamics, informally...• Conceptual differences between interactive and algorithmic

    dynamics

    • Interactive dynamics in practice: closed systems vs open sys-tems

    • Principles of Open Systems• A meta-model for open systems design

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 3 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COMPUTATION

    A mechanical procedure for mapping between a given “prob-lem” statement and its “answer.” Usually represented in theform of functionsf : I → O, whereI is the input “problem”domain andO is the output “solution” domain..

    Different connotations of computation:

    1. Decision

    2. Classification

    3. Calculation

    4. Search

    5. ...

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 4 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    EXPRESSIVENESS OF A COMPUTATIONAL MODEL

    The expressivenessof a computational model is defined as the “class” ofdecision problems that they can solve.

    An expressiveness hierarchy of computational problems:

    Regular ← Context Free← Recursively enumerable← Recursive

    DFA,Regular expressions ← context free grammar, PDA ←Turing recognisers← Turing enumerators

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 5 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    THE TURING MACHINE

    The mathematical model of computation is the Turing Machine which is of theform: TM = (S, T, s0, δ,H) where:

    S is a set of TM statesT is a set of tape symbolss0 ∈ S is the start stateδ : S × T → S × T × {L,R} is the transition functionH is a set of halting states.

    A TM uses an infinite tape on which the input is provided as afinite sequenceof symbols. The TM always begins computation ats0 and the TM finishescomputation when it reaches any stateh ∈ H.

    Important: A TM hasto necessarily halt for the computational problem to be

    termed “decidable.” If the TM cannot halt then the problem instance is said

    to be “undecidable.” (This is the basis for the difference between sets that are

    recursively enumerable and sets which are recursive).

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 6 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    VARIANTS OF TURING MACHINES

    • Turing recognizers (decides for all inputs)

    • Turing enumerators (recognizes all valid members)

    • Universal Turing Machine (loads the specification of another Turing Ma-chine and executes it)

    Computers today is termed to be no more powerful than theUniversal Turing

    Machine

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 7 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    EQUIVALENT MODELS OFCOMPUTATION

    • λ-calculus• First order logic, algebras and induction• Conventional (well-founded) set theory• Functional and imperative programming (Pascal, C, Lisp,

    etc.)

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 8 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    EXAMPLES OF COMPUTATION

    square(int x) returns the square of an integerx. Hencesquare(9)→ 81

    gcd(int x, int y) computes the gcd of two integers. Hencegcd(10, 25)→ 5

    shortestpath(graph G, node x, node y) computes theshortest path between nodesx andy in a given graphG.

    Do all computers only compute?

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 9 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    EXAMPLES OF COMPUTATION

    Consider the following problem:

    Design an function for a robot to navigate from a givensource to a given destination in a dynamic environmenthaving moving objects.

    Inputs: source, destination, map of the environment, dynamic objects in en-vironment, formula about dynamics of objects in environment, formula aboutinterference between dynamics of objects, ...

    What is the complexity of designing such a function?

    (Yet, software for robotic navigation is quite common – because they useinter-

    activemodels of robot dynamics.)

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 10 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    PROPERTIES OFCOMPUTATION

    Mathematically, computation is defined by several models andset-theoretic notations. These models have the following proper-ties:

    1. The specification of the problem is of finite length (although the workspaceneeded for computation may itself be infinite)

    2. All data relevant to the problem is available at the beginning of computation(Closed-world assumption)

    3. No exchanges of intermediate results take place with external environmentsuntil computation finishes

    4. All valid computations terminate

    5. The computation is stateless – multiple invocations of the same problemwith the same input parameters produce the same results.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 11 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    DOMAIN -THEORETIC NOTION OF COMPUTATION

    s0 : start state

    h0 h1 h2

    Each point in the domain represents data exchange with the ex-ternal world. Computing domains are always “pointed” domains.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 12 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    THE STRUCTURE OF A COMPUTATIONAL SYSTEM

    s0 : start state

    h0 h1 h2

    s0 : start state

    h0 h1 h2

    s0 : start state

    h0 h1 h2

    s0 : start state

    h0 h1 h2

    s0 : start state

    h0 h1 h2

    s0 : start state

    h0 h1 h2

    Pure computational systems form perfect hierarchies with severallevels of pointed domains. The relationship between two compu-tational process is in the form of subroutine calls.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 13 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INDUCTIVE CHARACTERIZATION OF COMPUTATION

    Computation can be represented as a set comprising of(problem, solution) pairswhich can be defined inductively. Induction has the following steps (Considerthe definition of the computationSQ defined asy = x2):

    1. Initial condition. ((0, 0) ∈ SQ)

    2. Iteration condition. (if(x, y) ∈ SQ then so does(x+ 1, y + 2x+ 1))

    3. Iteration condition. (if(x, y) ∈ SQ then so does(−x, y))

    4. Minimality condition. (The only elements ofSQ are those which are de-fined by the above two steps)

    Minimality is a characteristic of computation. A computational system forbids

    any element that it has not explicitly permitted as part of its computational rules.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 14 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INTERACTION

    Almost all real-world processes areinteractivein nature.

    Interaction involves at least two actors, neither of whom have absolute controlover the interactive process.

    For any actor, interaction requires exchange of intermediate results with one ormore external environments.

    Intermediate inputs from the environment(s) may be related to the intermediateresults. (Hence they cannot be bundled into one input packet at the beginning).

    The system has no control over the behaviour of its environment(s).

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 15 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CONSIDER THE FOLLOWING SCENARIOS...

    Bob: What is your name?

    Alice: Usually the train arrives on time.

    Bob: Where did you study?

    Alice: It never rains in November.

    Bob: How do you like it here?

    Alice: Canberra is the capital of Australia.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 16 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CONSIDER THE FOLLOWING SCENARIOS...

    Bob: What is your name?

    Alice: Alice

    Bob: What is the capital of Australia?

    Alice: Canberra.

    Bob: What is your name?

    Alice: Alice

    Bob: What is the boiling temperature of water?

    Alice: 100 degrees

    Bob: What is your name?

    Alice: Alice

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 17 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CONSIDER THE FOLLOWING SCENARIOS...

    Bob: What is your name?

    Alice: Alice

    Bob: Where did you study?

    Alice: IITM

    Bob: Where is it?

    Alice: In Chennai, India.

    Bob: What is the boiling temperature of water?

    Alice: 100 degrees

    Bob: What is it in Farenheit?

    Alice: 212 degrees

    In which of the above three scenarios, do you think Bob and Alicewereinteracting?

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 18 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INTERACTION

    Interaction involves a persistent state that is shared across all in-teracting actors.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 19 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COMPUTATION + PERSISTENT STATE

    What can a persistent state do?

    • A persistent state captures the (gist of) history of all previouscomputations.

    • The behaviour of an interactive system is not only dependenton the input problem, but also on the contents of the persistentstate. (Remember the ATM telling you, “Sorry, you are notallowed to withdraw more than Rs. 10,000/- in a week”?).

    • In effect, a persistent state results in a different start state foreach computation.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 20 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    DOMAIN CHARACTERISATION OF COMPUTATION+PERSISTENT STATE

    s0

    s67

    s82

    s43s112

    s18s5

    Interaction

    Interaction

    Interaction

    InteractionInteraction

    InteractionInteraction

    With a persistent state, there is no single start state for computation. The domainmay be arbitrary in shape. In fact, it could also benon-wellfounded.In domain theoretic terms,x ⊂ y means thaty is higher in the domain (containsmore information, etc.) thanx. And,x ⊂ y, y ⊂ z ⇒ x ⊂ z.In a well-foundeddomain, for anyx, x 6⊂ x. But in the above domain, it is wellpossible thatx ⊂ x. (In the example,s0 ⊂ s0).

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 21 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CHARACTERISTICS OF COMPUTATION+ PERSISTENT STATE

    1. No single start state (in fact, there could be an infinite numberof start states!)

    2. Computation has to terminate, but the interaction itself neednot terminate. It could go on forever!

    3. No nice hierarchical structures. Processes have acoroutinerelationship with one another (with the subroutine relation-ship being a special case).

    How do we deal with infinite states?In many cases, an infinite state space can be partitioned into a finite numberof state classes. (Ex:income ≤ 1, 50, 000, 1, 50, 000 < income ≤ 5, 00, 000,5, 00, 000 < income)

    But such partitioning is not possible always.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 22 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INDUCTIVE CHARACTERISATION

    Consider the way computationSQ is characterised:

    s0 (0,0)

    Rule 1

    s1 (1,1)

    Rule 2

    Rule 3 s2 (−1,1)

    Rule 2

    Rule 3

    Rule 2

    (2,4) Rule 3

    Rule 3

    s4 (−2,4)

    Rule 2

    s3

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 23 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INDUCTIVE CHARACTERISATION

    A member of an inductive domain is characterised by the pathsleading to it from the initial elements.

    s3 = s0 + Rule 2 + Rule 2s4 = s0 + Rule 2 + Rule 2 + Rule 3 = s3 + Rule 3

    (s3, Rule 3)→ s4

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 24 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COINDUCTIVE CHARACTERISATION

    United States of Utopia

    u0 u1 u2 u3

    p0

    p1

    p2

    Rule 1

    Rule 2 Rule 1

    Rule 3

    Rule 1 Rule 3

    p3

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 25 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COINDUCTIVE CHARACTERISATION

    1. Set of final elements (u0, u1, u2, u3) and rules of the negative

    2. Set of elements and rules for “unfolding”[p0, (Rule 1→ u0)][p3, (Rule 1 +Rule 1→ u0), (Rule 3→ p2)]

    3. Maximality condition

    Coinductive domains have amaximality conditionthat permits any element (andits corresponding unfolding) unless it is explicitly forbidden by the model.

    State s in an inductive description:s is that state which results after applyingthe following rules from the initial state.

    State s in a coinductive description:s is that state from which, the followingbehaviours can take me to utopia..

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 26 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COINDUCTIVE CHARACTERISATION: EXAMPLE

    • Final conditions:Grade = {A,B,C,D}

    • Once a grade is decided, it cannot be upgraded (i.e. B cannot be upgradedto A)

    1. Element A: If student does not have 85% attendance s/he gets grade B.

    2. Element B: If student does not have 85% attendance s/he gets grade C.

    3. Element C: If student does not have 85% attendance s/he gets grade D.

    4. Element “Local student”: If student has consistently scored above 90% inall tests s/he gets an A.

    5. Element “Local student”: If student has consistently scored below 40% inall tests s/he gets a D.

    6. Element “Local student”: If student’s average score occurs in the first quar-tile of class scores s/he gets an A.

    7. ...

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 27 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COINDUCTIVE CHARACTERISATION: EXAMPLE

    A B C D

    Local Student

    1 2 3

    4, 6 5

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 28 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COINDUCTIVE CHARACTERISATION: EXAMPLE

    A B C D

    Local Student

    1 2 3

    4, 6 5

    Unregistered Student

    Foreign Student

    Research Student

    There is no single starting point for computation. Computation may start from

    different places depending on whether the student is a local registered student, a

    local research student, an unregistered student or a foreign student.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 29 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    INDUCTION VS COINDUCTION

    Induction: Construction metaphor. (The “unfolded behaviour” of an inductivesystem is defined by the base conditions and construction rules)

    Coinduction: Observation metaphor (The rules of the system are designed such

    that they produce the speficied “unfolded behaviour.”)

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 30 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    COINDUCTIVE CLASS SPECIFICATION LANGUAGE

    The observable behaviour of a method is defined as the unfolding behaviour ofthe object from the point where it was called.

    Consider a vending machine object having methods:insertcoin(), choose(),option(), commit().

    The object is considered as a set of all possible valid streams of be-

    haviour. A call to insertcoin() for example returns a stream of the form:

    (insertcoin(), choose(), option(), commit())

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 31 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    EXAMPLES OF COMPUTATION+ PERSISTENT STATE

    1. C function with static variables

    2. A read-write database engine

    3. Objects...

    Open Systems:A system whose behaviour is best specified coinductively is

    also termed an “open” system. The system is by definition open to addition of

    behavioural “starting points” (and possibly removal of old “starting points” that

    are no longer relevant)

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 32 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    WHY IS THERE NO SILVER BULLET FOR SOFTWARESYSTEMS?

    Fred Brooks’ contention of “no silver bullet” for building software systems stillseems to hold

    Consider how objects are designed:

    1. The behaviour of an object is considered to be abstracted by its interface

    2. Object interface contains only method signatures. Method calls can manip-ulate the object’s state; however the state itself ishiddenfrom the externalworld

    3. Specifically,there is no provision to specify different “starting points” ofcomputation

    There is no silver bullet because we try to model open systems using closed

    models. (Note that using an open model does not automatically bring a silver

    bullet – there may be an infinite number of starting points..)

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 33 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    SERVICEOBJECT: A NEW MODEL FOR OBJECTS

    ServiceObject = set of “starting points” orstates

    State =(Condition, {(methodsig, endstate)}) whereCondition is the enabling condition for the state (condition that needs to

    uniquely hold for the object to start from this state)

    methodsig is the signature of a method that the state supports andendstate is a

    state of the object that can be reached on calling this method. Obviouslyendstate

    should be already defined in the object.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 34 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    SERVICEOBJECT: A NEW MODEL FOR OBJECTS

    Object Interface:

    Object id

    ...

    ...

    ...

    State id

    Condition

    method()method()

    ...

    State id

    Condition

    method()method()

    ...

    method()

    method()...

    Methods that arenot dependent on starting points

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 35 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    SERVICEOBJECT: A NEW MODEL FOR OBJECTS

    Qualifiers for states:A state (“starting point”) can be qualified as..

    • Private: This state is not “visible” to the outside. The service objectcannot be instantiated to start from this state. This state can be reached byother states. They cannot be inherited by derived classes.

    • Public: This state is visible to the outside. Objects can be instantiatedto start from this state. They can be inherited by derived classes.

    • Protected: This state is not visible to the outside; but they are inherita-ble by derived classes.

    Inheritance:If B is a derived class ofA then..

    • B inherits all public and protected states ofA. It can override the startcondition and method definitions if they are also either public or protected.

    • B can add more states (more starting points) and methods to the class.

    • Wherever an object ofA is required in the system, an object ofB can besubstituted without loss of semantics.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 36 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    ADDITION OF STATES

    As in Java, each service class should be derived from a single top-most superclass ServiceObject.

    ServiceObject supports the methodaddState(State s) that adds statesto the object.

    Each state is derived from a super class State that supports a methodbooleangetCondition() which returnstrue if the enabling condition holds, orfalse otherwise.

    When a service object is initialised, it executes anif ... else laddercalling getCondition() on each of its states to determine which should bethe starting state.

    ServiceObject also supports methodsetState(State s) where the state of

    the object can be explicitly set to states from the present state (sayt ). setState

    succeeds only if the enabling conditions ofs and t are independent of one

    another.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 37 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    DESIGNING INTERACTIVE PROCESSES: EXAMPLE

    Consider the problem of a student joining an institution like IIT. A typical work-flow engine would divide this process into several tasks and order them in someconsistent order. For example:

    1. Obtain admission form from admin office

    2. Submit filled admission form along with original certificates to Registrar

    3. Obtain medical test form and insurance form from admin office

    4. Undergo medical test and hospital and get report

    5. Submit insurance form with medical report to admin

    6. Obtain hostel form from admin office

    7. Submit filled hostel form to hostel warden

    8. ...

    Usually, the admission process never happens in exactly the above sequence.

    However, if a workflow engine (built using an inductive model) is used, it would

    generate forms strictly in the above order..

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 38 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    DESIGNING INTERACTIVE PROCESSES: EXAMPLE

    1. Identify the end state:all-formalities-over

    2. Identify negatives:There should never be a state where hostel and insurance processes havecompleted, but admission has not been completed.

    3. Identify states and unfolding behaviours:

    • State:insurance-overCondition:{admin− over, insurance− pending}Method:next()→ {all− formalities− over, hostel− pending}• State:insurance-pending

    Condition:{admin− over}Method:getInsuranceform()→ medicaltest− pendingMethod:submitInsuranceform()→ {insurance− pending, insurance− over}• State:only-medicaltest-pending

    Condition:{admin− over, insurance− pending}Method:getInsuranceform()→ medicaltest− pendingMethod:submitMedicalReport()→ insurance− pending• ...• ...

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 39 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CONSIDER THE FOLLOWING SCENARIOS

    Bob: What is your name?

    Alice: Alice

    Bob: Where did you study?

    Alice: IITM

    Bob: Where is it?

    Ashok: In Chennai, India.

    Bob: What is the boiling temperature of water?

    Ashok: 100 degrees

    Bob: What is it in Farenheit?

    Alice: 212 degrees

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 40 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CONSIDER THE FOLLOWING SCENARIOS

    Bob: What is your name?

    Alice: Alice

    Bob: What isyour name?

    Ashok: Ashok

    Bob: Where did you study?

    Alice: IITM

    Bob: And how about you? Where did you study and what was your branch?

    Ashok: IITB, Computer Science and Engineering

    Bob: Do you think you can finish this project?

    Alice: Yes, I have the confidence..

    Ashok: We are IITians; we are trained to sleep only on national holidays... ;)

    What is the difference between this and the earlier interaction?

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 41 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    MULTI -STREAM INTERACTION

    When interaction happens among only two actors; or when interaction among

    multiple actors is in a broadcast mode, it is calledsingle-streaminteraction. In

    multi-streaminteraction, each interacting actor has its own “view” of the global,

    shared persistent state

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 42 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    PROPERTIES OF MULTI-STREAM INTERACTION

    1. Multi-stream interaction = computation + persistent state +channel sensi-tivity

    2. It is not only important to computewhat the answer is, but alsowho theanswer should go to

    3. Response to an input on a channel is dependent on: input parameters, his-tory of previous interactions, interactions taking place on other channels(hidden adversary versus hidden variable)

    4. Almost all information systems are multi-stream interaction machines

    5. Examples of multi-stream interaction machines:A set of objects belonging to the same class, sharing class (static) variablesMulti-user read-write database systemsUnix and any multi-user operating system

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 43 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    META-MODELS SUPPORTING INTERACTION CHANNELSEXPLICITLY

    • CCS, Process calculusEx: C = in(x)C1;C1 = in(y)C2;C2 = ¯out(x)C1;C1 = ¯out(y)C

    • π-calculus• Stream-based interactive components

    (Broy et. al http://www4.informatik.tu-muenchen.de/proj/focus/Literature.html)

    http://http://www.iiitb.ac.in/http://www4.informatik.tu-muenchen.de/proj/focus/Literature.htmlhttp://www4.informatik.tu-muenchen.de/proj/focus/Literature.html

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 44 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    (PERCEIVED) SHORTCOMINGS WITH CURRENT MODELS

    • Channels are statically defined and the number of channels isfixed.

    • Channel behaviour is also fixed.• Models employ an “operational” view of channel behaviour

    specifying exact tokens of exchange taking place through thechannels.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 45 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    “I NTERACTION SCHEMA” MODEL

    • System consists of an unbounded but finite number of channels

    • Each channel is concerned with only its view of the global, persistent,shared state

    • No channel has the complete global state. The global state is manifested bycombining all the different local views using a set of combination policies

    • The set of combination policies is called theinteraction schema.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 46 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    THE MULTI -CHANNEL SERVICE OBJECT

    The multi-channel service object has the following components:

    • S – a set of states or “starting points”

    • ψ – a set ofconstraintsacross states inS

    Instances of a service object are called “channels”. At any point in time, achannel can be in any of the states ofS. If channelx is in states, it is said to“inhabit” s.

    Channel inhabitations change as it interacts with its environment.

    Each change in state is a computation – or an ACID transaction.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 47 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    MULTI -CHANNEL SERVICE OBJECT

    The “condition” part of each states forms the “entry condition” for a channel toenters.

    The entry condition is a condition on the interaction history of a chan-nel before it arrived at the present state. (Ex. In order to arrive at stateinsurance-pending the incumbent channel should have visited stateadmission-over )

    A channel not satisfying the entry condition rolls back to wherever it came from.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 48 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    MULTI -CHANNEL SERVICE OBJECT

    A channel is an instance of a service object. Any channelx has the followingdescriptors:

    • state(x) returns the current state thatx is inhabiting

    • hist(x) ∈ S∗ returns the channel’s trajectory in the state space

    • in(x) returns a handle to the input data stream for channelx

    • out(x) returns a handle to the output data stream for channelx

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 49 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    MULTI -CHANNEL SERVICE OBJECT

    Constraints in a service object are of the form:s1 ∧ s2 . . . ∧ sn →M [s].

    It is read as “if there are channels inhabitings1, s2, . . . sn, then states gets amodalityM .” HereM is one of the following:

    • O[s] : it is obligatedfor a channel to inhabits. Until the antecedent holds,all channels in the precedent of the rule areblocked.

    • P [s] : it is permittedfor a channel to inhabits

    • F [s] : it is forbiddenfor any channel to inhabits. If there are any channelsin s when the rule holds, then all of them areblocked.

    When a channel isblocked, its input and output streams are cut off and any out-

    put it generates are buffered. All method calls to the channel are also disabled.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 50 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    MULTI -CHANNEL SERVICE OBJECT

    When two or more constraints hold on a state, their net effect is the logical“and” of all the incoming constraints. When a constraint ceases to hold, the seteffect is the logical “negation” of the constraint.

    Following axioms define logical operators on normative constructs:

    1. O ∧ P ⇒ O

    2. P ∧ F ⇒ F

    3. F [O ∧ F ]

    4. ¬O ⇒ P

    5. ¬P ⇒ F

    6. ¬F ⇒ P

    The third axiom is the “crash condition” when a state is obligated and forbidden

    at the same time, an exception is raised and the later constraint that was fired is

    killed.

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 51 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    THE INTERACTION SCHEMA

    The interaction schema is simply a collection of service objectsand constraints across service objects.

    The interaction schema itself is work in progress and we shall notbe discussing it further here..

    http://http://www.iiitb.ac.in/

  • Home Page

    Title Page

    Contents

    JJ II

    J I

    Page 52 of 52

    Go Back

    Full Screen

    Close

    Quit

    •First •Prev •Next •Last •Go Back •Full Screen •Close •Quit

    CONCLUSIONS

    • Designing interactive systems is really about designing “open” systems

    • Open systems have onlypartial controlover their own dynamics

    • Interaction = computation + persistent state + channel sensitivity

    • Open systems necessarily have to be designed in such a way so as to be ableto include new “starting points” of computation dynamically

    Philosophical question:

    Is the universe inductive (minimalistic) or coinductive (maximalistic)?

    http://http://www.iiitb.ac.in/