1

In the Eclipse CLP, how many constraints or variables can I define?

I am currently remodeling my scheduling problem - I need to replace a single alldifferent constraint with many atmost constraints. But since I've introduced this change, my ecl script is not working. By "not working" I mean the Eclipse CLP - eclipse.exe or the TkEclipse GUI just shuts down. Without any error message,comment or saying goodbye. Just nothing.

If I try to comment-out some constraints, the script at least gets compiled.

Has someone already bothered with this issue?

Jan Drozen
  • 894
  • 2
  • 12
  • 28
  • Are you trying to compile huge, generated source files? In that case you could blow the system stack, especially on Windows. – jschimpf May 05 '19 at 07:17

1 Answers1

0

There is no specific limit on the number or variables or constraints.

But you were working with large, generated source files where clauses had thousands of subgoals. Because ECLiPSe uses a recursive descent parser, such files can cause an OS stack overflow, in particular on Windows. You could either increase the Windows stack limit, or you could break your generated code into smaller clauses, and call these in conjunction.

Generally, however, generating textual source code isn't such a great idea: it must be created, written, read, parsed, compiled, and is then executed just once. Consider instead generating a pure data file that contains only things like arrays/lists of numbers, but no variables. You can then have a generic ECLiPSe program that reads these data and uses them to create variables and constraints, usually in several loops.

For a very simple example, compare https://eclipseclp.org/examples/transport1.pl.txt (where all the data is explicit in the flat model) with https://eclipseclp.org/examples/transport_arr.pl.txt where the model is generic and all data comes from the data/3 fact at the end (this would correspond to the generated data file).

jschimpf
  • 4,904
  • 11
  • 24