浏览代码

Merge branch 'yentl' into new-sccd

Yentl Van Tendeloo 9 年之前
父节点
当前提交
1e4cefffe7

+ 0 - 0
bootstrap/__init__.py


+ 290 - 289
bootstrap/bootstrap.py

@@ -1,321 +1,322 @@
 ### Configuration for creating the bootstrap model using conformance_bottom.
 
-root = ["__hierarchy"]
+def bootstrap():
+    root = ["__hierarchy"]
 
-user_data = [   "input",
-                "output",
-                "globals",
-                "frame",
-                ]
+    user_data = [   "input",
+                    "output",
+                    "globals",
+                    "frame",
+                    ]
 
-user_frame = [  "evalstack",
-                "symbols",
-                "returnvalue",
-                ]
+    user_frame = [  "evalstack",
+                    "symbols",
+                    "returnvalue",
+                    ]
 
-primitives = {  "integer_addition": ["Integer", "Integer", "Integer"],
-                "integer_subtraction": ["Integer", "Integer", "Integer"],
-                "integer_multiplication": ["Integer", "Integer", "Integer"],
-                "integer_division": ["Integer", "Integer", "Integer"],
-                "integer_gt": ["Boolean", "Integer", "Integer"],
-                "integer_gte": ["Boolean", "Integer", "Integer"],
-                "integer_lt": ["Boolean", "Integer", "Integer"],
-                "integer_lte": ["Boolean", "Integer", "Integer"],
-                "integer_neg": ["Integer", "Integer"],
-                "float_addition": ["Float", "Float", "Float"],
-                "float_subtraction": ["Float", "Float", "Float"],
-                "float_multiplication": ["Float", "Float", "Float"],
-                "float_division": ["Float", "Float", "Float"],
-                "float_gt": ["Boolean", "Float", "Float"],
-                "float_gte": ["Boolean", "Float", "Float"],
-                "float_lt": ["Boolean", "Float", "Float"],
-                "float_lte": ["Boolean", "Float", "Float"],
-                "float_neg": ["Float", "Float"],
-                "bool_and": ["Boolean", "Boolean", "Boolean"],
-                "bool_or": ["Boolean", "Boolean", "Boolean"],
-                "bool_not": ["Boolean", "Boolean"],
-                "string_join": ["String", "String", "String"],
-                "string_get": ["String", "String", "Integer"],
-                "string_substr": ["String", "String", "Integer", "Integer"],
-                "string_len": ["Integer", "String"],
-                "string_split": ["Element", "String", "String"],
-                "string_startswith": ["Boolean", "String", "String"],
-                "value_eq":  ["Boolean", "Element", "Element"],
-                "value_neq": ["Boolean", "Element", "Element"],
-                "cast_i2f": ["Float", "Integer"],
-                "cast_i2s": ["String", "Integer"],
-                "cast_i2b": ["Boolean", "Integer"],
-                "cast_f2i": ["Integer", "Float"],
-                "cast_f2b": ["Boolean", "Float"],
-                "cast_f2s": ["String", "Float"],
-                "cast_s2i": ["Integer", "String"],
-                "cast_s2f": ["Float", "String"],
-                "cast_s2b": ["Boolean", "String"],
-                "cast_b2i": ["Integer", "Boolean"],
-                "cast_b2f": ["Float", "Boolean"],
-                "cast_b2s": ["String", "Boolean"],
-                "cast_e2s": ["String", "Element"],
-                "cast_a2s": ["String", "Action"],
-                "cast_v2s": ["String", "Element"],
-                "cast_id2s": ["String", "Element"],
-                "list_read": ["Element", "Element", "Integer"],
-                "list_append": ["Element", "Element", "Element"],
-                "list_insert": ["Element", "Element", "Integer", "Element"],
-                "list_delete": ["Element", "Element", "Integer"],
-                "list_len": ["Integer", "Element"],
-                "dict_add": ["Element", "Element", "Element", "Element"],
-                "dict_delete": ["Element", "Element", "Element"],
-                "dict_read": ["Element", "Element", "Element"],
-                "dict_read_edge": ["Element", "Element", "Element"],
-                "dict_read_node": ["Element", "Element", "Element"],
-                "dict_len": ["Integer", "Element"],
-                "dict_in": ["Boolean", "Element", "Element"],
-                "dict_in_node": ["Boolean", "Element", "Element"],
-                "dict_keys": ["Element", "Element"],
-                "set_add": ["Element", "Element", "Element"],
-                "set_pop": ["Element", "Element"],
-                "set_remove": ["Element", "Element", "Element"],
-                "set_remove_node": ["Element", "Element", "Element"],
-                "set_in": ["Boolean", "Element", "Element"],
-                "set_in_node": ["Boolean", "Element", "Element"],
-                "is_physical_int": ["Boolean", "Element"],
-                "is_physical_boolean": ["Boolean", "Element"],
-                "is_physical_string": ["Boolean", "Element"],
-                "is_physical_action": ["Boolean", "Element"],
-                "is_physical_float": ["Boolean", "Element"],
-                "has_value": ["Boolean", "Element"],
-                "create_node": ["Element"],
-                "create_edge": ["Element", "Element", "Element"],
-                "create_value": ["Element", "Element"],
-                "is_edge": ["Boolean", "Element"],
-                "read_nr_out": ["Integer", "Element"],
-                "read_out": ["Element", "Element", "Integer"],
-                "read_nr_in": ["Integer", "Element"],
-                "read_in": ["Element", "Element", "Integer"],
-                "read_edge_src": ["Element", "Element"],
-                "read_edge_dst": ["Element", "Element"],
-                "delete_element": ["Element", "Element"],
-                "element_eq": ["Boolean", "Element", "Element"],
-                "element_neq": ["Boolean", "Element", "Element"],
-                "read_root": ["Element"],
-                "deserialize": ["Element", "String"],
-                "log": ["String", "String"],
-            }
+    primitives = {  "integer_addition": ["Integer", "Integer", "Integer"],
+                    "integer_subtraction": ["Integer", "Integer", "Integer"],
+                    "integer_multiplication": ["Integer", "Integer", "Integer"],
+                    "integer_division": ["Integer", "Integer", "Integer"],
+                    "integer_gt": ["Boolean", "Integer", "Integer"],
+                    "integer_gte": ["Boolean", "Integer", "Integer"],
+                    "integer_lt": ["Boolean", "Integer", "Integer"],
+                    "integer_lte": ["Boolean", "Integer", "Integer"],
+                    "integer_neg": ["Integer", "Integer"],
+                    "float_addition": ["Float", "Float", "Float"],
+                    "float_subtraction": ["Float", "Float", "Float"],
+                    "float_multiplication": ["Float", "Float", "Float"],
+                    "float_division": ["Float", "Float", "Float"],
+                    "float_gt": ["Boolean", "Float", "Float"],
+                    "float_gte": ["Boolean", "Float", "Float"],
+                    "float_lt": ["Boolean", "Float", "Float"],
+                    "float_lte": ["Boolean", "Float", "Float"],
+                    "float_neg": ["Float", "Float"],
+                    "bool_and": ["Boolean", "Boolean", "Boolean"],
+                    "bool_or": ["Boolean", "Boolean", "Boolean"],
+                    "bool_not": ["Boolean", "Boolean"],
+                    "string_join": ["String", "String", "String"],
+                    "string_get": ["String", "String", "Integer"],
+                    "string_substr": ["String", "String", "Integer", "Integer"],
+                    "string_len": ["Integer", "String"],
+                    "string_split": ["Element", "String", "String"],
+                    "string_startswith": ["Boolean", "String", "String"],
+                    "value_eq":  ["Boolean", "Element", "Element"],
+                    "value_neq": ["Boolean", "Element", "Element"],
+                    "cast_i2f": ["Float", "Integer"],
+                    "cast_i2s": ["String", "Integer"],
+                    "cast_i2b": ["Boolean", "Integer"],
+                    "cast_f2i": ["Integer", "Float"],
+                    "cast_f2b": ["Boolean", "Float"],
+                    "cast_f2s": ["String", "Float"],
+                    "cast_s2i": ["Integer", "String"],
+                    "cast_s2f": ["Float", "String"],
+                    "cast_s2b": ["Boolean", "String"],
+                    "cast_b2i": ["Integer", "Boolean"],
+                    "cast_b2f": ["Float", "Boolean"],
+                    "cast_b2s": ["String", "Boolean"],
+                    "cast_e2s": ["String", "Element"],
+                    "cast_a2s": ["String", "Action"],
+                    "cast_v2s": ["String", "Element"],
+                    "cast_id2s": ["String", "Element"],
+                    "list_read": ["Element", "Element", "Integer"],
+                    "list_append": ["Element", "Element", "Element"],
+                    "list_insert": ["Element", "Element", "Integer", "Element"],
+                    "list_delete": ["Element", "Element", "Integer"],
+                    "list_len": ["Integer", "Element"],
+                    "dict_add": ["Element", "Element", "Element", "Element"],
+                    "dict_delete": ["Element", "Element", "Element"],
+                    "dict_read": ["Element", "Element", "Element"],
+                    "dict_read_edge": ["Element", "Element", "Element"],
+                    "dict_read_node": ["Element", "Element", "Element"],
+                    "dict_len": ["Integer", "Element"],
+                    "dict_in": ["Boolean", "Element", "Element"],
+                    "dict_in_node": ["Boolean", "Element", "Element"],
+                    "dict_keys": ["Element", "Element"],
+                    "set_add": ["Element", "Element", "Element"],
+                    "set_pop": ["Element", "Element"],
+                    "set_remove": ["Element", "Element", "Element"],
+                    "set_remove_node": ["Element", "Element", "Element"],
+                    "set_in": ["Boolean", "Element", "Element"],
+                    "set_in_node": ["Boolean", "Element", "Element"],
+                    "is_physical_int": ["Boolean", "Element"],
+                    "is_physical_boolean": ["Boolean", "Element"],
+                    "is_physical_string": ["Boolean", "Element"],
+                    "is_physical_action": ["Boolean", "Element"],
+                    "is_physical_float": ["Boolean", "Element"],
+                    "has_value": ["Boolean", "Element"],
+                    "create_node": ["Element"],
+                    "create_edge": ["Element", "Element", "Element"],
+                    "create_value": ["Element", "Element"],
+                    "is_edge": ["Boolean", "Element"],
+                    "read_nr_out": ["Integer", "Element"],
+                    "read_out": ["Element", "Element", "Integer"],
+                    "read_nr_in": ["Integer", "Element"],
+                    "read_in": ["Element", "Element", "Integer"],
+                    "read_edge_src": ["Element", "Element"],
+                    "read_edge_dst": ["Element", "Element"],
+                    "delete_element": ["Element", "Element"],
+                    "element_eq": ["Boolean", "Element", "Element"],
+                    "element_neq": ["Boolean", "Element", "Element"],
+                    "read_root": ["Element"],
+                    "deserialize": ["Element", "String"],
+                    "log": ["String", "String"],
+                }
 
