petrinet_ports.mvc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. include "primitives.alh"
  2. SimpleAttribute Natural{
  3. name = "Natural"
  4. constraint = $
  5. String function constraint(model : Element, name : String):
  6. if (is_physical_int(model["model"][name])):
  7. return "OK"!
  8. else:
  9. return "Natural has non-integer value"!
  10. $
  11. }
  12. SimpleAttribute String{
  13. name = "String"
  14. constraint = $
  15. String function constraint(model : Element, name : String):
  16. if (is_physical_string(model["model"][name])):
  17. return "OK"!
  18. else:
  19. return "String has non-string value"!
  20. $
  21. }
  22. SimpleAttribute Boolean {
  23. name = "Boolean"
  24. }
  25. Class Named {
  26. name = "Named"
  27. name : String
  28. }
  29. Class Place : Named {
  30. name = "Place"
  31. tokens : Natural
  32. }
  33. Class Transition : Named {
  34. name = "Transition"
  35. }
  36. Class Port : Named {
  37. name = "Port"
  38. }
  39. Association P2T (Place, Transition) {
  40. name = "P2T"
  41. }
  42. Association T2P (Transition, Place) {
  43. name = "T2P"
  44. }
  45. Association PortPlace (Port, Place) {
  46. name = "PortPlace"
  47. }
  48. Association Related (Port, Port) {
  49. name = "Related"
  50. }