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 general pattern that shows how the various parts of an expression fit together? a) Template b) Pattern c) Match d) Both a & b
How many items are available in mapping primitives are there? a) 3 b) 4 c) 5 d) 6
Explain where you use + operator in Prolog?
Which notation facilitates uniformity in lisp? a) Prefix b) Postfix c) Infix d) None of the mentioned
Explain what is List structures in Prolog?
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 will happen if the value of all the test-forms are nil? a) Nothing b) COND form is nil c) Both a & b d) None of the mentioned
Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned
Explain what is a predicate in LISP?
Explain with an example what is “Setof” predicate in Prolog?
Which do not evaluate their arguments in LISP? a) List b) Procedure c) Setf d) Macros
What is the output of the following statement? * ‘(first (first (rest (rest ((a b) (c d) (e f)))))) a) a b) b c) ab d) (FIRST (FIRST (REST (REST ((A B) (C D) (E F))))))