|
|
|
|
@@ -11,9 +11,9 @@
|
|
|
|
|
* `package; type; subtypes; name; signature; ext; input; kind; provenance`
|
|
|
|
|
* - Summaries:
|
|
|
|
|
* `package; type; subtypes; name; signature; ext; input; output; kind; provenance`
|
|
|
|
|
* - Negative Summaries:
|
|
|
|
|
* - Neutrals:
|
|
|
|
|
* `package; type; name; signature; provenance`
|
|
|
|
|
* A negative summary is used to indicate that there is no flow via a callable.
|
|
|
|
|
* A neutral is used to indicate that there is no flow via a callable.
|
|
|
|
|
*
|
|
|
|
|
* The interpretation of a row is similar to API-graphs with a left-to-right
|
|
|
|
|
* reading.
|
|
|
|
|
@@ -123,16 +123,16 @@ private class SummaryModelCsvInternal extends Unit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DEPRECATED: Define negative summary models as data extensions instead.
|
|
|
|
|
* DEPRECATED: Define neutral models as data extensions instead.
|
|
|
|
|
*
|
|
|
|
|
* A unit class for adding additional negative summary model rows.
|
|
|
|
|
* A unit class for adding additional neutral model rows.
|
|
|
|
|
*
|
|
|
|
|
* Extend this class to add additional negative summary definitions.
|
|
|
|
|
* Extend this class to add additional neutral definitions.
|
|
|
|
|
*/
|
|
|
|
|
deprecated class NegativeSummaryModelCsv = NegativeSummaryModelCsvInternal;
|
|
|
|
|
deprecated class NeutralModelCsv = NeutralModelCsvInternal;
|
|
|
|
|
|
|
|
|
|
private class NegativeSummaryModelCsvInternal extends Unit {
|
|
|
|
|
/** Holds if `row` specifies a negative summary definition. */
|
|
|
|
|
private class NeutralModelCsvInternal extends Unit {
|
|
|
|
|
/** Holds if `row` specifies a neutral definition. */
|
|
|
|
|
abstract predicate row(string row);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -142,9 +142,7 @@ private predicate summaryModelInternal(string row) { any(SummaryModelCsvInternal
|
|
|
|
|
|
|
|
|
|
private predicate sinkModelInternal(string row) { any(SinkModelCsvInternal s).row(row) }
|
|
|
|
|
|
|
|
|
|
private predicate negativeSummaryModelInternal(string row) {
|
|
|
|
|
any(NegativeSummaryModelCsvInternal s).row(row)
|
|
|
|
|
}
|
|
|
|
|
private predicate neutralModelInternal(string row) { any(NeutralModelCsvInternal s).row(row) }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Holds if an experimental source model exists for the given parameters.
|
|
|
|
|
@@ -313,17 +311,15 @@ predicate summaryModel(
|
|
|
|
|
.summaryModel(package, type, subtypes, name, signature, ext, input, output, kind, provenance)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Holds if a summary model exists indicating there is no flow for the given parameters. */
|
|
|
|
|
extensible predicate extNegativeSummaryModel(
|
|
|
|
|
/** Holds if a neutral model exists indicating there is no flow for the given parameters. */
|
|
|
|
|
extensible predicate extNeutralModel(
|
|
|
|
|
string package, string type, string name, string signature, string provenance
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/** Holds if a summary model exists indicating there is no flow for the given parameters. */
|
|
|
|
|
predicate negativeSummaryModel(
|
|
|
|
|
string package, string type, string name, string signature, string provenance
|
|
|
|
|
) {
|
|
|
|
|
/** Holds if a neutral model exists indicating there is no flow for the given parameters. */
|
|
|
|
|
predicate neutralModel(string package, string type, string name, string signature, string provenance) {
|
|
|
|
|
exists(string row |
|
|
|
|
|
negativeSummaryModelInternal(row) and
|
|
|
|
|
neutralModelInternal(row) and
|
|
|
|
|
row.splitAt(";", 0) = package and
|
|
|
|
|
row.splitAt(";", 1) = type and
|
|
|
|
|
row.splitAt(";", 2) = name and
|
|
|
|
|
@@ -331,7 +327,7 @@ predicate negativeSummaryModel(
|
|
|
|
|
row.splitAt(";", 4) = provenance
|
|
|
|
|
)
|
|
|
|
|
or
|
|
|
|
|
extNegativeSummaryModel(package, type, name, signature, provenance)
|
|
|
|
|
extNeutralModel(package, type, name, signature, provenance)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private predicate relevantPackage(string package) {
|
|
|
|
|
@@ -473,7 +469,7 @@ module ModelValidation {
|
|
|
|
|
or
|
|
|
|
|
summaryModelInternal(row) and expect = 10 and pred = "summary"
|
|
|
|
|
or
|
|
|
|
|
negativeSummaryModelInternal(row) and expect = 5 and pred = "negative summary"
|
|
|
|
|
neutralModelInternal(row) and expect = 5 and pred = "neutral"
|
|
|
|
|
|
|
|
|
|
|
exists(int cols |
|
|
|
|
|
cols = 1 + max(int n | exists(row.splitAt(";", n))) and
|
|
|
|
|
@@ -497,9 +493,9 @@ module ModelValidation {
|
|
|
|
|
summaryModel(package, type, _, name, signature, ext, _, _, _, provenance) and
|
|
|
|
|
pred = "summary"
|
|
|
|
|
or
|
|
|
|
|
negativeSummaryModel(package, type, name, signature, provenance) and
|
|
|
|
|
neutralModel(package, type, name, signature, provenance) and
|
|
|
|
|
ext = "" and
|
|
|
|
|
pred = "negative summary"
|
|
|
|
|
pred = "neutral"
|
|
|
|
|
|
|
|
|
|
|
not package.regexpMatch("[a-zA-Z0-9_\\.]*") and
|
|
|
|
|
result = "Dubious package \"" + package + "\" in " + pred + " model."
|
|
|
|
|
@@ -541,7 +537,7 @@ private predicate elementSpec(
|
|
|
|
|
or
|
|
|
|
|
summaryModel(package, type, subtypes, name, signature, ext, _, _, _, _)
|
|
|
|
|
or
|
|
|
|
|
negativeSummaryModel(package, type, name, signature, _) and ext = "" and subtypes = false
|
|
|
|
|
neutralModel(package, type, name, signature, _) and ext = "" and subtypes = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string paramsStringPart(Callable c, int i) {
|
|
|
|
|
@@ -590,7 +586,7 @@ private Element interpretElement0(
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Gets the source/sink/summary/negativesummary element corresponding to the supplied parameters. */
|
|
|
|
|
/** Gets the source/sink/summary/neutral element corresponding to the supplied parameters. */
|
|
|
|
|
Element interpretElement(
|
|
|
|
|
string package, string type, boolean subtypes, string name, string signature, string ext
|
|
|
|
|
) {
|
|
|
|
|
|