Browse Source

Naively changed user to task in all files

Yentl Van Tendeloo 4 years ago
parent
commit
b2f0bc0469
96 changed files with 1983 additions and 2030 deletions
  1. 4 5
      README.md
  2. 36 36
      bootstrap/bootstrap.py
  3. 0 54
      bootstrap/ftg.alc
  4. 3 3
      bootstrap/initial_code_manager.alb
  5. 3 3
      bootstrap/initial_code_user.alb
  6. 6 6
      bootstrap/primitives.alc
  7. 1 1
      bootstrap/user_interface.alc
  8. 32 0
      bootstrap/task_manager.alc
  9. 0 32
      bootstrap/user_manager.alc
  10. 8 0
      core/core_algorithm.alc
  11. 29 29
      hybrid_server/classes/mvkcontroller.xml
  12. 13 13
      integration/utils.py
  13. 25 25
      interface/CBD/main.py
  14. 32 32
      interface/FSA/main.py
  15. 7 7
      interface/HUTN/hutn_compiler/constructors_object_visitor.py
  16. 7 7
      interface/HUTN/hutn_compiler/linker.py
  17. 3 3
      interface/HUTN/hutn_compiler/model_object_visitor.py
  18. 5 5
      interface/HUTN/hutn_compiler/primitives_object_visitor.py
  19. 1 1
      interface/HUTN/includes/primitives.alh
  20. 1 0
      interface/HUTN/includes/task_interface.alh
  21. 1 0
      interface/HUTN/includes/task_manager.alh
  22. 0 1
      interface/HUTN/includes/user_interface.alh
  23. 0 1
      interface/HUTN/includes/user_manager.alh
  24. 3 3
      kernel/modelverse_jit/intrinsics.py
  25. 35 35
      kernel/modelverse_jit/jit.py
  26. 12 12
      kernel/modelverse_jit/runtime.py
  27. 1 1
      kernel/modelverse_kernel/compiled.py
  28. 299 299
      kernel/modelverse_kernel/legacy.py
  29. 318 318
      kernel/modelverse_kernel/main.py
  30. 2 2
      kernel/modelverse_kernel/primitives.py
  31. 6 6
      kernel/mvk_server/classes/executor.xml
  32. 46 46
      kernel/mvk_server/classes/mvkcontroller.xml
  33. 7 7
      kernel/mvk_server/classes/user_statechart.xml
  34. 1 1
      kernel/mvk_server/server.xml
  35. 3 3
      kernel/test/functions/factorial.eps
  36. 3 3
      kernel/test/functions/fib_naive.eps
  37. 3 3
      kernel/test/functions/test_factorial.py
  38. 3 3
      kernel/test/functions/test_fib_naive.py
  39. 31 31
      kernel/test/functions/utils.py
  40. 9 9
      kernel/test/instructions/test_instruction_access.py
  41. 10 10
      kernel/test/instructions/test_instruction_assign.py
  42. 9 9
      kernel/test/instructions/test_instruction_break.py
  43. 12 12
      kernel/test/instructions/test_instruction_call.py
  44. 9 9
      kernel/test/instructions/test_instruction_continue.py
  45. 12 12
      kernel/test/instructions/test_instruction_declare.py
  46. 12 12
      kernel/test/instructions/test_instruction_if.py
  47. 13 13
      kernel/test/instructions/test_instruction_input.py
  48. 20 20
      kernel/test/instructions/test_instruction_output.py
  49. 15 15
      kernel/test/instructions/test_instruction_resolve.py
  50. 18 18
      kernel/test/instructions/test_instruction_return.py
  51. 11 11
      kernel/test/instructions/test_instruction_while.py
  52. 31 31
      kernel/test/instructions/utils.py
  53. 10 10
      kernel/test/primitives/test_action.py
  54. 10 10
      kernel/test/primitives/test_bool.py
  55. 9 9
      kernel/test/primitives/test_cast.py
  56. 11 11
      kernel/test/primitives/test_create.py
  57. 9 9
      kernel/test/primitives/test_delete.py
  58. 11 11
      kernel/test/primitives/test_dict.py
  59. 10 10
      kernel/test/primitives/test_dict_special.py
  60. 9 9
      kernel/test/primitives/test_edge.py
  61. 9 9
      kernel/test/primitives/test_element.py
  62. 10 10
      kernel/test/primitives/test_float.py
  63. 10 10
      kernel/test/primitives/test_integer.py
  64. 11 11
      kernel/test/primitives/test_list.py
  65. 11 11
      kernel/test/primitives/test_read.py
  66. 11 11
      kernel/test/primitives/test_set.py
  67. 9 9
      kernel/test/primitives/test_set_node.py
  68. 11 11
      kernel/test/primitives/test_string.py
  69. 31 31
      kernel/test/primitives/utils.py
  70. 24 24
      kernel/test/rules/test_rules_access.py
  71. 42 42
      kernel/test/rules/test_rules_assign.py
  72. 12 12
      kernel/test/rules/test_rules_break.py
  73. 111 111
      kernel/test/rules/test_rules_call.py
  74. 11 11
      kernel/test/rules/test_rules_constant.py
  75. 12 12
      kernel/test/rules/test_rules_continue.py
  76. 22 22
      kernel/test/rules/test_rules_helper.py
  77. 50 50
      kernel/test/rules/test_rules_if.py
  78. 28 28
      kernel/test/rules/test_rules_input.py
  79. 26 26
      kernel/test/rules/test_rules_output.py
  80. 47 47
      kernel/test/rules/test_rules_resolve.py
  81. 31 31
      kernel/test/rules/test_rules_return.py
  82. 36 36
      kernel/test/rules/test_rules_while.py
  83. 31 31
      kernel/test/rules/utils.py
  84. 31 31
      kernel/test/utils.py
  85. 39 39
      model/model.py
  86. 6 6
      performance/utils.py
  87. 6 6
      scripts/check_objects.py
  88. 7 7
      scripts/compile.py
  89. 4 4
      scripts/debug_prompt.py
  90. 7 7
      scripts/execute_model.py
  91. 6 6
      scripts/link_and_load.py
  92. 3 3
      scripts/make_all.py
  93. 7 7
      scripts/make_parallel.py
  94. 7 7
      scripts/process.py
  95. 8 8
      scripts/prompt.py
  96. 6 6
      scripts/run_MvC_server.py

+ 4 - 5
README.md

@@ -11,7 +11,7 @@ Starting up the Modelverse
 
 Starting up the Modelverse is easy: simply execute the `scripts/run_local_modelverse.py` script, with as parameter the port you want to use.
 This will compile the Modelverse statechart and execute it afterwards.
-You can now directly communicate with the Modelverse user initialisation layer.
+You can now directly communicate with the Modelverse task initialisation layer.
 It is not recommended that you do this manually, so we will now introduce the action language.
 
 Compiling Action Language
@@ -20,18 +20,18 @@ Compiling Action Language
 For a more user-friendly experience, an Action Language compiler was introduced that can automatically generate Modelverse instructions.
 During compilation, a live Modelverse is required, as the bytecodes are immediately uploaded after compilation.
 The Modelverse uses a traditional compilation phase and linking phase, though this is all hidden to the user through the `scripts/make_all.py` script.
-The script takes as parameter the address of the Modelverse, the username in whose name to execute the code, and a list of source files.
+The script takes as parameter the address of the Modelverse, the taskname with which to communicate, and a list of source files.
 For realistic applications, we recommend to always link to the bootstrap code, by including the file `bootstrap/\*.alc`.
 Even on systems that don't support globbing (e.g., Windows), this will automatically be expanded by the compiler.
 
 For example, to compile the simple textual interface, you must compile the interface's action language, together with all bootstrapping code (the libraries):
 
 ```sh
-python scripts/make_all.py http://127.0.0.1:8001 test_user bootstrap/*.alc integration/code/pn_interface.alc
+python scripts/make_all.py http://127.0.0.1:8001 test_task bootstrap/*.alc integration/code/pn_interface.alc
 ```
 
 Compilation is (relatively) smart, as it will not compile code again that is already present in the Modelverse.
-As such, except for the first user, the bootstrap code no longer needs to be compiled, only linked.
+As such, except for the first task, the bootstrap code no longer needs to be compiled, only linked.
 In the future, this is expected to become more user friendly for users, such that they no longer need to have the bootstrapping code available locally.
 
 After this part, your action language in `integration/code/pn_interface.alc` is compiled and running on the Modelverse.
@@ -45,7 +45,6 @@ To do this, you can use whatever tool you want, as long as it can send and recei
 For example, a mere internet browser can already communicate with the Modelverse, though not in the most user-friendly way.
 
 A nicer way is through the Python prompt script `scripts/prompt.py`.
-It will ask you the location of the Modelverse, and the user to connect to.
 After that, it will print out all the output of the Modelverse, and send in all your queries directly to the Modelverse.
 
 Performance

+ 36 - 36
bootstrap/bootstrap.py

@@ -7,18 +7,18 @@ import gzip
 def bootstrap():
     root = ["__hierarchy"]
 
-    user_manager = "user_manager"
+    task_manager = "task_manager"
     initial_code_manager = "bootstrap/initial_code_manager.alb"
-    initial_code_user = "bootstrap/initial_code_user.alb"
-    bootstrap_files = glob.glob("bootstrap/*.alc") + [initial_code_manager, initial_code_user]
+    initial_code_task = "bootstrap/initial_code_task.alb"
+    bootstrap_files = glob.glob("bootstrap/*.alc") + [initial_code_manager, initial_code_task]
 
