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 given statement? * (setf pressure 3) * (when-plusp pressure (print ‘alarm)); a) Alarm b) Alarm Alarm c) 1 d) Nil
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
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
Which creates reader procedures for getting things out of an instance fields? a) Structure in LISP b) Defstruct c) Class d) Object
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
Explain what is the property list in LISP?
Which class can help to select a method? a) Nonoptional argument b) Class c) Method d) None of the method
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
Which keyword is used to define macro procedures in LISP? a) Defun b) Demacro c) Defmacro d) None of the mentioned
How data types are categorized in LISP?
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
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