Resurrecting Laplace's Demon: The Case for Deterministic Models - - PowerPoint PPT Presentation

resurrecting laplace s demon the case for deterministic
SMART_READER_LITE
LIVE PREVIEW

Resurrecting Laplace's Demon: The Case for Deterministic Models - - PowerPoint PPT Presentation

Resurrecting Laplace's Demon: The Case for Deterministic Models Edward A. Lee Robert S. Pepper Distinguished Professor UC Berkeley Invited Talk: Synchron December 8, 2016 Bamberg, Germany Context: Cyber-Physical Systems A par/cularly


slide-1
SLIDE 1

Resurrecting Laplace's Demon: The Case for Deterministic Models

Edward A. Lee

Robert S. Pepper Distinguished Professor UC Berkeley

Invited Talk: Synchron December 8, 2016 Bamberg, Germany

slide-2
SLIDE 2

Not just informa.on technology:

  • Cyber + Physical
  • Computa/on + Dynamics
  • Security + Safety

Proper.es:

  • Highly dynamic
  • Safety cri/cal
  • Uncertain environment
  • Physically distributed
  • Sporadic connec/vity
  • Resource constrained

Does it make sense to talk about determinis7c models for such systems?

Automotive

Context: Cyber-Physical Systems

A par/cularly challenging case for determinism

Biomedical Military Energy Manufacturing

Avionics

Buildings

2

Lee, Berkeley

slide-3
SLIDE 3

Models vs. Reality

In this example, the modeling framework is calculus and Newton’s laws. Fidelity is how well the model and its target match

Lee, Berkeley

3

The model The target (the thing being modeled).

slide-4
SLIDE 4

Solomon Wolf Golomb You will never strike oil by drilling through the map!

Lee, Berkeley

4

Engineers often confuse the model with its target

But this does not in any way diminish the value of a map!

slide-5
SLIDE 5

Determinacy

Some of the most valuable models are determinis7c.

A model is determinis7c if, given the ini/al state and the inputs, the model defines exactly one behavior. Determinis/c models have proven extremely valuable in the past.

Lee, Berkeley

5

slide-6
SLIDE 6

Laplace’s Demon

“We may regard the present state of the universe as the effect of its past and the cause of its future. An intellect which at a certain moment would know all forces that set nature in mo/on, and all posi/ons of all items of which nature is composed, if this intellect were also vast enough to submit these data to analysis, it would embrace in a single formula the movements of the greatest bodies of the universe and those of the /niest atom; for such an intellect nothing would be uncertain and the future just like the past would be present before its eyes.” — Pierre Simon Laplace

Lee, Berkeley

6

Pierre-Simon Laplace (1749–1827). Portrait by Joan-Baptiste Paulin Guérin, 1838

slide-7
SLIDE 7

Did quantum mechanics dash this hope?

“At first, it seemed that these hopes for a complete determinism would be dashed by the discovery early in the 20th century that events like the decay of radioac/ve atoms seemed to take place at random. It was as if God was playing dice, in Einstein’s phrase. But science snatched victory from the jaws

  • f defeat by moving the goal posts and

redefining what is meant by a complete knowledge of the universe.” (Stephen Hawking, 2002)

Lee, Berkeley

7

slide-8
SLIDE 8

Nevertheless, Laplace’s Demon cannot exist.

In 2008, David Wolpert, then at NASA, now at the Santa Fe Research Ins/tute, used Cantor’s diagonaliza/on technique to prove that Laplace’s demon cannot exist. His proof relies on the observa/on that such a demon, were it to exist, would have to exist in the very physical world that it predicts.

Lee, Berkeley

8

David Wolpert

slide-9
SLIDE 9

The Koptez Principle

Many properties that we assert about systems (determinism, timeliness, reliability) are in fact not properties of the system, but rather properties of a model of the system. If we accept this, then it makes no sense to talk about whether the physical world is

  • deterministic. It only makes sense to talk

about whether models of the physical world are deterministic.

Hermann Kopetz Professor (Emeritus) TU Vienna

slide-10
SLIDE 10

The ques/on switches from whether a model is True to whether it is Useful

“Essen/ally, all models are wrong, but some are useful.”

Box, G. E. P. and N. R. Draper, 1987: Empirical Model-Building and Response

  • Surfaces. Wiley Series in Probability and Sta/s/cs, Wiley.

Lee, Berkeley

10

slide-11
SLIDE 11

Physicists con/nue to debate whether the world is determinis/c

Determinism is a property of models, not a property of the systems they model.

Lee, Berkeley

11

Deterministic model Deterministic system?

slide-12
SLIDE 12

Schema/c of a simple Cyber-Physical System

Lee, Berkeley

12

What kinds of models should we use? Let’s look at the most successful kinds of models from the cyber and the physical worlds.

slide-13
SLIDE 13

Socware is a Model

Physical System Model Single-threaded impera7ve programs are determinis7c models

Lee, Berkeley

13

slide-14
SLIDE 14

Consider single-threaded impera/ve programs

The target of the model is electrons sloshing around in silicon. It takes /me, consumes energy, and fails if dropped in the ocean, none of which are proper/es of the model. This program defines exactly one behavior, given the input x. Note that the modeling framework (the C language, in this case) defines “behavior” and “input.”

Lee, Berkeley

14

slide-15
SLIDE 15

Socware relies on another determinis/c model that abstracts the hardware Physical System Model Instruction Set Architectures (ISAs) are deterministic models

Lee, Berkeley

15

Image: Wikimedia Commons

Waterman, et al., The RISC-V Instruction Set Manual, UCB/EECS-2011-62, 2011

slide-16
SLIDE 16

… which relies on yet another determinis/c model

Physical System Model Synchronous digital logic is a determinis7c model

Lee, Berkeley

16

slide-17
SLIDE 17

Determinis/c Models for the Physical Side of CPS

Physical System Model

Signal Signal

Differen7al Equa7ons are determinis7c models

Lee, Berkeley

17

Image: Wikimedia Commons

slide-18
SLIDE 18

Signal Signal

18

Image: Wikimedia Commons

Lee, Berkeley

A major problem for CPS: combina/ons of determinis/c models are nondeterminis/c

slide-19
SLIDE 19

Correct execution of a program in all widely used programming languages, and correct delivery of a network message in all general-purpose networks has nothing to do with how long it takes to do anything.

Programmers have to step outside the programming abstractions to specify timing behavior. CPS designers have no map!

Lee, Berkeley

19

Timing is not part of software and network semantics

slide-20
SLIDE 20

A Story

In “fly by wire” aircrac, computers control the plane, media/ng pilot commands.

slide-21
SLIDE 21

Abstrac/on Layers

All of which are models except the bofom

The purpose of an abstrac/on is to hide details of the implementa/on below and provide a plagorm for design from above.

slide-22
SLIDE 22

Abstrac/on Layers

All of which are models except the bofom

Every abstrac/on layer has failed for the aircrac designer. The design is the implementa/on.

slide-23
SLIDE 23

Determinism? Really?

CPS applica/ons operate in an intrinsically nondeterminis/c world. Does it really make sense to insist on determinis7c models?

23

Lee, Berkeley

slide-24
SLIDE 24
  • In science, the value of a model lies in how well its

behavior matches that of the physical system.

  • In engineering, the value of the physical system lies

in how well its behavior matches that of the model.

Lee, Berkeley

24

In engineering, model fidelity is a two-way street! For a model to be useful, it is necessary (but not sufficient) to be able to be able to construct a faithful physical realization.

The Value of Models

slide-25
SLIDE 25

A Model

Lee, Berkeley

25

slide-26
SLIDE 26

A Physical Realiza/on

Lee, Berkeley

26

slide-27
SLIDE 27

Model Fidelity

  • To a scien7st, the model is flawed.
  • To an engineer, the realiza/on is flawed.

I’m an engineer…

Lee, Berkeley

27

slide-28
SLIDE 28

For CPS, we need to change the ques/on

The ques/on is not whether determinis/c models can describe the behavior of cyber- physical systems (with high fidelity). The ques/on is whether we can build cyber- physical systems whose behavior matches that

  • f a determinis/c model (with high probability).

Lee, Berkeley

28

slide-29
SLIDE 29

Determinism?

What about resilience? Adaptability?

Determinis/c models do not eliminate the need for robust, fault-tolerant designs. In fact, they enable such designs, because they make it much clearer what it means to have a fault!

