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/descendant_2/sl.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'prolog/problems/family_relations/descendant_2') 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 = '''\ -

descendant(?X, ?Y): X je potomec (otrok, vnuk, …) od Y.

+

descendant(?X, ?Y): X je potomec (otrok, vnuk, +pravnukinja, …) od Y.

-?- descendant(patricia, X).
-  X = william ;
-  X = tina ;
-  X = thomas.
-
''' +?- descendant(patricia, Y). + Y = william ; + Y = tina ; + Y = thomas. + +

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

+''' plan = ['''\

Brez rekurzije ne bo šlo... kako lahko problem prevedem na (en korak) manjši problem?

-- cgit v1.2.1