# Tag: Prolog

Polynomial is an important topic in High School maths curriculum. There are many online courses that explain the topic in great details with lots of examples and sample exercises. Wouldn’t it be interesting if we can generate polynomials of given degree programmatically? It turns out that this is not such a hard problem after all. […]

There are several programming languages in use today and a simple google search will throw up interesting recommendations of a subset of these languages to learn, usually based on popularity ranking. As is expected, the popularity of a programming language varies over time and hence a language that was in demand a few years ago […]

In a series of articles written earlier, I had shown how it is possible to model Definite Clause Grammars (DCG) in LispWorks Lisp (Enterprise Edition). We use defgrammar in Common Prolog (available as part of KnowledgeWorks package) to define our grammar rules. Here is a toy English grammar represented using defgrammar: This corresponds to the following Prolog […]

A close relative of mine teaches Maths to school students in different Grades. During a casual chat some time ago, he mentioned that he was trying to adopt an automated approach to selecting assignment problems based on each student’s performance so far. Obviously, there are many ways in which this can be done, but he […]

Unification between two symbolic expressions involves finding substitutions for variables (if any) in the expressions such that the expressions match after applying the substitutions. This is a powerful idea and is quite common in logic programming languages such as Prolog. Interestingly, “newLisp” has a buil-in function called “unify” that can be used for unifying two expressions. […]

Sentences in English can be classified into the following common types: – Simple sentence (“I am drinking coffee”) – Compound sentence (“He came home with his school friend and they had an enjoyable evening”) – Complex sentence (“Whenever my dog barks, I give him some biscuit”) – Imperative sentence (“Please keep quiet”) – Interrogative sentence […]

Snake and Ladder is a popular game that originated in India and later spread to other parts of the world. Even now it is a hit among kids in South India, where people use the traditional game board, coins and dice.  Last week, I had a chance to play this game with my 5-year-old granddaughter, who […]

The iLexicon system can handle active/passive voice conversion of fairly complex English sentences. I gave examples of the underlying verb conjugation mechanism in this article and this one. Today, I am going to give examples of the conversion of complete sentences. Here is an example of active to passive voice conversion: The above is a snapshot […]