-    user_data = [   "input",
+    task_data = [   "input",
                     "output",
                     "globals",
                     "frame",
                     ]
 
-    user_frame = [  "evalstack",
+    task_frame = [  "evalstack",
                     "symbols",
                     "returnvalue",
                     ]
@@ -102,7 +102,7 @@ def bootstrap():
                     "element_eq": ["Boolean", "Element", "Element"],
                     "element_neq": ["Boolean", "Element", "Element"],
                     "read_root": ["Element"],
-                    "read_userroot": ["Element"],
+                    "read_taskroot": ["Element"],
                     "deserialize": ["Element", "String"],
                     "log": ["String", "String"],
                     "time": ["Float"],
@@ -179,31 +179,31 @@ def bootstrap():
                 declare_primitive_class('primitives', primitives)
                 declare_primitive_class('jit', jit_primitives)
 
-                # Create the initial user
-                f.write("Node user_root()\n")
+                # Create the initial task
+                f.write("Node task_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 task_data:
+                    f.write("Node task_%s()\n" % data)
+                    f.write('Node ___task_%s("%s")\n' % (data, data))
+                    f.write("Edge _task_%s(task_root, task_%s)\n" % (data, data))
+                    f.write("Edge __task_%s(_task_%s, ___task_%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 task_frame:
+                    f.write("Node task_%s()\n" % data)
+                    f.write('Node ___task_%s("%s")\n' % (data, data))
+                    f.write("Edge _task_%s(task_frame, task_%s)\n" % (data, data))
+                    f.write("Edge __task_%s(_task_%s, ___task_%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))
+                    f.write('Node ___task_last_%s("last_%s")\n' % (data, data))
+                    f.write("Edge _task_last_%s(task_root, task_%s)\n" % (data, data))
+                    f.write("Edge __task_last_%s(_task_last_%s, ___task_last_%s)\n" % (data, data, data))
                     
-                # Bind user to the root
-                f.write('Node ___new_user("%s")\n' % user_manager)
-                f.write("Edge _new_user(root, user_root)\n")
-                f.write("Edge __new_user(_new_user, ___new_user)\n")
+                # Bind task to the root
+                f.write('Node ___new_task("%s")\n' % task_manager)
+                f.write("Edge _new_task(root, task_root)\n")
+                f.write("Edge __new_task(_new_task, ___new_task)\n")
 
                 def compile_code_AL(filename, target, prepend="", main=False, symbols=None):
                     import sys
@@ -225,7 +225,7 @@ def bootstrap():
                     bootstrap_file = bootstrap_file.replace("\\", "/")
                     print("[COMP] %s" % bootstrap_file)
                     symbols = {}
-                    f.write(compile_code_AL(bootstrap_file, "initial_IP", prepend=bootstrap_file, symbols=symbols, main = bootstrap_file in [initial_code_manager, initial_code_user]), both=False)
+                    f.write(compile_code_AL(bootstrap_file, "initial_IP", prepend=bootstrap_file, symbols=symbols, main = bootstrap_file in [initial_code_manager, initial_code_task]), both=False)
 
                     # Now link the code with the compilation manager structure
                     f.write("Node elem()\n", both=False)
@@ -253,22 +253,22 @@ def bootstrap():
                         f.write('Edge _(__symbols, v)\n', both=False)
                         f.write('Edge _(_, k)\n', both=False)
 
-                # Create code for initial user
-                print("[BOOT] user_manager")
+                # Create code for initial task
+                print("[BOOT] task_manager")
                 f.write('Node _IP_str("IP")\n', both=False)
-                f.write("Edge _user_frame(user_frame, %s_initial_IP)\n" % initial_code_manager, both=False)
-                f.write("Edge __user_frame(_user_frame, _IP_str)\n", both=False)
+                f.write("Edge _task_frame(task_frame, %s_initial_IP)\n" % initial_code_manager, both=False)
+                f.write("Edge __task_frame(_task_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("Edge _task_phase(task_frame, __phase)\n", both=False)
+                f.write("Edge __task_phase(_task_phase, __phase_str)\n", both=False)
 
-                # Create code for new users to start at
-                print("[BOOT] new_user")
+                # Create code for new tasks to start at
+                print("[BOOT] new_task")
                 f.write('Node __IP_str("__IP")\n', both=False)
-                f.write("Edge _user_IP(__hierarchy, %s_initial_IP)\n" % initial_code_user, both=False)
-                f.write("Edge __user_IP(_user_IP, __IP_str)\n", both=False)
+                f.write("Edge _task_IP(__hierarchy, %s_initial_IP)\n" % initial_code_task, both=False)
+                f.write("Edge __task_IP(_task_IP, __IP_str)\n", both=False)
     except:
         os.remove("bootstrap/bootstrap.m.gz")
         os.remove("bootstrap/minimal.m.gz")

+ 0 - 54
bootstrap/ftg.alc

@@ -1,54 +0,0 @@
-include "primitives.alh"
-include "modelling.alh"
-include "library.alh"
-
-Void function visit_ftg(ftg : Element, root : Element, path : String, current : Element):
-	log("Visit FTG: " + path)
-	if (dict_in(current, "source")):
-		// Is a transformation, and therefore an edge for the FTG
-		if (bool_not(dict_in(ftg["model"], path))):
-			if (bool_not(dict_in(ftg["model"], current["source"]))):
-				visit_ftg(ftg, root, current["source"], root[current["source"]])
-
-			if (bool_not(dict_in(ftg["model"], current["target"]))):
-				visit_ftg(ftg, root, current["target"], root[current["source"]])
-
-			instantiate_link(ftg, "Transformation", path, current["source"], current["target"])
-			instantiate_attribute(ftg, path, "location", path)
-	else:
-		// Is a model, and therefore a node for the FTG
-		if (bool_not(dict_in(ftg["model"], path))):
-			instantiate_node(ftg, "Formalism", path)
-			instantiate_attribute(ftg, path, "location", path)
-
-	return !
-
-Element function create_ftg(root : Element):
-	Element queue
-	Element current
-	Element submodels
-	Element ftg
-	String path
-	String submodel
-
-	queue = create_node()
-	set_add(queue, create_tuple("models", root))
-	ftg = instantiate_model(import_node("models/FTG"))
-
-	while (read_nr_out(queue) > 0):
-		current = set_pop(queue)
-		path = current[0]
-		current = current[1]
-		log("Check node: " + cast_e2s(current))
-		if (dict_in(current, "__hierarchy_node" )):
-			log("IS HIERARCHY: " + path)
-			submodels = dict_keys(current)
-			// Is a browser structure, and therefore not part of the FTG
-			while (read_nr_out(submodels) > 0):
-				submodel = set_pop(submodels)
-				set_add(queue, create_tuple((path + "/") + submodel, current[submodel]))
-		else:
-			log("IS MODEL: " + path)
-			visit_ftg(ftg, root, path, current)
-
-	return ftg!

+ 3 - 3
bootstrap/initial_code_manager.alb

@@ -1,10 +1,10 @@
 include "bootstrap/primitives.alc"
-include "user_manager.alh"
+include "task_manager.alh"
 
 Void function __main():
 	Element root
 	root = read_root()
 	root = root["__hierarchy"]["objects"]
-	exec(root["bootstrap/user_manager.alc"]["initializers"])
-	user_management()
+	exec(root["bootstrap/task_manager.alc"]["initializers"])
+	task_management()
 	return!

+ 3 - 3
bootstrap/initial_code_user.alb

@@ -1,5 +1,5 @@
 include "bootstrap/primitives.alc"
-include "user_interface.alh"
+include "task_interface.alh"
 
 Void mutable function __main():
 	Element root
@@ -12,6 +12,6 @@ Void mutable function __main():
 	exec(root["bootstrap/conformance_scd.alc"]["initializers"])
 	exec(root["bootstrap/metamodels.alc"]["initializers"])
 	exec(root["bootstrap/modelling.alc"]["initializers"])
-	exec(root["bootstrap/user_interface.alc"]["initializers"])
-	new_user()
+	exec(root["bootstrap/task_interface.alc"]["initializers"])
+	new_task()
 	return!

+ 6 - 6
bootstrap/primitives.alc

@@ -74,7 +74,7 @@ Integer function string_len(a: String) = ?primitives/string_len
 Element function deserialize(a: String) = ?primitives/deserialize
 Element function log(a: String) = ?primitives/log
 Element function read_root() = ?primitives/read_root
-Element function read_userroot() = ?primitives/read_userroot
+Element function read_taskroot() = ?primitives/read_taskroot
 Boolean function is_physical_int(a: Element) = ?primitives/is_physical_int
 Boolean function is_physical_float(a: Element) = ?primitives/is_physical_float
 Boolean function is_physical_string(a: Element) = ?primitives/is_physical_string
@@ -164,16 +164,16 @@ String function string_substr(a: String, b: Integer, c: Integer):
 Element function resolve(name : String):
 	// Could directly access it through introspection
 	// But seems safer to create some code and execute it...
-	Element user_root
-	user_root = read_userroot()
-	user_root = user_root["globals"][name]["value"]
-	return user_root!
+	Element task_root
+	task_root = read_taskroot()
+	task_root = task_root["globals"][name]["value"]
+	return task_root!
 
 Integer function integer_modulo(a : Integer, b : Integer):
 	return a - b * (a / b)!
 
 Boolean function has_input():
-	return (element_neq(dict_read(read_userroot(), "input"), dict_read(read_userroot(),"last_input")))!
+	return (element_neq(dict_read(read_taskroot(), "input"), dict_read(read_taskroot(),"last_input")))!
 
 Element function list_pop(lst : Element, index : Integer):
 	Element v

+ 1 - 1
bootstrap/user_interface.alc

@@ -5,7 +5,7 @@ include "compilation_manager.alh"
 include "constructors.alh"
 include "modelling.alh"
 
-Void mutable function new_user():
+Void mutable function new_task():
 	Integer interface
 	while (True):
 		interface = input()

+ 32 - 0
bootstrap/task_manager.alc

@@ -0,0 +1,32 @@
+include "io.alh"
+include "primitives.alh"
+
+Void function task_management():
+	String taskname
+	Element task_root
+	Element task_frame
+	Element output_value
+	Element input_value
+	
+	while (True):
+		taskname = input()
+		if (bool_not(dict_in(read_root(), taskname))):
+			task_root = create_node()
+			task_frame = create_node()
+			output_value = create_node()
+			input_value = create_node()
+			dict_add(task_root, "frame", task_frame)
+			dict_add(task_root, "globals", create_node())
+			dict_add(task_root, "output", output_value)
+			dict_add(task_root, "last_output", output_value)
+			dict_add(task_root, "input", input_value)
+			dict_add(task_root, "last_input", input_value)
+			dict_add(task_frame, "evalstack", create_node())
+			dict_add(task_frame, "returnvalue", create_node())
+			dict_add(task_frame, "phase", "init")
+			dict_add(task_frame, "IP", dict_read(dict_read(read_root(), "__hierarchy"), "__IP"))
+			dict_add(task_frame, "symbols", create_node())
+
+			//Add this only at the end, as otherwise the task will already be detected
+			dict_add(read_root(), taskname, task_root)
+	return!

+ 0 - 32
bootstrap/user_manager.alc

@@ -1,32 +0,0 @@
-include "io.alh"
-include "primitives.alh"
-
-Void function user_management():
-	String username
-	Element user_root
-	Element user_frame
-	Element output_value
-	Element input_value
-	
-	while (True):
-		username = input()
-		if (bool_not(dict_in(read_root(), username))):
-			user_root = create_node()
-			user_frame = create_node()
-			output_value = create_node()
-			input_value = create_node()
-			dict_add(user_root, "frame", user_frame)
-			dict_add(user_root, "globals", create_node())
-			dict_add(user_root, "output", output_value)
-			dict_add(user_root, "last_output", output_value)
-			dict_add(user_root, "input", input_value)
-			dict_add(user_root, "last_input", input_value)
-			dict_add(user_frame, "evalstack", create_node())
-			dict_add(user_frame, "returnvalue", create_node())
-			dict_add(user_frame, "phase", "init")
-			dict_add(user_frame, "IP", dict_read(dict_read(read_root(), "__hierarchy"), "__IP"))
-			dict_add(user_frame, "symbols", create_node())
-
-			//Add this only at the end, as otherwise the user will already be detected
-			dict_add(read_root(), username, user_root)
-	return!

+ 8 - 0
core/core_algorithm.alc

@@ -197,6 +197,14 @@ Boolean function check_login(user_id : String):
 
 	return password == stored_password!
 
+Element function extract_ftg(user_id : String):
+	// Extract your personal FTG, showing only the readable models that can be opened
+	// This function does the actual projection of transformations
+
+	// TODO: Only keep transformations satisfying some properties!
+
+	return create_node()!
+
 Element function user_function():
 	String username
 	String user_id

+ 29 - 29
hybrid_server/classes/mvkcontroller.xml

@@ -34,14 +34,14 @@
             self.timeout = False
             self.init_time = time.time()
 
-            self.users = set()
+            self.tasks = set()
             self.input_queue = defaultdict(list)
             self.output_queue = defaultdict(list)
             self.source = None
             self.port = int(sys.argv[1])
             self.count = 0
             
-            self.debugged_users = set()
+            self.debugged_tasks = set()
             self.debug_info = {}
             self.done_something = False
 
@@ -73,7 +73,7 @@
     </constructor>
 
     <method name="execute_modelverse">
-        <parameter name="username"/>
+        <parameter name="taskname"/>
         <parameter name="operation"/>
         <parameter name="params"/>
         <body>
@@ -81,7 +81,7 @@
             reply = None
             commands = []
             while 1:
-                commands = self.mvk.execute_yields(username, operation, params, reply)
+                commands = self.mvk.execute_yields(taskname, operation, params, reply)
                 if commands is None:
                     break
                 reply = [self.mvs_operations[command[0]](*(command[1]))[0] for command in commands]
@@ -124,27 +124,27 @@
                                         value = [json.loads(data["value"])]
                                     else:
                                         value = json.loads(data["data"])
-                                    self.input_queue[data["username"]].append((source, value))
+                                    self.input_queue[data["taskname"]].append((source, value))
                                 elif data["op"] == "get_output":
-                                    self.output_queue[data["username"]].append(source)
+                                    self.output_queue[data["taskname"]].append(source)
                                 elif data["op"] == "attach_debugger":
-                                    self.debugged_users.add(data["username"])
+                                    self.debugged_tasks.add(data["taskname"])
                                     self.done_something = True
                                     self.source = source
-                                    self.debug_info[data["username"]] = {'state': 'running', 'breakpoints': []}
+                                    self.debug_info[data["taskname"]] = {'state': 'running', 'breakpoints': []}
                                 elif data["op"] == "detach_debugger":
-                                    self.debugged_users.discard(data["username"])
+                                    self.debugged_tasks.discard(data["taskname"])
                                     self.done_something = True
                                     self.source = source
-                                    del self.debug_info[data["username"]]
+                                    del self.debug_info[data["taskname"]]
                                 elif data["op"] == "pause":
-                                    if data["username"] in self.debugged_users:
-                                        self.debug_info[data["username"]]['state'] = 'paused'
+                                    if data["taskname"] in self.debugged_tasks:
+                                        self.debug_info[data["taskname"]]['state'] = 'paused'
                                     self.done_something = True
                                     self.source = source
                                 elif data["op"] == "resume":
-                                    if data["username"] in self.debugged_users:
-                                        self.debug_info[data["username"]]['state'] = 'running'
+                                    if data["taskname"] in self.debugged_tasks:
+                                        self.debug_info[data["taskname"]]['state'] = 'running'
                                     self.done_something = True
                                     self.source = source
                                 elif data["op"] == "step_over":
@@ -180,23 +180,23 @@
                         <script>
                             self.timeout = False
                             self.destination = None
-                            if self.users:
-                                user = self.users.pop()
-                                if not user in self.debugged_users or self.debug_info[user]['state'] == 'running':
+                            if self.tasks:
+                                task = self.tasks.pop()
+                                if not task in self.debugged_tasks or self.debug_info[task]['state'] == 'running':
                                     # Check if there are values to input
-                                    if self.input_queue[user]:
-                                        source, args = self.input_queue[user].pop(0)
+                                    if self.input_queue[task]:
+                                        source, args = self.input_queue[task].pop(0)
                                         for args_entry in args:
-                                            self.execute_modelverse(user, "set_input", [args_entry])
+                                            self.execute_modelverse(task, "set_input", [args_entry])
 
                                         self.destination = source
                                         self.value = "OK"
                                         self.all_failed = False
 
-                                    nr_of_steps = 1 if user in self.debugged_users else 100
+                                    nr_of_steps = 1 if task in self.debugged_tasks else 100
                                     # Now process for some steps, or until we are again blocked for input
                                     for x in xrange(nr_of_steps):
-                                        self.execute_modelverse(user, "execute_rule", [])
+                                        self.execute_modelverse(task, "execute_rule", [])
 
                                         if not self.mvk.success:
                                             # Blocking or broken, so quit already to stop wasting CPU
@@ -208,10 +208,10 @@
                                     # Check that we don't have anything to output yet, otherwise we wait
                                     if self.destination is None:
                                         # Perform output if there is anything
-                                        if self.output_queue[user]:
-                                            self.execute_modelverse(user, "get_output", [])
+                                        if self.output_queue[task]:
+                                            self.execute_modelverse(task, "get_output", [])
                                             if self.mvk.success:
-                                                self.destination = self.output_queue[user].pop(0)
+                                                self.destination = self.output_queue[task].pop(0)
                                                 self.value = self.mvk.returnvalue
                                                 self.all_failed = False
 
@@ -224,14 +224,14 @@
                                     self.mvs.garbage_collect()
                                 out = self.mvs.read_outgoing(self.root)[0]
                                 for m in out:
-                                    src, user = self.mvs.read_edge(m)[0]
+                                    src, task = self.mvs.read_edge(m)[0]
                                     outgoing = self.mvs.read_outgoing(m)[0]
                                     first = self.mvs.read_edge(outgoing[0])[0]
                                     dest = first[1]
                                     name = self.mvs.read_value(dest)[0]
                                     if name.startswith("__"):
                                         continue
-                                    self.users.add(name)
+                                    self.tasks.add(name)
                                 self.timeout = self.all_failed
                                 self.all_failed = True
                         </script>
@@ -254,8 +254,8 @@
                     <transition event="delete_socket" target=".">
                         <parameter name="socket"/>
                         <script>
-                            for user in self.output_queue.keys():
-                                self.output_queue[user] = [s for s in self.output_queue[user] if s != socket]
+                            for task in self.output_queue.keys():
+                                self.output_queue[task] = [s for s in self.output_queue[task] if s != socket]
                         </script>
                     </transition>
                 </state>

+ 13 - 13
integration/utils.py

@@ -16,7 +16,7 @@ sys.path.append("scripts")
 from hutn_compiler.compiler import main as do_compile
 from check_objects import to_recompile
 
-username = "test_user"
+taskname = "test_task"
 parallel_push = True
 
 ports = set()
@@ -51,7 +51,7 @@ def kill(process):
 
 def flush_data(address, data):
     if data:
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": username})), timeout=10).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "taskname": taskname})), timeout=10).read()
     return []
 
 def compile_file(address, mod_filename, filename, mode, proc):
@@ -59,9 +59,9 @@ def compile_file(address, mod_filename, filename, mode, proc):
     try:
         timeout_val = 240
         import random
-        username = str(random.random())
+        taskname = str(random.random())
         while 1:
-            proc2 = execute("compile", [address, mod_filename, username, filename, mode], wait=False)
+            proc2 = execute("compile", [address, mod_filename, taskname, filename, mode], wait=False)
 
             if proc.returncode is not None:
                 # Modelverse has already terminated, which isn't a good sign!
@@ -139,7 +139,7 @@ def run_file(files, parameters, expected, mode, wait=False):
 
         if mode[-1] == "O":
             # Fire up the linker
-            val = execute("link_and_load", [address, username] + mod_files, wait=True)
+            val = execute("link_and_load", [address, taskname] + mod_files, wait=True)
             if val != 0:
                 raise Exception("Linking error")
 
@@ -149,13 +149,13 @@ def run_file(files, parameters, expected, mode, wait=False):
         # ... and wait for replies
         if expected is None:
             while 1:
-                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=240).read()
+                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=240).read()
                 val = json.loads(val)
                 print(val)
         for e in expected:
             c = len(e) if isinstance(e, set) else 1
             for _ in range(c):
-                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=240).read()
+                val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=240).read()
                 val = json.loads(val)
 
                 if proc.returncode is not None:
@@ -192,7 +192,7 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
         # Run Modelverse server
         proc = execute("run_local_modelverse", [str(port)], wait=False)
 
-        # Create user and set interface
+        # Create task and set interface
         timeout_val = 15
         start = time.time()
         while 1:
@@ -202,9 +202,9 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
                 return False
 
             try:
-                urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": '"%s"' % username, "username": "user_manager"})), timeout=1).read()
+                urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": '"%s"' % taskname, "taskname": "task_manager"})), timeout=1).read()
                 if interface is not None:
-                    urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": interface, "username": username})), timeout=1).read()
+                    urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": interface, "taskname": taskname})), timeout=1).read()
                 break
             except:
                 time.sleep(0.01)
@@ -219,7 +219,7 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
         if link is not None:
             # Execute linker
             timeout_val = 10
-            proc2 = execute("link_and_load", [address, username] + link, wait=False)
+            proc2 = execute("link_and_load", [address, taskname] + link, wait=False)
 
             while proc2.returncode is None:
                 time.sleep(0.01)
@@ -234,7 +234,7 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
                     return False
 
         for inp in inputs:
-            urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": inp, "username": username})), timeout=1).read()
+            urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "element_type": "V", "value": inp, "taskname": taskname})), timeout=1).read()
             proc.poll()
             if proc.returncode is not None:
                 # Modelverse has already terminated, which isn't a good sign!
