1212 * - Summaries:
1313 * `package; type; subtypes; name; signature; ext; input; output; kind; provenance`
1414 * - Neutrals:
15- * `package; type; name; signature; provenance`
15+ * `package; type; name; signature; kind; provenance`
1616 * A neutral is used to indicate that there is no flow via a callable.
1717 *
1818 * The interpretation of a row is similar to API-graphs with a left-to-right
6565 * which classes the interpreted elements should be added. For example, for
6666 * sources "remote" indicates a default remote flow source, and for summaries
6767 * "taint" indicates a default additional taint step and "value" indicates a
68- * globally applicable value-preserving step.
68+ * globally applicable value-preserving step. For neutrals the kind can be `summary`,
69+ * `source` or `sink` to indicate that the neutral is neutral with respect to
70+ * flow (no summary), source (is not a source) or sink (is not a sink).
6971 * 9. The `provenance` column is a tag to indicate the origin and verification of a model.
7072 * The format is {origin}-{verification} or just "manual" where the origin describes
7173 * the origin of the model and verification describes how the model has been verified.
@@ -165,7 +167,7 @@ predicate summaryModel(
165167}
166168
167169/** Holds if a neutral model exists indicating there is no flow for the given parameters. */
168- predicate neutralModel = Extensions:: neutralModel / 5 ;
170+ predicate neutralModel = Extensions:: neutralModel / 6 ;
169171
170172private predicate relevantPackage ( string package ) {
171173 sourceModel ( package , _, _, _, _, _, _, _, _) or
@@ -288,6 +290,11 @@ module ModelValidation {
288290 not kind .matches ( "qltest%" ) and
289291 result = "Invalid kind \"" + kind + "\" in source model."
290292 )
293+ or
294+ exists ( string kind | neutralModel ( _, _, _, _, kind , _) |
295+ not kind = [ "summary" , "source" , "sink" ] and
296+ result = "Invalid kind \"" + kind + "\" in neutral model."
297+ )
291298 }
292299
293300 private string getInvalidModelSignature ( ) {
@@ -302,7 +309,7 @@ module ModelValidation {
302309 summaryModel ( package , type , _, name , signature , ext , _, _, _, provenance ) and
303310 pred = "summary"
304311 or
305- neutralModel ( package , type , name , signature , provenance ) and
312+ neutralModel ( package , type , name , signature , _ , provenance ) and
306313 ext = "" and
307314 pred = "neutral"
308315 |
@@ -346,7 +353,7 @@ private predicate elementSpec(
346353 or
347354 summaryModel ( package , type , subtypes , name , signature , ext , _, _, _, _)
348355 or
349- neutralModel ( package , type , name , signature , _) and ext = "" and subtypes = false
356+ neutralModel ( package , type , name , signature , _, _ ) and ext = "" and subtypes = false
350357}
351358
352359/**
0 commit comments