W3C home > Mailing lists > Public > public-cwm-talk@w3.org > July to September 2004

Re: Notation for sets in n3

From: Sandro Hawke <sandro@w3.org>
Date: Wed, 04 Aug 2004 12:29:17 -0400
Message-Id: <200408041629.i74GTHZa008348@roke.hawke.org>
To: Tim Berners-Lee <timbl@w3.org>
Cc: Jos De_Roo <jos.deroo@agfa.com>, Yosi Scharf <syosi@mit.edu>, public-cwm-talk@w3.org


> True.  I had been thinking that formulae were too different from lists 
> for sets to look like them - but then, formulae are indeed unordered 
> sets of statements.
> 
> { <a>, <b>, <c> }
> 
> works for me, as I also kinda expect {} for a set since high school.
> 
> Currently N3 is an LR1 language which can be predictively parsed: you 
> know which production is being expanded by looking just at the first 
> token.   This change would mess that up, in that one would have to try 
> both productions to distinguish
> 
> { <a> <b> <c> }  from  { <a> , <b>, <c> }
> 
> where <a> could be any path expression.

Yeah....   Yosi pointed that out to me yesterday.   Ugh.

I'm inclined to let the machine do the work.  Prolog DCGs and
blindfold's btyacc parser allow unlimitted lookahead, which gives you
expontial worst case performance problems, but there's no penalty in
the normal case, and I don't think this grammar ambiguity allows one
to construct a bad situation.  But it would be an obstacle to N3
spreading.

> The inelegant but effective solution to that would be
> { , <a>, <b>, <c> }
> which would be consistent with
> {,}
> as the null set and
> {,<a>}
> as a singleton set.

Is it okay to use { } as both the empty set and the empty formula?

     -- sandro
Received on Wednesday, 4 August 2004 12:27:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:01 GMT