system implementation sys.impl
    parameters
        A0: set of indices;
        A1: set of indices;
        A2: set of indices;
        A3: set of indices;
        A4: set of indices;
        B0: set of indices;
        B1: set of indices;
        B2: set of indices;
        B3: set of indices;
        B4: set of indices;
        C: set of indices;

    subcomponents
        a0: set indexed by A0;
        a1: set indexed by A1;
        a2: set indexed by A2;
        a3: set indexed by A3;
        a4: set indexed by A4;
        b0: set indexed by B0;
        b1: set indexed by B1;
        b2: set indexed by B2;
        b3: set indexed by B3;
        b4: set indexed by B4;
        c: set indexed by C;

    connections
        a0[x] -> c[y] for x in A0, y in C;
        b0[x] -> c[y] for x in B0, y in C;

        a1[x] -> a0[y] for x in A1, y in A0;
        a2[x] -> a1[y] for x in A2, y in A1;
        a3[x] -> a2[y] for x in A3, y in A2;
        a4[x] -> a3[y] for x in A4, y in A3;

        b1[x] -> b0[y] for x in B1, y in B0;
        b2[x] -> b1[y] for x in B2, y in B1;
        b3[x] -> b2[y] for x in B3, y in B2;
        b4[x] -> b3[y] for x in B4, y in B3;

    reconfigurations
        exists(x not in A0, next(A0) = add(A0, x));
        exists(x not in A1, next(A1) = add(A1, x));
        exists(x not in A2, next(A2) = add(A2, x));
        exists(x not in A3, next(A3) = add(A3, x));
        exists(x not in A4, next(A4) = add(A4, x));

        exists(x in A0, next(A0) = remove(A0, x));
        exists(x in A1, next(A1) = remove(A1, x));
        exists(x in A2, next(A2) = remove(A2, x));
        exists(x in A3, next(A3) = remove(A3, x));
        exists(x in A4, next(A4) = remove(A4, x));

        exists(x not in B0, next(B0) = add(B0, x));
        exists(x not in B1, next(B1) = add(B1, x));
        exists(x not in B2, next(B2) = add(B2, x));
        exists(x not in B3, next(B3) = add(B3, x));
        exists(x not in B4, next(B4) = add(B4, x));

        exists(x in B0, next(B0) = remove(B0, x));
        exists(x in B1, next(B1) = remove(B1, x));
        exists(x in B2, next(B2) = remove(B2, x));
        exists(x in B3, next(B3) = remove(B3, x));
        exists(x in B4, next(B4) = remove(B4, x));

        exists(x not in C, next(C) = add(C, x));
        exists(x in C, next(C) = remove(C, x));
end sys.impl;
