Add a visitor to relabel the atomic proposition in formulas.

* src/ltlvisit/relabel.cc, src/ltlvisit/relabel.hh: New files.
* src/ltlvisit/Makefile.am: Add them.
* src/ltlvisit/clone.cc (recurse): Don't call clone(), nobody
needs that.  Instead, really recurse.
* src/bin/ltlfilt.cc: Add a --relabel option.
* src/bin/genltl.cc: Relabel formulas if --lbt is used.
* src/sanity/style.test: Tweak detection of i++.
This commit is contained in:
Alexandre Duret-Lutz 2012-09-16 21:30:54 +02:00
parent 1a84c17ece
commit d9dc1f489d
7 changed files with 204 additions and 4 deletions

View file

@ -91,6 +91,7 @@
#include <cstring>
#include "ltlast/allnodes.hh"
#include "ltlenv/defaultenv.hh"
#include "ltlvisit/relabel.hh"
using namespace spot;
using namespace spot::ltl;
@ -820,6 +821,15 @@ output_pattern(int pattern, int n)
error(100, 0, "internal error: pattern not implemented");
}
// Make sure we use only "p42"-style of atomic propositions
// in lbt's output.
if (output_format == lbt_output)
{
const spot::ltl::formula* r = spot::ltl::relabel(f, spot::ltl::Pnn);
f->destroy();
f = r;
}
output_formula(f);
f->destroy();
}