-initial_user = "user_manager"
-initial_user_code = \
-'''
-Element function read_root() = ?primitives/read_root
-Element function dict_read(a: Element, b: Element) = ?primitives/dict_read
-Element function create_node() = ?primitives/create_node
-Element function create_value(a: Element) = ?primitives/create_value
-Element function dict_add(a: Element, b: Element, c: Element) = ?primitives/dict_add
-Boolean function value_eq(a: String, b: String) = ?primitives/value_eq
-Boolean function delete_element(a: Element) = ?primitives/delete_element
-Boolean function bool_not(a: Boolean) = ?primitives/bool_not
-Boolean function dict_in(a: Element, b: Element) = ?primitives/dict_in
+    initial_user = "user_manager"
+    initial_user_code = \
+    '''
+    Element function read_root() = ?primitives/read_root
+    Element function dict_read(a: Element, b: Element) = ?primitives/dict_read
+    Element function create_node() = ?primitives/create_node
+    Element function create_value(a: Element) = ?primitives/create_value
+    Element function dict_add(a: Element, b: Element, c: Element) = ?primitives/dict_add
+    Boolean function value_eq(a: String, b: String) = ?primitives/value_eq
+    Boolean function delete_element(a: Element) = ?primitives/delete_element
+    Boolean function bool_not(a: Boolean) = ?primitives/bool_not
+    Boolean function dict_in(a: Element, b: Element) = ?primitives/dict_in
 
-Element function input()
+    Element function input()
 
