In search annotations, the list of variables can be empty as a result of list comprehension depending on input parameters or in automatically generated models. For example, the following is expected to merely succeed:
$ cat lat.mzn
solve :: int_search([], largest, indomain_random, complete) satisfy;
$ minizinc --solver choco lat.mzn
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at org.chocosolver.parser.flatzinc.ast.searches.IntSearch.valueSelector(IntSearch.java:90)
at org.chocosolver.parser.flatzinc.ast.searches.IntSearch.build(IntSearch.java:41)
at org.chocosolver.parser.flatzinc.ast.FGoal.readSearchAnnotation(FGoal.java:134)
at org.chocosolver.parser.flatzinc.ast.FGoal.define_goal(FGoal.java:85)
at org.chocosolver.parser.flatzinc.Flatzinc4Parser.solve_goal(Flatzinc4Parser.java:1376)
at org.chocosolver.parser.flatzinc.Flatzinc4Parser.flatzinc_model(Flatzinc4Parser.java:244)
at org.chocosolver.parser.flatzinc.Flatzinc.parse(Flatzinc.java:194)
at org.chocosolver.parser.flatzinc.Flatzinc.buildModel(Flatzinc.java:147)
at org.chocosolver.parser.flatzinc.ChocoFZN.main(ChocoFZN.java:27)
In search annotations, the list of variables can be empty as a result of list comprehension depending on input parameters or in automatically generated models. For example, the following is expected to merely succeed: