Browse Source

Updated header files and removed or trimmed unused functions

Yentl Van Tendeloo 9 years ago
parent
commit
c82f6df97a

+ 6 - 17
bootstrap/object_operations.alc

@@ -106,9 +106,6 @@ Element function allIncomingAssociationInstances(model : Element, target_name :
 		i = i + 1
 	return result
 
-Element function readElementByName(model : Element, name : String):
-	return model["model"][name]
-
 Element function getAttributeList(model : Element, element : String):
 	Element result
 	Element keys
@@ -132,11 +129,13 @@ Element function getAttributeList(model : Element, element : String):
 
 	return result
 
-Element function getInstantiatableAttributes(model : Element, element : Element):
+Element function getInstantiatableAttributes(model : Element, element : String):
 	Element result
 	result = create_node()
 	// Get all outgoing "dictionary" links
 	Element set_own
+	Element elem
+	elem = model["model"][element]
 	set_own = dict_keys(element)
 
 	// Filter them
@@ -148,20 +147,10 @@ Element function getInstantiatableAttributes(model : Element, element : Element)
 
 	return result
 
-String function getName(m : Element, e : Element):
-	Element element_keys
-	Element s
-	s = m["model"]
-	element_keys = dict_keys(s)
-
-	Element key
-	while (0 < read_nr_out(element_keys)):
-		key = set_pop(element_keys)
-		if (element_eq(dict_read_node(s, key), e)):
-			return key
-
-	return string_join(string_join("(unknown: ", cast_e2s(e)), " )")
+String function getName(model : Element, element : Element):
+	return reverseKeyLookup(model["model"], element)
 
+// Utility functions!
 String function reverseKeyLookup(dict : Element, element : Element):
 	Element elements
 	String name

+ 6 - 6
interface/HUTN/includes/conformance_scd.alh

@@ -1,6 +1,6 @@
-Boolean function is_direct_instance(a: Element, b: Element, c: Element)
-Boolean function is_nominal_instance(a: Element, b: Element, c: Element)
-Boolean function is_structural_subtype(a: Element, b: Element)
-Element function conformance_scd(a: Element)
-Element function set_model_constraints(a: Element, b: Element)
-Element function generate_bottom_type_mapping(a: Element)
+Boolean function is_direct_instance(model: Element, instance: Element, type: Element)
+Boolean function is_nominal_instance(model: Element, instance: Element, type: Element)
+Boolean function is_structural_subtype(subtype: Element, supertype: Element)
+Element function conformance_scd(model: Element)
+Element function set_model_constraints(model: Element, func: Element)
+Element function generate_bottom_type_mapping(model: Element)

+ 1 - 1
interface/HUTN/includes/io.alh

@@ -1,2 +1,2 @@
 Element function input()
-Element function output(a : Element)
+Element function output(value : Element)

+ 2 - 2
interface/HUTN/includes/library.alh

@@ -1,2 +1,2 @@
-Element function export_node(a: String, b: Element)
-Element function import_node(a: String)
+Void function export_node(location: String, element: Element)
+Element function import_node(location: String)

+ 6 - 7
interface/HUTN/includes/object_operations.alh

@@ -1,11 +1,10 @@
-Element function allInstances(a: Element, b: Element)
+Element function allInstances(model: Element, type: Element)
+Element function selectPossibleIncoming(model : Element, target : String, limit_set : Element)
+Element function selectPossibleOutgoing(model : Element, source : String, limit_set : Element)
 Element function allOutgoingAssociationInstances(model: Element, source_name : String, assoc_name: String)
-Element function allIncomingAssociationInstances(a: Element, b: Element, c: Element)
-Element function readElementByName(a: Element, b: String)
-Element function getAttributeList(a: Element, b: Element)
-Element function getInstantiatableAttributes(a: Element, b: Element)
+Element function allIncomingAssociationInstances(model: Element, target_name : String, assoc_name: String)
+Element function getAttributeList(model: Element, element: String)
+Element function getInstantiatableAttributes(model: Element, element: Element)
 String function getName(a: Element, b: Element)
 String function reverseKeyLookup(a: Element, b: Element)
 String function print_dict(dict : Element)
-Element function selectPossibleIncoming(model : Element, target : String, limit_set : Element)
-Element function selectPossibleOutgoing(model : Element, source : String, limit_set : Element)