03: Choice & Control 15-424: Foundations of Cyber-Physical - - PowerPoint PPT Presentation

03 choice control
SMART_READER_LITE
LIVE PREVIEW

03: Choice & Control 15-424: Foundations of Cyber-Physical - - PowerPoint PPT Presentation

03: Choice & Control 15-424: Foundations of Cyber-Physical Systems Andr e Platzer aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA 0.5 0.4 0.3 0.2 1.0 0.1 0.8 0.6 0.4 0.2 Andr e


slide-1
SLIDE 1

03: Choice & Control

15-424: Foundations of Cyber-Physical Systems Andr´ e Platzer

aplatzer@cs.cmu.edu Computer Science Department Carnegie Mellon University, Pittsburgh, PA

0.2 0.4 0.6 0.8 1.0

0.1 0.2 0.3 0.4 0.5

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 1 / 10

slide-2
SLIDE 2

Outline

1

Learning Objectives

2

Gradual Introduction to Hybrid Programs

3

Notational Convention

4

Semantics of Hybrid Programs

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 2 / 10

slide-3
SLIDE 3

Outline

1

Learning Objectives

2

Gradual Introduction to Hybrid Programs

3

Notational Convention

4

Semantics of Hybrid Programs

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 2 / 10

slide-4
SLIDE 4

Learning Objectives

Choice & Control

CT M&C CPS nondeterminism abstraction programming languages for CPS semantics compositionality models core principles discrete+ continuous

  • perational effect
  • perational precision

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 3 / 10

slide-5
SLIDE 5

Outline

1

Learning Objectives

2

Gradual Introduction to Hybrid Programs

3

Notational Convention

4

Semantics of Hybrid Programs

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 3 / 10

slide-6
SLIDE 6

Playing with Acceleration and Braking

Example (Speedy the point)

a := a + 1; {x′ = v, v′ = a}

1 2 3 4 5 6 7 t 2.5 2.0 1.5 1.0 0.5 0.0 0.5a 1 2 3 4 5 6 7 t 2 2 4 6v

m

1 2 3 4 5 6 7 t 2 2 4 6 8 10

x

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 4 / 10

slide-7
SLIDE 7

Playing with Acceleration and Braking

Example (Speedy the point)

a := −2; {x′ = v, v′ = a}; a := 0.25; {x′ = v, v′ = a}; a := −2; {x′ = v, v′ = a}; a := 0.25; {x′ = v, v′ = a}; a := −2; {x′ = v, v′ = a}; a := 0.25; {x′ = v, v′ = a}

1 2 3 4 5 6 7 t 2.5 2.0 1.5 1.0 0.5 0.0 0.5a 1 2 3 4 5 6 7 t 2 2 4 6v

m

1 2 3 4 5 6 7 t 2 2 4 6 8 10

x

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 4 / 10

slide-8
SLIDE 8

Outline

1

Learning Objectives

2

Gradual Introduction to Hybrid Programs

3

Notational Convention

4

Semantics of Hybrid Programs

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 4 / 10

slide-9
SLIDE 9

Notational Conventions: Names

Example (Naming Conventions)

Letters Convention x, y, z variables e, ˜ e terms P, Q formulas α, β programs c constant symbols f , g, h function symbols p, q, r predicate symbols In CPS applications, all bets are off because names follow application: x position v velocity and a acceleration variables

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 5 / 10

slide-10
SLIDE 10

Notational Conventions: Precedence

Convention (Operator Precedence)

1 Unary operators (including ∗, ¬ and ∀x, ∃x) bind stronger than binary. 2 ∧ bind stronger than ∨, which binds stronger than →, ↔ 3 ; bind stronger than ∪ 4 Arithmetic operators +, −, · associate to the left 5 Logical and program operators associate to the right

Example (Operator Precedence)

∀x P ∧ Q ≡ (∀x P) ∧ Q ∀x P → Q ≡ (∀x P) → Q. α; β ∪ γ ≡ (α; β) ∪ γ α ∪ β; γ ≡ α ∪ (β; γ) α; β∗ ≡ α; (β∗) P → Q → R ≡ P → (Q → R). But →, ↔ expect explicit parentheses. Illegal: P → Q ↔ R P ↔ Q → R

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 6 / 10

slide-11
SLIDE 11

Outline

1

Learning Objectives

2

Gradual Introduction to Hybrid Programs

3

Notational Convention

