@@ -81,54 +81,6 @@ private import internal.AccessPathSyntax
8181private import ExternalFlowExtensions as Extensions
8282private import FlowSummary
8383
84- /**
85- * DEPRECATED: Define source models as data extensions instead.
86- *
87- * A unit class for adding additional source model rows.
88- *
89- * Extend this class to add additional source definitions.
90- */
91- deprecated class SourceModelCsv = SourceModelCsvInternal ;
92-
93- private class SourceModelCsvInternal extends Unit {
94- /** Holds if `row` specifies a source definition. */
95- abstract predicate row ( string row ) ;
96- }
97-
98- /**
99- * DEPRECATED: Define sink models as data extensions instead.
100- *
101- * A unit class for adding additional sink model rows.
102- *
103- * Extend this class to add additional sink definitions.
104- */
105- deprecated class SinkModelCsv = SinkModelCsvInternal ;
106-
107- private class SinkModelCsvInternal extends Unit {
108- /** Holds if `row` specifies a sink definition. */
109- abstract predicate row ( string row ) ;
110- }
111-
112- /**
113- * DEPRECATED: Define summary models as data extensions instead.
114- *
115- * A unit class for adding additional summary model rows.
116- *
117- * Extend this class to add additional flow summary definitions.
118- */
119- deprecated class SummaryModelCsv = SummaryModelCsvInternal ;
120-
121- private class SummaryModelCsvInternal extends Unit {
122- /** Holds if `row` specifies a summary definition. */
123- abstract predicate row ( string row ) ;
124- }
125-
126- private predicate sourceModelInternal ( string row ) { any ( SourceModelCsvInternal s ) .row ( row ) }
127-
128- private predicate summaryModelInternal ( string row ) { any ( SummaryModelCsvInternal s ) .row ( row ) }
129-
130- private predicate sinkModelInternal ( string row ) { any ( SinkModelCsvInternal s ) .row ( row ) }
131-
13284/**
13385 * A class for activating additional model rows.
13486 *
@@ -178,20 +130,6 @@ predicate sourceModel(
178130 string package , string type , boolean subtypes , string name , string signature , string ext ,
179131 string output , string kind , string provenance
180132) {
181- exists ( string row |
182- sourceModelInternal ( row ) and
183- row .splitAt ( ";" , 0 ) = package and
184- row .splitAt ( ";" , 1 ) = type and
185- row .splitAt ( ";" , 2 ) = subtypes .toString ( ) and
186- subtypes = [ true , false ] and
187- row .splitAt ( ";" , 3 ) = name and
188- row .splitAt ( ";" , 4 ) = signature and
189- row .splitAt ( ";" , 5 ) = ext and
190- row .splitAt ( ";" , 6 ) = output and
191- row .splitAt ( ";" , 7 ) = kind and
192- row .splitAt ( ";" , 8 ) = provenance
193- )
194- or
195133 Extensions:: sourceModel ( package , type , subtypes , name , signature , ext , output , kind , provenance )
196134 or
197135 any ( ActiveExperimentalModels q )
@@ -203,20 +141,6 @@ predicate sinkModel(
203141 string package , string type , boolean subtypes , string name , string signature , string ext ,
204142 string input , string kind , string provenance
205143) {
206- exists ( string row |
207- sinkModelInternal ( row ) and
208- row .splitAt ( ";" , 0 ) = package and
209- row .splitAt ( ";" , 1 ) = type and
210- row .splitAt ( ";" , 2 ) = subtypes .toString ( ) and
211- subtypes = [ true , false ] and
212- row .splitAt ( ";" , 3 ) = name and
213- row .splitAt ( ";" , 4 ) = signature and
214- row .splitAt ( ";" , 5 ) = ext and
215- row .splitAt ( ";" , 6 ) = input and
216- row .splitAt ( ";" , 7 ) = kind and
217- row .splitAt ( ";" , 8 ) = provenance
218- )
219- or
220144 Extensions:: sinkModel ( package , type , subtypes , name , signature , ext , input , kind , provenance )
221145 or
222146 any ( ActiveExperimentalModels q )
@@ -228,21 +152,6 @@ predicate summaryModel(
228152 string package , string type , boolean subtypes , string name , string signature , string ext ,
229153 string input , string output , string kind , string provenance
230154) {
231- exists ( string row |
232- summaryModelInternal ( row ) and
233- row .splitAt ( ";" , 0 ) = package and
234- row .splitAt ( ";" , 1 ) = type and
235- row .splitAt ( ";" , 2 ) = subtypes .toString ( ) and
236- subtypes = [ true , false ] and
237- row .splitAt ( ";" , 3 ) = name and
238- row .splitAt ( ";" , 4 ) = signature and
239- row .splitAt ( ";" , 5 ) = ext and
240- row .splitAt ( ";" , 6 ) = input and
241- row .splitAt ( ";" , 7 ) = output and
242- row .splitAt ( ";" , 8 ) = kind and
243- row .splitAt ( ";" , 9 ) = provenance
244- )
245- or
246155 Extensions:: summaryModel ( package , type , subtypes , name , signature , ext , input , output , kind ,
247156 provenance )
248157 or
@@ -368,40 +277,6 @@ module ModelValidation {
368277 )
369278 }
370279
371- private string getInvalidModelSubtype ( ) {
372- exists ( string pred , string row |
373- sourceModelInternal ( row ) and pred = "source"
374- or
375- sinkModelInternal ( row ) and pred = "sink"
376- or
377- summaryModelInternal ( row ) and pred = "summary"
378- |
379- exists ( string b |
380- b = row .splitAt ( ";" , 2 ) and
381- not b = [ "true" , "false" ] and
382- result = "Invalid boolean \"" + b + "\" in " + pred + " model."
383- )
384- )
385- }
386-
387- private string getInvalidModelColumnCount ( ) {
388- exists ( string pred , string row , int expect |
389- sourceModelInternal ( row ) and expect = 9 and pred = "source"
390- or
391- sinkModelInternal ( row ) and expect = 9 and pred = "sink"
392- or
393- summaryModelInternal ( row ) and expect = 10 and pred = "summary"
394- |
395- exists ( int cols |
396- cols = 1 + max ( int n | exists ( row .splitAt ( ";" , n ) ) ) and
397- cols != expect and
398- result =
399- "Wrong number of columns in " + pred + " model row, expected " + expect + ", got " + cols +
400- " in " + row + "."
401- )
402- )
403- }
404-
405280 private string getInvalidModelSignature ( ) {
406281 exists (
407282 string pred , string package , string type , string name , string signature , string ext ,
@@ -443,7 +318,7 @@ module ModelValidation {
443318 msg =
444319 [
445320 getInvalidModelSignature ( ) , getInvalidModelInput ( ) , getInvalidModelOutput ( ) ,
446- getInvalidModelSubtype ( ) , getInvalidModelColumnCount ( ) , getInvalidModelKind ( )
321+ getInvalidModelKind ( )
447322 ]
448323 }
449324}
0 commit comments