Mention why you have to use “is” instead of “=” in Prolog when it comes to applying calculation logic?
Answer / chaitanya
“=” triggers unification in Prolog
“is” triggers arithmetic evaluation in Prolog
So, in Prolog you cannot use “=” when you want to calculate something like 2+4=6, but instead you have to use 2+4 is 6.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the output of the following statement? * (setf meals ‘(breakfast lunch tea dinner)) * (first meals) a) Breakfast b) Lunch c) Tea d) Dinner
How many items are available in mapping primitives are there? a) 3 b) 4 c) 5 d) 6
Which can be represented in bytes in LISP? a) Boxes and pointers b) Lists c) Lisp d) None of the mentioned
What is the output of the given statement in LISP? * (setf bins (make-array 2 :initial-element ‘e)) a) E b) E E c) E E E d) E E E E
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)))
Explain what is a predicate in LISP?
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 the output of the given statement? * (setf high 98 temperature 102) * (when (> temperature high) (setf high temperature) ‘new-record) * high a) 98 b) 102 c) new d) Error
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
Explain what is slot and what are the most commonly used slot options?
What is partly embedded in the knowledge of your programming for manipulating applications? a) Programming cliches b) Procedures c) Abstraction d) Data
What is the value of last consequent form in the triggered clause? a) Value of the entire COND b) Trigger c) Consequent d) All of the mentioned