From 138610b0709d6e251c16b391242023eec393d775 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 15 Feb 2016 20:17:49 +0100 Subject: Prolog: add a graph of family relations --- prolog/problems/family_relations/grandparent_2/sl.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'prolog/problems/family_relations/grandparent_2') 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 = '''\ -

grandparent(?X, ?Y): X je dedek ali babica od Y.

+

grandparent(?X, ?Y): X je dedek ali babica od +Y.

-?- grandparent(tina, X).
-  X = vanessa ;
-  X = patricia.
+?- grandparent(tina, Y).
+  Y = vanessa ;
+  Y = patricia.
 ?- grandparent(tina, vanessa).
   true.
-
''' + +

Družinska drevesa so +podana s predikati parent/2, male/1 in +female/1.

+''' plan = ['''\

Dedek ali babica ima otroka, ki ima otroka.

-- cgit v1.2.1