Browse Source

Fixed first set of tests: constructors_model; updated metamodels.alc too

Yentl Van Tendeloo 8 years ago
parent
commit
20ae68d542

BIN
bootstrap/bootstrap.m.gz


+ 153 - 245
bootstrap/metamodels.alc

@@ -4,161 +4,63 @@ include "library.alh"
 include "conformance_scd.alh"
 include "modelling.alh"
 
-Element function constraint_natural(model : Element, name : String):
-	if (is_physical_int(model["model"][name])):
-		if (integer_gte(model["model"][name], 0)):
+String function constraint_Natural(params : Element):
+	Element self
+	self = params["model"]["model"][params["name"]]
+	if (is_physical_int(self)):
+		if (integer_gte(self, 0)):
 			return "OK"!
 		else:
 			return "Natural number not larger than or equal to zero"!
 	else:
-		return "Natural has non-integer instance"!
+		return "Natural number not larger than or equal to zero"!
 
-Element function constraint_string(model : Element, name : String):
-	if (is_physical_string(model["model"][name])):
+Element function constraint_String(params : Element):
+	Element self
+	self = params["model"]["model"][params["name"]]
+	if (is_physical_string(self)):
 		return "OK"!
 	else:
 		return "String has non-string instance"!
 
-Element function constraint_boolean(model : Element, name : String):
-	if (is_physical_boolean(model["model"][name])):
+Element function constraint_Boolean(params : Element):
+	Element self
+	self = params["model"]["model"][params["name"]]
+	if (is_physical_boolean(self)):
 		return "OK"!
 	else:
 		return "Boolean has non-boolean instance"!
 
-Element function constraint_if(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "if"):
+Element function constraint_Location(params : Element):
+	Element self
+	self = params["model"]["model"][params["name"]]
+	if (is_physical_string(self)):
+		if (element_neq(import_node(self), read_root())):
 			return "OK"!
 		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
+			return "Location references non-existing element!"!
 	else:
-		return "Expected physical action value"!
+		return "Location has non-string instance"!
 
-Element function constraint_while(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "while"):
+Element function constraint_ActionLanguage(params : Element):
+	Element self
+	self = params["model"]["model"][params["name"]]
+	if (is_physical_string(self)):
+		if (element_neq(import_node(self), read_root())):
 			return "OK"!
 		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
+			return "ActionLanguage references non-existing element!"!
 	else:
