Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Uebung 11, Aufgabe 4
- % Gruppe 13
- % Philipp Martin, 295412
- % Till Sieverts 346122
- % a)
- tier(elefant).
- tier(schwein).
- tier(wolf).
- tier(mensch).
- pflanze(baum).
- pflanze(getreide).
- isst(elefant,baum).
- isst(schwein,X) :- tier(X).
- isst(schwein,X) :- pflanze(X).
- isst(mensch,schwein).
- isst(mensch,getreide).
- isst(wolf,schwein).
- isst(wolf,mensch).
- % b)
- % ?- isst(X,schwein).
- % Ausgabe:
- % X = schwein ;
- % X = mensch ;
- % X = wolf ;
- % false.
- % c)
- fleischfresser(X) :- isst(X,Y),tier(Y).
- % d)
- fressfeinde(X,Y) :- isst(X,Z), isst(Y,Z).
- % e)
- nimmtZuSich(X,Y) :- isst(X,Y).
- nimmtZuSich(X,Y) :- isst(X,Z), nimmtZuSich(Z,Y).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement