Size: 634
Comment:
|
Size: 624
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
A context-free grammar is a 4-tuple [[latex2($(V,\Sigma,R,S)$)]], where | A context-free grammar is a 4-tuple $$(V,\Sigma,R,S)$$, where |
Context Free Grammar
Def: For every ContextFreeLanguage there is a ContextFreeGrammar that generates it and a PushDownAutomata that recognizes it.
A context-free grammar is a 4-tuple $$(V,\Sigma,R,S)$$, where
- Element $$V$$$ is a finite set called the variables,
Element $$\Sigma$$ is a finite set, disjoint from latex2($V$), called the terminals,
- Element $$R$$ is a finite set of rules, with each rule being a variable and a string of variables and terminals, and
- Element $$S \in V$$ is the start variable
An example of a rule is
$$A \rightarrow aBa$$ $$B \rightarrow \epsilon$$