* src/tgba/dictunion.cc (tgba_bdd_dict_union): Clone formulae

while building new dictionary.
* src/tgbatest/ltlprod.test, src/tgbatest/ltlprod.cc: New files.
* src/tgbatest/Makefile.am (check_PROGRAMS): Add ltlprod.
(ltlprod_SOURCES): New variable.
(TESTS): Add ltlprod.test.
This commit is contained in:
Alexandre Duret-Lutz 2003-06-06 13:23:04 +00:00
parent 3991a51a17
commit 4472a29227
6 changed files with 92 additions and 5 deletions

View file

@ -1,5 +1,6 @@
#include <set>
#include "dictunion.hh"
#include "ltlvisit/clone.hh"
#include <bdd.h>
#include <cassert>
@ -9,8 +10,6 @@ namespace spot
tgba_bdd_dict
tgba_bdd_dict_union(const tgba_bdd_dict& l, const tgba_bdd_dict& r)
{
tgba_bdd_dict res;
std::set<const ltl::formula*> now;
std::set<const ltl::formula*> var;
std::set<const ltl::formula*> prom;
@ -49,21 +48,26 @@ namespace spot
// Next BDD variable to use.
int v = 0;
tgba_bdd_dict res;
std::set<const ltl::formula*>::const_iterator f;
for (f = prom.begin(); f != prom.end(); ++f)
{
clone(*f);
res.prom_map[*f] = v;
res.prom_formula_map[v] = *f;
++v;
}
for (f = var.begin(); f != var.end(); ++f)
{
clone(*f);
res.var_map[*f] = v;
res.var_formula_map[v] = *f;
++v;
}
for (f = now.begin(); f != now.end(); ++f)
{
clone(*f);
res.now_map[*f] = v;
res.now_formula_map[v] = *f;
v += 2;