Compositional Semantics Web Laboratory

Torbjörn Lager 2002 

Compositional Semantics Web Laboratory is designed as an aid for students to explore compositional logic semantics for natural language. For an immediate demonstration of what the program does, click the Analyse button in the panel to the left. Then try the Generate button. Then go ahead and edit the grammar and/or the input string to your heart's delight!

IMPORTANT: You may need to install the Adobe SVG Viewer 3.0. CS Web Laboratory works well in Internet Explorer. Probably also in other browsers, as long as they support SVG.

Compositional Logic Semantics

Compositional logic semantics is a difficult subject, and there is no way you can learn it only from studying this short document and playing with the tool. You really have to study a proper book on the subject before you start playing with the ideas. All we can do here is to introduce the formalism we are going to use in this tool by way of a number of simple examples. It is assumed that the reader is already familiar with the subject.

A phrase structure grammar rule describes the possible modes of combination of words and/or phrases. Suppose we let S stand for sentence, NP for noun phrase, and VP for verb phrase, and that we let [S] stand for "the meaning of the sentence covered by S", [NP] for "the meaning of the noun-phrase covered by NP, and [VP] for "the meaning of the verb phrase covered by VP. Then we may write these rules as follows:

S -> NP VP: 
[S] = [NP]([VP]);

Something of the form F(A) is a function application, where a function F is applied to an argument A. The semantic rule above thus states that the meaning of the sentence is something that we get if we apply the meaning of the noun phrase to the meaning of the verb phrase. This results in a value - a semantic value - and this value is taken to be the meaning of the sentence. Now clearly, in order for this to work, the meaning of the nounphrase must be a function.

PN -> "John":
[PN] = P^P(john);

This has been a very brief introduction to compositional logic semantics. For a more thorough presentation the reader is referred to the existing literature on the subject.

Technical Information

CS Web Laboratory has been implemented in a combination of the Oz programming language, JavaScript, HTML, CSS, and Scalable Vector Graphics (SVG). Unfortunately, the reliance on SVG means that it currently only works in Internet Explorer using the Adobe ASV plugin. However, SVG is a W3C standard which many browsers can be expected to support in the near future.

Acknowledgements

Bibliography

Here is a short list of books:

  1. Patrick Blackburn and Johan Bos, Representation and Inference for Natural Language A First Course in Computational Semantics, in press