test_pn_interface.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. import unittest
  2. from utils import run_file, get_constructor
  3. set_inheritance = [
  4. "Which link in the metamodel is the inheritance link?",
  5. "Set inheritance link!",
  6. ]
  7. do_instantiate_simple = [
  8. "new", "PetriNets", "abc",
  9. "instantiate", "Transition", "t1",
  10. "instantiate", "Place", "p1", "attr_add", "p1", "tokens", 5,
  11. "instantiate", "Place", "p2", "attr_add", "p2", "tokens", 0,
  12. "instantiate", "P2T", "p2t", "p1", "t1", "attr_add", "p2t", "weight", 2,
  13. "instantiate", "T2P", "t2p", "t1", "p2", "attr_add", "t2p", "weight", 1]
  14. instantiate_node = ["Type to instantiate?",
  15. "Name of new element?",
  16. "Instantiation successful!"]
  17. instantiate_edge = ["Type to instantiate?",
  18. "Name of new element?",
  19. "Source name?",
  20. "Destination name?",
  21. "Instantiation successful!"]
  22. all_files = [ "pn_interface.alc",
  23. "primitives.alc",
  24. "object_operations.alc",
  25. "conformance_scd.alc",
  26. "library.alc",
  27. "ramify.alc",
  28. "metamodels.alc",
  29. "constructors.alc",
  30. "modelling.alc",
  31. "compilation_manager.alc",
  32. ]
  33. greeting = ["Welcome to the Model Management Interface, running live on the Modelverse!",
  34. "Use 'help' command for a list of possible commands"]
  35. new = ["Metamodel to instantiate?",
  36. "Name of model?"]
  37. prompt = ["Please give your command."]
  38. loaded = ["Model loaded, ready for commands!",
  39. "Use 'help' command for a list of possible commands"] + prompt
  40. load = ["Model to load?"]
  41. instantiate = ["Type to instantiate?"]
  42. instantiate_name = ["Name of new element?"]
  43. instantiate_ok = ["Instantiation successful!"]
  44. instantiate_source= ["Source name?"]
  45. instantiate_destination = ["Destination name?"]
  46. def list_menu(defined):
  47. defined.append(("PetriNets", "SimpleClassDiagrams"))
  48. defined.append(("SimpleClassDiagrams", "SimpleClassDiagrams"))
  49. defined.append(("LTM_bottom", "LTM_bottom"))
  50. return ["Found models:",
  51. set([" %s : %s" % (m, mm) for m, mm in defined])]
  52. def list_model(defined):
  53. return ["List of all elements:",
  54. set([" %s : %s" % (m, mm) for m, mm in defined])]
  55. def read_node(name, t, defs, attrs):
  56. return ["Element to read?",
  57. "Name: %s" % name,
  58. "Type: %s" % t,
  59. "Defines attributes:"] + \
  60. ([set([" %s : %s" % (m, mm) for m, mm in defs])] if defs else []) + \
  61. ["Attributes:"] + \
  62. ([set([' "%s" : "%s" = %s' % (m, mm, v) for m, mm, v in attrs])] if attrs else [])
  63. def read_edge(name, t, src, dst, defs, attrs):
  64. return ["Element to read?",
  65. "Name: %s" % name,
  66. "Type: %s" % t,
  67. "Source: %s" % src,
  68. "Destination: %s" % dst,
  69. "Defines attributes:"] + \
  70. ([set([" %s : %s" % (m, mm) for m, mm in defs])] if defs else []) + \
  71. ["Attributes:"] + \
  72. ([set([' "%s" : "%s" = %s' % (m, mm, v) for m, mm, v in attrs])] if attrs else [])
  73. delete = ["Model to delete?", "Deleted!"]
  74. rename = ["Old name?", "New name?", "Rename complete!"]
  75. attr_add = ["Which model do you want to assign an attribute to?",
  76. "Which attribute do you wish to assign?",
  77. "Value of attribute?",
  78. "Added attribute!"]
  79. attr_del = ["Which model do you want to remove an attribute of?",
  80. "Which attribute do you want to delete?",
  81. "Attribute deleted!",
  82. ]
  83. help_root = ["Currently no model is loaded, so your operations are limited to:",
  84. " new -- Create a new model and save it for future use"
  85. " load -- Load a previously made model",
  86. " rename -- Rename a previously made model",
  87. " delete -- Delete a previously made model",
  88. " list -- Show a list of all stored models",
  89. " help -- Show a list of possible commands"]
  90. verify_fail_weight= ["Natural number not larger than or equal to zero"]
  91. verify_fail_tokens= ["Natural number not larger than or equal to zero"]
  92. verify_fail_structure = ["Source of model edge not typed by source of type: p2t"]
  93. init = greeting + prompt
  94. did_instantiate_simple = init + \
  95. new + \
  96. loaded +\
  97. instantiate_node + \
  98. prompt + \
  99. instantiate_node + \
  100. prompt + \
  101. attr_add + \
  102. prompt + \
  103. instantiate_node + \
  104. prompt + \
  105. attr_add + \
  106. prompt + \
  107. instantiate_edge + \
  108. prompt + \
  109. attr_add + \
  110. prompt + \
  111. instantiate_edge + \
  112. prompt + \
  113. attr_add + \
  114. prompt
  115. def list_types(t):
  116. return ["List of types:"] + \
  117. [set([" %s : %s" % (m, mm) for m, mm in t])]
  118. modify = ["Element to modify?",
  119. "Attribute to modify?",
  120. "New value?",
  121. "Modified!",]
  122. class TestPetrinetInterface(unittest.TestCase):
  123. def test_po_pn_interface_manage(self):
  124. self.pn_interface_manage("PO")
  125. def test_co_pn_interface_manage(self):
  126. self.pn_interface_manage("CO")
  127. def pn_interface_manage(self, mode):
  128. self.assertTrue(run_file(all_files,
  129. ["list",
  130. "new", "PetriNets", "abc", "exit",
  131. "list",
  132. "new", "PetriNets", "def", "exit",
  133. "list",
  134. "delete", "def",
  135. "list",
  136. "rename", "abc", "a",
  137. "list",
  138. "delete", "a",
  139. "list",
  140. ],
  141. init + \
  142. list_menu([]) + prompt + \
  143. new + loaded + prompt + list_menu([("abc", "PetriNets")]) + prompt + \
  144. new + loaded + prompt + list_menu([("abc", "PetriNets"), ("def", "PetriNets")]) + prompt + \
  145. delete + prompt + list_menu([("abc", "PetriNets")]) + prompt + \
  146. rename + prompt + list_menu([("a", "PetriNets")]) + prompt + \
  147. delete + prompt + list_menu([]) + prompt,
  148. mode))
  149. def test_po_pn_interface_new_reload(self):
  150. self.pn_interface_new_reload("PO")
  151. def test_co_pn_interface_new_reload(self):
  152. self.pn_interface_new_reload("CO")
  153. def pn_interface_new_reload(self, mode):
  154. self.assertTrue(run_file(all_files,
  155. ["new", "PetriNets", "abc", "exit", "load", "abc"],
  156. init + new + loaded + prompt + load + loaded,
  157. mode))
  158. def test_po_pn_interface_instantiate_place(self):
  159. self.pn_interface_instantiate_place("PO")
  160. def test_co_pn_interface_instantiate_place(self):
  161. self.pn_interface_instantiate_place("CO")
  162. def pn_interface_instantiate_place(self, mode):
  163. self.assertTrue(run_file(all_files,
  164. ["new", "PetriNets", "abc",
  165. "instantiate", "Place", "p1",
  166. "attr_add", "p1", "tokens", 5,
  167. "list",
  168. "read", "p1",
  169. "instantiate", "Transition", "t1",
  170. "list",
  171. "read", "t1"],
  172. init + new + loaded + \
  173. instantiate_node + prompt + \
  174. attr_add + prompt + \
  175. list_model([("p1", "Place"), ("p1.tokens", "Natural")]) + prompt + \
  176. read_node("p1", "Place", [], [("tokens", "Natural", 5)]) + prompt + \
  177. instantiate_node + prompt + \
  178. list_model([("p1", "Place"), ("t1", "Transition"), ("p1.tokens", "Natural")]) + prompt + \
  179. read_node("t1", "Transition", [], []) + prompt,
  180. mode))
  181. def test_po_pn_interface_instantiate_arcs(self):
  182. self.pn_interface_instantiate_arcs("PO")
  183. def test_co_pn_interface_instantiate_arcs(self):
  184. self.pn_interface_instantiate_arcs("CO")
  185. def pn_interface_instantiate_arcs(self, mode):
  186. self.assertTrue(run_file(all_files,
  187. do_instantiate_simple + [
  188. "read", "p1",
  189. "read", "p2",
  190. "read", "t1",
  191. "read", "p2t",
  192. "read", "t2p",
  193. ],
  194. did_instantiate_simple + \
  195. read_node("p1", "Place", [], [("tokens", "Natural", 5)]) + prompt + \
  196. read_node("p2", "Place", [], [("tokens", "Natural", 0)]) + prompt + \
  197. read_node("t1", "Transition", [], []) + prompt + \
  198. read_edge("p2t", "P2T", "p1", "t1", [], [("weight", "Natural", 2)]) + prompt + \
  199. read_edge("t2p", "T2P", "t1", "p2", [], [("weight", "Natural", 1)]) + prompt,
  200. mode))
  201. def test_po_pn_interface_verify_OK(self):
  202. self.pn_interface_verify_OK("PO")
  203. def test_co_pn_interface_verify_OK(self):
  204. self.pn_interface_verify_OK("CO")
  205. def pn_interface_verify_OK(self, mode):
  206. self.assertTrue(run_file(all_files,
  207. do_instantiate_simple + ["verify"],
  208. did_instantiate_simple + ["OK"], mode))
  209. def test_po_pn_interface_verify_fail_tokens(self):
  210. self.pn_interface_verify_fail_tokens("PO")
  211. def test_co_pn_interface_verify_fail_tokens(self):
  212. self.pn_interface_verify_fail_tokens("CO")
  213. def pn_interface_verify_fail_tokens(self, mode):
  214. self.assertTrue(run_file(all_files,
  215. do_instantiate_simple + ["modify", "p1", "tokens", -5, "verify"],
  216. did_instantiate_simple + modify + prompt + verify_fail_tokens + prompt, mode))
  217. def test_po_pn_interface_verify_fail_weight(self):
  218. self.pn_interface_verify_fail_weight("PO")
  219. def test_co_pn_interface_verify_fail_weight(self):
  220. self.pn_interface_verify_fail_weight("CO")
  221. def pn_interface_verify_fail_weight(self, mode):
  222. self.assertTrue(run_file(all_files,
  223. do_instantiate_simple + ["modify", "p2t", "weight", -2, "verify"],
  224. did_instantiate_simple + modify + prompt + verify_fail_weight + prompt, mode))
  225. def test_po_pn_interface_verify_fail_structure(self):
  226. self.pn_interface_verify_fail_structure("PO")
  227. def test_co_pn_interface_verify_fail_structure(self):
  228. self.pn_interface_verify_fail_structure("CO")
  229. def pn_interface_verify_fail_structure(self, mode):
  230. self.assertTrue(run_file(all_files,
  231. ["new", "PetriNets", "abc",
  232. "instantiate", "Transition", "t1",
  233. "instantiate", "Place", "p1", "attr_add", "p1", "tokens", 5,
  234. "instantiate", "P2T", "p2t", "t1", "p1", "attr_add", "p2t", "weight", 2, "verify"],
  235. init + new + loaded + \
  236. instantiate_node + prompt + \
  237. instantiate_node + prompt + attr_add + prompt + \
  238. instantiate_edge + prompt + attr_add + prompt + \
  239. verify_fail_structure,
  240. mode))
  241. def test_po_pn_interface_types(self):
  242. self.pn_interface_types("PO")
  243. def test_co_pn_interface_types(self):
  244. self.pn_interface_types("CO")
  245. def pn_interface_types(self, mode):
  246. self.assertTrue(run_file(all_files,
  247. ["new", "PetriNets", "abc", "types"],
  248. init + new + loaded + list_types([("Place", "Class"),
  249. ("Transition", "Class"),
  250. ("P2T", "Association"),
  251. ("T2P", "Association"),
  252. ("Natural", "Class"),
  253. ("Place_tokens", "Association"),
  254. ("Place_tokens.name", "String"),
  255. ("Place_tokens.target_lower_cardinality", "Natural"),
  256. ("Place_tokens.target_upper_cardinality", "Natural"),
  257. ("P2T_weight", "Association"),
  258. ("P2T_weight.name", "String"),
  259. ("P2T_weight.target_lower_cardinality", "Natural"),
  260. ("P2T_weight.target_upper_cardinality", "Natural"),
  261. ("T2P_weight", "Association"),
  262. ("T2P_weight.name", "String"),
  263. ("T2P_weight.target_lower_cardinality", "Natural"),
  264. ("T2P_weight.target_upper_cardinality", "Natural"),
  265. ]) + prompt,
  266. mode))
  267. def test_po_pn_interface_modify_place(self):
  268. self.pn_interface_modify_place("PO")
  269. def test_co_pn_interface_modify_place(self):
  270. self.pn_interface_modify_place("CO")
  271. def pn_interface_modify_place(self, mode):
  272. self.assertTrue(run_file(all_files,
  273. ["new", "PetriNets", "abc",
  274. "instantiate", "Place", "p1", "attr_add", "p1", "tokens", 5,
  275. "read", "p1",
  276. "modify", "p1", "tokens", 1, "read", "p1"],
  277. init + new + loaded + \
  278. instantiate_node + prompt + attr_add + prompt + \
  279. read_node("p1", "Place", [], [("tokens", "Natural", 5)]) + prompt + \
  280. modify + prompt + \
  281. read_node("p1", "Place", [], [("tokens", "Natural", 1)]) + prompt,
  282. mode))
  283. def test_po_pn_interface_verify_fail_attr_lower_cardinality(self):
  284. self.pn_interface_verify_fail_attr_lower_cardinality("PO")
  285. def test_co_pn_interface_verify_fail_attr_lower_cardinality(self):
  286. self.pn_interface_verify_fail_attr_lower_cardinality("CO")
  287. def pn_interface_verify_fail_attr_lower_cardinality(self, mode):
  288. self.assertTrue(run_file(all_files,
  289. do_instantiate_simple + ["instantiate", "Place", "p999", "verify"],
  290. did_instantiate_simple + instantiate_node + prompt + ["Lower cardinality violation for outgoing edge of type Place_tokens at p999"] + prompt,
  291. mode))
  292. def test_po_pn_interface_verify_fail_attr_upper_cardinality(self):
  293. self.pn_interface_verify_fail_attr_upper_cardinality("PO")
  294. def test_co_pn_interface_verify_fail_attr_upper_cardinality(self):
  295. self.pn_interface_verify_fail_attr_upper_cardinality("CO")
  296. def pn_interface_verify_fail_attr_upper_cardinality(self, mode):
  297. self.assertTrue(run_file(all_files,
  298. do_instantiate_simple + ["attr_add", "p1", "tokens", 5, "verify"],
  299. did_instantiate_simple + attr_add + prompt + ["Upper cardinality violation for outgoing edge of type Place_tokens at p1"] + prompt,
  300. mode))
  301. def test_po_pn_interface_verify_natural(self):
  302. self.pn_interface_verify_natural("PO")
  303. def test_co_pn_interface_verify_natural(self):
  304. self.pn_interface_verify_natural("CO")
  305. def pn_interface_verify_natural(self, mode):
  306. self.assertTrue(run_file(all_files,
  307. ["new", "PetriNets", "abc",
  308. "instantiate", "Place", "p1",
  309. "attr_add", "p1", "tokens", -5,
  310. "attr_del", "p1", "tokens",
  311. "attr_add", "p1", "tokens", 4,
  312. "verify"],
  313. init + new + loaded + \
  314. instantiate_node + prompt + \
  315. attr_add + prompt + \
  316. attr_del + prompt + \
  317. attr_add + prompt + \
  318. ["OK"] + prompt,
  319. mode))
  320. def test_po_pn_interface_verify_PN_OK(self):
  321. self.pn_interface_verify_PN_OK("PO")
  322. def test_co_pn_interface_verify_PN_OK(self):
  323. self.pn_interface_verify_PN_OK("CO")
  324. def pn_interface_verify_PN_OK(self, mode):
  325. self.assertTrue(run_file(all_files,
  326. ["load", "PetriNets", "verify"],
  327. init + load + loaded + ["OK"], mode))
  328. def test_po_rpgame(self):
  329. self.rpgame("PO")
  330. def test_co_rpgame(self):
  331. self.rpgame("CO")
  332. def rpgame(self, mode):
  333. constraint_code = \
  334. """
  335. include "primitives.alh"
  336. include "object_operations.alh"
  337. Element function constraint(model : Element, name : String):
  338. \tElement associations
  339. \tElement back_associations
  340. \tElement association
  341. \tString destination
  342. \tassociations = allOutgoingAssociationInstances(model, name, "tile_left")
  343. \twhile (0 < list_len(associations)):
  344. \t\tassociation = set_pop(associations)
  345. \t\tdestination = readAssociationDestination(model, association)
  346. \t\tback_associations = allOutgoingAssociationInstances(model, destination, "tile_right")
  347. \t\tif (list_len(back_associations) < 1):
  348. \t\t\treturn "Left link does not have a right link back"!
  349. \t\telse:
  350. \t\t\tassociation = set_pop(back_associations)
  351. \t\t\tdestination = readAssociationDestination(model, association)
  352. \t\t\tif (destination != name):
  353. \t\t\t\treturn "Right link does not have a left link back to the same tile"!
  354. \tassociations = allOutgoingAssociationInstances(model, name, "tile_right")
  355. \twhile (0 < list_len(associations)):
  356. \t\tassociation = set_pop(associations)
  357. \t\tdestination = readAssociationDestination(model, association)
  358. \t\tback_associations = allOutgoingAssociationInstances(model, destination, "tile_left")
  359. \t\tif (list_len(back_associations) < 1):
  360. \t\t\treturn "Right link does not have a left link back"!
  361. \t\telse:
  362. \t\t\tassociation = set_pop(back_associations)
  363. \t\t\tdestination = readAssociationDestination(model, association)
  364. \t\t\tif (destination != name):
  365. \t\t\t\treturn "Right link does not have a left link back to the same tile"!
  366. \tassociations = allOutgoingAssociationInstances(model, name, "tile_top")
  367. \twhile (0 < list_len(associations)):
  368. \t\tassociation = set_pop(associations)
  369. \t\tdestination = readAssociationDestination(model, association)
  370. \t\tback_associations = allOutgoingAssociationInstances(model, destination, "tile_bottom")
  371. \t\tif (list_len(back_associations) < 1):
  372. \t\t\treturn "Top link does not have a bottom link back"!
  373. \t\telse:
  374. \t\t\tassociation = set_pop(back_associations)
  375. \t\t\tdestination = readAssociationDestination(model, association)
  376. \t\t\tif (destination != name):
  377. \t\t\t\treturn "Top link does not have a bottom link back to the same tile"!
  378. \tassociations = allOutgoingAssociationInstances(model, name, "tile_bottom")
  379. \twhile (0 < list_len(associations)):
  380. \t\tassociation = set_pop(associations)
  381. \t\tdestination = readAssociationDestination(model, association)
  382. \t\tback_associations = allOutgoingAssociationInstances(model, destination, "tile_top")
  383. \t\tif (list_len(back_associations) < 1):
  384. \t\t\treturn "Bottom link does not have a top link back"!
  385. \t\telse:
  386. \t\t\tassociation = set_pop(back_associations)
  387. \t\t\tdestination = readAssociationDestination(model, association)
  388. \t\t\tif (destination != name):
  389. \t\t\t\treturn "Bottom link does not have a top link back to the same tile"!
  390. \treturn "OK"!
  391. """
  392. constructors = get_constructor(constraint_code)
  393. print(constructors)
  394. self.assertTrue(run_file(all_files,
  395. ["new", "SimpleClassDiagrams", "RPGame",
  396. "set_inheritance", "Inheritance",
  397. "instantiate", "Class", "Scene",
  398. "instantiate", "Class", "Tile",
  399. "instantiate", "Class", "Item",
  400. "instantiate", "Class", "Goal",
  401. "instantiate", "Class", "Character",
  402. "instantiate", "Class", "Hero",
  403. "instantiate", "Association", "scene_has_tiles", "Scene", "Tile",
  404. "instantiate", "Association", "tile_left", "Tile", "Tile",
  405. "instantiate", "Association", "tile_right", "Tile", "Tile",
  406. "instantiate", "Association", "tile_top", "Tile", "Tile",
  407. "instantiate", "Association", "tile_bottom", "Tile", "Tile",
  408. "instantiate", "Association", "character_on", "Character", "Tile",
  409. "instantiate", "Association", "item_on", "Item", "Tile",
  410. "instantiate", "Inheritance", "hero_is_character", "Hero", "Character",
  411. "instantiate", "Inheritance", "goal_is_item", "Goal", "Item",
  412. "attr_add", "Scene", "lower_cardinality", 1,
  413. "attr_add", "Scene", "upper_cardinality", 1,
  414. "attr_add", "Goal", "lower_cardinality", 1,
  415. "attr_add", "scene_has_tiles", "source_lower_cardinality", 1,
  416. "attr_add", "scene_has_tiles", "source_upper_cardinality", 1,
  417. "attr_add", "scene_has_tiles", "target_lower_cardinality", 1,
  418. "attr_add", "item_on", "target_lower_cardinality", 1,
  419. "attr_add", "item_on", "target_upper_cardinality", 1,
  420. "attr_add", "item_on", "source_upper_cardinality", 1,
  421. "attr_add", "character_on", "target_lower_cardinality", 1,
  422. "attr_add", "character_on", "target_upper_cardinality", 1,
  423. "attr_add", "character_on", "source_upper_cardinality", 1,
  424. "attr_add", "tile_left", "source_upper_cardinality", 1,
  425. "attr_add", "tile_left", "target_upper_cardinality", 1,
  426. "attr_add", "tile_right", "source_upper_cardinality", 1,
  427. "attr_add", "tile_right", "target_upper_cardinality", 1,
  428. "attr_add", "tile_top", "source_upper_cardinality", 1,
  429. "attr_add", "tile_top", "target_upper_cardinality", 1,
  430. "attr_add", "tile_bottom", "source_upper_cardinality", 1,
  431. "attr_add", "tile_bottom", "target_upper_cardinality", 1,
  432. "constrain", "Tile",
  433. ] + constructors + ["verify"] + ["exit"] + [
  434. "new", "RPGame", "my_game",
  435. "instantiate", "Scene", "scene",
  436. "instantiate", "Hero", "Link",
  437. "instantiate", "Goal", "goal",
  438. "instantiate", "Tile", "tile_00",
  439. "instantiate", "Tile", "tile_01",
  440. "instantiate", "Tile", "tile_10",
  441. "instantiate", "Tile", "tile_11",
  442. "instantiate", "scene_has_tiles", "", "scene", "tile_00",
  443. "instantiate", "scene_has_tiles", "", "scene", "tile_01",
  444. "instantiate", "scene_has_tiles", "", "scene", "tile_10",
  445. "instantiate", "scene_has_tiles", "", "scene", "tile_11",
  446. "instantiate", "character_on", "", "Link", "tile_00",
  447. "instantiate", "item_on", "", "goal", "tile_11",
  448. "instantiate", "tile_left", "", "tile_01", "tile_00",
  449. "instantiate", "tile_left", "", "tile_11", "tile_10",
  450. "instantiate", "tile_right", "", "tile_00", "tile_01",
  451. "instantiate", "tile_right", "", "tile_10", "tile_11",
  452. "instantiate", "tile_top", "", "tile_10", "tile_00",
  453. "instantiate", "tile_top", "", "tile_11", "tile_01",
  454. "instantiate", "tile_bottom", "", "tile_00", "tile_10",
  455. "instantiate", "tile_bottom", "", "tile_01", "tile_11",
  456. "verify",
  457. ],
  458. init + new + loaded + \
  459. set_inheritance + prompt + \
  460. (instantiate_node + prompt) * 6 + \
  461. (instantiate_edge + prompt) * 9 + \
  462. (attr_add + prompt) * 20 + \
  463. ["Element to constrain (empty for global)?",
  464. "Give input to function constructors for LOCAL constraint!",
  465. "Added constraint to model!"] + \
  466. prompt + \
  467. ["OK"] + \
  468. prompt + prompt + new + loaded + \
  469. (instantiate_node + prompt) * 7 + \
  470. (instantiate_edge + prompt) * 14 + \
  471. ["OK"],
  472. mode))