Skip to main content Accessibility help
×
Hostname: page-component-7479d7b7d-767nl Total loading time: 0 Render date: 2024-07-12T02:26:34.247Z Has data issue: false hasContentIssue false

7 - Typechecking

from PART I - BASIC TOPICS

Published online by Cambridge University Press:  05 July 2014

Haruo Hosoya
Affiliation:
University of Tokyo
Get access

Summary

Typechecking is a static analysis on programs that enables the detection of potential dynamic type errors. Since it is already a standard technique in programming languages and since XML's schemas are analogous to data types in programming languages, we might expect existing typechecking techniques to be usable also for the verification of XML processing programs. However, a concrete analysis algorithm must be renewed entirely since schemas have a mathematical structure completely different from conventional data types. In this chapter, we first overview various approaches to XML typechecking and then consider, as a case study, a core of the XDuce type system in detail.

Compact taxonomy

Since the aim of typechecking is the rejection of possibly incorrect programs, it is a language feature clearly visible to the user. Therefore, in constructing a typechecker we must take into account not only the internal analysis algorithm but also the external specification, which further influences the design of the whole language.

The first design consideration is the kind of type error that should be detected. That is, what sort of type error should be raised from a program in the target language? The most typical kind of error occurs when the final result does not conform to the specified “output type.” However, some languages also check intermediate results against types. For example, the XDuce language has a pattern match facility, according to which a match error occurs when a form of conformance test on an intermediate result fails (Section 5.1).

Type
Chapter
Information
Foundations of XML Processing
The Tree-Automata Approach
, pp. 71 - 90
Publisher: Cambridge University Press
Print publication year: 2010

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.

  • Typechecking
  • Haruo Hosoya, University of Tokyo
  • Book: Foundations of XML Processing
  • Online publication: 05 July 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9780511762093.008
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.

  • Typechecking
  • Haruo Hosoya, University of Tokyo
  • Book: Foundations of XML Processing
  • Online publication: 05 July 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9780511762093.008
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.

  • Typechecking
  • Haruo Hosoya, University of Tokyo
  • Book: Foundations of XML Processing
  • Online publication: 05 July 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9780511762093.008
Available formats
×