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 |
Which is the primitive that creates new structure types in LISP? a) Defnum b) Deftype c) Defstruct d) None of the mentioned
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
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
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
Which process helps to build large and complicated programs in LISP? a) Macros b) Procedure abstraction c) Defun d) None
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
Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned
What is the process of arranging procedures into layers? a) Procedure b) Abstraction c) Abstraction layers d) Procedure abstraction
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
Which require sophisticated precedence compputation? a) Superclass b) Multiple Superclass c) Subclass d) None of the mentioned
Which symbol holds the first element and also an index in LISP? a) Nail b) Tail c) Initial d) All of the mentioned
What are the different nlp tasks deep learning can be applied?