CREST A Continuous, REactive SysTems DSL Stefan Klikovits Alban - - PowerPoint PPT Presentation

crest
SMART_READER_LITE
LIVE PREVIEW

CREST A Continuous, REactive SysTems DSL Stefan Klikovits Alban - - PowerPoint PPT Presentation

CREST A Continuous, REactive SysTems DSL Stefan Klikovits Alban Linard Didier Buchs University of Geneva, Switzerland Growing plants CREST 2 a Klikovits et. al. CREST DSL stefan.klikovits@unige.ch Growing plants CREST 2 a (c) Debra


slide-1
SLIDE 1

CREST

A Continuous, REactive SysTems DSL

Stefan Klikovits Alban Linard Didier Buchs

University of Geneva, Switzerland

slide-2
SLIDE 2

CREST a

2

Growing plants

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-3
SLIDE 3

CREST a

2

Growing plants

(c) Debra Roby https://www.flickr.com/photos/darinhercules/ Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-4
SLIDE 4

CREST a

3

CREST diagrams

+δt

≪Growing lamp≫

On Off room temperature: 22 (Celsius) switch:

  • ff (Switch)

electricity: 0 (Watt) light: 0 (Lumen) temperature: 22 (Celsius)

  • n time:

0 (Time) switch = on ∧ electricity = 100 switch = off ∨ electricity < 100 800 room temp. room temperature + 4 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-5
SLIDE 5

CREST a

3

CREST diagrams

+δt

≪Growing lamp≫

On Off room temperature: 22 (Celsius) switch:

  • ff (Switch)

electricity: 0 (Watt) light: 0 (Lumen) temperature: 22 (Celsius)

  • n time:

0 (Time) switch = on ∧ electricity = 100 switch = off ∨ electricity < 100 800 room temp. room temperature + 4 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-6
SLIDE 6

CREST a

3

CREST diagrams

+δt

≪Growing lamp≫

On Off room temperature: 22 (Celsius) switch:

  • ff (Switch)

electricity: 0 (Watt) light: 0 (Lumen) temperature: 22 (Celsius)

  • n time:

0 (Time) switch = on ∧ electricity = 100 switch = off ∨ electricity < 100 800 room temp. room temperature + 4 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-7
SLIDE 7

CREST a

3

CREST diagrams

+δt

≪Growing lamp≫

On Off room temperature: 22 (Celsius) switch:

  • ff (Switch)

electricity: 0 (Watt) light: 0 (Lumen) temperature: 22 (Celsius)

  • n time:

0 (Time) switch = on ∧ electricity = 100 switch = off ∨ electricity < 100 800 room temp. room temperature + 4 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-8
SLIDE 8

CREST a

3

CREST diagrams

+δt

≪Growing lamp≫

On Off room temperature: 22 (Celsius) switch:

  • ff (Switch)

electricity: 0 (Watt) light: 0 (Lumen) temperature: 22 (Celsius)

  • n time:

0 (Time) switch = on ∧ electricity = 100 switch = off ∨ electricity < 100 800 room temp. room temperature + 4 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-9
SLIDE 9

CREST a

4

Composition

≪Plant growing system≫

≪Growing lamp≫ room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) temperature 22 (Celsius) light 0 (Lumen) ≪Plant≫ light 0 (Lux) temperature 22 (Celcius) SPLIT MAX SPLIT MAX room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) light 0 (lux) ADD Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-10
SLIDE 10

CREST a

4

Composition

≪Plant growing system≫

≪Growing lamp≫ room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) temperature 22 (Celsius) light 0 (Lumen) ≪Plant≫ light 0 (Lux) temperature 22 (Celcius) SPLIT MAX SPLIT MAX room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) light 0 (lux) ADD Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-11
SLIDE 11

CREST a

4

Composition

≪Plant growing system≫

≪Growing lamp≫ room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) temperature 22 (Celsius) light 0 (Lumen) ≪Plant≫ light 0 (Lux) temperature 22 (Celcius) SPLIT MAX SPLIT MAX room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) light 0 (lux) ADD Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-12
SLIDE 12

CREST a

4

Composition

≪Plant growing system≫

≪Growing lamp≫ room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) temperature 22 (Celsius) light 0 (Lumen) ≪Plant≫ light 0 (Lux) temperature 22 (Celcius) ≪ADD≫ lamp 0 (Lumen) external 0 (Lux) light 0 (Lux) add lamp/0.25 +external SPLIT MAX SPLIT MAX room temperature 22 (Celsius) switch

  • ff (Switch)

electricity 0 (Watt) light 0 (lux) Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-13
SLIDE 13

CREST a

5

Language Realization

class GrowingLamp (Entity): electricity = Input(resource=res_electricity , init=0) light = Output(resource=res_light_lumen , init=0)

  • n = current = State ()
  • ff = State ()
  • ff_to_on = Transition (source=off , target=on ,

guard=(lambda lamp: lamp.switch.value == "on" and

  • lamp. electricity .value >= 100)

) @update(state=on) def set_light_on (lamp , dt=0): lamp.light.value = 800

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-14
SLIDE 14

CREST a

5

Language Realization

class GrowingLamp (Entity): electricity = Input(resource=res_electricity , init=0) light = Output(resource=res_light_lumen , init=0)

  • n = current = State ()
  • ff = State ()
  • ff_to_on = Transition (source=off , target=on ,

guard=(lambda lamp: lamp.switch.value == "on" and

  • lamp. electricity .value >= 100)

) @update(state=on) def set_light_on (lamp , dt=0): lamp.light.value = 800

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-15
SLIDE 15

CREST a

5

Language Realization

class GrowingLamp (Entity): electricity = Input(resource=res_electricity , init=0) light = Output(resource=res_light_lumen , init=0)

  • n = current = State ()
  • ff = State ()
  • ff_to_on = Transition (source=off , target=on ,

guard=(lambda lamp: lamp.switch.value == "on" and

  • lamp. electricity .value >= 100)

) @update(state=on) def set_light_on (lamp , dt=0): lamp.light.value = 800

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-16
SLIDE 16

CREST a

5

Language Realization

class GrowingLamp (Entity): electricity = Input(resource=res_electricity , init=0) light = Output(resource=res_light_lumen , init=0)

  • n = current = State ()
  • ff = State ()
  • ff_to_on = Transition (source=off , target=on ,

guard=(lambda lamp: lamp.switch.value == "on" and

  • lamp. electricity .value >= 100)

) @update(state=on) def set_light_on (lamp , dt=0): lamp.light.value = 800

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-17
SLIDE 17

CREST a

5

Language Realization

class GrowingLamp (Entity): electricity = Input(resource=res_electricity , init=0) light = Output(resource=res_light_lumen , init=0)

  • n = current = State ()
  • ff = State ()
  • ff_to_on = Transition (source=off , target=on ,

guard=(lambda lamp: lamp.switch.value == "on" and

  • lamp. electricity .value >= 100)

) @update(state=on) def set_light_on (lamp , dt=0): lamp.light.value = 800

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-18
SLIDE 18

CREST a

6

Why not «formalism-XYZ»?

◮ powerful, but complex ◮ too generic ◮ feature workarounds ◮ architecture and behaviour

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-19
SLIDE 19

CREST a

7

One DSL to rule them all?

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-20
SLIDE 20

CREST a

8

CREST Formalization

T, R, E, e e = Pe, resourcee, TSe, Ue, entitiese, Infe Pe = Ie ⊔ Oe ⊔ Le TS = Se, →e; →e⊆ Se × Se × Ge . . .

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-21
SLIDE 21

CREST a

8

CREST Formalization

T, R, E, e e = Pe, resourcee, TSe, Ue, entitiese, Infe Pe = Ie ⊔ Oe ⊔ Le TS = Se, →e; →e⊆ Se × Se × Ge . . . it’s in the paper

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-22
SLIDE 22

CREST a

9

How to design a simulator

◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-23
SLIDE 23

CREST a

9

How to design a simulator

◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams

not full full fill level full-signal fill-level < 10 fill-level = 10 flow-rate: 0.5 per time step 4.35 t fill-level 10 0,0 10 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-24
SLIDE 24

CREST a

9

How to design a simulator

◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams

not full full fill level full-signal fill-level < 10 fill-level = 10 flow-rate: 0.5 per time step 4.35 t fill-level 10 0,0 10 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-25
SLIDE 25

CREST a

9

How to design a simulator

◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams

not full full fill level full-signal fill-level < 10 fill-level = 10 flow-rate: 0.5 per time step 4.35 11.3 t fill-level 10 0,0 10 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-26
SLIDE 26

CREST a

10

Verification

◮ state space exploration ◮ zone/region-based verification

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-27
SLIDE 27

CREST a

10

Verification

◮ state space exploration ◮ zone/region-based verification

http://www-i2.informatik.rwth-aachen.de/ sri/Slides/sri-zonebased.pdf Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-28
SLIDE 28

CREST a

10

Verification

◮ state space exploration ◮ zone/region-based verification ◮ requirements language

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-29
SLIDE 29

CREST a

11

Controller synthesis

◮ planning + optimization + simulation ◮ changing parameters ◮ changing (sub-)systems

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-30
SLIDE 30

CREST a

12

Applications

plant growing home automation job scheduling

  • ffice automation

https://cs.wikipedia.org/wiki/Roomba#/media/File:IRobot_Roomba_780.jpg Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-31
SLIDE 31

CREST a

13

Conclusion

CREST

◮ architecture & behaviour ◮ continuous & reactive ◮ formal basis

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-32
SLIDE 32

CREST

A Continuous, REactive SysTems DSL

Stefan Klikovits Alban Linard Didier Buchs

University of Geneva, Switzerland

slide-33
SLIDE 33

CREST a

14

Meta-Model

subentity * source target

  • bserve

write source target Entity Port Input Output Local State Transition Guard Update Influence Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-34
SLIDE 34

CREST a

15

Complex Ports

A

Out Req-In

B

In Req-Out

Requestable Resources

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-35
SLIDE 35

CREST a

15

Complex Ports

A A

Out Req-In

B B

In Req-Out Out In

Requestable Resources

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-36
SLIDE 36

CREST a

15

Complex Ports

A A

Out Req-In

B B

In Req-Out Out In Out In

Requestable Resources

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-37
SLIDE 37

CREST a

15

Complex Ports

A A

Out Req-In

B B

In Req-Out Out In Out In

Requestable Resources

in Splitter in split

  • ut1
  • ut2

combined input & splitter

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch

slide-38
SLIDE 38

CREST a

15

Complex Ports

A A

Out Req-In

B B

In Req-Out Out In Out In

Requestable Resources

in Splitter in split

  • ut1
  • ut2

in in SPLIT

combined input & splitter

Klikovits et. al. CREST DSL stefan.klikovits@unige.ch