test_mvc.py 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015
  1. import unittest
  2. from utils import *
  3. model_list = set([" SimpleClassDiagrams : SimpleClassDiagrams",
  4. " CoreFormalism : SimpleClassDiagrams",
  5. " ManualOperation : SimpleClassDiagrams",
  6. " ActionLanguage : SimpleClassDiagrams",
  7. " ProcessModel : SimpleClassDiagrams",
  8. " Tracability : SimpleClassDiagrams",
  9. " core : CoreFormalism"])
  10. model_full_list = set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  11. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  12. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  13. " 221 root admin ManualOperation : SimpleClassDiagrams",
  14. " 221 root admin ProcessModel : SimpleClassDiagrams",
  15. " 221 root admin Tracability : SimpleClassDiagrams",
  16. " 200 root admin core : CoreFormalism"])
  17. all_files = [ "core/mini_modify.alc",
  18. "core/core_formalism.mvc",
  19. "core/core_algorithm.alc",
  20. "core/pm.mvc",
  21. "primitives.alc",
  22. "object_operations.alc",
  23. "conformance_scd.alc",
  24. "library.alc",
  25. "transform.alc",
  26. "model_management.alc",
  27. "ramify.alc",
  28. "metamodels.alc",
  29. "random.alc",
  30. "constructors.alc",
  31. "modelling.alc",
  32. "compilation_manager.alc",
  33. ]
  34. class TestModelverseCore(unittest.TestCase):
  35. def test_list(self):
  36. self.assertTrue(run_file(all_files,
  37. [ "root", "root", "root",
  38. "model_list",
  39. ],
  40. [ "Desired username for admin user?",
  41. "Desired password for admin user?",
  42. "Please repeat the password",
  43. "Passwords match!",
  44. "Welcome to the Model Management Interface v2.0!",
  45. "Use the 'help' command for a list of possible commands",
  46. "Ready for command...",
  47. set(model_list),
  48. ]))
  49. def test_list_full(self):
  50. self.assertTrue(run_file(all_files,
  51. [ "root", "root", "root",
  52. "model_list_full",
  53. ],
  54. [ "Desired username for admin user?",
  55. "Desired password for admin user?",
  56. "Please repeat the password",
  57. "Passwords match!",
  58. "Welcome to the Model Management Interface v2.0!",
  59. "Use the 'help' command for a list of possible commands",
  60. "Ready for command...",
  61. set(model_full_list),
  62. ]))
  63. def test_model_add_empty(self):
  64. self.assertTrue(run_file(all_files,
  65. [ "root", "root", "root",
  66. "model_add",
  67. "SimpleClassDiagrams",
  68. "Empty",
  69. "exit",
  70. "model_list",
  71. "model_list_full",
  72. ],
  73. [ "Desired username for admin user?",
  74. "Desired password for admin user?",
  75. "Please repeat the password",
  76. "Passwords match!",
  77. "Welcome to the Model Management Interface v2.0!",
  78. "Use the 'help' command for a list of possible commands",
  79. "Ready for command...",
  80. "Creating new model!",
  81. "Model type?",
  82. "Model name?",
  83. "Waiting for model constructors...",
  84. "Model upload success!",
  85. "Ready for command...",
  86. set(model_list) |
  87. set([" Empty : SimpleClassDiagrams",]),
  88. "Ready for command...",
  89. set(model_full_list) |
  90. set([" 200 root nobody Empty : SimpleClassDiagrams",]),
  91. ]))
  92. def test_model_empty_modify(self):
  93. self.assertTrue(run_file(all_files,
  94. [ "root", "root", "root",
  95. "model_add",
  96. "SimpleClassDiagrams",
  97. "Empty",
  98. "exit",
  99. "model_list",
  100. "model_list_full",
  101. "model_modify",
  102. "Empty",
  103. "instantiate",
  104. "Class",
  105. "A",
  106. "exit",
  107. "model_list_full",
  108. ],
  109. [ "Desired username for admin user?",
  110. "Desired password for admin user?",
  111. "Please repeat the password",
  112. "Passwords match!",
  113. "Welcome to the Model Management Interface v2.0!",
  114. "Use the 'help' command for a list of possible commands",
  115. "Ready for command...",
  116. "Creating new model!",
  117. "Model type?",
  118. "Model name?",
  119. "Waiting for model constructors...",
  120. "Model upload success!",
  121. "Ready for command...",
  122. set(model_list) |
  123. set([" Empty : SimpleClassDiagrams",]),
  124. "Ready for command...",
  125. set(model_full_list) |
  126. set([" 200 root nobody Empty : SimpleClassDiagrams",]),
  127. "Ready for command...",
  128. "Which model do you want to modify?",
  129. "Model loaded, ready for commands!",
  130. "Use 'help' command for a list of possible commands",
  131. "Please give your command.",
  132. "Type to instantiate?",
  133. "Name of new element?",
  134. "Instantiation successful!",
  135. "Please give your command.",
  136. "Ready for command...",
  137. set(model_full_list) |
  138. set([" 200 root nobody Empty : SimpleClassDiagrams",]),
  139. "Ready for command...",
  140. ]))
  141. def test_model_overwrite(self):
  142. self.assertTrue(run_file(all_files,
  143. [ "root", "root", "root",
  144. "model_add",
  145. "SimpleClassDiagrams",
  146. "Empty",
  147. "exit",
  148. "model_list_full",
  149. "model_modify",
  150. "Empty",
  151. "instantiate",
  152. "Class",
  153. "A",
  154. "exit",
  155. "model_list_full",
  156. "model_overwrite",
  157. "Empty",
  158. "instantiate_node",
  159. "",
  160. "Class",
  161. "B",
  162. "instantiate_node",
  163. "",
  164. "Class",
  165. "C",
  166. "exit",
  167. "model_list_full",
  168. "model_modify",
  169. "Empty",
  170. "list",
  171. "exit",
  172. ],
  173. [ "Desired username for admin user?",
  174. "Desired password for admin user?",
  175. "Please repeat the password",
  176. "Passwords match!",
  177. "Welcome to the Model Management Interface v2.0!",
  178. "Use the 'help' command for a list of possible commands",
  179. "Ready for command...",
  180. "Creating new model!",
  181. "Model type?",
  182. "Model name?",
  183. "Waiting for model constructors...",
  184. "Model upload success!",
  185. "Ready for command...",
  186. set(model_full_list) |
  187. set([" 200 root nobody Empty : SimpleClassDiagrams",]),
  188. "Ready for command...",
  189. "Which model do you want to modify?",
  190. "Model loaded, ready for commands!",
  191. "Use 'help' command for a list of possible commands",
  192. "Please give your command.",
  193. "Type to instantiate?",
  194. "Name of new element?",
  195. "Instantiation successful!",
  196. "Please give your command.",
  197. "Ready for command...",
  198. set(model_full_list) |
  199. set([" 200 root nobody Empty : SimpleClassDiagrams",]),
  200. "Ready for command...",
  201. "Which model to overwrite?",
  202. "Waiting for model constructors...",
  203. "Model overwrite success!",
  204. "Ready for command...",
  205. set(model_full_list) |
  206. set([" 200 root nobody Empty : SimpleClassDiagrams",]),
  207. "Ready for command...",
  208. "Which model do you want to modify?",
  209. "Model loaded, ready for commands!",
  210. "Use 'help' command for a list of possible commands",
  211. "Please give your command.",
  212. "List of all elements:",
  213. set([" B : Class",
  214. " C : Class"]),
  215. "Please give your command.",
  216. "Ready for command...",
  217. ]))
  218. def test_transform_add_MT_language(self):
  219. self.assertTrue(run_file(all_files,
  220. [ "root", "root", "root",
  221. "model_add",
  222. "SimpleClassDiagrams",
  223. "PetriNets",
  224. ] + get_model_constructor(open("integration/code/petrinets.mvc", "r").read()) + [
  225. "model_list_full",
  226. "transformation_add_MT_language",
  227. "PetriNets",
  228. "",
  229. "PetriNets_RAM",
  230. "model_list_full",
  231. ],
  232. [ "Desired username for admin user?",
  233. "Desired password for admin user?",
  234. "Please repeat the password",
  235. "Passwords match!",
  236. "Welcome to the Model Management Interface v2.0!",
  237. "Use the 'help' command for a list of possible commands",
  238. "Ready for command...",
  239. "Creating new model!",
  240. "Model type?",
  241. "Model name?",
  242. "Waiting for model constructors...",
  243. "Model upload success!",
  244. "Ready for command...",
  245. set(model_full_list) |
  246. set([" 200 root nobody PetriNets : SimpleClassDiagrams",]),
  247. "Ready for command...",
  248. "Formalisms to include (terminate with empty string)?",
  249. "Name of the RAMified transformation metamodel?",
  250. "Ready for command...",
  251. set(model_full_list) |
  252. set([" 200 root nobody PetriNets : SimpleClassDiagrams",
  253. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  254. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",]),
  255. "Ready for command...",
  256. ]))
  257. def test_transform_add_MT_instance(self):
  258. self.assertTrue(run_file(all_files,
  259. [ "root", "root", "root",
  260. "model_add",
  261. "SimpleClassDiagrams",
  262. "PetriNets",
  263. ] + get_model_constructor(open("integration/code/petrinets.mvc", "r").read()) + [
  264. "model_list_full",
  265. "transformation_add_MT_language",
  266. "PetriNets",
  267. "",
  268. "PetriNets_RAM",
  269. "model_list_full",
  270. "transformation_add_MT",
  271. "PetriNets_RAM",
  272. "PetriNets",
  273. "",
  274. "",
  275. "PetriNets_Print",
  276. "exit",
  277. "model_list_full",
  278. "transformation_list",
  279. "transformation_list_full",
  280. ],
  281. [ "Desired username for admin user?",
  282. "Desired password for admin user?",
  283. "Please repeat the password",
  284. "Passwords match!",
  285. "Welcome to the Model Management Interface v2.0!",
  286. "Use the 'help' command for a list of possible commands",
  287. "Ready for command...",
  288. "Creating new model!",
  289. "Model type?",
  290. "Model name?",
  291. "Waiting for model constructors...",
  292. "Model upload success!",
  293. "Ready for command...",
  294. set(model_full_list) |
  295. set([" 200 root nobody PetriNets : SimpleClassDiagrams",]),
  296. "Ready for command...",
  297. "Formalisms to include (terminate with empty string)?",
  298. "Name of the RAMified transformation metamodel?",
  299. "Ready for command...",
  300. set(model_full_list) |
  301. set([" 200 root nobody PetriNets : SimpleClassDiagrams",
  302. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  303. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",]),
  304. "Ready for command...",
  305. "RAMified metamodel to use?",
  306. "Supported metamodels:",
  307. set([" PetriNets",
  308. ]),
  309. "",
  310. "Which ones do you want to use as source (empty string to finish)?",
  311. "Which ones do you want to use as target (empty string to finish)?",
  312. "Name of new transformation?",
  313. "Waiting for model constructors...",
  314. "Ready for command...",
  315. set(model_full_list) |
  316. set([" 200 root nobody PetriNets : SimpleClassDiagrams",
  317. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  318. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  319. " 200 root nobody PetriNets_Print : PetriNets_RAM",]),
  320. "Ready for command...",
  321. set(["[ModelTransformation] PetriNets_Print : PetriNets_RAM",
  322. ]),
  323. "Ready for command...",
  324. set([" 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  325. ]),
  326. "Ready for command...",
  327. ]))
  328. def test_transform_add_MT_pn_print_upload(self):
  329. self.assertTrue(run_file(all_files,
  330. [ "root", "root", "root",
  331. "model_add",
  332. "SimpleClassDiagrams",
  333. "PetriNets",
  334. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  335. "model_list_full",
  336. "transformation_add_MT_language",
  337. "PetriNets",
  338. "",
  339. "PetriNets_RAM",
  340. "model_list_full",
  341. "transformation_add_MT",
  342. "PetriNets_RAM",
  343. "PetriNets",
  344. "",
  345. "",
  346. "PetriNets_Print",
  347. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  348. "transformation_list_full",
  349. ],
  350. [ "Desired username for admin user?",
  351. "Desired password for admin user?",
  352. "Please repeat the password",
  353. "Passwords match!",
  354. "Welcome to the Model Management Interface v2.0!",
  355. "Use the 'help' command for a list of possible commands",
  356. "Ready for command...",
  357. "Creating new model!",
  358. "Model type?",
  359. "Model name?",
  360. "Waiting for model constructors...",
  361. "Model upload success!",
  362. "Ready for command...",
  363. set(model_full_list) |
  364. set([" 200 root nobody PetriNets : SimpleClassDiagrams",]),
  365. "Ready for command...",
  366. "Formalisms to include (terminate with empty string)?",
  367. "Name of the RAMified transformation metamodel?",
  368. "Ready for command...",
  369. set(model_full_list) |
  370. set([" 200 root nobody PetriNets : SimpleClassDiagrams",
  371. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  372. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",]),
  373. "Ready for command...",
  374. "RAMified metamodel to use?",
  375. "Supported metamodels:",
  376. set([" PetriNets",
  377. ]),
  378. "",
  379. "Which ones do you want to use as source (empty string to finish)?",
  380. "Which ones do you want to use as target (empty string to finish)?",
  381. "Name of new transformation?",
  382. "Waiting for model constructors...",
  383. "Ready for command...",
  384. set([" 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  385. ]),
  386. "Ready for command...",
  387. ]))
  388. def test_transform_add_MT_pn_print_exec(self):
  389. self.assertTrue(run_file(all_files,
  390. [ "root", "root", "root",
  391. "model_add",
  392. "SimpleClassDiagrams",
  393. "PetriNets",
  394. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  395. "model_add",
  396. "PetriNets",
  397. "my_pn",
  398. ] + get_model_constructor(open("integration/code/pn_runtime_model.mvc", "r").read()) + [
  399. "model_list_full",
  400. "transformation_add_MT_language",
  401. "PetriNets",
  402. "",
  403. "PetriNets_RAM",
  404. "model_list_full",
  405. "transformation_add_MT",
  406. "PetriNets_RAM",
  407. "PetriNets",
  408. "",
  409. "",
  410. "PetriNets_Print",
  411. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  412. "transformation_list_full",
  413. "transformation_execute",
  414. "PetriNets_Print",
  415. "my_pn",
  416. "transformation_list_full",
  417. ],
  418. [ "Desired username for admin user?",
  419. "Desired password for admin user?",
  420. "Please repeat the password",
  421. "Passwords match!",
  422. "Welcome to the Model Management Interface v2.0!",
  423. "Use the 'help' command for a list of possible commands",
  424. "Ready for command...",
  425. "Creating new model!",
  426. "Model type?",
  427. "Model name?",
  428. "Waiting for model constructors...",
  429. "Model upload success!",
  430. "Ready for command...",
  431. "Creating new model!",
  432. "Model type?",
  433. "Model name?",
  434. "Waiting for model constructors...",
  435. "Model upload success!",
  436. "Ready for command...",
  437. set(model_full_list) |
  438. set([" 200 root nobody PetriNets : SimpleClassDiagrams",
  439. " 200 root nobody my_pn : PetriNets",]),
  440. "Ready for command...",
  441. "Formalisms to include (terminate with empty string)?",
  442. "Name of the RAMified transformation metamodel?",
  443. "Ready for command...",
  444. set(model_full_list) |
  445. set([" 200 root nobody PetriNets : SimpleClassDiagrams",
  446. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  447. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  448. " 200 root nobody my_pn : PetriNets",]),
  449. "Ready for command...",
  450. "RAMified metamodel to use?",
  451. "Supported metamodels:",
  452. set([" PetriNets",
  453. ]),
  454. "",
  455. "Which ones do you want to use as source (empty string to finish)?",
  456. "Which ones do you want to use as target (empty string to finish)?",
  457. "Name of new transformation?",
  458. "Waiting for model constructors...",
  459. "Ready for command...",
  460. set([" 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  461. ]),
  462. "Ready for command...",
  463. "Which transformation do you want to execute?",
  464. "Which model to bind for source element PetriNets",
  465. set(['"p1" --> 1',
  466. '"p2" --> 2',
  467. '"p3" --> 3',
  468. ]),
  469. "Transformation executed with result: True",
  470. "Ready for command...",
  471. ]))
  472. def test_transform_add_MT_pn_simulate(self):
  473. """
  474. This method tests the execution of a somewhat realistic use of the Modelverse and its core functions, through the use of a simple Petri nets example.
  475. First, Petri net metamodels are created for both the design language and the runtime language.
  476. Both languages only differ marginally from each other, with the runtime language only adding information on the currently selected transition for execution.
  477. Afterwards, a trivial Petri net model is created in the design language.
  478. This part tests the domain-specific and meta-modelling concepts of the Modelverse.
  479. After all models are created, transformations are defined to map between both languages: from design to runtime, and vice versa.
  480. Additional transformations are created for in-place model simulation and the printing of a Petri net model.
  481. This tests the modification of models, through the use of model transformations.
  482. Due to the use of a separate design and runtime language, we test exogenous transformations.
  483. The simulation transformation takes a single step in the Petri net model, by firing one of the applicable transitions, and therefore tests endogenous transformations.
  484. """
  485. self.assertTrue(run_file(all_files,
  486. [ "root", "root", "root",
  487. "model_add",
  488. "SimpleClassDiagrams",
  489. "PetriNets",
  490. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  491. "model_add",
  492. "SimpleClassDiagrams",
  493. "PetriNets_Runtime",
  494. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  495. "model_add",
  496. "PetriNets",
  497. "my_pn",
  498. ] + get_model_constructor(open("integration/code/pn_design_model.mvc", "r").read()) + [
  499. "model_list",
  500. "transformation_add_MT_language",
  501. "PetriNets_Runtime",
  502. "PetriNets",
  503. "",
  504. "PetriNets_RAM",
  505. "model_list",
  506. "model_modify",
  507. "__merged_PetriNets_RAM",
  508. "instantiate",
  509. "Association",
  510. "D2R_PlaceLink",
  511. "PetriNets/Place",
  512. "PetriNets_Runtime/Place",
  513. "instantiate",
  514. "Association",
  515. "D2R_TransitionLink",
  516. "PetriNets/Transition",
  517. "PetriNets_Runtime/Transition",
  518. "instantiate",
  519. "Association",
  520. "R2D_PlaceLink",
  521. "PetriNets_Runtime/Place",
  522. "PetriNets/Place",
  523. "instantiate",
  524. "Association",
  525. "R2D_TransitionLink",
  526. "PetriNets_Runtime/Transition",
  527. "PetriNets/Transition",
  528. "exit",
  529. "transformation_RAMify",
  530. "__merged_PetriNets_RAM",
  531. "PetriNets_RAM",
  532. "transformation_add_MT",
  533. "PetriNets_RAM",
  534. "PetriNets",
  535. "",
  536. "PetriNets_Runtime",
  537. "",
  538. "pn_design_to_runtime",
  539. ] + get_model_constructor(open("integration/code/pn_design_to_runtime.mvc", "r").read()) + [
  540. "transformation_add_MT",
  541. "PetriNets_RAM",
  542. "PetriNets_Runtime",
  543. "",
  544. "PetriNets",
  545. "",
  546. "pn_runtime_to_design",
  547. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  548. "transformation_add_MT",
  549. "PetriNets_RAM",
  550. "PetriNets_Runtime",
  551. "",
  552. "PetriNets_Runtime",
  553. "",
  554. "pn_step",
  555. ] + get_model_constructor(open("integration/code/pn_simulate.mvc", "r").read()) + [
  556. "transformation_add_MT",
  557. "PetriNets_RAM",
  558. "PetriNets",
  559. "",
  560. "",
  561. "pn_print",
  562. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  563. "model_list",
  564. "transformation_list",
  565. "transformation_execute",
  566. "pn_print",
  567. "my_pn",
  568. "transformation_execute",
  569. "pn_design_to_runtime",
  570. "my_pn",
  571. "my_pn_runtime",
  572. "transformation_execute",
  573. "pn_step",
  574. "my_pn_runtime",
  575. "my_pn_runtime",
  576. "transformation_execute",
  577. "pn_runtime_to_design",
  578. "my_pn_runtime",
  579. "my_pn",
  580. "transformation_execute",
  581. "pn_print",
  582. "my_pn",
  583. ],
  584. [ # bootup phase
  585. "Desired username for admin user?",
  586. "Desired password for admin user?",
  587. "Please repeat the password",
  588. "Passwords match!",
  589. "Welcome to the Model Management Interface v2.0!",
  590. "Use the 'help' command for a list of possible commands",
  591. "Ready for command...",
  592. # model_add
  593. "Creating new model!",
  594. "Model type?",
  595. "Model name?",
  596. "Waiting for model constructors...",
  597. "Model upload success!",
  598. "Ready for command...",
  599. # model_add
  600. "Creating new model!",
  601. "Model type?",
  602. "Model name?",
  603. "Waiting for model constructors...",
  604. "Model upload success!",
  605. "Ready for command...",
  606. # model_add
  607. "Creating new model!",
  608. "Model type?",
  609. "Model name?",
  610. "Waiting for model constructors...",
  611. "Model upload success!",
  612. "Ready for command...",
  613. # model_list
  614. set(model_list) |
  615. set([
  616. " PetriNets : SimpleClassDiagrams",
  617. " my_pn : PetriNets",
  618. " PetriNets_Runtime : SimpleClassDiagrams",]),
  619. "Ready for command...",
  620. # transformation_add_MT_language
  621. "Formalisms to include (terminate with empty string)?",
  622. "Name of the RAMified transformation metamodel?",
  623. "Ready for command...",
  624. # model_list
  625. set(model_list) |
  626. set([
  627. " PetriNets : SimpleClassDiagrams",
  628. " my_pn : PetriNets",
  629. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  630. " PetriNets_RAM : SimpleClassDiagrams",
  631. " PetriNets_Runtime : SimpleClassDiagrams",]),
  632. "Ready for command...",
  633. # model_modify
  634. "Which model do you want to modify?",
  635. "Model loaded, ready for commands!",
  636. "Use 'help' command for a list of possible commands",
  637. "Please give your command.",
  638. # instantiate 1
  639. "Type to instantiate?",
  640. "Name of new element?",
  641. "Source name?",
  642. "Destination name?",
  643. "Instantiation successful!",
  644. "Please give your command.",
  645. # instantiate 2
  646. "Type to instantiate?",
  647. "Name of new element?",
  648. "Source name?",
  649. "Destination name?",
  650. "Instantiation successful!",
  651. "Please give your command.",
  652. # instantiate 3
  653. "Type to instantiate?",
  654. "Name of new element?",
  655. "Source name?",
  656. "Destination name?",
  657. "Instantiation successful!",
  658. "Please give your command.",
  659. # instantiate 4
  660. "Type to instantiate?",
  661. "Name of new element?",
  662. "Source name?",
  663. "Destination name?",
  664. "Instantiation successful!",
  665. "Please give your command.",
  666. "Ready for command...",
  667. # transformation_RAMify
  668. "Which metamodel do you want to RAMify?",
  669. "Where do you want to store the RAMified metamodel?",
  670. "Ready for command...",
  671. # transformation_add_MT
  672. "RAMified metamodel to use?",
  673. "Supported metamodels:",
  674. set([" PetriNets",
  675. " PetriNets_Runtime",
  676. ]),
  677. "",
  678. "Which ones do you want to use as source (empty string to finish)?",
  679. "Which ones do you want to use as target (empty string to finish)?",
  680. "Name of new transformation?",
  681. "Waiting for model constructors...",
  682. "Ready for command...",
  683. # transformation_add_MT
  684. "RAMified metamodel to use?",
  685. "Supported metamodels:",
  686. set([" PetriNets",
  687. " PetriNets_Runtime",
  688. ]),
  689. "",
  690. "Which ones do you want to use as source (empty string to finish)?",
  691. "Which ones do you want to use as target (empty string to finish)?",
  692. "Name of new transformation?",
  693. "Waiting for model constructors...",
  694. "Ready for command...",
  695. # transformation_add_MT
  696. "RAMified metamodel to use?",
  697. "Supported metamodels:",
  698. set([" PetriNets",
  699. " PetriNets_Runtime",
  700. ]),
  701. "",
  702. "Which ones do you want to use as source (empty string to finish)?",
  703. "Which ones do you want to use as target (empty string to finish)?",
  704. "Name of new transformation?",
  705. "Waiting for model constructors...",
  706. "Ready for command...",
  707. # transformation_add_MT
  708. "RAMified metamodel to use?",
  709. "Supported metamodels:",
  710. set([" PetriNets",
  711. " PetriNets_Runtime",
  712. ]),
  713. "",
  714. "Which ones do you want to use as source (empty string to finish)?",
  715. "Which ones do you want to use as target (empty string to finish)?",
  716. "Name of new transformation?",
  717. "Waiting for model constructors...",
  718. "Ready for command...",
  719. # model_list
  720. set(model_list) |
  721. set([
  722. " PetriNets : SimpleClassDiagrams",
  723. " my_pn : PetriNets",
  724. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  725. " PetriNets_RAM : SimpleClassDiagrams",
  726. " pn_print : PetriNets_RAM",
  727. " pn_design_to_runtime : PetriNets_RAM",
  728. " pn_runtime_to_design : PetriNets_RAM",
  729. " pn_step : PetriNets_RAM",
  730. " PetriNets_Runtime : SimpleClassDiagrams",]),
  731. "Ready for command...",
  732. # transformation_list
  733. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  734. "[ModelTransformation] pn_design_to_runtime : PetriNets_RAM",
  735. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  736. "[ModelTransformation] pn_step : PetriNets_RAM"]),
  737. "Ready for command...",
  738. # transformation_execute (pn_print)
  739. "Which transformation do you want to execute?",
  740. "Which model to bind for source element PetriNets",
  741. set(['"p1" --> 1',
  742. '"p2" --> 2',
  743. '"p3" --> 3',
  744. ]),
  745. "Transformation executed with result: True",
  746. "Ready for command...",
  747. # transformation_execute (pn_design_to_runtime)
  748. "Which transformation do you want to execute?",
  749. "Which model to bind for source element PetriNets",
  750. "Which model to create for target element PetriNets_Runtime",
  751. "Transformation executed with result: True",
  752. "Ready for command...",
  753. # transformation_execute (pn_step)
  754. "Which transformation do you want to execute?",
  755. "Which model to bind for source element PetriNets_Runtime",
  756. "Which model to create for target element PetriNets_Runtime",
  757. "Transformation executed with result: True",
  758. "Ready for command...",
  759. # transformation_execute (pn_runtime_to_design)
  760. "Which transformation do you want to execute?",
  761. "Which model to bind for source element PetriNets_Runtime",
  762. "Which model to create for target element PetriNets",
  763. "Transformation executed with result: True",
  764. "Ready for command...",
  765. # transformation_execute (pn_print)
  766. "Which transformation do you want to execute?",
  767. "Which model to bind for source element PetriNets",
  768. set(['"p1" --> 0',
  769. '"p2" --> 1',
  770. '"p3" --> 5',
  771. ]),
  772. "Transformation executed with result: True",
  773. "Ready for command...",
  774. ]))
  775. @slow
  776. def test_transform_add_MT_pn_simulate_larger(self):
  777. def step_and_print():
  778. return [ \
  779. # transformation_execute (pn_step)
  780. "Which transformation do you want to execute?",
  781. "Which model to bind for source element PetriNets_Runtime",
  782. "Which model to create for target element PetriNets_Runtime",
  783. "Transformation executed with result: True",
  784. "Ready for command...",
  785. # transformation_execute (pn_runtime_to_design)
  786. "Which transformation do you want to execute?",
  787. "Which model to bind for source element PetriNets_Runtime",
  788. "Which model to create for target element PetriNets",
  789. "Transformation executed with result: True",
  790. "Ready for command...",
  791. # transformation_execute (pn_print)
  792. "Which transformation do you want to execute?",
  793. "Which model to bind for source element PetriNets",
  794. None,
  795. None,
  796. None,
  797. "Transformation executed with result: True",
  798. "Ready for command...",
  799. ]
  800. self.assertTrue(run_file(all_files,
  801. [ "root", "root", "root",
  802. "model_add",
  803. "SimpleClassDiagrams",
  804. "PetriNets",
  805. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  806. "model_add",
  807. "SimpleClassDiagrams",
  808. "PetriNets_Runtime",
  809. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  810. "model_add",
  811. "PetriNets",
  812. "my_pn",
  813. ] + get_model_constructor(open("integration/code/pn_design_model_larger.mvc", "r").read()) + [
  814. "model_list",
  815. "transformation_add_MT_language",
  816. "PetriNets_Runtime",
  817. "PetriNets",
  818. "",
  819. "PetriNets_RAM",
  820. "model_list",
  821. "model_modify",
  822. "__merged_PetriNets_RAM",
  823. "instantiate",
  824. "Association",
  825. "D2R_PlaceLink",
  826. "PetriNets/Place",
  827. "PetriNets_Runtime/Place",
  828. "instantiate",
  829. "Association",
  830. "D2R_TransitionLink",
  831. "PetriNets/Transition",
  832. "PetriNets_Runtime/Transition",
  833. "instantiate",
  834. "Association",
  835. "R2D_PlaceLink",
  836. "PetriNets_Runtime/Place",
  837. "PetriNets/Place",
  838. "instantiate",
  839. "Association",
  840. "R2D_TransitionLink",
  841. "PetriNets_Runtime/Transition",
  842. "PetriNets/Transition",
  843. "exit",
  844. "transformation_RAMify",
  845. "__merged_PetriNets_RAM",
  846. "PetriNets_RAM",
  847. "transformation_add_MT",
  848. "PetriNets_RAM",
  849. "PetriNets",
  850. "",
  851. "PetriNets_Runtime",
  852. "",
  853. "pn_design_to_runtime",
  854. ] + get_model_constructor(open("integration/code/pn_design_to_runtime.mvc", "r").read()) + [
  855. "transformation_add_MT",
  856. "PetriNets_RAM",
  857. "PetriNets_Runtime",
  858. "",
  859. "PetriNets",
  860. "",
  861. "pn_runtime_to_design",
  862. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  863. "transformation_add_MT",
  864. "PetriNets_RAM",
  865. "PetriNets_Runtime",
  866. "",
  867. "PetriNets_Runtime",
  868. "",
  869. "pn_step",
  870. ] + get_model_constructor(open("integration/code/pn_simulate.mvc", "r").read()) + [
  871. "transformation_add_MT",
  872. "PetriNets_RAM",
  873. "PetriNets",
  874. "",
  875. "",
  876. "pn_print",
  877. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  878. "model_list",
  879. "transformation_list",
  880. "transformation_execute",
  881. "pn_print",
  882. "my_pn",
  883. "transformation_execute",
  884. "pn_design_to_runtime",
  885. "my_pn",
  886. "my_pn_runtime", ] + [
  887. "transformation_execute",
  888. "pn_step",
  889. "my_pn_runtime",
  890. "my_pn_runtime",
  891. "transformation_execute",
  892. "pn_runtime_to_design",
  893. "my_pn_runtime",
  894. "my_pn",
  895. "transformation_execute",
  896. "pn_print",
  897. "my_pn",
  898. ] * 10 + [
  899. ],
  900. [ # bootup phase
  901. "Desired username for admin user?",
  902. "Desired password for admin user?",
  903. "Please repeat the password",
  904. "Passwords match!",
  905. "Welcome to the Model Management Interface v2.0!",
  906. "Use the 'help' command for a list of possible commands",
  907. "Ready for command...",
  908. # model_add
  909. "Creating new model!",
  910. "Model type?",
  911. "Model name?",
  912. "Waiting for model constructors...",
  913. "Model upload success!",
  914. "Ready for command...",
  915. # model_add
  916. "Creating new model!",
  917. "Model type?",
  918. "Model name?",
  919. "Waiting for model constructors...",
  920. "Model upload success!",
  921. "Ready for command...",
  922. # model_add
  923. "Creating new model!",
  924. "Model type?",
  925. "Model name?",
  926. "Waiting for model constructors...",
  927. "Model upload success!",
  928. "Ready for command...",
  929. # model_list
  930. set(model_list) |
  931. set([
  932. " PetriNets : SimpleClassDiagrams",
  933. " my_pn : PetriNets",
  934. " PetriNets_Runtime : SimpleClassDiagrams",]),
  935. "Ready for command...",
  936. # transformation_add_MT_language
  937. "Formalisms to include (terminate with empty string)?",
  938. "Name of the RAMified transformation metamodel?",
  939. "Ready for command...",
  940. # model_list
  941. set(model_list) |
  942. set([
  943. " PetriNets : SimpleClassDiagrams",
  944. " my_pn : PetriNets",
  945. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  946. " PetriNets_RAM : SimpleClassDiagrams",
  947. " PetriNets_Runtime : SimpleClassDiagrams",]),
  948. "Ready for command...",
  949. # model_modify
  950. "Which model do you want to modify?",
  951. "Model loaded, ready for commands!",
  952. "Use 'help' command for a list of possible commands",
  953. "Please give your command.",
  954. # instantiate 1
  955. "Type to instantiate?",
  956. "Name of new element?",
  957. "Source name?",
  958. "Destination name?",
  959. "Instantiation successful!",
  960. "Please give your command.",
  961. # instantiate 2
  962. "Type to instantiate?",
  963. "Name of new element?",
  964. "Source name?",
  965. "Destination name?",
  966. "Instantiation successful!",
  967. "Please give your command.",
  968. # instantiate 3
  969. "Type to instantiate?",
  970. "Name of new element?",
  971. "Source name?",
  972. "Destination name?",
  973. "Instantiation successful!",
  974. "Please give your command.",
  975. # instantiate 4
  976. "Type to instantiate?",
  977. "Name of new element?",
  978. "Source name?",
  979. "Destination name?",
  980. "Instantiation successful!",
  981. "Please give your command.",
  982. "Ready for command...",
  983. # transformation_RAMify
  984. "Which metamodel do you want to RAMify?",
  985. "Where do you want to store the RAMified metamodel?",
  986. "Ready for command...",
  987. # transformation_add_MT
  988. "RAMified metamodel to use?",
  989. "Supported metamodels:",
  990. set([" PetriNets",
  991. " PetriNets_Runtime",
  992. ]),
  993. "",
  994. "Which ones do you want to use as source (empty string to finish)?",
  995. "Which ones do you want to use as target (empty string to finish)?",
  996. "Name of new transformation?",
  997. "Waiting for model constructors...",
  998. "Ready for command...",
  999. # transformation_add_MT
  1000. "RAMified metamodel to use?",
  1001. "Supported metamodels:",
  1002. set([" PetriNets",
  1003. " PetriNets_Runtime",
  1004. ]),
  1005. "",
  1006. "Which ones do you want to use as source (empty string to finish)?",
  1007. "Which ones do you want to use as target (empty string to finish)?",
  1008. "Name of new transformation?",
  1009. "Waiting for model constructors...",
  1010. "Ready for command...",
  1011. # transformation_add_MT
  1012. "RAMified metamodel to use?",
  1013. "Supported metamodels:",
  1014. set([" PetriNets",
  1015. " PetriNets_Runtime",
  1016. ]),
  1017. "",
  1018. "Which ones do you want to use as source (empty string to finish)?",
  1019. "Which ones do you want to use as target (empty string to finish)?",
  1020. "Name of new transformation?",
  1021. "Waiting for model constructors...",
  1022. "Ready for command...",
  1023. # transformation_add_MT
  1024. "RAMified metamodel to use?",
  1025. "Supported metamodels:",
  1026. set([" PetriNets",
  1027. " PetriNets_Runtime",
  1028. ]),
  1029. "",
  1030. "Which ones do you want to use as source (empty string to finish)?",
  1031. "Which ones do you want to use as target (empty string to finish)?",
  1032. "Name of new transformation?",
  1033. "Waiting for model constructors...",
  1034. "Ready for command...",
  1035. # model_list
  1036. set(model_list) |
  1037. set([
  1038. " PetriNets : SimpleClassDiagrams",
  1039. " my_pn : PetriNets",
  1040. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1041. " PetriNets_RAM : SimpleClassDiagrams",
  1042. " pn_print : PetriNets_RAM",
  1043. " pn_design_to_runtime : PetriNets_RAM",
  1044. " pn_runtime_to_design : PetriNets_RAM",
  1045. " pn_step : PetriNets_RAM",
  1046. " PetriNets_Runtime : SimpleClassDiagrams",]),
  1047. "Ready for command...",
  1048. # transformation_list
  1049. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  1050. "[ModelTransformation] pn_design_to_runtime : PetriNets_RAM",
  1051. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  1052. "[ModelTransformation] pn_step : PetriNets_RAM"]),
  1053. "Ready for command...",
  1054. # transformation_execute (pn_print)
  1055. "Which transformation do you want to execute?",
  1056. "Which model to bind for source element PetriNets",
  1057. set(['"lock_available" --> 1',
  1058. '"critical_section_1" --> 0',
  1059. '"critical_section_2" --> 0',
  1060. ]),
  1061. "Transformation executed with result: True",
  1062. "Ready for command...",
  1063. # transformation_execute (pn_design_to_runtime)
  1064. "Which transformation do you want to execute?",
  1065. "Which model to bind for source element PetriNets",
  1066. "Which model to create for target element PetriNets_Runtime",
  1067. "Transformation executed with result: True",
  1068. "Ready for command...",
  1069. ] + \
  1070. step_and_print() * 10 +
  1071. []))
  1072. def test_transform_add_AL_pn_simulate(self):
  1073. self.assertTrue(run_file(all_files,
  1074. [ "root", "root", "root",
  1075. "model_add",
  1076. "SimpleClassDiagrams",
  1077. "PetriNets",
  1078. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  1079. "model_add",
  1080. "SimpleClassDiagrams",
  1081. "PetriNets_Runtime",
  1082. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  1083. "model_add",
  1084. "PetriNets",
  1085. "my_pn",
  1086. ] + get_model_constructor(open("integration/code/pn_design_model.mvc", "r").read()) + [
  1087. "model_list",
  1088. "transformation_add_MT_language",
  1089. "PetriNets_Runtime",
  1090. "PetriNets",
  1091. "",
  1092. "PetriNets_RAM",
  1093. "model_list",
  1094. "model_modify",
  1095. "__merged_PetriNets_RAM",
  1096. "instantiate",
  1097. "Association",
  1098. "D2R_PlaceLink",
  1099. "PetriNets/Place",
  1100. "PetriNets_Runtime/Place",
  1101. "instantiate",
  1102. "Association",
  1103. "D2R_TransitionLink",
  1104. "PetriNets/Transition",
  1105. "PetriNets_Runtime/Transition",
  1106. "instantiate",
  1107. "Association",
  1108. "R2D_PlaceLink",
  1109. "PetriNets_Runtime/Place",
  1110. "PetriNets/Place",
  1111. "instantiate",
  1112. "Association",
  1113. "R2D_TransitionLink",
  1114. "PetriNets_Runtime/Transition",
  1115. "PetriNets/Transition",
  1116. "exit",
  1117. "transformation_RAMify",
  1118. "__merged_PetriNets_RAM",
  1119. "PetriNets_RAM",
  1120. "transformation_add_MT",
  1121. "PetriNets_RAM",
  1122. "PetriNets",
  1123. "",
  1124. "PetriNets_Runtime",
  1125. "",
  1126. "pn_design_to_runtime",
  1127. ] + get_model_constructor(open("integration/code/pn_design_to_runtime.mvc", "r").read()) + [
  1128. "transformation_add_MT",
  1129. "PetriNets_RAM",
  1130. "PetriNets_Runtime",
  1131. "",
  1132. "PetriNets",
  1133. "",
  1134. "pn_runtime_to_design",
  1135. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  1136. "transformation_add_AL",
  1137. "PetriNets_Runtime",
  1138. "",
  1139. "PetriNets_Runtime",
  1140. "",
  1141. "pn_step",
  1142. ] + get_constructor(open("integration/code/pn_simulate.alc", "r").read()) + [
  1143. "transformation_add_MT",
  1144. "PetriNets_RAM",
  1145. "PetriNets",
  1146. "",
  1147. "",
  1148. "pn_print",
  1149. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  1150. "model_list",
  1151. "transformation_list",
  1152. "transformation_execute",
  1153. "pn_print",
  1154. "my_pn",
  1155. "transformation_execute",
  1156. "pn_design_to_runtime",
  1157. "my_pn",
  1158. "my_pn_runtime",
  1159. "transformation_execute",
  1160. "pn_step",
  1161. "my_pn_runtime",
  1162. "my_pn_runtime",
  1163. "transformation_execute",
  1164. "pn_runtime_to_design",
  1165. "my_pn_runtime",
  1166. "my_pn",
  1167. "transformation_execute",
  1168. "pn_print",
  1169. "my_pn",
  1170. ],
  1171. [ # bootup phase
  1172. "Desired username for admin user?",
  1173. "Desired password for admin user?",
  1174. "Please repeat the password",
  1175. "Passwords match!",
  1176. "Welcome to the Model Management Interface v2.0!",
  1177. "Use the 'help' command for a list of possible commands",
  1178. "Ready for command...",
  1179. # model_add
  1180. "Creating new model!",
  1181. "Model type?",
  1182. "Model name?",
  1183. "Waiting for model constructors...",
  1184. "Model upload success!",
  1185. "Ready for command...",
  1186. # model_add
  1187. "Creating new model!",
  1188. "Model type?",
  1189. "Model name?",
  1190. "Waiting for model constructors...",
  1191. "Model upload success!",
  1192. "Ready for command...",
  1193. # model_add
  1194. "Creating new model!",
  1195. "Model type?",
  1196. "Model name?",
  1197. "Waiting for model constructors...",
  1198. "Model upload success!",
  1199. "Ready for command...",
  1200. # model_list
  1201. set(model_list) |
  1202. set([" PetriNets : SimpleClassDiagrams",
  1203. " my_pn : PetriNets",
  1204. " PetriNets_Runtime : SimpleClassDiagrams",]),
  1205. "Ready for command...",
  1206. # transformation_add_MT_language
  1207. "Formalisms to include (terminate with empty string)?",
  1208. "Name of the RAMified transformation metamodel?",
  1209. "Ready for command...",
  1210. # model_list
  1211. set(model_list) |
  1212. set([
  1213. " PetriNets_Runtime : SimpleClassDiagrams",
  1214. " PetriNets : SimpleClassDiagrams",
  1215. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1216. " PetriNets_RAM : SimpleClassDiagrams",
  1217. " my_pn : PetriNets",]),
  1218. "Ready for command...",
  1219. # model_modify
  1220. "Which model do you want to modify?",
  1221. "Model loaded, ready for commands!",
  1222. "Use 'help' command for a list of possible commands",
  1223. "Please give your command.",
  1224. # instantiate 1
  1225. "Type to instantiate?",
  1226. "Name of new element?",
  1227. "Source name?",
  1228. "Destination name?",
  1229. "Instantiation successful!",
  1230. "Please give your command.",
  1231. # instantiate 2
  1232. "Type to instantiate?",
  1233. "Name of new element?",
  1234. "Source name?",
  1235. "Destination name?",
  1236. "Instantiation successful!",
  1237. "Please give your command.",
  1238. # instantiate 3
  1239. "Type to instantiate?",
  1240. "Name of new element?",
  1241. "Source name?",
  1242. "Destination name?",
  1243. "Instantiation successful!",
  1244. "Please give your command.",
  1245. # instantiate 4
  1246. "Type to instantiate?",
  1247. "Name of new element?",
  1248. "Source name?",
  1249. "Destination name?",
  1250. "Instantiation successful!",
  1251. "Please give your command.",
  1252. "Ready for command...",
  1253. # transformation_RAMify
  1254. "Which metamodel do you want to RAMify?",
  1255. "Where do you want to store the RAMified metamodel?",
  1256. "Ready for command...",
  1257. # transformation_add_MT
  1258. "RAMified metamodel to use?",
  1259. "Supported metamodels:",
  1260. set([" PetriNets",
  1261. " PetriNets_Runtime",
  1262. ]),
  1263. "",
  1264. "Which ones do you want to use as source (empty string to finish)?",
  1265. "Which ones do you want to use as target (empty string to finish)?",
  1266. "Name of new transformation?",
  1267. "Waiting for model constructors...",
  1268. "Ready for command...",
  1269. # transformation_add_MT
  1270. "RAMified metamodel to use?",
  1271. "Supported metamodels:",
  1272. set([" PetriNets",
  1273. " PetriNets_Runtime",
  1274. ]),
  1275. "",
  1276. "Which ones do you want to use as source (empty string to finish)?",
  1277. "Which ones do you want to use as target (empty string to finish)?",
  1278. "Name of new transformation?",
  1279. "Waiting for model constructors...",
  1280. "Ready for command...",
  1281. # transformation_add_AL
  1282. "Which metamodels do you want to use as source for the action code (empty string to finish)?",
  1283. "Which metamodels do you want to use as target for the action code (empty string to finish)?",
  1284. "Name of Action Language model?",
  1285. "Waiting for model constructors...",
  1286. "Ready for command...",
  1287. # transformation_add_MT
  1288. "RAMified metamodel to use?",
  1289. "Supported metamodels:",
  1290. set([" PetriNets",
  1291. " PetriNets_Runtime",
  1292. ]),
  1293. "",
  1294. "Which ones do you want to use as source (empty string to finish)?",
  1295. "Which ones do you want to use as target (empty string to finish)?",
  1296. "Name of new transformation?",
  1297. "Waiting for model constructors...",
  1298. "Ready for command...",
  1299. # model_list
  1300. set(model_list) |
  1301. set([
  1302. " PetriNets_Runtime : SimpleClassDiagrams",
  1303. " PetriNets : SimpleClassDiagrams",
  1304. " pn_print : PetriNets_RAM",
  1305. " pn_design_to_runtime : PetriNets_RAM",
  1306. " pn_runtime_to_design : PetriNets_RAM",
  1307. " pn_step : ActionLanguage",
  1308. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1309. " PetriNets_RAM : SimpleClassDiagrams",
  1310. " my_pn : PetriNets",]),
  1311. "Ready for command...",
  1312. # transformation_list
  1313. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  1314. "[ModelTransformation] pn_design_to_runtime : PetriNets_RAM",
  1315. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  1316. "[ActionLanguage] pn_step : ActionLanguage"]),
  1317. "Ready for command...",
  1318. # transformation_execute (pn_print)
  1319. "Which transformation do you want to execute?",
  1320. "Which model to bind for source element PetriNets",
  1321. set(['"p1" --> 1',
  1322. '"p2" --> 2',
  1323. '"p3" --> 3',
  1324. ]),
  1325. "Transformation executed with result: True",
  1326. "Ready for command...",
  1327. # transformation_execute (pn_design_to_runtime)
  1328. "Which transformation do you want to execute?",
  1329. "Which model to bind for source element PetriNets",
  1330. "Which model to create for target element PetriNets_Runtime",
  1331. "Transformation executed with result: True",
  1332. "Ready for command...",
  1333. # transformation_execute (pn_step)
  1334. "Which transformation do you want to execute?",
  1335. "Which model to bind for source element PetriNets_Runtime",
  1336. "Which model to create for target element PetriNets_Runtime",
  1337. "Ready for command...",
  1338. # transformation_execute (pn_runtime_to_design)
  1339. "Which transformation do you want to execute?",
  1340. "Which model to bind for source element PetriNets_Runtime",
  1341. "Which model to create for target element PetriNets",
  1342. "Transformation executed with result: True",
  1343. "Ready for command...",
  1344. # transformation_execute (pn_print)
  1345. "Which transformation do you want to execute?",
  1346. "Which model to bind for source element PetriNets",
  1347. set(['"p1" --> 0',
  1348. '"p2" --> 1',
  1349. '"p3" --> 5',
  1350. ]),
  1351. "Transformation executed with result: True",
  1352. "Ready for command...",
  1353. ]))
  1354. def test_transform_add_MANUAL_pn_simulate(self):
  1355. self.assertTrue(run_file(all_files,
  1356. [ "root", "root", "root",
  1357. "model_add",
  1358. "SimpleClassDiagrams",
  1359. "PetriNets",
  1360. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  1361. "model_add",
  1362. "SimpleClassDiagrams",
  1363. "PetriNets_Runtime",
  1364. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  1365. "model_add",
  1366. "PetriNets",
  1367. "my_pn",
  1368. ] + get_model_constructor(open("integration/code/pn_design_model.mvc", "r").read()) + [
  1369. "model_list",
  1370. "transformation_add_MT_language",
  1371. "PetriNets_Runtime",
  1372. "PetriNets",
  1373. "",
  1374. "PetriNets_RAM",
  1375. "model_list",
  1376. "model_modify",
  1377. "__merged_PetriNets_RAM",
  1378. "instantiate",
  1379. "Association",
  1380. "D2R_PlaceLink",
  1381. "PetriNets/Place",
  1382. "PetriNets_Runtime/Place",
  1383. "instantiate",
  1384. "Association",
  1385. "D2R_TransitionLink",
  1386. "PetriNets/Transition",
  1387. "PetriNets_Runtime/Transition",
  1388. "instantiate",
  1389. "Association",
  1390. "R2D_PlaceLink",
  1391. "PetriNets_Runtime/Place",
  1392. "PetriNets/Place",
  1393. "instantiate",
  1394. "Association",
  1395. "R2D_TransitionLink",
  1396. "PetriNets_Runtime/Transition",
  1397. "PetriNets/Transition",
  1398. "exit",
  1399. "transformation_RAMify",
  1400. "__merged_PetriNets_RAM",
  1401. "PetriNets_RAM",
  1402. "transformation_add_MANUAL",
  1403. "PetriNets",
  1404. "",
  1405. "PetriNets_Runtime",
  1406. "",
  1407. "pn_design_to_runtime",
  1408. "transformation_add_MT",
  1409. "PetriNets_RAM",
  1410. "PetriNets_Runtime",
  1411. "",
  1412. "PetriNets",
  1413. "",
  1414. "pn_runtime_to_design",
  1415. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  1416. "transformation_add_MT",
  1417. "PetriNets_RAM",
  1418. "PetriNets_Runtime",
  1419. "",
  1420. "PetriNets_Runtime",
  1421. "",
  1422. "pn_step",
  1423. ] + get_model_constructor(open("integration/code/pn_simulate.mvc", "r").read()) + [
  1424. "transformation_add_MT",
  1425. "PetriNets_RAM",
  1426. "PetriNets",
  1427. "",
  1428. "",
  1429. "pn_print",
  1430. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  1431. "model_list",
  1432. "transformation_list",
  1433. "transformation_execute",
  1434. "pn_print",
  1435. "my_pn",
  1436. "transformation_execute",
  1437. "pn_design_to_runtime",
  1438. "my_pn",
  1439. "my_pn_runtime",
  1440. "instantiate", "PetriNets_Runtime/Place", "p1",
  1441. "attr_add", "p1", "tokens", 1,
  1442. "attr_add", "p1", "name", "p1",
  1443. "instantiate", "PetriNets_Runtime/Place", "p2",
  1444. "attr_add", "p2", "tokens", 2,
  1445. "attr_add", "p2", "name", "p2",
  1446. "instantiate", "PetriNets_Runtime/Place", "p3",
  1447. "attr_add", "p3", "tokens", 3,
  1448. "attr_add", "p3", "name", "p3",
  1449. "instantiate", "PetriNets_Runtime/Transition", "t1",
  1450. "attr_add", "t1", "name", "t1",
  1451. "instantiate", "PetriNets_Runtime/P2T", "p2t1", "p1", "t1",
  1452. "attr_add", "p2t1", "weight", 1,
  1453. "instantiate", "PetriNets_Runtime/P2T", "p2t2", "p2", "t1",
  1454. "attr_add", "p2t2", "weight", 1,
  1455. "instantiate", "PetriNets_Runtime/T2P", "t2p", "t1", "p3",
  1456. "attr_add", "t2p", "weight", 2,
  1457. "exit",
  1458. "transformation_execute",
  1459. "pn_step",
  1460. "my_pn_runtime",
  1461. "my_pn_runtime",
  1462. "transformation_execute",
  1463. "pn_runtime_to_design",
  1464. "my_pn_runtime",
  1465. "my_pn",
  1466. "transformation_execute",
  1467. "pn_print",
  1468. "my_pn",
  1469. ],
  1470. [ # bootup phase
  1471. "Desired username for admin user?",
  1472. "Desired password for admin user?",
  1473. "Please repeat the password",
  1474. "Passwords match!",
  1475. "Welcome to the Model Management Interface v2.0!",
  1476. "Use the 'help' command for a list of possible commands",
  1477. "Ready for command...",
  1478. # model_add
  1479. "Creating new model!",
  1480. "Model type?",
  1481. "Model name?",
  1482. "Waiting for model constructors...",
  1483. "Model upload success!",
  1484. "Ready for command...",
  1485. # model_add
  1486. "Creating new model!",
  1487. "Model type?",
  1488. "Model name?",
  1489. "Waiting for model constructors...",
  1490. "Model upload success!",
  1491. "Ready for command...",
  1492. # model_add
  1493. "Creating new model!",
  1494. "Model type?",
  1495. "Model name?",
  1496. "Waiting for model constructors...",
  1497. "Model upload success!",
  1498. "Ready for command...",
  1499. # model_list
  1500. set(model_list) |
  1501. set([
  1502. " PetriNets : SimpleClassDiagrams",
  1503. " my_pn : PetriNets",
  1504. " PetriNets_Runtime : SimpleClassDiagrams",]),
  1505. "Ready for command...",
  1506. # transformation_add_MT_language
  1507. "Formalisms to include (terminate with empty string)?",
  1508. "Name of the RAMified transformation metamodel?",
  1509. "Ready for command...",
  1510. # model_list
  1511. set(model_list) |
  1512. set([
  1513. " PetriNets_Runtime : SimpleClassDiagrams",
  1514. " PetriNets : SimpleClassDiagrams",
  1515. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1516. " PetriNets_RAM : SimpleClassDiagrams",
  1517. " my_pn : PetriNets",]),
  1518. "Ready for command...",
  1519. # model_modify
  1520. "Which model do you want to modify?",
  1521. "Model loaded, ready for commands!",
  1522. "Use 'help' command for a list of possible commands",
  1523. "Please give your command.",
  1524. # instantiate 1
  1525. "Type to instantiate?",
  1526. "Name of new element?",
  1527. "Source name?",
  1528. "Destination name?",
  1529. "Instantiation successful!",
  1530. "Please give your command.",
  1531. # instantiate 2
  1532. "Type to instantiate?",
  1533. "Name of new element?",
  1534. "Source name?",
  1535. "Destination name?",
  1536. "Instantiation successful!",
  1537. "Please give your command.",
  1538. # instantiate 3
  1539. "Type to instantiate?",
  1540. "Name of new element?",
  1541. "Source name?",
  1542. "Destination name?",
  1543. "Instantiation successful!",
  1544. "Please give your command.",
  1545. # instantiate 4
  1546. "Type to instantiate?",
  1547. "Name of new element?",
  1548. "Source name?",
  1549. "Destination name?",
  1550. "Instantiation successful!",
  1551. "Please give your command.",
  1552. "Ready for command...",
  1553. # transformation_RAMify
  1554. "Which metamodel do you want to RAMify?",
  1555. "Where do you want to store the RAMified metamodel?",
  1556. "Ready for command...",
  1557. # transformation_add_MANUAL
  1558. "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
  1559. "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
  1560. "Name of Manual operation model?",
  1561. "Ready for command...",
  1562. # transformation_add_MT
  1563. "RAMified metamodel to use?",
  1564. "Supported metamodels:",
  1565. set([" PetriNets",
  1566. " PetriNets_Runtime",
  1567. ]),
  1568. "",
  1569. "Which ones do you want to use as source (empty string to finish)?",
  1570. "Which ones do you want to use as target (empty string to finish)?",
  1571. "Name of new transformation?",
  1572. "Waiting for model constructors...",
  1573. "Ready for command...",
  1574. # transformation_add_MT
  1575. "RAMified metamodel to use?",
  1576. "Supported metamodels:",
  1577. set([" PetriNets",
  1578. " PetriNets_Runtime",
  1579. ]),
  1580. "",
  1581. "Which ones do you want to use as source (empty string to finish)?",
  1582. "Which ones do you want to use as target (empty string to finish)?",
  1583. "Name of new transformation?",
  1584. "Waiting for model constructors...",
  1585. "Ready for command...",
  1586. # transformation_add_MT
  1587. "RAMified metamodel to use?",
  1588. "Supported metamodels:",
  1589. set([" PetriNets",
  1590. " PetriNets_Runtime",
  1591. ]),
  1592. "",
  1593. "Which ones do you want to use as source (empty string to finish)?",
  1594. "Which ones do you want to use as target (empty string to finish)?",
  1595. "Name of new transformation?",
  1596. "Waiting for model constructors...",
  1597. "Ready for command...",
  1598. # model_list
  1599. set(model_list) |
  1600. set([
  1601. " PetriNets_Runtime : SimpleClassDiagrams",
  1602. " PetriNets : SimpleClassDiagrams",
  1603. " pn_print : PetriNets_RAM",
  1604. " pn_design_to_runtime : ManualOperation",
  1605. " pn_runtime_to_design : PetriNets_RAM",
  1606. " pn_step : PetriNets_RAM",
  1607. " __merged_pn_design_to_runtime : SimpleClassDiagrams",
  1608. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1609. " PetriNets_RAM : SimpleClassDiagrams",
  1610. " my_pn : PetriNets",]),
  1611. "Ready for command...",
  1612. # transformation_list
  1613. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  1614. "[ManualOperation] pn_design_to_runtime : ManualOperation",
  1615. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  1616. "[ModelTransformation] pn_step : PetriNets_RAM"]),
  1617. "Ready for command...",
  1618. # transformation_execute (pn_print)
  1619. "Which transformation do you want to execute?",
  1620. "Which model to bind for source element PetriNets",
  1621. set(['"p1" --> 1',
  1622. '"p2" --> 2',
  1623. '"p3" --> 3',
  1624. ]),
  1625. "Transformation executed with result: True",
  1626. "Ready for command...",
  1627. # transformation_execute (pn_design_to_runtime)
  1628. "Which transformation do you want to execute?",
  1629. "Which model to bind for source element PetriNets",
  1630. "Which model to create for target element PetriNets_Runtime",
  1631. "Model loaded, ready for commands!",
  1632. "Use 'help' command for a list of possible commands",
  1633. "Please give your command.",
  1634. # instantiate p1
  1635. "Type to instantiate?",
  1636. "Name of new element?",
  1637. "Instantiation successful!",
  1638. "Please give your command.",
  1639. "Which model do you want to assign an attribute to?",
  1640. "Which attribute do you wish to assign?",
  1641. "Value of attribute?",
  1642. "Added attribute!",
  1643. "Please give your command.",
  1644. "Which model do you want to assign an attribute to?",
  1645. "Which attribute do you wish to assign?",
  1646. "Value of attribute?",
  1647. "Added attribute!",
  1648. "Please give your command.",
  1649. # instantiate p2
  1650. "Type to instantiate?",
  1651. "Name of new element?",
  1652. "Instantiation successful!",
  1653. "Please give your command.",
  1654. "Which model do you want to assign an attribute to?",
  1655. "Which attribute do you wish to assign?",
  1656. "Value of attribute?",
  1657. "Added attribute!",
  1658. "Please give your command.",
  1659. "Which model do you want to assign an attribute to?",
  1660. "Which attribute do you wish to assign?",
  1661. "Value of attribute?",
  1662. "Added attribute!",
  1663. "Please give your command.",
  1664. # instantiate p3
  1665. "Type to instantiate?",
  1666. "Name of new element?",
  1667. "Instantiation successful!",
  1668. "Please give your command.",
  1669. "Which model do you want to assign an attribute to?",
  1670. "Which attribute do you wish to assign?",
  1671. "Value of attribute?",
  1672. "Added attribute!",
  1673. "Please give your command.",
  1674. "Which model do you want to assign an attribute to?",
  1675. "Which attribute do you wish to assign?",
  1676. "Value of attribute?",
  1677. "Added attribute!",
  1678. "Please give your command.",
  1679. # instantiate t1
  1680. "Type to instantiate?",
  1681. "Name of new element?",
  1682. "Instantiation successful!",
  1683. "Please give your command.",
  1684. "Which model do you want to assign an attribute to?",
  1685. "Which attribute do you wish to assign?",
  1686. "Value of attribute?",
  1687. "Added attribute!",
  1688. "Please give your command.",
  1689. # instantiate p2t1
  1690. "Type to instantiate?",
  1691. "Name of new element?",
  1692. "Source name?",
  1693. "Destination name?",
  1694. "Instantiation successful!",
  1695. "Please give your command.",
  1696. "Which model do you want to assign an attribute to?",
  1697. "Which attribute do you wish to assign?",
  1698. "Value of attribute?",
  1699. "Added attribute!",
  1700. "Please give your command.",
  1701. # instantiate p2t2
  1702. "Type to instantiate?",
  1703. "Name of new element?",
  1704. "Source name?",
  1705. "Destination name?",
  1706. "Instantiation successful!",
  1707. "Please give your command.",
  1708. "Which model do you want to assign an attribute to?",
  1709. "Which attribute do you wish to assign?",
  1710. "Value of attribute?",
  1711. "Added attribute!",
  1712. "Please give your command.",
  1713. # instantiate t2p1
  1714. "Type to instantiate?",
  1715. "Name of new element?",
  1716. "Source name?",
  1717. "Destination name?",
  1718. "Instantiation successful!",
  1719. "Please give your command.",
  1720. "Which model do you want to assign an attribute to?",
  1721. "Which attribute do you wish to assign?",
  1722. "Value of attribute?",
  1723. "Added attribute!",
  1724. "Please give your command.",
  1725. "Ready for command...",
  1726. # transformation_execute (pn_step)
  1727. "Which transformation do you want to execute?",
  1728. "Which model to bind for source element PetriNets_Runtime",
  1729. "Which model to create for target element PetriNets_Runtime",
  1730. "Transformation executed with result: True",
  1731. "Ready for command...",
  1732. # transformation_execute (pn_runtime_to_design)
  1733. "Which transformation do you want to execute?",
  1734. "Which model to bind for source element PetriNets_Runtime",
  1735. "Which model to create for target element PetriNets",
  1736. "Transformation executed with result: True",
  1737. "Ready for command...",
  1738. # transformation_execute (pn_print)
  1739. "Which transformation do you want to execute?",
  1740. "Which model to bind for source element PetriNets",
  1741. set(['"p1" --> 0',
  1742. '"p2" --> 1',
  1743. '"p3" --> 5',
  1744. ]),
  1745. "Transformation executed with result: True",
  1746. "Ready for command...",
  1747. ]))
  1748. def test_process_model_trivial_pn(self):
  1749. self.assertTrue(run_file(all_files,
  1750. [ "root", "root", "root",
  1751. "model_add",
  1752. "SimpleClassDiagrams",
  1753. "PetriNet",
  1754. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  1755. "model_add",
  1756. "SimpleClassDiagrams",
  1757. "ReachabilityGraph",
  1758. ] + get_model_constructor(open("integration/code/reachability_graph.mvc", "r").read()) + [
  1759. "model_list",
  1760. "transformation_add_MT_language",
  1761. "PetriNet",
  1762. "",
  1763. "PetriNet_RAM",
  1764. "transformation_add_MT_language",
  1765. "ReachabilityGraph",
  1766. "",
  1767. "ReachabilityGraph_RAM",
  1768. "transformation_add_MT",
  1769. "PetriNet_RAM",
  1770. "",
  1771. "PetriNet",
  1772. "",
  1773. "initialize_PN",
  1774. ] + get_model_constructor(open("integration/code/initialize_PN.mvc", "r").read()) + [
  1775. "transformation_add_MANUAL",
  1776. "PetriNet",
  1777. "",
  1778. "PetriNet",
  1779. "",
  1780. "refine_PN",
  1781. "transformation_add_AL",
  1782. "PetriNet",
  1783. "",
  1784. "ReachabilityGraph",
  1785. "",
  1786. "reachability",
  1787. ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
  1788. "transformation_add_MT",
  1789. "ReachabilityGraph_RAM",
  1790. "ReachabilityGraph",
  1791. "",
  1792. "",
  1793. "reachability_print",
  1794. ] + get_model_constructor(open("integration/code/reachabilitygraph_print.mvc", "r").read()) + [
  1795. "model_add",
  1796. "ProcessModel",
  1797. "pn_reachability",
  1798. ] + get_model_constructor(open("integration/code/pm_pn_reachability.mvc", "r").read()) + [
  1799. "model_list",
  1800. "process_execute",
  1801. "pn_reachability",
  1802. "my_",
  1803. "instantiate",
  1804. "PetriNet/Place",
  1805. "p1",
  1806. "attr_add",
  1807. "p1",
  1808. "name",
  1809. "p1",
  1810. "attr_add",
  1811. "p1",
  1812. "tokens",
  1813. 1,
  1814. "instantiate",
  1815. "PetriNet/Transition",
  1816. "t1",
  1817. "attr_add",
  1818. "t1",
  1819. "name",
  1820. "t1",
  1821. "instantiate",
  1822. "PetriNet/P2T",
  1823. "p2t",
  1824. "p1",
  1825. "t1",
  1826. "attr_add",
  1827. "p2t",
  1828. "weight",
  1829. 1,
  1830. "exit",
  1831. "model_list",
  1832. ],
  1833. [ # bootup phase
  1834. "Desired username for admin user?",
  1835. "Desired password for admin user?",
  1836. "Please repeat the password",
  1837. "Passwords match!",
  1838. "Welcome to the Model Management Interface v2.0!",
  1839. "Use the 'help' command for a list of possible commands",
  1840. "Ready for command...",
  1841. # model_add
  1842. "Creating new model!",
  1843. "Model type?",
  1844. "Model name?",
  1845. "Waiting for model constructors...",
  1846. "Model upload success!",
  1847. "Ready for command...",
  1848. # model_add
  1849. "Creating new model!",
  1850. "Model type?",
  1851. "Model name?",
  1852. "Waiting for model constructors...",
  1853. "Model upload success!",
  1854. "Ready for command...",
  1855. # model_list
  1856. set(model_list) |
  1857. set([
  1858. " PetriNet : SimpleClassDiagrams",
  1859. " ReachabilityGraph : SimpleClassDiagrams",]),
  1860. "Ready for command...",
  1861. # transformation_add_MT_language
  1862. "Formalisms to include (terminate with empty string)?",
  1863. "Name of the RAMified transformation metamodel?",
  1864. "Ready for command...",
  1865. # transformation_add_MT_language
  1866. "Formalisms to include (terminate with empty string)?",
  1867. "Name of the RAMified transformation metamodel?",
  1868. "Ready for command...",
  1869. # transformation_add_MT
  1870. "RAMified metamodel to use?",
  1871. "Supported metamodels:",
  1872. set([" PetriNet",]),
  1873. "",
  1874. "Which ones do you want to use as source (empty string to finish)?",
  1875. "Which ones do you want to use as target (empty string to finish)?",
  1876. "Name of new transformation?",
  1877. "Waiting for model constructors...",
  1878. "Ready for command...",
  1879. # transformation_add_MANUAL
  1880. "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
  1881. "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
  1882. "Name of Manual operation model?",
  1883. "Ready for command...",
  1884. # transformation_add_AL
  1885. "Which metamodels do you want to use as source for the action code (empty string to finish)?",
  1886. "Which metamodels do you want to use as target for the action code (empty string to finish)?",
  1887. "Name of Action Language model?",
  1888. "Waiting for model constructors...",
  1889. "Ready for command...",
  1890. # transformation_add_MT
  1891. "RAMified metamodel to use?",
  1892. "Supported metamodels:",
  1893. set([" ReachabilityGraph",]),
  1894. "",
  1895. "Which ones do you want to use as source (empty string to finish)?",
  1896. "Which ones do you want to use as target (empty string to finish)?",
  1897. "Name of new transformation?",
  1898. "Waiting for model constructors...",
  1899. "Ready for command...",
  1900. # model_add
  1901. "Creating new model!",
  1902. "Model type?",
  1903. "Model name?",
  1904. "Waiting for model constructors...",
  1905. "Model upload success!",
  1906. "Ready for command...",
  1907. # model_list
  1908. set(model_list) |
  1909. set([
  1910. " PetriNet : SimpleClassDiagrams",
  1911. " ReachabilityGraph : SimpleClassDiagrams",
  1912. " initialize_PN : PetriNet_RAM",
  1913. " refine_PN : ManualOperation",
  1914. " reachability : ActionLanguage",
  1915. " reachability_print : ReachabilityGraph_RAM",
  1916. " pn_reachability : ProcessModel",
  1917. " PetriNet_RAM : SimpleClassDiagrams",
  1918. " ReachabilityGraph_RAM : SimpleClassDiagrams",
  1919. " __merged_PetriNet_RAM : SimpleClassDiagrams",
  1920. " __merged_ReachabilityGraph_RAM : SimpleClassDiagrams",
  1921. " __merged_refine_PN : SimpleClassDiagrams",
  1922. ]),
  1923. "Ready for command...",
  1924. # process_execute
  1925. "Which process model do you want to execute?",
  1926. "Model prefix to use?",
  1927. "Please perform manual transformation \"refine_PN\"",
  1928. "Model loaded, ready for commands!",
  1929. "Use 'help' command for a list of possible commands",
  1930. "Please give your command.",
  1931. # instantiate p1
  1932. "Type to instantiate?",
  1933. "Name of new element?",
  1934. "Instantiation successful!",
  1935. "Please give your command.",
  1936. "Which model do you want to assign an attribute to?",
  1937. "Which attribute do you wish to assign?",
  1938. "Value of attribute?",
  1939. "Added attribute!",
  1940. "Please give your command.",
  1941. "Which model do you want to assign an attribute to?",
  1942. "Which attribute do you wish to assign?",
  1943. "Value of attribute?",
  1944. "Added attribute!",
  1945. "Please give your command.",
  1946. # instantiate t1
  1947. "Type to instantiate?",
  1948. "Name of new element?",
  1949. "Instantiation successful!",
  1950. "Please give your command.",
  1951. "Which model do you want to assign an attribute to?",
  1952. "Which attribute do you wish to assign?",
  1953. "Value of attribute?",
  1954. "Added attribute!",
  1955. "Please give your command.",
  1956. # instantiate p2t
  1957. "Type to instantiate?",
  1958. "Name of new element?",
  1959. "Source name?",
  1960. "Destination name?",
  1961. "Instantiation successful!",
  1962. "Please give your command.",
  1963. "Which model do you want to assign an attribute to?",
  1964. "Which attribute do you wish to assign?",
  1965. "Value of attribute?",
  1966. "Added attribute!",
  1967. "Please give your command.",
  1968. set(['"0": {"p1": 1, }',
  1969. '"1": {"p1": 0, }',
  1970. ]),
  1971. set(['"0" --["t1"]--> "1"',
  1972. ]),
  1973. "Ready for command...",
  1974. # model_list
  1975. set(model_list) |
  1976. set([
  1977. " PetriNet : SimpleClassDiagrams",
  1978. " ReachabilityGraph : SimpleClassDiagrams",
  1979. " initialize_PN : PetriNet_RAM",
  1980. " refine_PN : ManualOperation",
  1981. " reachability : ActionLanguage",
  1982. " reachability_print : ReachabilityGraph_RAM",
  1983. " pn_reachability : ProcessModel",
  1984. " PetriNet_RAM : SimpleClassDiagrams",
  1985. " ReachabilityGraph_RAM : SimpleClassDiagrams",
  1986. " my_pn : PetriNet",
  1987. " my_reachability : ReachabilityGraph",
  1988. " __merged_PetriNet_RAM : SimpleClassDiagrams",
  1989. " __merged_ReachabilityGraph_RAM : SimpleClassDiagrams",
  1990. " __merged_refine_PN : SimpleClassDiagrams",
  1991. ]),
  1992. "Ready for command...",
  1993. ]))