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 |
Which do not evaluate their arguments in LISP? a) List b) Procedure c) Setf d) Macros
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
Explain what is LISP constants?
Mention what are the two pre-defined packages used in LISP?
Which is present in the writer procedure for arrays in LISP? a) Setf b) Aref c) Fref d) Both a & b
Which process helps to build large and complicated programs in LISP? a) Macros b) Procedure abstraction c) Defun d) None
Which hides details behind abstraction boundaries? a) Procedures b) Procedure abstraction c) Recursion d) Both a & b
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
Which abstractions have a prescribed behavior? a) Auxiliary procedures b) Procedure abstraction c) Primary procedures d) None of the mentioned
Which enables storage in procedurally indexed places in LISP? a) Defstruct b) Object c) Structure d) None of the mentioned
Which primitive removes all but the last element from the list? a) Last b) First c) Remove d) Revoke
In “cuts” what is the Parent goal in Prolog?
AI Algorithms (74)
AI Natural Language Processing (96)
AI Knowledge Representation Reasoning (12)
AI Robotics (183)
AI Computer Vision (13)
AI Neural Networks (66)
AI Fuzzy Logic (31)
AI Games (8)
AI Languages (141)
AI Tools (11)
AI Machine Learning (659)
Data Science (671)
Data Mining (120)
AI Deep Learning (111)
Generative AI (153)
AI Frameworks Libraries (197)
AI Ethics Safety (100)
AI Applications (427)
AI General (197)
AI AllOther (6)