Distinguished Speakers - Professor Marta Kwiatkowska

53
OxWoCS Distinguished Seminar, 4 th December 2013 Based on 2012 Milner Lecture, University of Edinburgh Sensing everywhere: Sensing everywhere: Sensing everywhere: Sensing everywhere: on quantitative verification for on quantitative verification for on quantitative verification for on quantitative verification for ubiquitous computing ubiquitous computing ubiquitous computing ubiquitous computing Marta Kwiatkowska University of Oxford

Transcript of Distinguished Speakers - Professor Marta Kwiatkowska

Page 1: Distinguished Speakers -  Professor Marta Kwiatkowska

OxWoCS Distinguished Seminar, 4th December 2013Based on 2012 Milner Lecture, University of Edinburgh

Sensing everywhere:Sensing everywhere:Sensing everywhere:Sensing everywhere:

on quantitative verification for on quantitative verification for on quantitative verification for on quantitative verification for ubiquitous computingubiquitous computingubiquitous computingubiquitous computing

Marta KwiatkowskaUniversity of Oxford

Page 2: Distinguished Speakers -  Professor Marta Kwiatkowska

2

Where are computers?

Page 3: Distinguished Speakers -  Professor Marta Kwiatkowska

3

Once upon a time, back in the 1980s…

Page 4: Distinguished Speakers -  Professor Marta Kwiatkowska

4

Smartphones, tablets…

Access to Access to Access to Access to servicesservicesservicesservices:Email, banking, shopping,directions, …

Personalised monitoringPersonalised monitoringPersonalised monitoringPersonalised monitoring:GPS/GPRS trackingAccelerometer, pedometer, … Air quality

Page 5: Distinguished Speakers -  Professor Marta Kwiatkowska

5

House appliances, networked…

Fridge that Fridge that Fridge that Fridge that Tweets!Tweets!Tweets!Tweets!

Home networkInternet-enabledRemote controlEnergy management

Page 6: Distinguished Speakers -  Professor Marta Kwiatkowska

6

Autonomous systems…

Intelligent Intelligent Intelligent Intelligent transporttransporttransporttransport:

Self-parking carsDriverless carsSearch and rescueUnmanned missions…

Page 7: Distinguished Speakers -  Professor Marta Kwiatkowska

7

Medical devices…

Wearable or Wearable or Wearable or Wearable or implantable implantable implantable implantable health monitoringhealth monitoringhealth monitoringhealth monitoring

Heart rateBreathingMovementGlucose…

Page 8: Distinguished Speakers -  Professor Marta Kwiatkowska

8

Ubiquitous computing

• Computing without computers

• Populations of sensor-enabled computing devices that are

− embedded in the environment, or even in our body

− sensors for interaction and control of the environment

− software controlled, can communicate

− operate autonomously, unattended

− devices are mobile, handheld or wearable

− miniature size, limited resources, bandwidth and memory

− organised into communities

• Unstoppable technological progress

− smaller and smaller devices, more and more complex scenarios, increasing take up…

Page 9: Distinguished Speakers -  Professor Marta Kwiatkowska

9

Perspectives on ubiquitous computing

• Technological: calm technology [Weiser 1993]

− “The most profound technologies are those thatdisappear. They weave themselves into everyday life until they are indistinguishable from it.”

• Usability: ‘everyware’ [Greenfield 2008]

− Hardware/software evolved into ‘everyware’: household appliances that do computing

• Scientific: “Ubicomp can empower us, if we can understand it” [Milner 2008]

− “What concepts, theories and tools are needed to specify and describe ubiquitous systems,

their subsystems and their interaction?”

• This lecture: from theory to practice, for Ubicomp

− emphasis on practical, algorithmic techniques and industrially-relevant tools

Page 10: Distinguished Speakers -  Professor Marta Kwiatkowska

10

Software quality assurance

• Embedded software is a critical component

• Need quality assurance methodologies

− model-based development

− rigorous software engineering

− software product lines

• Use formal techniques to produce guarantees for:

− safety, reliability, performance, resource usage, trust, …

− (safety) “probability of failure to raise alarm is tolerably low”

− (performance) “the smartphone will complete the financial transaction within 10ms, with high probability”

• Focus on automated, tool-supported methodologies

− automated verification via model checking

− quantitative verification wrt quantitative properties

− eg probability, expected time, expected energy usage, etc

Page 11: Distinguished Speakers -  Professor Marta Kwiatkowska

11

Quantitative (probabilistic) verification

Probabilistic modele.g. Markov chain

Probabilistic temporallogic specificatione.g. PCTL, CSL, LTL

Result

Quantitativeresults

System

Counter-example

Systemrequire-ments

P<0.01 [ F≤t fail]

0.5

0.1

0.4

Probabilisticmodel checker

e.g. PRISM

Automatic verification (aka model checking) of quantitative properties of probabilistic system models

Page 12: Distinguished Speakers -  Professor Marta Kwiatkowska

12

Why automated verification?

• Errors in computerised systems can be costly…

Pentium chip (1994)Bug found in FPU.

Intel (eventually) offersto replace faulty chips.Estimated loss: $475m

Infusion pumps (2010)

Patients die because of incorrect dosage.

Cause: software malfunction.79 recalls.

Toyota Prius (2010)Software “glitch”

found in anti-lockbraking system.

185,000 cars recalled.

• Why verify?

• “Testing can only show the presence of errors,not their absence.” [Edsger Dijstra]

Page 13: Distinguished Speakers -  Professor Marta Kwiatkowska

13

Tool support: PRISM

• PRISM: Probabilistic symbolic model checker

− developed at Birmingham/Oxford University, since 1999

− free, open source software (GPL), runs on all major OSs

− continuously updated and extended

• Support for five probabilistic models:

− models: DTMCs, CTMCs, MDPs, PTAs, SMGs, …

− properties: PCTL, CSL, LTL, PCTL*, costs/rewards, rPATL, …

• Features:

− simple but flexible high-level modelling language

− user interface: editors, simulator, experiments, graph plotting

− multiple efficient model checking engines (e.g. symbolic)

− adopted and used across a multitude of application domains

• See: http://www.prismmodelchecker.org/

Page 14: Distinguished Speakers -  Professor Marta Kwiatkowska

14

Since release in 2001, 35,000 downloads, 90+ case studies, 250 external papers…

PRISM – Users worldwide

Page 15: Distinguished Speakers -  Professor Marta Kwiatkowska

15

PRISM – Case studies

• Over 90 case studies, many contributed…

• Randomised distributed algorithms

− consensus, leader election, self-stabilisation, …

• Randomised communication protocols

− Bluetooth, FireWire, Zeroconf, 802.11, Zigbee, gossiping, …

• Security protocols/systems

− contract signing, anonymity, pin cracking, quantum crypto, …

• Biological systems

− cell signalling pathways, DNA computation, …

• Planning & controller synthesis

− robotics, dynamic power management, autonomous driving, …

• Performance & reliability

− nanotechnology, cloud computing, manufacturing systems, …

• See: www.prismmodelchecker.org/casestudies

Page 16: Distinguished Speakers -  Professor Marta Kwiatkowska

16

The challenge of ubiquitous computing

• Quantitative verification is not powerful enough!

• Necessary to model communities and cooperation

− add self-interest and ability to form coalitions

• Need to monitor and control physical processes

− extend models with continuous flows

• In future important to interface to biological systems

− consider computation at the molecular scale…

• In this lecture, focus on the above directions

− each demonstrating transition from theory to practice

− formulating novel verification algorithms

− resulting in new software tools , beyond PRISM…

Page 17: Distinguished Speakers -  Professor Marta Kwiatkowska

17

Focus on…

Cooperation

•Self-interest

•Autonomy

Physical processes

•Monitoring

•Control

Natural world

•Biosensing

•Molecular programming

Page 18: Distinguished Speakers -  Professor Marta Kwiatkowska

18

Modelling cooperation

• Ubicomp systems are organised into communities

− self-interested agents, goal driven

− need to cooperate, e.g. in order to share bandwidth

− possibly opposing goals, hence competititive behaviour

− incentives to increase motivation and discourage selfishness

• Many typical scenarios

− e.g. user-centric networks, energy management or sensor network co-ordination

• Natural to adopt a game-theoretic view

− widely used in computer science, economics, …

− here, distinctive focus on algorithms, automated verification

• Research question: can we automatically verify cooperative and competitive behaviour?

