Dataflow: Add empty provenance column to PathGraph.

This commit is contained in:
Anders Schack-Mulligen
2024-02-08 11:10:46 +01:00
parent 4c0d535cc2
commit b7d4a6926f
7 changed files with 42 additions and 24 deletions

View File

@@ -584,7 +584,7 @@ module DataFlowMake<InputSig Lang> {
signature module PathGraphSig<PathNodeSig PathNode> {
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
predicate edges(PathNode a, PathNode b);
predicate edges(PathNode a, PathNode b, string key, string val);
/** Holds if `n` is a node in the graph of data flow path explanations. */
predicate nodes(PathNode n, string key, string val);
@@ -648,9 +648,9 @@ module DataFlowMake<InputSig Lang> {
*/
module PathGraph implements PathGraphSig<PathNode> {
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
query predicate edges(PathNode a, PathNode b) {
Graph1::edges(a.asPathNode1(), b.asPathNode1()) or
Graph2::edges(a.asPathNode2(), b.asPathNode2())
query predicate edges(PathNode a, PathNode b, string key, string val) {
Graph1::edges(a.asPathNode1(), b.asPathNode1(), key, val) or
Graph2::edges(a.asPathNode2(), b.asPathNode2(), key, val)
}
/** Holds if `n` is a node in the graph of data flow path explanations. */
@@ -719,7 +719,9 @@ module DataFlowMake<InputSig Lang> {
*/
module PathGraph implements PathGraphSig<PathNode> {
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
query predicate edges(PathNode a, PathNode b) { Merged::PathGraph::edges(a, b) }
query predicate edges(PathNode a, PathNode b, string key, string val) {
Merged::PathGraph::edges(a, b, key, val)
}
/** Holds if `n` is a node in the graph of data flow path explanations. */
query predicate nodes(PathNode n, string key, string val) {

View File

@@ -3724,7 +3724,11 @@ module MakeImpl<InputSig Lang> {
*/
module PathGraph implements PathGraphSig<PathNode> {
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
query predicate edges(PathNode a, PathNode b) { a.getASuccessor() = b }
query predicate edges(PathNode a, PathNode b, string key, string val) {
a.getASuccessor() = b and
key = "provenance" and
val = ""
}
/** Holds if `n` is a node in the graph of data flow path explanations. */
query predicate nodes(PathNode n, string key, string val) {