@@ -251,7 +251,7 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
                         # Modelverse has already terminated, which isn't a good sign!
                         return False
 
-                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=240 if not timeout else 20).read()
+                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname})), timeout=240 if not timeout else 20).read()
                     val = json.loads(val)
                 except:
                     if timeout:

+ 25 - 25
interface/CBD/main.py

@@ -18,7 +18,7 @@ JUMP = 50
 MAX_WIDTH = 20 * JUMP
 MAX_HEIGHT = 20 * JUMP
 address = "http://127.0.0.1:8001"
-username = "test"
+taskname = "test"
 
 root = Tk()
 
@@ -72,7 +72,7 @@ def poll(address):
     working_simulation = None
 
     while 1:
-        returnvalue = json.loads(urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username}))).read())
+        returnvalue = json.loads(urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname}))).read())
         print("Process " + str(returnvalue))
         if (returnvalue.startswith("AVAILABLE_ATTR_VALUE")):
             working_available_attrs.append([json.loads(returnvalue.split(" ", 1)[1]), None])
@@ -110,58 +110,58 @@ class MvLayer():
         import threading
 
         self.address = address
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % username, "username": "user_manager"}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % taskname, "taskname": "task_manager"}))).read()
         thrd = threading.Thread(target=poll, args=[address])
         thrd.daemon = True
         thrd.start()
 
     def read_available_attributes(self, name):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_available_attributes"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_available_attributes"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "taskname": taskname}))).read()
 
         while not available_attrs:
             time.sleep(0.1)
         return available_attrs.pop(0)
 
     def read_attribute(self, name, attr):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_attribute"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_attribute"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "taskname": taskname}))).read()
 
         while not attribute:
             time.sleep(0.1)
         return attribute.pop(0)
 
     def set_attribute(self, name, attr, value):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"set_attribute"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": json.dumps(value), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"set_attribute"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": json.dumps(value), "taskname": taskname}))).read()
 
     def instantiate_block(self, name, block_type):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_node"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block_type), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_node"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block_type), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "taskname": taskname}))).read()
 
     def instantiate_link(self, name, link_type, source, target):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_association"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (link_type), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (source), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (target), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_association"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (link_type), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (source), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (target), "taskname": taskname}))).read()
 
     def simulate(self):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"simulate"', "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"simulate"', "taskname": taskname}))).read()
 
     def step(self):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"step"', "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"step"', "taskname": taskname}))).read()
 
     def pause(self):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"pause"', "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"pause"', "taskname": taskname}))).read()
 
     def delete(self, block):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"delete_element"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"delete_element"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block), "taskname": taskname}))).read()
 
 def lower(value):
     return value / JUMP * JUMP

+ 32 - 32
interface/FSA/main.py

@@ -21,7 +21,7 @@ MAX_WIDTH = 10 * JUMP
 MAX_HEIGHT = 10 * JUMP
 CLICK_TOLERANCE = 5
 address = "http://127.0.0.1:8001"
-username = "test"
+taskname = "test"
 
 root = Tk()
 names = {}
@@ -101,7 +101,7 @@ def poll(address):
     global request_new_state
 
     while 1:
-        returnvalue = json.loads(urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username}))).read())
+        returnvalue = json.loads(urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname}))).read())
         print("Process " + str(returnvalue))
         if (returnvalue.startswith("AVAILABLE_ATTR_VALUE")):
             working_available_attrs.append([json.loads(returnvalue.split(" ", 1)[1]), None])
@@ -140,7 +140,7 @@ class MvLayer():
         import threading
 
         self.address = address
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % username, "username": "user_manager"}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % taskname, "taskname": "task_manager"}))).read()
         thrd = threading.Thread(target=poll, args=[address])
         thrd.daemon = True
         thrd.start()
