Vyākaraṇa,the analysis of language

Pāṇini's Aṣṭādhyāyī

Around the fourth century BCE, Pāṇini described Sanskrit in about four thousand ordered rules — with definitions, metarules, recursion and a compact notation. It is the oldest surviving generative grammar, and the ideas it needed are the ones computing rediscovered two and a half thousand years later. The Aṣṭādhyāyī is in the Library, all 3,958 sūtras. Here are its first steps.

वृद्-धिर् आत्=ऐच्

vṛd-dhir āT=aiC

HREEM's gloss: Defines the technical term vṛddhi as the vowels ā, ai, au — a definition rule, the grammar naming its own symbols.

अत्=एङ् गुणः

aT=eṄ guṇaḥ

HREEM's gloss: Defines guṇa as a, e, o. Two rules in, and Pāṇini has already built a small vocabulary for the machine to use.

इको गुण-वृद्-धी

iKo guṇa-vṛd-dhī

HREEM's gloss: A metarule: where guṇa or vṛddhi is prescribed, it applies to the ik vowels (i, u, ṛ, ḷ). Rules about rules — the idea a compiler engineer would call a type constraint.

विप्रतिषेधे परम् कार्यम्

vipratiṣedhe param kāryam

HREEM's gloss: When two rules conflict, the later one wins. An explicit conflict-resolution policy, stated once for the whole system.

षष्ठी स्थाने-योगा

ṣaṣṭhī sthāne-yogā

HREEM's gloss: A genitive in a rule means 'in place of'. Pāṇini fixes what his notation means, so every later rule can be read mechanically.

How the study companion answers

The companion is not a model trained on scripture. It is retrieval with a check at the end: five steps, each one inspectable, the last of which removes any quoted verse that does not match the corpus.

  1. Understand the reference. "Katha 1.2.18", "Gita chapter 2", "BG 2.47" — references are parsed exactly and fetched directly. No search, no guessing.
  2. Search the corpus. Otherwise the question is expanded with a small lexicon (Sanskrit terms, English synonyms, Hinglish spellings) and matched against more than 760,000 verses with a full-text index. Verses a reader can read in English come first.
  3. Decide whether to speak. If the best match covers too little of the question, the Companion refuses. Silence over a dressed-up guess.
  4. Ask the model — inside a fence. When an answer engine is configured, it sees only the retrieved verses and may quote only those. For life questions it reflects; it never commands.
  5. Verify every citation. A deterministic checker compares each quoted verse, character by character, with the corpus. Anything that does not match is stripped before you see it.