{"abstract":"Each exam is checked against the previous period's length.","category":"Exam timetabling constraints","checks":8,"contract":"timetable maps exam -> period index, exams exam -> duration, periods -> duration. Duration violations (exam longer than its period) are listed first by exam id; then for each constraint in order: after (a must be in a strictly later period than b), exclusion (different periods), coincidence (same period), exclusive (a must be alone in its period). Return violation rows.","contract_signature":"timetable, exams, periods, cons","evaluation_group":"w2-exam-timetabling-constraints-hard-constraint-validation","failed_approach":"Special-casing period zero keeps the shift for every other period.","family":"w2-exam-timetabling-constraints-hard-constraint-validation-period-index-base","id":"FA-94491","implementations":{"attempt":{"sha256":"586c6a2cc23dea862f089d53bd9629df233eef3ab96424ed50b2d05d6fa2208b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(timetable, exams, periods, cons):\n    out = []\n    for e in sorted(timetable):\n        if exams[e] > periods[timetable[e] - 1] if timetable[e] else periods[0]:\n            out.append(['duration', e])\n    for kind, a, b in cons:\n        pa, pb = timetable[a], timetable[b]\n        if kind == 'after' and not pa > pb:\n            out.append([kind, a, b])\n        elif kind == 'exclusion' and pa == pb:\n            out.append([kind, a, b])\n        elif kind == 'coincidence' and pa != pb:\n            out.append([kind, a, b])\n        elif kind == 'exclusive' and sum(1 for e in timetable if timetable[e] == pa) > 1:\n            out.append([kind, a, b])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: period index base 1',\n   [{'A': 1, 'B': 0}, {'A': 120, 'B': 90}, [90, 120], [['exclusive', 'A', 'B']]], []),\n  ('regression variant: period index base 2',\n   [{'PHYS110': 3, 'MATH101H': 2, 'CHEM120': 0, 'BIO130': 1, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 90, 'BIO130': 180}, [90, 90, 120, 120],\n    [['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]],\n   [['duration', 'BIO130'], ['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]),\n  ('partial repair guard 3',\n   [{'MATH101': 2, 'PHYS110': 1, 'CHEM120': 2, 'MATH101H': 0, 'BIO130': 0},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180, 'BIO130': 180}, [90, 180, 90, 180],\n    [['coincidence', 'MATH101', 'MATH101H']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'MATH101H'],\n    ['coincidence', 'MATH101', 'MATH101H']]),\n  ('normal control 4',\n   [{'MATH101H': 1, 'MATH101': 2, 'CHEM120': 3, 'PHYS110': 3},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180}, [90, 90, 180, 180],\n    [['exclusive', 'CHEM120', 'MATH101'], ['exclusion', 'PHYS110', 'MATH101'],\n     ['coincidence', 'PHYS110', 'MATH101']]],\n   [['duration', 'MATH101H'], ['exclusive', 'CHEM120', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101']]),\n  ('normal control 5',\n   [{'CHEM120': 0, 'BIO130': 0, 'MATH101H': 1, 'MATH101': 0, 'PHYS110': 1},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 180, 'CHEM120': 120, 'BIO130': 180}, [120, 120, 90, 120],\n    [['after', 'MATH101', 'MATH101H'], ['exclusion', 'PHYS110', 'MATH101'],\n     ['exclusive', 'MATH101H', 'BIO130'], ['after', 'MATH101', 'CHEM120']]],\n   [['duration', 'BIO130'], ['duration', 'MATH101'], ['duration', 'PHYS110'],\n    ['after', 'MATH101', 'MATH101H'], ['exclusive', 'MATH101H', 'BIO130'], ['after', 'MATH101', 'CHEM120']]),\n  ('normal control 6',\n   [{'BIO130': 2, 'CHEM120': 1, 'MATH101H': 1, 'PHYS110': 3, 'MATH101': 1},\n    {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 90, 'CHEM120': 90, 'BIO130': 90}, [90, 120, 180, 180],\n    [['exclusion', 'BIO130', 'CHEM120'], ['after', 'BIO130', 'MATH101H'], ['after', 'MATH101', 'CHEM120']]],\n   [['duration', 'MATH101'], ['after', 'MATH101', 'CHEM120']]),\n  ('normal control 7',\n   [{'MATH101': 3, 'MATH101H': 0, 'CHEM120': 2, 'PHYS110': 1, 'BIO130': 0},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 180}, [120, 120, 180, 180],\n    [['after', 'MATH101H', 'MATH101']]],\n   [['duration', 'BIO130'], ['duration', 'MATH101H'], ['after', 'MATH101H', 'MATH101']]),\n  ('normal control 8',\n   [{'PHYS110': 0, 'CHEM120': 3, 'MATH101': 0, 'MATH101H': 0},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 90}, [120, 120, 90, 120],\n    [['coincidence', 'MATH101', 'CHEM120'], ['exclusion', 'CHEM120', 'MATH101H'],\n     ['exclusive', 'CHEM120', 'MATH101']]],\n   [['duration', 'MATH101'], ['coincidence', 'MATH101', 'CHEM120']])],\n [('regression: period index base 1',\n   [{'MATH101': 3, 'MATH101H': 1, 'PHYS110': 1, 'CHEM120': 1},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 180, 'CHEM120': 90}, [90, 180, 180, 120],\n    [['exclusion', 'MATH101H', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n     ['exclusion', 'CHEM120', 'PHYS110'], ['exclusion', 'MATH101', 'PHYS110']]],\n   [['duration', 'MATH101'], ['exclusion', 'MATH101H', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n    ['exclusion', 'CHEM120', 'PHYS110']]),\n  ('regression variant: period index base 2',\n   [{'PHYS110': 0, 'MATH101': 2, 'CHEM120': 2, 'MATH101H': 0},\n    {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 120, 'CHEM120': 180}, [90, 180, 120, 90],\n    [['exclusive', 'CHEM120', 'MATH101']]],\n   [['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'PHYS110'],\n    ['exclusive', 'CHEM120', 'MATH101']]),\n  ('partial repair guard 3',\n   [{'PHYS110': 3, 'MATH101H': 2, 'CHEM120': 0, 'BIO130': 1, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 90, 'BIO130': 180}, [90, 90, 120, 120],\n    [['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]],\n   [['duration', 'BIO130'], ['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]),\n  ('boundary control 4', [{'A': 2, 'B': 1}, {'A': 90, 'B': 90}, [90, 120, 120], [['after', 'A', 'B']]], []),\n  ('normal control 5',\n   [{'MATH101': 0, 'MATH101H': 1, 'PHYS110': 3}, {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 120},\n    [120, 90, 90, 180],\n    [['after', 'PHYS110', 'MATH101H'], ['exclusive', 'MATH101', 'PHYS110'],\n     ['coincidence', 'MATH101', 'MATH101H']]],\n   [['duration', 'MATH101'], ['coincidence', 'MATH101', 'MATH101H']]),\n  ('normal control 6',\n   [{'MATH101': 2, 'CHEM120': 3, 'MATH101H': 3, 'PHYS110': 3},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180}, [90, 120, 180, 90],\n    [['coincidence', 'MATH101H', 'CHEM120'], ['exclusion', 'PHYS110', 'MATH101']]],\n   [['duration', 'CHEM120'], ['duration', 'MATH101H'], ['duration', 'PHYS110']]),\n  ('normal control 7',\n   [{'MATH101H': 0, 'PHYS110': 1, 'CHEM120': 1, 'HIST140': 0, 'MATH101': 0, 'BIO130': 2},\n    {'MATH101': 120, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 90, 'HIST140': 180},\n    [180, 120, 120, 180], [['exclusion', 'CHEM120', 'BIO130'], ['coincidence', 'PHYS110', 'CHEM120']]],\n   []),\n  ('normal control 8',\n   [{'PHYS110': 3, 'MATH101H': 2, 'CHEM120': 2, 'MATH101': 0},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 120}, [180, 180, 180, 90],\n    [['exclusion', 'MATH101H', 'MATH101'], ['coincidence', 'MATH101H', 'CHEM120'],\n     ['after', 'CHEM120', 'MATH101H']]],\n   [['duration', 'PHYS110'], ['after', 'CHEM120', 'MATH101H']])],\n [('regression: period index base 1',\n   [{'CHEM120': 2, 'MATH101': 3, 'PHYS110': 2, 'MATH101H': 1},\n    {'MATH101': 120, 'MATH101H': 90, 'PHYS110': 90, 'CHEM120': 120}, [90, 180, 120, 90],\n    [['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'PHYS110', 'CHEM120']]],\n   [['duration', 'MATH101'], ['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'PHYS110', 'CHEM120']]),\n  ('regression variant: period index base 2',\n   [{'CHEM120': 1, 'MATH101': 1, 'PHYS110': 0, 'MATH101H': 2, 'BIO130': 1},\n    {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 180}, [180, 90, 120, 180],\n    [['exclusion', 'CHEM120', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n     ['exclusive', 'BIO130', 'MATH101H']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101H'],\n    ['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'BIO130', 'MATH101H']]),\n  ('partial repair guard 3',\n   [{'CHEM120': 3, 'MATH101H': 1, 'MATH101': 0, 'BIO130': 3, 'PHYS110': 2},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 90}, [120, 120, 120, 180],\n    [['exclusive', 'CHEM120', 'BIO130'], ['coincidence', 'CHEM120', 'BIO130'],\n     ['coincidence', 'BIO130', 'PHYS110']]],\n   [['duration', 'MATH101H'], ['exclusive', 'CHEM120', 'BIO130'], ['coincidence', 'BIO130', 'PHYS110']]),\n  ('boundary control 4', [{'B': 0, 'A': 1}, {'A': 180, 'B': 180}, [120, 120], []],\n   [['duration', 'A'], ['duration', 'B']]),\n  ('normal control 5',\n   [{'MATH101H': 1, 'MATH101': 0, 'PHYS110': 0, 'BIO130': 1, 'CHEM120': 3},\n    {'MATH101': 120, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 90}, [180, 120, 180, 120],\n    [['after', 'CHEM120', 'MATH101H'], ['exclusive', 'MATH101', 'BIO130'], ['after', 'MATH101', 'MATH101H']]],\n   [['exclusive', 'MATH101', 'BIO130'], ['after', 'MATH101', 'MATH101H']]),\n  ('normal control 6',\n   [{'MATH101H': 2, 'PHYS110': 3, 'CHEM120': 3, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 90, 'PHYS110': 180, 'CHEM120': 180}, [180, 120, 120, 120],\n    [['exclusion', 'PHYS110', 'MATH101H']]],\n   [['duration', 'CHEM120'], ['duration', 'PHYS110']]),\n  ('normal control 7',\n   [{'BIO130': 1, 'PHYS110': 0, 'MATH101': 0, 'MATH101H': 1, 'CHEM120': 2},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 180}, [90, 90, 90, 120],\n    [['exclusive', 'MATH101', 'BIO130'], ['after', 'PHYS110', 'MATH101H'],\n     ['exclusion', 'MATH101', 'PHYS110'], ['after', 'PHYS110', 'BIO130']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'MATH101H'],\n    ['duration', 'PHYS110'], ['exclusive', 'MATH101', 'BIO130'], ['after', 'PHYS110', 'MATH101H'],\n    ['exclusion', 'MATH101', 'PHYS110'], ['after', 'PHYS110', 'BIO130']]),\n  ('normal control 8',\n   [{'MATH101': 1, 'MATH101H': 2, 'PHYS110': 1, 'CHEM120': 1},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120}, [120, 90, 90, 180],\n    [['exclusion', 'CHEM120', 'MATH101H']]],\n   [['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'MATH101H'], ['duration', 'PHYS110']])],\n [('regression: period index base 1',\n   [{'HIST140': 1, 'CHEM120': 1, 'MATH101': 2, 'MATH101H': 3, 'PHYS110': 2, 'BIO130': 2},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 120, 'BIO130': 180, 'HIST140': 120},\n    [90, 120, 90, 120],\n    [['after', 'CHEM120', 'MATH101H'], ['coincidence', 'PHYS110', 'BIO130'], ['after', 'MATH101', 'HIST140'],\n     ['coincidence', 'MATH101', 'BIO130']]],\n   [['duration', 'BIO130'], ['duration', 'MATH101'], ['duration', 'MATH101H'], ['duration', 'PHYS110'],\n    ['after', 'CHEM120', 'MATH101H']]),\n  ('regression variant: period index base 2',\n   [{'MATH101': 1, 'CHEM120': 2, 'BIO130': 3, 'PHYS110': 3, 'MATH101H': 3},\n    {'MATH101': 90, 'MATH101H': 90, 'PHYS110': 180, 'CHEM120': 120, 'BIO130': 180}, [180, 120, 180, 120],\n    [['exclusion', 'CHEM120', 'MATH101H'], ['exclusive', 'BIO130', 'MATH101'],\n     ['exclusion', 'BIO130', 'MATH101H'], ['exclusion', 'CHEM120', 'BIO130']]],\n   [['duration', 'BIO130'], ['duration', 'PHYS110'], ['exclusive', 'BIO130', 'MATH101'],\n    ['exclusion', 'BIO130', 'MATH101H']]),\n  ('partial repair guard 3',\n   [{'MATH101H': 2, 'PHYS110': 0, 'MATH101': 2}, {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 90},\n    [90, 90, 180, 120],\n    [['exclusion', 'MATH101H', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101'],\n     ['coincidence', 'MATH101H', 'MATH101']]],\n   [['exclusion', 'MATH101H', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101']]),\n  ('boundary control 4', [{'A': 0}, {'A': 120}, [120], []], []),\n  ('normal control 5',\n   [{'PHYS110': 1, 'CHEM120': 2, 'MATH101H': 2, 'MATH101': 2},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 90}, [120, 180, 180, 120],\n    [['coincidence', 'CHEM120', 'MATH101'], ['coincidence', 'MATH101H', 'PHYS110'],\n     ['coincidence', 'MATH101H', 'PHYS110'], ['exclusion', 'MATH101H', 'PHYS110']]],\n   [['coincidence', 'MATH101H', 'PHYS110'], ['coincidence', 'MATH101H', 'PHYS110']]),\n  ('normal control 6',\n   [{'PHYS110': 1, 'MATH101H': 1, 'MATH101': 1}, {'MATH101': 120, 'MATH101H': 90, 'PHYS110': 90},\n    [90, 90, 180, 120],\n    [['exclusion', 'PHYS110', 'MATH101H'], ['exclusive', 'MATH101H', 'MATH101'],\n     ['exclusive', 'MATH101H', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101']]],\n   [['duration', 'MATH101'], ['exclusion', 'PHYS110', 'MATH101H'], ['exclusive', 'MATH101H', 'MATH101'],\n    ['exclusive', 'MATH101H', 'MATH101']]),\n  ('normal control 7',\n   [{'MATH101H': 1, 'PHYS110': 0, 'MATH101': 2}, {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 120},\n    [90, 90, 120, 180],\n    [['exclusive', 'MATH101', 'MATH101H'], ['coincidence', 'MATH101H', 'MATH101'],\n     ['after', 'MATH101H', 'PHYS110']]],\n   [['duration', 'MATH101'], ['duration', 'PHYS110'], ['coincidence', 'MATH101H', 'MATH101']]),\n  ('normal control 8',\n   [{'MATH101H': 0, 'PHYS110': 0, 'CHEM120': 1, 'BIO130': 1, 'MATH101': 3},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 90}, [180, 120, 120, 90],\n    [['exclusive', 'MATH101', 'PHYS110']]],\n   [['duration', 'MATH101']])],\n [('regression: period index base 1',\n   [{'BIO130': 0, 'PHYS110': 3, 'MATH101': 1, 'CHEM120': 0, 'MATH101H': 1},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 180, 'CHEM120': 90, 'BIO130': 90}, [120, 120, 180, 90],\n    [['coincidence', 'CHEM120', 'BIO130'], ['after', 'CHEM120', 'BIO130'],\n     ['exclusive', 'MATH101H', 'MATH101']]],\n   [['duration', 'MATH101'], ['duration', 'PHYS110'], ['after', 'CHEM120', 'BIO130'],\n    ['exclusive', 'MATH101H', 'MATH101']]),\n  ('regression variant: period index base 2',\n   [{'MATH101': 2, 'PHYS110': 3, 'MATH101H': 2}, {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180},\n    [120, 180, 90, 180], [['exclusive', 'MATH101H', 'MATH101']]],\n   [['duration', 'MATH101'], ['duration', 'MATH101H'], ['exclusive', 'MATH101H', 'MATH101']]),\n  ('partial repair guard 3',\n   [{'CHEM120': 1, 'MATH101': 1, 'PHYS110': 0, 'MATH101H': 2, 'BIO130': 1},\n    {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 180}, [180, 90, 120, 180],\n    [['exclusion', 'CHEM120', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n     ['exclusive', 'BIO130', 'MATH101H']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101H'],\n    ['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'BIO130', 'MATH101H']]),\n  ('boundary control 4', [{'A': 1, 'B': 1}, {'A': 90, 'B': 90}, [90, 120], [['after', 'A', 'B']]],\n   [['after', 'A', 'B']]),\n  ('normal control 5',\n   [{'PHYS110': 1, 'MATH101': 2, 'CHEM120': 1, 'HIST140': 3, 'MATH101H': 3, 'BIO130': 2},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 90, 'HIST140': 90},\n    [120, 120, 120, 120],\n    [['after', 'MATH101H', 'BIO130'], ['after', 'MATH101', 'BIO130'], ['coincidence', 'MATH101', 'HIST140']]],\n   [['duration', 'MATH101H'], ['after', 'MATH101', 'BIO130'], ['coincidence', 'MATH101', 'HIST140']]),\n  ('normal control 6',\n   [{'BIO130': 3, 'MATH101H': 0, 'CHEM120': 1, 'PHYS110': 0, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180, 'BIO130': 180}, [90, 120, 120, 120],\n    [['coincidence', 'CHEM120', 'MATH101'], ['after', 'MATH101', 'BIO130'],\n     ['coincidence', 'MATH101H', 'CHEM120']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101H'], ['duration', 'PHYS110'],\n    ['coincidence', 'CHEM120', 'MATH101'], ['after', 'MATH101', 'BIO130'],\n    ['coincidence', 'MATH101H', 'CHEM120']]),\n  ('normal control 7',\n   [{'CHEM120': 2, 'BIO130': 3, 'MATH101H': 2, 'MATH101': 3, 'PHYS110': 3},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 90, 'BIO130': 90}, [180, 120, 180, 120],\n    [['after', 'MATH101H', 'MATH101'], ['after', 'CHEM120', 'PHYS110']]],\n   [['duration', 'MATH101'], ['duration', 'PHYS110'], ['after', 'MATH101H', 'MATH101'],\n    ['after', 'CHEM120', 'PHYS110']]),\n  ('normal control 8',\n   [{'HIST140': 2, 'MATH101': 1, 'CHEM120': 3, 'PHYS110': 3, 'MATH101H': 2, 'BIO130': 3},\n    {'MATH101': 120, 'MATH101H': 90, 'PHYS110': 90, 'CHEM120': 90, 'BIO130': 90, 'HIST140': 120},\n    [90, 90, 120, 90],\n    [['after', 'HIST140', 'MATH101H'], ['exclusion', 'HIST140', 'BIO130'], ['after', 'HIST140', 'MATH101']]],\n   [['duration', 'MATH101'], ['after', 'HIST140', 'MATH101H']])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"d67a8d8d7c3e5ae8362e11d08afef36713cf2e532df787a5e9ce6e303a03d500","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(timetable, exams, periods, cons):\n    out = []\n    for e in sorted(timetable):\n        if exams[e] > periods[timetable[e] - 1]:\n            out.append(['duration', e])\n    for kind, a, b in cons:\n        pa, pb = timetable[a], timetable[b]\n        if kind == 'after' and not pa > pb:\n            out.append([kind, a, b])\n        elif kind == 'exclusion' and pa == pb:\n            out.append([kind, a, b])\n        elif kind == 'coincidence' and pa != pb:\n            out.append([kind, a, b])\n        elif kind == 'exclusive' and sum(1 for e in timetable if timetable[e] == pa) > 1:\n            out.append([kind, a, b])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: period index base 1',\n   [{'A': 1, 'B': 0}, {'A': 120, 'B': 90}, [90, 120], [['exclusive', 'A', 'B']]], []),\n  ('regression variant: period index base 2',\n   [{'PHYS110': 3, 'MATH101H': 2, 'CHEM120': 0, 'BIO130': 1, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 90, 'BIO130': 180}, [90, 90, 120, 120],\n    [['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]],\n   [['duration', 'BIO130'], ['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]),\n  ('partial repair guard 3',\n   [{'MATH101': 2, 'PHYS110': 1, 'CHEM120': 2, 'MATH101H': 0, 'BIO130': 0},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180, 'BIO130': 180}, [90, 180, 90, 180],\n    [['coincidence', 'MATH101', 'MATH101H']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'MATH101H'],\n    ['coincidence', 'MATH101', 'MATH101H']]),\n  ('normal control 4',\n   [{'MATH101H': 1, 'MATH101': 2, 'CHEM120': 3, 'PHYS110': 3},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180}, [90, 90, 180, 180],\n    [['exclusive', 'CHEM120', 'MATH101'], ['exclusion', 'PHYS110', 'MATH101'],\n     ['coincidence', 'PHYS110', 'MATH101']]],\n   [['duration', 'MATH101H'], ['exclusive', 'CHEM120', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101']]),\n  ('normal control 5',\n   [{'CHEM120': 0, 'BIO130': 0, 'MATH101H': 1, 'MATH101': 0, 'PHYS110': 1},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 180, 'CHEM120': 120, 'BIO130': 180}, [120, 120, 90, 120],\n    [['after', 'MATH101', 'MATH101H'], ['exclusion', 'PHYS110', 'MATH101'],\n     ['exclusive', 'MATH101H', 'BIO130'], ['after', 'MATH101', 'CHEM120']]],\n   [['duration', 'BIO130'], ['duration', 'MATH101'], ['duration', 'PHYS110'],\n    ['after', 'MATH101', 'MATH101H'], ['exclusive', 'MATH101H', 'BIO130'], ['after', 'MATH101', 'CHEM120']]),\n  ('normal control 6',\n   [{'BIO130': 2, 'CHEM120': 1, 'MATH101H': 1, 'PHYS110': 3, 'MATH101': 1},\n    {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 90, 'CHEM120': 90, 'BIO130': 90}, [90, 120, 180, 180],\n    [['exclusion', 'BIO130', 'CHEM120'], ['after', 'BIO130', 'MATH101H'], ['after', 'MATH101', 'CHEM120']]],\n   [['duration', 'MATH101'], ['after', 'MATH101', 'CHEM120']]),\n  ('normal control 7',\n   [{'MATH101': 3, 'MATH101H': 0, 'CHEM120': 2, 'PHYS110': 1, 'BIO130': 0},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 180}, [120, 120, 180, 180],\n    [['after', 'MATH101H', 'MATH101']]],\n   [['duration', 'BIO130'], ['duration', 'MATH101H'], ['after', 'MATH101H', 'MATH101']]),\n  ('normal control 8',\n   [{'PHYS110': 0, 'CHEM120': 3, 'MATH101': 0, 'MATH101H': 0},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 90}, [120, 120, 90, 120],\n    [['coincidence', 'MATH101', 'CHEM120'], ['exclusion', 'CHEM120', 'MATH101H'],\n     ['exclusive', 'CHEM120', 'MATH101']]],\n   [['duration', 'MATH101'], ['coincidence', 'MATH101', 'CHEM120']])],\n [('regression: period index base 1',\n   [{'MATH101': 3, 'MATH101H': 1, 'PHYS110': 1, 'CHEM120': 1},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 180, 'CHEM120': 90}, [90, 180, 180, 120],\n    [['exclusion', 'MATH101H', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n     ['exclusion', 'CHEM120', 'PHYS110'], ['exclusion', 'MATH101', 'PHYS110']]],\n   [['duration', 'MATH101'], ['exclusion', 'MATH101H', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n    ['exclusion', 'CHEM120', 'PHYS110']]),\n  ('regression variant: period index base 2',\n   [{'PHYS110': 0, 'MATH101': 2, 'CHEM120': 2, 'MATH101H': 0},\n    {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 120, 'CHEM120': 180}, [90, 180, 120, 90],\n    [['exclusive', 'CHEM120', 'MATH101']]],\n   [['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'PHYS110'],\n    ['exclusive', 'CHEM120', 'MATH101']]),\n  ('partial repair guard 3',\n   [{'PHYS110': 3, 'MATH101H': 2, 'CHEM120': 0, 'BIO130': 1, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 90, 'BIO130': 180}, [90, 90, 120, 120],\n    [['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]],\n   [['duration', 'BIO130'], ['coincidence', 'MATH101H', 'CHEM120'], ['coincidence', 'PHYS110', 'BIO130']]),\n  ('boundary control 4', [{'A': 2, 'B': 1}, {'A': 90, 'B': 90}, [90, 120, 120], [['after', 'A', 'B']]], []),\n  ('normal control 5',\n   [{'MATH101': 0, 'MATH101H': 1, 'PHYS110': 3}, {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 120},\n    [120, 90, 90, 180],\n    [['after', 'PHYS110', 'MATH101H'], ['exclusive', 'MATH101', 'PHYS110'],\n     ['coincidence', 'MATH101', 'MATH101H']]],\n   [['duration', 'MATH101'], ['coincidence', 'MATH101', 'MATH101H']]),\n  ('normal control 6',\n   [{'MATH101': 2, 'CHEM120': 3, 'MATH101H': 3, 'PHYS110': 3},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180}, [90, 120, 180, 90],\n    [['coincidence', 'MATH101H', 'CHEM120'], ['exclusion', 'PHYS110', 'MATH101']]],\n   [['duration', 'CHEM120'], ['duration', 'MATH101H'], ['duration', 'PHYS110']]),\n  ('normal control 7',\n   [{'MATH101H': 0, 'PHYS110': 1, 'CHEM120': 1, 'HIST140': 0, 'MATH101': 0, 'BIO130': 2},\n    {'MATH101': 120, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 90, 'HIST140': 180},\n    [180, 120, 120, 180], [['exclusion', 'CHEM120', 'BIO130'], ['coincidence', 'PHYS110', 'CHEM120']]],\n   []),\n  ('normal control 8',\n   [{'PHYS110': 3, 'MATH101H': 2, 'CHEM120': 2, 'MATH101': 0},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 120}, [180, 180, 180, 90],\n    [['exclusion', 'MATH101H', 'MATH101'], ['coincidence', 'MATH101H', 'CHEM120'],\n     ['after', 'CHEM120', 'MATH101H']]],\n   [['duration', 'PHYS110'], ['after', 'CHEM120', 'MATH101H']])],\n [('regression: period index base 1',\n   [{'CHEM120': 2, 'MATH101': 3, 'PHYS110': 2, 'MATH101H': 1},\n    {'MATH101': 120, 'MATH101H': 90, 'PHYS110': 90, 'CHEM120': 120}, [90, 180, 120, 90],\n    [['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'PHYS110', 'CHEM120']]],\n   [['duration', 'MATH101'], ['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'PHYS110', 'CHEM120']]),\n  ('regression variant: period index base 2',\n   [{'CHEM120': 1, 'MATH101': 1, 'PHYS110': 0, 'MATH101H': 2, 'BIO130': 1},\n    {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 180}, [180, 90, 120, 180],\n    [['exclusion', 'CHEM120', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n     ['exclusive', 'BIO130', 'MATH101H']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101H'],\n    ['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'BIO130', 'MATH101H']]),\n  ('partial repair guard 3',\n   [{'CHEM120': 3, 'MATH101H': 1, 'MATH101': 0, 'BIO130': 3, 'PHYS110': 2},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 90}, [120, 120, 120, 180],\n    [['exclusive', 'CHEM120', 'BIO130'], ['coincidence', 'CHEM120', 'BIO130'],\n     ['coincidence', 'BIO130', 'PHYS110']]],\n   [['duration', 'MATH101H'], ['exclusive', 'CHEM120', 'BIO130'], ['coincidence', 'BIO130', 'PHYS110']]),\n  ('boundary control 4', [{'B': 0, 'A': 1}, {'A': 180, 'B': 180}, [120, 120], []],\n   [['duration', 'A'], ['duration', 'B']]),\n  ('normal control 5',\n   [{'MATH101H': 1, 'MATH101': 0, 'PHYS110': 0, 'BIO130': 1, 'CHEM120': 3},\n    {'MATH101': 120, 'MATH101H': 120, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 90}, [180, 120, 180, 120],\n    [['after', 'CHEM120', 'MATH101H'], ['exclusive', 'MATH101', 'BIO130'], ['after', 'MATH101', 'MATH101H']]],\n   [['exclusive', 'MATH101', 'BIO130'], ['after', 'MATH101', 'MATH101H']]),\n  ('normal control 6',\n   [{'MATH101H': 2, 'PHYS110': 3, 'CHEM120': 3, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 90, 'PHYS110': 180, 'CHEM120': 180}, [180, 120, 120, 120],\n    [['exclusion', 'PHYS110', 'MATH101H']]],\n   [['duration', 'CHEM120'], ['duration', 'PHYS110']]),\n  ('normal control 7',\n   [{'BIO130': 1, 'PHYS110': 0, 'MATH101': 0, 'MATH101H': 1, 'CHEM120': 2},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120, 'BIO130': 180}, [90, 90, 90, 120],\n    [['exclusive', 'MATH101', 'BIO130'], ['after', 'PHYS110', 'MATH101H'],\n     ['exclusion', 'MATH101', 'PHYS110'], ['after', 'PHYS110', 'BIO130']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'MATH101H'],\n    ['duration', 'PHYS110'], ['exclusive', 'MATH101', 'BIO130'], ['after', 'PHYS110', 'MATH101H'],\n    ['exclusion', 'MATH101', 'PHYS110'], ['after', 'PHYS110', 'BIO130']]),\n  ('normal control 8',\n   [{'MATH101': 1, 'MATH101H': 2, 'PHYS110': 1, 'CHEM120': 1},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 120, 'CHEM120': 120}, [120, 90, 90, 180],\n    [['exclusion', 'CHEM120', 'MATH101H']]],\n   [['duration', 'CHEM120'], ['duration', 'MATH101'], ['duration', 'MATH101H'], ['duration', 'PHYS110']])],\n [('regression: period index base 1',\n   [{'HIST140': 1, 'CHEM120': 1, 'MATH101': 2, 'MATH101H': 3, 'PHYS110': 2, 'BIO130': 2},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 120, 'BIO130': 180, 'HIST140': 120},\n    [90, 120, 90, 120],\n    [['after', 'CHEM120', 'MATH101H'], ['coincidence', 'PHYS110', 'BIO130'], ['after', 'MATH101', 'HIST140'],\n     ['coincidence', 'MATH101', 'BIO130']]],\n   [['duration', 'BIO130'], ['duration', 'MATH101'], ['duration', 'MATH101H'], ['duration', 'PHYS110'],\n    ['after', 'CHEM120', 'MATH101H']]),\n  ('regression variant: period index base 2',\n   [{'MATH101': 1, 'CHEM120': 2, 'BIO130': 3, 'PHYS110': 3, 'MATH101H': 3},\n    {'MATH101': 90, 'MATH101H': 90, 'PHYS110': 180, 'CHEM120': 120, 'BIO130': 180}, [180, 120, 180, 120],\n    [['exclusion', 'CHEM120', 'MATH101H'], ['exclusive', 'BIO130', 'MATH101'],\n     ['exclusion', 'BIO130', 'MATH101H'], ['exclusion', 'CHEM120', 'BIO130']]],\n   [['duration', 'BIO130'], ['duration', 'PHYS110'], ['exclusive', 'BIO130', 'MATH101'],\n    ['exclusion', 'BIO130', 'MATH101H']]),\n  ('partial repair guard 3',\n   [{'MATH101H': 2, 'PHYS110': 0, 'MATH101': 2}, {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 90},\n    [90, 90, 180, 120],\n    [['exclusion', 'MATH101H', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101'],\n     ['coincidence', 'MATH101H', 'MATH101']]],\n   [['exclusion', 'MATH101H', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101']]),\n  ('boundary control 4', [{'A': 0}, {'A': 120}, [120], []], []),\n  ('normal control 5',\n   [{'PHYS110': 1, 'CHEM120': 2, 'MATH101H': 2, 'MATH101': 2},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 90}, [120, 180, 180, 120],\n    [['coincidence', 'CHEM120', 'MATH101'], ['coincidence', 'MATH101H', 'PHYS110'],\n     ['coincidence', 'MATH101H', 'PHYS110'], ['exclusion', 'MATH101H', 'PHYS110']]],\n   [['coincidence', 'MATH101H', 'PHYS110'], ['coincidence', 'MATH101H', 'PHYS110']]),\n  ('normal control 6',\n   [{'PHYS110': 1, 'MATH101H': 1, 'MATH101': 1}, {'MATH101': 120, 'MATH101H': 90, 'PHYS110': 90},\n    [90, 90, 180, 120],\n    [['exclusion', 'PHYS110', 'MATH101H'], ['exclusive', 'MATH101H', 'MATH101'],\n     ['exclusive', 'MATH101H', 'MATH101'], ['coincidence', 'PHYS110', 'MATH101']]],\n   [['duration', 'MATH101'], ['exclusion', 'PHYS110', 'MATH101H'], ['exclusive', 'MATH101H', 'MATH101'],\n    ['exclusive', 'MATH101H', 'MATH101']]),\n  ('normal control 7',\n   [{'MATH101H': 1, 'PHYS110': 0, 'MATH101': 2}, {'MATH101': 180, 'MATH101H': 90, 'PHYS110': 120},\n    [90, 90, 120, 180],\n    [['exclusive', 'MATH101', 'MATH101H'], ['coincidence', 'MATH101H', 'MATH101'],\n     ['after', 'MATH101H', 'PHYS110']]],\n   [['duration', 'MATH101'], ['duration', 'PHYS110'], ['coincidence', 'MATH101H', 'MATH101']]),\n  ('normal control 8',\n   [{'MATH101H': 0, 'PHYS110': 0, 'CHEM120': 1, 'BIO130': 1, 'MATH101': 3},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 90}, [180, 120, 120, 90],\n    [['exclusive', 'MATH101', 'PHYS110']]],\n   [['duration', 'MATH101']])],\n [('regression: period index base 1',\n   [{'BIO130': 0, 'PHYS110': 3, 'MATH101': 1, 'CHEM120': 0, 'MATH101H': 1},\n    {'MATH101': 180, 'MATH101H': 120, 'PHYS110': 180, 'CHEM120': 90, 'BIO130': 90}, [120, 120, 180, 90],\n    [['coincidence', 'CHEM120', 'BIO130'], ['after', 'CHEM120', 'BIO130'],\n     ['exclusive', 'MATH101H', 'MATH101']]],\n   [['duration', 'MATH101'], ['duration', 'PHYS110'], ['after', 'CHEM120', 'BIO130'],\n    ['exclusive', 'MATH101H', 'MATH101']]),\n  ('regression variant: period index base 2',\n   [{'MATH101': 2, 'PHYS110': 3, 'MATH101H': 2}, {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180},\n    [120, 180, 90, 180], [['exclusive', 'MATH101H', 'MATH101']]],\n   [['duration', 'MATH101'], ['duration', 'MATH101H'], ['exclusive', 'MATH101H', 'MATH101']]),\n  ('partial repair guard 3',\n   [{'CHEM120': 1, 'MATH101': 1, 'PHYS110': 0, 'MATH101H': 2, 'BIO130': 1},\n    {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 180}, [180, 90, 120, 180],\n    [['exclusion', 'CHEM120', 'PHYS110'], ['coincidence', 'MATH101', 'PHYS110'],\n     ['exclusive', 'BIO130', 'MATH101H']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101H'],\n    ['coincidence', 'MATH101', 'PHYS110'], ['exclusive', 'BIO130', 'MATH101H']]),\n  ('boundary control 4', [{'A': 1, 'B': 1}, {'A': 90, 'B': 90}, [90, 120], [['after', 'A', 'B']]],\n   [['after', 'A', 'B']]),\n  ('normal control 5',\n   [{'PHYS110': 1, 'MATH101': 2, 'CHEM120': 1, 'HIST140': 3, 'MATH101H': 3, 'BIO130': 2},\n    {'MATH101': 120, 'MATH101H': 180, 'PHYS110': 90, 'CHEM120': 120, 'BIO130': 90, 'HIST140': 90},\n    [120, 120, 120, 120],\n    [['after', 'MATH101H', 'BIO130'], ['after', 'MATH101', 'BIO130'], ['coincidence', 'MATH101', 'HIST140']]],\n   [['duration', 'MATH101H'], ['after', 'MATH101', 'BIO130'], ['coincidence', 'MATH101', 'HIST140']]),\n  ('normal control 6',\n   [{'BIO130': 3, 'MATH101H': 0, 'CHEM120': 1, 'PHYS110': 0, 'MATH101': 2},\n    {'MATH101': 90, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 180, 'BIO130': 180}, [90, 120, 120, 120],\n    [['coincidence', 'CHEM120', 'MATH101'], ['after', 'MATH101', 'BIO130'],\n     ['coincidence', 'MATH101H', 'CHEM120']]],\n   [['duration', 'BIO130'], ['duration', 'CHEM120'], ['duration', 'MATH101H'], ['duration', 'PHYS110'],\n    ['coincidence', 'CHEM120', 'MATH101'], ['after', 'MATH101', 'BIO130'],\n    ['coincidence', 'MATH101H', 'CHEM120']]),\n  ('normal control 7',\n   [{'CHEM120': 2, 'BIO130': 3, 'MATH101H': 2, 'MATH101': 3, 'PHYS110': 3},\n    {'MATH101': 180, 'MATH101H': 180, 'PHYS110': 180, 'CHEM120': 90, 'BIO130': 90}, [180, 120, 180, 120],\n    [['after', 'MATH101H', 'MATH101'], ['after', 'CHEM120', 'PHYS110']]],\n   [['duration', 'MATH101'], ['duration', 'PHYS110'], ['after', 'MATH101H', 'MATH101'],\n    ['after', 'CHEM120', 'PHYS110']]),\n  ('normal control 8',\n   [{'HIST140': 2, 'MATH101': 1, 'CHEM120': 3, 'PHYS110': 3, 'MATH101H': 2, 'BIO130': 3},\n    {'MATH101': 120, 'MATH101H': 90, 'PHYS110': 90, 'CHEM120': 90, 'BIO130': 90, 'HIST140': 120},\n    [90, 90, 120, 90],\n    [['after', 'HIST140', 'MATH101H'], ['exclusion', 'HIST140', 'BIO130'], ['after', 'HIST140', 'MATH101']]],\n   [['duration', 'MATH101'], ['after', 'HIST140', 'MATH101H']])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Stipulated toy exam-timetabling rule set for a bounded model; it does not claim conformance with any institution's regulations or a benchmark specification, and it performs no search or optimisation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-exam-timetabling-constraints-hard-constraint-validation-period-index-base","generated_at":"2026-09-29T14:52:04.856472+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Hard-constraint validation gates every candidate exam timetable.","root_cause":"The period index is shifted by one.","sha256":"50877af09f4e94eda9b0f90f1edec153b29da81414b6dc1221c134b13bd24fa4","title":"Period durations looked up with one-based indices · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.605,"exit_code":1,"observations":[{"actual":[["duration","A"],["duration","B"]],"check":"regression: period index base 1","expected":[],"passed":false},{"actual":[["duration","BIO130"],["duration","CHEM120"],["duration","MATH101H"],["coincidence","MATH101H","CHEM120"],["coincidence","PHYS110","BIO130"]],"check":"regression variant: period index base 2","expected":[["duration","BIO130"],["coincidence","MATH101H","CHEM120"],["coincidence","PHYS110","BIO130"]],"passed":false},{"actual":[["duration","BIO130"],["duration","MATH101H"],["duration","PHYS110"],["coincidence","MATH101","MATH101H"]],"check":"partial repair guard 3","expected":[["duration","BIO130"],["duration","CHEM120"],["duration","MATH101"],["duration","MATH101H"],["coincidence","MATH101","MATH101H"]],"passed":false},{"actual":[["duration","MATH101"],["duration","MATH101H"],["exclusive","CHEM120","MATH101"],["coincidence","PHYS110","MATH101"]],"check":"normal control 4","expected":[["duration","MATH101H"],["exclusive","CHEM120","MATH101"],["coincidence","PHYS110","MATH101"]],"passed":false},{"actual":[["duration","BIO130"],["duration","CHEM120"],["duration","MATH101"],["duration","PHYS110"],["after","MATH101","MATH101H"],["exclusive","MATH101H","BIO130"],["after","MATH101","CHEM120"]],"check":"normal control 5","expected":[["duration","BIO130"],["duration","MATH101"],["duration","PHYS110"],["after","MATH101","MATH101H"],["exclusive","MATH101H","BIO130"],["after","MATH101","CHEM120"]],"passed":false},{"actual":[["duration","MATH101"],["after","MATH101","CHEM120"]],"check":"normal control 6","expected":[["duration","MATH101"],["after","MATH101","CHEM120"]],"passed":true},{"actual":[["duration","BIO130"],["duration","MATH101H"],["after","MATH101H","MATH101"]],"check":"normal control 7","expected":[["duration","BIO130"],["duration","MATH101H"],["after","MATH101H","MATH101"]],"passed":true},{"actual":[["duration","MATH101"],["duration","MATH101H"],["duration","PHYS110"],["coincidence","MATH101","CHEM120"]],"check":"normal control 8","expected":[["duration","MATH101"],["coincidence","MATH101","CHEM120"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: period index base 1\", \"actual\": [[\"duration\", \"A\"], [\"duration\", \"B\"]], \"expected\": [], \"passed\": false}, {\"check\": \"regression variant: period index base 2\", \"actual\": [[\"duration\", \"BIO130\"], [\"duration\", \"CHEM120\"], [\"duration\", \"MATH101H\"], [\"coincidence\", \"MATH101H\", \"CHEM120\"], [\"coincidence\", \"PHYS110\", \"BIO130\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"coincidence\", \"MATH101H\", \"CHEM120\"], [\"coincidence\", \"PHYS110\", \"BIO130\"]], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101H\"], [\"duration\", \"PHYS110\"], [\"coincidence\", \"MATH101\", \"MATH101H\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"duration\", \"CHEM120\"], [\"duration\", \"MATH101\"], [\"duration\", \"MATH101H\"], [\"coincidence\", \"MATH101\", \"MATH101H\"]], \"passed\": false}, {\"check\": \"normal control 4\", \"actual\": [[\"duration\", \"MATH101\"], [\"duration\", \"MATH101H\"], [\"exclusive\", \"CHEM120\", \"MATH101\"], [\"coincidence\", \"PHYS110\", \"MATH101\"]], \"expected\": [[\"duration\", \"MATH101H\"], [\"exclusive\", \"CHEM120\", \"MATH101\"], [\"coincidence\", \"PHYS110\", \"MATH101\"]], \"passed\": false}, {\"check\": \"normal control 5\", \"actual\": [[\"duration\", \"BIO130\"], [\"duration\", \"CHEM120\"], [\"duration\", \"MATH101\"], [\"duration\", \"PHYS110\"], [\"after\", \"MATH101\", \"MATH101H\"], [\"exclusive\", \"MATH101H\", \"BIO130\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101\"], [\"duration\", \"PHYS110\"], [\"after\", \"MATH101\", \"MATH101H\"], [\"exclusive\", \"MATH101H\", \"BIO130\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [[\"duration\", \"MATH101\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"expected\": [[\"duration\", \"MATH101\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101H\"], [\"after\", \"MATH101H\", \"MATH101\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101H\"], [\"after\", \"MATH101H\", \"MATH101\"]], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [[\"duration\", \"MATH101\"], [\"duration\", \"MATH101H\"], [\"duration\", \"PHYS110\"], [\"coincidence\", \"MATH101\", \"CHEM120\"]], \"expected\": [[\"duration\", \"MATH101\"], [\"coincidence\", \"MATH101\", \"CHEM120\"]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.112,"exit_code":1,"observations":[{"actual":[["duration","A"]],"check":"regression: period index base 1","expected":[],"passed":false},{"actual":[["duration","BIO130"],["duration","MATH101H"],["coincidence","MATH101H","CHEM120"],["coincidence","PHYS110","BIO130"]],"check":"regression variant: period index base 2","expected":[["duration","BIO130"],["coincidence","MATH101H","CHEM120"],["coincidence","PHYS110","BIO130"]],"passed":false},{"actual":[["duration","PHYS110"],["coincidence","MATH101","MATH101H"]],"check":"partial repair guard 3","expected":[["duration","BIO130"],["duration","CHEM120"],["duration","MATH101"],["duration","MATH101H"],["coincidence","MATH101","MATH101H"]],"passed":false},{"actual":[["duration","MATH101"],["duration","MATH101H"],["exclusive","CHEM120","MATH101"],["coincidence","PHYS110","MATH101"]],"check":"normal control 4","expected":[["duration","MATH101H"],["exclusive","CHEM120","MATH101"],["coincidence","PHYS110","MATH101"]],"passed":false},{"actual":[["duration","BIO130"],["duration","MATH101"],["duration","PHYS110"],["after","MATH101","MATH101H"],["exclusive","MATH101H","BIO130"],["after","MATH101","CHEM120"]],"check":"normal control 5","expected":[["duration","BIO130"],["duration","MATH101"],["duration","PHYS110"],["after","MATH101","MATH101H"],["exclusive","MATH101H","BIO130"],["after","MATH101","CHEM120"]],"passed":true},{"actual":[["duration","MATH101"],["after","MATH101","CHEM120"]],"check":"normal control 6","expected":[["duration","MATH101"],["after","MATH101","CHEM120"]],"passed":true},{"actual":[["after","MATH101H","MATH101"]],"check":"normal control 7","expected":[["duration","BIO130"],["duration","MATH101H"],["after","MATH101H","MATH101"]],"passed":false},{"actual":[["duration","MATH101"],["coincidence","MATH101","CHEM120"]],"check":"normal control 8","expected":[["duration","MATH101"],["coincidence","MATH101","CHEM120"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: period index base 1\", \"actual\": [[\"duration\", \"A\"]], \"expected\": [], \"passed\": false}, {\"check\": \"regression variant: period index base 2\", \"actual\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101H\"], [\"coincidence\", \"MATH101H\", \"CHEM120\"], [\"coincidence\", \"PHYS110\", \"BIO130\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"coincidence\", \"MATH101H\", \"CHEM120\"], [\"coincidence\", \"PHYS110\", \"BIO130\"]], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [[\"duration\", \"PHYS110\"], [\"coincidence\", \"MATH101\", \"MATH101H\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"duration\", \"CHEM120\"], [\"duration\", \"MATH101\"], [\"duration\", \"MATH101H\"], [\"coincidence\", \"MATH101\", \"MATH101H\"]], \"passed\": false}, {\"check\": \"normal control 4\", \"actual\": [[\"duration\", \"MATH101\"], [\"duration\", \"MATH101H\"], [\"exclusive\", \"CHEM120\", \"MATH101\"], [\"coincidence\", \"PHYS110\", \"MATH101\"]], \"expected\": [[\"duration\", \"MATH101H\"], [\"exclusive\", \"CHEM120\", \"MATH101\"], [\"coincidence\", \"PHYS110\", \"MATH101\"]], \"passed\": false}, {\"check\": \"normal control 5\", \"actual\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101\"], [\"duration\", \"PHYS110\"], [\"after\", \"MATH101\", \"MATH101H\"], [\"exclusive\", \"MATH101H\", \"BIO130\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101\"], [\"duration\", \"PHYS110\"], [\"after\", \"MATH101\", \"MATH101H\"], [\"exclusive\", \"MATH101H\", \"BIO130\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [[\"duration\", \"MATH101\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"expected\": [[\"duration\", \"MATH101\"], [\"after\", \"MATH101\", \"CHEM120\"]], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [[\"after\", \"MATH101H\", \"MATH101\"]], \"expected\": [[\"duration\", \"BIO130\"], [\"duration\", \"MATH101H\"], [\"after\", \"MATH101H\", \"MATH101\"]], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [[\"duration\", \"MATH101\"], [\"coincidence\", \"MATH101\", \"CHEM120\"]], \"expected\": [[\"duration\", \"MATH101\"], [\"coincidence\", \"MATH101\", \"CHEM120\"]], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}