Re: Formal semantics of language semantics

"Nick Maclaren" <nmm1@cus.cam.ac.uk>
20 Oct 2002 22:48:00 -0400

          From comp.compilers

Related articles
[9 earlier articles]
Re: Formal semantics of language semantics haberg@matematik.su.se (Hans Aberg) (2002-10-13)
Re: Formal semantics of language semantics scgupta@solomons.cs.uwm.edu (Satish C. Gupta) (2002-10-13)
Re: Formal semantics of language semantics lex@cc.gatech.edu (Lex Spoon) (2002-10-13)
Re: Formal semantics of language semantics anw@merlot.uucp (Dr A. N. Walker) (2002-10-18)
Re: Formal semantics of language semantics whopkins@alpha2.csd.uwm.edu (Mark) (2002-10-18)
Re: Formal semantics of language semantics whopkins@alpha2.csd.uwm.edu (Mark) (2002-10-18)
Re: Formal semantics of language semantics nmm1@cus.cam.ac.uk (Nick Maclaren) (2002-10-20)
Re: Formal semantics of language semantics nmm1@cus.cam.ac.uk (Nick Maclaren) (2002-10-20)
Re: Formal semantics of language semantics merlot!anw@mailbox1.ucsd.edu (Dr A. N. Walker) (2002-10-25)
Re: Formal semantics of language semantics whopkins@alpha2.csd.uwm.edu (Mark) (2002-10-25)
Re: Formal semantics of language semantics whopkins@alpha2.csd.uwm.edu (Mark) (2002-10-25)
Re: Formal semantics of language semantics nmm1@cus.cam.ac.uk (Nick Maclaren) (2002-11-06)
Re: Formal semantics of language semantics nmm1@cus.cam.ac.uk (Nick Maclaren) (2002-11-06)
[1 later articles]
| List of all articles for this month |

From: "Nick Maclaren" <nmm1@cus.cam.ac.uk>
Newsgroups: comp.compilers
Date: 20 Oct 2002 22:48:00 -0400
Organization: University of Cambridge, England
References: 02-09-149 02-09-162 02-10-005 02-10-046
Keywords: semantics
Posted-Date: 20 Oct 2002 22:48:00 EDT

Dr A. N. Walker <anw@merlot.uucp> wrote:
>Nick Maclaren <nmm1@cus.cam.ac.uk> wrote:
>>Ingo Dittmer <i.dittmer@fh-osnabrueck.de> wrote:
>>>
>>>Many. All two-level-grammars (van-Wijngarden, [...]
>>
>>Hang on. The two-level grammars that I know of DON'T handle the
>>semantics, but extend the syntax to things like the type rules. That
>>was most definitely so for the van Wijngarden grammar used in Algol
>>68, for example. [...]
>
> It is true that the van Wijngaarden grammar used to define
>Algol 68 in the RR did not attempt the semantics; but it is *also*
>true that vW grammars *can* be used to define semantics%, and, as Ingo
>said, this was being done from the '60s. I doubt whether it's
>particularly useful to do so, but that's a different problem.


Um. I am not sure. I agree that it can be used to define SOME OF
the semantics, yes. The question is whether it can be extended to
the nastier, more context-dependent and less structured aspects.
I was answering the question "Can they be used to define ALL of
the semantics?" It is possible that you and Ingo Dittmer were
answering the one "Can they be used to define ANY of the semantics?"


The aspects that I was trying to define formally were things like
aliasing rules in an Algol/Fortran/C-like language, rules requiring
complex objects to be tidied up before a function returns, or some
consistency rules on exception handling. I have never seen a language
that defined such things formally, for a sufficiently general and
practical model, nor even a book that addressed them seriously :-(


The issue with all of those is that they are inherently dynamic
and involve the interactions between a potentially unbounded and
not statically specified collection of objects.


Languages like ML attempt to avoid hand-waving, but they deal with
a lot of such problems by denying their existence. This is very
obvious in the second example I gave, where the effective language
definition starts "Assuming a perfect garbage collector, ..." The
same is true of aliasing, where they make the Algol/Fortran/C issues
'impossible', but without resolving the underlying problem. And
similarly with exception handling, where practical programmers are
dealing with necessarily unclean exceptions.




Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.