test_powerwindow.py 73 KB

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