Learned how to make stuff happen in Prolog:

First program is pictured above

Second one:

sibling(X,Y) :- parent(Z,X), parent(Z,Y).
mother(X,Y) :- parent(X,Y), female(X).
uncle(X,Y) :- parent(Z, Y), sibling(Z,X), male(X).
female(lady). female(dne). male(jack).
parent(lady, jack). parent(lady,dne ).

Output:

prologggg

It’s pretty weird having everything happen at the same time in logic programming, but that’s what makes it unique.

Advertisements