Given:
fruitid('Apple', 'Granny Smith', 1).
fruitid('Apple', 'Cox', 2).
fruitid('Pear', 'Bartlett', 3).
How would I go about finding only unique items for instance:
is_unique(FruitName):-
In the example clauses the answer would be Pear.
I'm also trying to add error handling to my code, so in this instance if an input is:
is_unique(pineapple)
How could I catch this and output an error message?
Thanks,
AS