summaryrefslogtreecommitdiff
path: root/lang/prolog/1.8.7/src/family
diff options
context:
space:
mode:
Diffstat (limited to 'lang/prolog/1.8.7/src/family')
-rw-r--r--lang/prolog/1.8.7/src/family29
1 files changed, 29 insertions, 0 deletions
diff --git a/lang/prolog/1.8.7/src/family b/lang/prolog/1.8.7/src/family
new file mode 100644
index 0000000..8419cc6
--- /dev/null
+++ b/lang/prolog/1.8.7/src/family
@@ -0,0 +1,29 @@
+
+mann(jürgen). mann(detlef). mann (frank). mann (peter). mann(jochen).
+frau(gaby). frau(yvonne). frau(sinha). frau(rita). frau(viktoria).
+frau(adelheid).
+vater(gaby, peter). vater(yvonne, peter). vater(frank, peter).
+mutter(gaby, rita). mutter(yvonne, rita). mutter(frank, rita).
+mutter(rita,viktoria).
+vater(jürgen, heinz). mutter(jürgen, natalie).
+vater(kalle, heinz). mutter(kalle, natalie).
+mann(gaby, jürgen). mann(yvonne, detlef). mann(sinha,frank).
+mann(rita, peter). mann(adelheid, jochen).
+frau(X,Y) :- mann (Y,X).
+großmutter(X,Y):- mutter(X,H), mutter(H,Y); vater(X,H), mutter(H,Y).
+sohn(X,Y):- vater(Y,X), mann(Y); mutter(Y,X), mann(Y) .
+tochter(X,Y):- vater(Y,X), frau(Y); mutter(Y,X), frau(Y).
+geschwister(X,Y):-vater(X,A),vater(Y,A),mutter(X,B),mutter(Y,B),<>(X,Y).
+bruder(X,Y):- geschwister(X,Y), mann(Y).
+schwester(X,Y):- geschwister(X,Y), frau(Y).
+schwager(X,Y):- mann(X,Z), bruder(Z,Y); frau(X,Z), bruder(Z,Y).
+schwägerin(X,Y):-mann(X,Z),schwester(Z,Y);frau(X,Y),schwester(Z,Y).
+freund (X,Y):- mann(Y), mann(X), <>(X,Y);
+ mann(Y), frau(X), mann(Z,Y), <>(X,Z);
+ mann(Y), frau(X), !, mann(Z,Y), [];
+ mann(Y), frau(X).
+freundin (X,Y):- frau(Y), frau(X), <>(X,Y);
+ frau(Y), mann(X), mann(Y,Z), <>(X,Z);
+ frau(Y), mann(X), !, mann(Y,Z), [];
+ frau(Y), mann(X).
+