-Void function __main():
-\tString username
-\tElement user_root
-\tElement user_frame
-\tElement output_value
-\tElement input_value
-\t
-\twhile (True):
-\t\tusername = input()
-\t\tif (value_eq(username, "__delete")):
-\t\t\tuser_root = dict_read(read_root(), input())
-\t\t\tdelete_element(user_root)
-\t\telse:
-\t\t\tif (bool_not(dict_in(read_root(), username))):
-\t\t\t\tuser_root = create_node()
-\t\t\t\tuser_frame = create_node()
-\t\t\t\toutput_value = create_node()
-\t\t\t\tinput_value = create_node()
-\t\t\t\tdict_add(user_root, "frame", user_frame)
-\t\t\t\tdict_add(user_root, "globals", create_node())
-\t\t\t\tdict_add(user_root, "output", output_value)
-\t\t\t\tdict_add(user_root, "last_output", output_value)
-\t\t\t\tdict_add(user_root, "input", input_value)
-\t\t\t\tdict_add(user_root, "last_input", input_value)
-\t\t\t\tdict_add(user_frame, "evalstack", create_node())
-\t\t\t\tdict_add(user_frame, "returnvalue", create_node())
-\t\t\t\tdict_add(user_frame, "phase", "init")
-\t\t\t\tdict_add(user_frame, "IP", dict_read(dict_read(read_root(), "__hierarchy"), "__IP"))
-\t\t\t\tdict_add(user_frame, "symbols", create_node())
-\t\t\t\t//Add this only at the end, as otherwise the user will already be detected
-\t\t\t\tdict_add(read_root(), username, user_root)
-'''
+    Void function __main():
+    \tString username
+    \tElement user_root
+    \tElement user_frame
+    \tElement output_value
+    \tElement input_value
+    \t
+    \twhile (True):
+    \t\tusername = input()
+    \t\tif (value_eq(username, "__delete")):
+    \t\t\tuser_root = dict_read(read_root(), input())
+    \t\t\tdelete_element(user_root)
+    \t\telse:
+    \t\t\tif (bool_not(dict_in(read_root(), username))):
+    \t\t\t\tuser_root = create_node()
+    \t\t\t\tuser_frame = create_node()
+    \t\t\t\toutput_value = create_node()
+    \t\t\t\tinput_value = create_node()
+    \t\t\t\tdict_add(user_root, "frame", user_frame)
+    \t\t\t\tdict_add(user_root, "globals", create_node())
+    \t\t\t\tdict_add(user_root, "output", output_value)
+    \t\t\t\tdict_add(user_root, "last_output", output_value)
+    \t\t\t\tdict_add(user_root, "input", input_value)
+    \t\t\t\tdict_add(user_root, "last_input", input_value)
+    \t\t\t\tdict_add(user_frame, "evalstack", create_node())
+    \t\t\t\tdict_add(user_frame, "returnvalue", create_node())
+    \t\t\t\tdict_add(user_frame, "phase", "init")
+    \t\t\t\tdict_add(user_frame, "IP", dict_read(dict_read(read_root(), "__hierarchy"), "__IP"))
+    \t\t\t\tdict_add(user_frame, "symbols", create_node())
+    \t\t\t\t//Add this only at the end, as otherwise the user will already be detected
+    \t\t\t\tdict_add(read_root(), username, user_root)
+    '''
 
-code_new_users = \
-'''
-Element main
+    code_new_users = \
+    '''
+    Element main
 
-// Do this only in the bootstrapper
-include "io.alh"
-include "primitives.alc"
-include "compilation_manager.alc"
-include "constructors.alc"
-include "object_operations.alc"
-include "library.alc"
-include "conformance_scd.alc"
-include "modelling.alc"
+    // Do this only in the bootstrapper
+    include "io.alh"
+    include "primitives.alc"
+    include "compilation_manager.alc"
+    include "constructors.alc"
+    include "object_operations.alc"
+    include "library.alc"
+    include "conformance_scd.alc"
+    include "modelling.alc"
 
-Void function __main():
-\tInteger interface
-\twhile (True):
-\t\tlog("User interface select")
-\t\tinterface = input()
-\t\tif (interface == 0):
-\t\t\tlog("DO deserialize")
-\t\t\texec(deserialize(input()))
-\t\telif (interface == 1):
-\t\t\tlog("User entered constructors")
-\t\t\texec(construct_unknown())
-\t\telif (interface == 2):
-\t\t\tlog("Done signalled")
-\t\t\toutput("DONE")
-\t\telif (interface == 3):
-\t\t\tcompilation_manager()
-\t\telse:
-\t\t\tlog("Unsupported interface!")
-'''
+    Void function __main():
+    \tInteger interface
+    \twhile (True):
+    \t\tlog("User interface select")
+    \t\tinterface = input()
+    \t\tif (interface == 0):
+    \t\t\tlog("DO deserialize")
+    \t\t\texec(deserialize(input()))
+    \t\telif (interface == 1):
+    \t\t\tlog("User entered constructors")
+    \t\t\texec(construct_unknown())
+    \t\telif (interface == 2):
+    \t\t\tlog("Done signalled")
+    \t\t\toutput("DONE")
+    \t\telif (interface == 3):
+    \t\t\tcompilation_manager()
+    \t\telse:
+    \t\t\tlog("Unsupported interface!")
+    '''
 
-### Actual script to generate the file
-import os
-import sys
+    ### Actual script to generate the file
+    import os
+    import sys
 
-class Writer(object):
-    def __init__(self, file_a, file_b):
-        self.file_a = file_a
-        self.file_b = file_b
+    class Writer(object):
+        def __init__(self, file_a, file_b):
+            self.file_a = file_a
+            self.file_b = file_b
 
-    def write(self, text, both=True):
-        self.file_a.write(text)
-        if both:
-            self.file_b.write(text)
+        def write(self, text, both=True):
+            self.file_a.write(text)
+            if both:
+                self.file_b.write(text)
 
-try:
-    with open("bootstrap.m", "w") as fa:
-        with open("minimal.m", "w") as fb:
-            f = Writer(fa, fb)
-            # Create the root first
-            f.write("Node root()\n")
+    try:
+        with open("bootstrap/bootstrap.m", "w") as fa:
+            with open("bootstrap/minimal.m", "w") as fb:
+                f = Writer(fa, fb)
+                # Create the root first
+                f.write("Node root()\n")
 