-		return "Expected physical action value"!
-
-Element function constraint_break(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "break"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_continue(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "continue"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_assign(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "assign"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_return(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "return"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_output(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "output"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_input(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "input"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_declare(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "declare"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_global(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "global"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_access(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "access"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_constant(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "constant"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_resolve(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "resolve"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
-
-Element function constraint_call(model : Element, name : String):
-	if (is_physical_action(model["model"][name])):
-		if (cast_a2s(model["model"][name]) == "call"):
-			return "OK"!
-		else:
-			return "Got wrong action primitive: " + cast_a2s(model["model"][name])!
-	else:
-		return "Expected physical action value"!
+		return "ActionLanguage has non-string value!"!
 
 Element function initialize_SCD(location : String):
 	if (element_neq(import_node(location), read_root())):
 		return import_node(location)!
 
-	// Temporarily disable during tests
-	return create_node()!
-
 	Element scd
+	String al_location
+	al_location = "models/ActionLanguage"
+
 	scd = instantiate_bottom()
 
 	model_add_node(scd, "Element")
@@ -174,6 +76,7 @@ Element function initialize_SCD(location : String):
 	model_add_edge(scd, "attr_name_name", "attr_name", "name_value")
 	model_add_edge(scd, "class_inh_element", "Class", "Element")
 	model_add_edge(scd, "attribute_inh_element", "Attribute", "Element")
+	model_add_edge(scd, "simple_inh_element", "SimpleAttribute", "Element")
 	model_add_edge(scd, "association_inh_element", "Association", "Element")
 	model_add_edge(scd, "attributelink_inh_element", "AttributeLink", "Element")
 
@@ -183,15 +86,16 @@ Element function initialize_SCD(location : String):
 	retype(scd, "Class", "Class")
 	retype(scd, "Attribute", "Class")
 	retype(scd, "SimpleAttribute", "Class")
-	retype(scd, "String", "Attribute")
+	retype(scd, "String", "SimpleAttribute")
 	retype(scd, "name_value", "String")
 	retype(scd, "Association", "Association")
 	retype(scd, "Inheritance", "Association")
 	retype(scd, "AttributeLink", "Association")
-	retype(scd, "attr_name", "Attribute")
+	retype(scd, "attr_name", "AttributeLink")
 	retype(scd, "attr_name_name", "attr_name")
 	retype(scd, "class_inh_element", "Inheritance")
 	retype(scd, "attribute_inh_element", "Inheritance")
+	retype(scd, "simple_inh_element", "Inheritance")
 	retype(scd, "association_inh_element", "Inheritance")
 	retype(scd, "attributelink_inh_element", "Inheritance")
 
@@ -199,48 +103,39 @@ Element function initialize_SCD(location : String):
 	instantiate_node(scd, "SimpleAttribute", "Location")
 	instantiate_node(scd, "SimpleAttribute", "Natural")
 	instantiate_node(scd, "SimpleAttribute", "Boolean")
-	instantiate_link(scd, "AttributeLink", "attr_optional", "Attribute", "Boolean")
+	instantiate_link(scd, "AttributeLink", "attr_optional", "AttributeLink", "Boolean")
 	instantiate_attribute(scd, "attr_optional", "name", "optional")
 	instantiate_attribute(scd, "attr_optional", "optional", False)
 	instantiate_attribute(scd, "attr_name", "optional", False)
+
+	instantiate_node(scd, "Class", "ComplexAttribute")
+	instantiate_link(scd, "Inheritance", "", "ComplexAttribute", "Attribute")
+
 	model_define_attribute(scd, "Class", "lower_cardinality", True, "Natural")
 	model_define_attribute(scd, "Class", "upper_cardinality", True, "Natural")
 	model_define_attribute(scd, "Association", "source_lower_cardinality", True, "Natural")
 	model_define_attribute(scd, "Association", "target_lower_cardinality", True, "Natural")
 	model_define_attribute(scd, "Association", "source_upper_cardinality", True, "Natural")
 	model_define_attribute(scd, "Association", "target_upper_cardinality", True, "Natural")
+	model_define_attribute(scd, "ComplexAttribute", "type", False, "Location")
 
+	// Export already, to allow AL to pick it up
+	export_node(location, scd)
 	// Add in the Action Language metamodel
-	add_AL_to_MM(scd)
+	initialize_AL(location, al_location)
 
 	// Define additional attributes that define functions
-	model_define_attribute(scd, "Element", "constraint", True, "funcdef")
-	model_define_attribute(scd, "AttributeValue", "to_string", True, "funcdef")
+	instantiate_node(scd, "ComplexAttribute", "ActionLanguage")
+	instantiate_attribute(scd, "ActionLanguage", "type", al_location)
+	model_define_attribute(scd, "Element", "constraint", True, "ActionLanguage")
 
 	// Define some constraints
-	instantiate_attribute(scd, "Natural", "constraint", constraint_natural)
-	instantiate_attribute(scd, "String", "constraint", constraint_string)
-	instantiate_attribute(scd, "Boolean", "constraint", constraint_boolean)
-
-	// Add constraints to all primitive classes
-	// TODO this is much too slow right now
-	//instantiate_attribute_code(scd, "if", "constraint", constraint_if)
-	//instantiate_attribute_code(scd, "while", "constraint", constraint_while)
-	//instantiate_attribute_code(scd, "break", "constraint", constraint_break)
-	//instantiate_attribute_code(scd, "continue", "constraint", constraint_continue)
-	//instantiate_attribute_code(scd, "assign", "constraint", constraint_assign)
-	//instantiate_attribute_code(scd, "return", "constraint", constraint_return)
-	//instantiate_attribute_code(scd, "output", "constraint", constraint_output)
-	//instantiate_attribute_code(scd, "input", "constraint", constraint_input)
-	//instantiate_attribute_code(scd, "declare", "constraint", constraint_declare)
-	//instantiate_attribute_code(scd, "global", "constraint", constraint_global)
-	//instantiate_attribute_code(scd, "access", "constraint", constraint_access)
-	//instantiate_attribute_code(scd, "constant", "constraint", constraint_constant)
-	//instantiate_attribute_code(scd, "resolve", "constraint", constraint_resolve)
-	//instantiate_attribute_code(scd, "call", "constraint", constraint_call)
-
-	// Finally done, so export!
-	export_node(location, scd)
+	instantiate_attribute(scd, "Natural", "constraint", constraint_Natural)
+	instantiate_attribute(scd, "String", "constraint", constraint_String)
+	instantiate_attribute(scd, "Boolean", "constraint", constraint_Boolean)
+	instantiate_attribute(scd, "Location", "constraint", constraint_Location)
+	instantiate_attribute(scd, "ActionLanguage", "constraint", constraint_ActionLanguage)
+
 	return scd!
 
 Element function initialize_PN(location_SCD : String, location_PN : String):
@@ -260,7 +155,7 @@ Element function initialize_PN(location_SCD : String, location_PN : String):
 	model_define_attribute(pn, "T2P", "weight", False, "Natural")
 
 	// Add constraint on the Natural
-	instantiate_attribute(pn, "Natural", "constraint", constraint_natural)
+	instantiate_attribute(pn, "Natural", "constraint", constraint_Natural)
 
 	export_node(location_PN, pn)
 
@@ -302,42 +197,42 @@ Element function create_metamodels():
 
 	return dict_read(dict_read(read_root(), "__hierarchy"), "models")!
 
-Void function add_AL_to_MM(model : Element):
-	instantiate_node(model, "AttributeValue", "PrimitiveType")
-	instantiate_node(model, "AttributeValue", "Action")
-	instantiate_node(model, "AttributeValue", "String")
-	instantiate_node(model, "AttributeValue", "Natural")
-
-	instantiate_link(model, "Inheritance", "", "Natural", "PrimitiveType")
-	instantiate_link(model, "Inheritance", "", "String", "PrimitiveType")
-	instantiate_link(model, "Inheritance", "", "Action", "PrimitiveType")
-	instantiate_link(model, "Inheritance", "", "Boolean", "PrimitiveType")
-
-	instantiate_attribute(model, "Natural", "constraint", constraint_natural)
-	instantiate_attribute(model, "String", "constraint", constraint_string)
-	instantiate_attribute(model, "Boolean", "constraint", constraint_boolean)
-
-	instantiate_node(model, "AttributeValue", "Boolean")
-
-	instantiate_link(model, "Inheritance", "", "Action", "PrimitiveType")
-	instantiate_node(model, "AttributeValue", "Statement")
-	instantiate_node(model, "AttributeValue", "Expression")
-	instantiate_node(model, "AttributeValue", "funcdef")
-	instantiate_node(model, "AttributeValue", "param")
-	instantiate_node(model, "AttributeValue", "if")
-	instantiate_node(model, "AttributeValue", "break")
-	instantiate_node(model, "AttributeValue", "while")
-	instantiate_node(model, "AttributeValue", "continue")
-	instantiate_node(model, "AttributeValue", "assign")
-	instantiate_node(model, "AttributeValue", "return")
-	instantiate_node(model, "AttributeValue", "output")
-	instantiate_node(model, "AttributeValue", "declare")
-	instantiate_node(model, "AttributeValue", "global")
-	instantiate_node(model, "AttributeValue", "access")
-	instantiate_node(model, "AttributeValue", "constant")
-	instantiate_node(model, "AttributeValue", "input")
-	instantiate_node(model, "AttributeValue", "resolve")
-	instantiate_node(model, "AttributeValue", "call")
+Void function initialize_AL(scd_location : String, export_location : String):
+	Element model
+	Element scd_model
+
+	scd_model = import_node(scd_location)
+	model = instantiate_model(scd_model)
+
+	instantiate_node(model, "Class", "Element")
+	instantiate_node(model, "Class", "Action")
+	instantiate_node(model, "Class", "Statement")
+	instantiate_node(model, "Class", "Expression")
+	instantiate_node(model, "Class", "funcdef")
+	instantiate_node(model, "Class", "param")
+	instantiate_node(model, "Class", "if")
+	instantiate_node(model, "Class", "break")
+	instantiate_node(model, "Class", "while")
+	instantiate_node(model, "Class", "continue")
+	instantiate_node(model, "Class", "assign")
+	instantiate_node(model, "Class", "return")
+	instantiate_node(model, "Class", "output")
+	instantiate_node(model, "Class", "declare")
+	instantiate_node(model, "Class", "global")
+	instantiate_node(model, "Class", "access")
+	instantiate_node(model, "Class", "constant")
+	instantiate_node(model, "Class", "input")
+	instantiate_node(model, "Class", "resolve")
+	instantiate_node(model, "Class", "call")
+	instantiate_node(model, "Class", "String")
+	instantiate_node(model, "SimpleAttribute", "StringAttr")
+	instantiate_node(model, "Class", "Initial")
+
+	instantiate_attribute(model, "Initial", "lower_cardinality", 1)
+	instantiate_attribute(model, "Initial", "upper_cardinality", 1)
+	instantiate_link(model, "Association", "initial_funcdef", "Initial", "Action")
+	instantiate_attribute(model, "initial_funcdef", "target_lower_cardinality", 1)
+	instantiate_attribute(model, "initial_funcdef", "target_upper_cardinality", 1)
 
 	instantiate_link(model, "Inheritance", "", "Action", "Element")
 	instantiate_link(model, "Inheritance", "", "funcdef", "Action")
@@ -349,61 +244,74 @@ Void function add_AL_to_MM(model : Element):
 	instantiate_link(model, "Inheritance", "", "break", "Statement")
 	instantiate_link(model, "Inheritance", "", "continue", "Statement")
 	instantiate_link(model, "Inheritance", "", "global", "Statement")
-	instantiate_link(model, "Inheritance", "", "declare", "Statement")
 	instantiate_link(model, "Inheritance", "", "while", "Statement")
 	instantiate_link(model, "Inheritance", "", "assign", "Statement")
 	instantiate_link(model, "Inheritance", "", "return", "Statement")
 	instantiate_link(model, "Inheritance", "", "call", "Statement")
+	instantiate_link(model, "Inheritance", "", "declare", "Statement")
+	instantiate_link(model, "Inheritance", "", "call", "Expression")
 	instantiate_link(model, "Inheritance", "", "access", "Expression")
 	instantiate_link(model, "Inheritance", "", "constant", "Expression")
 	instantiate_link(model, "Inheritance", "", "input", "Expression")
-
-	model_define_attribute(model, "Statement", "next", True, "Statement")
-	model_define_attribute(model, "if", "cond", False, "Expression")
-	model_define_attribute(model, "if", "then", False, "Statement")
-	model_define_attribute(model, "if", "else", True, "Statement")
-	model_define_attribute(model, "while", "cond", False, "Expression")
-	model_define_attribute(model, "while", "body", False, "Statement")
-	model_define_attribute(model, "assign", "var", False, "resolve")
-	model_define_attribute(model, "assign", "value", False, "Expression")
-	model_define_attribute(model, "break", "while", False, "while")
-	model_define_attribute(model, "continue", "while", False, "while")
-	model_define_attribute(model, "return", "value", True, "Expression")
-	model_define_attribute(model, "resolve", "var", False, "PrimitiveType")
-	model_define_attribute(model, "access", "var", False, "resolve")
-	model_define_attribute(model, "constant", "node", False, "PrimitiveType")
-	model_define_attribute(model, "output", "node", False, "Expression")
-	model_define_attribute(model, "global", "var", False, "String")
-	model_define_attribute(model, "param", "name", False, "String")
-	model_define_attribute(model, "param", "value", False, "Expression")
-	model_define_attribute(model, "param", "next_param", True, "param")
-	model_define_attribute(model, "funcdef", "body", False, "Statement")
-	model_define_attribute(model, "call", "func", False, "Statement")
-	model_define_attribute(model, "call", "params", True, "param")
-	model_define_attribute(model, "call", "last_param", True, "param")
-
-	model_define_attribute(model, "Statement_next", "name", False, "String")
-	model_define_attribute(model, "if_cond", "name", False, "String")
-	model_define_attribute(model, "if_then", "name", False, "String")
-	model_define_attribute(model, "if_else", "name", False, "String")
-	model_define_attribute(model, "while_cond", "name", False, "String")
-	model_define_attribute(model, "while_body", "name", False, "String")
-	model_define_attribute(model, "assign_var", "name", False, "String")
-	model_define_attribute(model, "assign_value", "name", False, "String")
-	model_define_attribute(model, "break_while", "name", False, "String")
-	model_define_attribute(model, "continue_while", "name", False, "String")
-	model_define_attribute(model, "return_value", "name", False, "String")
-	model_define_attribute(model, "resolve_var", "name", False, "String")
-	model_define_attribute(model, "access_var", "name", False, "String")
-	model_define_attribute(model, "constant_node", "name", False, "String")
-	model_define_attribute(model, "output_node", "name", False, "String")
-	model_define_attribute(model, "global_var", "name", False, "String")
-	model_define_attribute(model, "param_name", "name", False, "String")
-	model_define_attribute(model, "param_value", "name", False, "String")
-	model_define_attribute(model, "param_next_param", "name", False, "String")
-	model_define_attribute(model, "funcdef_body", "name", False, "String")
-	model_define_attribute(model, "call_func", "name", False, "String")
-	model_define_attribute(model, "call_params", "name", False, "String")
-	model_define_attribute(model, "call_last_param", "name", False, "String")
-
+	instantiate_link(model, "Inheritance", "", "String", "Element")
+
+	instantiate_link(model, "Association", "dict_link", "Action", "Element")
+	model_define_attribute(model, "dict_link", "name", False, "StringAttr")
+	instantiate_attribute(model, "dict_link", "target_upper_cardinality", 1)
+
+	instantiate_link(model, "Association", "Statement_next", "Statement", "Statement")
+	instantiate_link(model, "Association", "if_cond", "if", "Expression")
+	instantiate_link(model, "Association", "if_then", "if", "Statement")
+	instantiate_link(model, "Association", "if_else", "if", "Statement")
+	instantiate_link(model, "Association", "while_cond", "while", "Expression")
+	instantiate_link(model, "Association", "while_body", "while", "Statement")
+	instantiate_link(model, "Association", "assign_var", "assign", "resolve")
+	instantiate_link(model, "Association", "assign_value", "assign", "Expression")
+	instantiate_link(model, "Association", "break_while", "break", "while")
+	instantiate_link(model, "Association", "continue_while", "continue", "while")
+	instantiate_link(model, "Association", "return_value", "return", "Expression")
+	instantiate_link(model, "Association", "resolve_var", "resolve", "Element")
+	instantiate_link(model, "Association", "access_var", "access", "resolve")
+	instantiate_link(model, "Association", "constant_node", "constant", "Element")
+	instantiate_link(model, "Association", "output_node", "output", "Expression")
+	instantiate_link(model, "Association", "global_var", "global", "String")
+	instantiate_link(model, "Association", "param_name", "param", "String")
+	instantiate_link(model, "Association", "param_value", "param", "Expression")
+	instantiate_link(model, "Association", "param_next_param", "param", "param")
+	instantiate_link(model, "Association", "funcdef_body", "funcdef", "Statement")
+	instantiate_link(model, "Association", "call_func", "call", "Expression")
+	instantiate_link(model, "Association", "call_params", "call", "param")
+	instantiate_link(model, "Association", "call_last_param", "call", "param")
+	instantiate_link(model, "Inheritance", "", "Statement_next", "dict_link")
+	instantiate_link(model, "Inheritance", "", "if_cond", "dict_link")
+	instantiate_link(model, "Inheritance", "", "if_then", "dict_link")
+	instantiate_link(model, "Inheritance", "", "if_else", "dict_link")
+	instantiate_link(model, "Inheritance", "", "while_cond", "dict_link")
+	instantiate_link(model, "Inheritance", "", "while_body", "dict_link")
+	instantiate_link(model, "Inheritance", "", "assign_var", "dict_link")
+	instantiate_link(model, "Inheritance", "", "assign_value", "dict_link")
+	instantiate_link(model, "Inheritance", "", "break_while", "dict_link")
+	instantiate_link(model, "Inheritance", "", "continue_while", "dict_link")
+	instantiate_link(model, "Inheritance", "", "return_value", "dict_link")
+	instantiate_link(model, "Inheritance", "", "resolve_var", "dict_link")
+	instantiate_link(model, "Inheritance", "", "access_var", "dict_link")
+	instantiate_link(model, "Inheritance", "", "constant_node", "dict_link")
+	instantiate_link(model, "Inheritance", "", "output_node", "dict_link")
+	instantiate_link(model, "Inheritance", "", "global_var", "dict_link")
+	instantiate_link(model, "Inheritance", "", "param_name", "dict_link")
+	instantiate_link(model, "Inheritance", "", "param_value", "dict_link")
+	instantiate_link(model, "Inheritance", "", "param_next_param", "dict_link")
+	instantiate_link(model, "Inheritance", "", "funcdef_body", "dict_link")
+	instantiate_link(model, "Inheritance", "", "call_func", "dict_link")
+	instantiate_link(model, "Inheritance", "", "call_params", "dict_link")
+	instantiate_link(model, "Inheritance", "", "call_last_param", "dict_link")
+
+	instantiate_attribute(model, "Statement_next", "target_lower_cardinality", 1)
+	instantiate_attribute(model, "if_else", "target_lower_cardinality", 1)
+	instantiate_attribute(model, "return_value", "target_lower_cardinality", 1)
+	instantiate_attribute(model, "param_next_param", "target_lower_cardinality", 1)
+	instantiate_attribute(model, "call_params", "target_lower_cardinality", 1)
+	instantiate_attribute(model, "call_last_param", "target_lower_cardinality", 1)
+
+	export_node(export_location, model)
 	return !

+ 4 - 7
bootstrap/ramify.alc

@@ -24,13 +24,10 @@ Element function ramify(model : Element):
 	mm = new_model["metamodel"]["model"]
 
 	// Add in some primitives
-	instantiate_node(new_model, "SimplAttribute", "Natural")
-	instantiate_node(new_model, "SimplAttribute", "String")
-	instantiate_node(new_model, "SimplAttribute", "Boolean")
-	instantiate_node(new_model, "SimplAttribute", "Element")
-
-	// Add in the complete AL metamodel
-	add_AL_to_MM(new_model)
+	instantiate_node(new_model, "SimpleAttribute", "Natural")
+	instantiate_node(new_model, "SimpleAttribute", "String")
+	instantiate_node(new_model, "SimpleAttribute", "Boolean")
+	instantiate_node(new_model, "SimpleAttribute", "Element")
 
 	// Add some default elements
 	//	Class LHS_Root {

+ 5 - 5
integration/test_constructors_models.py

@@ -68,7 +68,7 @@ bottom = [
 bottom_link_al = [
         "model",
         "instantiate_node", "1", "ComplexAttribute", "ActionLanguage",
-        "instantiate_attribute", "1", "ActionLanguage", "type", "models/ActionLanguage",
+        "instantiate_attribute", "1", "ActionLanguage", "type", "models/ActionLanguage_new",
 
         "model_define_attribute", "1", "Element", "constraint", True, "ActionLanguage",
         "exit",
@@ -187,7 +187,7 @@ action_language = [
         "instantiate_attribute", "2", "call_params", "target_lower_cardinality", 1,
         "instantiate_attribute", "2", "call_last_param", "target_lower_cardinality", 1,
 
-        "export_node", "2", "models/ActionLanguage",
+        "export_node", "2", "models/ActionLanguage_new",
         "exit",
     ]
 
@@ -381,7 +381,7 @@ class TestConstructorsModels(unittest.TestCase):
         commands = bottom + action_language + bottom_link_al + \
                     add_constraint("2", "String", code_string) + \
                     add_constraint("2", "StringAttr", code_string) + \
-                    conformance_check("models/ActionLanguage") + ["return", False]
+                    conformance_check("models/ActionLanguage_new") + ["return", False]
         self.assertTrue(run_barebone(commands, ["OK"], 1))
 
     def test_constructors_constraints_scd(self):
@@ -392,7 +392,7 @@ class TestConstructorsModels(unittest.TestCase):
                     add_constraint("1", "String", code_string) + \
                     add_constraint("1", "Location", code_location) + \
                     add_constraint("1", "Boolean", code_boolean) + \
-                    add_constraint("1", "ActionLanguage", code_complex_attribute) + \
+                    add_constraint("1", "ActionLanguage_new", code_complex_attribute) + \
                     conformance_check("models/SimpleClassDiagrams_new") + ["return", False]
         self.assertTrue(run_barebone(commands, ["OK"], 1))
 
@@ -404,7 +404,7 @@ class TestConstructorsModels(unittest.TestCase):
                     add_constraint("1", "String", code_string) + \
                     add_constraint("1", "Location", code_location) + \
                     add_constraint("1", "Boolean", code_boolean) + \
-                    add_constraint("1", "ActionLanguage", code_complex_attribute) + \
+                    add_constraint("1", "ActionLanguage_new", code_complex_attribute) + \
                     instantiate_scd + \
                     add_constraint("3", "Natural", code_natural) + \
                     conformance_check("models/PetriNets_new") + \

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

@@ -2,4 +2,4 @@ Element function create_metamodels()
 Element function initialize_SCD(location : String)
 Element function initialize_PN(location_SCD : String, location_PN : String)
 Element function initialize_bottom(location : String)
-Void function add_AL_to_MM(model : Element)
+Element function initialize_AL(location_SCD : String, location_AL : String)