module checkPortMessageGrouping {
    import from checkPortMessageGroupingExternal all;
    //correct examples

    group correct {
        type port port1 message {
            in m1;
            out m2, m3;
        }
        type port port2 message {
            inout m1, m3;
        }
        type port port3 message {
            inout m4, m3;
            out m1, m2;
            in integer, charstring;
            out integer;
        }
        type port port4 procedure {
            in sm1, sm2;
            out sm3, sm4;
            inout sm5, sm6;
        }
        type port port5 mixed {
            in sm1, m1;
            out integer;
        }
        group nested {
            group signatures {
                signature sm1();
                signature sm2();
                signature sm3();
                signature sm4();
                signature sm5();
                signature sm6();
            } 

        } 

        type integer m1;

        type record m2 {

        }

        type set m3 {

        }

        type record m4 {

        }

    }
    //incorrect examples 

    group incorrect {
        type port port6 message {
            in m1, m2;
            out m3;
        }
        type port port7 message {
            inout checkPortMessageGroupingExternal.m5;
            out m6;
        }
        type port port8 procedure {
            inout sm1, sm2;
            out sm3;
        }
    } 

    type record m6 {

    }

    type port port9 message {
        inout m6, m7;
    }

    group g1 {
        type set m7 {

        }
        type record m8 {

        }
    } 

}