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