Yentl Van Tendeloo 8 سال پیش
والد
کامیت
713537c8b6
2فایلهای تغییر یافته به همراه7 افزوده شده و 16 حذف شده
  1. 1 1
      bootstrap/utils.alc
  2. 6 15
      models/SCCD_execute.alc

+ 1 - 1
bootstrap/utils.alc

@@ -94,7 +94,7 @@ Element function list_splice(lst : Element, start : Integer, end : Integer):
 
 	Integer i
 	i = start
-	while (i <= end):
+	while (i < end):
 		list_append(result, list_read(lst, i))
 		i = i + 1
 

+ 6 - 15
models/SCCD_execute.alc

@@ -52,19 +52,6 @@ Element function filter_exists(model : Element, set : Element, attribute_name :
 
 	return result!
 
-Element function filter_resolve_exists(model : Element, set : Element, attribute_name : String):
-	Element keys
-	String key
-	Element result
-
-	result = create_node()
-	while (read_nr_out(set) > 0):
-		key = set_pop(set)
-		if (element_neq(read_attribute(model, key, attribute_name), read_root())):
-			set_add(result, read_attribute(model, key, attribute_name))
-
-	return result!
-
 Element function expand_current_state(model : Element, state : String, current_states : Element):
 	// Find the hierarchy of all current states, and select those that contain the currently selected state
 	Element result
@@ -372,8 +359,10 @@ Element function get_actions_to_execute(model : Element, source_states : Element
 	Integer i
 	String current
 	Element hierarchy
+	Boolean finished
 	i = 0
-	while (True):
+	finished = False
+	while (bool_not(finished)):
 		// Check the i-th element in both and see if they are equal
 		current = ""
 		iter_hierarchies = set_copy(all_hierarchies)
@@ -381,7 +370,8 @@ Element function get_actions_to_execute(model : Element, source_states : Element
 			hierarchy = set_pop(iter_hierarchies)
 
 			// Exhausted one of the lists
-			if (i == list_len(hierarchy)):
+			if (i >= list_len(hierarchy)):
+				finished = True
 				break!
 
 			// First entry, so read out value as reference
@@ -390,6 +380,7 @@ Element function get_actions_to_execute(model : Element, source_states : Element
 
 			// Check with reference element
 			if (bool_not(value_eq(list_read(hierarchy, i), current))):
+				finished = True
 				break!
 
 		// i-th element equal for all hierarchies, so go to next element