test_mvc.py 89 KB

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