Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 swi-prolog。如何从整数列表中删除公共数字?例如,如果列表是 X=[11,12,13,14,15],我需要从中删除 10,那么列表将变为 X=[1,2,3,4,5]。需要帮助。谢谢。
你可以试试
substract(N, L1, L2) :- maplist(sub(N), L1, L2). sub(N, V1, V2) :- V2 is V1 - N.