Languages

Our concept of language is an abstraction of the concept of a natural language.

Language Concepts and Notation

alphabet, denoted by languages1.jpg
a nonempty set of symbols

By convention, we use lowercase letters a, b, c, ... to represent elements of languages2.jpg .

For example, languages3.jpg

strings
finite sequences of symbols from the alphabet

By convention, we use lowercase letters ..., u, v, w, x, y, z to represent strings.

For example, languages4.jpg is a string from the above alphabet.

concatenation of strings u and v
appending the symbols of v to the right end (i.e., after) the symbols of u, denoted by uv

If languages5.jpg and languages6.jpg , then languages7.jpg

reverse of a string w, denoted by languages8.jpg .
string with same symbols, but with the order reversed

If languages9.jpg , then languages10.jpg .

length of a string w, denoted by languages11.jpg
the number of symbols in string w

empty string, denoted by languages12.jpg
the string with no symbols, languages13.jpg

The empty string is the identity element for concatenation, languages14.jpg

substring of a string w
any string of consecutive symbols in w

If languages15.jpg , then the substrings are languages16.jpg .

If w = vu, then v is a prefix of w; u is a suffix.

languages17.jpg , for any string w and languages18.jpg
denotes n repetitions of string (or symbol) w

If languages19.jpg , then the prefixes are languages20.jpg .

languages21.jpg , for alphabet languages22.jpg
denotes the set of all strings obtained by concatenating zero or more symbols from the alphabet

languages23.jpg

language
a subset of languages24.jpg , for some alphabet languages25.jpg

sentence of some language L
any string from L (i.e., from languages26.jpg )

Example Languages

Let languages27.jpg .

Operations on Languages

Languages are represented as sets. Operations on languages can be defined in terms of set operations.

union, intersection, and difference
directly as matching operations on sets

complementation with respect to languages33.jpg
languages34.jpg

reverse
languages35.jpg -- reverse all strings

concatenation
languages36.jpg

languages37.jpg
L concatenated with itself n times

languages38.jpg and languages39.jpg

star-closure
languages40.jpg

positive closure
languages41.jpg

Language Operation Examples

Let languages42.jpg .

How would we express in languages46.jpg and languages47.jpg ?

Although set notation is useful, it is not a convenient notation for expressing complicated languages.


[Next]


Copyright © 1998, H. Conrad Cunningham
Last modified: 27 August 1998.