matches.mvc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. include "primitives.alh"
  2. include "modelling.alh"
  3. include "object_operations.alh"
  4. A B {
  5. Composite schedule {
  6. {Contains} Failure failure {}
  7. {Contains} Success success {}
  8. {Contains} Query query {
  9. LHS {
  10. Pre_Query/Place {
  11. label = "2"
  12. }
  13. Pre_ReachabilityGraph/Place {
  14. label = "3"
  15. }
  16. constraint = $
  17. Boolean function constraint(host_model : Element, mapping : Element):
  18. Boolean names_match
  19. Boolean tokens_match
  20. names_match = value_eq(read_attribute(host_model, mapping["2"], "name"), read_attribute(host_model, mapping["3"], "name"))
  21. tokens_match = value_eq(read_attribute(host_model, mapping["2"], "tokens"), read_attribute(host_model, mapping["3"], "tokens"))
  22. return bool_and(names_match, tokens_match)!
  23. $
  24. }
  25. }
  26. {Contains} ForAll match {
  27. LHS {
  28. Pre_Query/Place {
  29. label = "2"
  30. }
  31. Pre_ReachabilityGraph/Place pre_3 {
  32. label = "3"
  33. }
  34. Pre_ReachabilityGraph/State pre_4 {
  35. label = "4"
  36. }
  37. Pre_ReachabilityGraph/Contains (pre_4, pre_3) {
  38. label = "5"
  39. }
  40. constraint = $
  41. Boolean function constraint(host_model : Element, mapping : Element):
  42. Boolean names_match
  43. Boolean tokens_match
  44. names_match = value_eq(read_attribute(host_model, mapping["2"], "name"), read_attribute(host_model, mapping["3"], "name"))
  45. tokens_match = value_eq(read_attribute(host_model, mapping["2"], "tokens"), read_attribute(host_model, mapping["3"], "tokens"))
  46. return bool_and(names_match, tokens_match)!
  47. $
  48. }
  49. RHS {
  50. Post_Query/Place {
  51. label = "2"
  52. }
  53. Post_ReachabilityGraph/Place post_3{
  54. label = "3"
  55. }
  56. Post_ReachabilityGraph/State post_4{
  57. label = "4"
  58. value_error = $
  59. Boolean function value (model : Element, name : String, mapping : Element):
  60. return True!
  61. $
  62. }
  63. Post_ReachabilityGraph/Contains (post_4, post_3){
  64. label = "5"
  65. }
  66. }
  67. }
  68. }
  69. Initial (schedule, query) {}
  70. OnSuccess (query, match) {}
  71. OnFailure (query, failure) {}
  72. OnSuccess (match, success) {}
  73. OnFailure (match, failure) {}
  74. }