Lee, Berkeley

29

slide-30
SLIDE 30

Enter: Synchronous Languages

  • Determinis/c

concurrency But:

  • Time between /cks?
  • WCET over all reac/ons?
  • Distributed systems?

Lee, Berkeley

30

slide-31
SLIDE 31

Useful determinis/c models for CPS

To get determinis/c models for CPS with faithful implementa/ons, we can:

  • 1. Use processors with controllable /ming

(PRET machines).

– hfp://chess.eecs.berkeley.edu/pret

  • 2. Extend synchronous languages with a

(superdense) model of /me

– Lee and Zheng, EMSOFT 2007

  • 3. Synchronize clocks and create

distributed real-/me execu/on (PTIDES)

– hfp://chess.eecs.berkeley.edu/p/des

Lee, Berkeley

31

Together, these technologies give a programming model for distributed and concurrent real-7me systems that is determinis7c in the sense of single- threaded impera7ve programs, and also determinis7c w.r.t. to 7ming of external interac7ons.

slide-32
SLIDE 32

Extending SR to get DE

  • Time to the next /ck is determined by /me-

stamped discrete events.

  • At each /ck, use a least fixed-point seman/cs,

as usual with synchronous languages.

Lee, Berkeley

32

EMSOFT 2007

slide-33
SLIDE 33

Abstract: Discrete-event (DE) models are formal system specifica/ons that have analyzable determinis/c behaviors. Using a global, consistent no/on of /me, DE components communicate via /me-stamped events. DE models have primarily been used in performance modeling and simula/on, where /me stamps are a modeling property bearing no rela/onship to real /me during execu/on of the model. In this paper, we extend DE models with the capability of rela/ng certain events to physical /me…

33

Lee, Berkeley

Ptides – A Robust Distributed Deterministic DE MoC

slide-34
SLIDE 34

Using Synchronized Clocks in Distributed Systems: Roots of the Idea

ACM Transac/ons on Programming Languages and Systems, 1984.

Lee, Berkeley

34

slide-35
SLIDE 35

Google Spanner – A Reinven/on

Google independently developed a very similar technique and applied it to distributed databases.

Lee, Berkeley

35

Proceedings of OSDI 2012

slide-36
SLIDE 36

Bound C1 on computation time Time stamp sensor data

Lee, Berkeley

36

Ptides: Time stamps bind to real time at sensors and actuators

Bound L on network latency Bound E on clock synchronization error An event here with time stamp T can be processed when the local clock exceeds T+C1+L+E Bound C2 on computation time Logical delay D Event is delivered to the actuator on time if D ≥ C1+C2+L+E

slide-37
SLIDE 37

Determinis/c Distributed Real-Time

Assume bounds on:

  • execu7on 7me
  • clock synchroniza7on error
  • network latency

then events are processed in .me-stamp order at every component and events are delivered to actuators on .me.

Lee, Berkeley

37

See http://chess.eecs.berkeley.edu/ptides

slide-38
SLIDE 38

All of the assumptions are achievable with today’s technology, and are requirements anyway for hard-real- time systems. The Ptides model makes the requirements explicit. Lee, Berkeley

38

So Many Assumptions?

You will never strike oil by drilling through the map!

Violations of the requirements are detectable as out-of-order events and can be treated as faults.

Non-Synchronized Clocks

slide-39
SLIDE 39

A fault manifests as out-of-order events.

… after an event here with a later time stamp has been processed, then fault! If an event arrives here with an earlier time stamp…

Occurrence

  • f a fault

implies one

  • r more of

the assumptions was violated. Lee, Berkeley

39

Handling Faults

slide-40
SLIDE 40

But…

Determinism has its limits.

Lee, Berkeley

40

  • Complexity
  • Uncertainty
  • Chaos
  • Incompleteness
slide-41
SLIDE 41

Complexity

  • Some systems are

too complex for determinis/c models.

  • Nondeterminis/c

abstrac/ons become useful.

Lee, Berkeley

41

“Iron wing” model of an Airbus A350.

slide-42
SLIDE 42

Complexity

  • Some systems are

too complex for determinis/c models.

  • Nondeterminis/c

abstrac/ons become useful.

Lee, Berkeley

42

