How to write predicate convert/2 in prolog?

后端 未结 2 907
离开以前
离开以前 2021-01-22 19:11

I want to write a predicate convert/2. It should work like this

? - convert([a,[a,a],[a,b],[b,a],[[a,b]],[d],c],X).
X = [a,c,[a],[d],[a,b],[[a,b]]]
yes

? - conv         


        
2条回答
  •  面向向阳花
    2021-01-22 19:45

    Ok, but can you replace built-in function 'sort' by some other? this is most important here

提交回复
热议问题