@@ -19,10 +19,12 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
19
19
/**
20
20
* The class of APIs relevant for model generation.
21
21
*/
22
- class Api extends Lang:: Callable {
22
+ class SummaryApi extends Lang:: Callable {
23
23
Lang:: Callable lift ( ) ;
24
24
}
25
25
26
+ class SourceOrSinkApi extends Lang:: Callable ;
27
+
26
28
/**
27
29
* Gets the string representation of the provenance of the models.
28
30
*/
@@ -33,9 +35,9 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
33
35
/**
34
36
* Computes the first 6 columns for MaD rows used for summaries, sources and sinks.
35
37
*/
36
- private string asPartialModel ( Printing :: Api api ) {
38
+ private string asPartialModel ( Lang :: Callable api ) {
37
39
exists ( string container , string type , string extensible , string name , string parameters |
38
- Lang:: partialModel ( api . lift ( ) , container , type , extensible , name , parameters ) and
40
+ Lang:: partialModel ( api , container , type , extensible , name , parameters ) and
39
41
result =
40
42
container + ";" //
41
43
+ type + ";" //
@@ -49,7 +51,7 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
49
51
/**
50
52
* Computes the first 4 columns for neutral MaD rows.
51
53
*/
52
- private string asPartialNeutralModel ( Printing:: Api api ) {
54
+ private string asPartialNeutralModel ( Printing:: SummaryApi api ) {
53
55
exists ( string container , string type , string name , string parameters |
54
56
Lang:: partialModel ( api , container , type , _, name , parameters ) and
55
57
result =
@@ -64,15 +66,15 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
64
66
* Gets the summary model for `api` with `input`, `output` and `kind`.
65
67
*/
66
68
bindingset [ input, output, kind]
67
- private string asSummaryModel ( Printing:: Api api , string input , string output , string kind ) {
69
+ private string asSummaryModel ( Printing:: SummaryApi api , string input , string output , string kind ) {
68
70
result =
69
- asPartialModel ( api ) + input + ";" //
71
+ asPartialModel ( api . lift ( ) ) + input + ";" //
70
72
+ output + ";" //
71
73
+ kind + ";" //
72
74
+ Printing:: getProvenance ( )
73
75
}
74
76
75
- string asNeutralSummaryModel ( Printing:: Api api ) {
77
+ string asNeutralSummaryModel ( Printing:: SummaryApi api ) {
76
78
result =
77
79
asPartialNeutralModel ( api ) //
78
80
+ "summary" + ";" //
@@ -83,23 +85,23 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
83
85
* Gets the value summary model for `api` with `input` and `output`.
84
86
*/
85
87
bindingset [ input, output]
86
- string asValueModel ( Printing:: Api api , string input , string output ) {
88
+ string asValueModel ( Printing:: SummaryApi api , string input , string output ) {
87
89
result = asSummaryModel ( api , input , output , "value" )
88
90
}
89
91
90
92
/**
91
93
* Gets the taint summary model for `api` with `input` and `output`.
92
94
*/
93
95
bindingset [ input, output]
94
- string asTaintModel ( Printing:: Api api , string input , string output ) {
96
+ string asTaintModel ( Printing:: SummaryApi api , string input , string output ) {
95
97
result = asSummaryModel ( api , input , output , "taint" )
96
98
}
97
99
98
100
/**
99
101
* Gets the sink model for `api` with `input` and `kind`.
100
102
*/
101
103
bindingset [ input, kind]
102
- string asSinkModel ( Printing:: Api api , string input , string kind ) {
104
+ string asSinkModel ( Printing:: SourceOrSinkApi api , string input , string kind ) {
103
105
result =
104
106
asPartialModel ( api ) + input + ";" //
105
107
+ kind + ";" //
@@ -110,7 +112,7 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
110
112
* Gets the source model for `api` with `output` and `kind`.
111
113
*/
112
114
bindingset [ output, kind]
113
- string asSourceModel ( Printing:: Api api , string output , string kind ) {
115
+ string asSourceModel ( Printing:: SourceOrSinkApi api , string output , string kind ) {
114
116
result =
115
117
asPartialModel ( api ) + output + ";" //
116
118
+ kind + ";" //
0 commit comments