Commit 5c4735b3 authored by Sarah Grebing's avatar Sarah Grebing

possible bugfix for subtree view stepinto

parent 49085499
Pipeline #23720 passed with stages
in 2 minutes and 40 seconds
...@@ -1462,10 +1462,17 @@ public class DebuggerMain implements Initializable { ...@@ -1462,10 +1462,17 @@ public class DebuggerMain implements Initializable {
ptree.setDeactivateRefresh(false); ptree.setDeactivateRefresh(false);
if (stateAfterStmt.size() > 0) { if (stateAfterStmt.size() > 0) {
Set<Node> sentinels = proof.getSubtreeGoals(pnode) proof.getSubtreeGoals(pnode).forEach(goal -> System.out.println("goal.node().serialNr() = " + goal.node().serialNr()));
Set<Node> sentinels;
sentinels = proof.getSubtreeGoals(pnode)
.stream() .stream()
.map(Goal::node) .map(Goal::node)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
if(sentinels.size() == 0){
sentinels = new LinkedHashSet();
sentinels.add(pnode);
//sentinels.add(stateAfterStmt.get(0).getData().getNode());
}
ptree.getSentinels().addAll(sentinels); ptree.getSentinels().addAll(sentinels);
sentinels.forEach(node -> ptree.setNodeColor(node, "blueviolet")); sentinels.forEach(node -> ptree.setNodeColor(node, "blueviolet"));
} else { } else {
...@@ -1481,7 +1488,6 @@ public class DebuggerMain implements Initializable { ...@@ -1481,7 +1488,6 @@ public class DebuggerMain implements Initializable {
//traverseProofTreeAndAddSentinelsToLeaves(); //traverseProofTreeAndAddSentinelsToLeaves();
} }
ptree.expandRootToSentinels(); ptree.expandRootToSentinels();
System.out.println("ptree = " + ptree.getRoot()); System.out.println("ptree = " + ptree.getRoot());
DockNode node = new DockNode(ptree, "Proof Tree for Step Into: " + DockNode node = new DockNode(ptree, "Proof Tree for Step Into: " +
......
...@@ -159,13 +159,16 @@ public class ProofTree extends BorderPane { ...@@ -159,13 +159,16 @@ public class ProofTree extends BorderPane {
this.colorOfNodes.put(n, color); this.colorOfNodes.put(n, color);
} }
public void expandRootToSentinels() { public void expandRootToSentinels() {
if (getTreeProof().getRoot() == null) { if (getTreeProof().getRoot() == null) {
if (root.get() != null) { if (root.get() != null) {
TreeItem<TreeNode> item = treeCreation.populate("Proof", root.get()); TreeItem<TreeNode> item;
// populate(root.get().serialNr() + ": " + root.get().serialNr(), root.get()); if(sentinels.contains(root.get())){
//val treeNode = new TreeNode("Proof", root.get()); item = treeCreation.itemFactory(root.get());
} else {
item = treeCreation.populate("Proof", root.get());
}
treeProof.setRoot(item); treeProof.setRoot(item);
} }
...@@ -438,6 +441,8 @@ public class ProofTree extends BorderPane { ...@@ -438,6 +441,8 @@ public class ProofTree extends BorderPane {
node = node.child(0); node = node.child(0);
currentItem.getChildren().add(new TreeItem<>(new TreeNode(node.serialNr() + ": " + toString(node), node))); currentItem.getChildren().add(new TreeItem<>(new TreeNode(node.serialNr() + ": " + toString(node), node)));
} }
/*do { /*do {
currentItem.getChildren().add(itemFactory(node)); currentItem.getChildren().add(itemFactory(node));
node = node.child(0); node = node.child(0);
......
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