summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2019-01-05 12:38:39 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2019-01-05 12:38:39 +0100
commit3e5d0d5844d9e747dd8b5995e5e1d5112800d85e (patch)
tree9f72a1fb83ff3a35ef77b934fac1423a1c54707d
parentc13b52c27e84a0a94e66d569dc03cfcf0f8e5261 (diff)
Prolog: add short intro for family_relations set
-rw-r--r--prolog/problems/family_relations/en.py9
-rw-r--r--prolog/problems/family_relations/intro_en.html49
2 files changed, 57 insertions, 1 deletions
diff --git a/prolog/problems/family_relations/en.py b/prolog/problems/family_relations/en.py
index dd8f6d6..a57ff7f 100644
--- a/prolog/problems/family_relations/en.py
+++ b/prolog/problems/family_relations/en.py
@@ -1,2 +1,9 @@
name = 'Family relations'
-description = 'First steps in Prolog, defining rules for various family relations.'
+description = '''\
+<p>
+<a target="_blank" href="[%@resource intro_en.html%]">First steps in Prolog</a>: defining rules for various family relations.
+For tasks in this set a database of <a target="_blank" href="[%@resource famrel.svg%]">family trees</a> is already defined.
+In Prolog, this information is represented with the predicates <code>parent/2</code>,
+<code>male/1</code> and <code>female/1</code>.
+</p>
+'''
diff --git a/prolog/problems/family_relations/intro_en.html b/prolog/problems/family_relations/intro_en.html
new file mode 100644
index 0000000..6f2a8d6
--- /dev/null
+++ b/prolog/problems/family_relations/intro_en.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>Prolog: family relations</title>
+ <link rel="stylesheet" type="text/css" href="/css/codeq.css" />
+ <link rel="stylesheet" type="text/css" href="../../style.css" />
+</head>
+<body>
+
+<h1>Prolog: family relations</h1>
+<p>
+The first set of tasks is an introduction to Prolog. At the same time we will refresh our knowledge of family relations – that’s right, we will deal with aunts, uncles, grandparents, ancestors and descendants.
+</p>
+
+<h2>Knowledge base</h2>
+<p>
+Everything Prolog knows is written in its knowledge base, which is simply a Prolog program. This is usually loaded from one or more files, which are loaded automatically in <span class="codeq">CodeQ</span>. The figure below shows a graphical representation of the knowledge base for this set.
+</p>
+
+<figure>
+ <a href="famrel.svg" target="_blank">
+ <img src="famrel.svg" />
+ </a>
+ <figcaption>The graph (forest) of family relations</figcaption>
+</figure>
+
+<p>
+The knowledge base itself is of course not represented in graphical form; it actually looks like this:
+</p>
+<pre>
+parent(tina, william).
+parent(thomas, william).
+parent(thomas, sally).
+parent(thomas, jeffrey).
+parent(william, vanessa).
+…
+female(tina).
+female(sally).
+female(vanessa).
+…
+male(william).
+male(thomas).
+male(jeffrey).
+…
+</pre>
+
+ </body>
+</html>