Add trivial identities for &&, <>->, []-> and Boolean arguments.
* src/ltlast/binop.cc (EConcat, UConcat): Rewrite "{b}<>-> f"
as "b && f", and rewrite "{b}[]->f" as "b->f".
* src/ltlast/binop.hh (binop::instance): Document trivial
identities for <>-> and []->.
* src/ltlast/multop.cc (multop::instance): Rewrite "b1 & b2"
as "b1 && b2" when b1 and b2 are Boolean.
(multop::multop): Always disable is.boolean for AndNLM.
* src/ltlast/multop.hh: Document the rewriting.
* src/ltltest/equals.cc: Show the two formulas if the exit_code
is 1, to help debugging.
* src/ltltest/equals.test: Add more tests.
* src/ltltest/kind.test: Adjust tests.
This commit is contained in:
parent
0e4e2a79b2
commit
a2da5184b5
7 changed files with 63 additions and 13 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright (C) 2008, 2009, 2010 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// Copyright (C) 2008, 2009, 2010, 2011 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de
|
||||
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
|
|
@ -120,6 +120,12 @@ main(int argc, char** argv)
|
|||
|
||||
int exit_code = f1 != f2;
|
||||
|
||||
if (exit_code)
|
||||
{
|
||||
spot::ltl::dump(std::cerr, f1) << std::endl;
|
||||
spot::ltl::dump(std::cerr, f2) << std::endl;
|
||||
}
|
||||
|
||||
f1->destroy();
|
||||
f2->destroy();
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,9 @@ run 0 ../equals 'a & false & a' 'false'
|
|||
run 0 ../equals 'a | false | a' 'a'
|
||||
run 0 ../equals 'true | a | a' 'true'
|
||||
run 0 ../equals '{a*}!' '{a*}<>->1'
|
||||
run 0 ../equals '{a -> b} (c)' '(a->b)->c'
|
||||
run 0 ../equals '{a & !b}!' 'a & !b'
|
||||
run 0 ../equals '{a;[*0]}|->!Xb' 'a -> !Xb'
|
||||
|
||||
# other formulae which are not
|
||||
run 1 ../equals 'a' 'b'
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ check 'a M b' '&!xfLP'
|
|||
check 'a M 1' '&!xfLPe'
|
||||
check 'a R b' '&!xfLP'
|
||||
check '0 R b' '&!xfLPu'
|
||||
check '{a}|->!Xb' '&fP'
|
||||
check '{a}|->X!b' '&!fP'
|
||||
check '{a}|->!Gb' '&xP'
|
||||
check '{a}|->F!b' '&!xP'
|
||||
check '{a;b}|->!Xb' '&fP'
|
||||
check '{a;b}|->X!b' '&!fP'
|
||||
check '{a;b}|->!Gb' '&xP'
|
||||
check '{a;b}|->F!b' '&!xP'
|
||||
|
||||
run 0 ../consterm '1'
|
||||
run 0 ../consterm '0'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue