test_powerwindow.py 63 KB

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