@@ -1751,32 +1751,31 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
17511751 }
17521752 }
17531753
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+
17541765 /** 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
17571768
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 ;
17621770
1771+ class RelevantSummarizedCallable extends RelevantSummarizedCallableFinal instanceof SummarizedCallableImpl
1772+ {
17631773 /** Holds if flow is propagated between `input` and `output`. */
17641774 predicate relevantSummary (
17651775 SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
17661776 ) {
17671777 super .propagatesFlow ( input , output , preservesValue )
17681778 }
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 ( ) }
17801779
17811780 string toString ( ) { result = super .toString ( ) }
17821781 }
@@ -1795,13 +1794,6 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
17951794 c .hasProvenance ( result )
17961795 }
17971796
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-
18051797 /**
18061798 * Holds if there exists a relevant summary callable with information roughly corresponding to `csv`.
18071799 * Used for testing.
@@ -1822,6 +1814,39 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
18221814 + renderProvenance ( c ) // provenance
18231815 )
18241816 }
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+ }
18251850
18261851 /**
18271852 * 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> {
18331858 csv =
18341859 c .getCallableCsv ( ) // Callable information
18351860 + c .getKind ( ) + ";" // kind
1836- + renderProvenanceNeutral ( c ) // provenance
1861+ + renderProvenance ( c ) // provenance
18371862 )
18381863 }
18391864 }
0 commit comments