Required is not the same as preferred
This distinction determines whether a solver can trade off an improvement or must reject a timetable. Agree on it before entering rules.
Hard constraint: a condition of validity
A teacher cannot teach two different lessons at once. A room cannot host two incompatible activities in the same period. Contractual unavailability may rule out a lesson even if placing it there would remove several gaps.
Contradictory hard constraints mean no valid timetable exists for that model. That does not mean the school cannot be organised: an entry may be wrong, or a requirement may have been expressed too rigidly.
Preference: an improvement objective
Reducing gaps and avoiding the last period can be weighted objectives. The solver tries to improve them without breaking mandatory rules; it does not promise to satisfy them all or always find the optimum before the time limit.
A lock fixes a lesson and reduces remaining options. A double period requires consecutive slots, not just two weekly hours. A band synchronises activities. Check each rule's meaning with colleagues before asking an agent to enter it: natural language can be ambiguous too.