Explain what is recursion in Prolog?



 Explain what is recursion in Prolog?..

Answer / chaitanya

In any language, a function that can call itself until the goal has been succeed is referred as recursion.  In Prolog, recursion happens when a predicate contains a goal that refers to itself.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AI Languages Interview Questions

 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  


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

1 Answers  


What does the language of fopl consist of?

0 Answers  


 What is the output of the given statement in LISP? * (setf abc ‘(a b c) xyz ‘(x y z)) * (setf bc (rest abc)) * bc a) A b) B c) C d) BC

1 Answers  


Mention why you have to use “is” instead of “=” in Prolog when it comes to applying calculation logic?

1 Answers  






. What is the output of the given statement? * (defstruct employee (length-of-service 0) (payment ‘salary)) * (setf employee-example (make-employee)) * (employee-length-of-service employee-example) a) T b) NIL c) 0 d) Error

1 Answers  


 Mention who is referred as a Member in Prolog?

1 Answers  


How many types of variables are available in lisp? a) 1 b) 2 c) 3 d) 4

1 Answers  


Which is used to build the lisp procedures?

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)) a) Person :sex female :personality nice b) Person :sex c) Sex:Female d) None of the mentioned

1 Answers  


 How the clause is called if it contains a test, as well as zero or more additional forms in LISP? a) Conditional b) Consequents c) Clause d) None of the mentioned

1 Answers  


 What is the output of the following statement? * (setf meals ‘(breakfast lunch tea dinner)) * (first meals) a) Breakfast b) Lunch c) Tea d) Dinner

1 Answers  


Categories