From 3682b3d9cd0bafa42bbac529233278b7219b4429 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Wed, 19 Sep 2018 12:14:38 +0300 Subject: [PATCH] prax02 --- PR02/prax02.pl | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 PR02/prax02.pl diff --git a/PR02/prax02.pl b/PR02/prax02.pl new file mode 100755 index 0000000..d7039e1 --- /dev/null +++ b/PR02/prax02.pl @@ -0,0 +1,41 @@ +#!/usr/bin/swipl +married(liisa, joosep). +married(anne,vello). +mother(evelin,anne). +mother(mikk, anne). +mother(juku, anne). +mother(anne, liisa). +mother(mart, liisa). +female(anne). +female(evelin). +female(anne). +male(vello). +male(mikk). +male(juku). +male(mart). + +father(Laps, Isa):- + mother(Laps, Ema), + married(Ema, Isa), + male(Isa). + +brother(Laps, Vend):- + mother(Laps, Ema), + mother(Vend, Ema), + Laps \= Vend, + male(Vend). + +sister(Laps, Ode):- + mother(Laps, Ema), + mother(Ode, Ema), + Laps \= Ode, + female(Ode). + +uncle(Laps, Uncle):- + mother(Laps, Ema), + brother(Ema, Uncle). + +uncle(Laps, Uncle):- + father(Laps, Isa), + brother(Isa, Uncle). +