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

FZN syntax error triggered by opt/where #778

Closed
wldhx opened this issue Jan 7, 2024 · 0 comments
Closed

FZN syntax error triggered by opt/where #778

wldhx opened this issue Jan 7, 2024 · 0 comments
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@wldhx
Copy link

wldhx commented Jan 7, 2024

Hi, here's a repro:

set of int: S = 0..9;

array[S] of var opt S: x_inv;
array[S] of var set of int: x_roff =
    array1d(S,
    [ let { var opt S: s = x_inv[l]; } % trigger (1): opt
      in if occurs(s)
         then {deopt(s)}
         else {}
         endif
    | l in S ]);
array[S] of var set of int: x_occupancy =
    array1d(S,
    [ { r  
      | r in x_roff[l]
        where r <= l } % trigger (2): where
    | l in S ]);

This yields

Error: Unknown character in line no. 78
Error: syntax error, unexpected FZ_ID, expecting FZ_INT_LIT or FZ_INT or '{' in line no. 78
=====ERROR=====

Either removing the where clause or changing the variable to non-opt solves the problem.

The offending FZN line is

var set of -infinity..infinity: X_INTRODUCED_273_ ::var_is_introduced ;

> minizinc --version
MiniZinc to FlatZinc converter, version 2.8.2
Copyright (C) 2014-1980 Monash University, NICTA, Data61
@Dekker1 Dekker1 added the bug label Jan 8, 2024
@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Jan 29, 2024
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