4

Semantics of Hybrid Programs

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 6 / 10

slide-12
SLIDE 12

Hybrid Program: Semantics

Definition (Hybrid program semantics) ([ [·] ] : HP → ℘(S × S))

[ [x := e] ] = {(ω, ν) : ν = ω except ν[ [x] ] = ω[ [e] ]} [ [?Q] ] = {(ω, ω) : ω ∈ [ [Q] ]} [ [x′ = f (x)] ] = {(ϕ(0), ϕ(r)) : ϕ | = x′ = f (x) for some duration r} [ [α ∪ β] ] = [ [α] ] ∪ [ [β] ] [ [α; β] ] = [ [α] ] ◦ [ [β] ] [ [α∗] ] =

  • n∈N

[ [αn] ]

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 7 / 10

slide-13
SLIDE 13

Hybrid Program: Semantics

ω ν x := e t x ω ν if ν(x) = ω[ [e] ] and ν(z) = ω(z) for z = x

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-14
SLIDE 14

Hybrid Program: Semantics

ω ν x := e t x ω ν if ν(x) = ω[ [e] ] and ν(z) = ω(z) for z = x ω ν x′ = f (x) & Q t x Q ν ω ϕ(t) r x′ = f (x) & Q

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-15
SLIDE 15

Hybrid Program: Semantics

ω ν x := e t x ω ν if ν(x) = ω[ [e] ] and ν(z) = ω(z) for z = x ω ν x′ = f (x) & Q t x Q ν ω ϕ(t) r x′ = f (x) & Q ω ?Q if ω ∈ [ [Q] ] t x ω no change if ω ∈ [ [Q] ]

  • therwise no transition

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-16
SLIDE 16

Hybrid Program: Semantics

ω ν1 ν2 α β α ∪ β t x ω ν1 ν2

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-17
SLIDE 17

Hybrid Program: Semantics

ω ν1 ν2 α β α ∪ β t x ω ν1 ν2 ω µ ν α ; β α β t x s ω ν

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-18
SLIDE 18

Hybrid Program: Semantics

ω ν1 ν2 α β α ∪ β t x ω ν1 ν2 ω µ ν α ; β α β t x s ω ν ω ω1 ω2 ν α∗ α α α t x ω ν

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-19
SLIDE 19

Hybrid Program: Semantics

ω ν1 ν2 α β α ∪ β t x ω ν1 ν2 ω µ ν α ; β α β t x s ω ν ω ω1 ω2 ν α∗ α α α t x ω ν

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-20
SLIDE 20

Hybrid Program: Semantics

ω ν1 ν2 α β α ∪ β t x ω ν1 ν2 ω µ ν α ; β α β t x s ω ν ω ω1 ω2 ν (α; β)∗ α β α β α β t x ω ν

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10

slide-21
SLIDE 21

Hybrid Program: Semantics

Definition (dL Formulas)

ω [a]P P P P

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10

slide-22
SLIDE 22

Hybrid Program: Semantics

Definition (dL Formulas)

ω aP P

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10

slide-23
SLIDE 23

Hybrid Program: Semantics

Definition (dL Formulas)

ω a-span [a]P

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10

slide-24
SLIDE 24

Hybrid Program: Semantics

Definition (dL Formulas)

ω a-span [a]P bP b-span

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10

slide-25
SLIDE 25

Hybrid Program: Semantics

Definition (dL Formulas)

ω a-span [a]P bP b-span b[a]-span

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10

slide-26
SLIDE 26

Hybrid Program: Semantics

Definition (dL Formulas)

ω a-span [a]P bP b-span b[a]-span compositional semantics ⇒ compositional proofs!

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10

slide-27
SLIDE 27

Hybrid Program: Semantics

Definition (Hybrid program semantics) ([ [·] ] : HP → ℘(S × S))

[ [x := e] ] = {(ω, ν) : ν = ω except ν[ [x] ] = ω[ [e] ]} [ [?Q] ] = {(ω, ω) : ω ∈ [ [Q] ]} [ [x′ = f (x)] ] = {(ϕ(0), ϕ(r)) : ϕ | = x′ = f (x) for some duration r} [ [α ∪ β] ] = [ [α] ] ∪ [ [β] ] [ [α; β] ] = [ [α] ] ◦ [ [β] ] [ [α∗] ] =

  • n∈N

[ [αn] ]

Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 10 / 10