Explain with an example what is “Setof” predicate in Prolog?
Answer / 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 |
What is the output of the given statement? * (setf pressure -3) * (when-plusp pressure (print ‘alarm)); a) T b) Nil c) Alarm d) None of the mentioned
Why in prolog it is said that Program and Data are the same thing?
Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers
Which class can help to select a method? a) Nonoptional argument b) Class c) Method d) None of the method
How many types of variables are available in lisp? a) 1 b) 2 c) 3 d) 4
What is the output of the given statement in LISP? * (Setf part-bins (make-array ‘(4))) a) #Done b) #4 c) #(0 0 0 0) d) None of the mentioned
Which process helps to build large and complicated programs in LISP? a) Macros b) Procedure abstraction c) Defun d) None
What is the output of the given statement in LISP? * (setf bins (make-array 2 :initial-element ‘e)) a) E b) E E c) E E E d) E E E E
Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned
Explain what is the importance of the hash table in LISP?
What is the output of the following statement in LISP? * (setf thing ‘point r 1) * (case thing (circle (*pi r r))(sphere (* 4 pi r r)) (otherwise 0)) a) 1 b) 0 c) 12.566 d) None of the mentioned
Which do not evaluate their arguments in LISP? a) List b) Procedure c) Setf d) Macros
AI Algorithms (74)
AI Natural Language Processing (96)
AI Knowledge Representation Reasoning (12)
AI Robotics (183)
AI Computer Vision (13)
AI Neural Networks (66)
AI Fuzzy Logic (31)
AI Games (8)
AI Languages (141)
AI Tools (11)
AI Machine Learning (659)
Data Science (671)
Data Mining (120)
AI Deep Learning (111)
Generative AI (153)
AI Frameworks Libraries (197)
AI Ethics Safety (100)
AI Applications (427)
AI General (197)
AI AllOther (6)