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

From: Amine Marref <cyborgamine_at_...32...>
Date: Wed, 3 Feb 2010 10:03:58 +0000
Thanks everyone,

I can now compile the program and run it.

This program is just about a tenth of the size of my target problems in future. It seems that I will sooner or later not be able to compile programs like this.

The size of the current program can be reduced by using loops to specify domains and constraints on sublists of variables. This however, only applies to this case. Eventually, each single variable will have a domain and a set of constraints which are potentially different from all other variables, so I guess this flat modeling is necessary.

I did not quite get the idea about the data file which should contain only "numbers". How can I get around the problem of needing to declare variables individually (and their distinctive set of constraints) by using a data file?



P.S. How do I reply to this topic without generating new threads in the user-list archive? 

> Date: Wed, 3 Feb 2010 15:03:43 +1100
> From: joachim.schimpf_at_...44...
> To:
> Subject: Re: [eclipse-clp-users] Program Does not Load
> 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)),
>         close(S),
>         execute(1, Goals).
>     execute(I, Goals) :-
>         ( Goals = (G,Gs) ->
>             writeln(I:G),
>             call(G),
>             I1 is I+1,
>             execute(I1, Gs)
>         ;
>             writeln(I:Goals),
>             call(Goals)
>         ).
> 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
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
Received on Wed Feb 03 2010 - 10:04:04 CET

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