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 given statement? * (setf pressure 3) * (when-plusp pressure (print ‘alarm)); a) Alarm b) Alarm Alarm c) 1 d) Nil

1 Answers  


 What is a symbol thought of as a name for a place to store value? a) Data b) Variable c) Parameters d) None of the mentioned

1 Answers  


 What is the output of the given statement  in LISP? * (setf part (make-array ‘(8 8))) a) 8 b) 0 0 0 0 0 0 0 0 c) 0 0 0 0 d) 8 rows of 0

1 Answers  


Which creates reader procedures for getting things out of an instance fields? a) Structure in LISP b) Defstruct c) Class d) Object

1 Answers  


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-p ‘(this is a list — not a person instance)) a) Female b) Nice c) T d) Nil

1 Answers  






 Explain what is the property list in LISP?

1 Answers  


 Which class can help to select a method? a) Nonoptional argument b) Class c) Method d) None of the method

1 Answers  


What will happen if the value of all the test-forms are nil? a) Nothing b) COND form is nil c) Both a & b d) None of the mentioned

1 Answers  


Which keyword is used to define macro procedures in LISP? a) Defun b) Demacro c) Defmacro d) None of the mentioned

1 Answers  


 How data types are categorized in LISP?

1 Answers  


Pick out the correct statement about macro. a) Macro is dependant. b) Macro is interoperable c) Macro is complex d) Macro deserve their own file

1 Answers  


 What is the output of the given statement in LISP? * (setf bins (make-array 4 :initial-element ‘e)) * (aref bins 0) a) E b) 0 c) 4 d) None of the mentioned

1 Answers  


Categories