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 Roby https://www.flickr.com/photos/darinhercules/ Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST diagrams CREST 3 a ≪ Growing lamp ≫ room temperature + 4 electricity: temperature: 0 (Watt) 22 (Celsius) room temp. switch = off ∨ electricity < 100 switch: on time: On Off + δ t off (Switch) 0 (Time) switch = on ∧ electricity = 100 0 room temperature: light: 22 (Celsius) 0 (Lumen) 800 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST diagrams CREST 3 a ≪ Growing lamp ≫ room temperature + 4 electricity: temperature: 0 (Watt) 22 (Celsius) room temp. switch = off ∨ electricity < 100 switch: on time: On Off + δ t off (Switch) 0 (Time) switch = on ∧ electricity = 100 0 room temperature: light: 22 (Celsius) 0 (Lumen) 800 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST diagrams CREST 3 a ≪ Growing lamp ≫ room temperature + 4 electricity: temperature: 0 (Watt) 22 (Celsius) room temp. switch = off ∨ electricity < 100 switch: on time: On Off + δ t off (Switch) 0 (Time) switch = on ∧ electricity = 100 0 room temperature: light: 22 (Celsius) 0 (Lumen) 800 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST diagrams CREST 3 a ≪ Growing lamp ≫ room temperature + 4 electricity: temperature: 0 (Watt) 22 (Celsius) room temp. switch = off ∨ electricity < 100 switch: on time: On Off + δ t off (Switch) 0 (Time) switch = on ∧ electricity = 100 0 room temperature: light: 22 (Celsius) 0 (Lumen) 800 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST diagrams CREST 3 a ≪ Growing lamp ≫ room temperature + 4 electricity: temperature: 0 (Watt) 22 (Celsius) room temp. switch = off ∨ electricity < 100 switch: on time: On Off + δ t off (Switch) 0 (Time) switch = on ∧ electricity = 100 0 room temperature: light: 22 (Celsius) 0 (Lumen) 800 Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Composition CREST 4 a ≪ Plant growing system ≫ room temperature SPLIT SPLIT 22 (Celsius) ≪ Growing lamp ≫ room temperature temperature MAX MAX 22 (Celsius) 22 (Celsius) switch switch off (Switch) off (Switch) electricity electricity light 0 (Watt) 0 (Watt) 0 (Lumen) light ADD 0 (lux) ≪ Plant ≫ light 0 (Lux) temperature 22 (Celcius) Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Composition CREST 4 a ≪ Plant growing system ≫ room temperature SPLIT SPLIT 22 (Celsius) ≪ Growing lamp ≫ room temperature temperature MAX MAX 22 (Celsius) 22 (Celsius) switch switch off (Switch) off (Switch) electricity electricity light 0 (Watt) 0 (Watt) 0 (Lumen) light ADD 0 (lux) ≪ Plant ≫ light 0 (Lux) temperature 22 (Celcius) Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Composition CREST 4 a ≪ Plant growing system ≫ room temperature SPLIT SPLIT 22 (Celsius) ≪ Growing lamp ≫ room temperature temperature MAX MAX 22 (Celsius) 22 (Celsius) switch switch off (Switch) off (Switch) electricity electricity light 0 (Watt) 0 (Watt) 0 (Lumen) light ADD 0 (lux) ≪ Plant ≫ light 0 (Lux) temperature 22 (Celcius) Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Composition CREST 4 a ≪ Plant growing system ≫ room temperature SPLIT SPLIT 22 (Celsius) ≪ Growing lamp ≫ room temperature temperature MAX MAX 22 (Celsius) 22 (Celsius) switch switch off (Switch) off (Switch) ≪ ADD ≫ electricity electricity light lamp 0 (Watt) 0 (Watt) 0 (Lumen) 0 (Lumen) add light external 0 (lux) 0 (Lux) lamp / 0.25 ≪ Plant ≫ + external light light 0 (Lux) 0 (Lux) temperature 22 (Celcius) Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Language Realization CREST 5 a class GrowingLamp ( Entity ): electricity = Input (resource=res_electricity , init=0) light = Output (resource=res_light_lumen , init=0) on = current = State () off = State () off_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
Language Realization CREST 5 a class GrowingLamp ( Entity ): electricity = Input (resource=res_electricity , init=0) light = Output (resource=res_light_lumen , init=0) on = current = State () off = State () off_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
Language Realization CREST 5 a class GrowingLamp ( Entity ): electricity = Input (resource=res_electricity , init=0) light = Output (resource=res_light_lumen , init=0) on = current = State () off = State () off_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
Language Realization CREST 5 a class GrowingLamp ( Entity ): electricity = Input (resource=res_electricity , init=0) light = Output (resource=res_light_lumen , init=0) on = current = State () off = State () off_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
Language Realization CREST 5 a class GrowingLamp ( Entity ): electricity = Input (resource=res_electricity , init=0) light = Output (resource=res_light_lumen , init=0) on = current = State () off = State () off_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
Why not «formalism-XYZ» ? CREST 6 a ◮ powerful, but complex ◮ too generic ◮ feature workarounds ◮ architecture and behaviour Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
One DSL to rule them all? CREST 7 a Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST Formalization CREST 8 a � T , R , E , e � e = � P e , resource e , TS e , U e , entities e , Inf e � P e = I e ⊔ O e ⊔ L e TS = � S e , → e � ; → e ⊆ S e × S e × G e . . . Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
CREST Formalization CREST 8 a � T , R , E , e � e = � P e , resource e , TS e , U e , entities e , Inf e � P e = I e ⊔ O e ⊔ L e TS = � S e , → e � ; → e ⊆ S e × S e × G e . . . it’s in the paper Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
How to design a simulator CREST 9 a ◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
How to design a simulator CREST 9 a ◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams fill-level 10 full-signal fill level fill-level = 10 not full full 4.35 fill-level < 10 flow-rate: 0.5 per time step 0,0 10 t Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
How to design a simulator CREST 9 a ◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams fill-level 10 full-signal fill level fill-level = 10 not full full 4.35 fill-level < 10 flow-rate: 0.5 per time step 0,0 10 t Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
How to design a simulator CREST 9 a ◮ advance time in constant steps? ◮ transition time calculation ◮ generate CREST diagrams fill-level 10 full-signal fill level fill-level = 10 not full full 4.35 fill-level < 10 flow-rate: 0.5 per time step 0,0 10 11.3 t Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Verification CREST 10 a ◮ state space exploration ◮ zone/region-based verification Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Verification CREST 10 a ◮ 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
Verification CREST 10 a ◮ state space exploration ◮ zone/region-based verification ◮ requirements language Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Controller synthesis CREST 11 a ◮ planning + optimization + simulation ◮ changing parameters ◮ changing (sub-)systems Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Applications CREST 12 a plant growing home automation job scheduling office automation https://cs.wikipedia.org/wiki/Roomba#/media/File:IRobot_Roomba_780.jpg Klikovits et. al. CREST DSL stefan.klikovits@unige.ch
Recommend
More recommend