{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

csc501-ln002

# csc501-ln002 - String Rewriting Systems The first step in...

This preview shows pages 1–5. Sign up to view the full content.

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: String Rewriting Systems The first step in exploring the formal aspects of programming languages is the definition of their structure or syntax . In order to accomplish this we will use a formal system known as String Rewriting System (SRS). We begin with the definition of strings over an alphabet. String Rewriting Systems Definition: [Strings over an Alphabet] 1 A finite, nonempty set will be called an alphabet if its elements are symbols , or characters (i.e., elements with“primitive” graphical representations). A finite sequence of symbols from a given alphabet will be called a string over the alphabet . A string that consists of a sequence a 1 , a 2 , . . . , a n of symbols will be denoted by the juxtaposition a 1 a 2 . . . a n . The length of some string s is denoted by | s | and assumed to equal the number of symbols in the string. Strings that have zero symbols, called empty strings , will be denoted by with | | = 0. 1 Based on material from the book “An Introduction to the Theory of Computation,” Eitan Gurari, Ohio State University,Computer Science Press, 1989. String Rewriting Systems Example: Γ 1 = { a , . . . , z } and Γ 2 = { , . . . , 9 } are alphabets. abb is a string over Γ 1 , and 123 is a string over Γ 2 . ba 12 is not a string over Γ 1 , because it contains symbols that are not in Γ 1 . Similarly, 314 . . . is not a string over Γ 2 , because it is not a finite sequence. On the other hand, is a string over any alphabet. The empty set ∅ is not an alphabet because it contains no element. The set of natural numbers is not an alphabet, because it is not finite. String Rewriting Systems Definition: [Kleene Closure] Given some alphabet Γ then the set...
View Full Document

{[ snackBarMessage ]}

### Page1 / 13

csc501-ln002 - String Rewriting Systems The first step in...

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

View Full Document
Ask a homework question - tutors are online