Explain what is List structures in Prolog?



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

Post New Answer

More AI Languages Interview Questions

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)))

1 Answers  


Which checks the evaluated key form against the unevaluated keys using EQL? a) COND b) CASE c) NIL d) SETF

1 Answers  


Which abstractions have a prescribed behavior? a) Auxiliary procedures b) Procedure abstraction c) Primary procedures d) None of the mentioned

1 Answers  


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

1 Answers  


 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

1 Answers  






 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

1 Answers  


Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers

1 Answers  


 What is the output of the following statement? * (first ‘( p h w)) a) P b) H c) W d) phw

1 Answers  


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

1 Answers  


 In “cuts” what is the Parent goal in Prolog?

1 Answers  


 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

1 Answers  


 Why in prolog it is said that Program and Data are the same thing?

1 Answers  


Categories