Commit d4225b0b authored by Lulu Luong's avatar Lulu Luong

Merge remote-tracking branch 'remotes/origin/master' into luong_compactInteractive

+ apply Bugfix for failing tests
                                                                                           # Conflicts:
                                                                                           #	ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controller/InteractiveModeController.java
parent 7341607c
Pipeline #38956 passed with stages
in 2 minutes and 38 seconds
......@@ -35,7 +35,11 @@ public class GoalNode<T> {
private int id = super.hashCode();
public GoalNode(T data) {
this(null, new VariableAssignment(), data, false);
this.assignments = new VariableAssignment();
this.parent = null;
this.data = data;
this.isClosed = false;
// this(null, new VariableAssignment(), data, false);
}
public GoalNode(@Nonnull GoalNode<T> parent, T data, boolean isClosed) {
......@@ -54,8 +58,8 @@ public class GoalNode<T> {
this.id = id;
}
private GoalNode(int id, GoalNode<T> parent, VariableAssignment ass, T data, boolean isClosed) {
this(parent, ass, data, isClosed);
private GoalNode(int id, GoalNode<T> parent, VariableAssignment varas, T data, boolean isClosed) {
this(parent, varas, data, isClosed);
this.id = id;
}
......@@ -65,6 +69,13 @@ public class GoalNode<T> {
this.id = id;
}
private GoalNode(int id, VariableAssignment ass, T data, boolean isClosed) {
this(data);
this.assignments = ass;
this.isClosed = isClosed;
this.id = id;
}
/**
* @param varname
* @return value of variable if it exists
......@@ -133,11 +144,13 @@ public class GoalNode<T> {
* @return
*/
public GoalNode<T> deepCopy() {
VariableAssignment deepCopy = assignments.deepCopy();
if (parent != null) {
VariableAssignment deepCopy = parent.assignments.deepCopy();
return new GoalNode<T>(id, parent.deepCopy(), deepCopy, data, isClosed);
} else {
return new GoalNode<T>(id, data, isClosed);
return new GoalNode<T>(id, deepCopy, data, isClosed);
}
}
......
......@@ -42,7 +42,7 @@ public class InterpreterTest {
Interpreter<String> i = new Interpreter<>(createTestLookup(scripts));
i.setMatcherApi(new PseudoMatcher());
//i.getEntryListeners().add(new ScopeLogger("scope:"));
i.newState(new GoalNode<>(null, "abc", false));
i.newState(new GoalNode<>("abc"));
i.interpret(scripts.get(0));
return i;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment