Quantcast
Channel: Samet Kilictas's Blog » Prolog
Browsing latest articles
Browse All 2 View Live

Example Code #3 – Basics in Prolog

1- Parent relation between rex, doggie and goldie dog(rex). dog(X):-parent(X,Y). parent(goldie,rex). parent(jack,rex). Query -> ?dog(goldie) : YES Query -> ?dog(jack) : YES 2- Sister relation...

View Article


Example Code #4 – Intersect and Write in Prolog

1- “!” character stops the query when it is false and “;” runs as “or” so it skips the false part then moves next part smaller(X,Y):- X X>Y,write(Y),write(' is bigger then '),write(X),!; write('They...

View Article

Browsing latest articles
Browse All 2 View Live