The following lines explains how cycles on the activity diagram should be interpreted, whether the cycles are all separated or whether there is some inner cycles. The case of intermixed cycles is a bit more complex, and will be explained later.
In a simplified point of view, consider that the interpretation of the cycle will be done as follows:
WHILE TRUE first_node_of_cycle ... last_node_of_cycle
UNTIL NOT X ... / UNTIL X ... first_node_of_cycle ... last_node_of_cycle
The determination of the case UNTIL X or UNTIL NOT X depends on which outgoing edge of the last node holds the guard condition.