public boolean isDoomedState() { /* this is irrelevant */ return false; }
public Forest getForest() { return f; }
public String toString() { return super.toString()+"->"+phase(); }
+ public boolean hasPathToRoot() {
+ if (predecessorPhase()==null) return true;
+ return super.hasPathToRoot();
+ }
public void check() {
if (destroyed) return;
- if (successors.size()==0) destroy();
- else if (predecessors.size()==0) destroy();
+ if (!hasSuccessors() || !hasPredecessors()) destroy();
}
protected void destroy() {
if (destroyed) return;
protected void addPred(StateNode pred) {
super.addPred(pred);
// results should have at most one predecessor
- if (predecessors.size() > 1) throw new Error();
+ //if (predecessors.size() > 1) throw new Error();
}
public ResultNode() { this(null, null, null); }