I have to solve a problem with SAT. That problem has 2 cardinality constraints, first one is: at most 6 "class of same stage" per day, "university" is "open" 12h per day, so you have to generate constraints to apply them to SAT solver.
Second cardinality constraint is: every subject must have at least X hours a week.
I've been reading and best way for first might be "Sorting networks algorithm" and I don't know about second though I don't know how to implement neither even begin to implement it in prolog.