matches.mvc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 match {
  9. LHS {
  10. Pre_Query/State {
  11. label = "0"
  12. }
  13. Pre_ReachabilityGraph/State {
  14. label = "1"
  15. }
  16. }
  17. NAC {
  18. Pre_Query/State pre_0 {
  19. label = "0"
  20. }
  21. Pre_ReachabilityGraph/State pre_1 {
  22. label = "1"
  23. }
  24. Pre_Query/Place pre_2 {
  25. label = "2"
  26. }
  27. Pre_ReachabilityGraph/Place pre_3 {
  28. label = "3"
  29. }
  30. Pre_Query/Contains (pre_0, pre_2) {
  31. label = "4"
  32. }
  33. Pre_ReachabilityGraph/Contains (pre_1, pre_3) {
  34. label = "5"
  35. }
  36. constraint = $
  37. Boolean function constraint(host_model : Element, mapping : Element):
  38. Boolean names_match
  39. Boolean tokens_mismatch
  40. names_match = value_eq(read_attribute(host_model, mapping["2"], "name"), read_attribute(host_model, mapping["3"], "name"))
  41. tokens_mismatch = value_neq(read_attribute(host_model, mapping["2"], "tokens"), read_attribute(host_model, mapping["3"], "tokens"))
  42. return bool_and(names_match, tokens_mismatch)!
  43. $
  44. }
  45. }
  46. }
  47. Initial (schedule, match) {}
  48. OnSuccess (match, success) {}
  49. OnFailure (match, failure) {}
  50. }