Skip to content

Instantly share code, notes, and snippets.

@sriki77
Created December 10, 2011 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sriki77/1454869 to your computer and use it in GitHub Desktop.
Save sriki77/1454869 to your computer and use it in GitHub Desktop.
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