How triska/simsttab works
Project type and purpose
• This is an open-source, command-line timetabling engine written in Prolog (a constraint-solver for school schedules).
• Its purpose is to read a requirement specification (reqs.pl), solve the scheduling problem via a Prolog engine, and emit a timetable (timetable.txt).
File structure
• Top‐level files:
• simsttab.pl : the main Prolog module/solver
• reqs.pl : user‐provided constraints (rooms, timeslots, teachers, classes)
• timetable.txt: sample output
• README.md : project description & usage
• No frontend/backend split – it’s a single‐process CLI tool.
• No build scripts or deployment artifacts beyond “run in Scryer-Prolog.”
README for additional insights
• Usage: “scryer-prolog simsttab.pl reqs.pl”
• Key operations:
a. Load library and problem definition (simsttab.pl + reqs.pl)
b. Generate Prolog variables, apply labeling([ff],Vs) – the finite‐domain search
c. Print results via print_classes/1
a. Main components:
1. CLI Interface / Invocation
2. Requirement Loader (reqs.pl parser)
3. Constraint Generator (requirements_variables/2)
4. Prolog Finite-Domain Solver (labeling/2 in the Scryer engine)
5. Output Formatter (print_classes/1)
6. External Runtime (Scryer-Prolog interpreter)
7. File System (input .pl files, output .txt)
b. Relationships & interactions:
• User → CLI
• CLI invokes Prolog interpreter, loads simsttab.pl & reqs.pl
• Requirement Loader → generates internal facts
• Constraint Generator → builds FD variables & constraints
• Prolog Solver → explores search space, finds a solution
• Output Formatter → writes timetable to stdout or timetable.txt
c. Architectural patterns / design principles:
• Modular decomposition: separation of “problem definition” (reqs.pl) from “solver logic” (simsttab.pl).
• Declarative pipeline: load facts → generate constraints → solve → print.
• Single‐process, data-flow architecture.
d. Key technologies / libraries:
• Scryer-Prolog engine (constraint‐solving runtime)
• Prolog FD library (labeling/2)
• Plain text input/output