1 / 61

Traversal techniques for concurrent systems

Traversal techniques for concurrent systems. Marc Solé & Enric Pastor Departament of Computer Architecture UPC msole@ac.upc.es. Introduction. General objective: checking of safety properties in concurrent systems. Accomplished through Reachability Analisys.

yahto
Download Presentation

Traversal techniques for concurrent systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Traversal techniques for concurrent systems Marc Solé & Enric Pastor Departament of Computer Architecture UPC msole@ac.upc.es

  2. Introduction • General objective: checking of safety properties in concurrent systems. • Accomplished through Reachability Analisys. • Lot of work done for synchronous systems, but not for concurrent ones. In this work: traversal methods for concurrent systems.

  3. s0 a b s0 s1 s2 {a,b} b a s3 s3 Concurrent systems particularities • Transition relations (TR) partitioned in smaller independent parts (events). • Each event is “fired” producing new states. Synchronous Concurrent

  4. Traditional Approach • Breadth First Search (BFS) does not take advantage of these particularities. • Our proposal: schedule the application of the events in a hybrid approach (BFS/DFS).

  5. Overview • Hypothesis • Speeding State Generation • Causality Detection • Four traversal methods • Token traverse • Weighed token traverse • Dynamic event-clustered traverse • TR cluster-closure traverse • Results & Conclusions

  6. Hypothesis • “The faster, the better”. • Intuition: • if you need less iterations to complete the process, then the probabilities of encountering an intermediate “big” BDD diminish. • Obviously not true in all cases.

  7. s0 s0 Speeding state generation • Great results with a very simple technique: chaining. BFS BFS with chaining s0 s0 a b a b s1 s2 s1 s2 b a b a s3 s3

  8. Speeding state generation • Great results with a very simple technique: chaining. BFS BFS with chaining s0 s0 a b a b s1 s2 s1 s1 s2 b a b a s3 s3

  9. Speeding state generation • Great results with a very simple technique: chaining. BFS BFS with chaining s0 s0 a b a b s1 s2 s1 s2 b a b a s3 s3

  10. Maximizing the chaining • The order of event firing has a significant impact on the performance.

  11. s0 b a s1 s2 b a c b s3 s4 s5 e d c e d s6 s7 s8 a b e b f f d s9 s10 s11 a g s12

  12. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s1 s1 s2 s2 s2 b b b a a a c c c b b b s3 s3 s3 s4 s4 s4 s5 s5 s5 e e e d d d c c c e e e d d d s6 s6 s6 s7 s7 s7 s8 s8 s8 a a a b b b e e e b b b f f f f f f d d d s9 s9 s9 s10 s10 s10 s11 s11 s11 a a a g g g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  13. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  14. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  15. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  16. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  17. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  18. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  19. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  20. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  21. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  22. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  23. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  24. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  25. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  26. BFS BFS with chaining BFS with chaining s0 s0 s0 b b b a a a s1 s2 s1 s2 s1 s2 b a b a b a c c c b b b s3 s4 s5 s3 s4 s5 s3 s4 s5 e d e d e d c c c e e e d d d s6 s7 s8 s6 s7 s8 s6 s7 s8 a b a b a b e e e b f b f b f f d f d f d s9 s10 s11 s9 s10 s11 s9 s10 s11 a g a g a g s12 s12 s12 {a,b,c,d,e,f,g} {a,b,c,d,e,f,g} {e,a,g,c,b,f,d}

  27. Maximizing the chaining • Information to obtain a good scheduling Causality analisys between events. • Main idea: If I have fired event X, which events are fireable now.

  28. Notation & Definitions • The set of states in which an event is “fireable” is called Firing Function (FF). • In fact, characteristic function of the set. • Example: • FF(a) a b s0 s1 s2 b a c b s3 s4 s5 e d c e d s6 s7 s8 a b e b f f d s9 s10 s11 a g s12

  29. Causality • Causality between TR a and TR b exists if: • You can fire a, but not b. • You fire a. • Now you can fire b. FF(a) FF(b)

  30. Causality • Causality between TR a and TR b exists if: • You can fire a, but not b. • You fire a. • Now you can fire b. FF(a)·!FF(b)

  31. Causality • Causality between TR a and TR b exists if: • You can fire a, but not b. • You fire a. • Now you can fire b. To a a a FF(a)·!FF(b) To = Firing a on FF(a)*!FF(b)

  32. If this set exists [To · FF(b)  ] then event bpotentially becomes fireable after event a Causality • Causality between TR a and TR b exists if: • You can fire a, but not b. • You fire a. • Now you can fire b. To FF(b) FF(a)·!FF(b)

  33. Causality • Checking the causality for each pair of events, we can determine the causality relations between all the events in the system. • This information can be stored in different ways (i.e. matix). • For clarity we use a Petri-Net like model to represent these relations.

  34. Petri Nets • Structure to represent relationships (synchronicity/concurrency) between components. • Three components: • Places: potential state. • Transitions: dynamic behaviour. • Tokens: present state.

  35. Causality s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 b a s7

  36. Traversal methods

  37. Token traverse • Put one initial token in all fireable events. • Fire the event with highest number of tokens. • If firing does not generate any new state, then the token is “absorbed”. • When all the tokens have been absorbed, compute the new states generated by this iteration. • If no new, fixpoint reached, else restart.

  38. Token traverse s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 b a s7

  39. Token traverse s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 b a Same number of tokens in a and b : Chose at random which to fire s7

  40. Token traverse s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 b a Same number of tokens in b and c : Chose at random which to fire s7

  41. Token traverse s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 Worst case: c is fired No new state produced, token absorbed b a s7

  42. Token traverse s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 b a s7

  43. Token traverse s0 • Example: b a s1 s2 a b b a s3 c s4 a b c s5 s6 b a s7

  44. Problems with Token Traverse • Ineffective firings. As in the case of event c in the previous example. s0 a b b a s1 s2 b a s3 c c

  45. Problems with Token Traverse • To solve this problem and produce a better scheduling we can try to relate: • number of tokens in one place • number of states in which this event is fireable.

  46. Weighed Token Traverse • Every time an event is fired, for each successor, we add a number of tokens equal to the number of states in which this successor is fireable. s0 a b b a s1 s2 b a s3 c c

  47. Weighed Token Traverse • In the former example, token from place a is now actually absorbed, as state s1  FF(c). s0 a b b a s1 s2 b a s3 c c

  48. Weighed Token Traverse • This solves ineffective firing problem, but increases BDD operations. For each firing we must perform k AND operations, being k the number of successors of an event. • Fortunately, in our benchmarks k is usually small (<4).

  49. Weighed Token Traverse • However this method does not consider the fireable states produced by concurrent events. s0 a b b a s1 s2 b a s3 2 states but only 1 token c c

  50. Best fireable event? • Both previous methods try to find out which is the best fireable event at every moment. • A possible heuristic: fire the event that will produce more states. • Events are usually bijective functions, so the problem is equivalent to find out which event has more states in which it is fireable.

More Related