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 |
Explain what is recursion in Prolog?
Which is the primitive that creates new structure types in LISP? a) Defnum b) Deftype c) Defstruct d) None of the mentioned
Explain what is LISP? Give an example of some of the popular applications built in LISP?
Mention what are the three functions required by LISP?
Which hides details behind abstraction boundaries? a) Procedures b) Procedure abstraction c) Recursion d) Both a & b
What is the output of the following statement? * (cdr ‘(a b c)) a) a b) B c) (B C) D) None of the mentioned
Explain why matching variable is important in Prolog? What is the method to match variables?
Explain what is the property list in LISP?
What is the output of the given statement? * (defun when-plusp-with-bug (number result); (when (plusp number) result)); * (setf pressure -2) * (when-plusp-with-bug pressure (print ‘alarm)) a) Alarm b) Nil c) Both a & b d) None of the mentioned
What is the output of the following statement? * ( first (rest (first ‘((a b) (c d))))) a) a b) b c) c d) d
Explain what is the importance of the hash table in LISP?
What is the output of the given statement? * (setf day-or-date ‘monday) * (if (symbolp day-or-date) ‘day ‘date) a) Monday b) Day c) Date d) None of the mentioned
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)