@@ -156,8 +156,8 @@ class MvLayer():
         thrd.start()
 
     def read_available_attributes(self, name):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_available_attributes"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_available_attributes"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "taskname": taskname}))).read()
 
         while 1:
             try:
@@ -168,9 +168,9 @@ class MvLayer():
 
     def read_attribute(self, name, attr):
         print("Sending read_attribute")
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_attribute"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"read_attribute"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "taskname": taskname}))).read()
 
         print("Waiting for attribute")
         while 1:
@@ -181,51 +181,51 @@ class MvLayer():
                 time.sleep(0.1)
 
     def set_attribute(self, name, attr, value):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"set_attribute"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": json.dumps(value), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"set_attribute"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % name, "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % attr, "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": json.dumps(value), "taskname": taskname}))).read()
 
     def instantiate_element(self, name, block_type):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_node"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block_type), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_node"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block_type), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "taskname": taskname}))).read()
 
     def instantiate_link(self, name, link_type, source, target):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_association"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (link_type), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (source), "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (target), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"instantiate_association"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (link_type), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (source), "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (target), "taskname": taskname}))).read()
 
     def simulate(self):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"simulate"', "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"simulate"', "taskname": taskname}))).read()
 
     def pause(self):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"pause"', "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"pause"', "taskname": taskname}))).read()
 
     def send_event(self, event):
         print("SENDING EVENT")
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"event"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (event), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"event"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (event), "taskname": taskname}))).read()
 
     def delete(self, block):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"delete_element"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"delete_element"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (block), "taskname": taskname}))).read()
 
     def switch_initial(self, name):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"switch_initial"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"switch_initial"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "taskname": taskname}))).read()
 
     def auto_sanitize(self, auto):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"auto_sanitize"', "username": username}))).read()
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": "true" if auto else "false", "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"auto_sanitize"', "taskname": taskname}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": "true" if auto else "false", "taskname": taskname}))).read()
 
     def set_current(self, name):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % (name), "taskname": taskname}))).read()
 
     def poll(self):
-        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"poll"', "username": username}))).read()
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"poll"', "taskname": taskname}))).read()
 
 def lower(value):
     return value / JUMP * JUMP

+ 7 - 7
interface/HUTN/hutn_compiler/constructors_object_visitor.py

@@ -14,7 +14,7 @@ class ConstructorsObjectVisitor(ConstructorsVisitor):
     def __init__(self, args):
         ConstructorsVisitor.__init__(self, args)
 
-        self.username = args[0]
+        self.taskname = args[0]
         self.obj_file = args[1]
         self.real_file = args[2]
         self.address = args[3]
@@ -27,8 +27,8 @@ class ConstructorsObjectVisitor(ConstructorsVisitor):
             md5.update(f.read())
         self.hash_file = md5.hexdigest()
 
-        # Create user
-        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "value": '"%s"' % self.username, "username": "user_manager"}))).read()
+        # Create task
+        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "value": '"%s"' % self.taskname, "taskname": "task_manager"}))).read()
 
         simple_filename = self.real_file.rsplit("/")[-1]
         print("[COMPILE] %s" % simple_filename)
@@ -38,7 +38,7 @@ class ConstructorsObjectVisitor(ConstructorsVisitor):
 
         def flush_data(data):
             if data:
-                urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": self.username})), timeout=timeout).read()
+                urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "taskname": self.taskname})), timeout=timeout).read()
             return []
 
         # Set up interface
@@ -52,11 +52,11 @@ class ConstructorsObjectVisitor(ConstructorsVisitor):
         # Finish the symbol table
         data.append(False)
 
-        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": self.username}))).read()
+        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "taskname": self.taskname}))).read()
 
         # Wait for kernel to signal that it finished
-        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "value": '2', "username": self.username}))).read()
-        v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
+        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "value": '2', "taskname": self.taskname}))).read()
+        v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "taskname": self.taskname}))).read()
         v = json.loads(v)
         if v == "DONE":
             return True

+ 7 - 7
interface/HUTN/hutn_compiler/linker.py

@@ -5,17 +5,17 @@ import json
 
 sys.path.append("scripts")
 
-def link(address, username, objects):
+def link(address, taskname, objects):
     # Read out all symbol tables that are to be linked
     definers = {}
-    users = {}
+    tasks = {}
     def flush_data(data):
         if data:
-            urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": username})), timeout=10).read()
+            urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "taskname": taskname})), timeout=10).read()
         return []
     flush_data([3, "link_and_load"] + objects + ["", "main"])
 
-    v = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username}))).read()
+    v = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "taskname": taskname}))).read()
     v = json.loads(v)
     if "OK" not in v:
         print(v)
@@ -23,13 +23,13 @@ def link(address, username, objects):
 
 if __name__ == "__main__":
     if len(sys.argv) == 1:
-        print("No username defined")
+        print("No taskname defined")
     else:
         address = sys.argv[1]
-        username = sys.argv[2]
+        taskname = sys.argv[2]
         objects = set(sys.argv[3:])
 
         if objects:
-            link(address, username, objects)
+            link(address, taskname, objects)
         else:
             print("No files to link defined")

+ 3 - 3
interface/HUTN/hutn_compiler/model_object_visitor.py

@@ -11,7 +11,7 @@ def empty(s):
 class ModelObjectVisitor(ModelVisitor):
     def __init__(self, args):
         ModelVisitor.__init__(self, args)
-        self.username = args[0]
+        self.taskname = args[0]
         self.obj_file = args[1]
         self.real_file = args[2]
         self.address = args[3]
@@ -23,8 +23,8 @@ class ModelObjectVisitor(ModelVisitor):
         # Wait for kernel to signal that it finished
         data.append(2)
 
-        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": self.username}))).read()
-        v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
+        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "taskname": self.taskname}))).read()
+        v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "taskname": self.taskname}))).read()
         v = json.loads(v)
         if v == "DONE":
             return True

+ 5 - 5
interface/HUTN/hutn_compiler/primitives_object_visitor.py

@@ -10,7 +10,7 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
     def __init__(self, args):
         PrimitivesVisitor.__init__(self, args)
 
-        self.username = args[0]
+        self.taskname = args[0]
         self.obj_file = args[1]
         self.real_file = args[2]
         self.address = args[3]
@@ -23,8 +23,8 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
             md5.update(f.read())
         self.hash_file = md5.hexdigest()
 
-        # Create user
-        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "value": '"%s"' % self.username, "username": "user_manager"}))).read()
+        # Create task
+        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "value": '"%s"' % self.taskname, "taskname": "task_manager"}))).read()
 
         simple_filename = self.real_file.rsplit("/")[-1]
         print("[COMPILE] %s" % simple_filename)
@@ -49,8 +49,8 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
         # Wait for kernel to signal that it finished
         data.append(2)
 
-        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": self.username}))).read()
-        v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
+        urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "taskname": self.taskname}))).read()
+        v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "taskname": self.taskname}))).read()
         v = json.loads(v)
         if v == "DONE":
             return True

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

@@ -81,7 +81,7 @@ Boolean function string_startswith(a: String, b: String)
 Element function deserialize(a: String) 
 String function log(a: String)
 Element function read_root()
-Element function read_userroot()
+Element function read_taskroot()
 Element function input()
 Element function output(a : Element)
 Boolean function is_physical_int(a : Element)

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

@@ -0,0 +1 @@
+Void function new_task()

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

@@ -0,0 +1 @@
+Void function task_management()

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

@@ -1 +0,0 @@
-Void function new_user()

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

@@ -1 +0,0 @@
-Void function user_management()

+ 3 - 3
kernel/modelverse_jit/intrinsics.py

@@ -242,12 +242,12 @@ MISC_INTRINSICS = {
             tree_ir.LoadLocalInstruction(jit.KWARGS_PARAMETER_NAME),
             tree_ir.LiteralInstruction('root')),
 
-    # read_userroot
-    'read_userroot' :
+    # read_taskroot
+    'read_taskroot' :
         lambda:
         tree_ir.LoadIndexInstruction(
             tree_ir.LoadLocalInstruction(jit.KWARGS_PARAMETER_NAME),
-            tree_ir.LiteralInstruction('user_root')),
+            tree_ir.LiteralInstruction('task_root')),
 
     # Dictionary operations
     'dict_read' :

+ 35 - 35
kernel/modelverse_jit/jit.py

@@ -20,7 +20,7 @@ LOCALS_NODE_NAME = "jit_locals"
 """The name of the node that is connected to all JIT locals in a given function call."""
 
 LOCALS_EDGE_NAME = "jit_locals_edge"
-"""The name of the edge that connects the LOCALS_NODE_NAME node to a user root."""
+"""The name of the edge that connects the LOCALS_NODE_NAME node to a task root."""
 
 def get_parameter_names(compiled_function):
     """Gets the given compiled function's parameter names."""
@@ -282,7 +282,7 @@ class ModelverseJit(object):
 
         raise primitive_functions.PrimitiveFinished(self.jitted_parameters[body_id])
 
-    def jit_compile(self, user_root, body_id, suggested_name=None):
+    def jit_compile(self, task_root, body_id, suggested_name=None):
         """Tries to jit the function defined by the given entry point id and parameter list."""
         # The comment below makes pylint shut up about our (hopefully benign) use of exec here.
         # pylint: disable=I0011,W0122
@@ -341,7 +341,7 @@ class ModelverseJit(object):
             raise JitCompilationFailedException(
                 "Function was marked '%s'." % jit_runtime.MUTABLE_FUNCTION_KEY)
         state = AnalysisState(
-            self, body_id, user_root, body_param_dict,
+            self, body_id, task_root, body_param_dict,
             self.max_instructions)
         constructed_body, = yield [("CALL_ARGS", [state.analyze, (body_id,)])]
         yield [("END_TRY", [])]
@@ -349,13 +349,13 @@ class ModelverseJit(object):
 
         # Write a prologue and prepend it to the generated function body.
         prologue_statements = []
-        # Create a LOCALS_NODE_NAME node, and connect it to the user root.
+        # Create a LOCALS_NODE_NAME node, and connect it to the task root.
         prologue_statements.append(
             tree_ir.create_new_local_node(
                 LOCALS_NODE_NAME,
                 tree_ir.LoadIndexInstruction(
                     tree_ir.LoadLocalInstruction(KWARGS_PARAMETER_NAME),
-                    tree_ir.LiteralInstruction('user_root')),
+                    tree_ir.LiteralInstruction('task_root')),
                 LOCALS_EDGE_NAME))
         for (key, val) in param_dict.items():
             arg_ptr = tree_ir.create_new_local_node(
@@ -399,13 +399,13 @@ class ModelverseJit(object):
 
 class AnalysisState(object):
     """The state of a bytecode analysis call graph."""
-    def __init__(self, jit, body_id, user_root, local_mapping, max_instructions=None):
+    def __init__(self, jit, body_id, task_root, local_mapping, max_instructions=None):
         self.analyzed_instructions = set()
         self.function_vars = set()
         self.local_vars = set()
         self.body_id = body_id
         self.max_instructions = max_instructions
-        self.user_root = user_root
+        self.task_root = task_root
         self.jit = jit
         self.local_mapping = local_mapping
         self.function_name = jit.jitted_entry_points[body_id]
@@ -431,14 +431,14 @@ class AnalysisState(object):
                 "Local is used as target of function call.")
         self.function_vars.add(local_id)
 
-    def retrieve_user_root(self):
-        """Creates an instruction that stores the user_root variable
+    def retrieve_task_root(self):
+        """Creates an instruction that stores the task_root variable
            in a local."""
         return tree_ir.StoreLocalInstruction(
-            'user_root',
+            'task_root',
             tree_ir.LoadIndexInstruction(
                 tree_ir.LoadLocalInstruction(KWARGS_PARAMETER_NAME),
-                tree_ir.LiteralInstruction('user_root')))
+                tree_ir.LiteralInstruction('task_root')))
 
     def load_kernel(self):
         """Creates an instruction that loads the Modelverse kernel."""
@@ -583,14 +583,14 @@ class AnalysisState(object):
         #
         # value = <some tree>
         # last_output, last_output_link, new_last_output = \
-        #                 yield [("RD", [user_root, "last_output"]),
-        #                        ("RDE", [user_root, "last_output"]),
+        #                 yield [("RD", [task_root, "last_output"]),
+        #                        ("RDE", [task_root, "last_output"]),
         #                        ("CN", []),
         #                       ]
         # _, _, _, _ = \
         #                 yield [("CD", [last_output, "value", value]),
         #                        ("CD", [last_output, "next", new_last_output]),
-        #                        ("CD", [user_root, "last_output", new_last_output]),
+        #                        ("CD", [task_root, "last_output", new_last_output]),
         #                        ("DE", [last_output_link])
         #                       ]
         # yield None
@@ -599,17 +599,17 @@ class AnalysisState(object):
         value_val, = yield [("CALL_ARGS", [self.analyze, (value_id,)])]
         value_local = tree_ir.StoreLocalInstruction('value', value_val)
 
-        store_user_root = self.retrieve_user_root()
+        store_task_root = self.retrieve_task_root()
         last_output = tree_ir.StoreLocalInstruction(
             'last_output',
             tree_ir.ReadDictionaryValueInstruction(
-                store_user_root.create_load(),
+                store_task_root.create_load(),
                 tree_ir.LiteralInstruction('last_output')))
 
         last_output_link = tree_ir.StoreLocalInstruction(
             'last_output_link',
             tree_ir.ReadDictionaryEdgeInstruction(
-                store_user_root.create_load(),
+                store_task_root.create_load(),
                 tree_ir.LiteralInstruction('last_output')))
 
         new_last_output = tree_ir.StoreLocalInstruction(
@@ -618,7 +618,7 @@ class AnalysisState(object):
 
         result = tree_ir.create_block(
             value_local,
-            store_user_root,
+            store_task_root,
             last_output,
             last_output_link,
             new_last_output,
@@ -631,7 +631,7 @@ class AnalysisState(object):
                 tree_ir.LiteralInstruction('next'),
                 new_last_output.create_load()),
             tree_ir.CreateDictionaryEdgeInstruction(
-                store_user_root.create_load(),
+                store_task_root.create_load(),
                 tree_ir.LiteralInstruction('last_output'),
                 new_last_output.create_load()),
             tree_ir.DeleteEdgeInstruction(last_output_link.create_load()),
@@ -654,7 +654,7 @@ class AnalysisState(object):
         #
         #     value = None
         #     while True:
-        #         _input = yield [("RD", [user_root, "input"])]
+        #         _input = yield [("RD", [task_root, "input"])]
         #         value = yield [("RD", [_input, "value"])]
         #
         #         if value is None:
@@ -664,15 +664,15 @@ class AnalysisState(object):
         #             break
         #
         #     _next = yield [("RD", [_input, "next"])]
-        #     yield [("CD", [user_root, "input", _next])]
+        #     yield [("CD", [task_root, "input", _next])]
         #     yield [("CE", [jit_locals, value])]
         #     yield [("DN", [_input])]
 
-        user_root = self.retrieve_user_root()
+        task_root = self.retrieve_task_root()
         _input = tree_ir.StoreLocalInstruction(
             None,
             tree_ir.ReadDictionaryValueInstruction(
-                user_root.create_load(),
+                task_root.create_load(),
                 tree_ir.LiteralInstruction('input')))
 
         value = tree_ir.StoreLocalInstruction(
@@ -684,7 +684,7 @@ class AnalysisState(object):
         raise primitive_functions.PrimitiveFinished(
             tree_ir.CompoundInstruction(
                 tree_ir.create_block(
-                    user_root,
+                    task_root,
                     value.create_store(tree_ir.LiteralInstruction(None)),
                     tree_ir.LoopInstruction(
                         tree_ir.create_block(
@@ -703,7 +703,7 @@ class AnalysisState(object):
                                     tree_ir.NopInstruction()),
                                 tree_ir.BreakInstruction()))),
                     tree_ir.CreateDictionaryEdgeInstruction(
-                        user_root.create_load(),
+                        task_root.create_load(),
                         tree_ir.LiteralInstruction('input'),
                         tree_ir.ReadDictionaryValueInstruction(
                             _input.create_load(),
@@ -725,7 +725,7 @@ class AnalysisState(object):
         #     if 'local_var' in locals():
         #         tmp = local_var
         #     else:
-        #         _globals, = yield [("RD", [user_root, "globals"])]
+        #         _globals, = yield [("RD", [task_root, "globals"])]
         #         global_var, = yield [("RD", [_globals, var_name])]
         #
         #         if global_var is None:
@@ -739,12 +739,12 @@ class AnalysisState(object):
             raise primitive_functions.PrimitiveFinished(
                 tree_ir.LoadLocalInstruction(name))
 
-        user_root = self.retrieve_user_root()
+        task_root = self.retrieve_task_root()
         global_var = tree_ir.StoreLocalInstruction(
             'global_var',
             tree_ir.ReadDictionaryValueInstruction(
                 tree_ir.ReadDictionaryValueInstruction(
-                    user_root.create_load(),
+                    task_root.create_load(),
                     tree_ir.LiteralInstruction('globals')),
                 tree_ir.LiteralInstruction(var_name)))
 
@@ -767,7 +767,7 @@ class AnalysisState(object):
                 tree_ir.LoadLocalInstruction(name),
                 tree_ir.CompoundInstruction(
                     tree_ir.create_block(
-                        user_root,
+                        task_root,
                         global_var,
                         err_block),
                     global_var.create_load())))
@@ -802,7 +802,7 @@ class AnalysisState(object):
         # To resolve a variable, we'll do something along the
         # lines of:
         #
-        #     _globals, = yield [("RD", [user_root, "globals"])]
+        #     _globals, = yield [("RD", [task_root, "globals"])]
         #     global_var = yield [("RD", [_globals, var_name])]
         #
         #     if global_var is None:
@@ -811,11 +811,11 @@ class AnalysisState(object):
         #
         #     tmp = global_var
 
-        user_root = self.retrieve_user_root()
+        task_root = self.retrieve_task_root()
         _globals = tree_ir.StoreLocalInstruction(
             '_globals',
             tree_ir.ReadDictionaryValueInstruction(
-                user_root.create_load(),
+                task_root.create_load(),
                 tree_ir.LiteralInstruction('globals')))
 
         global_var = tree_ir.StoreLocalInstruction(
@@ -827,7 +827,7 @@ class AnalysisState(object):
         raise primitive_functions.PrimitiveFinished(
             tree_ir.CompoundInstruction(
                 tree_ir.create_block(
-                    user_root,
+                    task_root,
                     _globals,
                     global_var,
                     tree_ir.SelectInstruction(
@@ -911,7 +911,7 @@ class AnalysisState(object):
             compiled_func = self.jit.lookup_compiled_function(callee_name)
             if compiled_func is None:
                 # Compile the callee.
-                yield [("CALL_ARGS", [self.jit.jit_compile, (self.user_root, body_id, callee_name)])]
+                yield [("CALL_ARGS", [self.jit.jit_compile, (self.task_root, body_id, callee_name)])]
             else:
                 self.jit.register_compiled(body_id, compiled_func, callee_name)
 
@@ -989,7 +989,7 @@ class AnalysisState(object):
                 resolved_var_name, = yield [("RV", [resolved_var_id])]
 
                 # Try to look up the name as a global.
-                _globals, = yield [("RD", [self.user_root, "globals"])]
+                _globals, = yield [("RD", [self.task_root, "globals"])]
                 global_var, = yield [("RD", [_globals, resolved_var_name])]
                 global_val, = yield [("RD", [global_var, "value"])]
 

+ 12 - 12
kernel/modelverse_jit/runtime.py

@@ -12,7 +12,7 @@ FUNCTION_BODY_KEY = "body"
 
 def call_function(function_id, named_arguments, **kwargs):
     """Runs the function with the given id, passing it the specified argument dictionary."""
-    user_root = kwargs['user_root']
+    task_root = kwargs['task_root']
     kernel = kwargs['mvk']
     body_id, is_mutable = yield [
         ("RD", [function_id, FUNCTION_BODY_KEY]),
@@ -35,7 +35,7 @@ def call_function(function_id, named_arguments, **kwargs):
     yield [("TRY", [])]
     yield [("CATCH", [JitCompilationFailedException, handle_jit_failed])]
     # Try to compile.
-    compiled_func, = yield [("CALL_ARGS", [kernel.jit_compile, (user_root, body_id)])]
+    compiled_func, = yield [("CALL_ARGS", [kernel.jit_compile, (task_root, body_id)])]
     yield [("END_TRY", [])]
     # Add the keyword arguments to the argument dictionary.
     named_arguments.update(kwargs)
@@ -45,16 +45,16 @@ def call_function(function_id, named_arguments, **kwargs):
 def interpret_function(function_id, named_arguments, **kwargs):
     """Makes the interpreter run the function with the given id for the specified
        argument dictionary."""
-    user_root = kwargs['user_root']
+    task_root = kwargs['task_root']
     kernel = kwargs['mvk']
-    user_frame, = yield [("RD", [user_root, "frame"])]
-    inst, body_id = yield [("RD", [user_frame, "IP"]), ("RD", [function_id, FUNCTION_BODY_KEY])]
+    task_frame, = yield [("RD", [task_root, "frame"])]
+    inst, body_id = yield [("RD", [task_frame, "IP"]), ("RD", [function_id, FUNCTION_BODY_KEY])]
     kernel.jit.mark_entry_point(body_id)
 
     # Create a new stack frame.
     frame_link, new_phase, new_frame, new_evalstack, new_symbols, \
         new_returnvalue, intrinsic_return = \
-                    yield [("RDE", [user_root, "frame"]),
+                    yield [("RDE", [task_root, "frame"]),
                            ("CNV", ["init"]),
                            ("CN", []),
                            ("CN", []),
@@ -64,14 +64,14 @@ def interpret_function(function_id, named_arguments, **kwargs):
                           ]
 
     _, _, _, _, _, _, _, _, _, _ = \
-                    yield [("CD", [user_root, "frame", new_frame]),
+                    yield [("CD", [task_root, "frame", new_frame]),
                            ("CD", [new_frame, "evalstack", new_evalstack]),
                            ("CD", [new_frame, "symbols", new_symbols]),
                            ("CD", [new_frame, "returnvalue", new_returnvalue]),
                            ("CD", [new_frame, "caller", inst]),
                            ("CD", [new_frame, "phase", new_phase]),
                            ("CD", [new_frame, "IP", body_id]),
-                           ("CD", [new_frame, "prev", user_frame]),
+                           ("CD", [new_frame, "prev", task_frame]),
                            ("CD", [
                                new_frame,
                                primitive_functions.EXCEPTION_RETURN_KEY,
@@ -91,7 +91,7 @@ def interpret_function(function_id, named_arguments, **kwargs):
         symbol_edge, = yield [("CE", [new_symbols, variable])]
         yield [("CE", [symbol_edge, param_var])]
 
-    username = kwargs['username']
+    taskname = kwargs['taskname']
     def exception_handler(ex):
         # print('Returning from interpreted function. Result: %s' % ex.result)
         raise primitive_functions.PrimitiveFinished(ex.result)
@@ -100,16 +100,16 @@ def interpret_function(function_id, named_arguments, **kwargs):
     yield [("TRY", [])]
     yield [("CATCH", [primitive_functions.InterpretedFunctionFinished, exception_handler])]
     while 1:
-        result, = yield [("CALL_ARGS", [kernel.execute_rule, (username,)])]
+        result, = yield [("CALL_ARGS", [kernel.execute_rule, (taskname,)])]
         # An instruction has completed. Forward it.
         yield result
 
 def get_input(**parameters):
     """Retrieves input."""
     mvk = parameters["mvk"]
-    user_root = parameters["user_root"]
+    task_root = parameters["task_root"]
     while 1:
-        yield [("CALL_ARGS", [mvk.input_init, (user_root,)])]
+        yield [("CALL_ARGS", [mvk.input_init, (task_root,)])]
         # Finished
         if mvk.success:
             # Got some input, so we can access it

+ 1 - 1
kernel/modelverse_kernel/compiled.py

@@ -452,4 +452,4 @@ def retype(a, b, c, **remainder):
         yield [("DE", [prev_edge])]
     t, =        yield [("CE", [tm, mm_ref])]
     yield [("CE", [t, m_ref])]
-    raise PrimitiveFinished(None)
+    raise PrimitiveFinished(None)

File diff suppressed because it is too large
+ 299 - 299
kernel/modelverse_kernel/legacy.py


File diff suppressed because it is too large
+ 318 - 318
kernel/modelverse_kernel/main.py


+ 2 - 2
kernel/modelverse_kernel/primitives.py

@@ -558,8 +558,8 @@ def log(a, **remainder):
     print("== LOG == " + str(a_value))
     raise PrimitiveFinished(a)
 
-def read_userroot(user_root, **remainder):
-    raise PrimitiveFinished(user_root)
+def read_taskroot(task_root, **remainder):
+    raise PrimitiveFinished(task_root)
 
 def time(**remainder):
     import time

+ 6 - 6
kernel/mvk_server/classes/executor.xml

@@ -65,22 +65,22 @@
                 <state id="queue">
                     <transition event="execute" target=".">
                         <parameter name="returnpath"/>
-                        <parameter name="username"/>
+                        <parameter name="taskname"/>
                         <parameter name="operation"/>
                         <parameter name="params"/>
                         <parameter name="request_id"/>
                         <script>
-                            self.request_queue.append((("/" + returnpath) if returnpath is not None else None, username, operation, params, request_id, True))
+                            self.request_queue.append((("/" + returnpath) if returnpath is not None else None, taskname, operation, params, request_id, True))
                         </script>
                     </transition>
                     <transition event="execute_debug" target=".">
                         <parameter name="returnpath"/>
-                        <parameter name="username"/>
+                        <parameter name="taskname"/>
                         <parameter name="operation"/>
                         <parameter name="params"/>
                         <parameter name="request_id"/>
                         <script>
-                            self.request_queue.append((("/" + returnpath) if returnpath is not None else None, username, operation, params, request_id, False))
+                            self.request_queue.append((("/" + returnpath) if returnpath is not None else None, taskname, operation, params, request_id, False))
                         </script>
                     </transition>
                 </state>
@@ -98,11 +98,11 @@
                             self.mvk.success = True
                             self.first = True
 
-                            self.returnpath, username, operation, params, self.request_id, self.mvk.allow_compiled = self.request_queue.pop(0)
+                            self.returnpath, taskname, operation, params, self.request_id, self.mvk.allow_compiled = self.request_queue.pop(0)
                             reply = None
                             commands = []
                             while 1:
-                                commands = self.mvk.execute_yields(username, operation, params, reply)
+                                commands = self.mvk.execute_yields(taskname, operation, params, reply)
                                 if commands is None:
                                     break
                                 reply = [self.mvs_operations[command[0]](*(command[1]))[0] for command in commands]

+ 46 - 46
kernel/mvk_server/classes/mvkcontroller.xml

@@ -2,17 +2,17 @@
     <relationships>
         <association name="to_mvs" class="HTTPClient" min="1" max="1"/>
         <association name="to_mvi" class="Server" min="1" max="1"/>
-        <association name="users" class="UserStatechart"/>
+        <association name="tasks" class="UserStatechart"/>
         <association name="executor" class="Executor" min="1" max="1"/>
     </relationships>
     <constructor>
         <parameter name="params"/>
         <body>
             <![CDATA[
-            self.users = []
-            self.user_statecharts = {"__hierarchy": None}
+            self.tasks = []
+            self.task_statecharts = {"__hierarchy": None}
             self.input_queue = []
-            self.user_queue = {}
+            self.task_queue = {}
             self.source = None
             self.root = None
 
@@ -101,12 +101,12 @@
                                     else:
                                         value = json.loads(data["data"])
                                     for v in value[:-1]:
-                                        self.input_queue.append((None, data["op"], [v], data["username"]))
-                                    self.input_queue.append((source, data["op"], [value[-1]], data["username"]))
+                                        self.input_queue.append((None, data["op"], [v], data["taskname"]))
+                                    self.input_queue.append((source, data["op"], [value[-1]], data["taskname"]))
                                     print("Added to input queue")
                                 else:
                                     print("Appending " + data["op"])
-                                    self.input_queue.append((source, data["op"], args, data["username"]))
+                                    self.input_queue.append((source, data["op"], args, data["taskname"]))
                             except ValueError:
                                 print("Error when deserializing request: " + str(data))
                                 raise
@@ -117,16 +117,16 @@
 
             <state id="push" initial="wait">
                 <state id="wait">
-                    <transition cond="self.input_queue and self.input_queue[0][3] in self.user_statecharts" target="../process"/>
+                    <transition cond="self.input_queue and self.input_queue[0][3] in self.task_statecharts" target="../process"/>
                     <!-- User is not yet detected, so stall this message -->
-                    <transition cond="self.input_queue and self.input_queue[0][3] not in self.user_statecharts" target=".">
-                        <!-- Move it to the back of the list, so we can process other users first -->
+                    <transition cond="self.input_queue and self.input_queue[0][3] not in self.task_statecharts" target=".">
+                        <!-- Move it to the back of the list, so we can process other tasks first -->
                         <script>
-                            print("Queue user")
-                            self.user_queue.setdefault(self.input_queue[0][3], []).append(self.input_queue.pop(0))
+                            print("Queue task")
+                            self.task_queue.setdefault(self.input_queue[0][3], []).append(self.input_queue.pop(0))
                         </script>
                         <!-- Force a refresh too -->
-                        <raise event="force_user_refresh"/>
+                        <raise event="force_task_refresh"/>
                     </transition>
 
                 </state>
@@ -134,9 +134,9 @@
                 <state id="process">
                     <transition cond="self.input_queue[0][1] == 'set_input'" target="../wait">
                         <script>
-                            source, op, args, username = self.input_queue.pop(0)
+                            source, op, args, taskname = self.input_queue.pop(0)
                         </script>
-                        <raise event="set_input" scope="narrow" target="self.user_statecharts[username]">
+                        <raise event="set_input" scope="narrow" target="self.task_statecharts[taskname]">
                             <parameter expr="source"/>
                             <parameter expr="args"/>
                         </raise>
@@ -144,9 +144,9 @@
 
                     <transition cond="self.input_queue[0][1] == 'get_output'" target="../wait">
                         <script>
-                            source, op, args, username = self.input_queue.pop(0)
+                            source, op, args, taskname = self.input_queue.pop(0)
                         </script>
-                        <raise event="get_output" scope="narrow" target="self.user_statecharts[username]">
+                        <raise event="get_output" scope="narrow" target="self.task_statecharts[taskname]">
                             <parameter expr="source"/>
                             <parameter expr="args"/>
                         </raise>
@@ -155,9 +155,9 @@
                     <transition cond="self.input_queue[0][1] == 'pause'" target="../wait">
                         <script>
                             print("Sending pause")
-                            source, op, args, username = self.input_queue.pop(0)
+                            source, op, args, taskname = self.input_queue.pop(0)
                         </script>
-                        <raise event="pause" scope="narrow" target="self.user_statecharts[username]">
+                        <raise event="pause" scope="narrow" target="self.task_statecharts[taskname]">
                             <parameter expr="source"/>
                             <parameter expr="args"/>
                         </raise>
@@ -165,9 +165,9 @@
                     
                     <transition cond="self.input_queue[0][1] == 'resume'" target="../wait">
                         <script>
-                            source, op, args, username = self.input_queue.pop(0)
+                            source, op, args, taskname = self.input_queue.pop(0)
                         </script>
-                        <raise event="resume" scope="narrow" target="self.user_statecharts[username]">
+                        <raise event="resume" scope="narrow" target="self.task_statecharts[taskname]">
                             <parameter expr="source"/>
                             <parameter expr="args"/>
                         </raise>
@@ -175,7 +175,7 @@
                 </state>
             </state>
 
-            <state id="find_users" initial="get_all_links">
+            <state id="find_tasks" initial="get_all_links">
                 <state id="get_all_links">
                     <onentry>
                         <raise event="raw_exec" scope="narrow" target="'executor'">
@@ -184,54 +184,54 @@
                         </raise>
                     </onentry>
 
-                    <transition event="raw_exec_reply" target="../retrieve_users">
+                    <transition event="raw_exec_reply" target="../retrieve_tasks">
                         <parameter name="data"/>
                         <script>
-                            self.users = data[0][0]
+                            self.tasks = data[0][0]
                         </script>
                     </transition>
                 </state>
 
-                <state id="retrieve_users">
-                    <transition cond="self.users" target="../got_usernames">
+                <state id="retrieve_tasks">
+                    <transition cond="self.tasks" target="../got_tasknames">
                         <raise event="raw_exec" scope="narrow" target="'executor'">
-                            <parameter expr="[['RV', [user]] for user in self.users]"/>
+                            <parameter expr="[['RV', [task]] for task in self.tasks]"/>
                             <parameter expr="'parent'"/>
                         </raise>
                     </transition>
-                    <transition cond="not self.users" target="../wait"/>
+                    <transition cond="not self.tasks" target="../wait"/>
                 </state>
 
-                <state id="got_usernames">
-                    <transition event="raw_exec_reply" target="../process_users">
+                <state id="got_tasknames">
+                    <transition event="raw_exec_reply" target="../process_tasks">
                         <parameter name="data"/>
                         <script>
                             data = set([v[0] for v in data])
-                            self.add_users = [v for v in data if v not in self.user_statecharts]
-                            self.delete_users = [v for v in self.user_statecharts if v not in data]
+                            self.add_tasks = [v for v in data if v not in self.task_statecharts]
+                            self.delete_tasks = [v for v in self.task_statecharts if v not in data]
                         </script>
                     </transition>
                 </state>
 
-                <state id="process_users">
-                    <transition cond="not self.add_users and not self.delete_users" target="../wait"/>
-                    <transition cond="self.add_users and not self.delete_users" target="../creating_user">
+                <state id="process_tasks">
+                    <transition cond="not self.add_tasks and not self.delete_tasks" target="../wait"/>
+                    <transition cond="self.add_tasks and not self.delete_tasks" target="../creating_task">
                         <raise event="create_instance" scope="cd">
-                            <parameter expr="'users'"/>
+                            <parameter expr="'tasks'"/>
                             <parameter expr="'UserStatechart'"/>
-                            <parameter expr="self.add_users[0]"/>
+                            <parameter expr="self.add_tasks[0]"/>
                             <parameter expr="self.mvk"/>
                         </raise>
                     </transition>
-                    <transition cond="self.delete_users" target=".">
+                    <transition cond="self.delete_tasks" target=".">
                         <raise event="delete_instance" scope="cd">
-                            <parameter expr="self.user_statecharts.pop(self.delete_users.pop(0))"/>
+                            <parameter expr="self.task_statecharts.pop(self.delete_tasks.pop(0))"/>
                         </raise>
                     </transition>
                 </state>
 
-                <state id="creating_user">
-                    <transition event="instance_created" target="../retrieve_users">
+                <state id="creating_task">
+                    <transition event="instance_created" target="../retrieve_tasks">
                         <parameter name="instancename"/>
                         <raise scope="cd" event="start_instance">
                             <parameter expr="instancename"/>
@@ -240,17 +240,17 @@
                             <parameter expr="instancename"/>
                         </raise>
                         <script>
-                            self.user_statecharts[self.add_users[0]] = instancename
-                            # Repush all this user's messages in the input queue
-                            self.input_queue.extend(self.user_queue.pop(self.add_users[0], []))
-                            self.add_users.pop(0)
+                            self.task_statecharts[self.add_tasks[0]] = instancename
+                            # Repush all this task's messages in the input queue
+                            self.input_queue.extend(self.task_queue.pop(self.add_tasks[0], []))
+                            self.add_tasks.pop(0)
                         </script>
                     </transition>
                 </state>
 
                 <state id="wait">
                     <transition after="1.0" target="../get_all_links"/>
-                    <transition event="force_user_refresh" target="../get_all_links"/>
+                    <transition event="force_task_refresh" target="../get_all_links"/>
                 </state>
             </state>
         </parallel>

+ 7 - 7
kernel/mvk_server/classes/user_statechart.xml

@@ -3,11 +3,11 @@
         <association name="parent" class="MvKController" min="1" max="1"/>
     </relationships>
     <constructor>
-        <parameter name="username"/>
+        <parameter name="taskname"/>
         <parameter name="mvk" />
         <body>
             <![CDATA[
-            self.username = username
+            self.taskname = taskname
             self.mvk = mvk
 
             self.output_queue = []
@@ -37,7 +37,7 @@
                         <onentry>
                             <raise event="execute" scope="narrow" target="'parent/executor'">
                                 <parameter expr="self.returnpath"/>
-                                <parameter expr="self.username"/>
+                                <parameter expr="self.taskname"/>
                                 <parameter expr="'execute_rule'"/>
                                 <parameter expr="[]"/>
                                 <parameter expr="self.request_id"/>
@@ -68,7 +68,7 @@
                         <parameter name="source"/>
                         <parameter name="args"/>
                         <raise event="HTTP_input" scope="narrow" target="'parent/to_mvi/' + source">
-                            <parameter expr="json.dumps({'user': self.username, 'state': 'paused', 'info': self.mvk.debug_info[self.username]})"/>
+                            <parameter expr="json.dumps({'task': self.taskname, 'state': 'paused', 'info': self.mvk.debug_info[self.taskname]})"/>
                         </raise>
                     </transition>
                 </state>
@@ -77,7 +77,7 @@
                         <parameter name="source"/>
                         <parameter name="args"/>
                         <raise event="HTTP_input" scope="narrow" target="'parent/to_mvi/' + source">
-                            <parameter expr="json.dumps({'user': self.username, 'state': 'running'})"/>
+                            <parameter expr="json.dumps({'task': self.taskname, 'state': 'running'})"/>
                         </raise>
                     </transition>
                 </state>
@@ -90,7 +90,7 @@
                         <parameter name="args"/>
                         <raise event="execute" scope="narrow" target="'parent/executor'">
                             <parameter expr="self.returnpath"/>
-                            <parameter expr="self.username"/>
+                            <parameter expr="self.taskname"/>
                             <parameter expr="'set_input'"/>
                             <parameter expr="args"/>
                             <parameter expr="self.request_id"/>
@@ -133,7 +133,7 @@
                     <transition cond="self.outstanding_output is None and self.output_queue" target=".">
                         <raise event="execute" scope="narrow" target="'parent/executor'">
                             <parameter expr="self.returnpath"/>
-                            <parameter expr="self.username"/>
+                            <parameter expr="self.taskname"/>
                             <parameter expr="'get_output'"/>
                             <parameter expr="[]"/>
                             <parameter expr="self.request_id"/>

+ 1 - 1
kernel/mvk_server/server.xml

@@ -22,6 +22,6 @@
     <class src="classes/server.xml"/>
     <class src="classes/socket.xml"/>
     <class src="classes/http_client.xml"/>
-    <class src="classes/user_statechart.xml"/>
+    <class src="classes/task_statechart.xml"/>
     <class src="classes/executor.xml"/>
 </diagram>

+ 3 - 3
kernel/test/functions/factorial.eps

@@ -167,12 +167,12 @@ def
 % /arrowwidth 5 def
 
 % make sure pdfmark is harmless for PS-interpreters other than Distiller
-/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+/pdfmark where {pop} {taskdict /pdfmark /cleartomark load put} ifelse
 % make '<<' and '>>' safe on PS Level 1 devices
 /languagelevel where {pop languagelevel}{1} ifelse
 2 lt {
-    userdict (<<) cvn ([) cvn load put
-    userdict (>>) cvn ([) cvn load put
+    taskdict (<<) cvn ([) cvn load put
+    taskdict (>>) cvn ([) cvn load put
 } if
 
 %%EndSetup

+ 3 - 3
kernel/test/functions/fib_naive.eps

@@ -167,12 +167,12 @@ def
 % /arrowwidth 5 def
 
 % make sure pdfmark is harmless for PS-interpreters other than Distiller
-/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
+/pdfmark where {pop} {taskdict /pdfmark /cleartomark load put} ifelse
 % make '<<' and '>>' safe on PS Level 1 devices
 /languagelevel where {pop languagelevel}{1} ifelse
 2 lt {
-    userdict (<<) cvn ([) cvn load put
-    userdict (>>) cvn ([) cvn load put
+    taskdict (<<) cvn ([) cvn load put
+    taskdict (>>) cvn ([) cvn load put
 } if
 
 %%EndSetup

+ 3 - 3
kernel/test/functions/test_factorial.py

@@ -1,6 +1,6 @@
 import unittest
 from modelverse_kernel.main import ModelverseKernel
-from utils import execute_until_finished, MvSWrapper, get_inst, get_phase, get_returnvalue, get_phase_ref, read_primitive_interfaces, get_inst_ref, add_new_user
+from utils import execute_until_finished, MvSWrapper, get_inst, get_phase, get_returnvalue, get_phase_ref, read_primitive_interfaces, get_inst_ref, add_new_task
 import math
 
 class TestFactorial(unittest.TestCase):
@@ -178,9 +178,9 @@ class TestFactorial(unittest.TestCase):
         self.mvs.execute("CD", [invoke_factorial, "next", const_5])
         self.mvs.execute("CD", [const_5, "node", value_c])
 
-        execute_until_finished(self.mvk, self.mvs, "initialize_new_user", [])
+        execute_until_finished(self.mvk, self.mvs, "initialize_new_task", [])
 
-        t = self.mvs.execute("CE", [self.mvs.execute("RD", [self.mvs.execute("RD", [root, "user_1"])[0], "globals"])[0] , var_value_4])[0]
+        t = self.mvs.execute("CE", [self.mvs.execute("RD", [self.mvs.execute("RD", [root, "task_1"])[0], "globals"])[0] , var_value_4])[0]
         self.mvs.execute("CE", [t, var_4])
 
         ### Execute rules

+ 3 - 3
kernel/test/functions/test_fib_naive.py

@@ -213,10 +213,10 @@ class TestFibNaive(unittest.TestCase):
         self.mvs.execute("CD", [invoke_fib, "next", const_6])
         self.mvs.execute("CD", [const_6, "node", value_c])
 
-        execute_until_finished(self.mvk, self.mvs, "initialize_new_user", ["user_1"])
+        execute_until_finished(self.mvk, self.mvs, "initialize_new_task", ["task_1"])
 
-        # Define in globals for user, kind of a hack...
-        t = self.mvs.execute("CE", [self.mvs.execute("RD", [self.mvs.execute("RD", [root, "user_1"])[0], "globals"])[0] , var_value_4])[0]
+        # Define in globals for task, kind of a hack...
+        t = self.mvs.execute("CE", [self.mvs.execute("RD", [self.mvs.execute("RD", [root, "task_1"])[0], "globals"])[0] , var_value_4])[0]
         self.mvs.execute("CE", [t, var_4])
 
         ### Execute rules

+ 31 - 31
kernel/test/functions/utils.py

@@ -34,11 +34,11 @@ class MvSWrapper(object):
 
         return [retval[0]]
 
-def add_new_user(root, mvs, username):
+def add_new_task(root, mvs, taskname):
     hierarchy = mvs.execute("RD", [root, "__hierarchy"])[0]
     initial = mvs.execute("RD", [hierarchy, "__IP"])[0]
 
-    user_root = mvs.execute("CN", [])[0]
+    task_root = mvs.execute("CN", [])[0]
     _globals = mvs.execute("CN", [])[0]
     frame = mvs.execute("CN", [])[0]
     evalstack = mvs.execute("CN", [])[0]
@@ -48,13 +48,13 @@ def add_new_user(root, mvs, username):
     returnvalue = mvs.execute("CN", [])[0]
     phase = mvs.execute("CNV", ["init"])[0]
 
-    mvs.execute("CD", [root, username, user_root])
-    mvs.execute("CD", [user_root, "frame", frame])
-    mvs.execute("CD", [user_root, "globals", _globals])
-    mvs.execute("CD", [user_root, "input", _input])
-    mvs.execute("CD", [user_root, "last_input", _input])
-    mvs.execute("CD", [user_root, "output", _output])
-    mvs.execute("CD", [user_root, "last_output", _output])
+    mvs.execute("CD", [root, taskname, task_root])
+    mvs.execute("CD", [task_root, "frame", frame])
+    mvs.execute("CD", [task_root, "globals", _globals])
+    mvs.execute("CD", [task_root, "input", _input])
+    mvs.execute("CD", [task_root, "last_input", _input])
+    mvs.execute("CD", [task_root, "output", _output])
+    mvs.execute("CD", [task_root, "last_output", _output])
     mvs.execute("CD", [frame, "evalstack", evalstack])
     mvs.execute("CD", [frame, "returnvalue", returnvalue])
     mvs.execute("CD", [frame, "phase", phase])
@@ -62,12 +62,12 @@ def add_new_user(root, mvs, username):
     mvs.execute("CD", [frame, "symbols", symbols])
 
 def execute_until_finished(mvk, mvs, operation="execute_rule", params=[]):
-    username = "user_1"
-    if operation == "initialize_new_user":
-        return add_new_user(mvk.root, mvs, username)
+    taskname = "task_1"
+    if operation == "initialize_new_task":
+        return add_new_task(mvk.root, mvs, taskname)
     response = None
     while 1:
-        mvs_commands = mvk.execute_yields(username, operation, params, response)
+        mvs_commands = mvk.execute_yields(taskname, operation, params, response)
         if mvs_commands is None:
             break
         response = []
@@ -75,37 +75,37 @@ def execute_until_finished(mvk, mvs, operation="execute_rule", params=[]):
             response.append(mvs.execute(command, param)[0])
 
 def get_inst(root, mvs):
-    user_root = mvs.execute("RD", [root, "user_1"])[0]
-    user_frame = mvs.execute("RD", [user_root, "frame"])[0]
-    inst = mvs.execute("RD", [user_frame, "IP"])[0]
+    task_root = mvs.execute("RD", [root, "task_1"])[0]
+    task_frame = mvs.execute("RD", [task_root, "frame"])[0]
+    inst = mvs.execute("RD", [task_frame, "IP"])[0]
     return mvs.execute("RV", [inst])[0]["value"]
 
 def get_phase(root, mvs):
-    user_root = mvs.execute("RD", [root, "user_1"])[0]
-    user_frame = mvs.execute("RD", [user_root, "frame"])[0]
-    phase = mvs.execute("RD", [user_frame, "phase"])[0]
+    task_root = mvs.execute("RD", [root, "task_1"])[0]
+    task_frame = mvs.execute("RD", [task_root, "frame"])[0]
+    phase = mvs.execute("RD", [task_frame, "phase"])[0]
     return mvs.execute("RV", [phase])[0]
 
 def get_returnvalue(root, mvs):
-    user_root = mvs.execute("RD", [root, "user_1"])[0]
-    user_frame = mvs.execute("RD", [user_root, "frame"])[0]
-    returnvalue = mvs.execute("RD", [user_frame, "returnvalue"])[0]
+    task_root = mvs.execute("RD", [root, "task_1"])[0]
+    task_frame = mvs.execute("RD", [task_root, "frame"])[0]
+    returnvalue = mvs.execute("RD", [task_frame, "returnvalue"])[0]
     return mvs.execute("RV", [returnvalue])[0]
 
 def get_inst_ref(root, mvs):
-    user_root = mvs.execute("RD", [root, "user_1"])[0]
-    user_frame = mvs.execute("RD", [user_root, "frame"])[0]
-    return mvs.execute("RD", [user_frame, "IP"])[0]
+    task_root = mvs.execute("RD", [root, "task_1"])[0]
+    task_frame = mvs.execute("RD", [task_root, "frame"])[0]
+    return mvs.execute("RD", [task_frame, "IP"])[0]
 
 def get_returnvalue_ref(root, mvs):
-    user_root = mvs.execute("RD", [root, "user_1"])[0]
-    user_frame = mvs.execute("RD", [user_root, "frame"])[0]
-    return mvs.execute("RD", [user_frame, "returnvalue"])[0]
+    task_root = mvs.execute("RD", [root, "task_1"])[0]
+    task_frame = mvs.execute("RD", [task_root, "frame"])[0]
+    return mvs.execute("RD", [task_frame, "returnvalue"])[0]
 
 def get_phase_ref(root, mvs):
-    user_root = mvs.execute("RD", [root, "user_1"])[0]
-    user_frame = mvs.execute("RD", [user_root, "frame"])[0]
-    phase = mvs.execute("RD", [user_frame, "phase"])[0]
+    task_root = mvs.execute("RD", [root, "task_1"])[0]
+    task_frame = mvs.execute("RD", [task_root, "frame"])[0]
+    phase = mvs.execute("RD", [task_frame, "phase"])[0]
     return phase
 
 def read_primitive_interfaces(root, mvs):

+ 9 - 9
kernel/test/instructions/test_instruction_access.py

@@ -8,19 +8,19 @@ class Testaccess(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_access(self):
         """
@@ -35,7 +35,7 @@ class Testaccess(unittest.TestCase):
 
         self.value_a = self.mvs.execute("CNV", ["a"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "var", self.resolve])
         self.mvs.execute("CD", [self.resolve, "var", self.var])
         self.mvs.execute("CD", [self.value, "value", self.const_a])

+ 10 - 10
kernel/test/instructions/test_instruction_assign.py

@@ -8,19 +8,19 @@ class TestAssign(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_assign_simple(self):
         """
@@ -36,7 +36,7 @@ class TestAssign(unittest.TestCase):
         self.inst = self.mvs.execute("CNV", [{"value":"assign"}])[0]
         self.resolve = self.mvs.execute("CNV", [{"value":"resolve"}])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "var", self.resolve])
         self.mvs.execute("CD", [self.inst, "value", self.const])
         self.mvs.execute("CD", [self.resolve, "var", self.var])
@@ -79,7 +79,7 @@ class TestAssign(unittest.TestCase):
         self.assertEquals(get_phase(self.root, self.mvs), "finish")
 
         # Check if the new value is really assigned
-        t = self.mvs.execute("RD", [self.root, "user_1"])[0]
+        t = self.mvs.execute("RD", [self.root, "task_1"])[0]
         t = self.mvs.execute("RD", [t, "frame"])[0]
         t = self.mvs.execute("RD", [t, "symbols"])[0]
         t = self.mvs.execute("RDN", [t, self.var])[0]

+ 9 - 9
kernel/test/instructions/test_instruction_break.py

@@ -8,19 +8,19 @@ class TestBreak(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_break(self):
         """
@@ -41,7 +41,7 @@ class TestBreak(unittest.TestCase):
         self.value_cond = self.mvs.execute("CNV", [True])[0]
         self.break_inst = self.mvs.execute("CNV", [{"value":"break"}])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "cond", self.const_cond])
         self.mvs.execute("CD", [self.inst, "body", self.const_a])
         self.mvs.execute("CD", [self.inst, "next", self.const_c])

