Fix the associativity of ->, <->, U, R, W, and M wrt the PSL standard.

* src/ltlparse/ltlparse.yy: Make all the above operators
right-associative.  Also let `:' have precedence over `;'.
* src/ltltest/reduccmp.test: Adjust for the `:' precedence.
* doc/tl/tl.tex, NEWS: Document this.
This commit is contained in:
Alexandre Duret-Lutz 2012-04-28 16:13:24 +02:00
parent 807dcefba4
commit ce437cd499
4 changed files with 43 additions and 45 deletions

View file

@ -111,19 +111,20 @@ using namespace spot::ltl;
/* Priorities. */
/* Low priority regex operator. */
%left OP_UCONCAT OP_ECONCAT OP_UCONCAT_NONO OP_ECONCAT_NONO
/* Low priority SERE-LTL binding operator. */
%right OP_UCONCAT OP_ECONCAT OP_UCONCAT_NONO OP_ECONCAT_NONO
%left OP_CONCAT OP_FUSION
%left OP_CONCAT
%left OP_FUSION
/* Logical operators. */
%left OP_IMPLIES OP_EQUIV
%right OP_IMPLIES OP_EQUIV
%left OP_OR
%left OP_XOR
%left OP_AND OP_SHORT_AND
/* LTL operators. */
%left OP_U OP_R OP_M OP_W
%right OP_U OP_R OP_M OP_W
%nonassoc OP_F OP_G
%nonassoc OP_X

View file

@ -263,13 +263,13 @@ for x in ../reduccmp ../reductaustr; do
run 0 $x '{a && b && d[->2..4]} <>-> d' '0'
run 0 $x '{a && { c* : b* : (g|h)*}} <>-> d' 'a & c & b & (g | h) & d'
run 0 $x '{a && {b;c}} <>-> d' '0'
run 0 $x '{a && {b;c:e}} <>-> d' '0'
run 0 $x '{a && {(b;c):e}} <>-> d' '0'
run 0 $x '{a && {b*;c*}} <>-> d' '{a && {b*|c*}} <>-> d' # until better
run 0 $x '{a && {b*;c*:e}} <>-> d' '{a && {b*|c*} && e} <>-> d' # idem
run 0 $x '{a && {(b*;c*):e}} <>-> d' '{a && {b*|c*} && e} <>-> d' # idem
run 0 $x '{a && {b*;c}} <>-> d' 'a & c & d'
run 0 $x '{a && {b*;c:e}} <>-> d' 'a & c & d & e'
run 0 $x '{a && {(b*;c):e}} <>-> d' 'a & c & d & e'
run 0 $x '{a && {b;c*}} <>-> d' 'a & b & d'
run 0 $x '{a && {b;c*:e}} <>-> d' 'a & b & d & e'
run 0 $x '{a && {(b;c*):e}} <>-> d' 'a & b & d & e'
run 0 $x '{{{b1;r1*}&&{b2;r2*}};c}' 'b1&b2&X{{r1*&&r2*};c}'
run 0 $x '{{b1:r1*}&&{b2:r2*}}' '{{b1&&b2}:{r1*&&r2*}}'
run 0 $x '{{r1*;b1}&&{r2*;b2}}' '{{r1*&&r2*};{b1&&b2}}'