Explain with an example what is “Setof” predicate in Prolog?
Answer / chaitanya
In Prolog, “Setof” predicate can be used to find out all the solutions of a predicate. For example, you have this database:
Guru99 (SAP, Testing Tools)
Guru99 (PHP, Perl)
And if you want to find the solutions of Guru99 (X, Y). We can enter
Setof ([ X,Y] , Guru99 (X,Y), Z).
Z = [[ SAP , Testing Tools], [ PHP, Perl] ]
| Is This Answer Correct ? | 0 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
Which process helps to build a large and complicated programs in LISP? a) Abstraction b) Mapping c) Data abstraction d) None of the mentioned
Explain List of programming languages for artificial intelligence?
Explain what is recursion in Prolog?
Which is a procedures supplied by user in terms of primitives? a) Custom b) User-defined c) Definite d) All of the mentioned
What is the output of the given statement in LISP? * (setf abc ‘(a b c) xyz ‘(x y z)) * (setf bc (rest abc)) * bc a) A b) B c) C d) BC
What is the process of creating new data types in lisp? a) List b) Structures c) Procedures d) None of the mentioned
What is the other name of boxes in LISP? a) Cons cells b) Conses c) Both a & b d) None of the mentioned
Which do not evaluate their arguments in LISP? a) List b) Procedure c) Setf d) Macros
Explain what is setq is used for in LISP?
Explain what is Local Variables?
What is the output of the following statement? * (setf p .6) * (cond ((> p .75) ‘very-likely)((> p .5) ‘likely)((> p .25) ‘unlikely)(t ‘very-unlikely)) a) Very-likely b) Likely c) Unlikely d) Very-unlikely
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)