/***************************************************************** Followed is well-formedness checking of compound classages None of the expressions, unless noted otherwise, typecheck ******************************************************************/ // Z is not defined as a classage. classage XY = X + Z with E >> F as K // G is not a classage interface in X classage XY = X + Y with G >> F as K classage XY = X + Y with E >> G as K // although P exists, it is not a mixer classage XY = X + Y with P >> F as K classage XY = X + Y with E >> P as K // cyclic compounding classage Z = U + V with E >> F classage U = Z + V with E >> F classage V = Z + U with E >> F // the resulting classge would have interfaces by the same name classage XY = X + Y with E >> F as P // when the two connectors are of the same name, they must // have exactly the same import classage XA = X + A with E >> F as K // when the two pluggers are of the same name, they must // have exactly the same import classage XA = X + B with E >> F as K // when the two connectors are of the same name, they must // not have exports of the same name (conflicting exports) classage XA = X + C with E >> F as K // when the two pluggers are of the same name, they must // not have exports of the same name (conflicting exports) classage XA = X + D with E >> F as K // when the two connectors are of the same name, they must // be both singletons or both generatives. classage XA = X + E with E >> F as K // when the two pluggers are of the same name, they must // be both singletons or both generatives. classage XA = X + F with E >> F as K // the two participating mixers must not have imports being // the same name but different signatures // under the compound forming with redirected mixers. classage XA = X + G with E >> F as K // the two participating mixers must // not have exports of the same name (conflicting exports) // under the compound forming with redirected mixers. classage XA = X + H with E >> F as K // the two participating mixers must have all imports satisfied // either by itself (overriding default), or by the other party. // under the compound forming without redirected mixers. classage XA = X + I with E >> F // the two participating mixers must have imports satisfied // by an export with a subtype signature classage XA = X + J with E >> F //different argument length classage XA = X + K with E >> F //subtyping violation on contravariants classage XA = X + L with E >> F //subtyping violation on covariants /***************************************************************** Followed is typechecking of compound classage constructors None of the expressions, unless noted otherwise, typecheck ******************************************************************/ // a constructor must have the same name as the classage name // classage UV1 = U + V with E >> F as K { // UV2() { :U(); :V(); } // } // can not find F as a participant classage. F does not exist classage UV2 = U + V with E >> F as K { UV2() { :F(); :V(); } } // can not find A as a participant classage. Atomic1 does exist // but is not a participant classage UV21 = U + V with E >> F as K { UV21() { :A(); :V(); } } // participant classsage constructor: // can not find appropriate constructor, does not exist at all classage UV3 = U + V with E >> F as K { UV3() { :U(true); :V(); } } // participant classsage constructor: // can not find appropriate constructor, subtyping violation classage UV4 = U + V with E >> F as K { UV4() { :U(create Sub2()); :V(); } } // self constructor: // can not find appropriate constructor, does not exist at all classage UV5 = U + V with E >> F as K { UV5() { this(true); :V(); } } // self constructor: // can not find appropriate constructor, subtyping violation classage UV6 = U + V with E >> F as K { UV6() { this(create Sub2()); :V(); } UV6(Sub1 x) { } } /***************************************************************** Some definition used by above ******************************************************************/ classage U { mixer E { export void a(int x) {} } U() { } U(Sub1 x) {} } classage V { mixer F { export void b(int x) {} } V() { } } classage X { mixer E { import void q(int x) export void a() { return; } export void v(Sub1 x) { return; } export Sub2 w() { return create Sub2(); } } connector P { import void c(int x) export void e(int x) {return; } } plugger Q { import void c(int x) export void e(int x) {return; } } } classage Y { mixer F { export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage A { mixer F { export void b() { return; } } connector P { import void c(int x) import void u(int y) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage B { mixer F { export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) import void u(int y) export void d(int x) {return; } } } classage C { mixer F { export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } export void e(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage D { mixer F { export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } export void e(int x) {return; } } } classage E { mixer F { export void b() { return; } } singleton connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage F { mixer F { export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } } singleton plugger Q { import void c(int x) export void d(int x) {return; } } } classage G { mixer F { import int q() export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage H { mixer F { export void b() { return; } export void a() { return; } } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage I { mixer F { export void b() { return; } } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage J { mixer F { export void q() { return; } export void b() { return; } import void v(Sub1 x) import Sub2 w() } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage K { mixer F { export void q(int x) { return; } export void b() { return; } import void v(Sub2 x) import Sub2 w() } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage L { mixer F { export void q(int x) { return; } export void b() { return; } import void v(Sub1 x) import Sub1 w() } connector P { import void c(int x) export void d(int x) {return; } } plugger Q { import void c(int x) export void d(int x) {return; } } } classage Sub1 { connector E { export void a() { return; } } } classage Sub2 { connector E { export void a() { return; } import void c() } }