system implementation sys.impl
    parameters
        A0: set of indices;
        A1: set of indices;
        A2: set of indices;
        A3: set of indices;

    subcomponents
        s: single;
        d: single;
        a0: set indexed by A0;
        a1: set indexed by A1;
        a2: set indexed by A2;
        a3: set indexed by A3;

    connections
        s -> a0[0];
        a3[2] -> d;

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

        a0[x] -> a1[y] if x < y for x in A0, y in A1;
        a1[x] -> a2[y] if x < y for x in A1, y in A2;
        a2[x] -> a3[y] if x < y for x in A2, y in A3;
        a3[x] -> a0[y] if x < y + 4 for x in A3, y in A0;

    reconfigurations
        exists(x not in A0, next(A0) = add(A0, x));
        exists(x in A0, next(A0) = remove(A0, x));

        exists(x not in A1, next(A1) = add(A1, x));
        exists(x in A1, next(A1) = remove(A1, x));

        exists(x not in A2, next(A2) = add(A2, x));
        exists(x in A2, next(A2) = remove(A2, x));

        exists(x not in A3, next(A3) = add(A3, x));
        exists(x in A3, next(A3) = remove(A3, x));

end sys.impl;
