Re: [eclipse-clp-users] Program Does not Load

From: Joachim Schimpf <joachim.schimpf_at_...44...>
Date: Wed, 03 Feb 2010 15:03:43 +1100
Amine Marref wrote:
> Dear Marco,
> Thanks for your prompt answer. I noticed some issues using "Version 6.0
> #115 (i386_linux)" of Eclipse on my Ubuntu.
> 1) I tried to reproduce the error. a) I used the GUI-mode to load my
> program (without your option) and it failed to load *silently*. b) I
> used the command-prompt mode and run "eclipse file.ecl "goal"" and it
> failed to load silently. c) I used the top-level-loop mode and I got a
> similar error [1] to yours. I wonder why it is explicit about the
> failure of loading in the loop mode and not as explicit in other modes?

The code invoking the compiler from the tkeclipse menu and from the -b option
incorrectly assumes that error messages have already been printed.
I have registered this as a bug.

> 2) I used the command-prompt mode i.e. "eclipse -g 1000000 file.ecl
> "goal"" and it failed to load silently again.

The correct syntax is eclipse -g 1000000 -b file.ecl

> Finally, how do you use the option -g in loop/GUI mode?

You give a -g option when starting eclipse or tkeclipse from a commmand line.
Or, in tkeclipse, open the Preference Editor, set Global/trail stack size,
save Preferences, and restart.

> I noticed that I cannot grow the stack to 3Meg,

You mean 3GiB.  The limit depends on the operating system, see

> do you know why my
> program is not loading? Is it the number of variables which is big? or
> constraints? or both?

The compiler isn't ideally suited for large generated source code.
But you should not generate source code anyway, see recommendations in

If you currently generate the source code using an ECLiPSe program, consider
modifying it and calling the constraints directly (instead of writing them to
a file, reading them back, compiling them and then executing).

If you generate the source code from a non-ECLiPSe program, consider writing
a data file (only numbers) and having a fixed ECLiPSe program to read that
data and set up the constraints dynamically, as in

Or: write a single setup clause (in your case, solve/2) to a file "model",
then interpret this clause as follows:

    execute_clause_from_file(File, Head) :-
        open(File, read, S),
        read(S, (Head :- Goals)),
        execute(1, Goals).

    execute(I, Goals) :-
        ( Goals = (G,Gs) ->
            I1 is I+1,
            execute(I1, Gs)

When called with execute_clause_from_file("model", solve(X,Y)), it
will read the model, execute the constraints one-by-one (printing
goal number and constraint first, so you can pinpoint failures more
easily), and deliver a result or fail.

-- Joachim
Received on Wed Feb 03 2010 - 04:02:50 CET

This archive was generated by hypermail 2.3.0 : Sat Aug 24 2019 - 21:14:55 CEST