[gecode-users] FlatZinc parser

Morten Boysen boysen at itu.dk
Wed Nov 5 22:24:33 CET 2008


Hi

As part of my thesis work, I have to build a configurator on top of 
Gecode (A configurator simply finds the valid domains of all variables 
in a CSP and allows assignment to variables). Since I need to read and 
parse FlatZinc models, I have looked at the FlatZinc interface to Gecode 
  to see if there is any code I can reuse.

I found the FlatZincGecode class, which looks like it suits my needs 
perfectly: I can access the different variable and do valid domain 
computations on them. However, I have run into some problems with the 
source, as I am struggling to find out how the following problems can 
solved. Is there already functionality for it, or do I have to modify 
the source:

1) How do I as simple as possible create a FlatZincGecode instance from 
a FlatZinc file? No propagation should occur or anything. The variables 
should just simply be added to the FlatZincGecode instance along with 
the constraints. This FlatZincGecode instance will then work as the 
initial model.

2) Is there a way to get the original name of a variable in the 
FlatZincGecode instance and vice versa (I took a look at the Registry 
class and it looked like it might have something to do with it, but I am 
not sure).

3) What is the easiest way to read the entire domain of an integer 
variable (not just the currently valid values, but also all the invalid 
ones). This includes cases where the domain is not a range?

4) Is there a way to read only the values of variables that has support, 
and the values that have no support?

Kind regards,
Morten Boysen




More information about the gecode-users mailing list