summaryrefslogtreecommitdiff
path: root/prolog/problems/family_relations
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-15 20:17:49 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-15 20:17:49 +0100
commit138610b0709d6e251c16b391242023eec393d775 (patch)
treea3ad175f0b2530348cfb7162265b18534651a161 /prolog/problems/family_relations
parent1e8acd4046a4315822bfd65718553733c17fbb3e (diff)
Prolog: add a graph of family relations
Diffstat (limited to 'prolog/problems/family_relations')
-rw-r--r--prolog/problems/family_relations/ancestor_2/sl.py18
-rw-r--r--prolog/problems/family_relations/aunt_2/sl.py12
-rw-r--r--prolog/problems/family_relations/brother_2/sl.py10
-rw-r--r--prolog/problems/family_relations/cousin_2/sl.py15
-rw-r--r--prolog/problems/family_relations/descendant_2/sl.py17
-rw-r--r--prolog/problems/family_relations/famrel.svg343
-rw-r--r--prolog/problems/family_relations/father_2/sl.py12
-rw-r--r--prolog/problems/family_relations/grandparent_2/sl.py15
-rw-r--r--prolog/problems/family_relations/mother_2/sl.py12
-rw-r--r--prolog/problems/family_relations/sister_2/sl.py12
-rw-r--r--prolog/problems/family_relations/sl.py8
11 files changed, 431 insertions, 43 deletions
diff --git a/prolog/problems/family_relations/ancestor_2/sl.py b/prolog/problems/family_relations/ancestor_2/sl.py
index 0308cde..081732b 100644
--- a/prolog/problems/family_relations/ancestor_2/sl.py
+++ b/prolog/problems/family_relations/ancestor_2/sl.py
@@ -4,13 +4,17 @@ name = 'ancestor/2'
slug = 'X je prednik od Y'
description = '''\
-<p><code>ancestor(?X, ?Y)</code>: <code>X</code> je prednik (oče, mama, dedek, …) od <code>Y</code>.</p>
-<pre>
-?- ancestor(patricia, X).
- X = john ;
- X = michael ;
- X = michelle.
-</pre>'''
+<p><code>ancestor(?X, ?Y)</code>: <code>X</code> je prednik (oče, mama, babica,
+pradedek, …) od <code>Y</code>.</p> <pre>
+?- ancestor(patricia, Y).
+ Y = john ;
+ Y = michael ;
+ Y = michelle.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = ['''\
<p>Sedaj pa bo potrebna rekurzija... kako lahko problem prevedem na (en korak) manjši problem?</p>
diff --git a/prolog/problems/family_relations/aunt_2/sl.py b/prolog/problems/family_relations/aunt_2/sl.py
index 71f774f..81014f4 100644
--- a/prolog/problems/family_relations/aunt_2/sl.py
+++ b/prolog/problems/family_relations/aunt_2/sl.py
@@ -6,10 +6,14 @@ slug = 'X je teta od Y'
description = '''\
<p><code>aunt(?X, ?Y)</code>: <code>X</code> je teta od <code>Y</code>.</p>
<pre>
-?- aunt(sally, X).
- X = vanessa ;
- X = patricia.
-</pre>'''
+?- aunt(sally, Y).
+ Y = vanessa ;
+ Y = patricia.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = ['''\
<p>Morda lahko uporabiš rešitev kakšne prejšnje naloge?</p>
diff --git a/prolog/problems/family_relations/brother_2/sl.py b/prolog/problems/family_relations/brother_2/sl.py
index 6d45111..2d170aa 100644
--- a/prolog/problems/family_relations/brother_2/sl.py
+++ b/prolog/problems/family_relations/brother_2/sl.py
@@ -7,9 +7,13 @@ description = '''\
<p><code>brother(?X, ?Y)</code>: <code>X</code> je brat od <code>Y</code>.</p>
<pre>
?- brother(jeffrey, X).
- X = william ;
- X = sally.
-</pre>'''
+ Y = william ;
+ Y = sally.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = [
'''\
diff --git a/prolog/problems/family_relations/cousin_2/sl.py b/prolog/problems/family_relations/cousin_2/sl.py
index a5f2b92..5b82305 100644
--- a/prolog/problems/family_relations/cousin_2/sl.py
+++ b/prolog/problems/family_relations/cousin_2/sl.py
@@ -4,12 +4,17 @@ name = 'cousin/2'
slug = 'X je bratranec ali sestrična od Y'
description = '''\
-<p><code>cousin(?X, ?Y)</code>: <code>X</code> je bratranec ali sestrična od <code>Y</code>.</p>
+<p><code>cousin(?X, ?Y)</code>: <code>X</code> je bratranec ali sestrična od
+<code>Y</code>.</p>
<pre>
-?- cousin(andrew, X).
- X = vanessa ;
- X = patricia.
-</pre>'''
+?- cousin(andrew, Y).
+ Y = vanessa ;
+ Y = patricia.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = ['''\
<p>Verjetno bi se sedaj splačalo uporabiti rešitev kakšne prejšnje naloge?</p>
diff --git a/prolog/problems/family_relations/descendant_2/sl.py b/prolog/problems/family_relations/descendant_2/sl.py
index 36231a1..8774ad6 100644
--- a/prolog/problems/family_relations/descendant_2/sl.py
+++ b/prolog/problems/family_relations/descendant_2/sl.py
@@ -4,13 +4,18 @@ name = 'descendant/2'
slug = 'the descendant relation'
description = '''\
-<p><code>descendant(?X, ?Y)</code>: <code>X</code> je potomec (otrok, vnuk, …) od <code>Y</code>.</p>
+<p><code>descendant(?X, ?Y)</code>: <code>X</code> je potomec (otrok, vnuk,
+pravnukinja, …) od <code>Y</code>.</p>
<pre>
-?- descendant(patricia, X).
- X = william ;
- X = tina ;
- X = thomas.
-</pre>'''
+?- descendant(patricia, Y).
+ Y = william ;
+ Y = tina ;
+ Y = thomas.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = ['''\
<p>Brez rekurzije ne bo šlo... kako lahko problem prevedem na (en korak) manjši problem?</p>
diff --git a/prolog/problems/family_relations/famrel.svg b/prolog/problems/family_relations/famrel.svg
new file mode 100644
index 0000000..bff500c
--- /dev/null
+++ b/prolog/problems/family_relations/famrel.svg
@@ -0,0 +1,343 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.38.0 (20140413.2041)
+ -->
+<!-- Title: famrel Pages: 1 -->
+<svg width="1170pt" height="332pt"
+ viewBox="0.00 0.00 1170.27 332.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 328)">
+<title>famrel</title>
+<polygon fill="white" stroke="none" points="-4,4 -4,-328 1166.27,-328 1166.27,4 -4,4"/>
+<!-- tina -->
+<g id="node1" class="node"><title>tina</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="241.169" cy="-306" rx="28.8653" ry="18"/>
+<text text-anchor="middle" x="241.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;tina♀</text>
+</g>
+<!-- william -->
+<g id="node19" class="node"><title>william</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="241.169" cy="-234" rx="42.451" ry="18"/>
+<text text-anchor="middle" x="241.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;william♂</text>
+</g>
+<!-- tina&#45;&gt;william -->
+<g id="edge1" class="edge"><title>tina&#45;&gt;william</title>
+<path fill="none" stroke="black" d="M241.169,-287.697C241.169,-279.983 241.169,-270.712 241.169,-262.112"/>
+<polygon fill="black" stroke="black" points="244.669,-262.104 241.169,-252.104 237.669,-262.104 244.669,-262.104"/>
+</g>
+<!-- sally -->
+<g id="node2" class="node"><title>sally</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="342.169" cy="-234" rx="31.2902" ry="18"/>
+<text text-anchor="middle" x="342.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;sally♀</text>
+</g>
+<!-- melanie -->
+<g id="node3" class="node"><title>melanie</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="342.169" cy="-162" rx="46.3387" ry="18"/>
+<text text-anchor="middle" x="342.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;melanie♀</text>
+</g>
+<!-- sally&#45;&gt;melanie -->
+<g id="edge6" class="edge"><title>sally&#45;&gt;melanie</title>
+<path fill="none" stroke="black" d="M342.169,-215.697C342.169,-207.983 342.169,-198.712 342.169,-190.112"/>
+<polygon fill="black" stroke="black" points="345.669,-190.104 342.169,-180.104 338.669,-190.104 345.669,-190.104"/>
+</g>
+<!-- andrew -->
+<g id="node22" class="node"><title>andrew</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="443.169" cy="-162" rx="44.1452" ry="18"/>
+<text text-anchor="middle" x="443.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;andrew♂</text>
+</g>
+<!-- sally&#45;&gt;andrew -->
+<g id="edge5" class="edge"><title>sally&#45;&gt;andrew</title>
+<path fill="none" stroke="black" d="M361.643,-219.503C376.287,-209.354 396.615,-195.265 413.308,-183.696"/>
+<polygon fill="black" stroke="black" points="415.432,-186.482 421.657,-177.909 411.444,-180.729 415.432,-186.482"/>
+</g>
+<!-- joanne -->
+<g id="node4" class="node"><title>joanne</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="484.169" cy="-90" rx="41.7203" ry="18"/>
+<text text-anchor="middle" x="484.169" y="-86.3" font-family="noto sans" font-size="14.00"> &#160;joanne♀</text>
+</g>
+<!-- steve -->
+<g id="node23" class="node"><title>steve</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="484.169" cy="-18" rx="35.1771" ry="18"/>
+<text text-anchor="middle" x="484.169" y="-14.3" font-family="noto sans" font-size="14.00"> &#160;steve♂</text>
+</g>
+<!-- joanne&#45;&gt;steve -->
+<g id="edge9" class="edge"><title>joanne&#45;&gt;steve</title>
+<path fill="none" stroke="black" d="M484.169,-71.6966C484.169,-63.9827 484.169,-54.7125 484.169,-46.1124"/>
+<polygon fill="black" stroke="black" points="487.669,-46.1043 484.169,-36.1043 480.669,-46.1044 487.669,-46.1043"/>
+</g>
+<!-- jill -->
+<g id="node5" class="node"><title>jill</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="525.169" cy="-162" rx="27" ry="18"/>
+<text text-anchor="middle" x="525.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;jill♀</text>
+</g>
+<!-- jill&#45;&gt;joanne -->
+<g id="edge8" class="edge"><title>jill&#45;&gt;joanne</title>
+<path fill="none" stroke="black" d="M515.66,-144.765C510.712,-136.317 504.551,-125.799 498.995,-116.312"/>
+<polygon fill="black" stroke="black" points="501.986,-114.493 493.911,-107.633 495.945,-118.031 501.986,-114.493"/>
+</g>
+<!-- vanessa -->
+<g id="node6" class="node"><title>vanessa</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="46.169" cy="-162" rx="46.3387" ry="18"/>
+<text text-anchor="middle" x="46.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;vanessa♀</text>
+</g>
+<!-- susan -->
+<g id="node8" class="node"><title>susan</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="95.169" cy="-90" rx="36.8706" ry="18"/>
+<text text-anchor="middle" x="95.169" y="-86.3" font-family="noto sans" font-size="14.00"> &#160;susan♀</text>
+</g>
+<!-- vanessa&#45;&gt;susan -->
+<g id="edge12" class="edge"><title>vanessa&#45;&gt;susan</title>
+<path fill="none" stroke="black" d="M57.7813,-144.411C63.7616,-135.868 71.1741,-125.278 77.8179,-115.787"/>
+<polygon fill="black" stroke="black" points="80.7727,-117.669 83.6401,-107.47 75.0381,-113.655 80.7727,-117.669"/>
+</g>
+<!-- patricia -->
+<g id="node7" class="node"><title>patricia</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="241.169" cy="-162" rx="44.1452" ry="18"/>
+<text text-anchor="middle" x="241.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;patricia♀</text>
+</g>
+<!-- john -->
+<g id="node25" class="node"><title>john</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="241.169" cy="-90" rx="31.2902" ry="18"/>
+<text text-anchor="middle" x="241.169" y="-86.3" font-family="noto sans" font-size="14.00"> &#160;john♂</text>
+</g>
+<!-- patricia&#45;&gt;john -->
+<g id="edge14" class="edge"><title>patricia&#45;&gt;john</title>
+<path fill="none" stroke="black" d="M241.169,-143.697C241.169,-135.983 241.169,-126.712 241.169,-118.112"/>
+<polygon fill="black" stroke="black" points="244.669,-118.104 241.169,-108.104 237.669,-118.104 244.669,-118.104"/>
+</g>
+<!-- michelle -->
+<g id="node9" class="node"><title>michelle</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="189.169" cy="-18" rx="48.0316" ry="18"/>
+<text text-anchor="middle" x="189.169" y="-14.3" font-family="noto sans" font-size="14.00"> &#160;michelle♀</text>
+</g>
+<!-- estelle -->
+<g id="node10" class="node"><title>estelle</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="509.169" cy="-306" rx="40.0263" ry="18"/>
+<text text-anchor="middle" x="509.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;estelle♀</text>
+</g>
+<!-- george -->
+<g id="node28" class="node"><title>george</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="584.169" cy="-234" rx="43.1824" ry="18"/>
+<text text-anchor="middle" x="584.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;george♂</text>
+</g>
+<!-- estelle&#45;&gt;george -->
+<g id="edge18" class="edge"><title>estelle&#45;&gt;george</title>
+<path fill="none" stroke="black" d="M525.814,-289.465C535.842,-280.105 548.788,-268.022 559.937,-257.616"/>
+<polygon fill="black" stroke="black" points="562.389,-260.116 567.311,-250.734 557.613,-254.998 562.389,-260.116"/>
+</g>
+<!-- helen -->
+<g id="node11" class="node"><title>helen</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="679.169" cy="-306" rx="36.1402" ry="18"/>
+<text text-anchor="middle" x="679.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;helen♀</text>
+</g>
+<!-- jerry -->
+<g id="node30" class="node"><title>jerry</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="757.169" cy="-234" rx="32.0211" ry="18"/>
+<text text-anchor="middle" x="757.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;jerry♂</text>
+</g>
+<!-- helen&#45;&gt;jerry -->
+<g id="edge20" class="edge"><title>helen&#45;&gt;jerry</title>
+<path fill="none" stroke="black" d="M696.094,-289.811C706.973,-280.048 721.27,-267.217 733.296,-256.425"/>
+<polygon fill="black" stroke="black" points="735.707,-258.964 740.812,-249.68 731.032,-253.754 735.707,-258.964"/>
+</g>
+<!-- elaine -->
+<g id="node12" class="node"><title>elaine</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="676.169" cy="-234" rx="38.3335" ry="18"/>
+<text text-anchor="middle" x="676.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;elaine♀</text>
+</g>
+<!-- anna -->
+<g id="node13" class="node"><title>anna</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="736.169" cy="-162" rx="33.7152" ry="18"/>
+<text text-anchor="middle" x="736.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;anna♀</text>
+</g>
+<!-- elaine&#45;&gt;anna -->
+<g id="edge22" class="edge"><title>elaine&#45;&gt;anna</title>
+<path fill="none" stroke="black" d="M689.784,-217.116C697.532,-208.076 707.384,-196.583 716.013,-186.515"/>
+<polygon fill="black" stroke="black" points="718.757,-188.692 722.608,-178.821 713.443,-184.136 718.757,-188.692"/>
+</g>
+<!-- kramer -->
+<g id="node31" class="node"><title>kramer</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="606.169" cy="-162" rx="43.1824" ry="18"/>
+<text text-anchor="middle" x="606.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;kramer♂</text>
+</g>
+<!-- elaine&#45;&gt;kramer -->
+<g id="edge23" class="edge"><title>elaine&#45;&gt;kramer</title>
+<path fill="none" stroke="black" d="M660.634,-217.465C651.429,-208.26 639.59,-196.421 629.303,-186.134"/>
+<polygon fill="black" stroke="black" points="631.692,-183.573 622.146,-178.977 626.742,-188.523 631.692,-183.573"/>
+</g>
+<!-- margaret -->
+<g id="node14" class="node"><title>margaret</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="1095.17" cy="-306" rx="52.1504" ry="18"/>
+<text text-anchor="middle" x="1095.17" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;margaret♀</text>
+</g>
+<!-- nevia -->
+<g id="node16" class="node"><title>nevia</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="998.169" cy="-234" rx="35.1771" ry="18"/>
+<text text-anchor="middle" x="998.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;nevia♀</text>
+</g>
+<!-- margaret&#45;&gt;nevia -->
+<g id="edge25" class="edge"><title>margaret&#45;&gt;nevia</title>
+<path fill="none" stroke="black" d="M1073.64,-289.465C1059.64,-279.364 1041.25,-266.091 1026.13,-255.177"/>
+<polygon fill="black" stroke="black" points="1027.82,-252.079 1017.66,-249.066 1023.72,-257.756 1027.82,-252.079"/>
+</g>
+<!-- alessandro -->
+<g id="node33" class="node"><title>alessandro</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="1103.17" cy="-234" rx="59.1929" ry="18"/>
+<text text-anchor="middle" x="1103.17" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;alessandro♂</text>
+</g>
+<!-- margaret&#45;&gt;alessandro -->
+<g id="edge26" class="edge"><title>margaret&#45;&gt;alessandro</title>
+<path fill="none" stroke="black" d="M1097.15,-287.697C1098.03,-279.983 1099.09,-270.712 1100.07,-262.112"/>
+<polygon fill="black" stroke="black" points="1103.56,-262.437 1101.21,-252.104 1096.6,-261.642 1103.56,-262.437"/>
+</g>
+<!-- ana -->
+<g id="node15" class="node"><title>ana</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="870.169" cy="-306" rx="28.1352" ry="18"/>
+<text text-anchor="middle" x="870.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;ana♀</text>
+</g>
+<!-- aleksander -->
+<g id="node34" class="node"><title>aleksander</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="893.169" cy="-234" rx="59.1929" ry="18"/>
+<text text-anchor="middle" x="893.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;aleksander♂</text>
+</g>
+<!-- ana&#45;&gt;aleksander -->
+<g id="edge27" class="edge"><title>ana&#45;&gt;aleksander</title>
+<path fill="none" stroke="black" d="M875.737,-288.055C878.325,-280.176 881.466,-270.617 884.365,-261.794"/>
+<polygon fill="black" stroke="black" points="887.696,-262.868 887.493,-252.275 881.046,-260.683 887.696,-262.868"/>
+</g>
+<!-- luana -->
+<g id="node17" class="node"><title>luana</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="900.169" cy="-162" rx="36.1402" ry="18"/>
+<text text-anchor="middle" x="900.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;luana♀</text>
+</g>
+<!-- nevia&#45;&gt;luana -->
+<g id="edge29" class="edge"><title>nevia&#45;&gt;luana</title>
+<path fill="none" stroke="black" d="M978.337,-218.834C963.991,-208.587 944.401,-194.594 928.421,-183.18"/>
+<polygon fill="black" stroke="black" points="930.143,-180.109 919.971,-177.144 926.074,-185.805 930.143,-180.109"/>
+</g>
+<!-- daniela -->
+<g id="node18" class="node"><title>daniela</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="994.169" cy="-162" rx="43.9143" ry="18"/>
+<text text-anchor="middle" x="994.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;daniela♀</text>
+</g>
+<!-- nevia&#45;&gt;daniela -->
+<g id="edge31" class="edge"><title>nevia&#45;&gt;daniela</title>
+<path fill="none" stroke="black" d="M997.18,-215.697C996.739,-207.983 996.21,-198.712 995.718,-190.112"/>
+<polygon fill="black" stroke="black" points="999.211,-189.888 995.146,-180.104 992.223,-190.288 999.211,-189.888"/>
+</g>
+<!-- william&#45;&gt;vanessa -->
+<g id="edge10" class="edge"><title>william&#45;&gt;vanessa</title>
+<path fill="none" stroke="black" d="M209.839,-221.753C177.069,-209.99 125.417,-191.448 88.9153,-178.345"/>
+<polygon fill="black" stroke="black" points="89.6445,-174.888 79.05,-174.803 87.2794,-181.476 89.6445,-174.888"/>
+</g>
+<!-- william&#45;&gt;patricia -->
+<g id="edge11" class="edge"><title>william&#45;&gt;patricia</title>
+<path fill="none" stroke="black" d="M241.169,-215.697C241.169,-207.983 241.169,-198.712 241.169,-190.112"/>
+<polygon fill="black" stroke="black" points="244.669,-190.104 241.169,-180.104 237.669,-190.104 244.669,-190.104"/>
+</g>
+<!-- thomas -->
+<g id="node20" class="node"><title>thomas</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="342.169" cy="-306" rx="44.1452" ry="18"/>
+<text text-anchor="middle" x="342.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;thomas♂</text>
+</g>
+<!-- thomas&#45;&gt;sally -->
+<g id="edge3" class="edge"><title>thomas&#45;&gt;sally</title>
+<path fill="none" stroke="black" d="M342.169,-287.697C342.169,-279.983 342.169,-270.712 342.169,-262.112"/>
+<polygon fill="black" stroke="black" points="345.669,-262.104 342.169,-252.104 338.669,-262.104 345.669,-262.104"/>
+</g>
+<!-- thomas&#45;&gt;william -->
+<g id="edge2" class="edge"><title>thomas&#45;&gt;william</title>
+<path fill="none" stroke="black" d="M320.75,-290.155C306.288,-280.132 286.999,-266.763 271.034,-255.698"/>
+<polygon fill="black" stroke="black" points="272.77,-252.644 262.558,-249.824 268.783,-258.397 272.77,-252.644"/>
+</g>
+<!-- jeffrey -->
+<g id="node21" class="node"><title>jeffrey</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="424.169" cy="-234" rx="40.0263" ry="18"/>
+<text text-anchor="middle" x="424.169" y="-230.3" font-family="noto sans" font-size="14.00"> &#160;jeffrey♂</text>
+</g>
+<!-- thomas&#45;&gt;jeffrey -->
+<g id="edge4" class="edge"><title>thomas&#45;&gt;jeffrey</title>
+<path fill="none" stroke="black" d="M360.367,-289.465C371.592,-279.883 386.16,-267.447 398.54,-256.878"/>
+<polygon fill="black" stroke="black" points="400.97,-259.406 406.304,-250.251 396.425,-254.082 400.97,-259.406"/>
+</g>
+<!-- andrew&#45;&gt;joanne -->
+<g id="edge7" class="edge"><title>andrew&#45;&gt;joanne</title>
+<path fill="none" stroke="black" d="M452.885,-144.411C457.716,-136.163 463.664,-126.009 469.071,-116.777"/>
+<polygon fill="black" stroke="black" points="472.204,-118.354 474.238,-107.956 466.163,-114.816 472.204,-118.354"/>
+</g>
+<!-- patrick -->
+<g id="node24" class="node"><title>patrick</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="144.169" cy="-162" rx="41.4901" ry="18"/>
+<text text-anchor="middle" x="144.169" y="-158.3" font-family="noto sans" font-size="14.00"> &#160;patrick♂</text>
+</g>
+<!-- patrick&#45;&gt;susan -->
+<g id="edge13" class="edge"><title>patrick&#45;&gt;susan</title>
+<path fill="none" stroke="black" d="M132.557,-144.411C126.576,-135.868 119.164,-125.278 112.52,-115.787"/>
+<polygon fill="black" stroke="black" points="115.3,-113.655 106.698,-107.47 109.565,-117.669 115.3,-113.655"/>
+</g>
+<!-- john&#45;&gt;michelle -->
+<g id="edge16" class="edge"><title>john&#45;&gt;michelle</title>
+<path fill="none" stroke="black" d="M229.369,-73.1159C222.973,-64.5051 214.922,-53.6674 207.708,-43.9567"/>
+<polygon fill="black" stroke="black" points="210.42,-41.7377 201.647,-35.7973 204.801,-45.912 210.42,-41.7377"/>
+</g>
+<!-- michael -->
+<g id="node26" class="node"><title>michael</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="294.169" cy="-18" rx="45.6069" ry="18"/>
+<text text-anchor="middle" x="294.169" y="-14.3" font-family="noto sans" font-size="14.00"> &#160;michael♂</text>
+</g>
+<!-- john&#45;&gt;michael -->
+<g id="edge15" class="edge"><title>john&#45;&gt;michael</title>
+<path fill="none" stroke="black" d="M253.196,-73.1159C259.715,-64.5051 267.921,-53.6674 275.273,-43.9567"/>
+<polygon fill="black" stroke="black" points="278.205,-45.8827 281.451,-35.7973 272.624,-41.6572 278.205,-45.8827"/>
+</g>
+<!-- frank -->
+<g id="node27" class="node"><title>frank</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="595.169" cy="-306" rx="35.1771" ry="18"/>
+<text text-anchor="middle" x="595.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;frank♂</text>
+</g>
+<!-- frank&#45;&gt;george -->
+<g id="edge17" class="edge"><title>frank&#45;&gt;george</title>
+<path fill="none" stroke="black" d="M592.45,-287.697C591.238,-279.983 589.781,-270.712 588.43,-262.112"/>
+<polygon fill="black" stroke="black" points="591.867,-261.44 586.857,-252.104 584.952,-262.526 591.867,-261.44"/>
+</g>
+<!-- george&#45;&gt;kramer -->
+<g id="edge24" class="edge"><title>george&#45;&gt;kramer</title>
+<path fill="none" stroke="black" d="M589.495,-216.055C591.944,-208.261 594.911,-198.822 597.659,-190.079"/>
+<polygon fill="black" stroke="black" points="601.08,-190.865 600.74,-180.275 594.402,-188.766 601.08,-190.865"/>
+</g>
+<!-- morty -->
+<g id="node29" class="node"><title>morty</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="764.169" cy="-306" rx="38.3335" ry="18"/>
+<text text-anchor="middle" x="764.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;morty♂</text>
+</g>
+<!-- morty&#45;&gt;jerry -->
+<g id="edge19" class="edge"><title>morty&#45;&gt;jerry</title>
+<path fill="none" stroke="black" d="M762.439,-287.697C761.667,-279.983 760.74,-270.712 759.88,-262.112"/>
+<polygon fill="black" stroke="black" points="763.357,-261.706 758.879,-252.104 756.392,-262.403 763.357,-261.706"/>
+</g>
+<!-- jerry&#45;&gt;anna -->
+<g id="edge21" class="edge"><title>jerry&#45;&gt;anna</title>
+<path fill="none" stroke="black" d="M752.086,-216.055C749.747,-208.261 746.916,-198.822 744.293,-190.079"/>
+<polygon fill="black" stroke="black" points="747.578,-188.848 741.352,-180.275 740.873,-190.859 747.578,-188.848"/>
+</g>
+<!-- aleksandr -->
+<g id="node32" class="node"><title>aleksandr</title>
+<ellipse fill="none" stroke="black" stroke-width="0.75" cx="963.169" cy="-306" rx="53.6122" ry="18"/>
+<text text-anchor="middle" x="963.169" y="-302.3" font-family="noto sans" font-size="14.00"> &#160;aleksandr♂</text>
+</g>
+<!-- aleksandr&#45;&gt;aleksander -->
+<g id="edge28" class="edge"><title>aleksandr&#45;&gt;aleksander</title>
+<path fill="none" stroke="black" d="M946.934,-288.765C938.051,-279.882 926.878,-268.709 917.023,-258.854"/>
+<polygon fill="black" stroke="black" points="919.348,-256.23 909.802,-251.633 914.399,-261.179 919.348,-256.23"/>
+</g>
+<!-- aleksander&#45;&gt;luana -->
+<g id="edge30" class="edge"><title>aleksander&#45;&gt;luana</title>
+<path fill="none" stroke="black" d="M894.899,-215.697C895.671,-207.983 896.598,-198.712 897.458,-190.112"/>
+<polygon fill="black" stroke="black" points="900.946,-190.403 898.459,-180.104 893.981,-189.706 900.946,-190.403"/>
+</g>
+<!-- aleksander&#45;&gt;daniela -->
+<g id="edge32" class="edge"><title>aleksander&#45;&gt;daniela</title>
+<path fill="none" stroke="black" d="M915.835,-217.291C930.165,-207.359 948.842,-194.415 964.365,-183.656"/>
+<polygon fill="black" stroke="black" points="966.391,-186.511 972.616,-177.938 962.403,-180.757 966.391,-186.511"/>
+</g>
+</g>
+</svg>
diff --git a/prolog/problems/family_relations/father_2/sl.py b/prolog/problems/family_relations/father_2/sl.py
index adb6fd9..4f7f3de 100644
--- a/prolog/problems/family_relations/father_2/sl.py
+++ b/prolog/problems/family_relations/father_2/sl.py
@@ -8,10 +8,14 @@ description = '''\
<pre>
?- father(thomas, william).
true.
-?- father(aleksander, X).
- X = luana ;
- X = daniela.
-</pre>'''
+?- father(aleksander, Y).
+ Y = luana ;
+ Y = daniela.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = [
'''\
diff --git a/prolog/problems/family_relations/grandparent_2/sl.py b/prolog/problems/family_relations/grandparent_2/sl.py
index bd2d63c..2961ffa 100644
--- a/prolog/problems/family_relations/grandparent_2/sl.py
+++ b/prolog/problems/family_relations/grandparent_2/sl.py
@@ -4,14 +4,19 @@ name = 'grandparent/2'
slug = 'X je dedek ali babica od Y'
description = '''\
-<p><code>grandparent(?X, ?Y)</code>: <code>X</code> je dedek ali babica od <code>Y</code>.</p>
+<p><code>grandparent(?X, ?Y)</code>: <code>X</code> je dedek ali babica od
+<code>Y</code>.</p>
<pre>
-?- grandparent(tina, X).
- X = vanessa ;
- X = patricia.
+?- grandparent(tina, Y).
+ Y = vanessa ;
+ Y = patricia.
?- grandparent(tina, vanessa).
true.
-</pre>'''
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = ['''\
<p><img src="[%@resource Prolog_grandparent_01.svg%]" alt="Dedek ali babica ima otroka, ki ima otroka." /></p>
diff --git a/prolog/problems/family_relations/mother_2/sl.py b/prolog/problems/family_relations/mother_2/sl.py
index 32103a8..e3cbd1e 100644
--- a/prolog/problems/family_relations/mother_2/sl.py
+++ b/prolog/problems/family_relations/mother_2/sl.py
@@ -8,10 +8,14 @@ description = '''\
<pre>
?- mother(tina, william).
true.
-?- mother(nevia, X).
- X = luana ;
- X = daniela.
-</pre>'''
+?- mother(nevia, Y).
+ Y = luana ;
+ Y = daniela.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = [
'''\
diff --git a/prolog/problems/family_relations/sister_2/sl.py b/prolog/problems/family_relations/sister_2/sl.py
index 92ea45d..6c36bce 100644
--- a/prolog/problems/family_relations/sister_2/sl.py
+++ b/prolog/problems/family_relations/sister_2/sl.py
@@ -4,11 +4,15 @@ name = 'sister/2'
slug = 'X je sestra od Y'
description = '''\
-<p><code>sister(?X, ?Y)</code>: <code>X</code> je sestra od <code>Y</code>.</p>
+<p><code>sister(?X, ?Y)</code>: <code>X</code> je sestra od <code>Y</code>. Primer:</p>
<pre>
-?- sister(vanessa, X).
- X = patricia.
-</pre>'''
+?- sister(vanessa, Y).
+ Y = patricia.
+</pre>
+<p><a target="_blank" href="[%@resource famrel.svg%]">Družinska drevesa</a> so
+podana s predikati <code>parent/2</code>, <code>male/1</code> in
+<code>female/1</code>.</p>
+'''
plan = [
'''\
diff --git a/prolog/problems/family_relations/sl.py b/prolog/problems/family_relations/sl.py
index fafdeef..81242ed 100644
--- a/prolog/problems/family_relations/sl.py
+++ b/prolog/problems/family_relations/sl.py
@@ -1,2 +1,8 @@
name = 'Družinske relacije'
-description = 'Prvi koraki v prologu, pisanje pravil za različne družinske relacije.'
+description = '''\
+<p>Prvi koraki v prologu – pisanje pravil za različne družinske relacije.
+Za naloge v tem sklopu je že definirana baza podatkov o
+<a target="_blank" href="[%@resource famrel.svg%]">družinskih drevesih</a>.
+V prologu so te informacije predstavljene s predikati <code>parent/2</code>,
+<code>male/1</code> in <code>female/1</code>.</p>
+'''