Page 19: Distinguished Speakers -  Professor Marta Kwiatkowska

19

Energy management for the future?

• Microgrid: proposed model for future energy markets

− localised energy management

• Neighbourhoods use andstore electricity generatedfrom local sources

− wind, solar, …

• Needs: demand-sidemanagement

− active managementof demand by users

− to avoid peaks

− autonomousoperation

Page 20: Distinguished Speakers -  Professor Marta Kwiatkowska

20

Microgrid demand-side management

• New protocols proposed, here consider demand-side management algorithm of [Hildmann/Saffre’11]

− N households

− task submission probabilistic

− realistic daily demand curve

− aim to maximise value per household, while minimising total energy cost

• Analysis of [Hildmann/Saffre’11]

− simulation-based (providing all households stick to algorithm)

• Our analysis

− protocol modelled as a stochastic multi-player game

− clients can cheat (and cooperate)

− exposes protocol weakness

− propose/verify simple fix

Page 21: Distinguished Speakers -  Professor Marta Kwiatkowska

21

Results: Competitive behaviour

• The original algorithm does not discourage selfish behaviour…

All follow alg.

No use of alg.

Deviations ofvarying size

Strong incentive to deviate

Page 22: Distinguished Speakers -  Professor Marta Kwiatkowska

22

Results: Competitive behaviour

• Algorithm fix: simple punishment mechanism

− distribution manager can cancel some tasks

All follow alg.

Deviations ofvarying size

Better to collaborate(with all)

Page 23: Distinguished Speakers -  Professor Marta Kwiatkowska

23

Tool support: PRISM-games

• Prototype model checker for stochastic games

− integrated into PRISM model checker

− PRISM modelling language extended, adding games to the repertoire of models

− property specification language based on ATL (Alternating Temporal Logic)

• Further case studies

− team formation protocols

− collective decision making for sensor networks

− user-centric networks

− reputation-based network coordination protocols

• Available now:

− http://www.prismmodelchecker.org/games/

Page 24: Distinguished Speakers -  Professor Marta Kwiatkowska

24

Focus on…

Cooperation

•Self-interest

•Autonomy

Physical processes

•Monitoring

•Control

Natural world

•Biosensing

•Molecular programming

Page 25: Distinguished Speakers -  Professor Marta Kwiatkowska

25

Monitoring physical processes

• Ubicomp systems monitor and control physical processes

− electrical signal, velocity, distance, chemical concentration, …

− often modelled by non-linear differential equations

− necessary to extend models with continuous flows

• Many typical scenarios

− e.g. smart energy meters, automotive control, closed loop medical devices

• Natural to adopt hybrid system models, which combine discrete mode switches and continuous variables

− widely used in embedded systems, control engineering …

− probabilistic extensions needed to model failure

• Research question: can we apply quantitative verification to establish correctness of implantable cardiac pacemakers?

Page 26: Distinguished Speakers -  Professor Marta Kwiatkowska

26

Function of the heart

• Maintains blood circulation by contracting the atria and ventricles

− spontaneously generates electrical signal (action potential)

− conducted through cellular pathways into atrium, causing contraction of atria then ventricles

− repeats, maintaining 60-100 beats per minute

− a real-time system, and natural pacemaker

• Abnormalities in electrical conduction

− missed/slow heart beat

− can be corrected by by implantable pacemakers

Page 27: Distinguished Speakers -  Professor Marta Kwiatkowska

27

Implantable pacemaker

• How it works

− reads electrical (action potential) signals through sensors placed in the right atrium and right ventricle

− monitors the timing of heart beats and local electrical activity

− generates artificial pacing signalas necessary

• Embedded software

• Widely used, replaced every few years

• Unfortunately…

− 600,000 devices recalled during 1990-2000

− 200,000 due to firmware problems

Page 28: Distinguished Speakers -  Professor Marta Kwiatkowska

28

Quantitative verification for pacemakers

• Model the pacemaker and the heart, compose and verify

Page 29: Distinguished Speakers -  Professor Marta Kwiatkowska

29

Quantitative verification for pacemakers

Page 30: Distinguished Speakers -  Professor Marta Kwiatkowska

30

Quantitative verification for pacemakers

Page 31: Distinguished Speakers -  Professor Marta Kwiatkowska

31

Correction of Bradycardia

Purple lines original (slow) heart beat, green are induced (correcting)

Page 32: Distinguished Speakers -  Professor Marta Kwiatkowska

32

Tool support: PRISM & MATLAB Simulink

• Develop model-based framework

− timed automata models for pacemaker

− hybrid heart models in Simulink

− probabilistic switching between diseases,can be learnt from patient data

• Properties

− (basic safety) maintain 60-100 beats per minute

− (advanced analysis) energy usage, plotted against timing parameters of the pacemaker

• Now supported by ERC Proof ofConcept grant VERIPACE

• See

http://www.veriware.org/pacemaker.php

Page 33: Distinguished Speakers -  Professor Marta Kwiatkowska

33

Focus on…

Cooperation

•Self-interest

•Autonomy

Physical processes

•Monitoring

•Control

Natural world

•Biosensing

•Molecular programming

Page 34: Distinguished Speakers -  Professor Marta Kwiatkowska

34

Interacting with the natural world

• Ubicomp systems need to sense and control biological processes

− programmable identification of substance, targeted delivery, movement

− directly at the molecular level

• Many typical scenarios

− e.g. drug delivery directly into the blood stream, implantable continuous monitoring devices

• Natural to adopt the molecular programming approach

− here, focus on DNA computation, which aims to build computing devices using DNA molecules

− shared techniques and tools with synthetic biology

• Research question: can we apply (quantitative) verification to DNA programming?

Page 35: Distinguished Speakers -  Professor Marta Kwiatkowska

35

Digital circuits

• Logic gates realised in silicon

• 0s and 1s are represented as low and high voltage

• Hardware verification indispensable as design methodology

Page 36: Distinguished Speakers -  Professor Marta Kwiatkowska

36

DNA circuits

Pop quiz, hotshot: what's the square root of 13?Science Photo Library/Alamy

[Qian, Winfree,Science 2012]

• “Computing with soup” (The Economist 2012)

• DNA strands are inputs and outputs

• Circuit of 130 strands computes square root of 4 bit number,rounded down

• 10 hours, but it’s a first…

Page 37: Distinguished Speakers -  Professor Marta Kwiatkowska

37

DNA structures

2nm

DNA origami

• DNA origami [Rothemund, Nature 2006]

− DNA can self-assemble into structures – “molecular IKEA?”

− Programmable self-assembly (can form tiles, nanotubes, boxes that can open, etc)

− Simple manufacturing process (heating and cooling), not yet well understood

Page 38: Distinguished Speakers -  Professor Marta Kwiatkowska

38

Why DNA programming?

• A different perspective on programming – more like chemistry…

− DNA: versatile, easily accessible, cheap to synthesiseinformation processing material

− “DNA as a universal substrate”: any finite network of chemical reactions can be implemented with DNA molecules

− Moore’s law, hence need to make devices smaller…

• Many applications for combinations of DNA logic circuits, origami and molecular walker technologies

− e.g. point of care diagnostics (Tuberculosis) [Ellington], smart drug delivery, …

• Can we transfer verification to this new application domain?

− stochasticity essential!

Page 39: Distinguished Speakers -  Professor Marta Kwiatkowska

39

Computation in DNA

http://lucacardelli.name/

Page 40: Distinguished Speakers -  Professor Marta Kwiatkowska

40

Example: Transducer

• Transducer: full reaction list

input outputunreactive structures(no exposed toeholds)

Page 41: Distinguished Speakers -  Professor Marta Kwiatkowska

41

Results: debugging DNA circuits

• Unwanted deadlock!

− OK for one, fails for two copies of the gates

• PRISM identifies a 5-step trace to the“bad” deadlock state

− previously found manually [Cardelli’10]

− detection now fully automated

• Bug is easily fixed

− (and verified)

Counterexample:Counterexample:Counterexample:Counterexample:(1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)(0,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)(0,0,1,0,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)(0,0,1,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)(0,0,1,0,1,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0)(0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0)

reactive gates

http://www.veriware.org/dna.php

Page 42: Distinguished Speakers -  Professor Marta Kwiatkowska

42

Transducers: Quantitative properties

• We can also use PRISM to study the kinetics of the pair of (faulty) transducers:

− P=? [ F[T,T] "deadlock" ]