-            # Create all children of the root
-            for node in root:
-                f.write("Node %s()\n" % node)
-                f.write("Edge _%s(root, %s)\n" % (node, node))
-                f.write('Node __%s("%s")\n' % (node, node))
-                f.write("Edge ___%s(_%s, __%s)\n" % (node, node, node))
+                # Create all children of the root
+                for node in root:
+                    f.write("Node %s()\n" % node)
+                    f.write("Edge _%s(root, %s)\n" % (node, node))
+                    f.write('Node __%s("%s")\n' % (node, node))
+                    f.write("Edge ___%s(_%s, __%s)\n" % (node, node, node))
 
-            f.write("Node primitives()\n")
-            f.write("Edge _primitives(__hierarchy, primitives)\n")
-            f.write('Node __primitives("primitives")\n')
-            f.write("Edge ___primitives(_primitives, __primitives)\n")
+                f.write("Node primitives()\n")
+                f.write("Edge _primitives(__hierarchy, primitives)\n")
+                f.write('Node __primitives("primitives")\n')
+                f.write("Edge ___primitives(_primitives, __primitives)\n")
 
-            # Define all primitive functions
-            for function, parameters in primitives.iteritems():
-                #if parameters[0] == "Element":
-                #    f.write("Node _type_%s()\n" % function)
-                #else:
-                #    f.write("Node _type_%s(%s)\n" % (function, parameters[0]))
-                    
-                f.write("Node _func_signature_%s()\n" % function)
-                f.write("Node _func_params_%s()\n" % function)
-                f.write("Node _func_body_%s()\n" % function)
-                f.write("Edge _primitives_%s(primitives, _func_signature_%s)\n" % (function, function))
-                f.write('Node _name_%s("%s")\n' % (function, function))
-                f.write("Edge _primitives_name_%s(_primitives_%s, _name_%s)\n" % (function, function, function))
+                # Define all primitive functions
+                for function, parameters in primitives.iteritems():
+                    #if parameters[0] == "Element":
+                    #    f.write("Node _type_%s()\n" % function)
+                    #else:
+                    #    f.write("Node _type_%s(%s)\n" % (function, parameters[0]))
+                        
+                    f.write("Node _func_signature_%s()\n" % function)
+                    f.write("Node _func_params_%s()\n" % function)
+                    f.write("Node _func_body_%s()\n" % function)
+                    f.write("Edge _primitives_%s(primitives, _func_signature_%s)\n" % (function, function))
+                    f.write('Node _name_%s("%s")\n' % (function, function))
+                    f.write("Edge _primitives_name_%s(_primitives_%s, _name_%s)\n" % (function, function, function))
 
-                f.write('Node _body_%s("body")\n' % function)
-                f.write("Edge _signature_body_%s(_func_signature_%s, _func_body_%s)\n" % (function, function, function))
-                f.write("Edge _signature_body_str_%s(_signature_body_%s, _body_%s)\n" % (function, function, function))
+                    f.write('Node _body_%s("body")\n' % function)
+                    f.write("Edge _signature_body_%s(_func_signature_%s, _func_body_%s)\n" % (function, function, function))
+                    f.write("Edge _signature_body_str_%s(_signature_body_%s, _body_%s)\n" % (function, function, function))
 
-                f.write('Node _params_%s("params")\n' % function)
-                f.write("Edge _signature_params_%s(_func_signature_%s, _func_params_%s)\n" % (function, function, function))
-                f.write("Edge _signature_params_str_%s(_signature_params_%s, _params_%s)\n" % (function, function, function))
+                    f.write('Node _params_%s("params")\n' % function)
+                    f.write("Edge _signature_params_%s(_func_signature_%s, _func_params_%s)\n" % (function, function, function))
+                    f.write("Edge _signature_params_str_%s(_signature_params_%s, _params_%s)\n" % (function, function, function))
 
-                #f.write('Node _type_str_%s("type")\n' % function)
-                #f.write("Edge _signature_type_%s(_func_signature_%s, _type_%s)\n" % (function, function, function))
-                #f.write("Edge _signature_type_str_%s(_signature_type_%s, _type_str_%s)\n" % (function, function, function))
+                    #f.write('Node _type_str_%s("type")\n' % function)
+                    #f.write("Edge _signature_type_%s(_func_signature_%s, _type_%s)\n" % (function, function, function))
+                    #f.write("Edge _signature_type_str_%s(_signature_type_%s, _type_str_%s)\n" % (function, function, function))
 
-                parameter_names = "abcdefghijklmnopqrstuvwxyz"
-                for number, param in enumerate(parameters[1:]):
-                    param_encoding = "%s_%s" % (function, parameter_names[number])
-                    #if param == "Element":
-                    #    f.write("Node _type_%s()\n" % param_encoding)
-                    #else:
-                    #    f.write("Node _type_%s(%s)\n" % (param_encoding, param))
+                    parameter_names = "abcdefghijklmnopqrstuvwxyz"
+                    for number, param in enumerate(parameters[1:]):
+                        param_encoding = "%s_%s" % (function, parameter_names[number])
+                        #if param == "Element":
+                        #    f.write("Node _type_%s()\n" % param_encoding)
+                        #else:
+                        #    f.write("Node _type_%s(%s)\n" % (param_encoding, param))
 
-                    f.write("Node _func_params_%s()\n" % (param_encoding))
-                    f.write('Node _name_%s("%s")\n' % (param_encoding, parameter_names[number]))
-                    f.write("Edge _param_link_%s(_func_params_%s, _func_params_%s)\n" % (param_encoding, function, param_encoding))
-                    f.write("Edge _param_link_str_%s(_param_link_%s, _name_%s)\n" % (param_encoding, param_encoding, param_encoding))
-                    f.write('Node _name_str_%s("name")\n' % param_encoding)
-                    f.write("Edge _param_name_%s(_func_params_%s, _name_%s)\n" % (param_encoding, param_encoding, param_encoding))
-                    f.write("Edge _param_name_str_%s(_param_name_%s, _name_str_%s)\n" % (param_encoding, param_encoding, param_encoding))
-                    #f.write('Node _type_str_%s("type")\n' % param_encoding)
-                    #f.write("Edge _param_type_%s(_func_params_%s, _type_%s)\n" % (param_encoding, param_encoding, param_encoding))
-                    #f.write("Edge _param_type_str_%s(_param_type_%s, _type_str_%s)\n" % (param_encoding, param_encoding, param_encoding))
+                        f.write("Node _func_params_%s()\n" % (param_encoding))
+                        f.write('Node _name_%s("%s")\n' % (param_encoding, parameter_names[number]))
+                        f.write("Edge _param_link_%s(_func_params_%s, _func_params_%s)\n" % (param_encoding, function, param_encoding))
+                        f.write("Edge _param_link_str_%s(_param_link_%s, _name_%s)\n" % (param_encoding, param_encoding, param_encoding))
+                        f.write('Node _name_str_%s("name")\n' % param_encoding)
+                        f.write("Edge _param_name_%s(_func_params_%s, _name_%s)\n" % (param_encoding, param_encoding, param_encoding))
+                        f.write("Edge _param_name_str_%s(_param_name_%s, _name_str_%s)\n" % (param_encoding, param_encoding, param_encoding))
+                        #f.write('Node _type_str_%s("type")\n' % param_encoding)
+                        #f.write("Edge _param_type_%s(_func_params_%s, _type_%s)\n" % (param_encoding, param_encoding, param_encoding))
+                        #f.write("Edge _param_type_str_%s(_param_type_%s, _type_str_%s)\n" % (param_encoding, param_encoding, param_encoding))
 
