See
https://www.metalevel.at/simsttab/
for more information.
Example query:
?- consult('reqs.pl'),
requirements_variables(Rs, Vs),
labeling([ff], Vs),
print_classes(Rs).
This constructs a timetable that satisifies the requirements stated in reqs.pl.