Commit 876f8c90 authored by Thomas Badie's avatar Thomas Badie
Browse files

Create the direct simulation.

* src/tgbaalgos/simulation.cc, src/tgbaalgos/simulation.hh: New files.
* src/tgbaalgos/Makefile.am: Add the new files to the compilation.
* src/tgbatest/spotlbtt.test: Add the simulation.
* src/tgbatest/ltl2tgba.cc: Add direct simulation (-RSD).
parent e75ad574
......@@ -57,6 +57,7 @@ tgbaalgos_HEADERS = \
scc.hh \
sccfilter.hh \
se05.hh \
simulation.hh \
stats.hh \
tau03.hh \
tau03opt.hh \
......@@ -93,6 +94,7 @@ libtgbaalgos_la_SOURCES = \
scc.cc \
sccfilter.cc \
se05.cc \
simulation.cc \
stats.cc \
tau03.cc \
tau03opt.cc \
......
This diff is collapsed.
// -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#ifndef SPOT_TGBAALGOS_SIMULATION_HH
# define SPOT_TGBAALGOS_SIMULATION_HH
namespace spot
{
class tgba;
/// \addtogroup tgba_reduction
/// @{
/// \brief Tries to reduce the automaton by merging states whose
/// recognizes similar language.
///
/// When the language recognized by one state is included in the
/// language recognized by an another one, the first one is merged
/// with the second. The algorithm is based on the following
/// paper:
///
/// \verbatim
/// @InProceedings{ etessami.00.concur,
/// author = {Kousha Etessami and Gerard J. Holzmann},
/// title = {Optimizing {B\"u}chi Automata},
/// booktitle = {Proceedings of the 11th International Conference on
/// Concurrency Theory (Concur'00)},
/// pages = {153--167},
/// year = {2000},
/// editor = {C. Palamidessi},
/// volume = {1877},
/// series = {Lecture Notes in Computer Science},
/// address = {Pennsylvania, USA},
/// publisher = {Springer-Verlag}
/// }
/// \endverbatim
///
/// \param automaton The automaton to simulate.
/// \return a new automaton which is at worst a copy of the received
/// one.
tgba* simulation(const tgba* automaton);
/// @}
} // End namespace spot.
#endif // !SPOT_TGBAALGOS_SIMULATION_HH
......@@ -63,6 +63,7 @@
#include "tgbaalgos/emptiness_stats.hh"
#include "tgbaalgos/scc.hh"
#include "kripkeparse/public.hh"
#include "tgbaalgos/simulation.hh"
std::string
ltl_defs()
......@@ -339,6 +340,9 @@ main(int argc, char** argv)
spot::timer_map tm;
bool use_timer = false;
bool assume_sba = false;
bool reduction_dir_sim = false;
spot::tgba* temp_dir_sim = 0;
for (;;)
{
......@@ -621,6 +625,10 @@ main(int argc, char** argv)
{
reduc_aut |= spot::Reduce_quotient_Dir_Sim;
}
else if (!strcmp(argv[formula_index], "-RSD"))
{
reduction_dir_sim = true;
}
else if (!strcmp(argv[formula_index], "-R1t"))
{
reduc_aut |= spot::Reduce_transition_Dir_Sim;
......@@ -958,10 +966,22 @@ main(int argc, char** argv)
else
{
a = minimized;
// When the minimization succeed, simulation is useless.
reduction_dir_sim = false;
assume_sba = true;
}
}
if (reduction_dir_sim)
{
tm.start("Reduction w/ direct simulation");
temp_dir_sim = spot::simulation(a);
a = temp_dir_sim;
tm.stop("Reduction w/ direct simulation");
}
unsigned int n_acc = a->number_of_acceptance_conditions();
if (echeck_inst
&& degeneralize_opt == NoDegen
......@@ -999,6 +1019,8 @@ main(int argc, char** argv)
// pointless.
}
spot::tgba_reduc* aut_red = 0;
if (reduc_aut != spot::Reduce_None)
{
......@@ -1379,6 +1401,7 @@ main(int argc, char** argv)
delete state_labeled;
delete to_free;
delete echeck_inst;
delete temp_dir_sim;
}
else
{
......
......@@ -154,7 +154,7 @@ Algorithm
{
Name = "Spot (Couvreur -- FM), post reduction with direct simulation"
Path = "${LBTT_TRANSLATE}"
Parameters = "--spot '../ltl2tgba -R1q -R1t -F -f -t'"
Parameters = "--spot '../ltl2tgba -R1q -R1t -R3 -r4 -F -f -t'"
Enabled = yes
}
......@@ -222,6 +222,40 @@ Algorithm
Enabled = yes
}
Algorithm
{
Name = "Spot (Couvreur -- FM), simulated"
Path = "${LBTT_TRANSLATE}"
Parameters = "--spot '../ltl2tgba -F -f -t -RSD -r4 -R3'"
Enabled = yes
}
Algorithm
{
Name = "Spot (Couvreur -- LaCim), simulated"
Path = "${LBTT_TRANSLATE}"
Parameters = "--spot '../ltl2tgba -F -f -l -t -RSD -r4 -R3'"
Enabled = yes
}
Algorithm
{
Name = "Spot (Couvreur -- TAA), simulated"
Path = "${LBTT_TRANSLATE}"
Parameters = "--spot '../ltl2tgba -F -f -l -taa -t -RSD -r4 -R3'"
Enabled = yes
}
Algorithm
{
Name = "Spot (Couvreur -- FM), simulated and degeneralized on states."
Path = "${LBTT_TRANSLATE}"
Parameters = "--spot '../ltl2tgba -F -f -t -RSD -DS'"
Enabled = yes
}
Algorithm
{
Name = "Spot (Couvreur -- FM), degeneralized on states"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment