You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, function return value signature isn't checked and serves as semantic annotation for reader, function with declared value of 1 or 2 might return 4. Also there is a less important issue with function dispatch. In example below, f1 for var ints doesn't get called with var x as argument.
var int: x;
set of int: DAY = 1..7;
constraint x in {5, 6};
function array[1..2] of 1..2: f1(int: n) = [i | i in 1..n];
function array[1..2] of var 1..2: f1(var int: n) = [1, 2, 3, 4];
function set of DAY: f2() = {10};
function set of 1..2: f3() = {10};
output[show(f1(3)) ++ "\n" ++ show(f1(x)) ++ "\n" ++ show(f2()) ++ "\n" ++ show(f3())];
solve satisfy;
Code runs, returning
[1, 2, 3]
[1, 2, 3, 4, 5, 6]
10..10
10..10
I think the code should rather fail and in case of
function array[int] of int: f1(int: n) = [i | i in 1..n];
function array[int] of var int: f1(var int: n) = [1, 2, 3, 4];
first two lines of output should be
[1, 2, 3]
[1, 2, 3, 4]
The text was updated successfully, but these errors were encountered:
At the moment, function return value signature isn't checked and serves as semantic annotation for reader, function with declared value of 1 or 2 might return 4. Also there is a less important issue with function dispatch. In example below, f1 for var ints doesn't get called with var x as argument.
Code runs, returning
I think the code should rather fail and in case of
first two lines of output should be
The text was updated successfully, but these errors were encountered: