InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Will Prolog Withstand In Competition With Modern Lp Languages Such As Goedel ? |
|
Answer» The languages like GOEDEL, ALF, LIFE etc. are currently more oriented to theory than to real-world applications. In real-life usage, we can give more chances to CLP which is sometimes ASSUMED as a PROLOG lifesaver for practical applications. The languages like Goedel, ALF, LIFE etc. are currently more oriented to theory than to real-world applications. In real-life usage, we can give more chances to CLP which is sometimes assumed as a PROLOG lifesaver for practical applications. |
|
| 2. |
What Are The Advantages Of Clp On Prolog In Practical Applications? |
|
Answer» CLP(X) uses "INTERPRETABLE" domain X, e.g., reals, integers, STRINGS, while pure Prolog is limited to "uninterpretable" Herbrand Universe. Also, Prolog uses UNIFICATION as a main data OPERATION while CLP allows declarative constraints which are more general than unification. CLP(X) uses "interpretable" domain X, e.g., reals, integers, strings, while pure Prolog is limited to "uninterpretable" Herbrand Universe. Also, Prolog uses unification as a main data operation while CLP allows declarative constraints which are more general than unification. |
|
| 3. |
Can Clp (constraint Logic Programming) Be Implemented Just In Prolog ? |
|
Answer» Using the TECHNIQUE known as meta-programming, it is POSSIBLE to IMPLEMENT CLP completely in PROLOG. The disadvantage of this approach is DEGRADATION of PERFORMANCE that is typical for meta-programming. Using the technique known as meta-programming, it is possible to implement CLP completely in PROLOG. The disadvantage of this approach is degradation of performance that is typical for meta-programming. |
|
| 4. |
What Is It Clp (constraint Logic Programming)? |
|
Answer» CLP is an extension of PROLOG (logic PROGRAMMING) where the UNIFICATION is substituted by solving equalities and other types of constraints over particular domain like reals, INTEGERS, strings ETC. CLP is an extension of PROLOG (logic programming) where the unification is substituted by solving equalities and other types of constraints over particular domain like reals, integers, strings etc. |
|
| 5. |
What Is It A Meta-program? |
|
Answer» Meta-PROGRAM is a program that USES other program as its data. For EXAMPLE, meta-INTERPRETER of a given PROGRAMMING language is an interpreter of that language written in the same language. Meta-program is a program that uses other program as its data. For example, meta-interpreter of a given programming language is an interpreter of that language written in the same language. |
|
| 6. |
Is It Possible To Change Standard Behaviour Of Prolog Interpreter (first Rule, The Most Left Subgoal)? |
|
Answer» It is EASY to WRITE a COMPLETE PROLOG interpreter in PROLOG with DIFFERENT behaviour via meta-programming technique. It is easy to write a complete PROLOG interpreter in PROLOG with different behaviour via meta-programming technique. |
|
| 7. |
What Are The Major Examples Of Use Of Prolog In 'real Life' Applications ? |
|
Answer» You can find PROLOG in AREAS like EXPERT systems or theorem provers construction. The VARIANT of PROLOG CALLED DATALOG is used in database management. You can find PROLOG in areas like expert systems or theorem provers construction. The variant of PROLOG called DATALOG is used in database management. |
|
| 8. |
What Kind Of Sw Is Prolog Especially Useful For Writing ? |
|
Answer» Prolog SEEMS to be good for problems in which logic is intimately involved, or whose SOLUTIONS have a logical characterization. Like other INTERACTIVE, symbolic languages, Prolog is also good for rapid prototyping. Prolog seems to be good for problems in which logic is intimately involved, or whose solutions have a logical characterization. Like other interactive, symbolic languages, Prolog is also good for rapid prototyping. |
|
| 9. |
How Variables Are Used In Prolog? |
|
Answer» Here is an Example: SUPPOSE we WANT to ask, “What course does ROBIN teach”?,then we can write it in prolog as ” Is there a course,X,that ROBIN teaches? “ Here, here x stands for an object that the questioner does not know about yet,so to answer the prolog has to find the value of x.If we know the value of variable then it is KNOWN as BOUND, if we don’t know then known as UNBOUND. Here is an Example: Suppose we want to ask, “What course does ROBIN teach”?,then we can write it in prolog as ” Is there a course,x,that ROBIN teaches? “ Here, here x stands for an object that the questioner does not know about yet,so to answer the prolog has to find the value of x.If we know the value of variable then it is known as BOUND, if we don’t know then known as UNBOUND. |
|
| 10. |
How Prolog Language Can Be Stated As Procedural Language? |
|
Answer» In Prolog, procedures are called predicate. FOLLOWING are the TWO reasons because of which it is also KNOWN as procedural language. The two UNUSUAL ASPECTS of Prolog are:
In Prolog, procedures are called predicate. Following are the two reasons because of which it is also known as procedural language. The two unusual aspects of Prolog are: |
|
| 11. |
Name Some Data Types In Prolog Programming Language? |
|
Answer» Following are the data types supported by prolog :Prolog’s single data type is the TERM. Terms are either atoms, numbers, variables or compound terms.
Following are the data types supported by prolog :Prolog’s single data type is the term. Terms are either atoms, numbers, variables or compound terms. |
|
| 12. |
Write An Sample Program In Prolog Language? |
|
Answer» Here is an example. of SAMPLE programming LANGUAGE by displaying the message “Hello”: SOURCE CODE : Here is an example. of Sample programming language by displaying the message “Hello”: SOURCE CODE : |
|
| 13. |
Why We Use Prolog Programming Language? |
|
Answer» Following are some POINTS for using prolog more:
Following are some points for using prolog more: |
|
| 14. |
Name The Areas In Which Prolog Programming Language Is Used? |
|
Answer» Following are some areas in which prolog is used:
Following are some areas in which prolog is used: |
|
| 15. |
What Are The Features Of Prolog Language? |
|
Answer» Following are the features of PROLOG language:
Following are the features of prolog language: |
|
| 16. |
Explain What Is Swi-prolog? |
|
Answer» SWI-PROLOG is a free prolog COMPILER licensed under GPL, targeting primarily the RESEARCH and education. SWI-Prolog is a free prolog compiler licensed under GPL, targeting primarily the research and education. |
|
| 17. |
Explain What Is Recursion In Prolog? |
|
Answer» In any LANGUAGE, a FUNCTION that can CALL itself until the goal has been succeed is REFERRED as recursion. In Prolog, recursion happens when a predicate contains a goal that refers to itself. In any language, a function that can call itself until the goal has been succeed is referred as recursion. In Prolog, recursion happens when a predicate contains a goal that refers to itself. |
|
| 18. |
Explain What Is Backtracking In Prolog? |
|
Answer» In Prolog, backtracking is a process ADOPTED by Prolog. When a sub-goal fails in Prolog, the Prolog SYSTEM moves its steps backwards to the previous goal and tries to re-satisfy it. Backtracking ENABLES Prolog to find all alternative solutions to a GIVEN QUERY. In Prolog, backtracking is a process adopted by Prolog. When a sub-goal fails in Prolog, the Prolog system moves its steps backwards to the previous goal and tries to re-satisfy it. Backtracking enables Prolog to find all alternative solutions to a given query. |
|
| 19. |
Explain Why Matching Variable Is Important In Prolog? What Is The Method To Match Variables? |
|
Answer» In Prolog, in order to PROCESS the elements of a LIST, we have to match them to variables. The method for doing is
In Prolog, in order to process the elements of a list, we have to match them to variables. The method for doing is |
|
| 20. |
Mention What Is The Difference Between Prolog And Normal Programming Language? |
|
Answer» Prolog: It is a “declarative PROGRAMMING” language which means that you have to SPECIFY the goals, but not the strategy to REACH the goal. It figures it out on its own.
Prolog: It is a “declarative programming” language which means that you have to specify the goals, but not the strategy to reach the goal. It figures it out on its own.
|
|
| 21. |
Mention What Is The Difference Between = And = = In Prolog? |
|
Answer» The “=” OPERATOR in Prolog is actually a predicate that stands for UNIFICATION. This operator “= =” means the two terms are not IDENTICAL. Unification does not take PLACE even if this SUCCEEDS. The “=” operator in Prolog is actually a predicate that stands for unification. This operator “= =” means the two terms are not identical. Unification does not take place even if this succeeds. |
|
| 22. |
Mention What Is Cut (!) In Prolog And What Is The Advantage Of ‘cut’ And ‘negation’? |
|
Answer» 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 :
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 : |
|
| 23. |
Mention Who Is Referred As A Member In Prolog? |
|
Answer» Member is a PROLOG tool that is USED for CONFIGURING lists and to INTRODUCE the IDEA of recursing down lists. Member is a Prolog tool that is used for configuring lists and to introduce the idea of recursing down lists. |
|
| 24. |
Mention Why You Have To Use “is” Instead Of “=” In Prolog When It Comes To Applying Calculation Logic? |
Answer»
|
|
| 25. |
Why In Prolog It Is Said That Program And Data Are The Same Thing? |
|
Answer» In Prolog, DATA and program both are implemented as the bunch of trees. There is no difference between a rule that CAUSES OPERATIONS to happen and a rule that just gives BACK a data value. In Prolog, data and program both are implemented as the bunch of trees. There is no difference between a rule that causes operations to happen and a rule that just gives back a data value. |
|
| 26. |
Explain Where You Use + Operator In Prolog? |
|
Answer» Operator + can be used to negate goals; these are EITHER sub-goals in the body of a rule or sub-goals of a QUERY. We cannot negate facts or the HEADS of rules. Operator + can be used to negate goals; these are either sub-goals in the body of a rule or sub-goals of a query. We cannot negate facts or the heads of rules. |
|
| 27. |
Explain What Is List Structures In Prolog? |
|
Answer» A PROLOG list is referred as an ORDERED sequence of elements of arbitrary LENGTH. Here the elements are variables, CONSTANT, structures, INCLUDING other lists. A Prolog list is referred as an ordered sequence of elements of arbitrary length. Here the elements are variables, constant, structures, including other lists. |
|
| 28. |
In “cuts” What Is The Parent Goal In Prolog? |
|
Answer» When running the subgoals in a RULE’s body, the PARENT goal is referred to the goal that CAUSED the matching of the HEAD of the CURRENT rule. When running the subgoals in a rule’s body, the parent goal is referred to the goal that caused the matching of the head of the current rule. |
|
| 29. |
Explain Why Prolog Language Is Stated As A Procedural Language? |
|
Answer» 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. 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. |
|
| 30. |
Explain With An Example What Is “setof” Predicate In Prolog? |
|
Answer» In Prolog, “SETOF” predicate can be used to FIND out all the solutions of a predicate. For example, you have this database: Wisdom (SAP, Testing Tools) In Prolog, “Setof” predicate can be used to find out all the solutions of a predicate. For example, you have this database: Wisdom (SAP, Testing Tools) |
|
| 31. |
Name The Sector Where Prolog Programming Language Is Used? |
|
Answer» Prolog programming language is used in sectors like
Prolog programming language is used in sectors like |
|
| 32. |
Explain What Is The Difference Between Bagof/3 And Setof/3 Predicate In Prolog? |
|
Answer» Setof/3 is SIMILAR to bagof/3 and the DIFFERENCE between is that bagof/3 LEAVES all REPEATED SOLUTIONS while setof/3 removes them. Setof/3 is similar to bagof/3 and the difference between is that bagof/3 leaves all repeated solutions while setof/3 removes them. |
|
| 33. |
Explain What Is Prolog Programming Language? What Is It Based On? |
|
Answer» 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. 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. |
|