Explain with an example what is “Setof” predicate in Prolog?

Answer Posted / chaitanya

In Prolog, “Setof” predicate can be used to find out all the solutions of a predicate. For example, you have this database:
Guru99 (SAP, Testing Tools)
Guru99 (PHP, Perl)
And if you want to find the solutions of Guru99 (X, Y). We can enter
Setof ([ X,Y] , Guru99 (X,Y), Z).
Z = [[ SAP , Testing Tools], [ PHP, Perl] ]

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different nlp tasks deep learning can be applied?

532


Explain List of artificial intelligence projects?

913


Explain List of programming languages for artificial intelligence?

967


What is the output of the given statement? * (defclass article() ((title :accessor article-title :initarg :title) (author :accessor article-author :initarg :author))) * (defclass computer-article (article) ()) * (defclass business-article (article) ()) * (defclass political-article (article) ()) * (setf articles (list (make-instance ‘business-article :title “Memory Prices down”))) a) Business article b) Political article c) Business article

859


What does the language of fopl consist of?

539