0
我無法運行此代碼,關於允許maplist/2
運行all_distinct/1
的列表,我有什麼要說的?未充分實例化maplist(all_distinct,列表)
Solution = [A, B, C, D, E, F, G, H, I],
Solution ins 1..9,
maplist(all_distinct, Solution).
我得到ERROR: Arguments are not sufficiently instantiated
。我明白我對數字列表沒有足夠的瞭解,但我不知道我需要告訴它什麼。我想通過9
9個不同的數字1的名單這裏有一個跟蹤,當我嘗試執行:
Call: (7) puzzle(_G548) ? creep
Call: (8) _G548=[_G656, _G659, _G662, _G665, _G668, _G671, _G674, _G677|...] ? creep
Exit: (8) [_G656, _G659, _G662, _G665, _G668, _G671, _G674, _G677|...]=[_G656, _G659, _G662, _G665, _G668, _G671, _G674, _G677|...] ? creep
Call: (8) clpfd: ([_G656, _G659, _G662, _G665, _G668, _G671, _G674|...]ins 1..9) ? creep
Call: (9) error:must_be(list, [_G656, _G659, _G662, _G665, _G668, _G671, _G674|...]) ? creep
Exit: (9) error:must_be(list, [_G656, _G659, _G662, _G665, _G668, _G671, _G674|...]) ? creep
Call: (9) clpfd:'__aux_maplist/2_fd_variable+0'([_G656, _G659, _G662, _G665, _G668, _G671, _G674|...]) ? creep
Call: (10) clpfd:fd_variable(_G656) ? creep
Call: (11) var(_G656) ? creep
Exit: (11) var(_G656) ? creep
Call: (11) true ? creep
Exit: (11) true ? creep
Exit: (10) clpfd:fd_variable(_G656) ? creep
Call: (10) clpfd:'__aux_maplist/2_fd_variable+0'([_G659, _G662, _G665, _G668, _G671, _G674, _G677|...]) ? creep
看起來ins/2
可能無法正常工作,然後還冒充到maplist/2
?我不知道發生了什麼。
事實上,一個'type_error(列表,X)'將有更多的幫助 – false 2015-02-10 14:32:05
@false你或許應該報告爲bug – 2015-02-10 14:36:09
@Boris:2013年8月8日作爲i3a#314提交。但它是一個非常多毛的情況,因爲一個變量通常不會與類型錯誤相關聯。是的,沒有任何實例可以成爲有效的術語,所以類型錯誤似乎很有意義,但它仍然處於邊緣。 – false 2015-02-10 14:54:55