-            # Create the initial user
-            f.write("Node user_root()\n")
+                # Create the initial user
+                f.write("Node user_root()\n")
 
-            for data in user_data:
-                f.write("Node user_%s()\n" % data)
-                f.write('Node ___user_%s("%s")\n' % (data, data))
-                f.write("Edge _user_%s(user_root, user_%s)\n" % (data, data))
-                f.write("Edge __user_%s(_user_%s, ___user_%s)\n" % (data, data, data))
+                for data in user_data:
+                    f.write("Node user_%s()\n" % data)
+                    f.write('Node ___user_%s("%s")\n' % (data, data))
+                    f.write("Edge _user_%s(user_root, user_%s)\n" % (data, data))
+                    f.write("Edge __user_%s(_user_%s, ___user_%s)\n" % (data, data, data))
 
-            for data in user_frame:
-                f.write("Node user_%s()\n" % data)
-                f.write('Node ___user_%s("%s")\n' % (data, data))
-                f.write("Edge _user_%s(user_frame, user_%s)\n" % (data, data))
-                f.write("Edge __user_%s(_user_%s, ___user_%s)\n" % (data, data, data))
+                for data in user_frame:
+                    f.write("Node user_%s()\n" % data)
+                    f.write('Node ___user_%s("%s")\n' % (data, data))
+                    f.write("Edge _user_%s(user_frame, user_%s)\n" % (data, data))
+                    f.write("Edge __user_%s(_user_%s, ___user_%s)\n" % (data, data, data))
 
-            # Add last_input and last_output links
-            for data in ["input", "output"]:
-                f.write('Node ___user_last_%s("last_%s")\n' % (data, data))
-                f.write("Edge _user_last_%s(user_root, user_%s)\n" % (data, data))
-                f.write("Edge __user_last_%s(_user_last_%s, ___user_last_%s)\n" % (data, data, data))
-                
-            # Bind user to the root
-            f.write('Node ___new_user("%s")\n' % initial_user)
-            f.write("Edge _new_user(root, user_root)\n")
-            f.write("Edge __new_user(_new_user, ___new_user)\n")
+                # Add last_input and last_output links
+                for data in ["input", "output"]:
+                    f.write('Node ___user_last_%s("last_%s")\n' % (data, data))
+                    f.write("Edge _user_last_%s(user_root, user_%s)\n" % (data, data))
+                    f.write("Edge __user_last_%s(_user_last_%s, ___user_last_%s)\n" % (data, data, data))
+                    
+                # Bind user to the root
+                f.write('Node ___new_user("%s")\n' % initial_user)
+                f.write("Edge _new_user(root, user_root)\n")
+                f.write("Edge __new_user(_new_user, ___new_user)\n")
 
-            def compile_code_AL(code, target):
-                import sys
-                sys.path.append("../interface/HUTN/")
-                from hutn_compiler.compiler import main as compile_code
+                def compile_code_AL(code, target):
+                    import sys
+                    sys.path.append("interface/HUTN/")
+                    from hutn_compiler.compiler import main as compile_code
 
-                with open("bootstrap.al", "w") as f:
-                    f.write(code)
-                code = compile_code("bootstrap.al", "../interface/HUTN/grammars/actionlanguage.g", "BS", ["--debug"])
-                os.remove("bootstrap.al")
-                return code.replace("auto_initial_IP", target)
+                    with open("bootstrap/bootstrap.al", "w") as f:
+                        f.write(code)
+                    code = compile_code("bootstrap/bootstrap.al", "interface/HUTN/grammars/actionlanguage.g", "BS", ["--debug"])
+                    os.remove("bootstrap/bootstrap.al")
+                    return code.replace("auto_initial_IP", target)
 
-            # Create code for initial user
-            f.write(compile_code_AL(initial_user_code, "IP_initial"), both=False)
-            f.write('Node _IP_str("IP")\n', both=False)
-            f.write("Edge _user_frame(user_frame, IP_initial)\n", both=False)
-            f.write("Edge __user_frame(_user_frame, _IP_str)\n", both=False)
+                # Create code for initial user
+                f.write(compile_code_AL(initial_user_code, "IP_initial"), both=False)
+                f.write('Node _IP_str("IP")\n', both=False)
+                f.write("Edge _user_frame(user_frame, IP_initial)\n", both=False)
+                f.write("Edge __user_frame(_user_frame, _IP_str)\n", both=False)
 
-            f.write('Node __phase("init")\n', both=False)
-            f.write('Node __phase_str("phase")\n', both=False)
-            f.write("Edge _user_phase(user_frame, __phase)\n", both=False)
-            f.write("Edge __user_phase(_user_phase, __phase_str)\n", both=False)
+                f.write('Node __phase("init")\n', both=False)
+                f.write('Node __phase_str("phase")\n', both=False)
+                f.write("Edge _user_phase(user_frame, __phase)\n", both=False)
+                f.write("Edge __user_phase(_user_phase, __phase_str)\n", both=False)
 
