courses:hcai:lab_prolog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
courses:hcai:lab_prolog [2026/11/26 15:05] – [Notebook] kktcourses:hcai:lab_prolog [2026/11/26 20:36] (current) – [Entry quiz] kkt
Line 1: Line 1:
-===== Lab: Automated reasoning systems =====+===== Lab: Reasoning systems =====
  
 ==== Before the lab ==== ==== Before the lab ====
  
   * **Reading:**   * **Reading:**
-    * AIMA: FIXME. Focus on FIXME.+    * 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. 
 +    * [[https://lpn.swi-prolog.org/lpnpage.php?pagetype=html&pageid=lpn-html|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:**   * **Technical preparation:**
-    * Open today's notebook and run all setup cells and the first code cell in **Segment 1** to verify that the notebook works in your environment. __The output should FIXME.__ +    * 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 <code prolog>created_by(starry_night, Who).</code> should return <code prolog>Who = van_gogh</code>
 ==== Entry quiz ==== ==== Entry quiz ====
  
-  * 08:30 -- FIXME MS Forms +  * 08:30 -- [[https://forms.cloud.microsoft/e/ArnKUpNTE4|MS Forms]] 
-  * 10:00 -- FIXME MS Forms+  * 10:00 -- [[https://forms.cloud.microsoft/e/yUnCeM3p0e|MS Forms]]
  
 ==== Q&A ==== ==== Q&A ====
  
-  - FIXME+  - A museum query asks for an artwork created by Creator, but two facts match it with different creators. Has unification failed because it produced two answers? 
 +  - A museum adds new facts about artworks every day and wants all implied classifications to become available before visitors ask questions. Should it reason forward from the facts or backward from visitor queries? 
 +  - A visitor asks whether a particular artwork is connected to Impressionism. Must the museum system first derive every possible fact about its entire collection? 
 +  - The museum records that Cubism influenced Futurism, Futurism influenced Constructivism, and Constructivism influenced Cubism. What may happen?
  
 ==== Notebook ==== ==== Notebook ====
Line 26: Line 29:
 ==== Challenge ==== ==== Challenge ====
  
-Work in groups of **2-4** to **FIXME**+Work in groups of **2-4** on the **Museum Mystery** using the provided **[[https://swish.swi-prolog.org/?code=https://krzysztof.kutt.pl/didactics/hcai/HCAI_Challenge_Prolog_Mystery_Starter.swinb|Starter Notebook]]** in SWISH.
  
-Start the challenge during the lab and continue it as part of the **self-study regarding classes**. Selected groups may share their FIXME.+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.
 ==== Learn more! ==== ==== Learn more! ====
  
-  * FIXME+  * [[https://iraitzm.github.io/PrologResurrected/|Logic Quest]] -- Learn Prolog through a retro cyberpunk adventure with puzzles, hints, scoring, and adjustable difficulty 
 + 
 +  * [[https://n3.elfenbenstornet.se/demonstrator|Prolog Trinity Demonstrator]] -- Experiment with expert systems, proof trees, games, concurrent agents, and other runnable examples in the browser 
 +  * [[https://cdglabs.github.io/prolog-viz/|Prolog Visualizer]] -- Watch unification, recursion, and backtracking unfold as an execution tree 
 +  * [[https://github.com/didvc/prolog-logic-puzzle-solver|Prolog Logic Puzzle Solver]] -- Explore five visual logic puzzles with step-by-step reasoning and constraint explanations 
 + 
 +  * [[https://hysenlabs.com/projects/terminusdb-terminusdb|TerminusDB: Git for data]] -- See how a modern graph database combines Prolog, knowledge graphs, versioning, provenance, and time-travel queries 
 +  * [[https://github.com/testlbin/procds|ProCDS]] -- See how Prolog rules and LLMs support transparent clinical decision-making 
 +  * [[https://www.mdpi.com/2571-5577/8/6/160|Renewable-energy traceability]] -- See logic programming and knowledge graphs applied to supply-chain reasoning (no code is provided, but the paper includes a small Prolog example)
  • courses/hcai/lab_prolog.1795705559.txt.gz
  • Last modified: 7 days ago
  • by kkt