@@ -19,10 +19,12 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
1919 /**
2020 * The class of APIs relevant for model generation.
2121 */
22- class Api extends Lang:: Callable {
22+ class SummaryApi extends Lang:: Callable {
2323 Lang:: Callable lift ( ) ;
2424 }
2525
26+ class SourceOrSinkApi extends Lang:: Callable ;
27+
2628 /**
2729 * Gets the string representation of the provenance of the models.
2830 */
@@ -33,9 +35,9 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
3335 /**
3436 * Computes the first 6 columns for MaD rows used for summaries, sources and sinks.
3537 */
36- private string asPartialModel ( Printing :: Api api ) {
38+ private string asPartialModel ( Lang :: Callable api ) {
3739 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
3941 result =
4042 container + ";" //
4143 + type + ";" //
@@ -49,7 +51,7 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
4951 /**
5052 * Computes the first 4 columns for neutral MaD rows.
5153 */
52- private string asPartialNeutralModel ( Printing:: Api api ) {
54+ private string asPartialNeutralModel ( Printing:: SummaryApi api ) {
5355 exists ( string container , string type , string name , string parameters |
5456 Lang:: partialModel ( api , container , type , _, name , parameters ) and
5557 result =
@@ -64,15 +66,15 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
6466 * Gets the summary model for `api` with `input`, `output` and `kind`.
6567 */
6668 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 ) {
6870 result =
69- asPartialModel ( api ) + input + ";" //
71+ asPartialModel ( api . lift ( ) ) + input + ";" //
7072 + output + ";" //
7173 + kind + ";" //
7274 + Printing:: getProvenance ( )
7375 }
7476
75- string asNeutralSummaryModel ( Printing:: Api api ) {
77+ string asNeutralSummaryModel ( Printing:: SummaryApi api ) {
7678 result =
7779 asPartialNeutralModel ( api ) //
7880 + "summary" + ";" //
@@ -83,23 +85,23 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
8385 * Gets the value summary model for `api` with `input` and `output`.
8486 */
8587 bindingset [ input, output]
86- string asValueModel ( Printing:: Api api , string input , string output ) {
88+ string asValueModel ( Printing:: SummaryApi api , string input , string output ) {
8789 result = asSummaryModel ( api , input , output , "value" )
8890 }
8991
9092 /**
9193 * Gets the taint summary model for `api` with `input` and `output`.
9294 */
9395 bindingset [ input, output]
94- string asTaintModel ( Printing:: Api api , string input , string output ) {
96+ string asTaintModel ( Printing:: SummaryApi api , string input , string output ) {
9597 result = asSummaryModel ( api , input , output , "taint" )
9698 }
9799
98100 /**
99101 * Gets the sink model for `api` with `input` and `kind`.
100102 */
101103 bindingset [ input, kind]
102- string asSinkModel ( Printing:: Api api , string input , string kind ) {
104+ string asSinkModel ( Printing:: SourceOrSinkApi api , string input , string kind ) {
103105 result =
104106 asPartialModel ( api ) + input + ";" //
105107 + kind + ";" //
@@ -110,7 +112,7 @@ module ModelPrintingImpl<ModelPrintingLangSig Lang> {
110112 * Gets the source model for `api` with `output` and `kind`.
111113 */
112114 bindingset [ output, kind]
113- string asSourceModel ( Printing:: Api api , string output , string kind ) {
115+ string asSourceModel ( Printing:: SourceOrSinkApi api , string output , string kind ) {
114116 result =
115117 asPartialModel ( api ) + output + ";" //
116118 + kind + ";" //
0 commit comments