Mention what is the difference between Prolog and normal programming language?
Answer / chaitanya
Prolog: It is a “declarative programming” language which means that you have to specify the goals, but not the strategy to reach the goal. It figures it out on its own.
Normal Programming language: Languages like C/C++/Java/Python are imperative (IP) languages that does specify instructions of how to reach some goal, but leaving the real goal implicit
Is This Answer Correct ? | 4 Yes | 0 No |
What is the output of the given statement? * (defstruct triangle (base 0) (altitude 0)) * (defun area (figure) (cond ((triangle-p figure) (* 1/2 (triangle-base figure) (triangle-altitude figure))))) * (setf triangle (make-triangle :base 2 :altitude 3)) * (area triangle) a) Triangle b) 7 c) 6 d) 10
Explain why matching variable is important in Prolog? What is the method to match variables?
Mention what are the three functions required by LISP?
Which keyword is used to construct an array in LISP? a) Array b) Make-array c) Bins d) Make
What is the output of the following statement? * (defun book-author (book) (second book)) * (setf book-example-1 ‘((Artificial Intelligence) (Patrick) (Technical AI))) * (book-author book-example-1) a) Artificial Intelligence b) Patrick c) Technical AI d) None of the mentioned
Which is uses their arguments to build intermediate forms and evaluating them to produce a value? a) Backquote b) Macros c) List d) Procedures
Mention how many types of variables available is LISP? Explain what are the variables that are bound, and that have values assigned to them?
Mention why you have to use “is” instead of “=” in Prolog when it comes to applying calculation logic?
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))) * (defun book-author-writer (book author) (cons (list ‘author author) book)) a) Book b) Book-author c) Book-author-writer d) None of the mentioned
Explain List of artificial intelligence projects?
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
Explain what is SWI-Prolog?