courses:hcai:lab_prolog

This is an old revision of the document!


  • Reading:
    • AIMA: Chapter 9, Sections 9.2-9.4. Focus on unification, forward and backward chaining, logic programming, and recursive reasoning. Skim the detailed algorithm pseudocode and complexity analysis.
    • Learn Prolog Now!: Sections 1.1-1.2, 2.1-2.2, and 3.1-3.2. Focus on facts, rules, queries, proof search, recursion, and termination. This reading will not be covered in the entry quiz or Q&A, but these basics are required to work efficiently during the laboratory.
  • Technical preparation:
    • Open today's notebook in SWISH using the link in the Notebook section. Run the first query cell in Experiment 1.1 of Segment 1 to verify that the notebook works in your environment. There is no need to run the program cell at the beginning of Segment 1 separately. The query
      created_by(starry_night, Who).

      should return

      Who = van_gogh

Entry quiz

  • 08:30 – FIXME MS Forms
  • 10:00 – FIXME MS Forms
  1. FIXME

Notebook: HCAI_Lab_Reasoning_Systems.swinb

Today, we will use SWISH, an interactive environment for running Prolog programs and notebooks, instead of Google Colab. The notebook follows the usual structure; only the environment is different.

To download the notebook file, click here (Google Drive backup).

Work in groups of 2-4 on the Museum Mystery using the provided Starter Notebook in SWISH.

Build an explainable museum detective that identifies artworks from clues about their creators, topics, artistic movements, museums, cities, and relations between movements. Your program should find all matching artworks, classify each mystery as unique, ambiguous, or unsolved, and provide a readable explanation for every candidate.

Begin by completing the missing Prolog rules and use the supplied cases to test your solution. Make sure that your program supports both direct and multi-step clues, handles cycles in the movement-influence graph, and does not treat missing knowledge as negative knowledge. Do not hard-code answers for individual mysteries.

Next, create two mysteries of your own: one with exactly one matching artwork and one with at least two matches. At least one of them should require a derived or multi-step clue. Exchange your mysteries with another group and check whether their detective returns the expected answers and explanations.

Start the challenge during the lab and continue it as part of the self-study regarding classes. Selected groups may demonstrate their mysteries and explain their modelling choices at the next lab, and effective solutions may receive bonus points.

  • FIXME
  • courses/hcai/lab_prolog.1795722360.txt.gz
  • Last modified: 7 days ago
  • by kkt