test_powerwindow.py 79 KB

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