Re: [eclipse-users] Library Induction

From: Kish Shen <kish.shen_at_crosscoreop.com>
Date: Thu, 26 Apr 2007 00:35:22 +0100
On Wednesday 25 April 2007 21:34, Siddharth Angrish wrote:
> Hi
>       I have ECLiPSe 5.10 installed on a linux machine. I want to
> "include" some library
> made available by a thirdparty (FSA6 utilities toolbox) so that I can
> use it in my eclipse
> programs.
>  All the thirdparty libraries are with me. The libraries are in SWI Prolog.
> They are successfully included in SWI prolog installed on my machine.
> 
> I modified the library_path of my eclipse to point to the directory
> containing the libraries. But
> still I am getting the error:
>         library not found in use_module(library(fsa_library))
> 
> upon execution of the command : lib(fsa_library)
> 

When you  use lib(name) to load a module, there must be a corresponding name.pl file in
<library_path>.

I have just downloaded the tarball for FSA6 (6-275), and there is a fsa_library.pl in 
fsa6/src. I don't know if this gets copied somewhere when you build the system, but
your library path should include fsa6/src (or where fsa_library.pl is copied to) in its
path. If you think you have included this path, could you please show the full path
for the fsa_library.pl file, and what you library_path is (you can get this with 
get_flag(library_path, X).


> NOTE: this fsa_libary (and all of its supporting ones) are written in
> SWI Prolog. SWI Prolog is
> installed on my machine and I execute lib(swi) before executing lib(fsa_library)
> 
> Thanks
> Siddharth
> 
From looking at their website, my guess is that FSA is designed mainly for SICStus Prolog,
and then ported to SWI and Yap, so it may be easier to try to port it via lib(sicstus) than
lib(swi).

>Whats the realtion between ECLiPSe and SWi Prolog. I guess both are different
>kinds of prologs.
>Can we use ECLiPse as a SWI Prolog by setting some flag?

SWI Prolog and ECLiPSe are, as you say, different variants of Prolog. The main difference 
are some of the builtins and libraries provided, and also (probably) the module system.
In practice, this probably mean that for small programs (the ones you generally write when
learning Prolog), there should be little or no differences between ECLiPSe and SWI Prolog
(or any of the other Prologs that more or less adhere to the Edinburgh and/or ISO Prolog
standard). But for big applications such as FSA, there will probably be differences.

What lib(swi) does is essentially `setting some flag' (and providing some builtins) in ECLiPSe 
to make ECLiPSe more like SWI Prolog so that it is easier for you to run SWI Prolog code on 
ECLiPSe. It is not complete, and you may still need to modify your code to get it running on 
ECLiPSe. However, if you really want to use a package (such as FSA) in ECLiPSe, you should 
aim to port it to native ECLiPSe, perhaps first by getting it working with lib(sicstus) or 
lib(swi), and then gradually replacing the incompatible parts with native ECLiPSe code.

Cheers,

Kish
Received on Thu Apr 26 2007 - 00:36:52 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET