Skip to content

Error: undefined identifier infinity #457

Closed

Description

@vrzh

I have a large model, but managed to find the following minimal example which shows my issue:

var int: a;
var int: b;
constraint a mod b != 0;
solve satisfy;

I do not want to give bounds to variables a and b because in my full model, I don't know what those bounds should be.

Full error message is:

Error: Unknown character in line no. 6
Error: undefined identifier infinity in line no. 6
Error: syntax error, unexpected FZ_DOTDOT, expecting ')' or ',' in line no. 6
=====ERROR=====

Generated .fzn file contents (using MiniZincIDE-2.5.3-bundle-linux-x86_64):

var int: a:: output_var;
var int: b:: output_var;
var int: X_INTRODUCED_0_ ::var_is_introduced ;
constraint int_ne(b,0);
constraint int_mod(a,b,X_INTRODUCED_0_);
constraint set_in(X_INTRODUCED_0_,-infinity..-1 union {} union 1..infinity);
solve  satisfy;

Activity

  1. a1880 commented on Mar 3, 2021

    @a1880

    Looks like a bug.

    A workaround for modulo/divisibility:

    constraint (b * (a div b)) == a;

    or

    constraint (a - b*(a div b)) == 0;

  2. added a commit that references this issue on Mar 4, 2021
    897875d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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