即使我将它们放在setof中,也无法忽略元素的顺序
我遵循了这个问题中建议的答案我如何使用PL-UNIT的任何顺序测试非确定性谓词?。
test(hello, [
setup(board_1_setup),
cleanup(clear_board),
Ys = [d-6, e-6, f-6, d-5, f-5, e-4, f-4]
]) :- setof(Y, any_turn_king_move(e-5, Y), Ys).
ERROR: /home/eguneys/chess/pro/_chess.plt:10:
test hello: wrong answer (compared using =)
ERROR: Expected: [d-6,e-6,f-6,d-5,f-5,e-4,f-4]
ERROR: Got: [d-5,d-6,e-4,e-6,f-4,f-5,f-6]
如果我把它们放在测试中。
即使我将它们放在setof
中,为什么仍会检查订单。
I followed the answer suggested in this question How can I test a non-deterministic predicate in any order with PL-Unit? .
test(hello, [
setup(board_1_setup),
cleanup(clear_board),
Ys = [d-6, e-6, f-6, d-5, f-5, e-4, f-4]
]) :- setof(Y, any_turn_king_move(e-5, Y), Ys).
ERROR: /home/eguneys/chess/pro/_chess.plt:10:
test hello: wrong answer (compared using =)
ERROR: Expected: [d-6,e-6,f-6,d-5,f-5,e-4,f-4]
ERROR: Got: [d-5,d-6,e-4,e-6,f-4,f-5,f-6]
If I put them in order the test passes.
Why does this still checks for order, even though I put them in a setof
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在此链接上尝试了一个片段 https://sicstus.sics.sics.se/sicstus/docs/4.2.0/html/sicstus/plunit-a-unit-a-unit-test-box.html 。
它起作用了。
这样:
我不确定这是如何工作的,如果有人可以解释发生了什么,我将接受这一点。
I've tried a snippet on this link https://sicstus.sics.se/sicstus/docs/4.2.0/html/sicstus/PlUnit-A-Unit-Test-Box.html .
And it worked.
Like this:
I am not sure how this works, if someone can explain what's going on I will accept that as an answer.