Explain what is List structures in Prolog?
Answer / chaitanya
A Prolog list is referred as an ordered sequence of elements of arbitrary length. Here the elements are variables, constant, structures, including other lists.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the output of the following statement? * (defun make (title author) (list (list ‘title title) (list ‘author author))) * (setf book (make ‘(Common Lisp) ‘(Guy steele))) a) Common Lisp b) Guy steele c) Make d) ((TITLE (COMMON LISP)) (AUTHOR (GUY STEELE)))
Which checks the evaluated key form against the unevaluated keys using EQL? a) COND b) CASE c) NIL d) SETF
Which abstractions have a prescribed behavior? a) Auxiliary procedures b) Procedure abstraction c) Primary procedures d) None of the mentioned
What is the difference between the appearance of macro and ordinary definition in LISP? a) Argument list b) Reture value c) Just the defining keyword d) None of the mentioned
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
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
Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers
What is the output of the following statement? * (first ‘( p h w)) a) P b) H c) W d) phw
What is the output of the given statement in LISP? * (setf abc ‘(a b c) xyz ‘(x y z)) * abc a) A b) B c) ABC
In “cuts” what is the Parent goal in Prolog?
What is the output of the following statement? * (setf breakfast ‘(eggs bacon toast tea)) * (cond ((> (length breakfast) 10) ‘glutton) ((not (endp breakfast)) ‘normal)(t ‘anorexic)) a) Anorexic b) Breakfast c) Eggs d) Normal
Why in prolog it is said that Program and Data are the same thing?