Cycle-based Programming of Distributed Systems: The Synchrony - - PowerPoint PPT Presentation

cycle based programming of distributed systems the
SMART_READER_LITE
LIVE PREVIEW

Cycle-based Programming of Distributed Systems: The Synchrony - - PowerPoint PPT Presentation

Cycle-based Programming of Distributed Systems: The Synchrony Hypothesis Michael Mendler Faculty of Information Systems and Applied Computer Sciences University of Bamberg, Germany M. Mendler tubs.CITY, Braunschweig, 1.7.2009 1 Overview 1.


slide-1
SLIDE 1
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 1

Cycle-based Programming of Distributed Systems: The Synchrony Hypothesis

Michael Mendler

Faculty of Information Systems and Applied Computer Sciences University of Bamberg, Germany

slide-2
SLIDE 2
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 2

Overview

  • 1. Synchronous Programming
  • 2. The Synchrony Hypothesis
  • 3. Causal Reaction = Fixed Point ?
  • 4. What‘s in a Step ?: Notions of Causality
  • 5. The Synchrony Hypothesis (Hypo-)Thesis
slide-3
SLIDE 3
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 3

  • 1. Synchronous Programming
slide-4
SLIDE 4
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 4

Data flow paradigms Control flow paradigms

Synchronous Programming

Statecharts (Harel) Esterel (Berry, Gonthier) Signal (Benveniste, LeGuernic) Lustre (Caspi, Halbwachs)

iCONNECT Statemate Stateflow Modecharts VisualState SyncCharts Argos UMLStatecharts

...

RSML LabView Simulink SCADE Lustre V7 Syndex

...

slide-5
SLIDE 5
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 5

Example: SCADE – Esterel Tech

Data Flow: SCADE Lustre

wA

A/arm

wB

B/arm

WaitAandB

done

/ AB

dA dB

ABSync Reset signal arm

idle cnt 1

arm Detection Inhib

Timer

2 T / disarm

eot

disarm

2

signal disarm

Control Flow: SCADE Safe State Machines

  • embedded systems

domain (avionics, automotive)

  • rigorous semantics
  • verification & testing

(certification)

  • code-generation
  • hw/sw codesign
slide-6
SLIDE 6
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 6

Orthogonality in Time and Space

slide-7
SLIDE 7
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 7

Data Flow

data flow

slide-8
SLIDE 8
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 8

Data Flow

data flow Q: How do we treat the cyclic DF dependencies ? A: Continuitiy Hypothesis, Kahn stream semantics !

slide-9
SLIDE 9
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 9

Orthogonality in Time and Space

slide-10
SLIDE 10
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 10

State Flow

state flow

slide-11
SLIDE 11
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 11

State Flow

state flow Q: How do we treat the cyclic SF dependencies ? A: Synchrony Hypothesis, Fourman response semantics

slide-12
SLIDE 12
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 12

  • 2. The Synchrony Hypothesis
slide-13
SLIDE 13
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 14

Synchrony Hypothesis

Environment view: Reactions are

  • atomic
  • deterministic
  • bounded

System view: Reactions may be

  • non-atomic
  • non-deterministic
  • unbounded

“A reactive system is faster than its environment, hence reactions can be considered atomic”

slide-14
SLIDE 14
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 15

“A reactive system is faster than its environment, hence reactions can be considered atomic”

R2 R1

The Synchrony Paradox

Environment view: Reactions are

  • atomic
  • deterministic
  • bounded

System view: Reactions may be

  • non-atomic
  • non-deterministic
  • unbounded

Paradox ?

faster faster

slide-15
SLIDE 15
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 21

Programming Synchronous Reactions

  • logical transitions
  • conjunctions =

parallelism

  • negations code

choices, priorities and hierarchy logical transitions parallelism choice, priority

slide-16
SLIDE 16
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 22

Programming Synchronous Reactions

  • logical transitions
  • conjunctions =

parallelism

  • negations code

choices, priorities and hierarchy

slide-17
SLIDE 17
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 23

Programming Synchronous Reactions

  • logical transitions
  • conjunctions =

parallelism

  • negations code

choices, priorities and hierarchy

slide-18
SLIDE 18
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 24

In which sense does REACT describe an atomic macro step ?

Synchronous Abstraction

input stimulus instantaneous reaction

slide-19
SLIDE 19
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 25

Synchronous Abstraction

Cyclic dependencies ? => Fixed-Points !

In which sense does REACT describe an atomic macro step ?

input stimulus instantaneous reaction

slide-20
SLIDE 20
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 28

  • 3. Causal Reaction = Fixed-Point ?
slide-21
SLIDE 21
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 29

Synchronous Reactive Component

positive, negative triggers, actions , atomic logical signals, logical transitions

action

„response function“

enabled

Reactive component Response of C

slide-22
SLIDE 22
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 30

Reaction = Fixed-Point ?

"A signal s is present in an instant if and only if an `emit s' statement is executed in this instant."

