@@ -1751,32 +1751,31 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
1751
1751
}
1752
1752
}
1753
1753
1754
+ signature module TestSummaryInputSig {
1755
+ /**
1756
+ * A class of callables where the flow summary should be included
1757
+ * in the `summary/1` query predicate.
1758
+ */
1759
+ class RelevantSummarizedCallable instanceof SummarizedCallableImpl {
1760
+ /** Gets the string representation of this callable used by `summary/1`. */
1761
+ string getCallableCsv ( ) ;
1762
+ }
1763
+ }
1764
+
1754
1765
/** Provides a query predicate for outputting a set of relevant flow summaries. */
1755
- module TestOutput {
1756
- final private class SummarizedCallableImplFinal = SummarizedCallableImpl ;
1766
+ module TestSummaryOutput < TestSummaryInputSig TestInput > {
1767
+ private import TestInput
1757
1768
1758
- /** A flow summary to include in the `summary/1` query predicate. */
1759
- abstract class RelevantSummarizedCallable extends SummarizedCallableImplFinal {
1760
- /** Gets the string representation of this callable used by `summary/1`. */
1761
- abstract string getCallableCsv ( ) ;
1769
+ final class RelevantSummarizedCallableFinal = TestInput:: RelevantSummarizedCallable ;
1762
1770
1771
+ class RelevantSummarizedCallable extends RelevantSummarizedCallableFinal instanceof SummarizedCallableImpl
1772
+ {
1763
1773
/** Holds if flow is propagated between `input` and `output`. */
1764
1774
predicate relevantSummary (
1765
1775
SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
1766
1776
) {
1767
1777
super .propagatesFlow ( input , output , preservesValue )
1768
1778
}
1769
- }
1770
-
1771
- /** A model to include in the `neutral/1` query predicate. */
1772
- abstract class RelevantNeutralCallable instanceof NeutralCallable {
1773
- /** Gets the string representation of this callable used by `neutral/1`. */
1774
- abstract string getCallableCsv ( ) ;
1775
-
1776
- /**
1777
- * Gets the kind of the neutral.
1778
- */
1779
- string getKind ( ) { result = super .getKind ( ) }
1780
1779
1781
1780
string toString ( ) { result = super .toString ( ) }
1782
1781
}
@@ -1795,13 +1794,6 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
1795
1794
c .hasProvenance ( result )
1796
1795
}
1797
1796
1798
- private string renderProvenanceNeutral ( NeutralCallable c ) {
1799
- exists ( Provenance p | p .isManual ( ) and c .hasProvenance ( p ) and result = p .toString ( ) )
1800
- or
1801
- not c .hasManualModel ( ) and
1802
- c .hasProvenance ( result )
1803
- }
1804
-
1805
1797
/**
1806
1798
* Holds if there exists a relevant summary callable with information roughly corresponding to `csv`.
1807
1799
* Used for testing.
@@ -1822,6 +1814,39 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
1822
1814
+ renderProvenance ( c ) // provenance
1823
1815
)
1824
1816
}
1817
+ }
1818
+
1819
+ signature module TestNeutralInputSig {
1820
+ /**
1821
+ * A class of callables where the neutral model should be included
1822
+ * in the `neutral/1` query predicate.
1823
+ */
1824
+ class RelevantNeutralCallable instanceof NeutralCallable {
1825
+ /** Gets the string representation of this callable used by `neutral/1`. */
1826
+ string getCallableCsv ( ) ;
1827
+ }
1828
+ }
1829
+
1830
+ module TestNeutralOutput< TestNeutralInputSig TestInput> {
1831
+ private import TestInput
1832
+
1833
+ final class RelevantNeutralCallableFinal = TestInput:: RelevantNeutralCallable ;
1834
+
1835
+ class RelevantNeutralCallable extends RelevantNeutralCallableFinal instanceof NeutralCallable {
1836
+ /**
1837
+ * Gets the kind of the neutral.
1838
+ */
1839
+ string getKind ( ) { result = super .getKind ( ) }
1840
+
1841
+ string toString ( ) { result = super .toString ( ) }
1842
+ }
1843
+
1844
+ private string renderProvenance ( NeutralCallable c ) {
1845
+ exists ( Provenance p | p .isManual ( ) and c .hasProvenance ( p ) and result = p .toString ( ) )
1846
+ or
1847
+ not c .hasManualModel ( ) and
1848
+ c .hasProvenance ( result )
1849
+ }
1825
1850
1826
1851
/**
1827
1852
* Holds if there exists a relevant neutral callable with information roughly corresponding to `csv`.
@@ -1833,7 +1858,7 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
1833
1858
csv =
1834
1859
c .getCallableCsv ( ) // Callable information
1835
1860
+ c .getKind ( ) + ";" // kind
1836
- + renderProvenanceNeutral ( c ) // provenance
1861
+ + renderProvenance ( c ) // provenance
1837
1862
)
1838
1863
}
1839
1864
}
0 commit comments