Skip to content

Use of lb() function produces incorrect error message #47

Description

@colbec

Using openSUSE Linux 13.2 and Minizinc 0.9.9/2.0.6, in the (bad) code:

array[int] of set of 1..10: thesets = [{1,2},{3,5},{4,6}];
set of 1..10: sett = {5,6,9};

var 1..10: y;
var set of 1..10: z;
constraint y == min(thesets[3]);
constraint z == lb(thesets[3]);

solve satisfy;

minizinc responds with a message indicating that the lb() builtin is missing.
I think this is incorrect, the lb() function is there, but the code referring to it is bad.
A colleague in Prof. Stuckey's online course points out that if the lb() is used correctly to refer to a non-parameterized set then it works, and I confirm this is correct.
A second colleague points out that there are issues with the ub() function as well.
Please see original comments in thread:
https://class.coursera.org/modelingoptimization-001/forum/thread?thread_id=306

Activity

  1. added a commit that references this issue on Sep 7, 2015
    d9c56c6
  2. guidotack commented on Sep 7, 2015

    @guidotack
    Member

    The lb function should also work for var sets (it will usually return the empty set, which is a correct lower bound). This was a bug, and I've just added a fix. Thanks for the bug report.

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