* src/tgbatest/spotlbtt.test: We don't check the post-reduction

with scc and delayed simulation.

* src/tgbatest/ltl2tgba.cc: Adjust parameters.
* src/tgbatest/reductgba.cc, src/tgbatest/Makefile.am: More Test.
* src/tgbaalgos/reductgba_sim_del.cc: Not finish, lot of bugs.
* src/tgbaalgos/reductgba_sim.hh, src/tgbaalgos/reductgba_sim.cc:
Remove some useless comments.
* src/tgba/tgbareduc.cc, src/tgba/tgbareduc.hh: Bug in SCC.

* src/ltlvisit/reducform.cc: Correct some bug for multop.
* src/ltltest/reduccmp.test: More Test.
* src/ltltest/reduc.cc: Thinko
* src/ltltest/equals.cc: Reduction compare
This commit is contained in:
martinez 2004-06-17 16:27:36 +00:00
parent 84e72c8764
commit c769f74750
16 changed files with 429 additions and 250 deletions

View file

@ -39,6 +39,7 @@ check_PROGRAMS = \
powerset \
readsave \
reductgba \
reduccmp \
tgbaread \
tripprod
@ -55,12 +56,15 @@ mixprod_SOURCES = mixprod.cc
powerset_SOURCES = powerset.cc
readsave_SOURCES = readsave.cc
reductgba_SOURCES = reductgba.cc
reduccmp_SOURCES = reductgba.cc
reduccmp_CXXFLAGS = -DREDUCCMP
tgbaread_SOURCES = tgbaread.cc
tripprod_SOURCES = tripprod.cc
# Keep this sorted by STRENGTH. Test basic things first,
# because such failures will be easier to diagnose and fix.
TESTS = \
reduccmp.test \
reductgba.test \
explicit.test \
tgbaread.test \

View file

@ -88,6 +88,16 @@ syntax(char* prog)
<< " -r4 reduce formula using all rules" << std::endl
<< " -rd display the reduce formula" << std::endl
<< " -R same as -r, but as a set" << std::endl
<< " -R1 use direct simulation to reduce the automata "
<< "(implies -L)"
<< std::endl
<< " -R2 use delayed simulation to reduce the automata, incorrect"
<< "(implies -L)"
<< std::endl
<< " -R3 use SCC to reduce the automata"
<< std::endl
<< " -Rd to display simulation relation"
<< std::endl
<< " -s convert to explicit automata, and number states "
<< "in DFS order" << std::endl
<< " -S convert to explicit automata, and number states "
@ -102,17 +112,7 @@ syntax(char* prog)
<< " -X do not compute an automaton, read it from a file"
<< std::endl
<< " -y do not merge states with same symbolic representation "
<< "(implies -f)" << std::endl
<< " -R1 use direct simulation to reduce the automata "
<< "(implies -L)"
<< std::endl
<< " -R2 use delayed simulation to reduce the automata, incorrect"
<< "(implies -L)"
<< std::endl
<< " -R3 use SCC to reduce the automata"
<< std::endl
<< " -Rd to display simulation relation"
<< std::endl;
<< "(implies -f)" << std::endl;
exit(2);
}
@ -393,12 +393,6 @@ main(int argc, char** argv)
to_free = a = concrete = spot::ltl_to_tgba_lacim(f, dict);
}
/*
spot::tgba* aut_red = 0;
if (reduc_aut != spot::Reduce_None)
a = aut_red = spot::reduc_tgba_sim(a, reduc_aut);
*/
spot::tgba_reduc* aut_red = 0;
if (reduc_aut != spot::Reduce_None)
{

View file

@ -45,81 +45,107 @@
void
syntax(char* prog)
{
std::cerr << prog << " option formula1" << std::endl;
#ifdef REDUCCMP
std::cerr << prog << " option file" << std::endl;
#else
std::cerr << prog << " option formula" << std::endl;
#endif
exit(2);
}
int
main(int argc, char** argv)
{
if (argc < 2)
if (argc < 3)
syntax(argv[0]);
int o = spot::ltl::Reduce_None;
switch (atoi(argv[1]))
{
case 0:
o = spot::Reduce_Scc;
break;
case 1:
o = spot::Reduce_Dir_Sim;
break;
case 2:
o = spot::Reduce_Del_Sim;
break;
case 3:
o = spot::Reduce_Dir_Sim | spot::Reduce_Scc;
break;
case 4:
o = spot::Reduce_Del_Sim | spot::Reduce_Scc;
break;
case 5:
// No Reduction
break;
default:
return 2;
}
int exit_code = 0;
spot::simulation_relation* rel = NULL;
spot::tgba* automata = NULL;
spot::tgba* aut_red = NULL;
spot::tgba_reduc* automatareduc = NULL;
spot::ltl::environment& env(spot::ltl::default_environment::instance());
spot::bdd_dict* dict = new spot::bdd_dict();
spot::ltl::parse_error_list p1;
spot::ltl::formula* f = spot::ltl::parse(argv[1], p1, env);
//std::cout << "Compute the automata" << std::endl;
#ifdef REDUCCMP
spot::tgba_parse_error_list pel;
automata = spot::tgba_parse(argv[2], pel, dict, env, false);
if (spot::format_tgba_parse_errors(std::cerr, pel))
return 2;
#else
spot::ltl::parse_error_list p1;
spot::ltl::formula* f = spot::ltl::parse(argv[2], p1, env);
if (spot::ltl::format_parse_errors(std::cerr, argv[2], p1))
return 2;
automata = spot::ltl_to_tgba_fm(f, dict,
false, true,
false, true);
#endif
//std::cout << "Display the automata" << std::endl;
spot::dotty_reachable(std::cout, automata);
//std::cout << "Initialize the reduction automata" << std::endl;
automatareduc = new spot::tgba_reduc(automata);
//aut_red = spot::reduc_tgba_sim(automata);
//std::cout << "Compute the simulation relation" << std::endl;
//rel = spot::get_direct_relation_simulation(automatareduc);
rel = spot::get_delayed_relation_simulation(automatareduc);
//rel = NULL;
//std::cout << "Display of the parity game" << std::endl;
//std::cout << "Display of the simulation relation" << std::endl;
if (rel != NULL)
automatareduc->display_rel_sim(rel, std::cout);
//std::cout << "Prune automata using simulation relation" << std::endl;
if (rel != NULL)
automatareduc->prune_automata(rel);
//automatareduc->compute_scc();
//std::cout << "Prune automata using scc" << std::endl;
//automatareduc->prune_scc();
//std::cout << "Display of scc" << std::endl;
//automatareduc->display_scc(std::cout);
if (o & spot::Reduce_Dir_Sim)
{
rel = spot::get_direct_relation_simulation(automatareduc);
automatareduc->prune_automata(rel);
}
else if (o & spot::Reduce_Del_Sim)
{
rel = spot::get_delayed_relation_simulation(automatareduc);
automatareduc->quotient_state(rel);
}
if (rel != NULL)
{
automatareduc->display_rel_sim(rel, std::cout);
spot::free_relation_simulation(rel);
}
if (o & spot::Reduce_Scc)
{
automatareduc->prune_scc();
//automatareduc->display_scc(std::cout);
}
if (automatareduc != NULL)
{
std::cout << "Display of the minimize automata" << std::endl;
std::cout << std::endl;
spot::dotty_reachable(std::cout, automatareduc);
}
if (aut_red != NULL)
delete aut_red;
if (automata != NULL)
delete automata;
if (automatareduc != NULL)
delete automatareduc;
#ifndef REDUCCMP
if (f != NULL)
spot::ltl::destroy(f);
#endif
assert(spot::ltl::atomic_prop::instance_count() == 0);
assert(spot::ltl::unop::instance_count() == 0);

View file

@ -25,24 +25,67 @@
set -e
check ()
check()
{
run 0 ./reductgba "$1"
run 0 ./reductgba "$1" "$2"
}
# We don't check the output, but just running these might be enough to
# trigger assertions.
check 'a'
check 'a U b'
check 'a U Fb'
check 'X a'
check 'a & b & c'
check 'a | b | (c U (d & (g U (h ^ i))))'
check 'Xa & (b U !a) & (b U !a)'
check 'Fa & Xb & GFc & Gd'
check 'Fa & Xa & GFc & Gc'
check 'Fc & X(a | Xb) & GF(a | Xb) & Gc'
check 'a R (b R c)'
check '(a U b) U (c U d)'
check '((Xp2)U(X(1)))*(p1 R(p2 R p0))'
# No reduction
check 0 'Fa & Xb & GFc & Gd'
check 0 'Fc & X(a | Xb) & GF(a | Xb) & Gc'
check 1 a
check 1 'a U b'
check 1 'X a'
check 1 'a & b & c'
check 1 'a | b | (c U (d & (g U (h ^ i))))'
check 1 'Xa & (b U !a) & (b U !a)'
check 1 'Fa & Xb & GFc & Gd'
check 1 'Fa & Xa & GFc & Gc'
check 1 'Fc & X(a | Xb) & GF(a | Xb) & Gc'
check 1 'a R (b R c)'
check 1 '(a U b) U (c U d)'
check 1 '((Xp2)U(X(1)))*(p1 R(p2 R p0))'
#reduction
check 1 'a U Fb'
#check 0 a
#check 0 'a U b'
#check 0 'a U Fb'
#check 3 a
#check 3 'a U b'
#check 3 'a U Fb'
#check 0 a
#check 0 'a U b'
#check 0 'a U Fb'
#check 0 'X a'
#check 0 'a & b & c'
#check 0 'a | b | (c U (d & (g U (h ^ i))))'
#check 0 'Xa & (b U !a) & (b U !a)'
#check 0 'Fa & Xb & GFc & Gd'
#check 0 'Fa & Xa & GFc & Gc'
#check 0 'Fc & X(a | Xb) & GF(a | Xb) & Gc'
#check 0 'a R (b R c)'
#check 0 '(a U b) U (c U d)'
#check 0 '((Xp2)U(X(1)))*(p1 R(p2 R p0))'
#check 3 a
#check 3 'a U b'
#check 3 'a U Fb'
#check 3 'X a'
#check 3 'a & b & c'
#check 3 'a | b | (c U (d & (g U (h ^ i))))'
#check 3 'Xa & (b U !a) & (b U !a)'
#check 3 'Fa & Xb & GFc & Gd'
#check 3 'Fa & Xa & GFc & Gc'
#check 3 'Fc & X(a | Xb) & GF(a | Xb) & Gc'
#check 3 'a R (b R c)'
#check 3 '(a U b) U (c U d)'
#check 3 '((Xp2)U(X(1)))*(p1 R(p2 R p0))'

View file

@ -94,14 +94,14 @@ Algorithm
Algorithm
{
Name = "Spot (Couvreur -- FM), post reduction"
Path = "${LBTT_TRANSLATE} --spot './ltl2tgba -R1 -R2 -F -f -t'"
Path = "${LBTT_TRANSLATE} --spot './ltl2tgba -R1 -F -f -t'"
Enabled = yes
}
Algorithm
{
Name = "Spot (Couvreur -- FM), pre + post reduction"
Path = "${LBTT_TRANSLATE} --spot './ltl2tgba -r4 -R1 -R2 -F -f -t'"
Path = "${LBTT_TRANSLATE} --spot './ltl2tgba -r4 -R1 -F -f -t'"
Enabled = yes
}