test_powerwindow.py 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. import unittest
  2. from utils import *
  3. model_list = set([" SimpleClassDiagrams : SimpleClassDiagrams",
  4. " CoreFormalism : SimpleClassDiagrams",
  5. " ManualOperation : SimpleClassDiagrams",
  6. " ActionLanguage : SimpleClassDiagrams",
  7. " ProcessModel : SimpleClassDiagrams",
  8. " core : CoreFormalism"])
  9. model_full_list = set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  10. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  11. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  12. " 221 root admin ManualOperation : SimpleClassDiagrams",
  13. " 221 root admin ProcessModel : SimpleClassDiagrams",
  14. " 200 root admin core : CoreFormalism"])
  15. all_files = [ "core/mini_modify.alc",
  16. "core/core_formalism.mvc",
  17. "core/core_algorithm.alc",
  18. "core/pm.mvc",
  19. "primitives.alc",
  20. "object_operations.alc",
  21. "conformance_scd.alc",
  22. "library.alc",
  23. "transform.alc",
  24. "model_management.alc",
  25. "ramify.alc",
  26. "metamodels.alc",
  27. "random.alc",
  28. "constructors.alc",
  29. "modelling.alc",
  30. "compilation_manager.alc",
  31. ]
  32. class TestPowerWindow(unittest.TestCase):
  33. def test_process_powerwindow_fast(self):
  34. self.assertTrue(run_file(all_files,
  35. [ "root", "root", "root",
  36. "model_add",
  37. "SimpleClassDiagrams",
  38. "ReachabilityGraph",
  39. ] + get_model_constructor_2("integration/code/reachability_graph.mvc") + [
  40. "model_add",
  41. "SimpleClassDiagrams",
  42. "PetriNet",
  43. ] + get_model_constructor_2("integration/code/pn_design.mvc") + [
  44. "model_add",
  45. "SimpleClassDiagrams",
  46. "Encapsulated_PetriNet",
  47. ] + get_model_constructor_2("models/petrinet_ports.mvc") + [
  48. "model_add",
  49. "SimpleClassDiagrams",
  50. "PW_Plant",
  51. ] + get_model_constructor_2("models/plant_PW.mvc") + [
  52. "model_add",
  53. "SimpleClassDiagrams",
  54. "PW_Environment",
  55. ] + get_model_constructor_2("models/environment_PW.mvc") + [
  56. "model_add",
  57. "SimpleClassDiagrams",
  58. "PW_Control",
  59. ] + get_model_constructor_2("models/control_PW.mvc") + [
  60. "model_add",
  61. "SimpleClassDiagrams",
  62. "Requirements",
  63. ] + get_model_constructor_2("models/requirements.mvc") + [
  64. "model_add",
  65. "SimpleClassDiagrams",
  66. "Query",
  67. ] + get_model_constructor_2("models/query.mvc") + [
  68. "model_add",
  69. "ProcessModel",
  70. "pm_powerwindow",
  71. ] + get_model_constructor_2("models/pm_req_analyse.mvc") + [
  72. "model_list",
  73. "transformation_add_MT_language",
  74. "PetriNet",
  75. "Encapsulated_PetriNet",
  76. "PW_Plant",
  77. "PW_Control",
  78. "PW_Environment",
  79. "Requirements",
  80. "ReachabilityGraph",
  81. "Query",
  82. "",
  83. "All_RAM",
  84. "model_modify",
  85. "__merged_All_RAM",
  86. "instantiate",
  87. "Association",
  88. "CTRL2EPN_link",
  89. "PW_Control/State",
  90. "Encapsulated_PetriNet/Place",
  91. "instantiate",
  92. "Association",
  93. "CTRL2EPN_tlink",
  94. "PW_Control/Transition",
  95. "Encapsulated_PetriNet/Transition",
  96. "instantiate",
  97. "Association",
  98. "PLANT2EPN_link",
  99. "PW_Plant/State",
  100. "Encapsulated_PetriNet/Place",
  101. "instantiate",
  102. "Association",
  103. "PLANT2EPN_tlink",
  104. "PW_Plant/Transition",
  105. "Encapsulated_PetriNet/Transition",
  106. "instantiate",
  107. "Association",
  108. "ENV2EPN_link",
  109. "PW_Environment/Event",
  110. "Encapsulated_PetriNet/Place",
  111. "instantiate",
  112. "Association",
  113. "EPN2PN_place_link",
  114. "Encapsulated_PetriNet/Place",
  115. "PetriNet/Place",
  116. "instantiate",
  117. "Association",
  118. "EPN2PN_transition_link",
  119. "Encapsulated_PetriNet/Transition",
  120. "PetriNet/Transition",
  121. "exit",
  122. "transformation_RAMify",
  123. "__merged_All_RAM",
  124. "All_RAM",
  125. "transformation_add_MANUAL",
  126. "",
  127. "Requirements",
  128. "",
  129. "define_req",
  130. "transformation_add_MANUAL",
  131. "Requirements",
  132. "PW_Environment",
  133. "",
  134. "PW_Environment",
  135. "",
  136. "refine_environment",
  137. "transformation_add_MANUAL",
  138. "Requirements",
  139. "PW_Plant",
  140. "",
  141. "PW_Plant",
  142. "",
  143. "refine_plant",
  144. "transformation_add_MANUAL",
  145. "Requirements",
  146. "PW_Control",
  147. "",
  148. "PW_Control",
  149. "",
  150. "refine_control",
  151. "transformation_add_MANUAL",
  152. "Requirements",
  153. "Query",
  154. "",
  155. "Query",
  156. "",
  157. "refine_query",
  158. "transformation_add_MT",
  159. "All_RAM",
  160. "",
  161. "PW_Plant",
  162. "PW_Environment",
  163. "PW_Control",
  164. "Query",
  165. "",
  166. "make_initial_models",
  167. ] + get_model_constructor_2("models/initialize.mvc") + [
  168. "transformation_add_MT",
  169. "All_RAM",
  170. "PW_Plant",
  171. "",
  172. "Encapsulated_PetriNet",
  173. "",
  174. "plant_to_EPN",
  175. ] + get_model_constructor_2("models/plant_to_EPN.mvc") + [
  176. "transformation_add_MT",
  177. "All_RAM",
  178. "PW_Control",
  179. "",
  180. "Encapsulated_PetriNet",
  181. "",
  182. "control_to_EPN",
  183. ] + get_model_constructor_2("models/control_to_EPN.mvc") + [
  184. "transformation_add_MT",
  185. "All_RAM",
  186. "PW_Environment",
  187. "",
  188. "Encapsulated_PetriNet",
  189. "",
  190. "environment_to_EPN",
  191. ] + get_model_constructor_2("models/environment_to_EPN.mvc") + [
  192. "transformation_add_MT",
  193. "All_RAM",
  194. "Encapsulated_PetriNet",
  195. "",
  196. "Encapsulated_PetriNet",
  197. "",
  198. "combine_EPN",
  199. ] + get_model_constructor_2("models/combine_EPN.mvc") + [
  200. "transformation_add_AL",
  201. "PetriNet",
  202. "",
  203. "ReachabilityGraph",
  204. "",
  205. "reachability",
  206. ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
  207. "transformation_add_MT",
  208. "All_RAM",
  209. "ReachabilityGraph",
  210. "Query",
  211. "",
  212. "",
  213. "matches",
  214. ] + get_model_constructor_2("models/matches.mvc") + [
  215. "model_list",
  216. "process_execute",
  217. "pm_powerwindow",
  218. "pm_",
  219. # define_req
  220. "upload",
  221. ] + get_model_constructor_2("models/requirements_model.mvc") + [
  222. "exit",
  223. # refine_plant
  224. "upload",
  225. ] + get_model_constructor_2("models/plant_model.mvc") + [
  226. "exit",
  227. # refine_environment
  228. "upload",
  229. ] + get_model_constructor_2("models/environment_model.mvc") + [
  230. "exit",
  231. # refine_control
  232. "upload",
  233. ] + get_model_constructor_2("models/control_model.mvc") + [
  234. "exit",
  235. # refine_query
  236. "upload",
  237. ] + get_model_constructor_2("models/query_model.mvc") + [
  238. "exit",
  239. ],
  240. [ # bootup phase
  241. "Desired username for admin user?",
  242. "Desired password for admin user?",
  243. "Please repeat the password",
  244. "Passwords match!",
  245. "Welcome to the Model Management Interface v2.0!",
  246. "Use the 'help' command for a list of possible commands",
  247. "Ready for command...",
  248. # model_add * 9
  249. ] + [ "Creating new model!",
  250. "Model type?",
  251. "Model name?",
  252. "Waiting for model constructors...",
  253. "Model upload success!",
  254. "Ready for command...", ] * 9 + [
  255. # model_list
  256. model_list |
  257. set([
  258. " ReachabilityGraph : SimpleClassDiagrams",
  259. " PetriNet : SimpleClassDiagrams",
  260. " Encapsulated_PetriNet : SimpleClassDiagrams",
  261. " PW_Plant : SimpleClassDiagrams",
  262. " PW_Environment : SimpleClassDiagrams",
  263. " PW_Control : SimpleClassDiagrams",
  264. " Requirements : SimpleClassDiagrams",
  265. " Query : SimpleClassDiagrams",
  266. " pm_powerwindow : ProcessModel",
  267. ]),
  268. "Ready for command...",
  269. # transformation_add_MT_language
  270. "Formalisms to include (terminate with empty string)?",
  271. "Name of the RAMified transformation metamodel?",
  272. "Ready for command...",
  273. # model_modify
  274. "Which model do you want to modify?",
  275. "Model loaded, ready for commands!",
  276. "Use 'help' command for a list of possible commands",
  277. "Please give your command.",
  278. # instantiate * 7
  279. ] + [ "Type to instantiate?",
  280. "Name of new element?",
  281. "Source name?",
  282. "Destination name?",
  283. "Instantiation successful!",
  284. "Please give your command.", ] * 7 + [
  285. "Ready for command...",
  286. # transformation_RAMify
  287. "Which metamodel do you want to RAMify?",
  288. "Where do you want to store the RAMified metamodel?",
  289. "Ready for command...",
  290. # transformation_add_MANUAL
  291. ] + [
  292. "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
  293. "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
  294. "Model added as target",
  295. "Name of Manual operation model?",
  296. "Ready for command...",
  297. ] + [
  298. # transformation_add_MANUAL * 4
  299. ] + [
  300. "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
  301. "Model added as source",
  302. "Model added as source",
  303. "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
  304. "Model added as target",
  305. "Name of Manual operation model?",
  306. "Ready for command...",
  307. ] * 4 + [
  308. # transformation_add_MT
  309. "RAMified metamodel to use?",
  310. "Supported metamodels:",
  311. set([" PetriNet",
  312. " Encapsulated_PetriNet",
  313. " PW_Plant",
  314. " Query",
  315. " PW_Environment",
  316. " Requirements",
  317. " PW_Control",
  318. " ReachabilityGraph",
  319. ]),
  320. "",
  321. "Which ones do you want to use as source (empty string to finish)?",
  322. "Which ones do you want to use as target (empty string to finish)?",
  323. "Model added as target",
  324. "Model added as target",
  325. "Model added as target",
  326. "Model added as target",
  327. "Name of new transformation?",
  328. "Waiting for model constructors...",
  329. "Ready for command...",
  330. # transformation_add_MT
  331. "RAMified metamodel to use?",
  332. "Supported metamodels:",
  333. set([" PetriNet",
  334. " Encapsulated_PetriNet",
  335. " Query",
  336. " PW_Plant",
  337. " PW_Environment",
  338. " Requirements",
  339. " PW_Control",
  340. " ReachabilityGraph",
  341. ]),
  342. "",
  343. "Which ones do you want to use as source (empty string to finish)?",
  344. "Model added as source",
  345. "Which ones do you want to use as target (empty string to finish)?",
  346. "Model added as target",
  347. "Name of new transformation?",
  348. "Waiting for model constructors...",
  349. "Ready for command...",
  350. # transformation_add_MT
  351. "RAMified metamodel to use?",
  352. "Supported metamodels:",
  353. set([" PetriNet",
  354. " Encapsulated_PetriNet",
  355. " Query",
  356. " PW_Plant",
  357. " PW_Environment",
  358. " Requirements",
  359. " PW_Control",
  360. " ReachabilityGraph",
  361. ]),
  362. "",
  363. "Which ones do you want to use as source (empty string to finish)?",
  364. "Model added as source",
  365. "Which ones do you want to use as target (empty string to finish)?",
  366. "Model added as target",
  367. "Name of new transformation?",
  368. "Waiting for model constructors...",
  369. "Ready for command...",
  370. # transformation_add_MT
  371. "RAMified metamodel to use?",
  372. "Supported metamodels:",
  373. set([" PetriNet",
  374. " Encapsulated_PetriNet",
  375. " Query",
  376. " PW_Plant",
  377. " PW_Environment",
  378. " Requirements",
  379. " PW_Control",
  380. " ReachabilityGraph",
  381. ]),
  382. "",
  383. "Which ones do you want to use as source (empty string to finish)?",
  384. "Model added as source",
  385. "Which ones do you want to use as target (empty string to finish)?",
  386. "Model added as target",
  387. "Name of new transformation?",
  388. "Waiting for model constructors...",
  389. "Ready for command...",
  390. # transformation_add_MT
  391. "RAMified metamodel to use?",
  392. "Supported metamodels:",
  393. set([" PetriNet",
  394. " Encapsulated_PetriNet",
  395. " Query",
  396. " PW_Plant",
  397. " PW_Environment",
  398. " Requirements",
  399. " PW_Control",
  400. " ReachabilityGraph",
  401. ]),
  402. "",
  403. "Which ones do you want to use as source (empty string to finish)?",
  404. "Model added as source",
  405. "Which ones do you want to use as target (empty string to finish)?",
  406. "Model added as target",
  407. "Name of new transformation?",
  408. "Waiting for model constructors...",
  409. "Ready for command...",
  410. # transformation_add_AL
  411. ] + [ "Which metamodels do you want to use as source for the action code (empty string to finish)?",
  412. "Model added as source",
  413. "Which metamodels do you want to use as target for the action code (empty string to finish)?",
  414. "Model added as target",
  415. "Name of Action Language model?",
  416. "Waiting for model constructors...",
  417. "Ready for command...", ] * 1 + [
  418. # transformation_add_MT
  419. "RAMified metamodel to use?",
  420. "Supported metamodels:",
  421. set([" PetriNet",
  422. " Encapsulated_PetriNet",
  423. " Query",
  424. " PW_Plant",
  425. " PW_Environment",
  426. " Requirements",
  427. " PW_Control",
  428. " ReachabilityGraph",
  429. ]),
  430. "",
  431. "Which ones do you want to use as source (empty string to finish)?",
  432. "Model added as source",
  433. "Model added as source",
  434. "Which ones do you want to use as target (empty string to finish)?",
  435. "Name of new transformation?",
  436. "Waiting for model constructors...",
  437. "Ready for command...",
  438. # model_list
  439. model_list |
  440. set([
  441. " PetriNet : SimpleClassDiagrams",
  442. " Encapsulated_PetriNet : SimpleClassDiagrams",
  443. " PW_Plant : SimpleClassDiagrams",
  444. " PW_Environment : SimpleClassDiagrams",
  445. " PW_Control : SimpleClassDiagrams",
  446. " Requirements : SimpleClassDiagrams",
  447. " Query : SimpleClassDiagrams",
  448. " reachability : ActionLanguage",
  449. " define_req : ManualOperation",
  450. " refine_plant : ManualOperation",
  451. " refine_control : ManualOperation",
  452. " refine_environment : ManualOperation",
  453. " refine_query : ManualOperation",
  454. " __merged_define_req : SimpleClassDiagrams",
  455. " __merged_All_RAM : SimpleClassDiagrams",
  456. " __merged_refine_plant : SimpleClassDiagrams",
  457. " __merged_refine_control : SimpleClassDiagrams",
  458. " __merged_refine_environment : SimpleClassDiagrams",
  459. " __merged_refine_query : SimpleClassDiagrams",
  460. " matches : All_RAM",
  461. " All_RAM : SimpleClassDiagrams",
  462. " make_initial_models : All_RAM",
  463. " pm_powerwindow : ProcessModel",
  464. " plant_to_EPN : All_RAM",
  465. " combine_EPN : All_RAM",
  466. " environment_to_EPN : All_RAM",
  467. " control_to_EPN : All_RAM",
  468. " ReachabilityGraph : SimpleClassDiagrams",
  469. ]),
  470. "Ready for command...",
  471. # process_execute
  472. "Which process model do you want to execute?",
  473. "Model prefix to use?",
  474. # Manual transformation define_req
  475. "Please perform manual transformation \"define_req\"",
  476. "Model loaded, ready for commands!",
  477. "Use 'help' command for a list of possible commands",
  478. "Please give your command.",
  479. "Waiting for model constructors...",
  480. "Please give your command.",
  481. # Manual transformation refine_plant
  482. "Please perform manual transformation \"refine_plant\"",
  483. "Model loaded, ready for commands!",
  484. "Use 'help' command for a list of possible commands",
  485. "Please give your command.",
  486. "Waiting for model constructors...",
  487. "Please give your command.",
  488. # Manual transformation refine_environment
  489. "Please perform manual transformation \"refine_environment\"",
  490. "Model loaded, ready for commands!",
  491. "Use 'help' command for a list of possible commands",
  492. "Please give your command.",
  493. "Waiting for model constructors...",
  494. "Please give your command.",
  495. # Manual transformation refine_control
  496. "Please perform manual transformation \"refine_control\"",
  497. "Model loaded, ready for commands!",
  498. "Use 'help' command for a list of possible commands",
  499. "Please give your command.",
  500. "Waiting for model constructors...",
  501. "Please give your command.",
  502. # Manual transformation refine_query
  503. "Please perform manual transformation \"refine_query\"",
  504. "Model loaded, ready for commands!",
  505. "Use 'help' command for a list of possible commands",
  506. "Please give your command.",
  507. "Waiting for model constructors...",
  508. "Please give your command.",
  509. # Computations happen without output
  510. # Finished, so we go back to the start
  511. "Ready for command...",
  512. ]))
  513. def test_process_powerwindow_debug(self):
  514. self.assertTrue(run_file(all_files,
  515. [ "root", "root", "root",
  516. "model_add",
  517. "SimpleClassDiagrams",
  518. "ReachabilityGraph",
  519. ] + get_model_constructor_2("integration/code/reachability_graph.mvc") + [
  520. "model_add",
  521. "SimpleClassDiagrams",
  522. "PetriNet",
  523. ] + get_model_constructor_2("integration/code/pn_design.mvc") + [
  524. "model_add",
  525. "SimpleClassDiagrams",
  526. "Encapsulated_PetriNet",
  527. ] + get_model_constructor_2("models/petrinet_ports.mvc") + [
  528. "model_add",
  529. "SimpleClassDiagrams",
  530. "PW_Plant",
  531. ] + get_model_constructor_2("models/plant_PW.mvc") + [
  532. "model_add",
  533. "SimpleClassDiagrams",
  534. "PW_Environment",
  535. ] + get_model_constructor_2("models/environment_PW.mvc") + [
  536. "model_add",
  537. "SimpleClassDiagrams",
  538. "PW_Control",
  539. ] + get_model_constructor_2("models/control_PW.mvc") + [
  540. "model_add",
  541. "SimpleClassDiagrams",
  542. "Requirements",
  543. ] + get_model_constructor_2("models/requirements.mvc") + [
  544. "model_add",
  545. "SimpleClassDiagrams",
  546. "Query",
  547. ] + get_model_constructor_2("models/query.mvc") + [
  548. "model_add",
  549. "ProcessModel",
  550. "pm_powerwindow",
  551. ] + get_model_constructor_2("models/pm_req_analyse_debug.mvc") + [
  552. "model_list",
  553. "transformation_add_MT_language",
  554. "PetriNet",
  555. "Encapsulated_PetriNet",
  556. "PW_Plant",
  557. "PW_Control",
  558. "PW_Environment",
  559. "Requirements",
  560. "ReachabilityGraph",
  561. "Query",
  562. "",
  563. "All_RAM",
  564. "model_modify",
  565. "__merged_All_RAM",
  566. "instantiate",
  567. "Association",
  568. "CTRL2EPN_link",
  569. "PW_Control/State",
  570. "Encapsulated_PetriNet/Place",
  571. "instantiate",
  572. "Association",
  573. "CTRL2EPN_tlink",
  574. "PW_Control/Transition",
  575. "Encapsulated_PetriNet/Transition",
  576. "instantiate",
  577. "Association",
  578. "PLANT2EPN_link",
  579. "PW_Plant/State",
  580. "Encapsulated_PetriNet/Place",
  581. "instantiate",
  582. "Association",
  583. "PLANT2EPN_tlink",
  584. "PW_Plant/Transition",
  585. "Encapsulated_PetriNet/Transition",
  586. "instantiate",
  587. "Association",
  588. "ENV2EPN_link",
  589. "PW_Environment/Event",
  590. "Encapsulated_PetriNet/Place",
  591. "instantiate",
  592. "Association",
  593. "EPN2PN_place_link",
  594. "Encapsulated_PetriNet/Place",
  595. "PetriNet/Place",
  596. "instantiate",
  597. "Association",
  598. "EPN2PN_transition_link",
  599. "Encapsulated_PetriNet/Transition",
  600. "PetriNet/Transition",
  601. "exit",
  602. "transformation_RAMify",
  603. "__merged_All_RAM",
  604. "All_RAM",
  605. "transformation_add_MANUAL",
  606. "",
  607. "Requirements",
  608. "",
  609. "define_req",
  610. "transformation_add_MANUAL",
  611. "Requirements",
  612. "PW_Environment",
  613. "",
  614. "PW_Environment",
  615. "",
  616. "refine_environment",
  617. "transformation_add_MANUAL",
  618. "Requirements",
  619. "PW_Plant",
  620. "",
  621. "PW_Plant",
  622. "",
  623. "refine_plant",
  624. "transformation_add_MANUAL",
  625. "Requirements",
  626. "PW_Control",
  627. "",
  628. "PW_Control",
  629. "",
  630. "refine_control",
  631. "transformation_add_MANUAL",
  632. "Requirements",
  633. "Query",
  634. "",
  635. "Query",
  636. "",
  637. "refine_query",
  638. "transformation_add_MT",
  639. "All_RAM",
  640. "",
  641. "PW_Plant",
  642. "PW_Environment",
  643. "PW_Control",
  644. "Query",
  645. "",
  646. "make_initial_models",
  647. ] + get_model_constructor_2("models/initialize.mvc") + [
  648. "transformation_add_MT",
  649. "All_RAM",
  650. "PW_Plant",
  651. "",
  652. "Encapsulated_PetriNet",
  653. "",
  654. "plant_to_EPN",
  655. ] + get_model_constructor_2("models/plant_to_EPN.mvc") + [
  656. "transformation_add_MT",
  657. "All_RAM",
  658. "PW_Control",
  659. "",
  660. "Encapsulated_PetriNet",
  661. "",
  662. "control_to_EPN",
  663. ] + get_model_constructor_2("models/control_to_EPN.mvc") + [
  664. "transformation_add_MT",
  665. "All_RAM",
  666. "PW_Environment",
  667. "",
  668. "Encapsulated_PetriNet",
  669. "",
  670. "environment_to_EPN",
  671. ] + get_model_constructor_2("models/environment_to_EPN.mvc") + [
  672. "transformation_add_MT",
  673. "All_RAM",
  674. "Encapsulated_PetriNet",
  675. "",
  676. "Encapsulated_PetriNet",
  677. "",
  678. "combine_EPN",
  679. ] + get_model_constructor_2("models/combine_EPN.mvc") + [
  680. "transformation_add_MT",
  681. "All_RAM",
  682. "ReachabilityGraph",
  683. "",
  684. "",
  685. "print_reachability",
  686. ] + get_model_constructor_2("integration/code/reachabilitygraph_print.mvc") + [
  687. "transformation_add_AL",
  688. "PetriNet",
  689. "",
  690. "ReachabilityGraph",
  691. "",
  692. "reachability",
  693. ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
  694. "transformation_add_MT",
  695. "All_RAM",
  696. "ReachabilityGraph",
  697. "Query",
  698. "",
  699. "",
  700. "matches",
  701. ] + get_model_constructor_2("models/matches.mvc") + [
  702. "transformation_add_AL",
  703. "PetriNet",
  704. "",
  705. "PetriNet",
  706. "",
  707. "pn_print",
  708. ] + get_constructor(open("models/pn_print.alc", "r").read()) + [
  709. "transformation_add_AL",
  710. "Encapsulated_PetriNet",
  711. "",
  712. "Encapsulated_PetriNet",
  713. "",
  714. "epn_print",
  715. ] + get_constructor(open("models/epn_print.alc", "r").read()) + [
  716. "model_list",
  717. "process_execute",
  718. "pm_powerwindow",
  719. "pm_",
  720. # define_req
  721. "upload",
  722. ] + get_model_constructor_2("models/requirements_model.mvc") + [
  723. "exit",
  724. # refine_plant
  725. "upload",
  726. ] + get_model_constructor_2("models/plant_model.mvc") + [
  727. "exit",
  728. # refine_environment
  729. "upload",
  730. ] + get_model_constructor_2("models/environment_model.mvc") + [
  731. "exit",
  732. # refine_control
  733. "upload",
  734. ] + get_model_constructor_2("models/control_model.mvc") + [
  735. "exit",
  736. # refine_query
  737. "upload",
  738. ] + get_model_constructor_2("models/query_model.mvc") + [
  739. "exit",
  740. ],
  741. [ # bootup phase
  742. "Desired username for admin user?",
  743. "Desired password for admin user?",
  744. "Please repeat the password",
  745. "Passwords match!",
  746. "Welcome to the Model Management Interface v2.0!",
  747. "Use the 'help' command for a list of possible commands",
  748. "Ready for command...",
  749. # model_add * 9
  750. ] + [ "Creating new model!",
  751. "Model type?",
  752. "Model name?",
  753. "Waiting for model constructors...",
  754. "Model upload success!",
  755. "Ready for command...", ] * 9 + [
  756. # model_list
  757. model_list |
  758. set([
  759. " ReachabilityGraph : SimpleClassDiagrams",
  760. " PetriNet : SimpleClassDiagrams",
  761. " Encapsulated_PetriNet : SimpleClassDiagrams",
  762. " PW_Plant : SimpleClassDiagrams",
  763. " PW_Environment : SimpleClassDiagrams",
  764. " PW_Control : SimpleClassDiagrams",
  765. " Requirements : SimpleClassDiagrams",
  766. " Query : SimpleClassDiagrams",
  767. " pm_powerwindow : ProcessModel",
  768. ]),
  769. "Ready for command...",
  770. # transformation_add_MT_language
  771. "Formalisms to include (terminate with empty string)?",
  772. "Name of the RAMified transformation metamodel?",
  773. "Ready for command...",
  774. # model_modify
  775. "Which model do you want to modify?",
  776. "Model loaded, ready for commands!",
  777. "Use 'help' command for a list of possible commands",
  778. "Please give your command.",
  779. # instantiate * 7
  780. ] + [ "Type to instantiate?",
  781. "Name of new element?",
  782. "Source name?",
  783. "Destination name?",
  784. "Instantiation successful!",
  785. "Please give your command.", ] * 7 + [
  786. "Ready for command...",
  787. # transformation_RAMify
  788. "Which metamodel do you want to RAMify?",
  789. "Where do you want to store the RAMified metamodel?",
  790. "Ready for command...",
  791. # transformation_add_MANUAL
  792. ] + [
  793. "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
  794. "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
  795. "Model added as target",
  796. "Name of Manual operation model?",
  797. "Ready for command...",
  798. ] + [
  799. # transformation_add_MANUAL * 4
  800. ] + [
  801. "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
  802. "Model added as source",
  803. "Model added as source",
  804. "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
  805. "Model added as target",
  806. "Name of Manual operation model?",
  807. "Ready for command...",
  808. ] * 4 + [
  809. # transformation_add_MT
  810. "RAMified metamodel to use?",
  811. "Supported metamodels:",
  812. set([" PetriNet",
  813. " Encapsulated_PetriNet",
  814. " PW_Plant",
  815. " Query",
  816. " PW_Environment",
  817. " Requirements",
  818. " PW_Control",
  819. " ReachabilityGraph",
  820. ]),
  821. "",
  822. "Which ones do you want to use as source (empty string to finish)?",
  823. "Which ones do you want to use as target (empty string to finish)?",
  824. "Model added as target",
  825. "Model added as target",
  826. "Model added as target",
  827. "Model added as target",
  828. "Name of new transformation?",
  829. "Waiting for model constructors...",
  830. "Ready for command...",
  831. # transformation_add_MT
  832. "RAMified metamodel to use?",
  833. "Supported metamodels:",
  834. set([" PetriNet",
  835. " Encapsulated_PetriNet",
  836. " Query",
  837. " PW_Plant",
  838. " PW_Environment",
  839. " Requirements",
  840. " PW_Control",
  841. " ReachabilityGraph",
  842. ]),
  843. "",
  844. "Which ones do you want to use as source (empty string to finish)?",
  845. "Model added as source",
  846. "Which ones do you want to use as target (empty string to finish)?",
  847. "Model added as target",
  848. "Name of new transformation?",
  849. "Waiting for model constructors...",
  850. "Ready for command...",
  851. # transformation_add_MT
  852. "RAMified metamodel to use?",
  853. "Supported metamodels:",
  854. set([" PetriNet",
  855. " Encapsulated_PetriNet",
  856. " Query",
  857. " PW_Plant",
  858. " PW_Environment",
  859. " Requirements",
  860. " PW_Control",
  861. " ReachabilityGraph",
  862. ]),
  863. "",
  864. "Which ones do you want to use as source (empty string to finish)?",
  865. "Model added as source",
  866. "Which ones do you want to use as target (empty string to finish)?",
  867. "Model added as target",
  868. "Name of new transformation?",
  869. "Waiting for model constructors...",
  870. "Ready for command...",
  871. # transformation_add_MT
  872. "RAMified metamodel to use?",
  873. "Supported metamodels:",
  874. set([" PetriNet",
  875. " Encapsulated_PetriNet",
  876. " Query",
  877. " PW_Plant",
  878. " PW_Environment",
  879. " Requirements",
  880. " PW_Control",
  881. " ReachabilityGraph",
  882. ]),
  883. "",
  884. "Which ones do you want to use as source (empty string to finish)?",
  885. "Model added as source",
  886. "Which ones do you want to use as target (empty string to finish)?",
  887. "Model added as target",
  888. "Name of new transformation?",
  889. "Waiting for model constructors...",
  890. "Ready for command...",
  891. # transformation_add_MT
  892. "RAMified metamodel to use?",
  893. "Supported metamodels:",
  894. set([" PetriNet",
  895. " Encapsulated_PetriNet",
  896. " Query",
  897. " PW_Plant",
  898. " PW_Environment",
  899. " Requirements",
  900. " PW_Control",
  901. " ReachabilityGraph",
  902. ]),
  903. "",
  904. "Which ones do you want to use as source (empty string to finish)?",
  905. "Model added as source",
  906. "Which ones do you want to use as target (empty string to finish)?",
  907. "Model added as target",
  908. "Name of new transformation?",
  909. "Waiting for model constructors...",
  910. "Ready for command...",
  911. # transformation_add_MT
  912. "RAMified metamodel to use?",
  913. "Supported metamodels:",
  914. set([" PetriNet",
  915. " Encapsulated_PetriNet",
  916. " Query",
  917. " PW_Plant",
  918. " PW_Environment",
  919. " Requirements",
  920. " PW_Control",
  921. " ReachabilityGraph",
  922. ]),
  923. "",
  924. "Which ones do you want to use as source (empty string to finish)?",
  925. "Model added as source",
  926. "Which ones do you want to use as target (empty string to finish)?",
  927. "Name of new transformation?",
  928. "Waiting for model constructors...",
  929. "Ready for command...",
  930. # transformation_add_AL
  931. ] + [ "Which metamodels do you want to use as source for the action code (empty string to finish)?",
  932. "Model added as source",
  933. "Which metamodels do you want to use as target for the action code (empty string to finish)?",
  934. "Model added as target",
  935. "Name of Action Language model?",
  936. "Waiting for model constructors...",
  937. "Ready for command...", ] * 1 + [
  938. # transformation_add_MT
  939. "RAMified metamodel to use?",
  940. "Supported metamodels:",
  941. set([" PetriNet",
  942. " Encapsulated_PetriNet",
  943. " Query",
  944. " PW_Plant",
  945. " PW_Environment",
  946. " Requirements",
  947. " PW_Control",
  948. " ReachabilityGraph",
  949. ]),
  950. "",
  951. "Which ones do you want to use as source (empty string to finish)?",
  952. "Model added as source",
  953. "Model added as source",
  954. "Which ones do you want to use as target (empty string to finish)?",
  955. "Name of new transformation?",
  956. "Waiting for model constructors...",
  957. "Ready for command...",
  958. # transformation_add_AL * 2
  959. ] + [ "Which metamodels do you want to use as source for the action code (empty string to finish)?",
  960. "Model added as source",
  961. "Which metamodels do you want to use as target for the action code (empty string to finish)?",
  962. "Model added as target",
  963. "Name of Action Language model?",
  964. "Waiting for model constructors...",
  965. "Ready for command...", ] * 2 + [
  966. # model_list
  967. model_list |
  968. set([
  969. " PetriNet : SimpleClassDiagrams",
  970. " Encapsulated_PetriNet : SimpleClassDiagrams",
  971. " PW_Plant : SimpleClassDiagrams",
  972. " PW_Environment : SimpleClassDiagrams",
  973. " PW_Control : SimpleClassDiagrams",
  974. " Requirements : SimpleClassDiagrams",
  975. " Query : SimpleClassDiagrams",
  976. " reachability : ActionLanguage",
  977. " define_req : ManualOperation",
  978. " refine_plant : ManualOperation",
  979. " refine_control : ManualOperation",
  980. " refine_environment : ManualOperation",
  981. " refine_query : ManualOperation",
  982. " pn_print : ActionLanguage",
  983. " epn_print : ActionLanguage",
  984. " __merged_define_req : SimpleClassDiagrams",
  985. " __merged_All_RAM : SimpleClassDiagrams",
  986. " __merged_refine_plant : SimpleClassDiagrams",
  987. " __merged_refine_control : SimpleClassDiagrams",
  988. " __merged_refine_environment : SimpleClassDiagrams",
  989. " __merged_refine_query : SimpleClassDiagrams",
  990. " matches : All_RAM",
  991. " All_RAM : SimpleClassDiagrams",
  992. " make_initial_models : All_RAM",
  993. " pm_powerwindow : ProcessModel",
  994. " plant_to_EPN : All_RAM",
  995. " print_reachability : All_RAM",
  996. " combine_EPN : All_RAM",
  997. " environment_to_EPN : All_RAM",
  998. " control_to_EPN : All_RAM",
  999. " ReachabilityGraph : SimpleClassDiagrams",
  1000. ]),
  1001. "Ready for command...",
  1002. # process_execute
  1003. "Which process model do you want to execute?",
  1004. "Model prefix to use?",
  1005. # Manual transformation define_req
  1006. "Please perform manual transformation \"define_req\"",
  1007. "Model loaded, ready for commands!",
  1008. "Use 'help' command for a list of possible commands",
  1009. "Please give your command.",
  1010. "Waiting for model constructors...",
  1011. "Please give your command.",
  1012. # Manual transformation refine_plant
  1013. "Please perform manual transformation \"refine_plant\"",
  1014. "Model loaded, ready for commands!",
  1015. "Use 'help' command for a list of possible commands",
  1016. "Please give your command.",
  1017. "Waiting for model constructors...",
  1018. "Please give your command.",
  1019. # Manual transformation refine_environment
  1020. "Please perform manual transformation \"refine_environment\"",
  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_control
  1027. "Please perform manual transformation \"refine_control\"",
  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_query
  1034. "Please perform manual transformation \"refine_query\"",
  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. # Computations happen without output
  1041. # Finished, so we go back to the start
  1042. "Ready for command...",
  1043. ]))