Browse Source

Fixes to make everything work

Yentl Van Tendeloo 7 years ago
parent
commit
00b48a6948

+ 2 - 1
bootstrap/library.alc

@@ -1,6 +1,7 @@
 include "primitives.alh"
 
 Element function export_node(model_name : String, model_reference : Element):
+	log("Export to " + model_name)
 	Element splitted
 	splitted = string_split(model_name, "/")
 	Integer length
@@ -23,7 +24,7 @@ Element function export_node(model_name : String, model_reference : Element):
 	if (bool_not(dict_in(current, splitted[length]))):
 		dict_add(current, splitted[length], model_reference)
 	else:
-		log("Could not export to that location: already in use!")
+		log(("Could not export to " + model_name) + ": already in use!")
 
 	return model_reference!
 

+ 0 - 9
core/core_algorithm.alc

@@ -16,15 +16,6 @@ Element core = ?
 String core_location = "models/CoreFormalism"
 String core_model_location = "core"
 
-Void function dict_overwrite(d : Element, key : Element, value : Element):
-	if (dict_in(d, key)):
-		dict_delete(d, key)
-	if (dict_in_node(d, key)):
-		dict_delete_node(d, key)
-	dict_add(d, key, value)
-
-	return !
-
 Void function main():
 	// Initialize the Core Formalism
 	String core_model

+ 0 - 9
integration/code/cbd_semantics.alc

@@ -135,15 +135,6 @@ Element function create_schedule(model : Element):
 
 	return values["SCC"]!
 
-Void function dict_overwrite(d : Element, key : Element, value : Element):
-	if (dict_in(d, key)):
-		dict_delete(d, key)
-	if (dict_in_node(d, key)):
-		dict_delete_node(d, key)
-	dict_add(d, key, value)
-
-	return !
-
 Integer function min(a : Integer, b : Integer):
 	if (a < b):
 		return a!

+ 3 - 0
integration/code/reachability_graph.mvc

@@ -3,6 +3,9 @@ include "object_operations.alh"
 include "modelling.alh"
 
 SimpleClassDiagrams ReachabilityGraph {
+    SimpleAttribute String {}
+    SimpleAttribute Natural {}
+
     Class State {}
     Class Place {
         name : String

+ 1 - 0
integration/code/reachabilitygraph_print.mvc

@@ -1,5 +1,6 @@
 include "primitives.alh"
 include "modelling.alh"
+include "object_operations.alh"
 
 ReachabilityGraph_RAM reachabilitygraph_print {
     Composite schedule {

+ 4 - 0
integration/test_mvc.py

@@ -1901,10 +1901,12 @@ class TestModelverseCore(unittest.TestCase):
                 "",
                 "ReachabilityGraph_RAM",
                 "transformation_add_MT",
+                    "PetriNet_RAM",
                     "",
                     "PetriNet",
                     "",
                     "initialize_PN",
+                    ] + get_model_constructor(open("integration/code/initialize_PN.mvc", "r").read()) + [
                 "transformation_add_MANUAL",
                     "PetriNet",
                     "",
@@ -1919,10 +1921,12 @@ class TestModelverseCore(unittest.TestCase):
                     "reachability",
                     ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
                 "transformation_add_MT",
+                    "ReachabilityGraph_RAM",
                     "ReachabilityGraph",
                     "",
                     "",
                     "reachability_print",
+                    ] + get_model_constructor(open("integration/code/reachabilitygraph_print.mvc", "r").read()) + [
                 "model_add",
                     "ProcessModel",
                     "pn_reachability",

+ 0 - 9
performance/code/matrix.alc

@@ -4,15 +4,6 @@ include "random.alh"
 Float function v2f(i : Element):
 	return cast_s2f(cast_v2s(i))!
 
-Void function dict_overwrite(d : Element, key : Element, value : Element):
-	if (dict_in(d, key)):
-		dict_delete(d, key)
-	if (dict_in_node(d, key)):
-		dict_delete_node(d, key)
-	dict_add(d, key, value)
-
-	return !
-
 Element function create_random_matrix(n : Integer):
 	Element m
 	Integer i