Mention what is Cut (!) in Prolog and what is the advantage of ‘Cut’ and ‘Negation’?



Mention what is Cut (!) in Prolog and what is the advantage of ‘Cut’ and ‘Negation..

Answer / chaitanya

Cut function is used in Prolog when you want to restrict Prolog from backtracking into certain choicepoints or subgoals, either because the alternatives would give wrong solutions or for efficiency reasons.
Advantage of using cut in Prolog is
Through cut, we can often improve the efficiency of the program
We can specify exclusive rules using cut

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More AI Languages Interview Questions

 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 are the variables that are bound and that have values assigned to them? a) Data b) Variable c) Parameters d) None of the mentioned

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-personality person-instance-2) a) Female b) Nice c) Person d) Both a & b

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  


 Which process helps to build large and complicated programs in LISP? a) Macros b) Procedure abstraction c) Defun d) None 

1 Answers  






 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

1 Answers  


Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure 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 is the output of the given statement? * (evenp (* 10 8 6 4 2)) a) T b) F c) NIL d) All of the mentioned

1 Answers  


 Which require sophisticated precedence compputation? a) Superclass b) Multiple Superclass c) Subclass d) None of the mentioned

1 Answers  


 Which symbol holds the first element and also an index in LISP? a) Nail b) Tail c) Initial d) All of the mentioned

1 Answers  


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

0 Answers  


Categories