I base denotational definitions on the notion of matching patterns. In this I owe a debt to modern descriptions of language (and how it means things) and to some of the more subtle programming languages.

In discussing what amounts to the parsing of text, I'll be discussing a text to which context gives a reading and describing enough presumptions about how that works to give a framework in which to introduce one formalism for associating meaning to fragments of such a text. I'll do that using English sentences (which I do not formally describe) and then use this formalism to introduce some denotational definitions, involving brackets, punctuation and (rather crude) arrows, among other forms. The denotations thus defined form the foundation of the denotational toolkit with which I intend to say enough mathematics to see how to do some interesting physics. Aside from this page and the denotations for lists, I think the only denotational definitions I'll be doing will be namings and binary operators.

Matching Patterns

I consider now a particular kind of denotational definition, which I'll be using later. This specifies a pattern, possibly some constraints and a reading for any text which matches the pattern (subject to relevant constraints) in terms of values as which we know how to read various parts of the text recognised by the pattern. Now let's slow that sentence down a bit.

One easy pattern is noun verb noun. In this, verb, say, stands for a portion of text for which context supplies a reading as a verb: in the opening sentence of this paragraph, the word is is such a fragment of text. Likewise, the fragment of text may be several words, as One easy pattern has a reading as a noun. A more general pattern might involve some explicit tokens - typically punctuators, such as ( and ), but sometimes words also - to be supplied as given. I'll distinguish these, where they appear in patterns, by putting them into bold font: tokens which are to be replaced by suitable texts will be in italic.

If fragments of text with suitable readings are substituted in place of the tokens in a pattern, leaving only the explicit tokens, the resulting text is said to match the pattern: indeed, the opening sentence of this paragraph matches the pattern it offers, if we recognise a sample text as a kind of noun. The mapping between tokens in the pattern and texts with appropriate meanings is described as a match of the whole text to the pattern. Given a match of a text to the pattern: I'll refer to the sub-text of it which replaced a given token in the pattern as matching that token.

There could, in principle, be several matches of a text to a pattern: a denotational definition should aim to ensure that where this happens it; either gives the same reading to the text, as a whole, for any match; or provides an unambiguous basis for chosing which match to prefer. Quite commonly, however, such conflicts are avoided altogether by use of (implicit) nesting rules: all the denotations I introduce involving ( { [ brackets ] } ) of various kinds involve them in () matched {} pairs [] - for example, mapping ( value ) - so any brackets openend in the sub-text matching value are closed by ones in that sub-text. Thus there can be no doubt about which of the available closing brackets, in a given text, matches any given opening bracket.

Written by Eddy.