test_pn_interface.py 24 KB

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