c
module C1 {
    var y1 : boolean;
    var r1 : boolean;

    next {
        y1' = r1;
        r1' = !r1;
    }
}

module C2 {
    input x2 : boolean;
    var y2 : boolean;
    var r2 : boolean;

    next {
        y2' = x2 || r2;
        r2' = x2 || r2;
    }
}

module main {
    instance c1 : C1(y1, r1);
    instance c2 : C2(x2, y2, r2);

    init {
        // Initial values for variables
        c1.r1 = true;
        c2.r2 = false;
    }

    next {
        // Synchronous composition
        c1.y1 = c2.y2;
        c2.x2 = c1.r1;
    }
}
