Explain what is the difference between bagof/3 and setof/3 predicate in Prolog?
Answer / chaitanya
Setof/3 is similar to bagof/3 and the difference between is that bagof/3 leaves all repeated solutions while setof/3 removes them.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the output of the following statement? * (setf meals ‘(breakfast lunch tea dinner)) * (cons (first meals) (last meals)) a) Breakfast b) Lunch c) Dinner d) Both a & c
What is the output of the given statement in LISP? * (setf part (make-array ‘(8 8))) a) 8 b) 0 0 0 0 0 0 0 0 c) 0 0 0 0 d) 8 rows of 0
Why in prolog it is said that Program and Data are the same thing?
Which symbol holds the first element and also an index in LISP? a) Nail b) Tail c) Initial d) All of the mentioned
What is meant by collection of methods the same name? a) Lisp class b) Class c) Generic function d) None of the mentioned
Which is used to seperate the abstraction layers? a) Abstraction boundaries b) Data c) Procedure d) All of the mentioned
Mention what is Cut (!) in Prolog and what is the advantage of ‘Cut’ and ‘Negation’?
Demonstrate with an example how you can code in LISP?
Which is used to build the lisp procedures?
What is the output of the given statement? * (defmethod area ((figure rectangle)) (* (rectangle-width figure) (rectangle-height figure))) a) Area b) Rectangle c) Height d) Error
Mention who is referred as a Member in Prolog?
What is the output of the following statement? * (first ‘( p h w)) a) P b) H c) W d) phw
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)