petrinets_constraints.mvc 648 B

12345678910111213141516171819202122232425262728
  1. import models/SimpleClassDiagrams as SCD
  2. include "primitives.alh"
  3. SCD PetriNets{
  4. Class Natural {
  5. $
  6. if (bool_not(is_physical_int(self))):
  7. return "Natural has no integer value"
  8. elif (integer_lt(self, 0)):
  9. return "Natural does not have a positive or zero value"
  10. else:
  11. return "OK"
  12. $
  13. }
  14. Class Place{
  15. tokens : Natural
  16. }
  17. Class Transition{}
  18. Association P2T (Place, Transition) {
  19. weight : Natural
  20. }
  21. Association T2P (Transition, Place) {
  22. weight : Natural
  23. }
  24. }
  25. export PetriNets to models/PetriNets