Re: [eclipse-clp-users] Mario Gianni - Eclipse Global Setting

From: Joachim Schimpf <joachim.schimpf_at_monash.edu>
Date: Thu, 29 Jul 2010 12:25:43 +1000
Mario Gianni wrote:
> hi all
> 
> I'm new for eclipse clp
> 
> I'm try to compile some code for old version of eclipse prolog (I mean
> 5.x), under ubuntu 9.10, into eclipse prolog 6.x
> 
> when I call set_flag(occur_check,on) or set_flag(all_dynamic,on) the
> compiler tell me
> "unimplemented functionality in..."
> 
> in the eclipse environment, can I remove directly these lines of code or
> exist a way to modify the global setting to accomodate these features?

Both features are no longer supported with the new ECLiPSe compiler.
How easy it is to port depends very much on your application.

If you can localise the places where occurs check is needed, you can
replace normal unifications by iso:unify_with_occurs_check(X,Y),
which is defined simply as

unify_with_occurs_check(X, X) :- ayclic_term(X).

So you could also just add calls to acyclic_term/1 after your critical
unifications.


The all_dynamic flag was only ever meant as a kind of debugging feature.
Dynamic predicates should really only be used if absolutely required,
and they should always be explicitly declared using dynamic/1.  Predicates
created with assert/1 will automatically become dynamic.  You could just
remove the all_dynamic setting, see what errors you get, and then
add explicit dynamic/1 declarations or calls in the code.

If your application is some kind of meta-interpreter that uses dynamic
predicates only for storage of the object program clauses (i.e. compiles
them, and then only accesses them with clause/1,2), then I would recommend
that you load the object program with a piece of code like the following,
which simply asserts all clauses from a file:

:- tool(compile_dynamic/1, compile_dynamic_/2).

compile_dynamic_(File, Module) :-
        open(File, read, Stream),
        read(Stream, First),
        (
            fromto(First,Clause,Next,end_of_file),
            param(Stream,Module)
        do
            assertz(Clause)@Module,
            read(Stream, Next)
        ),
        close(Stream).


If all else fails, version 5.10 is still downloadable from
http://eclipseclp.org/Distribution/Old/


-- Joachim
Received on Thu Jul 29 2010 - 03:23:28 CEST

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