test_powerwindow.py 71 KB

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