![](/img/trans.png)
[英]Output the solved time and date in minizinc with assert function
[英]Having trouble using a function of a var set twice in an output statement in minizinc
以下程序運行沒有問題。
array[1..2] of var set of 5..8: ar = [{5, 6}, {6, 7}];
function string: format_set_1( var set of int: s ) = "\(fix(s))\t";
function string: format_set_2( var set of int: s ) = "\(fix(s))\t";
output
[format_set_1(ar[1]) ++ format_set_2(ar[2])];
但是,當我在 output 數組中將format_set_2
替換為format_set_1
(反之亦然)時,我收到以下錯誤消息。
MiniZinc: type error:
function with the same type already defined in C:/Users/rabbott/AppData/Local/Temp/MiniZinc IDE (bundled)-SEkuWd/untitled_model.mzn:4.1
這是怎么回事?
此問題是由 MiniZinc 2.3.2 中的錯誤引起的。 該問題最近在GitHub上提出,並已在MiniZinc 開發分支上得到修復。 MiniZinc 的下一個版本應該會再次按預期工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.