5DV248 · Trustworthy Human-AI Interaction · Interactive laboratory

Lab 14 — Asking and Telling with Description Logics

Represent a small university knowledge base using concepts, roles and individuals. Tell the knowledge base what is true, then ask what follows from those statements.

Beginner · Knowledge representation · Interactive

Learning objectives

Teaching scenario: a fictional university. The knowledge base is intentionally small so that every inference can be inspected.

1 · The formal language

We use a small, explicitly defined fragment of ALC-style Description Logic. The lab supports atomic concept inclusions, the two role constraints below, concept assertions and role assertions. It is not a complete ALC reasoner.

Knowledge base

\(\mathcal{K}=(\mathcal{T},\mathcal{A})\)

TBox \(\mathcal{T}\): general statements about concepts and roles.

ABox \(\mathcal{A}\): statements about named individuals.

Interpretation

\(\mathcal{I}=(\Delta^\mathcal{I},\cdot^\mathcal{I})\)

A non-empty domain \(\Delta^\mathcal{I}\), together with an interpretation of every concept, role and individual name.

Syntax used in this laboratory

ExpressionMeaningExample
\(C\sqsubseteq D\)Every C is a D (concept inclusion)\(Student\sqsubseteq Person\)
\(C(a)\)Individual a is an instance of C\(Student(Alice)\)
\(R(a,b)\)a is related to b by role R\(EnrolledIn(Alice,AI)\)
\(\exists R.\top\sqsubseteq C\)Anything related by R to at least one thing is a C (domain constraint)\(\exists EnrolledIn.\top\sqsubseteq Person\)
\(\top\sqsubseteq\forall R.C\)Every R-successor is a C (range constraint)\(\top\sqsubseteq\forall EnrolledIn.Course\)

Semantics: the central satisfaction conditions

\(C\sqsubseteq D\) is satisfied iff \(C^\mathcal{I}\subseteq D^\mathcal{I}\).
\(C(a)\) is satisfied iff \(a^\mathcal{I}\in C^\mathcal{I}\).
\(R(a,b)\) is satisfied iff \((a^\mathcal{I},b^\mathcal{I})\in R^\mathcal{I}\).

Here, \(C^\mathcal{I}\subseteq\Delta^\mathcal{I}\) and \(R^\mathcal{I}\subseteq\Delta^\mathcal{I}\times\Delta^\mathcal{I}\). The symbol \(\top\) denotes the whole domain.

2 · Start with a knowledge base

The initial TBox and ABox are shown below. Select a statement to see its role in the knowledge base.

TBox · Terminological axioms
Student ⊑ Person
Lecturer ⊑ Person
∃ EnrolledIn.⊤ ⊑ Person
⊤ ⊑ ∀ EnrolledIn.Course

The first two axioms define subclasses. The last two constrain the domain and range of EnrolledIn.

ABox · Assertions
Student(Alice)
Course(AI)
EnrolledIn(Alice, AI)

These statements concern named individuals.

From these statements, the knowledge base entails Person(Alice). It also entails Course(AI), which is explicitly asserted.

3 · TELL — Add knowledge

Tell adds an axiom or assertion. Choose the statement type and enter its symbols. Names are case-sensitive.

Choose a statement and add it to the knowledge base.

Current knowledge base

TBox
ABox

4 · ASK — Query the knowledge base

Ask whether an assertion follows, retrieve instances of a concept, or test whether one concept is subsumed by another.

Submit a query to see the result and its justification.

Inference trace

The trace distinguishes facts explicitly told from facts derived by the supported inference rules.

No query has been evaluated yet.

5 · Experiment: change one fact

Try the following sequence. Predict the result before clicking Ask.

  1. Tell ResearchStudent ⊑ Student.
  2. Tell ResearchStudent(Bob).
  3. Ask whether Person(Bob) follows.
  4. Tell EnrolledIn(Bob, Robotics) as a role assertion.
  5. Ask whether Course(Robotics) follows. Explain which TBox axiom supports the result.
Open-world assumption: if the knowledge base cannot derive Lecturer(Bob), you cannot conclude ¬Lecturer(Bob). The information may simply be unknown.

6 · Mathematical view of the queries

A knowledge base entails an assertion when that assertion is true in every model of the knowledge base.

\(\mathcal{K}\models\varphi\quad\text{iff}\quad\forall\mathcal{I}\;(\mathcal{I}\models\mathcal{K}\Rightarrow\mathcal{I}\models\varphi)\)

For instance checking, the query is \(C(a)\). For subsumption, the query is \(C\sqsubseteq D\). For retrieval, the answer set is the named individuals a for which \(\mathcal{K}\models C(a)\).

\(Ans_{inst}(C,\mathcal{K})=\{a\mid a\text{ is named and }\mathcal{K}\models C(a)\}\)

What this implementation computes

The interactive engine computes closure for a finite, positive fragment: named concept assertions, named role assertions, atomic subclass inclusions, and the displayed domain/range constraints. It does not implement all ALC constructors, negation, disjointness, existential witness generation, equality, or a complete DL tableau procedure. Its positive entailment results are limited to the stated fragment.

7 · Check your understanding

Question 1

Is Student ⊑ Person an ABox assertion?

Question 2

If Student(Alice) and Student ⊑ Person, what follows?

Question 3

If Lecturer(Bob) is not derivable, is ¬Lecturer(Bob) true?