Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-7drxs Total loading time: 0 Render date: 2024-07-22T13:22:21.314Z Has data issue: false hasContentIssue false

1 - Predicate Logic

Published online by Cambridge University Press:  28 January 2010

John C. Reynolds
Affiliation:
Carnegie Mellon University, Pennsylvania
Get access

Summary

In this chapter, we introduce four concepts that pervade the study of programming languages: abstract syntax, denotational semantics, inference rules, and binding. These concepts are illustrated by using them to describe a formal language that is not a programming language: predicate logic.

There are three reasons for the oddity of starting a book about programming languages by defining a logic. First, predicate logic is close enough to conventional mathematical notation that the reader's intuitive understanding is likely to be accurate; thus we will be illustrating novel concepts in a familiar setting. Second, since predicate logic has no concept of nontermination, we will be able to define its denotations in terms of ordinary sets, and postpone the more subtle topic of domains until Chapter 2. Finally, as we will see in Chapter 3, predicate logic plays a pivotal role in the formal specification of simple imperative programs.

Although the syntax and semantics of predicate logic are standard topics in logic, we will describe them in the terminology of programming languages: The types of phrases that a logician would call “terms” and “well-formed formulas” we will call “integer expressions” (abbreviated by “intexp”) and “assertions” (abbreviated by “assert”) respectively. Similarly, “assignments” will be called “states”. Moreover, we will usually interpret the operators used to construct terms in a fixed way, as the familiar operations of integer arithmetic.

Abstract Syntax

It is possible to specify the syntax of a formal language, such as predicate logic or a programming language, by using a context-free grammar (often called BNF or Backus-Naur form) and to define the semantics of the language by a function on the set of strings generated by this grammar.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 1998

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.

  • Predicate Logic
  • John C. Reynolds, Carnegie Mellon University, Pennsylvania
  • Book: Theories of Programming Languages
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626364.002
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.

  • Predicate Logic
  • John C. Reynolds, Carnegie Mellon University, Pennsylvania
  • Book: Theories of Programming Languages
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626364.002
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.

  • Predicate Logic
  • John C. Reynolds, Carnegie Mellon University, Pennsylvania
  • Book: Theories of Programming Languages
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626364.002
Available formats
×