Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-9q27g Total loading time: 0 Render date: 2024-07-19T04:56:02.500Z Has data issue: false hasContentIssue false

7 - Basic Concepts

Published online by Cambridge University Press:  05 June 2012

R. D. Tennent
Affiliation:
Queen's University, Ontario
Get access

Summary

Recognizing patterns in strings is ubiquitous in computing. For example, a programming-language compiler has to recognize whether input programs match the “pattern” defined by the syntax rules of the programming language. Many important software tools, such as text editors, command interpreters, and formatters, require the capability to recognize patterns in strings. In fact, any program that reads textual input from its users must implicitly test the well-formedness of that input. In the following chapters, we introduce some of the interesting concepts and techniques that may be used to address this class of applications.

Strings

In computing, the term string is normally understood to refer to finite sequences of characters drawn from a character set such as ASCII. We will find it convenient to generalize this concept slightly by allowing string components to be drawn from an arbitrary finite set, termed the alphabet or the vocabulary.

Definition 7.1 If Σ is any finite set, a string over Σ is any finite sequence of elements of Σ.

Strings may also be termed words or sentences. String components (i.e., elements of Σ) might be termed, depending on the context, characters, tokens, symbols, atoms, or generators. If Σ is the ASCII character set, a string over Σ is exactly what is normally considered to be a string. But if we are discussing the syntax of a programming language, the relevant vocabulary might be a set of lexical tokens, ignoring, at this level of abstraction, the substructure of multiple-character tokens such as <=.

Type
Chapter
Information
Specifying Software
A Hands-On Introduction
, pp. 159 - 168
Publisher: Cambridge University Press
Print publication year: 2002

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Basic Concepts
  • R. D. Tennent, Queen's University, Ontario
  • Book: Specifying Software
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139164900.012
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Basic Concepts
  • R. D. Tennent, Queen's University, Ontario
  • Book: Specifying Software
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139164900.012
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Basic Concepts
  • R. D. Tennent, Queen's University, Ontario
  • Book: Specifying Software
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139164900.012
Available formats
×