On the Total Variation Distance of SMPs Giorgio Bacci, Giovanni Bacci, Kim G. Larsen, Radu Mardare Aalborg University, Denmark 25-26 September 2014 4 IDEA CPS 1/24
Outline • Semi-Markov Processes (SMPs) • Total Variation Distance of SMPs • Total Variation vs. Model Checking • An Approximation Algorithm • Concluding Remarks 2/24
Before to start... Given μ , ν : Σ → ℝ + measures on (X, Σ ) Total Variation Distance || μ - ν || = sup | μ (E) - ν (E)| E ∈ Σ 3/24
Before to start... Given μ , ν : Σ → ℝ + measures on (X, Σ ) Total Variation Distance || μ - ν || = sup | μ (E) - ν (E)| E ∈ Σ The largest possible difference that μ and ν assign to the same event 3/24
semi-Markov Processes N(2,3) 1 Exp(3) Exp(3) 1/3 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 4/24
semi-Markov Processes N(2,3) 1 Exp(3) Exp(3) 1/3 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 Given an initial state, SMPs can be interpreted as “machines” that emit timed traces of states at a certain probability 4/24
Timed paths & Events Cylinder set residence-time (s i ∈ S i , t i ∈ R i and R i Borel set) t n-1 t 0 ... π : 핮 ( S 0 , R 0 , ... , R n-1 , S n ) ∈ s n-1 s n s 0 s 1 “probability that, starting from s , P[s]( 핮 ( S 0 , R 0 , ... , R n-1 , S n )) = the SMP emits a timed path with prefix in S 0 × R 0 × ... × R n-1 × S n ” 5/24
Prob. Trace Equivalence N(2,3) 1 Exp(3) Exp(3) 1/3 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 6/24
Prob. Trace Equivalence N(2,3) 1 Exp(3) Exp(3) 1/3 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 6/24
Prob. Trace Equivalence N(2,3) 1 Exp(3) Exp(3) 1/3 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 P[ s 0 ]( 핮 ( , R 0 , ... , R n-1 , )) = P[ s 1 ]( 핮 ( , R 0 , ... , R n-1 , )) L n L 0 L 0 L n 6/24
Prob. Trace Equivalence N(2,3) 1 Exp(3) Exp(3) 1/3 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3 1/3 1 U(2) U(2) s 3 s 4 q,r q,r Trace Cylinders (up to label equiv.) 1 P[ s 0 ]( 핮 ( , R 0 , ... , R n-1 , )) = P[ s 1 ]( 핮 ( , R 0 , ... , R n-1 , )) L n L 0 L 0 L n 6/24
Prob. Trace Equivalence N(2,3) 1 Exp(3) Exp(3) 1/3+ ε 1/3 s 0 s 2 s 1 p,r q p,r 1/3 2/3- ε 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 P[ s 0 ]( 핮 ( , ℝ , ,)) =1/3+ ε ≠ 1/3 = P[ s 1 ] ( 핮 ( , ℝ , ,)) p,r q p,r q 7/24
Prob. Trace Equivalence N(2,3) 1 Exp(3) Exp(3) 1/3+ ε 1/3 s 0 s 2 s 1 FRAGILE p,r q p,r 1/3 2/3- ε 1/3 1 U(2) U(2) s 3 s 4 q,r q,r 1 P[ s 0 ]( 핮 ( , ℝ , ,)) =1/3+ ε ≠ 1/3 = P[ s 1 ] ( 핮 ( , ℝ , ,)) p,r q p,r q 7/24
Trace Pseudometric (difference w.r.t. linear real-time behaviors) d(s,s’) = sup |P[s](E) - P[s’](E)| E ∈ σ ( 퓣 ) σ -algebra generated from Trace Cylinders 8/24
Trace Pseudometric (difference w.r.t. linear real-time behaviors) d(s,s’) = sup |P[s](E) - P[s’](E)| E ∈ σ ( 퓣 ) σ -algebra generated from Trace Cylinders It’s a Behavioral Distance! d(s,s’) = 0 iff s ≈ s’ T 8/24
Trace Distance vs. Model Checking (i.e., what do they have in common?) 9/24
Model Checking SMPs i.e., measuring the likelihood that a a linear real-time property is satisfied by the SMP SMP ⊨ Linear Real-time Spec. 10/24
Model Checking SMPs i.e., measuring the likelihood that a a linear real-time property is satisfied by the SMP a proper measurable set! SMP ⊨ Linear Real-time Spec. 10/24
Model Checking SMPs i.e., measuring the likelihood that a a linear real-time property is satisfied by the SMP a proper measurable set! SMP ⊨ Linear Real-time Spec. represented as Metric Temporal Logic formulas 10/24
Model Checking SMPs i.e., measuring the likelihood that a a linear real-time property is satisfied by the SMP a proper measurable set! SMP ⊨ Linear Real-time Spec. ... or languages represented as recognized Metric Temporal Logic by Timed Automata formulas 10/24
Metric Temporal Logic (Alur-Henzinger) Next Until φ ≔ p | ⊥ | φ→φ | X φ | φ U φ I I (*) I ⊆ ℝ closed interval with rational endpoints 11/24
Metric Temporal Logic (Alur-Henzinger) Next Until φ ≔ p | ⊥ | φ→φ | X φ | φ U φ I I (*) I ⊆ ℝ closed interval with rational endpoints ψ within time t ∈ I ... t i-1 ∈ I t 0 + + φ U ψ I π : ⊨ ... φ φ ψ φ 11/24
MTL distance (difference w.r.t. MTL properties) set of timed paths that satisfy φ MTL(s,s’) = sup |P[s]({ π ⊨ φ }) - P[s’]({ π ⊨ φ })| φ ∈ MTL 12/24
MTL distance (difference w.r.t. MTL properties) m e a s u r a b l e set of timed paths i n σ ( ) 퓣 that satisfy φ MTL(s,s’) = sup |P[s]({ π ⊨ φ }) - P[s’]({ π ⊨ φ })| φ ∈ MTL Relation with Trace Distance MTL(s,s’) ≤ d(s,s’) = sup |P[s](E) - P[s’](E)| E ∈ σ ( 퓣 ) 12/24
MTL distance (difference w.r.t. MTL properties) m e a s u r a b l e set of timed paths i n σ ( ) 퓣 that satisfy φ MTL(s,s’) = sup |P[s]({ π ⊨ φ }) - P[s’]({ π ⊨ φ })| φ ∈ MTL Relation with Trace Distance = MTL(s,s’) ≤ d(s,s’) = sup |P[s](E) - P[s’](E)| E ∈ σ ( 퓣 ) 12/24
Timed Automata (Alur-Dill) without invariants Clocks = {x,y} q p,r x ≥ 1/4, {x} Clock Guards ℓ 1 x ≥ 5, {x} g ≔ x ⋈ q | g ∧ g q p,r ℓ 0 for ⋈ ∈ {<, ≤ ,>, ≥ }, q ∈ ℚ y ≤ 1/2 x ≤ 1/2 ℓ 2 p,r , x<3, {y} accepted! q p,r q , 1/2 , 2 , 1/2 x=0 x=2 x=2.5 ( ℓ 0 , ) ( ℓ 2 , ) ( ℓ 1 , ) ... y=0 y=0 y=0.5 13/24
TA distance (difference w.r.t. regular TA properties) set of timed paths accepted by 퓐 TA(s,s’) = sup |P[s]({ π ∈ L( 퓐 )}) - P[s’]({ π ∈ L( 퓐 )})| 퓐 ∈ TA 14/24
TA distance (difference w.r.t. regular TA properties) m e a s u r a b l set of timed paths e i n σ ( ) 퓣 accepted by 퓐 TA(s,s’) = sup |P[s]({ π ∈ L( 퓐 )}) - P[s’]({ π ∈ L( 퓐 )})| 퓐 ∈ TA Relation with Trace Distance TA(s,s’) ≤ d(s,s’) = sup |P[s](E) - P[s’](E)| E ∈ σ ( 퓣 ) 14/24
TA distance (difference w.r.t. regular TA properties) m e a s u r a b l set of timed paths e i n σ ( ) 퓣 accepted by 퓐 TA(s,s’) = sup |P[s]({ π ∈ L( 퓐 )}) - P[s’]({ π ∈ L( 퓐 )})| 퓐 ∈ TA Relation with Trace Distance = TA(s,s’) ≤ d(s,s’) = sup |P[s](E) - P[s’](E)| E ∈ σ ( 퓣 ) 14/24
The theorem behind... For μ , ν : Σ → ℝ + finite measures on (X, Σ ) and F ⊆ Σ field such that σ (F)= Σ Representation Theorem || μ - ν || = sup | μ (E) - ν (E)| E ∈ F 15/24
The theorem behind... For μ , ν : Σ → ℝ + finite measures on (X, Σ ) and F ⊆ Σ field such that σ (F)= Σ Representation Theorem || μ - ν || = sup | μ (E) - ν (E)| E ∈ F F is much simpler than Σ , nevertheless it suffices to attain to the supremum! 15/24
A series of characterizations MTL(s,s’) = MTL (s,s’) ¬U d(s,s’) = TA(s,s’) = DTA(s,s’) 1-DTA(s,s’) = 1-RDTA(s,s’) 16/24
A series of characterizations distance w.r.t. φ ∈ MTL without Until MTL(s,s’) = MTL (s,s’) ¬U d(s,s’) = TA(s,s’) = DTA(s,s’) 1-DTA(s,s’) = 1-RDTA(s,s’) 16/24
A series of characterizations distance w.r.t. φ ∈ MTL without Until MTL(s,s’) = MTL (s,s’) ¬U distance w.r.t. only Deterministic TAs d(s,s’) = TA(s,s’) = DTA(s,s’) 1-DTA(s,s’) = 1-RDTA(s,s’) 16/24
A series of characterizations distance w.r.t. φ ∈ MTL without Until MTL(s,s’) = MTL (s,s’) ¬U distance w.r.t. only Deterministic TAs d(s,s’) = TA(s,s’) = DTA(s,s’) 1-DTA(s,s’) = 1-RDTA(s,s’) distance w.r.t. only single-clock DTAs 16/24
A series of characterizations distance w.r.t. φ ∈ MTL without Until MTL(s,s’) = MTL (s,s’) ¬U distance w.r.t. only Deterministic TAs d(s,s’) = TA(s,s’) = DTA(s,s’) distance w.r.t. only Resetting 1-DTAs 1-DTA(s,s’) = 1-RDTA(s,s’) distance w.r.t. only single-clock DTAs 16/24
Approximation Algorithm for the Trace Distance (from below & from above) 17/24
... from below 18/24
... from below r e c a l l Representation Theorem t h a t . . . || μ - ν || = sup | μ (E) - ν (E)| E ∈ F 18/24
... from below r e c a l l Representation Theorem t h a t . . . || μ - ν || = sup | μ (E) - ν (E)| E ∈ F F field that generates Σ 18/24
... from below r e c a l l Representation Theorem t h a t . . . || μ - ν || = sup | μ (E) - ν (E)| E ∈ F F field that generates Σ We need F 0 ⊆ F 1 ⊆ F 2 ⊆ ... such that U i F i = F to define l i = sup | μ (E) - ν (E)| E ∈ F i 18/24
... from below r e c a l l Representation Theorem t h a t . . . || μ - ν || = sup | μ (E) - ν (E)| E ∈ F F field that generates Σ We need F 0 ⊆ F 1 ⊆ F 2 ⊆ ... such that U i F i = F to define l i = sup | μ (E) - ν (E)| E ∈ F i so that ∀ i ≥ 0, l i ≤ l i+1 & sup i l i = || μ - ν || increasing limiting 18/24
... from above 19/24
Recommend
More recommend