Skip to content
A collection of short Prolog programs & predicates
Prolog Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
A1
A2
A3
A4
README.md

README.md

Solutions to problems from a 2nd year course on Logic Programming.

Contents

A1

  • Unification & Arithmetic (i.e. do the following expressions unify, if yes, what's the result?)
  • Family Tree
  • Animal Classification

A2

  • List Operations (Prolog predicates for list operations)
  • Six Degrees of Bruce Campbell (finds if a given actor is within 6 degrees of separation of Bruce)
  • Campbell Number (finds the minimum degrees of separation between an actor and Bruce)

A3

  • String Tokenizer
  • Postfix Calculator
  • Knapsack Problem (uses assert predicate, solves by brute-force)

A4

  • Logic Puzzle (uses Constraint Logic Programming with Finite Domains - clpfd)
  • Palindromes (uses Definite Clause Grammars)

Credit

Earl E. Foxwell was my course instructor. He came up with the problems (or borrowed them from elsewhere). The problems are not my own, but the solutions are unless otherwise noted.

TODO

  • Fix bugs & mistakes
  • Cleanup
Something went wrong with that request. Please try again.