Relating and Visualising CSP , VCR and Structural Traces Neil Brown 1 Marc Smith 2 1 Computing Laboratory, University of Kent, UK 2 Department of Computer Science, Vassar College, NY, USA 2 November 2009
Motivation Dining Philosophers
Motivation Starving Dining Philosophers
Background Visualization: Strings and Beads Consider the CSP system: P || Q { a , f } where P = a → b → c → f → SKIP Q = a → d → e → f → SKIP b c P a f Q d e
Background Visualization: Strings and Beads Consider the CSP system: P || Q { a , f } where P = a → b → c → f → SKIP Q = a → d → e → f → SKIP b c P a f Q d e
Background Visualization: Strings and Beads Consider the CSP system: P || Q { a , f } where P = a → b → c → f → SKIP Q = a → d → e → f → SKIP b c P a f Q d e
Background Visualization: Strings and Beads Consider the CSP system: P || Q { a , f } where P = a → b → c → f → SKIP Q = a → d → e → f → SKIP b c P a f Q d e
Background CSP Observer
Background CSP Observer
Background CSP Observer b c P a f Q d e b c P a f Q d e b c P a f Q d e b c P a f Q d e � a , b , c , d , e , f � � a , b , d , c , e , f � � a , b , d , e , c , f � � a , d , b , c , e , f � � a , d , e , b , c , f � � a , d , b , e , c , f �
Background VCR Observer(s)
Background VCR Observer(s) b c P a f Q d e b c P a f Q d e b c P a f Q d e b c P a f Q d e �{ a } , { b , d } , { c , e } , { f }� �{ a } , { b } , { c , d } , { e } , { f }� �{ a } , { d } , { b , e } , { c } , { f }�
Background Structural Observers
Background Structural Observers b c P a f Q d e b c P a f Q d e b c P a f Q d e b c P a f Q d e ( a → b → c → f ) || ( a → d → e → f )
Background Traces Three types of traces: 1 CSP traces A sequence of individual events, recorded by the observer; events observed simultaneously are interleaved abstracts away time and space 2 VCR Traces A sequence of event multisets; multiple observers account for different views preserves time independence; abstracts away space 3 Structural Traces Sequential and parallel composition of the trace reflects the program’s structure preserves time independence and space
Background Space and Mobility c logger
Background Space and Mobility c logger!42 logger logger?42
Background Space and Mobility c logger!42 c?logger -> c!logger logger logger?42
Background Space and Mobility c c?logger logger!42 -> logger!43 -> c!logger logger logger?42 -> logger?43
Background Space and Mobility c c?logger logger!42 -> logger!43 -> c!logger logger logger?42 -> logger?43 ( logger ! 42 → c ! logger ) || ( c ? logger → logger ! 43 ) || ( logger ? 42 → logger ? 43 )
Conversion Conversion Example CSP: P = ( AB o 9 AB ) || ( b → b → SKIP ) { b } where AB = ( a → SKIP ) ||| ( b → SKIP )
Conversion Conversion Example CSP: P = ( AB o 9 AB ) || ( b → b → SKIP ) { b } where AB = ( a → SKIP ) ||| ( b → SKIP ) Structural Trace Visualisation: a a b b b b
Conversion Conversion Example CSP: P = ( AB o 9 AB ) || ( b → b → SKIP ) { b } where AB = ( a → SKIP ) ||| ( b → SKIP ) Structural Trace Conversion Algorithm: a a b b b b
Conversion Conversion Example Structural Trace Conversion Algorithm: a a b b b b VCR Trace Visualisation: a a b b
Conversion Conversion Example VCR Trace Visualisation: a a b b
Conversion Conversion Example VCR Trace Visualisation: a a b b CSP Trace Visualisation: a b a b b a a b a b b a b a b a
Example Starving CHP Philosophers
Example Starving CHP Philosophers Trace philosopher eatChicken = forever (syncBarrier eatChicken) chef a b c = forever ((syncBarrier a <&> syncBarrier b) <-> (syncBarrier b <&> syncBarrier c) <-> (syncBarrier a <&> syncBarrier c))
Example Starving CHP Philosophers Trace philosopher eatChicken = forever (syncBarrier eatChicken) chef a b c = forever ((syncBarrier a <&> syncBarrier b) <-> (syncBarrier b <&> syncBarrier c) <-> (syncBarrier a <&> syncBarrier c)) chicken.0 chicken.0 chicken.0 chicken.1 chicken.2 chicken.2 chicken.2 chicken.2 ... (Chef)
Summary Summary Traces are useful for diagnostics and observing run-time behaviour Structural traces Most straightforward and efficient to record Useful for observing mobility Conversion algorithms One Structural trace converts to many VCR traces One VCR trace converts to many CSP traces Visualisation Graphs to represent CSP , VCR and Structural traces Tool support will be beneficial
Future Work Tools to Explore Traces numbers b d prefix delta a c recorder succ 42*(b? -> (c! || d!)) || (42*(b! -> a?) -> b!) || 42*(c! -> a?)
Future Work Tools to Explore Traces numbers b d prefix delta a c recorder succ 42*(b? -> (c! || d!))
Future Work Challenge: Structural traces and UTP a a d e b b f c c g a c d Figure: Concatenation, quotient and healthiness conditions
Future Work Questions? Practical demo of traces for testing – tonight at the fringe
Recommend
More recommend