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 DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 withprimitive 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
 Spring '09
 Staff

Click to edit the document details