Assuming statement S1 and S2, S2 depends on S1 if:
[I(S1) ∩ O(S2)] ∪ [O(S1) ∩ I(S2)] ∪ [O(S1) ∩ O(S2)] ≠ Ø
where:
I(Si) is the set of memory locations read by Si and
O(Sj) is the set of memory locations written by Sj
and there is a feasible run-time execution path from S1 to S2
This Condition is called Bernstein Condition, named by A. J. Bernstein.
Three cases exist:
Flow (data) dependence: O(S1) ∩ I (S2), S1 → S2 and S1 writes after something read by S2
Anti-dependence: I(S1) ∩ O(S2), S1 → S2 and S1 reads something before S2 overwrites it
Output dependence: O(S1) ∩ O(S2), S1 → S2 and both write the same memory location.