Mention why you have to use “is” instead of “=” in Prolog when it comes to applying calculation logic?



Mention why you have to use “is” instead of “=” in Prolog when it comes to a..

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

Post New Answer

More AI Languages Interview Questions

 What is the output of the following statement? * (setf meals ‘(breakfast lunch tea dinner)) * (first meals) a) Breakfast b) Lunch c) Tea d) Dinner

1 Answers  


 How many items are available in mapping primitives are there? a) 3 b) 4 c) 5 d) 6

1 Answers  


 Which can be represented in bytes in LISP? a) Boxes and pointers b) Lists c) Lisp d) None of the mentioned

1 Answers  


 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

1 Answers  


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  






Explain what is a predicate in LISP?

1 Answers  


 Which symbol holds the first element and also an index in LISP? a) Nail b) Tail c) Initial d) All of the mentioned

1 Answers  


. 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

1 Answers  


 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

1 Answers  


Explain what is slot and what are the most commonly used slot options?

1 Answers  


 What is partly embedded in the knowledge of your programming for manipulating applications? a) Programming cliches b) Procedures c) Abstraction d) Data

1 Answers  


 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

1 Answers  


Categories