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

Using Sicstus Prolog with LMDB

Written by on October 3, 2021 in Programming, Prolog with 0 Comments
Using Sicstus Prolog with LMDB

In an earlier article, I showed how Sicstus Prolog allows us to use Berkeley DB for storage and retrieval of terms using the file system. Interestingly, the latest release of Sicstus Prolog, version 4.7.0, deprecates the Berekely DB library, while recommending an alternative implementation based on Lightning Memory-Mapped Database Manager (LMDB). The library interfaces are […]

Continue Reading

Sentence Negation

Written by on July 18, 2021 in Natural Language Processing, Programming, Prolog with 0 Comments
Sentence Negation

In the last article, I talked about determining sentence types automatically. Another interesting task is to generate the “negation” of a given sentence. Example-1: Sentence => “My teacher lives nearby” Negation => “My teacher does not live nearby” Example-2: Sentence => “She did not like that speech” Negation => “She liked that speech” I have […]

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

Getting to Know Visual Prolog 10

Written by on June 6, 2021 in C++, Programming, Prolog with 0 Comments
Getting to Know Visual Prolog 10

Visual Prolog has its roots in Turbo Prolog, which was popularized by Borland in the mid 1980s. It is developed and supported by PDC A/S, Denmark. So how is Visual Prolog different from other Prolog implementations out there, for example, SWI-Prolog or Sicstus Prolog? Here are the key differences: 1) It is not an ISO Prolog  […]

Continue Reading

The Structure of WH-Questions

Written by on May 23, 2021 in Natural Language Processing, Programming, Prolog with 0 Comments
The Structure of WH-Questions

WH-Questions are questions that begin with the following words: – Who (“Who came here yesterday?”) – What (“What is the goal of this project?”) – When (“When can I visit my parents?”) – Where (“Where did he go?”) – Why (“Why is everyone running away?”) – Which (“Which is the book you recommend?”) – How […]

Continue Reading

Top