Tag: Prolog

Generating Polynomials in Prolog

Written by on November 26, 2023 in Programming, Prolog with 0 Comments
Generating Polynomials in 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. […]

Continue Reading

Why Learn Prolog?

Written by on October 6, 2022 in Programming, Prolog with 2 Comments

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 […]

Continue Reading

Definite Clause Grammars in Lisp – Part 4

Written by on June 12, 2022 in LISP, Natural Language Processing, Programming, Prolog with 0 Comments
Definite Clause Grammars in Lisp – Part 4

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 […]

Continue Reading

Students Assessment Advisor in Prolog

Written by on May 15, 2022 in Programming, Prolog with 0 Comments
Students Assessment Advisor in 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 […]

Continue Reading

Understanding the “unify” Function in “newLisp”

Written by on November 28, 2021 in newLisp, Programming with 0 Comments
Understanding the “unify” Function in “newLisp”

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. […]

Continue Reading

Identifying Sentence Types Automatically

Written by on July 4, 2021 in Natural Language Processing, Programming, Prolog with 0 Comments
Identifying Sentence Types Automatically

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 […]

Continue Reading

Snake and Ladder Game in Prolog

Written by on June 19, 2021 in Programming, Prolog with 0 Comments
Snake and Ladder Game in Prolog

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 […]

Continue Reading

Automatically Converting Active Voice to Passive Voice and Vice Versa

Written by on February 16, 2020 in Natural Language Processing, Programming, Prolog with 0 Comments
Automatically Converting Active Voice to Passive Voice and Vice Versa

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 […]

Continue Reading

Distributed Computing with Linda

Written by on December 22, 2019 in Programming, Prolog with 0 Comments
Distributed Computing with Linda

Linda, originally proposed by Nicholas Carriero and David Gelernter, is a model of process communication using a small set of well-defined primitives, operating on a tuple space.  Interestingly, Sicstus Prolog comes with a library that implements Linda (both Server and Client).  I played with it a little bit and really enjoyed it. In this article, I would […]

Continue Reading

Conjugating Phrasal Verbs

Written by on October 13, 2019 in Natural Language Processing, Programming, Prolog with 0 Comments
Conjugating Phrasal Verbs

In the last article, I showed how to generate verb conjugations in the “iLexicon” system. Today, let us see how this idea can be extended to English “phrasal verbs”. According to Wikipedia: “a phrasal verb is a phrase such as turn down or ran into which combines two or three words from different grammatical categories: […]

Continue Reading

Top