简体   繁体   中英

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?

您可以使用内置谓词sort/2

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

Works very fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM