* src/tgba/tgbabddconcretefactory.cc
(tgba_bdd_concrete_factory::~tgba_bdd_concrete_factory): destroy the formulae used as keys in prom_. (tgba_bdd_concrete_factory::create_promise): Delete. (tgba_bdd_concrete_factory::declare_promise, tgba_bdd_concrete_factory::finish): New functions. * src/tgba/tgbabddconcretefactory.hh (tgba_bdd_concrete_factory::create_promise): Delete. (tgba_bdd_concrete_factory::declare_promise, tgba_bdd_concrete_factory::finish): New functions. (tgba_bdd_concrete_factory::prom_): New map. * src/tgba/ltl2tgba.cc (ltl_trad_visitor::visit): Adjust the Fx and aUb cases to register promises with tgba_bdd_concrete_factory::declare_promise(). (ltl2tgba): Call tgba_bdd_concrete_factory::finish().
This commit is contained in:
parent
8e51474fa2
commit
725dacb4e8
4 changed files with 95 additions and 38 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "ltlast/formula.hh"
|
||||
#include "bddfactory.hh"
|
||||
#include "tgbabddfactory.hh"
|
||||
#include <map>
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
|
@ -33,15 +34,17 @@ namespace spot
|
|||
/// can be turned into BDD using ithvar().
|
||||
int create_atomic_prop(const ltl::formula* f);
|
||||
|
||||
/// Create a promise variable for formula \a f.
|
||||
/// Declare a promise.
|
||||
///
|
||||
/// \param f The formula to create a promise for.
|
||||
/// \return The variable number for this state.
|
||||
/// \param b that BDD of the expression that makes a promise
|
||||
/// \param p the formula promised
|
||||
///
|
||||
/// The promise is not created if it already exists. Instead its
|
||||
/// existing variable number is returned. Variable numbers
|
||||
/// can be turned into BDD using ithvar().
|
||||
int create_promise(const ltl::formula* f);
|
||||
/// Formula such as 'f U g' or 'F g' make the promise
|
||||
/// that 'g' will be fulfilled eventually. So once
|
||||
/// one of this formula has been translated into a BDD,
|
||||
/// we use declare_promise() to associate the promise 'g'
|
||||
/// to this BDD.
|
||||
void declare_promise(bdd b, const ltl::formula* p);
|
||||
|
||||
const tgba_bdd_core_data& get_core_data() const;
|
||||
const tgba_bdd_dict& get_dict() const;
|
||||
|
|
@ -49,9 +52,19 @@ namespace spot
|
|||
/// Add a new constraint to the relation.
|
||||
void add_relation(bdd new_rel);
|
||||
|
||||
/// \Perfom final computations before the relation can be used.
|
||||
///
|
||||
/// This function should be called after all propositions, state,
|
||||
/// promise, and constraints have been declared, and before calling
|
||||
/// get_code_data() or get_dict().
|
||||
void finish();
|
||||
|
||||
private:
|
||||
tgba_bdd_core_data data_; ///< Core data for the new automata.
|
||||
tgba_bdd_dict dict_; ///< Dictionary for the new automata.
|
||||
|
||||
typedef std::map<const ltl::formula*, bdd> promise_map_;
|
||||
promise_map_ prom_; ///< BDD associated to each promises
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue