test_powerwindow.py 70 KB

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