-            # Create code for new users to start at
-            f.write(compile_code_AL(code_new_users, "IP_new"), both=False)
-            f.write('Node __IP_str("__IP")\n', both=False)
-            f.write("Edge _user_IP(__hierarchy, IP_new)\n", both=False)
-            f.write("Edge __user_IP(_user_IP, __IP_str)\n", both=False)
-except:
-    os.remove("bootstrap.m")
-    os.remove("minimal.m")
-    raise
+                # Create code for new users to start at
+                f.write(compile_code_AL(code_new_users, "IP_new"), both=False)
+                f.write('Node __IP_str("__IP")\n', both=False)
+                f.write("Edge _user_IP(__hierarchy, IP_new)\n", both=False)
+                f.write("Edge __user_IP(_user_IP, __IP_str)\n", both=False)
+    except:
+        os.remove("bootstrap/bootstrap.m")
+        os.remove("bootstrap/minimal.m")
+        raise

+ 1 - 0
bootstrap/conformance_scd.alc

@@ -2,6 +2,7 @@ include "primitives.alh"
 include "library.alh"
 include "object_operations.alh"
 include "constructors.alh"
+include "modelling.alh"
 
 Boolean function is_direct_instance(model : Element, instance : Element, type : Element):
 	// Just check whether or not the type mapping specifies the type as the type of the instance

+ 0 - 16
compile.sh

@@ -1,16 +0,0 @@
-#!/bin/bash
-set -e
-
-source library.sh
-
-address=$1
-filename=`realpath $2`
-username=$3
-modulename=$4
-mode=$5
-
-# Leave this here too, as the call might crash early
-curl $address -d "op=set_input&username=user_manager&element_type=V&value=\"$username\"" -s -S >> /dev/null
-
-cd interface/HUTN
-${python} hutn_compiler/compiler.py $filename grammars/actionlanguage.g $mode $username $modulename $filename $address

+ 0 - 9
fix_linux.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-ln -s ../utils.py kernel/test/functions/utils.py
-ln -s ../utils.py kernel/test/instructions/utils.py
-ln -s ../utils.py kernel/test/primitives/utils.py
-ln -s ../utils.py kernel/test/rules/utils.py
-
-ln -s ../util.py interface/HUTN/test/grammar_action_language/util.py
-ln -s ../util.py interface/HUTN/test/graph_compilation_action_language/util.py
-ln -s ../util.py interface/HUTN/test/constructor_compilation_action_language/util.py

+ 0 - 7
fix_windows.bat

@@ -1,7 +0,0 @@
-copy kernel\test\utils.py kernel\test\functions\utils.py
-copy kernel\test\utils.py kernel\test\instructions\utils.py
-copy kernel\test\utils.py kernel\test\primitives\utils.py
-copy kernel\test\utils.py kernel\test\rules\utils.py
-
-copy interface\HUTN\test\util.py interface\HUTN\test\grammar_action_language\util.py
-copy interface\HUTN\test\util.py interface\HUTN\test\graph_compilation_action_language\util.py

+ 0 - 2
flush_compiler_caches.sh

@@ -1,2 +0,0 @@
-#!/bin/bash
-find . -type f -name '*.pickle' -delete

+ 0 - 3
generate_bootstrap.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-cd bootstrap
-pypy bootstrap.py

+ 2 - 2
hybrid_server/classes/mvkcontroller.xml

@@ -168,7 +168,7 @@
                         </script>
                     </onentry>
 
-                    <transition cond="self.destination is not None" after="0.0001" target=".">
+                    <transition cond="self.destination is not None" after="0" target=".">
                         <raise event="HTTP_input" scope="narrow" target="'to_mvi/%s' % self.destination">
                             <parameter expr="self.value"/>
                         </raise>
@@ -176,7 +176,7 @@
 
                     <transition cond="self.timeout and self.destination is None" after="0.1" target="."/>
 
-                    <transition cond="not self.timeout and self.destination is None" after="0.0001" target="."/>
+                    <transition cond="not self.timeout and self.destination is None" after="0" target="."/>
                 </state>
             </state>
 

+ 7 - 7
integration/utils.py

@@ -42,12 +42,11 @@ def serialize(value):
         return str(value)
 
 def execute(scriptname, parameters=[], wait=False):
-    if os.name == "nt":
-        command = ["%s.bat" % scriptname] + parameters
-    elif os.name == "posix":
-        command = ["./%s.sh" % scriptname] + parameters
-    else:
-        raise Exception("Unknown OS: " + str(os.name))
+    if os.name not in ["nt", "posix"]:
+        # Stop now, as we would have no clue on how to kill its subtree
+        raise Exception("Unknown OS version: " + str(os.name))
+
+    command = [sys.executable, "scripts/%s.py" % scriptname] + parameters
 
     if wait:
         return subprocess.call(command, shell=False)
@@ -86,7 +85,8 @@ def compile_file(address, mod_filename, filename, mode, proc):
                     kill(proc2)
                     print("Compilation timeout expired!")
                     return False
-            if proc2.returncode not in [7, 56]:
+
+            if proc2.returncode != 2:
                 break
 
         # Make sure everything stopped correctly

+ 4 - 3
interface/HUTN/hutn_compiler/constructors_object_visitor.py

@@ -30,13 +30,14 @@ class ConstructorsObjectVisitor(ConstructorsVisitor):
 
         v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
         v = v.split("=", 2)[2]
+        simple_filename = self.real_file.rsplit("/")[-1]
         if v == "None":
             # Not defined, so recompile
-            print("[COMPILE] %s" % self.real_file.rsplit("/", 1)[1])
+            print("[COMPILE] %s" % simple_filename)
         else:
             # Is defined already, so let's compare hashes
             if v != self.hash_file:
-                print("[COMPILE] %s" % self.real_file.rsplit("/", 1)[1])
+                print("[COMPILE] %s" % simple_filename)
 
                 # Remove in Modelverse and recompile
                 urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": '3', "username": self.username}))).read()
@@ -45,7 +46,7 @@ class ConstructorsObjectVisitor(ConstructorsVisitor):
             else:
                 self.visit = lambda i: i
                 self.dump = lambda: True
-                print("[CACHED] %s" % self.real_file.rsplit("/", 1)[1])
+                print("[CACHED] %s" % simple_filename)
 
     def dump(self):
         v = ConstructorsVisitor.dump(self)

+ 15 - 14
interface/HUTN/hutn_compiler/linker.py

@@ -84,19 +84,20 @@ def link(address, username, objects, fast):
     import json
     urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "data": json.dumps(commands), "username": username}))).read()
 
