Thursday, February 25, 2010

Panini's logic and Computer languages

Education in Ancient India
The greatness of any ancient civilization is measured not only based on its trade, commerce and wealth, but also from the flourishing of learning and education. The great civilizations that have flourished in India have made their own contributions to Arts and Science. Ancient universities in the country, like the Nalanda and Taxila universities attracted scholars and teachers from all over the world. Out of many of India’s advancements in the field of learning, the country’s contributions to philology (the science of language and speech) are significant. India is home to hundreds of languages and dialects that reflect the culture and vibrancy of the country. Amongst them, a few languages like Tamil and Sanskrit have been in use since the ancient times, yet they stand the test of time, and are still in use. These languages also possess well established forms of grammar, that reflect on the refined and articulate systems of communication evolved by the Indians, when much of the rest of the world still used primitive symbols and ideas.
The Eternal language
Sanskrit is one of the oldest prevailing languages of India. It is considered as ‘Devavani’- the language of the gods. The language has been in existence for more than 5000 years. It had once been used widely over the Indian subcontinent and also as a scholarly language. The grammar adopted for Sanskrit is so sophisticated, technical and precise, that it comes close to the syntax of modern computer languages. It is believed that the grammatical rules used in Sanskrit can be applied in the field of Artificial Intelligence. This is evident from the grammar rules framed by the great scholar, Panini, in his work on the formation and use of Sanskrit words and expressions, called ‘Ashtadhyayi’.
Panini is considered to have lived around 500 BC, in the Shalatur village near the present-day Peshawar. He had pursued his studies in the famous Taxila university. Panini’s lifetime was during the transformation phase between the archaic form of Sanskrit (as used in the Vedas) to a simplified form, called ‘Classical Sanskrit’.
The organization of Ashtadhyayi
The Ashtadhyayi consists of 3959 rules or ‘sutras’ that are classified into eight chapters, hence the name ‘Ashtadhyayi’. Each chapter is subdivided into four sections or ‘padas’. In this text, Panini explains the application of certain structured algorithms into previously defined lexical lists, to get well-formed words. The author utilizes techniques like recursion, transformation and metarules. He also introduces the concept of phonemes, morphemes and root words, which were realized later by the western linguists only during the 19th century. In addition to the morphology of words, Panini also deals with concepts like phonetics (Shiksha). The Ashtadhyayi uses a few auxiliary texts, such as the Shiva sutras, the Dhatupatha and the Ganapatha. Dhatupatha and Ganapatha are lexical lists. Dhatupatha lists the verbal roots and Ganapatha, the nominal stems having common properties.
The Backus-Naur Form
To understand how Panini’s rules resemble the syntax of computer languages, let us have a look at the development of computer languages. The start of programming languages is the concept of Backus Natural Form or Backus-Naur Form (BNF). This was introduced by John Backus in 1959, at the World Computer Congress to define the syntax of programming languages. It was later simplified by Peter Naur, and the expansion for BNF was changed to include his name. Based on concepts evolved from the Backus-Naur form, the programming language called ALGOL was evolved. This has been the basis for most of the programming languages that have followed ALGOL. The similarity between BNF and Panini’s logic was discovered later and hence it is also called as Panini-Backus Form. The same concept also finds application in Mathematical linguistics, (a scientific analysis of human languages) as acknowledged by the American linguist, Noam Chomsky.
Application in AI
Apart from BNF, Paninian grammar also involves Natural Language Processing, a concept widely used in the field of Artificial Intelligence (AI). Artificial Intelligence concerns the application of computers in fields, which require thought processes similar to human beings, as opposed to logic and techniques conventionally adopted by computing systems. This is estimated to be the next level of advancement of computers, called the ‘Fifth Generation computers’. The basic requirement of AI is a way to map the logic utilized by the human brain, while solving problems that may range widely. There are many approaches that have been suggested and tried over the decades to make computers think in the way humans do. Consequently, many ideas have been analyzed by scientists, right since the introduction of computers. Paninian grammar, in its attempt to establish a well-defined system of using a human language, explores the methods of processing the language systematically. Thus, the methods utilized by Panini could possibly assist further advances in Artificial Intelligence. Such an attempt, apart from aiding technological advancement, would also throw light upon the modernity of Sanskrit.
Commentaries on Ashtadhyayi
It has been a practice for scholars over the centuries in India, to write commentaries on important books to guide others who learn the subject. Such commentaries are called ‘bhashyams’. As such, a commentary on Ashtadhyayi has also been written by another grammarian, Patanjali, called ‘Mahabhashyam’ (literally, ‘the great commentary’). The Mahabhashyam covers 1228 rules found in the Ashtadhyayi, while clearing various doubts that had arisen over a few grammatical issues. Moreover, it has also discarded a few extra rules suggested by Katyayana, another contemporary grammarian during Patanjali’s period. Other works related to the Ashtadhyayi include a more simplified version of the Ashtadhyayi, written by Bhattikavya, based on moral concepts.
The Influence of Sanskrit grammar
The structured form of Sanskrit grammar has led to the creation of many great literary works in the language, like the plays written by Kalidasa, Bhasa and Sri Harsha, and novels written by Bana Bhatta. While the brilliant ideas proposed by Panini have been recognized to some extent, much research is yet to be conducted to reveal their full significance. The universality of the Paninian rules have made them to influence not only the grammatical structures of many Indian languages and literary works compiled in those languages, but also the syntax in a few European languages.

6 comments:

  1. Thanks for the informative introduction. My question is about a detail: The text editions of Panini's Astadhyayi that I know have ca. 3983 sutras. You are talking about 3959 sutras. I really would like to know your source of the Astadhyayi.

    ReplyDelete
    Replies
    1. You are right, I got the stat wrong. The correct no. is indeed 3983. Thanks for the edit... Funny coincidence.. I decided to visit my blog after such a long time of neglect, the very next day after u posted your comment

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Thanks. What would you think is the quickest way for a Non-Hindu to learn Panini's Astadhyayi by heart? Is there a quick way to get the essence of it?

      Delete
    4. If your aim is to understand and memorize the rules, isn't it better to learn them in English as such? I mean, the Sanskrit is quite tough. I learnt the Vishnu Sahasranamam by heart because I listened to the audio set in music.. I guess such an option is not available for a grammar book.. Although, if you think it is possible to learn Ashtadhyayi by heart, go for it. Its not like one really needs to understand Sanskrit to memorize it.

      Delete
  2. @maria I think to understand Panini's ashtadhayai is important than memorize it but if really want to memorize so don't focus on the Sutra's just try to make understanding of the trims are used in the sutra's like guna, vridhi,

    ReplyDelete