{"action":"closed","issue":{"url":"https://api.github.com/repos/MiniZinc/libminizinc/issues/106","repository_url":"https://api.github.com/repos/MiniZinc/libminizinc","labels_url":"https://api.github.com/repos/MiniZinc/libminizinc/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/MiniZinc/libminizinc/issues/106/comments","events_url":"https://api.github.com/repos/MiniZinc/libminizinc/issues/106/events","html_url":"https://github.com/MiniZinc/libminizinc/issues/106","id":164638638,"number":106,"title":"\"cannot determine bounds\" when using abs function outside solve statement","user":{"login":"Zero3","id":82504,"avatar_url":"https://avatars.githubusercontent.com/u/82504?v=3","gravatar_id":"","url":"https://api.github.com/users/Zero3","html_url":"https://github.com/Zero3","followers_url":"https://api.github.com/users/Zero3/followers","following_url":"https://api.github.com/users/Zero3/following{/other_user}","gists_url":"https://api.github.com/users/Zero3/gists{/gist_id}","starred_url":"https://api.github.com/users/Zero3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zero3/subscriptions","organizations_url":"https://api.github.com/users/Zero3/orgs","repos_url":"https://api.github.com/users/Zero3/repos","events_url":"https://api.github.com/users/Zero3/events{/privacy}","received_events_url":"https://api.github.com/users/Zero3/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-09T00:12:27Z","updated_at":"2016-11-16T07:32:00Z","closed_at":"2016-11-16T07:32:00Z","body":"I have a model with a set of of float decision variables (`itemValues`) that runs fine with the following solve statement:\n\n```\nsolve minimize sum (i in Items) (abs(itemPrices[i] - itemValues[i]));\n```\n\nHowever, it breaks if I move the sum into its own variable, which should have no effect as far as I am concerned:\n\n```\nvar float: diffs = sum (i in Items) (abs(itemPrices[i] - itemValues[i]));\nsolve minimize diffs;\n```\n\nIf I remove the `abs` function, both work fine. So it appears to be a bug/limitation related to this function.\n\nThe error thrown is:\n\n```\nMiniZinc: evaluation error: \n<.mzn file path>:23:\n  in variable declaration for 'diffs'\n  in call 'sum'\n  in array comprehension expression\n    with i = 1\n  in call 'abs'\nC:\\Program Files (x86)\\MiniZinc IDE (bundled)/share/minizinc/std/builtins.mzn:321:\n  in if-then-else expression\nC:\\Program Files (x86)\\MiniZinc IDE (bundled)/share/minizinc/std/builtins.mzn:322:\n  in let expression\n  in call 'max'\n  in call 'ub'\n  cannot determine bounds\n```\n"}}
{"actor":{"display_login":"guidotack"}}