1
0
Fork 0
ITI0021-loogiline-programme.../PR02/prax02.pl

42 lines
688 B
Prolog
Executable File

#!/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).