Skip to content

Pumpkin crashes when using connected constraint #321

@sappho3

Description

@sappho3

The following minizinc code crashes:

int: n = 4;

array [1..n,1..n] of var bool: node_active = [|
false, true, true, false|
true, false, false, true|
true, true, true, true|
true, false, false, false |];

% check if you can reach every active node from active node
include "connected.mzn";
constraint connected(
  [x + (y-1)*n | x in 1..n-1, y in 1..n] ++ [x + (y-1)*n | x in 1..n, y in 1..n-1],
  [x + (y-1)*n | x in 2..n, y in 1..n] ++ [x + (y-1)*n | x in 1..n, y in 2..n],
  [node_active[x, y] | y in 1..n, x in 1..n],
  % an edge is in the subgraph if from and to are active
  [(node_active[x, y]) /\ (node_active[x + 1, y]) | x in 1..n-1, y in 1..n] 
  ++ [(node_active[x, y]) /\ (node_active[x, y + 1]) | x in 1..n, y in 1..n-1], 
);

solve satisfy;

It gives the following error:

all predicates in the conflict nogood should be assigned to true
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Process finished with non-zero exit code 1.

Bisecting the git history seems to give 37c664c as the culprit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions