1 / 93

543 cbj fans can’t be wrong

543 cbj fans can’t be wrong. Talk inspired by Prof. Ian Philip Gent. and The Fall. 543. CBJ. Sit up model checkers Pay attention at the back. What’s a csp?. <V,D,C>. a set of variables each with a domain of values

palma
Download Presentation

543 cbj fans can’t be wrong

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. 543 cbj fans can’t be wrong

  2. Talk inspired by Prof. Ian Philip Gent and The Fall

  3. 543 CBJ

  4. Sit up model checkers Pay attention at the back

  5. What’s a csp? <V,D,C> • a set of variables • each with a domain of values • a collection of constraints (I’m going to assume binary for the present) • assign each variable a value from its domain to satisfy the constraint

  6. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 How will search proceed? Demo csp5 with bt4 with system.verbose := 3 A solution is 3--3--2--1

  7. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 V3 V4 V5 V6 V7 V8 V9 V10

  8. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 V4 V5 V6 V7 V8 V9 V10

  9. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 V5 V6 V7 V8 V9 V10

  10. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 V6 V7 V8 V9 V10

  11. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 V7 V8 V9 V10

  12. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 1 V7 V8 V9 V10

  13. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 1 V7 = 1 V8 V9 V10

  14. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 1 V7 = 2 V8 V9 V10

  15. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 1 V7 = 3 V8 V9 V10

  16. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 2 V7 V8 V9 V10

  17. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 2 V7 = 1 V8 V9 V10

  18. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 2 V7 = 2 V8 V9 V10

  19. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 2 V7 = 3 V8 V9 V10

  20. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 3 V7 V8 V9 V10

  21. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 3 V7 = 1 V8 V9 V10

  22. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 3 V7 = 2 V8 V9 V10

  23. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 1 V6 = 3 V7 = 3 V8 V9 V10

  24. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 V7 V8 V9 V10

  25. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 1 V7 V8 V9 V10

  26. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 1 V7 = 1 V8 V9 V10

  27. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 1 V7 = 2 V8 V9 V10

  28. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 1 V7 = 3 V8 V9 V10

  29. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 2 V7 V8 V9 V10

  30. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 2 V7 = 1 V8 V9 V10

  31. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 2 V7 = 2 V8 V9 V10

  32. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 2 V7 = 3 V8 V9 V10

  33. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 3 V7 V8 V9 V10

  34. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 3 V7 = 1 V8 V9 V10

  35. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 3 V7 = 2 V8 V9 V10

  36. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 2 V6 = 3 V7 = 3 V8 V9 V10

  37. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 3 V6 V7 V8 V9 V10

  38. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 3 V6 = 1 V7 V8 V9 V10

  39. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 3 V6 = 1 V7 = 1 V8 V9 V10

  40. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 3 V6 = 1 V7 = 2 V8 V9 V10

  41. Consider the following problem (csp5) • variables V[1] to V[10] • uniform domains D[1] to D[10] = {1,2,3} • constraints • V[1] = V[4] • V[4] > V[7] • V[7] = V[10] + 1 V1 = 1 V2 = 1 V3 = 1 V4 = 1 V5 = 3 V6 = 1 V7 = 3 V8 V9 V10

  42. BT Thrashes! past variable v[h] past conflict with v[h] current variable v[i] future future variable v[j]

  43. Thrashing: Slavishly repeating the same set of actions with the same set of outcomes. Can we minimise thrashing?

  44. Current variable Cause for conflict in some other csp Recording conflicts Conflict Sets V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 CS1 = {0} CS2 = {0} CS3 = {0} CS4 = {0,1} CS5 = {0} CS6 = {0} CS7 = {0,4} CS8 = {0} CS9 = {0} CS10 = {0,6,7} What do we do now? Why do we do that? • Assume search proceeded as follows • V1, V2, and V3 were instantiated without failures • First value tried for V4 conflicted with V1 • Second value tried for V4 was compatible with V1, V2, and V3 • V5 and V6 were instantiated without failures • First and second value tried for V7 failed against V4 • Third value tried for V7 was compatible with all past variables V1 to V6 • V8 and V9 were instantiated without failure • First value tried for V10 failed against V6 • Second and Third values tried for V10 failed against V7 • V10 has no more values

  45. Current variable Cause for conflict in some other csp Recording conflicts Conflict Sets V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 CS1 = {0} CS2 = {0} CS3 = {0} CS4 = {0,1} CS5 = {0} CS6 = {0} CS7 = {0,4} CS8 = {0} CS9 = {0} CS10 = {0,6,7} • Jump back from V10 to V7 • update CS7 to be CS7  CS10  {7} • the set of variables conflicting with V10 or V7, excluding V7 Why? If we re-instantiate V7 we might find a compatible value for V10

  46. Current variable Cause for conflict in some other csp Recording conflicts Conflict Sets V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 CS1 = {0} CS2 = {0} CS3 = {0} CS4 = {0,1} CS5 = {0} CS6 = {0} CS7 = {0,4,6} CS8 = {0} CS9 = {0} CS10 = {0} • Assume V7 now has no values remaining • jump back to V[6] and update CS6 Why? If we re-instantiate V6 we might find compatible values for V7 and V10

More Related