Subscribe Now: standard

Disclaimer

DISCLAIMER

All 'characters' on this blog are fictitious
and bear no resemblance to any 'character'
living or dead.

Search For Your Ubuntu Package.

Facebook Badge

Sunday, October 24, 2010

Logic Programming In Ubuntu


The 'YAP Prolog System' provides a great solution to your prolog programming needs in Ubuntu.Available in the Synaptic , simply search for 'yap and install.
To launch a prolog session , launch the terminal and enter 'yap' at the command line. This would take you right to the prompt where you could ask questions. But where's the database of rules and facts?
There are actually two ways of providing the relevant database to the compiler.In one of the modes , you can create a simple text file consisting of facts and rules and save it in your home directory. To let the compiler compile this file simply type '[file_name]' after the '?' prompt.Then you could ask relevant questions and get results.



I the second mode, you could provide facts and rules at the command line itself. To do this type in '[user]' after the '?'.Here 'user' is not your username. It has to be '[user]' only. Then to ask questions type Ctrl+d.