+ 12 - 12
kernel/test/instructions/test_instruction_call.py

@@ -8,19 +8,19 @@ class Testcall(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_no_params(self):
         """
@@ -44,7 +44,7 @@ class Testcall(unittest.TestCase):
         self.const_a = self.mvs.execute("CNV", [{"value":"constant"}])[0]
         self.value_a = self.mvs.execute("CNV", ["a"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "func", self.access])
         self.mvs.execute("CD", [self.inst, "next", self.const_a])
         self.mvs.execute("CD", [self.access, "var", self.resolve])
@@ -128,7 +128,7 @@ class Testcall(unittest.TestCase):
         self.value_abc = self.mvs.execute("CNV", ["abc"])[0]
         self.value_def = self.mvs.execute("CNV", ["def"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "func", self.access])
         self.mvs.execute("CD", [self.inst, "next", self.const_a])
         self.mvs.execute("CD", [self.inst, "params", self.actual_arg])
@@ -237,7 +237,7 @@ class Testcall(unittest.TestCase):
         self.value_e = self.mvs.execute("CNV", ["e"])[0]
         self.value_f = self.mvs.execute("CNV", ["f"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "func", self.access])
         self.mvs.execute("CD", [self.inst, "next", self.const_a])
         self.mvs.execute("CD", [self.inst, "params", self.actual_arg_a])
@@ -369,7 +369,7 @@ class Testcall(unittest.TestCase):
         self.value_e = self.mvs.execute("CNV", ["e"])[0]
         self.value_f = self.mvs.execute("CNV", ["f"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "func", self.access])
         self.mvs.execute("CD", [self.inst, "next", self.const_a])
         self.mvs.execute("CD", [self.inst, "params", self.actual_arg_a])

+ 9 - 9
kernel/test/instructions/test_instruction_continue.py

@@ -8,19 +8,19 @@ class Testcontinue(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_continue(self):
         """
@@ -41,7 +41,7 @@ class Testcontinue(unittest.TestCase):
         self.value_cond = self.mvs.execute("CNV", [True])[0]
         self.continue_inst = self.mvs.execute("CNV", [{"value":"continue"}])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "cond", self.const_cond])
         self.mvs.execute("CD", [self.inst, "body", self.const_a])
         self.mvs.execute("CD", [self.inst, "next", self.const_c])

