core_formalism.mvc 2.0 KB

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