Add support for PSL's non-length-matching And.

* src/ltlast/multop.cc, src/ltlast/multop.hh: Declare AndNML
operator.
* src/ltlparse/ltlscan.ll: Distinguish "&" and "&&".
* src/ltlparse/ltlparse.yy: Handle them both as "And" for LTL
formula, use AndNML or And for rational expressions.
* src/ltlvisit/tostring.cc: Adjust to distinguish "&" and "&&" in
rational expressions. Also use {braces} to group rational
expressions.
* src/tgbaalgos/ltl2tgba_fm.cc
(ratexp_trad_visitor::ratexp_trad_visitor): Remove the possibility
to select the empty_word should act like true, and fix the rules
for Closure and NegClosure to rely on constant_term instead.
(ratexp_trad_visitor::visit) Adjust the And translation to also
support AndNML.
(ratexp_trad_visitor::recurse_and_concat): Introduce this new
method to simplify some calls to recurse(f, to_concat_).
* src/tgbatest/ltl2tgba.test: Add more test cases.
* src/ltlvisit/basicreduce.cc, src/ltlvisit/consterm.cc,
src/ltlvisit/contain.cc, src/ltlvisit/mark.cc,
src/ltlvisit/nenoform.cc, src/ltlvisit/syntimpl.cc,
src/tgba/formula2bdd.cc, src/tgbaalgos/eltl2tgba_lacim.cc,
src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_lacim.cc: Add
missing cases in switches.
This commit is contained in:
Alexandre Duret-Lutz 2010-03-10 11:05:41 +01:00
parent 1ecc6984d3
commit bbb645e1fc
17 changed files with 238 additions and 100 deletions

View file

@ -78,7 +78,8 @@ using namespace spot::ltl;
%token START_RATEXP "RATEXP start marker"
%token PAR_OPEN "opening parenthesis" PAR_CLOSE "closing parenthesis"
%token BRACE_OPEN "opening brace" BRACE_CLOSE "closing brace"
%token OP_OR "or operator" OP_XOR "xor operator" OP_AND "and operator"
%token OP_OR "or operator" OP_XOR "xor operator"
%token OP_AND "and operator" OP_SHORT_AND "short and operator"
%token OP_IMPLIES "implication operator" OP_EQUIV "equivalent operator"
%token OP_U "until operator" OP_R "release operator"
%token OP_W "weak until operator" OP_M "strong release operator"
@ -103,7 +104,7 @@ using namespace spot::ltl;
%left OP_IMPLIES OP_EQUIV
%left OP_OR
%left OP_XOR
%left OP_AND
%left OP_AND OP_SHORT_AND
/* LTL operators. */
%left OP_U OP_R OP_M OP_W
@ -257,7 +258,13 @@ rationalexp: booleanatom
| rationalexp OP_AND rationalexp
{ $$ = multop::instance(multop::And, $1, $3); }
| rationalexp OP_AND error
{ missing_right_binop($$, $1, @2, "and operator"); }
{ missing_right_binop($$, $1, @2,
"length-matching and operator"); }
| rationalexp OP_SHORT_AND rationalexp
{ $$ = multop::instance(multop::AndNLM, $1, $3); }
| rationalexp OP_SHORT_AND error
{ missing_right_binop($$, $1, @2,
"non-length-matching and operator"); }
| rationalexp OP_OR rationalexp
{ $$ = multop::instance(multop::Or, $1, $3); }
| rationalexp OP_OR error
@ -318,6 +325,10 @@ subformula: booleanatom
{ $$ = multop::instance(multop::And, $1, $3); }
| subformula OP_AND error
{ missing_right_binop($$, $1, @2, "and operator"); }
| subformula OP_SHORT_AND subformula
{ $$ = multop::instance(multop::And, $1, $3); }
| subformula OP_SHORT_AND error
{ missing_right_binop($$, $1, @2, "and operator"); }
| subformula OP_OR subformula
{ $$ = multop::instance(multop::Or, $1, $3); }
| subformula OP_OR error