Capstone Projects
Facts for 3–4 generations; rules for every relationship (cousin, in-law, nth-ancestor); a query REPL with natural-language-like output.
Project 1 — Family tree knowledge base (beginner)
Facts for 3–4 generations; rules for every relationship (cousin, in-law, nth-ancestor); a query REPL with natural-language-like output. *Concepts: facts, rules, recursion, findall/setof, format.*
Project 2 — Puzzle solver suite (beginner/intermediate)
Zebra puzzle, N-queens, SEND+MORE, Sudoku, map coloring — each with both generate-and-test and CLP(FD); compare timings. *Concepts: backtracking, CLP(FD), labeling strategies.*
Project 3 — Natural-language query interface (intermediate)
DCG parser for questions like "who is the grandparent of ann?" translated into Prolog queries over Project 1's knowledge base. *Concepts: DCGs, parse trees, semantic translation, meta-calls.*
question(Q) --> [who, is, the], relation(R), [of], [Person], ['?'],
{ Q =.. [R, Who, Person], Who = _ }.
relation(grandparent) --> [grandparent].
relation(parent) --> [parent].
ask(Words) :-
phrase(question(Q), Words),
arg(1, Q, Who),
findall(Who, Q, Answers),
format("Answer: ~w~n", [Answers]).
?- ask([who, is, the, grandparent, of, ann, '?']).Project 4 — Expert system shell (intermediate/advanced)
Rule language with operators (if ... then ...), backward and forward chaining, certainty factors, "why/how" explanations via a meta-interpreter. *Concepts: operators, term expansion, meta-interpreters, dynamic database.*
Project 5 — Mini programming language (advanced)
Tokenizer (DCG over chars) → parser (DCG over tokens) → type checker (unification) → interpreter and compiler to a stack VM. *Concepts: DCGs, ASTs, assoc environments, difference lists.*
Project 6 — Scheduler / timetabling system (advanced)
University timetabling with rooms, teachers, and student groups; hard & soft constraints; optimization with CLP(FD); web UI using SWI's HTTP server. *Concepts: CLP(FD) global constraints, optimization, web APIs, JSON.*
Project 7 — Path planning & game AI (advanced)
A* route planner on a grid map and a tic-tac-toe / connect-four player with minimax + alpha-beta. *Concepts: search algorithms, heuristics, heaps, tabling.*
Project 8 — REST service with Prolog + Python (expert)
A rules engine exposed via SWI's HTTP JSON API; a Python client (Janus) that feeds data from pandas and queries Prolog for decisions; plunit + pytest tests; Docker deployment. *Concepts: web, foreign interfaces, modules, deployment.*