test_powerwindow.py 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429
  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 TestPowerWindow(unittest.TestCase):
  35. def test_process_powerwindow_fast(self):
  36. self.assertTrue(run_file(all_files,
  37. [ "root", "root", "root",
  38. "model_add",
  39. "SimpleClassDiagrams",
  40. "ReachabilityGraph",
  41. ] + get_model_constructor_2("models/reachability_graph.mvc") + [
  42. "model_add",
  43. "SimpleClassDiagrams",
  44. "PetriNet",
  45. ] + get_model_constructor_2("integration/code/pn_design.mvc") + [
  46. "model_add",
  47. "SimpleClassDiagrams",
  48. "Encapsulated_PetriNet",
  49. ] + get_model_constructor_2("models/petrinet_ports.mvc") + [
  50. "model_add",
  51. "SimpleClassDiagrams",
  52. "PW_Plant",
  53. ] + get_model_constructor_2("models/plant_PW.mvc") + [
  54. "model_add",
  55. "SimpleClassDiagrams",
  56. "PW_Environment",
  57. ] + get_model_constructor_2("models/environment_PW.mvc") + [
  58. "model_add",
  59. "SimpleClassDiagrams",
  60. "PW_Control",
  61. ] + get_model_constructor_2("models/control_PW.mvc") + [
  62. "model_add",
  63. "SimpleClassDiagrams",
  64. "Requirements",
  65. ] + get_model_constructor_2("models/requirements.mvc") + [
  66. "model_add",
  67. "SimpleClassDiagrams",
  68. "Query",
  69. ] + get_model_constructor_2("models/query.mvc") + [
  70. "model_add",
  71. "ProcessModel",
  72. "pm_powerwindow",
  73. ] + get_model_constructor_2("models/pm_req_analyse.mvc") + [
  74. "model_add",
  75. "SimpleClassDiagrams",
  76. "Architecture",
  77. ] + get_model_constructor_2("models/architecture.mvc") + [
  78. "model_list",
  79. "transformation_add_MT_language",
  80. "PetriNet",
  81. "Encapsulated_PetriNet",
  82. "PW_Plant",
  83. "PW_Control",
  84. "PW_Environment",
  85. "Requirements",
  86. "ReachabilityGraph",
  87. "Query",
  88. "Architecture",
  89. "",
  90. "All_RAM",
  91. "model_modify",
  92. "__merged_All_RAM",
  93. "instantiate",
  94. "Association",
  95. "CTRL2EPN_link",
  96. "PW_Control/State",
  97. "Encapsulated_PetriNet/Place",
  98. "instantiate",
  99. "Association",
  100. "CTRL2EPN_tlink",
  101. "PW_Control/Transition",
  102. "Encapsulated_PetriNet/Transition",
  103. "instantiate",
  104. "Association",
  105. "PLANT2EPN_link",
  106. "PW_Plant/State",
  107. "Encapsulated_PetriNet/Place",
  108. "instantiate",
  109. "Association",
  110. "PLANT2EPN_tlink",
  111. "PW_Plant/Transition",
  112. "Encapsulated_PetriNet/Transition",
  113. "instantiate",
  114. "Association",
  115. "ENV2EPN_link",
  116. "PW_Environment/Event",
  117. "Encapsulated_PetriNet/Place",
  118. "instantiate",
  119. "Association",
  120. "EPN2PN_place_link",
  121. "Encapsulated_PetriNet/Place",
  122. "PetriNet/Place",
  123. "instantiate",
  124. "Association",
  125. "EPN2PN_transition_link",
  126. "Encapsulated_PetriNet/Transition",
  127. "PetriNet/Transition",
  128. "exit",
  129. "transformation_RAMify",
  130. "__merged_All_RAM",
  131. "All_RAM",
  132. "transformation_add_MANUAL",
  133. "Requirements",
  134. "",
  135. "Requirements",
  136. "",
  137. "revise_req",
  138. "transformation_add_MANUAL",
  139. "Requirements",
  140. "PW_Environment",
  141. "",
  142. "PW_Environment",
  143. "",
  144. "revise_environment",
  145. "transformation_add_MANUAL",
  146. "Requirements",
  147. "PW_Plant",
  148. "",
  149. "PW_Plant",
  150. "",
  151. "revise_plant",
  152. "transformation_add_MANUAL",
  153. "Requirements",
  154. "PW_Control",
  155. "",
  156. "PW_Control",
  157. "",
  158. "revise_control",
  159. "transformation_add_MANUAL",
  160. "Requirements",
  161. "Query",
  162. "",
  163. "Query",
  164. "",
  165. "revise_query",
  166. "transformation_add_MANUAL",
  167. "Requirements",
  168. "Architecture",
  169. "",
  170. "Architecture",
  171. "",
  172. "revise_architecture",
  173. "transformation_add_MT",
  174. "All_RAM",
  175. "",
  176. "PW_Plant",
  177. "PW_Environment",
  178. "PW_Control",
  179. "Query",
  180. "Architecture",
  181. "Requirements",
  182. "",
  183. "make_initial_models",
  184. ] + get_model_constructor_2("models/initialize.mvc") + [
  185. "transformation_add_MT",
  186. "All_RAM",
  187. "PW_Plant",
  188. "",
  189. "Encapsulated_PetriNet",
  190. "",
  191. "plant_to_EPN",
  192. ] + get_model_constructor_2("models/plant_to_EPN.mvc") + [
  193. "transformation_add_MT",
  194. "All_RAM",
  195. "PW_Control",
  196. "",
  197. "Encapsulated_PetriNet",
  198. "",
  199. "control_to_EPN",
  200. ] + get_model_constructor_2("models/control_to_EPN.mvc") + [
  201. "transformation_add_MT",
  202. "All_RAM",
  203. "PW_Environment",
  204. "",
  205. "Encapsulated_PetriNet",
  206. "",
  207. "environment_to_EPN",
  208. ] + get_model_constructor_2("models/environment_to_EPN.mvc") + [
  209. "transformation_add_MT",
  210. "All_RAM",
  211. "Encapsulated_PetriNet",
  212. "Architecture",
  213. "",
  214. "Encapsulated_PetriNet",
  215. "",
  216. "combine_EPN",
  217. ] + get_model_constructor_2("models/combine_EPN.mvc") + [
  218. "transformation_add_MT",
  219. "All_RAM",
  220. "ReachabilityGraph",
  221. "Query",
  222. "",
  223. "",
  224. "match",
  225. ] + get_model_constructor_2("models/matches.mvc") + [
  226. "transformation_add_AL",
  227. "PetriNet",
  228. "",
  229. "ReachabilityGraph",
  230. "",
  231. "reachability",
  232. ] + get_constructor(open("models/reachability.alc", "r").read()) + [
  233. "transformation_add_AL",
  234. "ReachabilityGraph",
  235. "",
  236. "",
  237. "bfs",
  238. ] + get_constructor(open("models/bfs.alc", "r").read()) + [
  239. "model_list",
  240. "process_execute",
  241. "pm_powerwindow",
  242. "pm_",
  243. # revise_req
  244. "upload",
  245. ] + get_model_constructor_2("models/requirements_model.mvc") + [
  246. "exit",
  247. # revise_plant
  248. "upload",
  249. ] + get_model_constructor_2("models/plant_model.mvc") + [
  250. "exit",
  251. # revise_environment
  252. "upload",
  253. ] + get_model_constructor_2("models/environment_model.mvc") + [
  254. "exit",
  255. # revise_control
  256. "upload",
  257. ] + get_model_constructor_2("models/control_model.mvc") + [
  258. "exit",
  259. # revise_query
  260. "upload",
  261. ] + get_model_constructor_2("models/query_model.mvc") + [
  262. "exit",
  263. # revise_architecture
  264. "upload",
  265. ] + get_model_constructor_2("models/architecture_model.mvc") + [
  266. "exit",
  267. ],
  268. [ # bootup phase
  269. "Desired username for admin user?",
  270. "Desired password for admin user?",
  271. "Please repeat the password",
  272. "Passwords match!",
  273. "Welcome to the Model Management Interface v2.0!",
  274. "Use the 'help' command for a list of possible commands",
  275. "Ready for command...",
  276. # model_add * 10
  277. ] + [ "Creating new model!",
  278. "Model type?",
  279. "Model name?",
  280. "Waiting for model constructors...",
  281. "Model upload success!",
  282. "Ready for command...", ] * 10 + [
  283. # model_list
  284. model_list |
  285. set([
  286. " ReachabilityGraph : SimpleClassDiagrams",
  287. " PetriNet : SimpleClassDiagrams",
  288. " Encapsulated_PetriNet : SimpleClassDiagrams",
  289. " PW_Plant : SimpleClassDiagrams",
  290. " PW_Environment : SimpleClassDiagrams",
  291. " PW_Control : SimpleClassDiagrams",
  292. " Requirements : SimpleClassDiagrams",
  293. " Query : SimpleClassDiagrams",
  294. " pm_powerwindow : ProcessModel",
  295. " Architecture : SimpleClassDiagrams",
  296. ]),
  297. "Ready for command...",
  298. # transformation_add_MT_language
  299. "Formalisms to include (terminate with empty string)?",
  300. "Name of the RAMified transformation metamodel?",
  301. "Ready for command...",
  302. # model_modify
  303. "Which model do you want to modify?",
  304. "Model loaded, ready for commands!",
  305. "Mode: r/w",
  306. "Use 'help' command for a list of possible commands",
  307. "Please give your command.",
  308. # instantiate * 7
  309. ] + [ "Type to instantiate?",
  310. "Name of new element?",
  311. "Source name?",
  312. "Destination name?",
  313. "Instantiation successful!",
  314. None,
  315. "Please give your command.", ] * 7 + [
  316. "Ready for command...",
  317. # transformation_RAMify
  318. "Which metamodel do you want to RAMify?",
  319. "Where do you want to store the RAMified metamodel?",
  320. "Ready for command...",
  321. # transformation_add_MANUAL * 6
  322. ] + [
  323. "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  324. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  325. "Name of operation model?",
  326. "Ready for command...",
  327. ] * 6 + [
  328. # transformation_add_MT * 6
  329. ] + [
  330. "RAMified metamodel to use?",
  331. "Supported metamodels:",
  332. set([" PetriNet",
  333. " Encapsulated_PetriNet",
  334. " PW_Plant",
  335. " Architecture",
  336. " Query",
  337. " PW_Environment",
  338. " Requirements",
  339. " PW_Control",
  340. " ReachabilityGraph",
  341. ]),
  342. "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  343. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  344. "Name of new operation?",
  345. "Waiting for model constructors...",
  346. "Ready for command...",
  347. ] * 6 + [
  348. # transformation_add_AL * 2
  349. ] + [ "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  350. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  351. "Name of operation model?",
  352. "Waiting for model constructors...",
  353. "Ready for command...", ] * 2 + [
  354. # model_list
  355. model_list |
  356. set([
  357. " PetriNet : SimpleClassDiagrams",
  358. " Encapsulated_PetriNet : SimpleClassDiagrams",
  359. " PW_Plant : SimpleClassDiagrams",
  360. " PW_Environment : SimpleClassDiagrams",
  361. " PW_Control : SimpleClassDiagrams",
  362. " Requirements : SimpleClassDiagrams",
  363. " Query : SimpleClassDiagrams",
  364. " reachability : ActionLanguage",
  365. " revise_req : ManualOperation",
  366. " revise_plant : ManualOperation",
  367. " revise_control : ManualOperation",
  368. " revise_environment : ManualOperation",
  369. " revise_query : ManualOperation",
  370. " revise_architecture : ManualOperation",
  371. " __merged_bfs : SimpleClassDiagrams",
  372. " __merged_reachability : SimpleClassDiagrams",
  373. " __merged_revise_req : SimpleClassDiagrams",
  374. " __merged_All_RAM : SimpleClassDiagrams",
  375. " __merged_revise_plant : SimpleClassDiagrams",
  376. " __merged_revise_control : SimpleClassDiagrams",
  377. " __merged_revise_environment : SimpleClassDiagrams",
  378. " __merged_revise_query : SimpleClassDiagrams",
  379. " __merged_revise_architecture : SimpleClassDiagrams",
  380. " match : All_RAM",
  381. " All_RAM : SimpleClassDiagrams",
  382. " make_initial_models : All_RAM",
  383. " pm_powerwindow : ProcessModel",
  384. " plant_to_EPN : All_RAM",
  385. " combine_EPN : All_RAM",
  386. " environment_to_EPN : All_RAM",
  387. " control_to_EPN : All_RAM",
  388. " ReachabilityGraph : SimpleClassDiagrams",
  389. " Architecture : SimpleClassDiagrams",
  390. " bfs : ActionLanguage",
  391. ]),
  392. "Ready for command...",
  393. # process_execute
  394. "Which process model do you want to execute?",
  395. "Model prefix to use?",
  396. # Manual transformation revise_req
  397. "Please perform manual operation \"revise_req\"",
  398. "Model loaded, ready for commands!",
  399. "Mode: r/w",
  400. "Use 'help' command for a list of possible commands",
  401. "Please give your command.",
  402. "Waiting for model constructors...",
  403. "Please give your command.",
  404. # Manual transformation revise_plant
  405. "Please perform manual operation \"revise_plant\"",
  406. "Model loaded, ready for commands!",
  407. "Mode: r/w",
  408. "Use 'help' command for a list of possible commands",
  409. "Please give your command.",
  410. "Waiting for model constructors...",
  411. "Please give your command.",
  412. # Manual transformation revise_environment
  413. "Please perform manual operation \"revise_environment\"",
  414. "Model loaded, ready for commands!",
  415. "Mode: r/w",
  416. "Use 'help' command for a list of possible commands",
  417. "Please give your command.",
  418. "Waiting for model constructors...",
  419. "Please give your command.",
  420. # Manual transformation revise_control
  421. "Please perform manual operation \"revise_control\"",
  422. "Model loaded, ready for commands!",
  423. "Mode: r/w",
  424. "Use 'help' command for a list of possible commands",
  425. "Please give your command.",
  426. "Waiting for model constructors...",
  427. "Please give your command.",
  428. # Manual transformation revise_query
  429. "Please perform manual operation \"revise_query\"",
  430. "Model loaded, ready for commands!",
  431. "Mode: r/w",
  432. "Use 'help' command for a list of possible commands",
  433. "Please give your command.",
  434. "Waiting for model constructors...",
  435. "Please give your command.",
  436. # Manual transformation revise_architecture
  437. "Please perform manual operation \"revise_architecture\"",
  438. "Model loaded, ready for commands!",
  439. "Mode: r/w",
  440. "Use 'help' command for a list of possible commands",
  441. "Please give your command.",
  442. "Waiting for model constructors...",
  443. "Please give your command.",
  444. # Computations happen without output
  445. # Finished, so we go back to the start
  446. "Ready for command...",
  447. ]))
  448. @slow
  449. def test_process_powerwindow_debug(self):
  450. self.assertTrue(run_file(all_files,
  451. [ "root", "root", "root",
  452. "model_add",
  453. "SimpleClassDiagrams",
  454. "ReachabilityGraph",
  455. ] + get_model_constructor_2("models/reachability_graph.mvc") + [
  456. "model_add",
  457. "SimpleClassDiagrams",
  458. "PetriNet",
  459. ] + get_model_constructor_2("integration/code/pn_design.mvc") + [
  460. "model_add",
  461. "SimpleClassDiagrams",
  462. "Encapsulated_PetriNet",
  463. ] + get_model_constructor_2("models/petrinet_ports.mvc") + [
  464. "model_add",
  465. "SimpleClassDiagrams",
  466. "PW_Plant",
  467. ] + get_model_constructor_2("models/plant_PW.mvc") + [
  468. "model_add",
  469. "SimpleClassDiagrams",
  470. "PW_Environment",
  471. ] + get_model_constructor_2("models/environment_PW.mvc") + [
  472. "model_add",
  473. "SimpleClassDiagrams",
  474. "PW_Control",
  475. ] + get_model_constructor_2("models/control_PW.mvc") + [
  476. "model_add",
  477. "SimpleClassDiagrams",
  478. "Requirements",
  479. ] + get_model_constructor_2("models/requirements.mvc") + [
  480. "model_add",
  481. "SimpleClassDiagrams",
  482. "Query",
  483. ] + get_model_constructor_2("models/query.mvc") + [
  484. "model_add",
  485. "ProcessModel",
  486. "pm_powerwindow",
  487. ] + get_model_constructor_2("models/pm_req_analyse_debug.mvc") + [
  488. "model_add",
  489. "SimpleClassDiagrams",
  490. "Architecture",
  491. ] + get_model_constructor_2("models/architecture.mvc") + [
  492. "model_list",
  493. "transformation_add_MT_language",
  494. "PetriNet",
  495. "Encapsulated_PetriNet",
  496. "PW_Plant",
  497. "PW_Control",
  498. "PW_Environment",
  499. "Requirements",
  500. "ReachabilityGraph",
  501. "Query",
  502. "Architecture",
  503. "",
  504. "All_RAM",
  505. "model_modify",
  506. "__merged_All_RAM",
  507. "instantiate",
  508. "Association",
  509. "CTRL2EPN_link",
  510. "PW_Control/State",
  511. "Encapsulated_PetriNet/Place",
  512. "instantiate",
  513. "Association",
  514. "CTRL2EPN_tlink",
  515. "PW_Control/Transition",
  516. "Encapsulated_PetriNet/Transition",
  517. "instantiate",
  518. "Association",
  519. "PLANT2EPN_link",
  520. "PW_Plant/State",
  521. "Encapsulated_PetriNet/Place",
  522. "instantiate",
  523. "Association",
  524. "PLANT2EPN_tlink",
  525. "PW_Plant/Transition",
  526. "Encapsulated_PetriNet/Transition",
  527. "instantiate",
  528. "Association",
  529. "ENV2EPN_link",
  530. "PW_Environment/Event",
  531. "Encapsulated_PetriNet/Place",
  532. "instantiate",
  533. "Association",
  534. "EPN2PN_place_link",
  535. "Encapsulated_PetriNet/Place",
  536. "PetriNet/Place",
  537. "instantiate",
  538. "Association",
  539. "EPN2PN_transition_link",
  540. "Encapsulated_PetriNet/Transition",
  541. "PetriNet/Transition",
  542. "exit",
  543. "transformation_RAMify",
  544. "__merged_All_RAM",
  545. "All_RAM",
  546. "transformation_add_MANUAL",
  547. "Requirements",
  548. "",
  549. "Requirements",
  550. "",
  551. "revise_req",
  552. "transformation_add_MANUAL",
  553. "Requirements",
  554. "PW_Environment",
  555. "",
  556. "PW_Environment",
  557. "",
  558. "revise_environment",
  559. "transformation_add_MANUAL",
  560. "Requirements",
  561. "PW_Plant",
  562. "",
  563. "PW_Plant",
  564. "",
  565. "revise_plant",
  566. "transformation_add_MANUAL",
  567. "Requirements",
  568. "PW_Control",
  569. "",
  570. "PW_Control",
  571. "",
  572. "revise_control",
  573. "transformation_add_MANUAL",
  574. "Requirements",
  575. "Query",
  576. "",
  577. "Query",
  578. "",
  579. "revise_query",
  580. "transformation_add_MANUAL",
  581. "Requirements",
  582. "Architecture",
  583. "",
  584. "Architecture",
  585. "",
  586. "revise_architecture",
  587. "transformation_add_MT",
  588. "All_RAM",
  589. "",
  590. "PW_Plant",
  591. "PW_Environment",
  592. "PW_Control",
  593. "Query",
  594. "Architecture",
  595. "Requirements",
  596. "",
  597. "make_initial_models",
  598. ] + get_model_constructor_2("models/initialize.mvc") + [
  599. "transformation_add_MT",
  600. "All_RAM",
  601. "PW_Plant",
  602. "",
  603. "Encapsulated_PetriNet",
  604. "",
  605. "plant_to_EPN",
  606. ] + get_model_constructor_2("models/plant_to_EPN.mvc") + [
  607. "transformation_add_MT",
  608. "All_RAM",
  609. "PW_Control",
  610. "",
  611. "Encapsulated_PetriNet",
  612. "",
  613. "control_to_EPN",
  614. ] + get_model_constructor_2("models/control_to_EPN.mvc") + [
  615. "transformation_add_MT",
  616. "All_RAM",
  617. "PW_Environment",
  618. "",
  619. "Encapsulated_PetriNet",
  620. "",
  621. "environment_to_EPN",
  622. ] + get_model_constructor_2("models/environment_to_EPN.mvc") + [
  623. "transformation_add_MT",
  624. "All_RAM",
  625. "Encapsulated_PetriNet",
  626. "Architecture",
  627. "",
  628. "Encapsulated_PetriNet",
  629. "",
  630. "combine_EPN",
  631. ] + get_model_constructor_2("models/combine_EPN.mvc") + [
  632. "transformation_add_MT",
  633. "All_RAM",
  634. "ReachabilityGraph",
  635. "Query",
  636. "",
  637. "",
  638. "match",
  639. ] + get_model_constructor_2("models/matches.mvc") + [
  640. "transformation_add_AL",
  641. "PetriNet",
  642. "",
  643. "ReachabilityGraph",
  644. "",
  645. "reachability",
  646. ] + get_constructor(open("models/reachability.alc", "r").read()) + [
  647. "transformation_add_AL",
  648. "PetriNet",
  649. "",
  650. "",
  651. "pn_print",
  652. ] + get_constructor(open("models/pn_print.alc", "r").read()) + [
  653. "transformation_add_AL",
  654. "Encapsulated_PetriNet",
  655. "",
  656. "",
  657. "epn_print",
  658. ] + get_constructor(open("models/epn_print.alc", "r").read()) + [
  659. "transformation_add_AL",
  660. "ReachabilityGraph",
  661. "",
  662. "",
  663. "bfs",
  664. ] + get_constructor(open("models/bfs.alc", "r").read()) + [
  665. "model_list",
  666. "process_execute",
  667. "pm_powerwindow",
  668. "pm_",
  669. # revise_req
  670. "upload",
  671. ] + get_model_constructor_2("models/requirements_model.mvc") + [
  672. "exit",
  673. #### First phase!
  674. # revise_plant
  675. "upload",
  676. ] + get_model_constructor_2("models/plant_model.mvc") + [
  677. "exit",
  678. # revise_environment
  679. "upload",
  680. ] + get_model_constructor_2("models/environment_model.mvc") + [
  681. "exit",
  682. # revise_control
  683. "upload",
  684. ] + get_model_constructor_2("models/control_model_wrong.mvc") + [
  685. "exit",
  686. # revise_query
  687. "upload",
  688. ] + get_model_constructor_2("models/query_model.mvc") + [
  689. "exit",
  690. # revise_architecture
  691. "upload",
  692. ] + get_model_constructor_2("models/architecture_model.mvc") + [
  693. "exit",
  694. #### Second phase!
  695. # revise_plant
  696. "upload",
  697. ] + get_model_constructor_2("models/plant_model.mvc") + [
  698. "exit",
  699. # revise_environment
  700. "upload",
  701. ] + get_model_constructor_2("models/environment_model.mvc") + [
  702. "exit",
  703. # revise_control
  704. "upload",
  705. ] + get_model_constructor_2("models/control_model.mvc") + [
  706. "exit",
  707. # revise_query
  708. "upload",
  709. ] + get_model_constructor_2("models/query_model.mvc") + [
  710. "exit",
  711. # revise_architecture
  712. "upload",
  713. ] + get_model_constructor_2("models/architecture_model.mvc") + [
  714. "exit",
  715. ],
  716. [ # bootup phase
  717. "Desired username for admin user?",
  718. "Desired password for admin user?",
  719. "Please repeat the password",
  720. "Passwords match!",
  721. "Welcome to the Model Management Interface v2.0!",
  722. "Use the 'help' command for a list of possible commands",
  723. "Ready for command...",
  724. # model_add * 10
  725. ] + [ "Creating new model!",
  726. "Model type?",
  727. "Model name?",
  728. "Waiting for model constructors...",
  729. "Model upload success!",
  730. "Ready for command...", ] * 10 + [
  731. # model_list
  732. model_list |
  733. set([
  734. " ReachabilityGraph : SimpleClassDiagrams",
  735. " PetriNet : SimpleClassDiagrams",
  736. " Encapsulated_PetriNet : SimpleClassDiagrams",
  737. " PW_Plant : SimpleClassDiagrams",
  738. " PW_Environment : SimpleClassDiagrams",
  739. " PW_Control : SimpleClassDiagrams",
  740. " Requirements : SimpleClassDiagrams",
  741. " Query : SimpleClassDiagrams",
  742. " pm_powerwindow : ProcessModel",
  743. " Architecture : SimpleClassDiagrams",
  744. ]),
  745. "Ready for command...",
  746. # transformation_add_MT_language
  747. "Formalisms to include (terminate with empty string)?",
  748. "Name of the RAMified transformation metamodel?",
  749. "Ready for command...",
  750. # model_modify
  751. "Which model do you want to modify?",
  752. "Model loaded, ready for commands!",
  753. "Mode: r/w",
  754. "Use 'help' command for a list of possible commands",
  755. "Please give your command.",
  756. # instantiate * 7
  757. ] + [ "Type to instantiate?",
  758. "Name of new element?",
  759. "Source name?",
  760. "Destination name?",
  761. "Instantiation successful!",
  762. None,
  763. "Please give your command.", ] * 7 + [
  764. "Ready for command...",
  765. # transformation_RAMify
  766. "Which metamodel do you want to RAMify?",
  767. "Where do you want to store the RAMified metamodel?",
  768. "Ready for command...",
  769. # transformation_add_MANUAL * 6
  770. ] + [
  771. "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  772. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  773. "Name of operation model?",
  774. "Ready for command...",
  775. ] * 6 + [
  776. # transformation_add_MT * 6
  777. ] + [
  778. "RAMified metamodel to use?",
  779. "Supported metamodels:",
  780. set([" PetriNet",
  781. " Encapsulated_PetriNet",
  782. " PW_Plant",
  783. " Architecture",
  784. " Query",
  785. " PW_Environment",
  786. " Requirements",
  787. " PW_Control",
  788. " ReachabilityGraph",
  789. ]),
  790. "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  791. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  792. "Name of new operation?",
  793. "Waiting for model constructors...",
  794. "Ready for command...",
  795. ] * 6 + [
  796. # transformation_add_AL * 4
  797. ] + [ "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  798. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  799. "Name of operation model?",
  800. "Waiting for model constructors...",
  801. "Ready for command...", ] * 4 + [
  802. # model_list
  803. model_list |
  804. set([
  805. " PetriNet : SimpleClassDiagrams",
  806. " Encapsulated_PetriNet : SimpleClassDiagrams",
  807. " PW_Plant : SimpleClassDiagrams",
  808. " PW_Environment : SimpleClassDiagrams",
  809. " PW_Control : SimpleClassDiagrams",
  810. " Requirements : SimpleClassDiagrams",
  811. " Query : SimpleClassDiagrams",
  812. " reachability : ActionLanguage",
  813. " revise_req : ManualOperation",
  814. " revise_plant : ManualOperation",
  815. " revise_control : ManualOperation",
  816. " revise_environment : ManualOperation",
  817. " revise_query : ManualOperation",
  818. " revise_architecture : ManualOperation",
  819. " __merged_reachability : SimpleClassDiagrams",
  820. " __merged_revise_req : SimpleClassDiagrams",
  821. " __merged_All_RAM : SimpleClassDiagrams",
  822. " __merged_revise_plant : SimpleClassDiagrams",
  823. " __merged_revise_control : SimpleClassDiagrams",
  824. " __merged_revise_environment : SimpleClassDiagrams",
  825. " __merged_revise_query : SimpleClassDiagrams",
  826. " __merged_revise_architecture : SimpleClassDiagrams",
  827. " __merged_pn_print : SimpleClassDiagrams",
  828. " __merged_epn_print : SimpleClassDiagrams",
  829. " __merged_bfs : SimpleClassDiagrams",
  830. " pn_print : ActionLanguage",
  831. " epn_print : ActionLanguage",
  832. " match : All_RAM",
  833. " All_RAM : SimpleClassDiagrams",
  834. " make_initial_models : All_RAM",
  835. " pm_powerwindow : ProcessModel",
  836. " plant_to_EPN : All_RAM",
  837. " combine_EPN : All_RAM",
  838. " environment_to_EPN : All_RAM",
  839. " control_to_EPN : All_RAM",
  840. " ReachabilityGraph : SimpleClassDiagrams",
  841. " Architecture : SimpleClassDiagrams",
  842. " bfs : ActionLanguage",
  843. ]),
  844. "Ready for command...",
  845. # process_execute
  846. "Which process model do you want to execute?",
  847. "Model prefix to use?",
  848. # Manual transformation revise_req
  849. "Please perform manual operation \"revise_req\"",
  850. "Model loaded, ready for commands!",
  851. "Mode: r/w",
  852. "Use 'help' command for a list of possible commands",
  853. "Please give your command.",
  854. "Waiting for model constructors...",
  855. "Please give your command.",
  856. # Manual transformation revise_plant
  857. "Please perform manual operation \"revise_plant\"",
  858. "Model loaded, ready for commands!",
  859. "Mode: r/w",
  860. "Use 'help' command for a list of possible commands",
  861. "Please give your command.",
  862. "Waiting for model constructors...",
  863. "Please give your command.",
  864. # Manual transformation revise_environment
  865. "Please perform manual operation \"revise_environment\"",
  866. "Model loaded, ready for commands!",
  867. "Mode: r/w",
  868. "Use 'help' command for a list of possible commands",
  869. "Please give your command.",
  870. "Waiting for model constructors...",
  871. "Please give your command.",
  872. # Manual transformation revise_control
  873. "Please perform manual operation \"revise_control\"",
  874. "Model loaded, ready for commands!",
  875. "Mode: r/w",
  876. "Use 'help' command for a list of possible commands",
  877. "Please give your command.",
  878. "Waiting for model constructors...",
  879. "Please give your command.",
  880. # Manual transformation revise_query
  881. "Please perform manual operation \"revise_query\"",
  882. "Model loaded, ready for commands!",
  883. "Mode: r/w",
  884. "Use 'help' command for a list of possible commands",
  885. "Please give your command.",
  886. "Waiting for model constructors...",
  887. "Please give your command.",
  888. # Manual transformation revise_architecture
  889. "Please perform manual operation \"revise_architecture\"",
  890. "Model loaded, ready for commands!",
  891. "Mode: r/w",
  892. "Use 'help' command for a list of possible commands",
  893. "Please give your command.",
  894. "Waiting for model constructors...",
  895. "Please give your command.",
  896. # Computations happen without output
  897. # Got an error!
  898. "Found error path:",
  899. None,
  900. # Manual transformation revise_plant
  901. "Please perform manual operation \"revise_plant\"",
  902. "Model loaded, ready for commands!",
  903. "Mode: r/w",
  904. "Use 'help' command for a list of possible commands",
  905. "Please give your command.",
  906. "Waiting for model constructors...",
  907. "Please give your command.",
  908. # Manual transformation revise_environment
  909. "Please perform manual operation \"revise_environment\"",
  910. "Model loaded, ready for commands!",
  911. "Mode: r/w",
  912. "Use 'help' command for a list of possible commands",
  913. "Please give your command.",
  914. "Waiting for model constructors...",
  915. "Please give your command.",
  916. # Manual transformation revise_control
  917. "Please perform manual operation \"revise_control\"",
  918. "Model loaded, ready for commands!",
  919. "Mode: r/w",
  920. "Use 'help' command for a list of possible commands",
  921. "Please give your command.",
  922. "Waiting for model constructors...",
  923. "Please give your command.",
  924. # Manual transformation revise_query
  925. "Please perform manual operation \"revise_query\"",
  926. "Model loaded, ready for commands!",
  927. "Mode: r/w",
  928. "Use 'help' command for a list of possible commands",
  929. "Please give your command.",
  930. "Waiting for model constructors...",
  931. "Please give your command.",
  932. # Manual transformation revise_architecture
  933. "Please perform manual operation \"revise_architecture\"",
  934. "Model loaded, ready for commands!",
  935. "Mode: r/w",
  936. "Use 'help' command for a list of possible commands",
  937. "Please give your command.",
  938. "Waiting for model constructors...",
  939. "Please give your command.",
  940. # Finished, so we go back to the start
  941. "Ready for command...",
  942. ]))
  943. @slow
  944. def test_process_powerwindow_slow(self):
  945. self.assertTrue(run_file(all_files,
  946. [ "root", "root", "root",
  947. "model_add",
  948. "SimpleClassDiagrams",
  949. "ReachabilityGraph",
  950. ] + get_model_constructor_2("models/reachability_graph.mvc") + [
  951. "model_add",
  952. "SimpleClassDiagrams",
  953. "PetriNet",
  954. ] + get_model_constructor_2("integration/code/pn_design.mvc") + [
  955. "model_add",
  956. "SimpleClassDiagrams",
  957. "Encapsulated_PetriNet",
  958. ] + get_model_constructor_2("models/petrinet_ports.mvc") + [
  959. "model_add",
  960. "SimpleClassDiagrams",
  961. "PW_Plant",
  962. ] + get_model_constructor_2("models/plant_PW.mvc") + [
  963. "model_add",
  964. "SimpleClassDiagrams",
  965. "PW_Environment",
  966. ] + get_model_constructor_2("models/environment_PW.mvc") + [
  967. "model_add",
  968. "SimpleClassDiagrams",
  969. "PW_Control",
  970. ] + get_model_constructor_2("models/control_PW.mvc") + [
  971. "model_add",
  972. "SimpleClassDiagrams",
  973. "Requirements",
  974. ] + get_model_constructor_2("models/requirements.mvc") + [
  975. "model_add",
  976. "SimpleClassDiagrams",
  977. "Query",
  978. ] + get_model_constructor_2("models/query.mvc") + [
  979. "model_add",
  980. "ProcessModel",
  981. "pm_powerwindow",
  982. ] + get_model_constructor_2("models/pm_req_analyse.mvc") + [
  983. "model_add",
  984. "SimpleClassDiagrams",
  985. "Architecture",
  986. ] + get_model_constructor_2("models/architecture.mvc") + [
  987. "model_list",
  988. "transformation_add_MT_language",
  989. "PetriNet",
  990. "Encapsulated_PetriNet",
  991. "PW_Plant",
  992. "PW_Control",
  993. "PW_Environment",
  994. "Requirements",
  995. "ReachabilityGraph",
  996. "Query",
  997. "Architecture",
  998. "",
  999. "All_RAM",
  1000. "model_modify",
  1001. "__merged_All_RAM",
  1002. "instantiate",
  1003. "Association",
  1004. "CTRL2EPN_link",
  1005. "PW_Control/State",
  1006. "Encapsulated_PetriNet/Place",
  1007. "instantiate",
  1008. "Association",
  1009. "CTRL2EPN_tlink",
  1010. "PW_Control/Transition",
  1011. "Encapsulated_PetriNet/Transition",
  1012. "instantiate",
  1013. "Association",
  1014. "PLANT2EPN_link",
  1015. "PW_Plant/State",
  1016. "Encapsulated_PetriNet/Place",
  1017. "instantiate",
  1018. "Association",
  1019. "PLANT2EPN_tlink",
  1020. "PW_Plant/Transition",
  1021. "Encapsulated_PetriNet/Transition",
  1022. "instantiate",
  1023. "Association",
  1024. "ENV2EPN_link",
  1025. "PW_Environment/Event",
  1026. "Encapsulated_PetriNet/Place",
  1027. "instantiate",
  1028. "Association",
  1029. "EPN2PN_place_link",
  1030. "Encapsulated_PetriNet/Place",
  1031. "PetriNet/Place",
  1032. "instantiate",
  1033. "Association",
  1034. "EPN2PN_transition_link",
  1035. "Encapsulated_PetriNet/Transition",
  1036. "PetriNet/Transition",
  1037. "exit",
  1038. "transformation_RAMify",
  1039. "__merged_All_RAM",
  1040. "All_RAM",
  1041. "transformation_add_MANUAL",
  1042. "Requirements",
  1043. "",
  1044. "Requirements",
  1045. "",
  1046. "revise_req",
  1047. "transformation_add_MANUAL",
  1048. "Requirements",
  1049. "PW_Environment",
  1050. "",
  1051. "PW_Environment",
  1052. "",
  1053. "revise_environment",
  1054. "transformation_add_MANUAL",
  1055. "Requirements",
  1056. "PW_Plant",
  1057. "",
  1058. "PW_Plant",
  1059. "",
  1060. "revise_plant",
  1061. "transformation_add_MANUAL",
  1062. "Requirements",
  1063. "PW_Control",
  1064. "",
  1065. "PW_Control",
  1066. "",
  1067. "revise_control",
  1068. "transformation_add_MANUAL",
  1069. "Requirements",
  1070. "Query",
  1071. "",
  1072. "Query",
  1073. "",
  1074. "revise_query",
  1075. "transformation_add_MANUAL",
  1076. "Requirements",
  1077. "Architecture",
  1078. "",
  1079. "Architecture",
  1080. "",
  1081. "revise_architecture",
  1082. "transformation_add_MT",
  1083. "All_RAM",
  1084. "",
  1085. "PW_Plant",
  1086. "PW_Environment",
  1087. "PW_Control",
  1088. "Query",
  1089. "Architecture",
  1090. "Requirements",
  1091. "",
  1092. "make_initial_models",
  1093. ] + get_model_constructor_2("models/initialize.mvc") + [
  1094. "transformation_add_MT",
  1095. "All_RAM",
  1096. "PW_Plant",
  1097. "",
  1098. "Encapsulated_PetriNet",
  1099. "",
  1100. "plant_to_EPN",
  1101. ] + get_model_constructor_2("models/plant_to_EPN.mvc") + [
  1102. "transformation_add_MT",
  1103. "All_RAM",
  1104. "PW_Control",
  1105. "",
  1106. "Encapsulated_PetriNet",
  1107. "",
  1108. "control_to_EPN",
  1109. ] + get_model_constructor_2("models/control_to_EPN.mvc") + [
  1110. "transformation_add_MT",
  1111. "All_RAM",
  1112. "PW_Environment",
  1113. "",
  1114. "Encapsulated_PetriNet",
  1115. "",
  1116. "environment_to_EPN",
  1117. ] + get_model_constructor_2("models/environment_to_EPN.mvc") + [
  1118. "transformation_add_MT",
  1119. "All_RAM",
  1120. "Encapsulated_PetriNet",
  1121. "Architecture",
  1122. "",
  1123. "Encapsulated_PetriNet",
  1124. "",
  1125. "combine_EPN",
  1126. ] + get_model_constructor_2("models/combine_EPN.mvc") + [
  1127. "transformation_add_MT",
  1128. "All_RAM",
  1129. "ReachabilityGraph",
  1130. "Query",
  1131. "",
  1132. "",
  1133. "match",
  1134. ] + get_model_constructor_2("models/matches.mvc") + [
  1135. "transformation_add_AL",
  1136. "PetriNet",
  1137. "",
  1138. "ReachabilityGraph",
  1139. "",
  1140. "reachability",
  1141. ] + get_constructor(open("models/reachability.alc", "r").read()) + [
  1142. "transformation_add_AL",
  1143. "ReachabilityGraph",
  1144. "",
  1145. "",
  1146. "bfs",
  1147. ] + get_constructor(open("models/bfs.alc", "r").read()) + [
  1148. "model_list",
  1149. "process_execute",
  1150. "pm_powerwindow",
  1151. "pm_",
  1152. # revise_req
  1153. "upload",
  1154. ] + get_model_constructor_2("models/requirements_model.mvc") + [
  1155. "exit",
  1156. #### First phase
  1157. # revise_plant
  1158. "upload",
  1159. ] + get_model_constructor_2("models/plant_model.mvc") + [
  1160. "exit",
  1161. # revise_environment
  1162. "upload",
  1163. ] + get_model_constructor_2("models/environment_model.mvc") + [
  1164. "exit",
  1165. # revise_control
  1166. "upload",
  1167. ] + get_model_constructor_2("models/control_model_wrong.mvc") + [
  1168. "exit",
  1169. # revise_query
  1170. "upload",
  1171. ] + get_model_constructor_2("models/query_model.mvc") + [
  1172. "exit",
  1173. # revise_architecture
  1174. "upload",
  1175. ] + get_model_constructor_2("models/architecture_model.mvc") + [
  1176. "exit",
  1177. #### Second phase
  1178. # revise_plant
  1179. "upload",
  1180. ] + get_model_constructor_2("models/plant_model.mvc") + [
  1181. "exit",
  1182. # revise_environment
  1183. "upload",
  1184. ] + get_model_constructor_2("models/environment_model.mvc") + [
  1185. "exit",
  1186. # revise_control
  1187. "upload",
  1188. ] + get_model_constructor_2("models/control_model.mvc") + [
  1189. "exit",
  1190. # revise_query
  1191. "upload",
  1192. ] + get_model_constructor_2("models/query_model.mvc") + [
  1193. "exit",
  1194. # revise_architecture
  1195. "upload",
  1196. ] + get_model_constructor_2("models/architecture_model.mvc") + [
  1197. "exit",
  1198. ],
  1199. [ # bootup phase
  1200. "Desired username for admin user?",
  1201. "Desired password for admin user?",
  1202. "Please repeat the password",
  1203. "Passwords match!",
  1204. "Welcome to the Model Management Interface v2.0!",
  1205. "Use the 'help' command for a list of possible commands",
  1206. "Ready for command...",
  1207. # model_add * 10
  1208. ] + [ "Creating new model!",
  1209. "Model type?",
  1210. "Model name?",
  1211. "Waiting for model constructors...",
  1212. "Model upload success!",
  1213. "Ready for command...", ] * 10 + [
  1214. # model_list
  1215. model_list |
  1216. set([
  1217. " ReachabilityGraph : SimpleClassDiagrams",
  1218. " PetriNet : SimpleClassDiagrams",
  1219. " Encapsulated_PetriNet : SimpleClassDiagrams",
  1220. " PW_Plant : SimpleClassDiagrams",
  1221. " PW_Environment : SimpleClassDiagrams",
  1222. " PW_Control : SimpleClassDiagrams",
  1223. " Requirements : SimpleClassDiagrams",
  1224. " Query : SimpleClassDiagrams",
  1225. " pm_powerwindow : ProcessModel",
  1226. " Architecture : SimpleClassDiagrams",
  1227. ]),
  1228. "Ready for command...",
  1229. # transformation_add_MT_language
  1230. "Formalisms to include (terminate with empty string)?",
  1231. "Name of the RAMified transformation metamodel?",
  1232. "Ready for command...",
  1233. # model_modify
  1234. "Which model do you want to modify?",
  1235. "Model loaded, ready for commands!",
  1236. "Mode: r/w",
  1237. "Use 'help' command for a list of possible commands",
  1238. "Please give your command.",
  1239. # instantiate * 7
  1240. ] + [ "Type to instantiate?",
  1241. "Name of new element?",
  1242. "Source name?",
  1243. "Destination name?",
  1244. "Instantiation successful!",
  1245. None,
  1246. "Please give your command.", ] * 7 + [
  1247. "Ready for command...",
  1248. # transformation_RAMify
  1249. "Which metamodel do you want to RAMify?",
  1250. "Where do you want to store the RAMified metamodel?",
  1251. "Ready for command...",
  1252. # transformation_add_MANUAL * 6
  1253. ] + [
  1254. "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  1255. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  1256. "Name of operation model?",
  1257. "Ready for command...",
  1258. ] * 6 + [
  1259. # transformation_add_MT * 6
  1260. ] + [
  1261. "RAMified metamodel to use?",
  1262. "Supported metamodels:",
  1263. set([" PetriNet",
  1264. " Encapsulated_PetriNet",
  1265. " PW_Plant",
  1266. " Architecture",
  1267. " Query",
  1268. " PW_Environment",
  1269. " Requirements",
  1270. " PW_Control",
  1271. " ReachabilityGraph",
  1272. ]),
  1273. "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  1274. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  1275. "Name of new operation?",
  1276. "Waiting for model constructors...",
  1277. "Ready for command...",
  1278. ] * 6 + [
  1279. # transformation_add_AL * 2
  1280. ] + [ "Which metamodels do you want to use as source for the operation (empty string to finish)?",
  1281. "Which metamodels do you want to use as target for the operation (empty string to finish)?",
  1282. "Name of operation model?",
  1283. "Waiting for model constructors...",
  1284. "Ready for command...", ] * 2 + [
  1285. # model_list
  1286. model_list |
  1287. set([
  1288. " PetriNet : SimpleClassDiagrams",
  1289. " Encapsulated_PetriNet : SimpleClassDiagrams",
  1290. " PW_Plant : SimpleClassDiagrams",
  1291. " PW_Environment : SimpleClassDiagrams",
  1292. " PW_Control : SimpleClassDiagrams",
  1293. " Requirements : SimpleClassDiagrams",
  1294. " Query : SimpleClassDiagrams",
  1295. " reachability : ActionLanguage",
  1296. " revise_req : ManualOperation",
  1297. " revise_plant : ManualOperation",
  1298. " revise_control : ManualOperation",
  1299. " revise_environment : ManualOperation",
  1300. " revise_query : ManualOperation",
  1301. " revise_architecture : ManualOperation",
  1302. " __merged_bfs : SimpleClassDiagrams",
  1303. " __merged_reachability : SimpleClassDiagrams",
  1304. " __merged_revise_req : SimpleClassDiagrams",
  1305. " __merged_All_RAM : SimpleClassDiagrams",
  1306. " __merged_revise_plant : SimpleClassDiagrams",
  1307. " __merged_revise_control : SimpleClassDiagrams",
  1308. " __merged_revise_environment : SimpleClassDiagrams",
  1309. " __merged_revise_query : SimpleClassDiagrams",
  1310. " __merged_revise_architecture : SimpleClassDiagrams",
  1311. " match : All_RAM",
  1312. " All_RAM : SimpleClassDiagrams",
  1313. " make_initial_models : All_RAM",
  1314. " pm_powerwindow : ProcessModel",
  1315. " plant_to_EPN : All_RAM",
  1316. " combine_EPN : All_RAM",
  1317. " environment_to_EPN : All_RAM",
  1318. " control_to_EPN : All_RAM",
  1319. " ReachabilityGraph : SimpleClassDiagrams",
  1320. " Architecture : SimpleClassDiagrams",
  1321. " bfs : ActionLanguage",
  1322. ]),
  1323. "Ready for command...",
  1324. # process_execute
  1325. "Which process model do you want to execute?",
  1326. "Model prefix to use?",
  1327. # Manual transformation revise_req
  1328. "Please perform manual operation \"revise_req\"",
  1329. "Model loaded, ready for commands!",
  1330. "Mode: r/w",
  1331. "Use 'help' command for a list of possible commands",
  1332. "Please give your command.",
  1333. "Waiting for model constructors...",
  1334. "Please give your command.",
  1335. # Manual transformation revise_plant
  1336. "Please perform manual operation \"revise_plant\"",
  1337. "Model loaded, ready for commands!",
  1338. "Mode: r/w",
  1339. "Use 'help' command for a list of possible commands",
  1340. "Please give your command.",
  1341. "Waiting for model constructors...",
  1342. "Please give your command.",
  1343. # Manual transformation revise_environment
  1344. "Please perform manual operation \"revise_environment\"",
  1345. "Model loaded, ready for commands!",
  1346. "Mode: r/w",
  1347. "Use 'help' command for a list of possible commands",
  1348. "Please give your command.",
  1349. "Waiting for model constructors...",
  1350. "Please give your command.",
  1351. # Manual transformation revise_control
  1352. "Please perform manual operation \"revise_control\"",
  1353. "Model loaded, ready for commands!",
  1354. "Mode: r/w",
  1355. "Use 'help' command for a list of possible commands",
  1356. "Please give your command.",
  1357. "Waiting for model constructors...",
  1358. "Please give your command.",
  1359. # Manual transformation revise_query
  1360. "Please perform manual operation \"revise_query\"",
  1361. "Model loaded, ready for commands!",
  1362. "Mode: r/w",
  1363. "Use 'help' command for a list of possible commands",
  1364. "Please give your command.",
  1365. "Waiting for model constructors...",
  1366. "Please give your command.",
  1367. # Manual transformation revise_architecture
  1368. "Please perform manual operation \"revise_architecture\"",
  1369. "Model loaded, ready for commands!",
  1370. "Mode: r/w",
  1371. "Use 'help' command for a list of possible commands",
  1372. "Please give your command.",
  1373. "Waiting for model constructors...",
  1374. "Please give your command.",
  1375. # Computations happen without output
  1376. #### ERROR detected: go back to the start to fix it
  1377. "Found error path:",
  1378. None,
  1379. # Manual transformation revise_plant
  1380. "Please perform manual operation \"revise_plant\"",
  1381. "Model loaded, ready for commands!",
  1382. "Mode: r/w",
  1383. "Use 'help' command for a list of possible commands",
  1384. "Please give your command.",
  1385. "Waiting for model constructors...",
  1386. "Please give your command.",
  1387. # Manual transformation revise_environment
  1388. "Please perform manual operation \"revise_environment\"",
  1389. "Model loaded, ready for commands!",
  1390. "Mode: r/w",
  1391. "Use 'help' command for a list of possible commands",
  1392. "Please give your command.",
  1393. "Waiting for model constructors...",
  1394. "Please give your command.",
  1395. # Manual transformation revise_control
  1396. "Please perform manual operation \"revise_control\"",
  1397. "Model loaded, ready for commands!",
  1398. "Mode: r/w",
  1399. "Use 'help' command for a list of possible commands",
  1400. "Please give your command.",
  1401. "Waiting for model constructors...",
  1402. "Please give your command.",
  1403. # Manual transformation revise_query
  1404. "Please perform manual operation \"revise_query\"",
  1405. "Model loaded, ready for commands!",
  1406. "Mode: r/w",
  1407. "Use 'help' command for a list of possible commands",
  1408. "Please give your command.",
  1409. "Waiting for model constructors...",
  1410. "Please give your command.",
  1411. # Manual transformation revise_architecture
  1412. "Please perform manual operation \"revise_architecture\"",
  1413. "Model loaded, ready for commands!",
  1414. "Mode: r/w",
  1415. "Use 'help' command for a list of possible commands",
  1416. "Please give your command.",
  1417. "Waiting for model constructors...",
  1418. "Please give your command.",
  1419. # Finished, so we go back to the start
  1420. "Ready for command...",
  1421. ]))