Encoding order relations in CNF
Variable $a_i$ set means class $a$ is in timeslot $i$, with a similar encoding for class $b$.  Higher values of $i$ means later time slots.  If class $a$ must occur before class b then you need clauses to declare that exactly one of $a_i$ or $b_{i+1}$, $b_{i+2}$ ... is set.  You need one such declaration for each $a_i$ possibility.  E.g.

ExactlyOne($a_1, b_2, b_3, b_4, ...$)

ExactlyOne($a_2, b_3, b_4, b_5, ...$)

ExactlyOne($a_3, b_4, b_5, b_6, ...$)

which is efficiently encoded using commander variable encoding as described in Efficient CNF Encoding for Selecting 1 to N Objects.  The scheme requires $O(n)$ clause growth, unlike the naive encoding method which requires $O(n^2)$ clause growth.