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 Platzer (CMU) FCPS / 03: Choice & Control 1 / 10
Outline Learning Objectives 1 Gradual Introduction to Hybrid Programs 2 Notational Convention 3 Semantics of Hybrid Programs 4 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 2 / 10
Outline Learning Objectives 1 Gradual Introduction to Hybrid Programs 2 Notational Convention 3 Semantics of Hybrid Programs 4 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 2 / 10
Learning Objectives Choice & Control nondeterminism abstraction programming languages for CPS semantics compositionality CT M&C CPS models operational effect core principles operational precision discrete+ continuous Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 3 / 10
Outline Learning Objectives 1 Gradual Introduction to Hybrid Programs 2 Notational Convention 3 Semantics of Hybrid Programs 4 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 3 / 10
Playing with Acceleration and Braking Example (Speedy the point) a := a + 1; { x ′ = v , v ′ = a } 6 v x 0.5 a 10 m 7 t 0.0 8 1 2 3 4 5 6 4 � 0.5 6 2 � 1.0 4 � 1.5 2 7 t 0 1 2 3 4 5 6 7 t � 2.0 0 1 2 3 4 5 6 � 2.5 � 2 � 2 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 4 / 10
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 } 6 v x 0.5 a 10 m 7 t 0.0 8 1 2 3 4 5 6 4 � 0.5 6 2 � 1.0 4 � 1.5 2 7 t 0 1 2 3 4 5 6 7 t � 2.0 0 1 2 3 4 5 6 � 2.5 � 2 � 2 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 4 / 10
Outline Learning Objectives 1 Gradual Introduction to Hybrid Programs 2 Notational Convention 3 Semantics of Hybrid Programs 4 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 4 / 10
Notational Conventions: Names Example (Naming Conventions) Letters Convention x , y , z variables e , ˜ e terms P , Q formulas α, β programs constant symbols c f , g , h function symbols predicate symbols p , q , r 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
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
Outline Learning Objectives 1 Gradual Introduction to Hybrid Programs 2 Notational Convention 3 Semantics of Hybrid Programs 4 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 6 / 10
Hybrid Program: Semantics Definition (Hybrid program semantics) ([ [ · ] ] : HP → ℘ ( S × S )) [ [ x := e ] ] = { ( ω, ν ) : ν = ω except ν [ [ x ] ] = ω [ [ e ] ] } [ [? Q ] ] = { ( ω, ω ) : ω ∈ [ [ Q ] ] } [ x ′ = f ( x )] = x ′ = f ( x ) for some duration r } [ ] = { ( ϕ (0) , ϕ ( r )) : ϕ | [ [ α ∪ β ] ] = [ [ α ] ] ∪ [ [ β ] ] [ [ α ; β ] ] = [ [ α ] ] ◦ [ [ β ] ] � [ [ α ∗ ] ] = [ [ α n ] ] n ∈ N Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 7 / 10
Hybrid Program: Semantics x ν if ν ( x ) = ω [ [ e ] ] x := e and ν ( z ) = ω ( z ) for z � = x ω ν ω t 0 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics x ν if ν ( x ) = ω [ [ e ] ] x := e and ν ( z ) = ω ( z ) for z � = x ω ν ω t 0 x ϕ ( t ) x ′ = f ( x ) & Q ν ω ν Q ω t r 0 x ′ = f ( x ) & Q Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics x ν if ν ( x ) = ω [ [ e ] ] x := e and ν ( z ) = ω ( z ) for z � = x ω ν ω t 0 x ϕ ( t ) x ′ = f ( x ) & Q ν ω ν Q ω t r 0 x ′ = f ( x ) & Q x ? Q ω no change if ω ∈ [ [ Q ] ] if ω ∈ [ [ Q ] ] otherwise no transition ω t 0 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics ν 1 x ω α ν 1 ω α ∪ β ν 2 β t ν 2 Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics ν 1 x ω α ν 1 ω α ∪ β ν 2 β t ν 2 x α ; β s ω µ ν ω ν α t β Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics ν 1 x ω α ν 1 ω α ∪ β ν 2 β t ν 2 x α ; β s ω µ ν ω ν α t β α ∗ x ν ω ω ω 1 ω 2 ν α α α t Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics ν 1 x ω α ν 1 ω α ∪ β ν 2 β t ν 2 x α ; β s ω µ ν ω ν α t β α ∗ x ν ω ω ω 1 ω 2 ν α α α t Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics ν 1 x ω α ν 1 ω α ∪ β ν 2 β t ν 2 x α ; β s ω µ ν ω ν α t β ( α ; β ) ∗ x ν ω ω ω 1 ω 2 ν t α β α β α β Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 8 / 10
Hybrid Program: Semantics Definition (dL Formulas) P ω P [ a ] P P Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10
Hybrid Program: Semantics Definition (dL Formulas) ω P � a � P Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10
Hybrid Program: Semantics Definition (dL Formulas) [ a ] P ω a -span Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10
Hybrid Program: Semantics Definition (dL Formulas) [ a ] P ω a -span � b � P b -span Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10
Hybrid Program: Semantics Definition (dL Formulas) � b � [ a ]-span [ a ] P ω a -span � b � P b -span Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10
Hybrid Program: Semantics Definition (dL Formulas) � b � [ a ]-span [ a ] P ω a -span � b � P b -span compositional semantics ⇒ compositional proofs! Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 9 / 10
Hybrid Program: Semantics Definition (Hybrid program semantics) ([ [ · ] ] : HP → ℘ ( S × S )) [ [ x := e ] ] = { ( ω, ν ) : ν = ω except ν [ [ x ] ] = ω [ [ e ] ] } [ [? Q ] ] = { ( ω, ω ) : ω ∈ [ [ Q ] ] } [ x ′ = f ( x )] = x ′ = f ( x ) for some duration r } [ ] = { ( ϕ (0) , ϕ ( r )) : ϕ | [ [ α ∪ β ] ] = [ [ α ] ] ∪ [ [ β ] ] [ [ α ; β ] ] = [ [ α ] ] ◦ [ [ β ] ] � [ [ α ∗ ] ] = [ [ α n ] ] n ∈ N Andr´ e Platzer (CMU) FCPS / 03: Choice & Control 10 / 10
Recommend
More recommend