summaryrefslogtreecommitdiff
path: root/prolog/problems/family_relations/cousin_2/common.py
blob: 7cd63924450342c25226d077c88273cf1f2b75bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# coding=utf-8

id = 99
group = 'family_relations'
number = 6
visible = True
facts = 'family_relations'

solution = '''\
sister99(X, Y) :-
  parent(P, X),
  parent(P, Y),
  female(X),
  X \== Y.

brother99(X, Y) :-
  parent(P, X),
  parent(P, Y),
  male(X),
  X \== Y.

cousin(X, Y) :-
  parent(PX, X),
  parent(PY, Y),
  ( brother99(PX, PY)
    ;
    sister99(PX, PY) ).
'''