I am new to Prolog.
I need help writing a predicate which finds and deletes the minimum element in a list.
Thank you very much!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let me google it for you.
How could you find a minimum of a list..
Anyway, there is a nice
min_listpredicate.Here is a little example how could you remove some element from a list (notice, that all
2s is gone):If you wanna remove only first occasion of a element, use
select:So your final answer could be something like that:
And