petrinet_ports.mvc 905 B

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