Kaynağa Gözat

Add bottom formalism (the nice way)

Yentl Van Tendeloo 8 yıl önce
ebeveyn
işleme
e4828596d2
2 değiştirilmiş dosya ile 8 ekleme ve 48 silme
  1. 8 0
      bootstrap/bottom.mvc
  2. 0 48
      bootstrap/metamodels.alt

+ 8 - 0
bootstrap/bottom.mvc

@@ -0,0 +1,8 @@
+import models/SimpleClassDiagrams as SCD
+
+SCD bottom{
+    Class Node {}
+    Association Edge : Node (Node, Node) {}
+}
+
+export bottom to models/bottom

+ 0 - 48
bootstrap/metamodels.alt

@@ -141,60 +141,12 @@ Element function initialize_SCD(location : String):
 
 	return scd!
 
-Element function initialize_PN(location_SCD : String, location_PN : String):
-	Element pn
-	Element scd
-
-	scd = import_node(location_SCD)
-
-	pn = instantiate_model(scd)
-	instantiate_node(pn, "Class", "Place")
-	instantiate_node(pn, "Class", "Transition")
-	instantiate_node(pn, "SimpleAttribute", "Natural")
-	instantiate_link(pn, "Association", "P2T", "Place", "Transition")
-	instantiate_link(pn, "Association", "T2P", "Transition", "Place")
-	model_define_attribute(pn, "Place", "tokens", False, "Natural")
-	model_define_attribute(pn, "P2T", "weight", False, "Natural")
-	model_define_attribute(pn, "T2P", "weight", False, "Natural")
-
-	// Add constraint on the Natural
-	instantiate_attribute_code(pn, "Natural", "constraint", constraint_Natural)
-
-	export_node(location_PN, pn)
-
-	return pn!
-
-Element function initialize_bottom(location_bottom : String):
-	Element ltm_bottom
-	ltm_bottom = instantiate_bottom()
-	model_add_node(ltm_bottom, "Node")
-	model_add_edge(ltm_bottom, "Edge", "Node", "Node")
-	model_add_edge(ltm_bottom, "inheritance", "Node", "Node")
-	model_add_edge(ltm_bottom, "__inh", "Edge", "Node")
-
-	retype_model(ltm_bottom, ltm_bottom)
-	retype(ltm_bottom, "Node", "Node")
-	retype(ltm_bottom, "Edge", "Edge")
-	retype(ltm_bottom, "inheritance", "Edge")
-	retype(ltm_bottom, "__inh", "inheritance")
-
-	export_node(location_bottom, ltm_bottom)
-
-	return ltm_bottom!
-
 Void function create_metamodels():
 	String location_SCD
 	String location_PN
-	String location_bottom
 
 	location_SCD = "models/SimpleClassDiagrams"
 	location_PN = "models/PetriNets"
-	location_bottom = "models/LTM_bottom"
-
-	if (element_eq(import_node("models/PetriNets"), read_root())):
-		initialize_PN(location_SCD, location_PN)
-	if (element_eq(import_node("models/LTM_bottom"), read_root())):
-		initialize_bottom(location_bottom)
 
 	return!