matches.mvc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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} ForAll match {
  9. LHS {
  10. Pre_Query/Place {
  11. label = "2"
  12. }
  13. Pre_ReachabilityGraph/State pre_4 {
  14. label = "4"
  15. }
  16. Pre_ReachabilityGraph/Place pre_3 {
  17. label = "3"
  18. }
  19. Pre_ReachabilityGraph/Contains (pre_4, pre_3) {
  20. label = "5"
  21. }
  22. constraint = $
  23. Boolean function constraint(host_model : Element, mapping : Element):
  24. Boolean names_match
  25. Boolean tokens_match
  26. names_match = value_eq(read_attribute(host_model, mapping["2"], "name"), read_attribute(host_model, mapping["3"], "name"))
  27. tokens_match = value_eq(read_attribute(host_model, mapping["2"], "tokens"), read_attribute(host_model, mapping["3"], "tokens"))
  28. return bool_and(names_match, tokens_match)!
  29. $
  30. }
  31. RHS {
  32. Post_Query/Place {
  33. label = "2"
  34. }
  35. Post_ReachabilityGraph/Place post_3{
  36. label = "3"
  37. }
  38. Post_ReachabilityGraph/State post_4{
  39. label = "4"
  40. value_error = $
  41. Boolean function value (model : Element, name : String, mapping : Element):
  42. return True!
  43. $
  44. }
  45. Post_ReachabilityGraph/Contains (post_4, post_3){
  46. label = "5"
  47. }
  48. }
  49. }
  50. }
  51. Initial (schedule, match) {}
  52. OnSuccess (match, success) {}
  53. OnFailure (match, failure) {}
  54. }