Deep Learning, draft book in preparation, by Yoshua Bengio, Ian Goodfellow, and Aaron Courville. http://www.deeplearningbook.org/

slide-43
SLIDE 43

But…

Determinism has its limits.

Lee, Berkeley

43

  • Complexity
  • Uncertainty
  • Chaos
  • Incompleteness
slide-44
SLIDE 44

Uncertainty

  • We can’t construct

determinis/c models of what we don’t know.

  • For this, nondeterminism

is useful.

  • Bayesian probability (which

is mostly due to Laplace) quan/fies uncertainty.

Lee, Berkeley

44

Portrait of Reverend Thomas Bayes (1701 - 1761) that is probably not actually him.

slide-45
SLIDE 45

But…

Determinism has its limits.

Lee, Berkeley

45

  • Complexity
  • Uncertainty
  • Chaos
  • Incompleteness
slide-46
SLIDE 46

Determinism does not imply predictability

Lee, Berkeley

46

Edward Lorenz

slide-47
SLIDE 47

Determinism does not imply predictability

Lee, Berkeley

47

Edward Lorenz

The position of a point is not meaningfully predictable even though the system is deterministic.

slide-48
SLIDE 48

Determinism does not imply predictability

[Thiele and Kumar, EMSOFT 2015]

Lee, Berkeley

48

slide-49
SLIDE 49

But…

Determinism has its limits.

Lee, Berkeley

49

  • Complexity
  • Uncertainty
  • Chaos
  • Incompleteness
slide-50
SLIDE 50

Incompleteness of Determinism

Any set of determinis/c models rich enough to encompass Newton’s laws plus discrete transi/ons is incomplete.

Lee, Fundamental Limits

  • f Cyber-Physical Systems

Modeling, ACM Tr. on CPS,

  • Vol. 1, No. 1,

November 2016

Lee, Berkeley

50

slide-51
SLIDE 51

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

51

slide-52
SLIDE 52

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

52

slide-53
SLIDE 53

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

53

slide-54
SLIDE 54

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

54

slide-55
SLIDE 55

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

55

slide-56
SLIDE 56

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

56

slide-57
SLIDE 57

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

57

slide-58
SLIDE 58

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

58

slide-59
SLIDE 59

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

59

slide-60
SLIDE 60

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

60

slide-61
SLIDE 61

Illustra/on of the Incompleteness of Determinism

Lee, Berkeley

61

slide-62
SLIDE 62

Arbitrary Interleaving Yields Nondeterminism

Lee, Berkeley

62

slide-63
SLIDE 63

Recall the Heisenberg Uncertainty Principle

Lee, Berkeley

63

slide-64
SLIDE 64

Is Determinism Incomplete?

  • In Lee (2017), I show that this sequence of models is Cauchy, so the space of

determinis/c models is incomplete (it does not contain its own limit points).

  • In Lee (2014), I show that a direct descrip/on of this scenario results in a non-

construc/ve model. The nondeterminism arises in making this model construc/ve.

Lee, Berkeley

64

slide-65
SLIDE 65

Rejec/ng discreteness leads to determinis/c chaos

A con/nuous determinis/c model that models the balls as springs is chao/c.

Lee, Berkeley

65

slide-66
SLIDE 66

Discrete behaviors cannot be excluded unless we also reject causality

Lee, Berkeley

66

Example from Lee, “Constructive Models of Discrete and Continuous Physical Phenomena,” IEEE Access, 2014

slide-67
SLIDE 67

Summary

  • Determinis/c models are extremely useful.
  • Combining of our best determinis/c cyber models and

physical models today yields nondeterminis/c models.

  • But determinis/c models with faithful implementa/ons

exist (in research) for cyber-physical systems.

  • Determinis/c models aren’t always possible or prac/cal

due to complexity, unknowns, chaos, and incompleteness.

  • Determinism is a powerful modeling tool.

Use it if you can. Back off only when you can’t.

Lee, Berkeley

67

slide-68
SLIDE 68

Conclusion

Models play a central role in reasoning about and designing engineered systems. Determinism is a valuable and subtle property of models.

Lee, Berkeley

68

Plato and the Nerd

On Technology and Creativity Edward Ashford Lee MIT Press, 2017 Forthcoming book My first for a general audience