The first of three articles. It opens Pāṇini's grammar and runs it. The second asks what kept it alive. The third asks what our AI is missing.
Series page · Next → II · The Founder Ranks Last
AI detectors flag careful writing as machine-made. Point one at Pāṇini's ancient Sanskrit grammar and it would likely say "AI". It would be wrong. Here is the grammar, run rule by rule, and why.
In Brief For readers who have heard that Sanskrit is "like computer code" and want to know what is true in that. The article first explains what AI detectors measure and why they flag careful human writing. Then it opens the Aṣṭādhyāyī*, the grammar Pāṇini composed for Sanskrit, and runs it: the fourteen lines of sounds, the marker letters that vanish, the case endings used as instructions, the rules that carry words forward, one verb built in five steps, the rules that decide between rules, and the roles of who did what to whom. It ends with what the grammar could not do by itself. Volume II takes up that gap.*
Pāṇini's grammar is a human device for building every correct form of a language from a small set of rules, and an AI detector would mistake it for a machine because it cannot tell discipline from automation. The grammar is not magic and it is not a computer. It is about four thousand short rules, built so carefully that a few letters can stand for a whole sentence of instructions. This article runs those rules on real Sanskrit words, so that the reader can see the device work instead of taking its fame on trust. It also shows where the device needs something outside itself: a teacher, a speaker's intention, and people who argue with its author.
Opening — The Student Whose Care Looked Like a Machine
In 2023 a team at Stanford University tested seven popular AI detectors. These are programs that schools and publishers use to guess whether a text was written by a person or by a chatbot. The team gave them 91 essays written by students in India, China and other countries for the TOEFL, an English test for people whose first language is not English. On average the detectors marked more than six in ten of these human essays as machine-written. Essays by American schoolchildren of about thirteen were marked human almost every time1.
The detectors were not reading minds. They were measuring how predictable each next word was, and how evenly the sentences ran. A student writing carefully in a second language uses common words and regular sentences. The detectors read that care as a sign of a machine.
The same year, people found that detectors marked the Constitution of the United States as probably AI-written2. The reason is simple. The Constitution is formal and regular, and it has been copied across the internet so often that any program trained on the internet finds it predictable.
So here is a fair question. What would a detector say about the most carefully regular text the ancient world produced?
That text is the Aṣṭādhyāyī, "the eight chapters", the grammar of Sanskrit composed by Pāṇini in the north-west of the Indian subcontinent. Most scholars date him to about the fifth or fourth century BCE, and the date is argued over3. Few texts in any language are more compressed or more rule-bound. A detector would very likely call it a machine.
I have not run that test, and I would not trust anyone who reports a clean number from it. Detectors were built and tested mainly on modern English. Sanskrit joins words together at their edges, packs whole clauses into one long compound, and carries its grammar in word endings. A detector pointed at it would measure its own confusion, not Pāṇini's.
Is it true that NASA called Sanskrit the best language for computers?
No. In 1985 Rick Briggs, a researcher at an institute at NASA's Ames Research Center, wrote a careful paper in AI Magazine comparing how Indian grammarians analysed sentences with how computer scientists of his time stored meaning4. Over the years the paper became a forwarded message: "NASA says Sanskrit is the best language for computers". The paper says nothing like that, and it was one researcher's paper, not NASA's view. The story survives because it flatters. Flattery is the fastest way to make a people stupid about its own past.
So two easy stories are on offer. One says that anything regular is inhuman, so Pāṇini looks like a machine. The other says Sanskrit was a computer language all along. Both are wrong, and for the same reason: neither has looked inside the grammar.
Here is what looking inside means. In Sanskrit, dadhi (curd) followed by atra (here) is spoken as dadhy atra. The i turns into y before the next vowel. Every Sanskrit speaker does this without thinking. Pāṇini covers every meeting of this kind in the whole language, for four vowels, in a rule of three words: iko yaṇ aci. By the middle of Part Two you will be able to read those three words and see why they are enough.
A word on method before we start. This series makes three kinds of claim and keeps them apart. Some are facts about the texts: rule 6.1.77 turns i into y before a vowel. Some are comparisons: that rule looks like a rule in a computer language. Some are my own readings, and I mark them. Every comparison with computers is a comparison, not a family tree. Pāṇini was not on his way to the computer.
One more limit. When this series says "Indian" it means less than India. It reads Sanskrit traditions, mostly Brahmin ones: grammar, Vedic recitation, logic, interpretation of scripture, poetry. Buddhist and Jain grammarians appear in Volume II. The Tamil grammar Tolkāppiyam, itself a compact system of rules with a long life of commentary, does not appear, and the series would be richer if it did.
Part One — Fourteen Lines That Are Not an Alphabet
The list of sounds that the whole grammar stands on, and why its strange order is the point.
Before the first rule of the grammar, the tradition places fourteen short lines. They are called the Śiva-sūtras, after a story that they sounded from the drum of the dancing god Śiva. Leave the story aside and they are a list of the sounds of Sanskrit:
a i u ṇ · ṛ ḷ k · e o ṅ · ai au c · ha ya va ra ṭ · la ṇ · ña ma ṅa ṇa na m · jha bha ñ · gha ḍha dha ṣ · ja ba ga ḍa da ś · kha pha cha ṭha tha ca ṭa ta v · ka pa y · śa ṣa sa r · ha l
Read it as an alphabet and it is a mess. The vowels are split across four lines. The sound ha comes twice. The last letter of every line (ṇ, k, ṅ, c and the rest) is not one of the sounds in the list at all.
It is not an alphabet. Sanskrit already had a neat alphabet, the one children learn, which runs from the vowels through the consonants by where they are made in the mouth. Pāṇini had that order and chose not to use it. He arranged the fourteen lines so that every group of sounds his rules would need sits together in one unbroken stretch somewhere in the list. The disorder is the design.
What are the letters at the end of each line for?
Each line ends in a marker letter, called an it. The grammar says so in its own rules. Rule 1.3.3, halantyam, says that the last consonant of an item being taught is a marker. Rule 1.3.9, tasya lopaḥ, says that a marker is deleted3. The marker does its job and disappears before anything is spoken.
Its job here is to close a range. Rule 1.1.71, ādir antyena sahetā, says that a first sound joined to a later marker stands for itself and every sound in between3. Take a from the first line and the marker c from the fourth, and ac means all the vowels. Take ha from the fifth line and l from the last, and hal means all the consonants. Take i and the marker k, and ik means the four vowels i u ṛ ḷ. Such a short name is a pratyāhāra, a "drawing back", and the grammar uses several dozen of them.
Anyone who has written computer code will recognise something like this. The pattern [a-z] names a group of letters by its first and last member in a fixed order. That is the comparison, and it stops there. The fourteen lines were built for one language and one grammar, and their order was chosen by the needs of the rules.
The repeated sounds are not mistakes either. Ha appears twice because Pāṇini needed it in two groups that could not both stay together otherwise. The marker ṇ closes both the first line and the sixth, so a name like aṇ is unclear: it could stop at the first ṇ or run on to the second. Later grammarians had to decide, rule by rule, which one each aṇ meant. The fourteen lines are a compression with a known flaw, and the tradition recorded it.
How can a rule define the markers using a marker?
Look at rule 1.3.3 again. Halantyam means "a final hal is a marker". But hal is itself one of these short names, and it only means "all consonants" because its final l is already a marker. The rule that creates markers is written with a marker it has not yet created.
Patañjali, the great commentator of about the second century BCE, saw this circle and discussed how the grammar gets out of it5. The details matter less than the fact. Pāṇini's grammar describes Sanskrit in a special form of Sanskrit that it defines as it goes, like any system that writes its own rules in its own notation. It asks the reader for a small act of trust at the start, and its commentators knew exactly where.
The first two rules
Now the first rule can be read properly.
vṛddhir ādaic
Vṛddhi is ā, ai and au.
Pāṇini, Aṣṭādhyāyī 1.1.1
The rule gives a technical name, vṛddhi, to a set of vowels. The set is written ādaic, which has two pieces. Aic is a short name: ai in the fourth line up to the marker c, so ai and au. Āt is the long vowel ā followed by a t, and the t does precise work. Long ā is not in the fourteen lines at all. Only short a is. Normally a vowel named in the grammar stands for its whole family, short and long (rule 1.1.69). Rule 1.1.70, taparas tatkālasya, changes that: a vowel followed by t stands only for a vowel of its own length3. So āt means long ā and nothing else.
The second rule does the same for a lower grade of vowel:
adeṅ guṇaḥ
Guṇa is a, e and o.
Pāṇini, Aṣṭādhyāyī 1.1.2
At is short a only. Eṅ runs from e in the third line to its marker ṅ, so e and o.
Two short words, four markers, one rule about length, and two groups of vowels that the whole grammar will use thousands of times. In ordinary Sanskrit vṛddhi means growth and guṇa means a quality. Pāṇini fills both with new, exact meanings. A name given this way is a saṃjñā, a technical term.
There is one oddity, and the tradition explains it. In the second rule the sounds come first and the name last, which is the grammar's usual order. In the first rule the order is reversed, so the very first word of the grammar is vṛddhi. Patañjali says the teacher put an auspicious word at the head of a great work on purpose, because "growth" is a word of good omen5. The first syllable of the most compressed text of the ancient world is spent on a blessing. The grammarians who counted half-vowels did not count that one as waste.
The third rule says what the two groups are for. Rule 1.1.3, iko guṇavṛddhī, says that when a rule orders guṇa or vṛddhi without saying what it replaces, it replaces one of the vowels i u ṛ ḷ3. This is not a rule about Sanskrit. It is a rule about how to read other rules. Three rules in, the grammar has built an index, defined two groups on it, and given its first instruction about its own rules.
Does the trick work only on the fourteen lines?
No. It works on any list the grammar sets out. Rule 4.1.2 lists the twenty-one endings of the Sanskrit noun (seven cases, three numbers) as one long run of syllables that begins su and ends sup. From then on the whole set is called sup. Rule 3.4.78 lists the eighteen endings of the verb, from tip to mahiṅ, and the whole set is called tiṅ3. Two syllables, sup and tiṅ, name the endings of every Sanskrit noun and verb. Lay out a list once, in an order that serves the rules, then refer to any part of it by its first and last member forever.
Part Two — A Grammar That Turns Case Endings Into Instructions
How Pāṇini used the grammar of Sanskrit itself to write his rules, and how one word can govern a thousand rules without being repeated.
The rules are written in Sanskrit, but not in ordinary Sanskrit. Their cleverest trick is to give the language's own case endings new jobs.
Rule 1.1.49 says that a word in the genitive case (the "of" case) names the thing to be replaced. Rule 1.1.66 says that a word in the locative case (the "in" or "at" case) names what comes right after, and the change happens to what stands before it. Rule 1.1.67 says that a word in the ablative case (the "from" case) names what comes right before, and the change happens to what follows. The nominative, the plain naming case, gives the replacement3.
With these four rules a rule needs no verb at all. Here is the rule from the Opening:
iko yaṇ aci
In place of i, u, ṛ or ḷ, put y, v, r or l, when a vowel follows.
Pāṇini, Aṣṭādhyāyī 6.1.77
Ikaḥ is genitive: a vowel of the ik group is replaced. Yaṇ is nominative: by a semivowel. Aci is locative: when a vowel follows. A modern linguist would write it as ik → yaṇ / _ ac. Rule 1.1.50, sthāne 'ntaratamaḥ, says each sound is replaced by its nearest match, so i becomes y, u becomes v, ṛ becomes r and ḷ becomes l3.
Run it. Dadhi plus atra: the final i is in the ik group, a vowel follows, so it becomes y. Dadhy atra. Madhu (honey) plus ari: madhv ari. Three words cover every meeting of this kind in the language.
The comparison with a modern rule is useful, and this is where it starts to fall short. The modern arrow is a sign agreed outside the language it describes. Pāṇini's signs are made inside Sanskrit, from Sanskrit's own grammar. He describes the language in the language, used in two ways at once.
Why is the next rule even shorter?
Because it borrows words from the rule before it.
eco 'yavāyāvaḥ
In place of e, o, ai or au, put ay, av, āy or āv.
Pāṇini, Aṣṭādhyāyī 6.1.78
When? The rule does not say. The condition is aci, "when a vowel follows", carried over silently from rule 6.1.77. Run it: ne plus anam gives nayanam, the eye, "the thing that leads". Bho plus anam gives bhavanam, a house.
This carrying over is called anuvṛtti, "continuing". A word stated in one rule continues into the next rules until something stops it, and the reader supplies it. It is the largest source of the grammar's shortness and the largest source of its difficulty. A rule read alone is often only a fragment, and the student must know which words are running into it from which earlier rules, and where each one stops. The text itself does not mark this. The tradition kept track of it and argued about it.
What is a heading in a grammar?
A heading does more than carry a word forward. It declares an area. Rule 3.1.1 is a single word, pratyayaḥ, "an affix". Rule 3.1.2 adds paraś ca, "and it comes after". From that point to the end of the fifth chapter, more than a thousand rules later, everything the grammar adds is an affix, and it comes after what it joins. No rule in that stretch has to say either thing again3.
This is an adhikāra, a governing heading. Rule 6.1.72, saṃhitāyām, "in joined speech", is another. It heads the long run of sound-joining rules, including the two above, and says they apply only where words are run together in speech.
The difference is simple to state. Anuvṛtti carries words. Adhikāra sets the area where rules apply. A programmer would call one inheritance and the other a declaration at the top of a block. The Sanskrit terms do not need a programmer to make them precise. Grammarians argued them into precision, rule by rule, deciding where each heading's power ran out.
So one rule must be read against at least five things: the technical terms it uses, the short names it contains, the case endings of its words, the words carried into it, and the heading it sits under. Only then is it a rule. That is why the Aṣṭādhyāyī is a small book and a hard one. Its four thousand rules can be recited in a few hours. Written out in full, with every carried word restored and every short name spelled out, it would be several times longer. Nothing is lost in the shortening. The information is stored in the shape of the text, not in its words, and only someone taught how the shape works can get it back. Volume II is about those people.
Part Three — Building One Word in Five Steps
A verb root, a few vanishing letters and six rules, followed from start to finish.
The grammar does not start from words. It starts from pieces. A dhātu is a verb root. Rule 1.3.1, bhūvādayo dhātavaḥ, says roots are "bhū and the rest", pointing to a separate list, the Dhātupāṭha, of about two thousand roots, each tagged with markers that record how it behaves3. A pratyaya is an affix. Between them the grammar builds every verb form in the language.
Take bhū, "to be, to become", the first root in the list. Build bhavati, "he is", "she becomes", "it happens".
Step four is where the device shows its hand. Rule 7.3.84 says a root's final vowel is strengthened to guṇa before an affix of the type called sārvadhātuka. Is śap of that type? Rule 3.4.113, tiṅśit sārvadhātukam, says the verb endings and any affix with the marker ś are of that type3. Śap has the marker ś. The marker that vanished in step three decides what happens in step four. The ū of bhū is strengthened, and the nearest strong vowel to ū is o.
Why does a letter nobody hears matter so much?
Because it can also stop a rule. Rule 1.1.5, kṅiti ca, blocks this strengthening before an affix marked with k or ṅ. Rule 1.2.4 says an affix of this type that lacks the marker p is treated as if it were marked ṅ3. Śap and tip both carry a p. That p, never spoken, is what keeps the strengthening from being blocked. Take it away and the vowel would stay weak.
Now watch the same machinery run the other way. The affix kta makes past participles, and it carries the marker k. Add it to the root kṛ, "to do". The k triggers rule 1.1.5, the strengthening is blocked, and the result is kṛta, "done", not karta. One silent letter has decided the vowel of one of the commonest words in the language.
That is what a marker is. It is not a letter of the word. It is information attached to a piece of a word, telling later rules how to treat that piece, and then deleted. A programmer might call it metadata. Much of the grammar's shortness lives in these letters: one consonant on an affix can stand for a whole sentence of conditions that every rule touching it would otherwise have to repeat.
How does the new ending remember where it came from?
At step two the placeholder l was replaced by ti. Why should ti still count as the thing the present-tense rule added? Rule 1.1.56, sthānivad ādeśo 'nalvidhau, says a replacement is treated like the original it replaced, except in rules about single sounds3. This is an atideśa, an extension: one thing is treated as another for stated purposes. Without it, every replacement would lose track of what it is. With it, a derivation can rewrite its material again and again and still know what each piece is.
Six rules from four different chapters cooperated to make one ordinary word. None of them mentions bhavati or bhū. Each is stated for groups: vowels, endings, affix types, roots. The word comes out of their meeting, in an order set by the conditions each one needs.
That is what "the grammar runs" means, without metaphor. Give it a root, a meaning and a grammatical frame, and its rules apply one after another until a correct form appears. The Aṣṭādhyāyī describes the Sanskrit of Pāṇini's time, and treats the older Vedic language as a special case. It is also, and this is what makes it unusual among the ancient grammars of the world, a device for producing that language.
Its reach should be stated as exactly as its power. The device is most complete in word-building and sound-joining. It handles how words relate in a sentence through roles and case endings, as Part Five shows, but it has no general theory of word order, because Sanskrit marks relations with endings and did not need one. "Produces the forms of the language" means the forms. It does not mean everything a modern linguist calls grammar.
Part Four — What Happens When Two Rules Disagree
A grammar of this kind needs rules for choosing between its own rules. Pāṇini knew it, and the choosing never ended.
The tradition sorted the rules by their job. A saṃjñā gives a name, like rule 1.1.1. A paribhāṣā says how other rules are to be read, like 1.1.3 or 1.1.49. An adhikāra sets a heading. An atideśa extends one thing's treatment to another, like 1.1.56. A vidhi orders a change, like 6.1.77: when this holds, do this.
Two more kinds matter most. A niyama is a restriction. It narrows a change that would otherwise apply too widely. The tradition had a maxim for spotting one: siddhe sati ārambho niyamārthaḥ, "when a rule is stated for a result that would have come anyway, it is there to restrict". If the grammar says something it did not need to say, ask what the saying excludes.
And an apavāda is an exception: a narrower rule that wins over a general one on its own ground.
How does an exception work?
Rule 6.1.87, ād guṇaḥ, says that when a or ā meets a following vowel, the two join into one guṇa vowel. Mahā (great) plus indra gives mahendra, "great Indra". Gaṇa plus īśa gives gaṇeśa, "lord of the troops". Mahā plus ṛṣi gives maharṣi, "great sage".
The next rule, 6.1.88, vṛddhir eci, says that when a or ā meets e, o, ai or au, the join is a vṛddhi vowel instead. Sadā (always) plus eva (indeed) gives sadaiva, not sadeva. Mahā plus oṣadhi (herb) gives mahauṣadhi.
Every case the second rule covers, the first would also have covered, with a different answer. Neither rule mentions the other. The principle that the narrower rule wins on its own ground is what makes the second an exception and not a contradiction.
What if neither rule is narrower?
Then two rules can both apply to the same form and demand different results. For this Pāṇini wrote rule 1.4.2:
vipratiṣedhe paraṃ kāryam
When two rules conflict, the para one is to be applied.
Pāṇini, Aṣṭādhyāyī 1.4.2
Para usually means "later". The obvious reading is that when two rules conflict, the one placed later in the book wins. That reading does not work well. Applied mechanically, it gives wrong forms in many cases, and the tradition built a set of further principles around it. By the early eighteenth century the grammarian Nāgeśa could state the result in one line: of an earlier rule, a later rule, a nitya rule (one that applies whether or not its rival applies first), an antaraṅga rule (one whose conditions sit closer to the core of the word), and an exception, each is stronger than the one before6.
In 2022 a doctoral thesis at Cambridge, by Rishi Rajpopat, argued that this whole structure rests on a misreading of para7. Volume II tells that story. The point here is simpler. A grammar like this cannot be only a list of rules. It must also have rules for choosing between its rules, and those create disputes of their own, which need further rules. The rules about rules were not added later as decoration. The device forced them.
Can a grammar make one of its own steps invisible?
Yes, and it is the strangest device in the book. Rule 8.2.1, pūrvatrāsiddham, stands at the head of the last three quarters of the eighth chapter, a section the tradition calls the tripādī, "the three quarters". It says that from here on, the result of each rule is asiddha, "not done", as far as every earlier rule is concerned3. Nothing earlier can see what this section does.
One example shows why anyone would want this. Take hare, "O Hari", followed by iha, "here". Rule 6.1.78 turns the e into ay before a vowel: haray iha. A rule in the last section, 8.3.19, allows that y to be dropped, following the usage of the older grammarian Śākalya: hara iha. Now a stands before i, and rule 6.1.87 is waiting to join them into e, which would give hareha. It cannot. The dropping happened in the last section, and rule 8.2.1 makes it invisible to rule 6.1.87. The two vowels stay apart. Sanskrit says hara iha, or harayiha with the y kept, and never hareha. The grammar gets the language right by hiding one of its own steps from another.
People who write compilers, the programs that turn code into instructions for a machine, know this problem: a later stage must not set off an earlier one, or the process loops and produces nonsense. Pāṇini's answer was not to number every step. It was to draw a line across which results do not flow backwards. Scholars still argue about how far this principle reaches. That the argument is about the behaviour of a formal device, and can be tested against real Sanskrit, is the point.
Part Five — Who Did What to Whom
How the grammar links forms to meaning, why a case ending is not a role, and how a compound can mean something none of its parts says.
Everything so far has been about sounds and forms. A grammar must also link forms to what a sentence says, and here Pāṇini built something that European linguistics reached by its own road only in the twentieth century.
Rule 1.4.23, kārake, is a heading: "about a participant in an action". Under it Pāṇini defines six roles that a thing can play in an action, each by what it does, not by how it is marked3:
- the apādāna, the fixed point something moves away from (1.4.24),
- the sampradāna, the one the act is aimed at, the receiver (1.4.32),
- the karaṇa, "the most effective means", the instrument (1.4.42),
- the adhikaraṇa, the place or ground of the act (1.4.45),
- the karman, what the doer most wants to reach (1.4.49),
- the kartṛ, "the independent one" (1.4.54), the doer who is not directed by anyone else in the same act.
Only later, in the second chapter, does the grammar give case endings to these roles. And its first word on the subject is a condition. Rule 2.3.1, anabhihite, "when not already expressed", governs everything after it. The accusative marks the karman, the instrumental marks the doer or the instrument, and so on, but only when the role has not already been expressed by something else in the sentence.
Why does that one condition matter?
Watch it work. In rāmo grāmaṃ gacchati, "Rāma goes to the village", the verb's ending already expresses the doer. So the doer is not marked again: rāmaḥ stands in the plain naming case. The village is the karman, not expressed by the verb, so it takes the accusative. Now make the sentence passive: rāmeṇa grāmo gamyate, "the village is gone to by Rāma". The verb ending now expresses the karman. So the village falls into the plain case, and Rāma, no longer expressed by the verb, takes the instrumental.
A school grammar says the subject of an active verb is in the nominative and the agent of a passive verb goes into another case. Pāṇini says something shorter. The roles stay the same. The endings mark whatever the verb has left unsaid. The passive is not a change to the sentence. It is a different choice of which role the verb will carry. When twentieth-century linguists developed ideas of "semantic roles", they were not reading Pāṇini, and their systems differ from his. His is the earliest worked-out account of the idea that roles and case endings are different things.
Who decides what role a thing plays?
The speaker does. The roles are not read off the world. One can say sthālyāṃ pacati, "he cooks in the pot", making the pot the place. One can say sthālyā pacati, "he cooks with the pot", making it the instrument. One can even say sthālī pacati, "the pot cooks", making it the doer. All three are correct Sanskrit. The pot has not changed. The speaker's framing has. The tradition's phrase for this is vivakṣā, "the wish to express".
Patañjali tested these definitions hard. The apādāna is "the fixed point in moving away". So what about a man who falls from a galloping horse? The horse is not fixed. Patañjali's answer is that "fixed" is relative to the act of separating: the horse is the fixed point of the falling, whatever else it is doing5. One-line definitions are being pressed against awkward cases and made sharper. Volume II is about that pressing, and the fact that it never stopped.
This matters beyond grammar. A device that assigns roles by the speaker's framing cannot run without knowing what the speaker means. At this point Pāṇini's device takes an input that no rule supplies: someone's decision about how to present the world. Volume III comes back to that input, because it is exactly what an AI language model does not visibly have.
How can a word mean something none of its parts says?
Sanskrit builds long compounds, and the grammar governs them under a heading of their own. Rule 2.4.71 drops the case endings inside a compound3. Rājñaḥ puruṣaḥ, "the king's man", becomes rājapuruṣaḥ. The "of" ending disappears, and the compound's shape now carries the relation.
The most remarkable kind is defined by rule 2.2.24, anekam anyapadārthe: several words join to mean something outside themselves. Pīta means yellow and ambara means garment. Pītāmbaraḥ does not mean "yellow garment". It means "he whose garment is yellow", and it names Kṛṣṇa. The compound points outside its parts to someone none of them names. This kind is called bahuvrīhi, after its own example, "one who has much rice". Here a system of forms has to carry reference, and the grammar gives it a type and rules of its own.
Last comes sandhi, the joining of sounds at word edges, which most learners meet first and think of as spelling. In the grammar it is neither first nor spelling. Its rules are spread across the sixth and eighth chapters, placed where a derivation needs them. Rule 8.2.39, which turns tat plus api into tad api, sits deep in the last section, where earlier rules cannot see what it does. The order of the book is part of the grammar.
Part Six — The Same Culture Wrote Poetry That Does the Opposite
Why shortness was a way of knowing and not just a trick, and why the civilisation that made this grammar also made poems built to surprise.
ardhamātrālāghavena putrotsavaṃ manyante vaiyākaraṇāḥ
Grammarians rejoice over saving half a short vowel as over the birth of a son.
A maxim of the grammarians, in Nāgeśa Bhaṭṭa, Paribhāṣenduśekhara
This maxim is a joke6, and like most good jokes it carries a doctrine. The saving is tiny. The joy is enormous. The value at stake is lāghava, "lightness". In grammar it means a rule must say no more than it must. In the later logic school of Navya-Nyāya, lāghava and its opposite gaurava, "heaviness", became standard tests for choosing between rival explanations, much as Europe later used the principle of parsimony. Behind both uses is one belief: the lighter account is not just neater, it knows more.
What makes shortness a kind of knowledge?
There are two kinds of shortening. Bad shortening just drops material, and what is dropped is gone. A summary of a novel is useful, but you cannot rebuild the novel from it. Good shortening keeps the means of rebuilding. "Two plus two is four" records one result. "a plus b equals b plus a" records a pattern from which endless results follow. It is shorter for each fact it holds, and it holds more, because it stores the rule instead of the answers. Every device in Parts One to Five is good shortening of this kind. Its test is whether a trained mind, centuries later, can rebuild the correct forms.
The genius is not in storing everything. It is in storing enough structure that everything else can be rebuilt. Volume II will show that this sentence is true and incomplete. The structure did not rebuild itself. People did.
Were the grammarians alone in this?
No. The Chandaḥśāstra of Piṅgala, a treatise on the metres of Sanskrit verse, treats each metre as a pattern of light and heavy syllables. It gives methods to list every pattern of a given length, to find a pattern's place in that list, and to recover a pattern from its place8. Because each syllable is either light or heavy, these are operations on strings of two values. The commentator Halāyudha, in the tenth century, drew from them the triangle of numbers Europe later named after Pascal.
This is a favourite place for patriotic exaggeration, so the plain claim matters. Piṅgala did not invent the binary computer. He treated a fixed form step by step, because verse was a way of storing knowledge and its patterns had to be listed, taught and checked. A missing syllable breaks the line, and a metre makes the break audible.
Did this culture think all good language should be short and regular?
No. If the argument stopped at compression it would slide into a new narrowness: the best text is the shortest and most regular. The same civilisation produced Kālidāsa.
Classical court poetry, kāvya, is dense in the opposite direction. It hunts for the unexpected compound, the phrase that means two things at once, the image that releases its sense slowly. Where the rule lowers surprise, the poem raises it. A detector that flagged Pāṇini would not know what to do with Kālidāsa's Meghadūta, "the cloud messenger", where an exiled lover sends word to his wife by a monsoon cloud and the poet maps a journey across India through the cloud's eyes9.
In the ninth century the critic Ānandavardhana built a whole theory of poetry, dhvani, around meaning that is never stated but only suggested: what is left after the literal sense and the figurative sense have both done their work10. A culture that studied suggestion that carefully did not believe that all valuable language is code. Volume III will need dhvani, because the most dangerous sentences a chatbot writes are not the ones that break grammar. They are the ones whose form suggests an authority they do not have.
Seen side by side, and this arrangement is my own, not a system any of these schools believed it belonged to, Sanskrit learning had many tools for many jobs. The sūtra compresses a system until it can be held in memory and rebuilt. Vedic recitation keeps a text unchanged across generations, with errors made audible. Metre packs language into countable patterns. Logic, in the Nyāya school, makes reasons public and open to defeat. Mīmāṃsā turns an inherited text into present duty without guesswork. Poetry raises meaning beyond the literal. Epic and story carry a people's memory through sheer abundance.
This is where a detector's view of language looks poorest. It knows one scale, regular against irregular, and assumes humans live at one end of it. These traditions lived at both ends and knew which end each task needed. A civilisation that can write both the Aṣṭādhyāyī and the Meghadūta is not naturally regular. It can choose how surprising a text should be.
Ending — What the Device Could Not Do by Itself
In 1933 the American linguist Leonard Bloomfield called Pāṇini's grammar "one of the greatest monuments of human intelligence"11. It is usually quoted as praise. It is better read as a description, and this article has tried to earn it by showing the device at work.
Computer scientists noticed long before today's excitement. In 1967 Peter Ingerman wrote to the journal Communications of the ACM proposing that the notation used to define programming languages, then called Backus Normal Form, be renamed Pāṇini-Backus Form, since Pāṇini had used an equivalent method first12. The name did not stick. The observation did. Since then, researchers such as Gérard Huet in Paris and Amba Kulkarni in Hyderabad have built computer tools that carry out large parts of Pāṇini's analysis13,14. A complete, faithful program for every rule and every traditional reading is still unfinished, and the reason is the subject of Volume II: the text does not contain everything needed to run it.
So is Pāṇini a computer scientist?
No. Calling him one explains nothing. It lets computer science set the exam and then gives the ancient student a pass mark. The linguist Paul Kiparsky gives a better explanation. Much of what looks like theory in the grammar (its levels, its roles, its strict ordering) follows, he argues, from one relentless demand: say it in the fewest words without losing anything15. Push brevity far enough, while still producing every correct form and no wrong one, and architecture appears. Shortness pushed to its limit stops being a style and becomes a structure.
"Device" is accurate and incomplete. The Aṣṭādhyāyī has inputs, steps and outputs. It was also a text memorised in childhood, the core of an education, a standard of correct speech with social consequences for who spoke "correctly", and the root of a commentary that argued over every line for two thousand years. The device picture shows the rules and hides the people.
That is also why the common objection, "rules are mechanical, and the mechanical is not intelligent", runs two things together. A clerk applying a tax table follows rules. Pāṇini built a system of rules that can produce an open-ended language, with its own notation and its own ways of settling conflicts between its parts. Following a rule and building such a system are as different as reading a map and surveying a country.
One strong strand of modern Western culture, from the Romantic poets to the cult of the original genius, finds intelligence in the surprising output and the break from rules. That strand is not the whole West, which also gave us Euclid, the debates of the medieval schools and the rules of counterpoint in music. But it has become the default picture in schools and in arguments about AI. The grammar shows another picture at work: intelligence as the ability to understand a system that produces things, and to produce from it endless correct results, including ones its maker never saw.
This series uses one frame, and the frame is mine, not the tradition's. At least three abilities travel under the word "intelligence". The first is producing: can I make valid possibilities? The second is testing: can I tell valid from invalid, and true from false? The third is choosing: can I decide which possibility ought to be chosen, and stand behind the choice? The Aṣṭādhyāyī is the greatest monument to the first.
Yet this article has shown, four times, that the first was never alone. The fourteen lines had a known flaw that later grammarians had to settle. The rule for conflicts needed principles the text does not contain. The definition of the fixed point had to be defended against a man falling from a horse. And the device, handed to a reader without a teacher, does not run at all.
So the question that opened this article has a sharper form. A detector would call Pāṇini a machine. But a machine runs by itself. Who kept this device running for two thousand years, and how did they dare to tell its maker he was wrong?
Words to keep
These are not slogans. Each line carries a step in the argument.
Terms
- Aṣṭādhyāyī, "the eight chapters", Pāṇini's grammar of Sanskrit.
- it (also anubandha), a marker letter that carries an instruction and is then deleted.
- pratyāhāra, a short name for a group of sounds, made from a first sound and a later marker.
- saṃjñā, a technical term defined by a rule.
- anuvṛtti, words carried silently from one rule into the next.
- adhikāra, a heading that sets the area where rules apply.
- apavāda, an exception, a narrower rule that wins on its own ground.
- asiddha, "not done": a result treated as invisible to earlier rules.
- kāraka, a role a thing plays in an action, such as doer, instrument or place.
- lāghava, lightness, the demand that a rule or theory say no more than it must.
Lines to keep
- "A marker does its job and disappears before anything is spoken." Pāṇini stores instructions in letters that never reach the ear. That is where much of his shortness lives.
- "A civilisation that can write both the Aṣṭādhyāyī and the Meghadūta is not naturally regular. It can choose how surprising a text should be." What a detector's one scale cannot see.
Sources
- Weixin Liang, Mert Yuksekgonul, Yining Mao, Eric Wu and James Zou, "GPT detectors are biased against non-native English writers", Patterns 4, no. 7 (2023). https://doi.org/10.1016/j.patter.2023.100779
- Benj Edwards, "Why AI detectors think the US Constitution was written by AI", Ars Technica, July 2023. https://arstechnica.com/information-technology/2023/07/why-ai-detectors-think-the-us-constitution-was-written-by-ai/
- Pāṇini, Aṣṭādhyāyī, with the Śiva-sūtras and the Dhātupāṭha. Standard edition and translation: Sumitra M. Katre, Aṣṭādhyāyī of Pāṇini (Austin: University of Texas Press, 1987). Rule numbers are book, quarter and rule. The renderings here are mine.
- Rick Briggs, "Knowledge Representation in Sanskrit and Artificial Intelligence", AI Magazine 6, no. 1 (1985), pp. 32–39. https://doi.org/10.1609/aimag.v6i1.466
- Patañjali, Mahābhāṣya, ed. Franz Kielhorn, 3 vols (Bombay: Government Central Book Depot, 1880–85). Cited for the circle in rule 1.3.3, the auspicious vṛddhi of 1.1.1, and the falling rider under 1.4.24. The renderings here are mine.
- Nāgeśa Bhaṭṭa, Paribhāṣenduśekhara (early 18th century), ed. and trans. Franz Kielhorn (Bombay, 1868–74). Source of the half-vowel maxim and of the order of strength among rules.
- Rishi Rajpopat, In Pāṇini We Trust: Discovering the Algorithm for Rule Conflict Resolution in the Aṣṭādhyāyī, PhD thesis, University of Cambridge, 2022. https://www.repository.cam.ac.uk/handle/1810/332654
- Piṅgala, Chandaḥśāstra, with Halāyudha's commentary Mṛtasañjīvanī (10th century).
- Kālidāsa, Meghadūta.
- Ānandavardhana, Dhvanyāloka (9th century), trans. Daniel H. H. Ingalls, Jeffrey Moussaieff Masson and M. V. Patwardhan, The Dhvanyāloka of Ānandavardhana with the Locana of Abhinavagupta (Cambridge, MA: Harvard University Press, 1990).
- Leonard Bloomfield, Language (New York: Henry Holt, 1933), p. 11.
- Peter Zilahy Ingerman, "'Pāṇini-Backus Form' suggested", Communications of the ACM 10, no. 3 (1967), p. 137. https://doi.org/10.1145/363162.363165
- Gérard Huet, The Sanskrit Heritage Site, INRIA, Paris. https://sanskrit.inria.fr/
- Amba Kulkarni and colleagues, Saṃsādhanī: Sanskrit computational tools, University of Hyderabad. https://sanskrit.uohyd.ac.in/scl/
- Paul Kiparsky, "On the Architecture of Pāṇini's Grammar" (2002), lectures given at Hyderabad. https://web.stanford.edu/~kiparsky/Papers/hyderabad.pdf
How I wrote this
- What I read in the original. The rules of the Aṣṭādhyāyī quoted here, against Katre's edition. Every rule number and every derivation step was checked against it. The renderings of rules into English are mine.
- What rests on other scholars. Patañjali's remarks on rules 1.1.1, 1.3.3 and 1.4.24, Nāgeśa's order of strength, Piṅgala's methods and Halāyudha's triangle, and Kiparsky's account of why the grammar's architecture follows from brevity. The detector studies are reported as their authors reported them.
- Simplifications. The derivation of bhavati leaves out accent and rules that change nothing. The treatment of aṇ, the reach of asiddha beyond rule 8.2.1, and the full conditions of rule 7.3.84 are simplified. None changes the argument.
- Dates. Pāṇini's date is disputed. I give the range most scholars use and say so.
- Readings that are mine. The three abilities (producing, testing, choosing), the comparisons with code, and the side-by-side view of Sanskrit learning in Part Six. Each is marked in the text.
- What I did not do. I did not run any AI detector on Sanskrit, for the reasons given in the Opening.
- Tools. I used AI assistance for research checks and editing. The arguments, the readings and any errors are mine.