-if len(sys.argv) == 1:
-    print("No username defined")
-else:
-    address = sys.argv[1]
-    username = sys.argv[2]
-    objects = set(sys.argv[3:])
-    if "--fast" in objects:
-        objects.remove("--fast")
-        fast = True
+if __name__ == "__main__":
+    if len(sys.argv) == 1:
+        print("No username defined")
     else:
-        fast = False
+        address = sys.argv[1]
+        username = sys.argv[2]
+        objects = set(sys.argv[3:])
+        if "--fast" in objects:
+            objects.remove("--fast")
+            fast = True
+        else:
+            fast = False
 
-    if objects:
-        link(address, username, objects, fast)
-    else:
-        print("No files to link defined")
+        if objects:
+            link(address, username, objects, fast)
+        else:
+            print("No files to link defined")

+ 4 - 3
interface/HUTN/hutn_compiler/primitives_object_visitor.py

@@ -29,13 +29,14 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
 
         v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
         v = v.split("=", 2)[2]
+        simple_filename = self.real_file.rsplit("/")[-1]
         if v == "None":
             # Not defined, so recompile
-            print("[COMPILE] %s" % self.real_file.rsplit("/", 1)[1])
+            print("[COMPILE] %s" % simple_filename)
         else:
             # Is defined already, so let's compare hashes
             if v != self.hash_file:
-                print("[COMPILE] %s" % self.real_file.rsplit("/", 1)[1])
+                print("[COMPILE] %s" % simple_filename)
 
                 # Remove in Modelverse and recompile
                 urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": '3', "username": self.username}))).read()
@@ -44,7 +45,7 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
             else:
                 self.visit = lambda i: i
                 self.dump = lambda: True
-                print("[CACHED] %s" % self.real_file.rsplit("/", 1)[1])
+                print("[CACHED] %s" % simple_filename)
 
     def dump(self):
         v = PrimitivesVisitor.dump(self)

+ 0 - 1
interface/HUTN/test/constructor_compilation_action_language/test_real.py

@@ -1,6 +1,5 @@
 import unittest
 import util
-from postproc import postproc
 
 from hutn_compiler.compiler import main
 import json

+ 0 - 1
interface/HUTN/test/constructor_compilation_action_language/test_simple.py

@@ -1,6 +1,5 @@
 import unittest
 import util
-from postproc import postproc
 
 from hutn_compiler.compiler import main
 import json

+ 1 - 1
kernel/mvk_server/server.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe and Joeri Exelmans
 
-Date:   Tue Mar 15 15:48:55 2016
+Date:   Mon Aug 08 08:28:10 2016
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server

+ 0 - 5
library.sh

@@ -1,5 +0,0 @@
-if type "pypy" > /dev/null; then
-    python="pypy"
-else
-    python="python"
-fi

+ 0 - 10
link_and_load.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-set -e
-address=$1
-username=$2
-shift
-shift
-
-curl $address -d "op=set_input&username=user_manager&element_type=V&value=\"$username\"" -s -S >> /dev/null
-
-python interface/HUTN/hutn_compiler/linker.py $address $username "$@"

+ 0 - 14
make_all.sh

@@ -1,14 +0,0 @@
-#!/bin/bash
-set -e
-
-username=$1
-address=$2
-shift
-shift
-
-for f in "$@"
-do
-    ./compile.sh $address $f $RANDOM $f CO
-done
-
-./link_and_load.sh $address $username "$@"

+ 0 - 19
make_parallel.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-set -e
-
-username=$1
-address=$2
-shift
-shift
-
-for f in "$@"
-do
-    ./compile.sh $address $f $RANDOM $f PO --debug &
-done
-
-for job in `jobs -p`
-do
-    wait $job || let "FAIL+=1"
-done
-
-./link_and_load.sh $address $username "$@" --fast

+ 0 - 10
run_local_modelverse.bat

@@ -1,10 +0,0 @@
-@echo off
-set filename=%~f1
-echo Compiling MvK server
-cd kernel\mvk_server
-python python_sccd_compiler\sccdc.py -p threads server.xml
-
-echo Starting MvK with file %filename%
-python run_mvk_server.py %filename%
-cd ..\..
-pause

+ 0 - 13
run_local_modelverse.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-set -e
-trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
-
-port=$1
-source library.sh
-
-echo "Compiling MvK server"
-cd hybrid_server
-${python} -m sccd.compiler.sccdc -p threads server.xml
-
-echo "Starting MvK"
-${python} run_mvk_server.py $port

+ 0 - 22
run_modelverse.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-set -e
-trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
-
-filename=`realpath $1`
-
-echo "Compiling MvS server"
-cd state/mvs_server
-python python_sccd_compiler/sccdc.py -p threads server.xml
-
-echo "Starting MvS"
-xterm -e "python run_mvs_server.py $filename || read -p \"Press any key to continue\"" &
-
-echo "Waiting for boot-up"
-sleep 1
-
-echo "Compiling MvK server"
-cd ../../kernel/mvk_server
-python python_sccd_compiler/sccdc.py -p threads server.xml
-
-echo "Starting MvK"
-xterm -e "python run_mvk_server.py || read -p \"Press any key to continue\""

+ 0 - 16
run_tests.bat

@@ -1,16 +0,0 @@
-@echo off
-
-cd state
-py.test --timeout=5
-cd ..
-
-cd kernel
-py.test --timeout=10
-cd ..
-
-cd interface/HUTN
-py.test --timeout=10
-cd ../..
-
-py.test --timeout=60 integration
-pause

+ 0 - 22
run_tests.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-set -e
-
-./flush_compiler_caches.sh
-
-cd state
-py.test
-cd ..
-
-./generate_bootstrap.sh
-
-cd kernel
-py.test
-cd ..
-
-./flush_compiler_caches.sh
-
-cd interface/HUTN
-py.test
-cd ../..
-
-py.test integration

+ 24 - 0
scripts/compile.py

@@ -0,0 +1,24 @@
+import sys
+import os
+import urllib2
+import subprocess
+
+def do_compile(address, filename, username, modulename, mode):
+    filename = os.path.realpath(filename)
+    try:
+        urllib2.urlopen(urllib2.Request(address, 'op=set_input&username=user_manager&element_type=V&value="%s"' % username)).read()
+        subprocess.check_call([sys.executable, "hutn_compiler/compiler.py", filename, "grammars/actionlanguage.g", mode, username, modulename, filename, address], cwd="interface/HUTN")
+    except urllib2.URLError:
+        return 2
+    except:
+        return 1
+    return 0
+
+if __name__ == "__main__":
+    address = sys.argv[1]
+    filename = sys.argv[2]
+    username = sys.argv[3]
+    modulename = sys.argv[4]
+    mode = sys.argv[5]
+    
+    sys.exit(do_compile(address, filename, username, modulename, mode))

