Meaning in Syntax

In a previous lecture we gave meaning to a formal language by mapping it to a structure we were familiar with, in our case the natural numbers or a computing machine.

Is there way of capturing the meaning that resides in the mapping

[[โˆ’]] by staying completely on the syntactic side?

Obviously impossible?

Yes, when we think eg about sending DNA into outer space. Even if a superintelligence would discover our DNA, they would not be able to learn much about us from it. The meaning of DNA relies on a sophisticated environment surrounding it.

But maths could be different. I believe we have some evidence that the maths is the same throughout the universe. So there is some hope to represent maths in some objective way โ€ฆ I am speculating here and we can come back to the question later โ€ฆ

But the speculations of the previous paragraph are relevant to our endeavour of making machines perform meaningful tasks: How do we make machines perform meaningful tasks, if the machines cannot understand the meaning of what they should do? The basic idea is that we make the machines follow rules that are clearly specified. But then the question is: How do we make sure that the rules capture what we mean? One big idea tackling this question is our topic here.

To simplify the big question, let us concentrate on one example:

Can we capture the maths of numbers by pure syntax? [1]

Let us recall the formal language [2]

โ€‹โ€‹โ€‹โ€‹    exp ::= num | exp + 1 | exp + exp | exp * exp

and its semantics

[[โˆ’]]:Lโ†’N

which maps an expression to the corresponding number. For example,

(1+1)+1 and
1+(1+1)
are mapped the same number 3, but are different expressions.

We will now revisit our discussion of syntax, semantics, soundness, complete in the light of what we learned about equivalence relations. The crux of the matter is the following

Exercise:

  • Let

    f:Aโ†’B be a function. Show that
    aโ‰กaโ€ฒ =def f(a)=f(aโ€ฒ)

    defines an equivalence relation, the equivalence relation induced by
    f
    .

  • Show that if

    f is onto, then the induced function
    A/โ‰กโ†’B
    is a bijection.

Why is it important to know that we get a bijection? Because this says that there is a perfect correspondence (one-to-one and onto) between

A/โ‰ก and
B
. In other words, up to naming conventions,
A/โ‰ก
are exactly the same
B
sets.

We now apply this to the meaning-function

[[โˆ’]]:Lโ†’N

and we see that the set

L/โ‰ก of equivalence classes is, up to renaming of the elements, the same as
N
.

In other words, if we are able to describe

โ‰ก by a set of rules, then we have captured the semantics
N
by pure syntax, amenable to computations by a machine.

So can we describe

โ‰ก by a set of rules?

Yes, we can!

Because โ€ฆ the equivalence relation induced by

[[โˆ’]] is given by the familiar equations

X+(Y+Z)โ‰ˆ(X+Y)+ZXโ‹…1โ‰ˆXXโ‹…(Y+Z)โ‰ˆXโ‹…Y+Xโ‹…ZXโ‹…(Yโ‹…Z)โ‰ˆ(Xโ‹…Y)โ‹…ZX+Yโ‰ˆY+XXโ‹…Yโ‰ˆYโ‹…X

Question: Are all equations above needed? Is there one missing?

Remark: In the discrete maths lecture we not only learned about equivalence relations but emphasised equivalence relations that are the equivalence closure

โ†”โˆ— of a "one-step-computation" relation
โ†’
. During the next lectures, we will investigate when such a relation can be used to "rewrite to unique normal form". This is important: If every equivalence class has a unique normal form, then this normal form can be used to represent every element in the class. For example, write
n
for the normal form of the equivalence class of elements
e
such that
[[e]]=3
. We then can identify
n
with
3
, or, in other words, we can consider
n
just as a different notation, or encoding, of 3 itself. Thus, as a slogan, what was syntax has become semantics. We have found meaning in syntax.


  1. Of course, everybody who has ever used a calculator knows that the answer is yes. But let us forget for a moment that we know the answer in this example. Let us start thinking from scratch and discover a big idea that also applies to much more difficult examples. โ†ฉ๏ธŽ

  2. I slightly simplified the grammar by putting everything in one line. It is safe to ignore this difference for the current discussion. โ†ฉ๏ธŽ