1212 * - Summaries:
1313 * `namespace; type; subtypes; name; signature; ext; input; output; kind; provenance`
1414 * - Neutrals:
15- * `namespace; type; name; signature; provenance`
15+ * `namespace; 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
7272 * which classes the interpreted elements should be added. For example, for
7373 * sources "remote" indicates a default remote flow source, and for summaries
7474 * "taint" indicates a default additional taint step and "value" indicates a
75- * globally applicable value-preserving step.
75+ * globally applicable value-preserving step. For neutrals the kind can be `summary`,
76+ * `source` or `sink` to indicate that the neutral is neutral with respect to
77+ * flow (no summary), source (is not a source) or sink (is not a sink).
7678 * 9. The `provenance` column is a tag to indicate the origin and verification of a model.
7779 * The format is {origin}-{verification} or just "manual" where the origin describes
7880 * the origin of the model and verification describes how the model has been verified.
@@ -104,7 +106,7 @@ predicate sinkModel = Extensions::sinkModel/9;
104106predicate summaryModel = Extensions:: summaryModel / 10 ;
105107
106108/** Holds if a model exists indicating there is no flow for the given parameters. */
107- predicate neutralModel = Extensions:: neutralModel / 5 ;
109+ predicate neutralModel = Extensions:: neutralModel / 6 ;
108110
109111private predicate relevantNamespace ( string namespace ) {
110112 sourceModel ( namespace , _, _, _, _, _, _, _, _) or
@@ -218,6 +220,11 @@ module ModelValidation {
218220 not kind = [ "local" , "remote" , "file" , "file-write" ] and
219221 result = "Invalid kind \"" + kind + "\" in source model."
220222 )
223+ or
224+ exists ( string kind | neutralModel ( _, _, _, _, kind , _) |
225+ not kind = [ "summary" , "source" , "sink" ] and
226+ result = "Invalid kind \"" + kind + "\" in neutral model."
227+ )
221228 }
222229
223230 private string getInvalidModelSignature ( ) {
@@ -232,7 +239,7 @@ module ModelValidation {
232239 summaryModel ( namespace , type , _, name , signature , ext , _, _, _, provenance ) and
233240 pred = "summary"
234241 or
235- neutralModel ( namespace , type , name , signature , provenance ) and
242+ neutralModel ( namespace , type , name , signature , _ , provenance ) and
236243 ext = "" and
237244 pred = "neutral"
238245 |
@@ -275,7 +282,7 @@ private predicate elementSpec(
275282 or
276283 summaryModel ( namespace , type , subtypes , name , signature , ext , _, _, _, _)
277284 or
278- neutralModel ( namespace , type , name , signature , _) and ext = "" and subtypes = false
285+ neutralModel ( namespace , type , name , signature , _, _ ) and ext = "" and subtypes = false
279286}
280287
281288private predicate elementSpec (
0 commit comments