Explain why matching variable is important in Prolog? What is the method to match variables?



 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

Post New Answer

More AI Languages Interview Questions

Explain List of artificial intelligence projects?

0 Answers  


 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

1 Answers  


 Which hides details behind abstraction boundaries? a) Procedures b) Procedure abstraction c) Recursion d) Both a & b

1 Answers  


Explain what is LISP constants?

1 Answers  


Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers

1 Answers  






Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned

1 Answers  


How many access procedures are avilable in lisp? a) 1 b) 2 c) 3 d) 4

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  


Which is a string of boxes linked by arrow like pointers in LISP? a) Lisp b) List c) Variables d) Pointers

1 Answers  


 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

1 Answers  


Explain what is backtracking in Prolog?

1 Answers  


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

1 Answers  


Categories