CSE 428: Lecture 1  

Formal Definition Programming Languages

Why formal definitions

Natural languages are full of ambiguities. An example is the phrase: This sentence in fact can be interpreted in different ways: does each boy like a different girl or do they all like the same girl?

Another example is:

Again, several meanings are possible, depending on whether  the rabbit is a pet, or a dish, or a fur...

In the human-to-human communication, ambiguities in the language are usually resolved by using additional knowledge (context, culture,...). When we deal with computers, however, we cannot pretend them to have such knowledge.  Yet we want them to understand and interpret a program according to the programmer's intentions. Therefore it is important that programming languages be defined rigorously (i.e. formally) and leave no room to ambiguity.  It is essential that all the people which deal with the language (implementers, tool-developers, users) attribute to each sentence the same meaning.

The various levels of definition of a language

There are various levels of definition:

Syntax

Static semantics

Semantics (or dynamic semantics)