4Theory of Formal Languages

4Theory of Formal Languages - What kind of grammar is...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Theory of Formal Languages A language is a (perhaps infinite) set of strings of terminal symbols. A grammar of a language L is a finite set of rules that generates all and only the terminal strings (strings containing only terminal symbols) of L. In generating a terminal string of L, the grammar of L generates a number of intermediate strings containing some nonterminal symbols. Consider a language consisting of symbol strings of the following sort: ab, aabb, aaabbb, aaaabbbb, …
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: What kind of grammar is needed to do this? Convention: Rules are of the form string a-> string b where the string on the left consists of one or more symbols and the string on the right consists of one or more symbols, and -> means rewrite as. Grammar for the above mirror-image language: S -> ab S -> aSb Lower-case = terminal symbols Upper-case = nonterminal symbols S S S a a a b b b Additional conventions Types of grammars...
View Full Document

This note was uploaded on 08/12/2008 for the course PSY 387R taught by Professor Diehl during the Spring '07 term at University of Texas at Austin.

Page1 / 2

4Theory of Formal Languages - What kind of grammar is...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online