Explain what is prolog programming language? What is it based on?
Prolog is designed for Artificial Intelligence, and it deals with the declarative and logical aspects. Prolog is a logic programming and is based on three attributes- Facts, Rules of Inference and Questions. Facts are the known truths, rules determine how new information can be inferred from these facts, and questions search for answers according to the facts and rules.
Explain what is the difference between bagof/3 and setof/3 predicate in Prolog?
Setof/3 is similar to bagof/3 and the difference between is that bagof/3 leaves all repeated solutions while setof/3 removes them.
Name the sector where prolog programming language is used?
Prolog programming language is used in sectors like
Natural language understanding
Intelligent data base retrieval
Explain with an example what is “Setof” predicate in Prolog?
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] ]
Explain why PROLOG language is stated as a procedural language?
In Prolog, procedures are referred as predicate. It is also known as a procedural language due to the two unusual aspects of prolog like prolog is non deterministic and has assign- once variables.