Explain what is backtracking in Prolog?



Explain what is backtracking in Prolog?..

Answer / chaitanya

In Prolog, backtracking is a process adopted by Prolog.  When a sub-goal fails in Prolog, the Prolog system moves its steps backwards to the previous goal and tries to re-satisfy it. Backtracking enables Prolog to find all alternative solutions to a given query.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More AI Languages Interview Questions

 What is the other name of boxes in LISP? a) Cons cells b) Conses c) Both a & b d) None of the mentioned

1 Answers  


What is the process of arranging procedures into layers? a) Procedure b) Abstraction c) Abstraction layers d) Procedure abstraction

1 Answers  


What are the different nlp tasks deep learning can be applied?

0 Answers  


What is the output of the following statement? * (setf whole-list ‘(monday tuesday wednesday thursday friday)) * (defun both-ends ()(setf whole-list (cons (first whole-list) (last whole-list)))) a) Monday b) BOTH-ENDS c) Friday Monday d) Monday Friday

1 Answers  


 What should be used with structure names with a combination? a) Make- b) Make c) Create d) Deploy

1 Answers  






 Explain why PROLOG language is stated as a procedural language?

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)) * (person-p ‘(this is a list — not a person instance)) a) Female b) Nice c) T d) Nil

1 Answers  


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

1 Answers  


 What is the output of the following statement? * ( first (rest (first ‘((a b) (c d))))) a) a b) b c) c d) d

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  


 Which is the primitive that creates new structure types in LISP? a) Defnum b) Deftype c) Defstruct d) None of the mentioned

1 Answers  


 What is the output of the given statement? * (defun when-plusp-with-bug (number result); (when (plusp number) result)); * (setf pressure -2) * (when-plusp-with-bug pressure (print ‘alarm)) a) Alarm b) Nil c) Both a & b d) None of the mentioned

1 Answers  


Categories