📖 Formal grammar

= collection of syntax definitions in a 📕 Formal Language that define valid words or phrases

Classification

🪜 Chomsky Hierarchy

Units

Types

How to check?

Relationships

Two grammars are…

  • Weakly equivalent: generate same strings
  • Strongly equivalent: generate the same strings and structures (= parse tree)

📖 Example: