Skip to content

Instantly share code, notes, and snippets.

@sriki77 sriki77/books.prolog
Created Dec 10, 2011

Embed
What would you like to do?
Prolog Day 1
#!/opt/local/bin/gprolog --consult-file
book('Seven langauges in seven days','Bruce tate').
book('Beyond Java','Bruce tate').
book('Bitter Java','Bruce tate').
book('Spring Developer Note Book','Bruce tate').
book('C programming language','Ritchie','Kernighan').
book('Practice Of Programming','Kernighan','Pike').
book('Unix Programming Environment','Pike','Kernighan').
author(X,Y):- book(Y,X).
author(X,Y):- book(Y,_,X).
author(X,Y):- book(Y,X,_).
author('Bruce tate',W).
author('Pike',W).
#!/opt/local/bin/gprolog --consult-file
musician('Guitar','Brian Adams').
musician('Tabla','Ustad Zakhir Hussain').
musician('Guitar','Leny Kravitz').
musician('Guitar','Bono').
musician('Keyboard','A.R. Rehman').
musician('Guitar',W).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.