Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[p4-feedback] Why does the expression editor remove essential parentheses?

S Essaid sielists at gmail.com
Sun Apr 26 17:21:02 PDT 2009


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
http://www.w3.org/TR/2009/WD-owl2-manchester-syntax-20090421/#Descriptions
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 
http://www.webont.org/owled/2006/acceptedLong/submission_9.pdf

> 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
https://mailman.stanford.edu/pipermail/p4-feedback/2007-May/000108.html
but I didn't find a bug report for it.

Thanks,
Shahim

> 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 depends
> 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 expression
> as you typed it until it is restarted.
>
> Nick
>   




More information about the p4-feedback mailing list