CSCI 351
Theory of Programming Languages

Preliminaries

Get email accounts
mail to me -- amk@ecst.csuchico.edu

  1. Name
  2. Location
  3. What theory courses
  4. What mathematics courses
  5. What computer language courses

Text
Introduction to the Theory of Programming Languages, Bertrand Meyer, Prentice Hall, 1990, ISBN 0-13-498510-9

Course Description

Seminar in the definition and philosophy of grammars, contextual relationships, semantic and syntactic analysis, parsing efficiency analysis, and program verification.
If time allows, intractability and the classes of P, NP-Hard, NP-Complete.

Syllabus

  1. Abstract Syntax: Backus-Naur Form (BNF) Grammars
  2. Attribute Grammars
  3. Syntax to Semantics: Translational Semantics
  4. Operational Semantics
  5. Denotational Semantics
  6. Axiomatic Semantics
  7. Program Analysis and Verification
  8. Computational Complexity and Intractability

"Given that programming languages are strictly artificial entities created to facilitate the preparation of computer programs and the representation and communication of algortihms, their diversity, complexity, and often unfathomed depth of structure and concept are truly remarkable. After three decades of intense research and development, there is still no end in sight to the stream of useful innovations in language design and valuable theoretical insights into language structure." [Pagan] Pagan, Frank, Formal Specification of Programming Languages, Prentice-Hall, Inc., 1981.

Chapter 1: Basic Concepts

The majority of language descriptions have always been informal, i.e., expressed in a narrative form instead of using a rigorous notation.

When writing a definitive specification or standard definition of a language, the informal approaches have well-known disadvantages.

One requires formal methods if there is to be any hope of being able to write language specifications with the following qualities:

Informal specs are verbose and often vague... and none of the above :-)

"The formal descriptions discussed in this book are mathematical theories used to model and analyze the essential properties of programming languages and programs." text

Two points formal and essential:

Why do we want such precise (formal) definitions of programming languages?

  1. Help in understanding languages
    raise questions that might not be asked in informal

  2. Support for language standardization
    key to portability is standardization

  3. Guidelines for language design
    mathematical simplicity in specs provide 'clean' languages

  4. Aid in writing compilers and language systems
    formal descriptions viewed as specs of an abstract language system for that language - can lead to Automatic synthesis

  5. Support for program verification and software reliability
    proofs of programs and correctness of implementations

  6. Model for software specification
    Language reference

In the definition of a language, one requires precision and absense of ambiguity (at which mathematical techniques are particularly effective) without commitment to a particular implementation, i.e., without overspecification.

The emphasis on essential features restricts the discussion to properties that characterize programs and programming languages independently of particular implementations.

Basic categorization of the various aspects of language description:

Example: Consider the following instance of the common assignment statement:

Of course, descriptions of "variable" and "expression" would also need to be supplied...

Any kind of description or specification of a language must employ some metalanguage.

A metalanguage is any language or notation used to describe programming languages.

A formal description requires a formal metalanguage.

What we will study in this course are informal explanations of formal metalanguages and examples of their use in defining programming languages. (more later)

Mathematics vs. Programs

Imperative features: (page 6)

Referential transparency

A word of warning:
Throughout this course one will need to be careful about when one is using metalanguage and when one is using the language being defined.

Formal specifications tend to use many of the notions used for programming purposes.

Example: page 11 Case "statements"

We will define the metalanguage terminology, which uses abstract syntax, in Chapter 3 when we define the metalanguage Metanot.