This document contains the information for the exercises part of the KR2025 tutorial on User-friendly KR.
We use the BPMN.io DMN modeller to represent the following decision procedure:
Start by opening the editor in a new tab. The editor will automatically open an empty table. Note that this editor does not color the inputs or outputs, but uses a “When-then” labeling. Now create a table that defines “hole” in terms of “wall” (we will do this together).
To add a new table, click on the “View DRD” button in the top-left. This drops you in the Decision Requirements Diagram – a visual overview of the decision tables and how they are connected. Next, click on the rectangle in the toolbar on the left, and place a new rectangle anywhere in the canvas. Lastly, click on the wrench, followed by “Decision Table” to turn it into a decision table. (We will also do this together)
Now try to create a table which defines “method” in terms of “hole” and “weight”. :-)
Unfortunately, BPMN.io cannot run our models for us. In this
tutorial, we will instead rely on the IDP-Z3 reasoning engine. However, this
currently does not support uploading .dmn files.
You have two options:
cdmn-solver tool using pip,
and convert the .dmn into .json.Our handyman has recently upgraded their toolkit with a diamond drill bit, which allows them to safely drill through tile to make a hole. Can you update the model to reflect this? Try to work in IDP-Z3’s online IDE directly.
Important: take care to update the glossary tables
as well – diamond drillbit should be added to the boolean
table.
As part of the next exercise, model the following knowledge as a feature model:
In the same IDP-Z3 webIDE as before, click on the tab “Feature Model” to go to the editor. Next, you can click anywhere on the canvas to introduce a new feature. When a feature has been selected, a toolbar will appear allowing you to change its name, child relations, and parent relation. (We will start together initially)
To generate solutions for the feature model, click “Run” at the top of the screen.
Alternatively, click “Interactive Consultant” to try some specific things.
In the BPMN.io editor (or on a piece of paper), try to express the following knowledge:
Starting from our previous Handyman solution, replace the “How to hang” table by tables representing:
(Solution)
cDMN also supports types, higher-ary symbols, and quantification. For instance, this model represents a partial solution to the well-known Map Coloring problem, in which we want to ensure that no neighbouring countries share the same color. In more detail, the model contains:
color_of_country: Country -> Color)D which defines which countries
bordersMap coloring table which expresses that each country
is red.Now, try to modify this last table to express that “For every country c1,c2 must hold that if they border, they may not have the same color”. Tips:
Type called t introduces a universal
quantifier t over type Typet can then be used as part of functions and predicates,
provided the type matchesnot(x) to denote that
Column != xIn the Interactive Consultant, each symbol of the model is represented by a symbol tile through which values can be assigned:
Importantly, each time you set a value, the system derives the consequences (if any) and shows them as grey values. Clicking on such a system-derived value will show an explanation for why the value was derived.
In this cDMN model, we model the advice given by Belgium regarding quarantines/PCRtests after a “high risk” contact with someone who tested positive for covid. This advice was as follows:
The linked cDMN model was built by someone with little modeling expertise, so it’s possible that some errors slipped in. Can you find any by testing out things in the Interactive Consultant? To help you on your way, you can check the things listed below. If you encounter any errors, try to update the cDMN model accordingly.