Yes, these constraints are called "extensional" (or user-defined constraints). Gecode has quite some support for that: you can specify the relation by a set of tuples (that's implemented as lists of lists in Prolog) or by a regular expression or DFA. Please check "Modeling with Gecode", it elaborates on extensional constraints.
Christian -----Original Message----- From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of Pedro Salgueiro Sent: Tuesday, May 19, 2009 5:40 PM To: us...@gecode.org Subject: [gecode-users] Symbolic Constraints - fd_relation contraint in Gecode? Hi! GNU Prolog has a Symbolic Constraint called fd_relation that constraints a tuple of variables to be equal to one tuple of a list of relations. Here is its description: fd_relation(Relation, Vars) constraints the tuple of variables Vars to be equal to one tuple of the list Relation. A tuple is represented by a list. Using this predicate as follows: fd_relation([[0,0,0],[0,1,0]], [X,Y,Z]). the tuple [X,Y,Z] only could take the values specified in the tuple list [[0,0,0],[0,1,0]]. Here is its documentation: http://www.gprolog.org/manual/html_node/gprolog062.html#toc274 Is there any simple way to do this in Gecode? Maybe a constraint that limits the domain values of a tuple defined by an IntVarArray to any of the elements of an array, where each element of such array is an array composed by Integer values, defining a tuple. Any help will be appreciated :) Thanks Pedro Salgueiro _______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users