What is the output of the given statement?
* (defstruct person (sex nil) (personality ‘nice))
* (setf person-instance-1 (make-person))
* (setf person-instance-2 (make-person :sex ‘female))
* (person-personality person-instance-2)
a) Female
b) Nice
c) Person
d) Both a & b
Explain what is the difference between bagof/3 and setof/3 predicate in Prolog?
What is the output of the given statement? * (defstruct person (sex nil) (personality ‘nice)) * (setf person-instance-1 (make-person)) * (setf person-instance-2 (make-person :sex ‘female)) * (person-personality person-instance-2) a) Female b) Nice c) Person d) Both a & b
Which can build new lists by depositing pointers in free boxes? a) Do b) Dobuild c) Cons d) None of the mentioned
What is the output of the following statement? * (setf x ‘outside) * (let ((x ‘inside) (y x)) (list x y)) a) Outside b) Inside c) Inside Outside d) Outside Inside
How many items are available in mapping primitives are there? a) 3 b) 4 c) 5 d) 6
Explain what is recursion in Prolog?
Explain what is LISP? Give an example of some of the popular applications built in LISP?
What is the output of the following statement? * (defun (input-list) (if (endp input-list) nil (cons ( (first input-list)) ( (rest input-list))))) a) Procedure b) Transforming c) Input d) Error
What is the output of the given statement? * (setf pressure 3) * (when-plusp pressure (print ‘alarm)); a) Alarm b) Alarm Alarm c) 1 d) Nil
What is the output of the given statement? * (defstruct circle (radius 0)) * (defun area (figure) (cond ((circle-p figure) (* pi (expt (circle-radius figure) 2))))) * (setf circle (make-circle :radius 11)) * (area circle) a) 44 b) 380 c) 382 d) 380.132
Which exploit the fact that lisp forms are just expressions meant to be evaluated? a) List b) Procedure c) Macro d) None of the mentioned
Which primitive removes all but the last element from the list? a) Last b) First c) Remove d) Revoke