+ 10 - 0
scripts/fix_files.py

@@ -0,0 +1,10 @@
+import shutil
+
+shutil.copy("kernel/test/utils.py", "kernel/test/functions/utils.py")
+shutil.copy("kernel/test/utils.py", "kernel/test/instructions/utils.py")
+shutil.copy("kernel/test/utils.py", "kernel/test/primitives/utils.py")
+shutil.copy("kernel/test/utils.py", "kernel/test/rules/utils.py")
+
+shutil.copy("interface/HUTN/test/util.py", "interface/HUTN/test/grammar_action_language/util.py")
+shutil.copy("interface/HUTN/test/util.py", "interface/HUTN/test/graph_compilation_action_language/util.py")
+shutil.copy("interface/HUTN/test/util.py", "interface/HUTN/test/constructor_compilation_action_language/util.py")

+ 11 - 0
scripts/flush_compiler_caches.py

@@ -0,0 +1,11 @@
+def flush():
+    import os, re, os.path
+    pattern = "^.*\.pickle$"
+    mypath = "."
+    for root, dirs, files in os.walk(mypath):
+        for file in filter(lambda x: re.match(pattern, x), files):
+            print("Remove: %s" % os.path.join(root, file))
+            os.remove(os.path.join(root, file))
+
+if __name__ == "__main__":
+    flush()

+ 7 - 0
scripts/generate_bootstrap.py

@@ -0,0 +1,7 @@
+import sys
+sys.path.append(".")
+
+from bootstrap.bootstrap import bootstrap
+
+if __name__ == "__main__":
+    bootstrap()

+ 17 - 0
scripts/link_and_load.py

@@ -0,0 +1,17 @@
+import sys
+import urllib2
+
+def link_and_load(address, username, objs, fast):
+    urllib2.urlopen(urllib2.Request(address, 'op=set_input&username=user_manager&element_type=V&value="%s"' % username)).read()
+
+    sys.path.append("interface/HUTN")
+    from hutn_compiler.linker import link
+    link(address, username, objs, fast)
+
+if __name__ == "__main__":
+    address = sys.argv[1]
+    username = sys.argv[2]
+    objs = [arg for arg in sys.argv[3:] if arg != "--fast"]
+    fast = "--fast" in sys.argv[3:]
+
+    link_and_load(address, username, objs, fast)

+ 15 - 0
scripts/make_all.py

@@ -0,0 +1,15 @@
+import sys
+
+from compile import do_compile
+from link_and_load import link_and_load
+import random
+import glob
+
+address = sys.argv[1]
+username = sys.argv[2]
+files = [a.replace("\\", "/") for a in sum([glob.glob(f) for f in sys.argv[3:]], [])]
+
+for f in files:
+    do_compile(address, f, str(random.random()), f, "CO")
+
+link_and_load(address, username, files, False)

+ 20 - 0
scripts/make_parallel.py

@@ -0,0 +1,20 @@
+import sys
+
+from compile import do_compile
+from link_and_load import link_and_load
+import random
+import multiprocessing
+import glob
+
+address = sys.argv[1]
+username = sys.argv[2]
+files = [a.replace("\\", "/") for a in sum([glob.glob(f) for f in sys.argv[3:]], [])]
+
+def do_compile_wrapper(filename):
+    do_compile(address, filename, str(random.random()), filename, "PO")
+
+if __name__ == "__main__":
+    p = multiprocessing.Pool(multiprocessing.cpu_count())
+    p.map(do_compile_wrapper, files)
+
+    link_and_load(address, username, files, True)

+ 0 - 14
prompt.py

@@ -10,20 +10,6 @@ def local_print(string):
 def remote_print(string):
     print("\033[94m%s\033[0m" % string)
 
-def execute(scriptname, parameters=[], wait=False):
-    if os.name == "nt":
-        command = ["%s.bat" % scriptname] + parameters
-    elif os.name == "posix":
-        command = ["./%s.sh" % scriptname] + parameters
-    else:
-        raise Exception("Unknown OS: " + str(os.name))
-
-    if wait:
-        return subprocess.call(command, shell=False)
-        return subprocess.call(command, shell=False, stdout=open('/tmp/output', 'w'), stderr=open('/tmp/output', 'w'))
-    else:
-        return subprocess.Popen(command, shell=False, stdout=open('/tmp/output', 'w'))
-
 local_print("Welcome to the local shell!")
 local_print("Please specify Modelverse location (default: localhost:8001)")
 

+ 6 - 0
scripts/run_local_modelverse.py

@@ -0,0 +1,6 @@
+import subprocess
+import sys
+
+# sys.executable to use the same Python interpreter used to invoke this command
+subprocess.check_call([sys.executable, "-m", "sccd.compiler.sccdc", "-p", "threads", "server.xml"], cwd="hybrid_server")
+subprocess.call([sys.executable, "run_mvk_server.py", sys.argv[1]], cwd="hybrid_server")

+ 18 - 0
scripts/run_tests.py

@@ -0,0 +1,18 @@
+from flush_compiler_caches import flush
+from generate_bootstrap import bootstrap
+import subprocess
+import sys
+
+flush()
+
+subprocess.check_call([sys.executable, "-m", "pytest"], cwd="state")
+
+bootstrap()
+
+subprocess.check_call([sys.executable, "-m", "pytest"], cwd="kernel")
+
+flush()
+
+subprocess.check_call([sys.executable, "-m", "pytest"], cwd="interface/HUTN")
+
+subprocess.check_call([sys.executable, "-m", "pytest", "integration"])

+ 0 - 9
unfix_linux.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-rm kernel/test/functions/utils.py
-rm kernel/test/instructions/utils.py
-rm kernel/test/primitives/utils.py
-rm kernel/test/rules/utils.py
-
-rm interface/HUTN/test/grammar_action_language/util.py
-rm interface/HUTN/test/graph_compilation_action_language/util.py
-rm interface/HUTN/test/pretty_printer/util.py