core_formalism.mvc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import models/SimpleClassDiagrams as SimpleClassDiagrams
  2. SimpleClassDiagrams CoreFormalism {
  3. Class String {
  4. $
  5. if (bool_not(is_physical_string(self))):
  6. return "String has no string value"!
  7. else:
  8. return "OK"!
  9. $
  10. }
  11. Class Permissions {
  12. $
  13. if (bool_not(is_physical_string(self))):
  14. return "Permissions has no string value"!
  15. else:
  16. return "OK"!
  17. $
  18. }
  19. Class Boolean {
  20. $
  21. if (bool_not(is_physical_bool(self))):
  22. return "Boolean has no bool value"!
  23. else:
  24. return "OK"!
  25. $
  26. }
  27. Class Natural {
  28. $
  29. if (bool_not(is_physical_int(self))):
  30. return "Natural has no integer value"!
  31. elif (integer_lt(self, 0)):
  32. return "Natural has negative value"!
  33. else:
  34. return "OK"!
  35. $
  36. }
  37. Class User {
  38. name : String
  39. admin : Boolean
  40. nr_logins : Natural
  41. }
  42. Class Group {
  43. name : String
  44. }
  45. Association ownedBy (Group, User) {}
  46. Association belongsTo (User, Group) {}
  47. Class Model {
  48. name : String
  49. location : String
  50. permissions : Permissions
  51. }
  52. Association owner (Model, User) {
  53. target_lower_cardinality = 1
  54. target_upper_cardinality = 1
  55. }
  56. Association group (Model, Group) {
  57. target_lower_cardinality = 1
  58. target_upper_cardinality = 1
  59. }
  60. Class Transformation : Model {
  61. name : String
  62. location : String
  63. }
  64. Class ModelTransformation : Transformation {}
  65. Class ActionLanguage : Transformation {}
  66. Association transformInput (Model, Transformation) {
  67. name : String
  68. }
  69. Association transformOutput (Transformation, Model) {
  70. name : String
  71. target_lower_cardinality = 1
  72. }
  73. Association tracability (Model, Model) {
  74. type : String
  75. }
  76. }
  77. export CoreFormalism to models/CoreFormalism