mrbela
mrbela

Reputation: 4647

Searching for a special prolog predicate

I need a simple Prolog predicate like:

make_list_elements_unique([1,1,1,2,2,3], X) with X = [1,2,3].

Before starting to write it on my own, I want to search for a built-in predicate. I can't suggest that Prolog hasn't such a predicate.

Do you know it?

Upvotes: 1

Views: 100

Answers (2)

mrbela
mrbela

Reputation: 4647

I've found the built-in predicate list_to_set/2 for that!

Works very fine.

Upvotes: 1

mat
mat

Reputation: 40768

You can use the built-in predicate sort/2 for this.

Upvotes: 2

Related Questions