JavaScript: Add explicit nodes query predicate in PathGraph.

This is needed to correctly handle the case where `edges` is empty.
This commit is contained in:
Max Schaefer
2018-11-12 14:43:31 +00:00
parent 60a1357092
commit 4860364d91

View File

@@ -827,9 +827,14 @@ class SinkPathNode extends PathNode {
}
/**
* Provides the query predicate needed to include a graph in a path-problem query.
* Provides the query predicates needed to include a graph in a path-problem query.
*/
module PathGraph {
/** Holds if `nd` is a node in the graph of data flow path explanations. */
query predicate nodes(PathNode nd) {
any()
}
/** Holds if `pred` → `succ` is an edge in the graph of data flow path explanations. */
query predicate edges(PathNode pred, PathNode succ) {
pred.getASuccessor() = succ