− P=? [ F[T,T] "deadlock" & !"all_done" ]

− P=? [ F[T,T] "deadlock" & "all_done" ]success/errorequally likely

Page 43: Distinguished Speakers -  Professor Marta Kwiatkowska

43

Tool support: DSD & PRISM

• Developed a framework incorporating DSD and PRISM

− DSD designs automatically translated to PRISM via SBML

• Model checking as for molecular signalling networks

− reduction to CTMC model

− reuse existing PRISM algorithms

• Achievements

− first ever (quantitative) verification of a DNA circuit

− demonstrated bugs can be found automatically

− but scalability major challenge

• Further case studies

− approximated majority, molecular walkers

• Available now:

http://www.veriware.org/dna.php

Page 44: Distinguished Speakers -  Professor Marta Kwiatkowska

44

Summing up…

• Brief overview of three directions of particular importance to ubiquitous computing

− demonstrating first successes and usefulness of quantitative verification methodology

− and resulting in new techniques and tools

• Many challenges remain

− for cooperation, addressing more general quantitative goals

− incorporation of quantitative verification in pacemaker development environments, and

− scalability of verification for molecular programming models

• More challenges not covered in this lecture

− controller synthesis, code generation, runtime verification, approximate methods, more expressive models and logics, new application domains, …

Page 45: Distinguished Speakers -  Professor Marta Kwiatkowska

45

Acknowledgements

• My group and collaborators in this work

• Collaborators who contributed to theoretical and practical PRISM development

• External users of, and contributors to, PRISM

• Project funding

− ERC, EPSRC

− Oxford Martin School, Institute for the Future of Computing

• See also

− www.veriware.org

− PRISM www.prismmodelchecker.org

Page 46: Distinguished Speakers -  Professor Marta Kwiatkowska

46

Personal journey

• Career path

− graduated in Computer Science from Jagiellonian University

− junior assistant professor, PhD scholar, lecturer, reader, professor (personal chair), statutory chair at Oxford

− several ‘firsts’

• PhD in Computer Science at Leicester

• female professor in Computer Science at Birmingham and Oxford

− married, 1 daughter

• The transition…

− from approx. 50-50 gender balance as an undergraduate, to the only female lecturer in my then department…

Page 47: Distinguished Speakers -  Professor Marta Kwiatkowska

47

Women in UK universities

Source:http://www.shu.ac.uk/witec/ukprojects/documents/conferencereport.pdf

Page 48: Distinguished Speakers -  Professor Marta Kwiatkowska

48

Women and career ladder

Source:The Times Higher May 25 1999

• News headline…

Page 49: Distinguished Speakers -  Professor Marta Kwiatkowska

49

Women and career ladder

• In 1984, 3% of all professors were women (93 in total), and only a few had children

• In 2012, 20%

• Baseline? First female full professor at Oxford in 1948

Progress!

Page 50: Distinguished Speakers -  Professor Marta Kwiatkowska

50

How about Oxford?

Page 51: Distinguished Speakers -  Professor Marta Kwiatkowska

51

Personal perspective on academic career

• Exciting developments make for a very exciting time as a computer scientist!

• Academic career offers freedom to pursue own ideas and developing new theories, good for creative types

− “Anyone who has never made a mistake has never tried anything new.” (Einstein)

• Theory has beauty and elegance, but my greatest satisfaction resulted from seeing theory applied and used

− “Important to keep a live connection between theory and application in computer science”. (Milner)

• Collaborating and seeing students grow and develop is most rewarding

− “For a research worker, collaborators are almost indispensable, for in isolation he will in most cases be lost.” (Janiszewski)

Page 52: Distinguished Speakers -  Professor Marta Kwiatkowska

52

It’s about role models

Source: http://www.aip.org/history/curie/contents.htm

ARIE SKLODOWSKA CURIE opened up the

science of radioactivity. She is best known as the

discoverer of the radioactive elements polonium and

radium and as the first person to win two Nobel

prizes. For scientists and the public, her radium was

a key to a basic change in our understanding of

matter and energy. Her work not only influenced the

development of fundamental science but also

ushered in a new era in medical research and

treatment.

Page 53: Distinguished Speakers -  Professor Marta Kwiatkowska

Thank you for your attention