@@ -361,3 +361,52 @@ module MergePathGraph<
361
361
}
362
362
}
363
363
}
364
+
365
+ /**
366
+ * Constructs a `PathGraph` from three `PathGraph`s by disjoint union.
367
+ */
368
+ module MergePathGraph3<
369
+ PathNodeSig PathNode1, PathNodeSig PathNode2, PathNodeSig PathNode3,
370
+ PathGraphSig< PathNode1 > Graph1, PathGraphSig< PathNode2 > Graph2, PathGraphSig< PathNode3 > Graph3>
371
+ {
372
+ private module MergedInner = MergePathGraph< PathNode1 , PathNode2 , Graph1 , Graph2 > ;
373
+
374
+ private module Merged =
375
+ MergePathGraph< MergedInner:: PathNode , PathNode3 , MergedInner:: PathGraph , Graph3 > ;
376
+
377
+ /** A node in a graph of path explanations that is formed by disjoint union of the three given graphs. */
378
+ class PathNode instanceof Merged:: PathNode {
379
+ /** Gets this as a projection on the first given `PathGraph`. */
380
+ PathNode1 asPathNode1 ( ) { result = super .asPathNode1 ( ) .asPathNode1 ( ) }
381
+
382
+ /** Gets this as a projection on the second given `PathGraph`. */
383
+ PathNode2 asPathNode2 ( ) { result = super .asPathNode1 ( ) .asPathNode2 ( ) }
384
+
385
+ /** Gets this as a projection on the third given `PathGraph`. */
386
+ PathNode3 asPathNode3 ( ) { result = super .asPathNode2 ( ) }
387
+
388
+ /** Gets a textual representation of this element. */
389
+ string toString ( ) { result = super .toString ( ) }
390
+
391
+ /**
392
+ * Holds if this element is at the specified location.
393
+ * The location spans column `startcolumn` of line `startline` to
394
+ * column `endcolumn` of line `endline` in file `filepath`.
395
+ * For more information, see
396
+ * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
397
+ */
398
+ predicate hasLocationInfo (
399
+ string filepath , int startline , int startcolumn , int endline , int endcolumn
400
+ ) {
401
+ super .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
402
+ }
403
+
404
+ /** Gets the underlying `Node`. */
405
+ Node getNode ( ) { result = super .getNode ( ) }
406
+ }
407
+
408
+ /**
409
+ * Provides the query predicates needed to include a graph in a path-problem query.
410
+ */
411
+ module PathGraph = Merged:: PathGraph;
412
+ }
0 commit comments