Procházet zdrojové kódy

Make pn_interface compile everything again without errors

Yentl Van Tendeloo před 9 roky
rodič
revize
a4dee76d05

+ 4 - 3
bootstrap/compilation_manager.alc

@@ -1,5 +1,6 @@
 include "primitives.alh"
 include "constructors.alh"
+include "conformance_scd.alh"
 
 Element function compilation_manager():
 	String operation
@@ -10,11 +11,11 @@ Element function compilation_manager():
 
 	mv_root = read_root()
 
-	if (dict_in(mv_root["__hierarchy"], "objects")):
-		root = mv_root["__hierarchy"]["objects"]
+	if (dict_in(mv_root["__hierarchy"], "models")):
+		root = mv_root["__hierarchy"]["models"]
 	else:
 		root = create_node()
-		dict_add(mv_root["__hierarchy"], "objects", root)
+		dict_add(mv_root["__hierarchy"], "models", root)
 
 	operation = input()
 	if (operation == "upload"):

+ 3 - 0
bootstrap/primitives.alc

@@ -163,3 +163,6 @@ Element function resolve(name : String):
 	user_root = read_userroot()
 	user_root = user_root["globals"][name]["value"]
 	return user_root
+
+Integer function integer_modulo(a : Integer, b : Integer):
+	return a - b * (a / b)

+ 4 - 2
bootstrap/random.alc

@@ -1,3 +1,5 @@
+include "primitives.alh"
+
 Integer seed = 1
 
 Float function random():
@@ -12,13 +14,13 @@ Float function random():
 	m = 4294967296
 
 	// Do the generation and update the seed
-	seed = integer_mod(a * seed + c, m)
+	seed = integer_modulo(a * seed + c, m)
 
 	// The seed is the new value
 	return seed / m
 
 Integer function random_interval(a : Integer, b : Integer):
-	return cast_f2i(rand * (b - a) + a)
+	return cast_f2i(random() * (b - a) + a)
 
 Element function random_choice(list : Element):
 	return read_edge_dst(read_out(list, random_interval(0, read_nr_out(list) - 1)))

+ 1 - 0
interface/HUTN/includes/conformance_scd.alh

@@ -4,3 +4,4 @@ Boolean function is_nominal_subtype(metamodel : Element, subclass : String, supe
 Element function conformance_scd(model: Element)
 Element function set_model_constraints(model: Element, func: Element)
 Element function generate_bottom_type_mapping(model: Element)
+Element function set_copy(a : Element)

+ 2 - 0
interface/HUTN/includes/primitives.alh

@@ -54,6 +54,7 @@ Integer function integer_addition(a: Integer, b: Integer)
 Integer function integer_subtraction(a: Integer, b: Integer) 
 Integer function integer_multiplication(a: Integer, b: Integer) 
 Integer function integer_division(a: Integer, b: Integer) 
+Integer function integer_modulo(a: Integer, b: Integer) 
 Boolean function integer_gt(a: Integer, b: Integer) 
 Boolean function integer_gte(a: Integer, b: Integer) 
 Boolean function integer_lt(a: Integer, b: Integer) 
@@ -90,3 +91,4 @@ Boolean function is_physical_boolean(a : Element)
 Boolean function has_value(a : Element)
 
 Element function exec(a : Element)
+Element function resolve(var_name : String)

+ 1 - 1
scripts/make_parallel.py

@@ -22,4 +22,4 @@ if __name__ == "__main__":
     p = multiprocessing.Pool(multiprocessing.cpu_count() * 2)
     p.map(do_compile_wrapper, files)
 
-    link_and_load(address, username, files, False)
+    link_and_load(address, username, files)