+ 12 - 12
kernel/test/instructions/test_instruction_declare.py

@@ -8,27 +8,27 @@ class TestDeclare(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
         self.globals = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_root, "globals", self.globals])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_root, "globals", self.globals])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_declare(self):
         self.inst = self.mvs.execute("CNV", [{"value":"declare"}])[0]
         self.var = self.mvs.execute("CN", [])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "var", self.var])
 
         ### Execute rules
@@ -41,11 +41,11 @@ class TestDeclare(unittest.TestCase):
         self.assertNotEquals(self.mvs.execute("RDN", [self.symbols, self.var])[0], None)
 
     def test_global(self):
-        self.global_symbols = self.mvs.execute("RD", [self.user_root, "globals"])[0]
+        self.global_symbols = self.mvs.execute("RD", [self.task_root, "globals"])[0]
         self.inst = self.mvs.execute("CNV", [{"value":"global"}])[0]
         self.var = self.mvs.execute("CNV", ["abc"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "var", self.var])
 
         ### Execute rules

+ 12 - 12
kernel/test/instructions/test_instruction_if.py

@@ -8,19 +8,19 @@ class Testif(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_if_true_with_else(self):
         """
@@ -43,7 +43,7 @@ class Testif(unittest.TestCase):
         self.value_c = self.mvs.execute("CNV", ["c"])[0]
         self.value_true = self.mvs.execute("CNV", [True])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "cond", self.const_true])
         self.mvs.execute("CD", [self.inst, "then", self.const_a])
         self.mvs.execute("CD", [self.inst, "else", self.const_b])
@@ -109,7 +109,7 @@ class Testif(unittest.TestCase):
         self.value_c = self.mvs.execute("CNV", ["c"])[0]
         self.value_true = self.mvs.execute("CNV", [True])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "cond", self.const_true])
         self.mvs.execute("CD", [self.inst, "then", self.const_a])
         self.mvs.execute("CD", [self.inst, "next", self.const_c])
@@ -177,7 +177,7 @@ class Testif(unittest.TestCase):
         self.value_c = self.mvs.execute("CNV", ["c"])[0]
         self.value_false = self.mvs.execute("CNV", [False])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "cond", self.const_false])
         self.mvs.execute("CD", [self.inst, "then", self.const_a])
         self.mvs.execute("CD", [self.inst, "else", self.const_b])
@@ -243,7 +243,7 @@ class Testif(unittest.TestCase):
         self.value_c = self.mvs.execute("CNV", ["c"])[0]
         self.value_false = self.mvs.execute("CNV", [False])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
+        self.mvs.execute("CD", [self.task_frame, "IP", self.inst])
         self.mvs.execute("CD", [self.inst, "cond", self.const_false])
         self.mvs.execute("CD", [self.inst, "then", self.const_a])
         self.mvs.execute("CD", [self.inst, "next", self.const_c])

+ 13 - 13
kernel/test/instructions/test_instruction_input.py

@@ -8,21 +8,21 @@ class TestInput(unittest.TestCase):
         self.root = self.mvs.execute("RR", [])[0]
         self.mvk = ModelverseKernel(self.root)
 
-        self.user_root = self.mvs.execute("CN", [])[0]
-        self.user_frame = self.mvs.execute("CN", [])[0]
-        self.user_input = self.mvs.execute("CN", [])[0]
+        self.task_root = self.mvs.execute("CN", [])[0]
+        self.task_frame = self.mvs.execute("CN", [])[0]
+        self.task_input = self.mvs.execute("CN", [])[0]
         self.symbols = self.mvs.execute("CN", [])[0]
         self.evalstack = self.mvs.execute("CN", [])[0]
         self.returnvalue = self.mvs.execute("CN", [])[0]
         self.phase = self.mvs.execute("CNV", ["init"])[0]
 
-        self.mvs.execute("CD", [self.root, "user_1", self.user_root])
-        self.mvs.execute("CD", [self.user_root, "input", self.user_input])
-        self.mvs.execute("CD", [self.user_root, "frame", self.user_frame])
-        self.mvs.execute("CD", [self.user_frame, "symbols", self.symbols])
-        self.mvs.execute("CD", [self.user_frame, "evalstack", self.evalstack])
-        self.mvs.execute("CD", [self.user_frame, "phase", self.phase])
-        self.mvs.execute("CD", [self.user_frame, "returnvalue", self.returnvalue])
+        self.mvs.execute("CD", [self.root, "task_1", self.task_root])
+        self.mvs.execute("CD", [self.task_root, "input", self.task_input])
+        self.mvs.execute("CD", [self.task_root, "frame", self.task_frame])
+        self.mvs.execute("CD", [self.task_frame, "symbols", self.symbols])
+        self.mvs.execute("CD", [self.task_frame, "evalstack", self.evalstack])
+        self.mvs.execute("CD", [self.task_frame, "phase", self.phase])
+        self.mvs.execute("CD", [self.task_frame, "returnvalue", self.returnvalue])
 
     def test_input(self):
         self.input_value = self.mvs.execute("CN", [])[0]
@@ -30,9 +30,9 @@ class TestInput(unittest.TestCase):
 
         self.value_a = self.mvs.execute("CNV", ["a"])[0]
 
-        self.mvs.execute("CD", [self.user_frame, "IP", self.inst])
-        self.mvs.execute("CD", [self.user_input, "next", self.input_value])
-        self.mvs.execute("CD", [self.user_input, "value", self.value_a])
+