Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal error: missing builtin 'exists' #792

Closed
jarble opened this issue Feb 20, 2024 · 5 comments
Closed

internal error: missing builtin 'exists' #792

jarble opened this issue Feb 20, 2024 · 5 comments
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@jarble
Copy link

jarble commented Feb 20, 2024

I tried to run this model in the MiniZinc playground using the Chuffed solver:

enum functions = {animal,dog};
type func = record(functions:funcs,int: input);
array[1..10] of var func:funcs;

function var bool:dog(int:t) =
(funcs:dog,input:t) in funcs;

var int:d1 = dog(1);

solve satisfy;

output [show(d1)];

But the solver shows this error message:

=====UNKNOWN=====
/usr/share/minizinc/std/stdlib/stdlib_array.mzn:266.3-32:
MiniZinc: evaluation error: internal error: missing builtin 'exists'
Process finished with non-zero exit code 1.
@cyderize cyderize added the bug label Feb 20, 2024
@cyderize
Copy link
Member

As a workaround until this is fixed, you can pass the funcs array as an argument to your dog function:

function var bool:dog(array[int] of var func: fns, int:t) =
(funcs:dog,input:t) in fns;

var int:d1 = dog(funcs, 1);

@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Feb 23, 2024
@jarble
Copy link
Author

jarble commented Mar 11, 2024

@cyderize and @guidotack This error still appears in the MiniZinc playground. Has it not been updated to the latest version?

@Dekker1
Copy link
Member

Dekker1 commented Mar 11, 2024

The problem is resolved when you select the “edge” version of MiniZinc in the playground. The fix has not been included in any release yet, so the “latest” version does not yet include the fix.

@jarble
Copy link
Author

jarble commented Mar 13, 2024

@Dekker1 Now a different error appears when running this model using the COIN-BC solver:

MiniZinc: flattening error: variable X_INTRODUCED_19_ needs finite bounds for linearisation. Or, use indicator constraints. Current domain is [[ [ -inf, 0 ] [ 1, 1 ] [ 2, inf ] ]]

Is this another compiler bug?

@cyderize
Copy link
Member

I think this is just a limitation of how linearisation works for MIP solvers like CBC.

Without any bounds for the input field of the record, it's not possible to turn (funcs:dog,input:t) in funcs into an integer variable which the solver can handle.

You can add bounds with

type func = record(functions:funcs,-10..10: input);

which will fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

3 participants