
Hi, I am new to PPL and Prolog. I am trying to use PPL in Prolog programs. Can someone give an example showing how to initialize the library and use the interfaces. Thanks in advance.
Jie

Dear Jie,
We would be happy to help you get started with the PPL, but you do not give us much information.
I assume you have successfully installed the PPL and at least one of the Prolog interfaces. Is this correct? Then, in this case, we need to know which Prolog interfaces you have installed. The way we use the Prolog interface for the PPL partly depends on the Prolog system itself.
There are several examples of Prolog programs that use the PPL included in the `ppl/interfaces/Prolog/tests' directory (clpq.pl, clpq2.pl and pl_check.pl). Any extra code needed for the specific Prolog system to be used are in the appropriate subdirectories. You can see these being run if you do a "make check" for the Prolog System you have installed. I suggest you look at at least one of these examples to see how things work before writing your own interface. Note that the program pl_check.pl executes every one of the Prolog predicates provided by the PPL and, hence, provides examples of their use.
As regards "initializing" the library, normally, in the Prolog code, before using any of the main PPL predicates, you should first call the proposition: ppl_initialize. This, in fact, initializes the PPL system.
Information about the installation and use of the Prolog systems is also in the documentation. Have a look at the section on "System-Dependent Features" for your Prolog system you are using.
If you want more help, let us know which Prolog system you are using and if you can run "make check" successfully on this system.
All the best, Pat
On Tue, 26 Apr 2005, jouyang wrote:
Hi, I am new to PPL and Prolog. I am trying to use PPL in Prolog programs. Can someone give an example showing how to initialize the library and use the interfaces. Thanks in advance.
Jie _______________________________________________ PPL-devel mailing list PPL-devel@cs.unipr.it http://www.cs.unipr.it/mailman/listinfo/ppl-devel

Hi Jouyang.
The quickest way is to have a look at
<your-path-to-ppl-sources>/interfaces/Prolog/tests/pl_check.pl
where you can find many simple Prolog predicates that are meant to test each functionality provided by the PPL. Other interesting files are
<your-path-to-ppl-sources>/interfaces/Prolog/tests/clpq.pl <your-path-to-ppl-sources>/interfaces/Prolog/tests/clpq2.pl
which implement toy meta-interpreters for CLP(Q) on top of the PPL. However, if you are also new to Prolog, then I strongly suggest you start from something simpler, such as the tests I mentioned above.
Cheers, Enea Zaffanella.
jouyang wrote:
Hi, I am new to PPL and Prolog. I am trying to use PPL in Prolog programs. Can someone give an example showing how to initialize the library and use the interfaces. Thanks in advance.
Jie _______________________________________________ PPL-devel mailing list PPL-devel@cs.unipr.it http://www.cs.unipr.it/mailman/listinfo/ppl-devel
participants (3)
-
Enea Zaffanella
-
jouyang
-
P M Hill