test_powerwindow.py 70 KB

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