matches.mvc 1.5 KB

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