tl: fix handling of f##[0:0]g, and of ##[0:n]g

The first issue was reported by Victor Khomenko.

* spot/tl/formula.cc: Introduce a single-argument
version of sugar_delay().
* spot/parsetl/parsetl.yy: Use it.
* doc/tl/tl.tex, spot/tl/formula.hh: Adjust doc.
* tests/core/ltlfilt.test, tests/core/sugar.test: More tests.
This commit is contained in:
Alexandre Duret-Lutz 2019-05-20 20:59:33 +02:00
parent 66a3b6f7cb
commit 90a88d0b5a
6 changed files with 58 additions and 13 deletions

View file

@ -541,8 +541,7 @@ sere: booleanatom
| sere OP_FUSION error
{ missing_right_binop($$, $1, @2, "fusion operator"); }
| OP_DELAY_N sere
{ $$ = formula::sugar_delay(formula::tt(), formula($2),
$1, $1).to_node_(); }
{ $$ = formula::sugar_delay(formula($2), $1, $1).to_node_(); }
| OP_DELAY_N error
{ missing_right_binop($$, fnode::tt(), @1, "SVA delay operator"); }
| sere OP_DELAY_N sere
@ -557,7 +556,7 @@ sere: booleanatom
error_list.emplace_back(@1, "reversed range");
std::swap($1.max, $1.min);
}
$$ = formula::sugar_delay(formula::tt(), formula($2),
$$ = formula::sugar_delay(formula($2),
$1.min, $1.max).to_node_();
}
| delayargs error