Skip to content

FZN syntax error triggered by opt/where #778

Closed

Description

@wldhx

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

Activity

  1. added a commit that references this issue on Jan 29, 2024
    6f025dd
  2. added
    resolvedIssue is resolved and the feature or fix will be part of next release
    on Jan 29, 2024
  3. added theissue type on Jan 22, 2026
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

    resolvedIssue is resolved and the feature or fix will be part of next release

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions