Explain why matching variable is important in Prolog? What is the method to match variables?
Answer / chaitanya
In Prolog, in order to process the elements of a list, we have to match them to variables. The method for doing is
We get the head by matching it to a variable
By calling a predicate with the variable, it processes the head
Until you get an empty list repeat the above steps
Is This Answer Correct ? | 2 Yes | 0 No |
Explain List of artificial intelligence projects?
What is the output of the given statement? * (defclass article() ((title :accessor article-title :initarg :title) (author :accessor article-author :initarg :author))) a) Article b) c) d) None of the mentioned
Which hides details behind abstraction boundaries? a) Procedures b) Procedure abstraction c) Recursion d) Both a & b
Explain what is LISP constants?
Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers
Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned
How many access procedures are avilable in lisp? a) 1 b) 2 c) 3 d) 4
What is partly embedded in the knowledge of your programming for manipulating applications? a) Programming cliches b) Procedures c) Abstraction d) Data
Which is a string of boxes linked by arrow like pointers in LISP? a) Lisp b) List c) Variables d) Pointers
What is the output of the following statement? * (defun both-ends-with-special ()(setf whole-list (cons (first whole-list) (last whole-list)))) * (setf whole-list ‘(monday tuesday wednesday thursday friday)) * (both-ends-with-special) a) Monday b) Friday c) Wednesday d) Both a & b
Explain what is backtracking in Prolog?
What is the output of the following statement? * (setf thing ‘point r 1) * (case thing (circle (*pi r r))(sphere (* 4 pi r r))) a) 1 b) 12.56637 c) NIL d) T