Logical Coherence [Berry]

  • A response S is logically coherent iff

S is a fixed-point of AEC, i.e., S = AEC(S).

  • C is logically reactive iff it in every activation state

and environment, AEC has a fixed-point. Logical Coherence & Reactiveness

slide-23
SLIDE 23
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 31

Problem The response function is not monotonic !

Causal Response = Unique Fixed Point ?

slide-24
SLIDE 24
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 32

Problem The response function is not monotonic !

Causal Response = Unique Fixed Point ?

contravariant covariant

  • no unique (least) fixed points !
  • compositionality and full-abstraction problems !
  • different computation methods !

→ different notions of steps, instants, reactions ...

slide-25
SLIDE 25
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 34

Example

For all inputs there is a unique stationary Boolean fixed

  • point. Thus, the system is logically reactive.

We can compile & execute Boolean solution atomically ! But what if we are compiling for a component-based and distributed architecture ?

slide-26
SLIDE 26
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 35

Example

Oscillation under up-bounded inertial delay scheduling [Brzozowski & Seger]

slide-27
SLIDE 27
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 36

Example

schedule s1, s3 with higher priority than s2 or implement s1, s3 atomically, as a 2in/2out block. Oscillation can be avoided if we Then, whenever s2 is executed, we maintain the invariant

slide-28
SLIDE 28
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 38

  • 4. What is in a Step ? Notions of Causality
slide-29
SLIDE 29
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 39

What is in a Step ? - A Profusion of Options

1 Avoid Negations

  • nly positive triggers [Modecharts´94, Argos´89]

2 Modify Semantics of Negation

give up global consistency [Huizing&al.´88, Modecharts´96]

3 Give up Synchrony Hypothesis (no abstraction)

all signals delayed[Statemate´90,VHDL,RSML´95,PretC´09] add consistency as implicit trigger

[Maggiolo-Schettini &al.´96, Lüttgen &al.´99]

negative triggers delayed [Saraswat TCCP´94,

Boussinot & deSimone SL´95, Boussinot FunLoft‘07]

slide-30
SLIDE 30
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 40

What is in a Step ? - A Profusion of Options

4 Conflict-avoiding Schedules

  • nly accept stratifiable (statically schedulable) programs

[Normal Logic Programming] sequential schedule (endochrony) [Benveniste &al.´00] NRSA „no reaction to signal absence“ (weak endochrony, concurrent input reading) [Butucaru, Caillaud´06]

slide-31
SLIDE 31
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 42

5 Self-scheduled Run-time (explicit absence, dual rail)

What is in a Step ? - A Profusion of Options

non-deterministic speculation on absence

[Pnueli & Shalev´91; Boussinot‘s „basic semantics“ ‘98]

slide-32
SLIDE 32
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 43

What is in a Step ? - A Profusion of Options

non-deterministic speculation on absence

[Pnueli & Shalev´91; Boussinot‘s „basic semantics“ ‘98]

„Feel free to assume the absence of a signal as long as it is consistent to do so; if necessary, backtrack!“

  • fully-abstract, compositional intuitionistic Kripke semantics

[Lüttgen & Mendler´01]

  • game-theoretic “lazy“ fixed-points [Aguado & Mendler´05]

5 Self-scheduled Run-time (explicit absence, dual rail)

slide-33
SLIDE 33
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 44

What is in a Step ? - A Profusion of Options

constructiveness = “computed“ absence [Berry´00]

5 Self-scheduled Run-time (explicit absence, dual rail)

non-deterministic speculation on absence

[Pnueli & Shalev´91; Boussinot‘s „basic semantics“ ‘98]

slide-34
SLIDE 34
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 45

What is in a Step ? - A Profusion of Options

constructiveness = “computed“ absence [Berry´00]

“Accept the absence of a signal only under computable evidence that it may not occur later“

  • game-theoretic “eager“ fixed-points [Aguado & Mendler´05]
  • delay-insensitivity = non-inertial delay

= constructive modal logic [Mendler & Shiple & Berry´07]

& many other hardware approaches

  • speed-independence, semi-modularity, distributivity, ...

5 Self-scheduled Run-time (explicit absence, dual rail)

SugarCubes [Boussinot ´98] (Esterel v3,v4,v5,v6,v7)

non-deterministic speculation on absence

[Pnueli & Shalev´91; Boussinot‘s „basic semantics“ ‘98]

slide-35
SLIDE 35
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 46

  • 5. The Synchrony Hypothesis Thesis
slide-36
SLIDE 36
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 47

Outlook

Thesis 1

There are as many notions of constructive causality as there are scheduling/run-time models Synchronous reaction requires intensional semantics:

classical Boolean logic ⇒ constructive logic (e.g., Heyting algebra) least and greatest fixed points ⇒ general game-theoretic fixed points

Thesis 2

slide-37
SLIDE 37
  • M. Mendler

tubs.CITY, Braunschweig, 1.7.2009 54

Thank You !