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 |
What is the output of the following statement? * ( first (rest (first ‘((a b) (c d))))) a) a b) b c) c d) d
How many items are available in mapping primitives are there? a) 3 b) 4 c) 5 d) 6
What is the process of creating new data types in lisp? a) List b) Structures c) Procedures d) None of the mentioned
What is a symbol thought of as a name for a place to store value? a) Data b) Variable c) Parameters d) None of the mentioned
Which is used to seperate the abstraction layers? a) Abstraction boundaries b) Data c) Procedure d) All of the mentioned
What is the output of the given statement? * (setf pressure 3) * (when-plusp pressure (print ‘alarm)); a) Alarm b) Alarm Alarm c) 1 d) Nil
Explain what is the difference between bagof/3 and setof/3 predicate in Prolog?
What is the programming structure for LISP?
Which is a procedures supplied by user in terms of primitives? a) Custom b) User-defined c) Definite d) All of the mentioned
Which is used to represent the prompt in lisp? a) # b) $ c) & d) *
. What is the output of the given statement? * (setf high 98 temperature 102) * (when (> temperature high) (setf high temperature) ‘new-record) * high a) 98 b) 102 c) new d) Error
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
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)