Search Mailing List Archives
[p4-feedback] Why does the expression editor remove essential parentheses?
nick.drummond at cs.manchester.ac.uk
Tue Apr 28 07:48:16 PDT 2009
Yes, the description editor treats OR as higher precedence.
The parser used is the OWL API Manchester Syntax parser and is not
consistent with the Manchester OWL Syntax BNF and paper.
I'll raise this with Matthew and see if we can come to an agreement about
which should hold.
2009/4/27 S Essaid <sielists at gmail.com>
> Hi Nick,
> I just came across this same issue. If I understood your previous post
> correctly you are saying that OR has a higher precedence than AND but my
> understanding is the opposite. The description editor is behaving as if
> OR has a higher precedence than AND but this is not what the Manchester
> syntax says. Is this discrepancy intentional or am I misunderstanding
> the syntaxes?
> The current W3 BNF for the syntax
> shows that A AND B OR C will be first parsed as (A AND B) OR (C) instead
> of the other way around (A) AND (B OR C) (the way the description editor
> is parsing the text).
> The precedence order is described more clearly in your paper about the
> Manchester syntax "The Manchester OWL Syntax" at
> > Precedence The Manchester OWL Syntax encourages the minimisation of the
> > number of brackets that are used. This is achieved using operator
> > precedence for
> > class descriptions. The following list summarises operator precedence
> > – operators
> > are shown from highest precedece to lowest precedence.
> > – SOME, ALL, VALUE, MIN, MAX, EXACTLY, THAT
> > – NOT
> > – AND
> > – OR
> This was described as a bug in this post
> but I didn't find a bug report for it.
> > Hi Patrick,
> > I just looked at this and I think the issue is just the rendering. Or
> > appears to have greater precedence than and in the Man Syntax.
> > A and B or C is parsed as
> > A and (B or C)
> > We should probably retain the brackets to make this clearer (as it
> > what your background is whether this is intuitive - C has && as higher
> > precedence for example).
> > The reason the rendering changes on a reload is p4 remembers the
> > as you typed it until it is restarted.
> > Nick
> p4-feedback mailing list
> p4-feedback at lists.stanford.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the p4-feedback