Context-sensitive grammars (CSGs) are a type of formal grammar used in computational linguistics and computer science. They extend context-free grammars by allowing production rules where the length of the string on the left side can be less than or equal to the length of the string on the right side. This means that the rules can depend on the surrounding symbols, making them more powerful for certain languages.
CSGs can generate languages that are more complex than those generated by context-free grammars, such as some natural languages. They are particularly useful in applications like syntax analysis and compiler design, where understanding the context of symbols is crucial for accurate interpretation.