瀏覽代碼

Fix transformation code for NACs with multiple LHS matchings

Yentl Van Tendeloo 7 年之前
父節點
當前提交
9ca4355819
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      bootstrap/transform.alc

+ 3 - 1
bootstrap/transform.alc

@@ -240,6 +240,7 @@ Element function get_possible_bindings(host_model : Element, schedule_model : El
 
 Element function full_match(host_model : Element, schedule_model : Element, current : String, single_ok : Boolean):
 	Element NACs
+	Element NACs_backup
 	String LHS
 	String NAC
 	Element mappings
@@ -255,12 +256,13 @@ Element function full_match(host_model : Element, schedule_model : Element, curr
 	mappings = match(host_model, schedule_model, LHS, dict_create())
 
 	// Got a list of all possible mappings, now filter based on NACs
-	NACs = allAssociationDestinations(schedule_model, current, "NACLink")
+	NACs_backup = allAssociationDestinations(schedule_model, current, "NACLink")
 
 	// For each possible mapping, we check all NACs!
 	while (set_len(mappings) > 0):
 		mapping = set_pop(mappings)
 		allowed = True
+		NACs = set_copy(NACs_backup)
 		while (set_len(NACs) > 0):
 			NAC = set_pop(NACs)
 			result = match(host_model, schedule_model, NAC, mapping)