Commit 2665b578 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

relabel: do not unregister old AP that are also new

Reported by Ayrat Khalimov against the trans.html page when using

* spot/twaalgos/ Here.
* tests/core/ltl3dra.test: Test it.
* NEWS: Mention it.
* THANKS: Add Ayrat.
parent 70064d0b
......@@ -13,6 +13,10 @@ New in spot 2.0.2a (Not yet released)
* The generalized testing automata displayed by the on-line
translator were incorrect (those output by ltl2tgta were OK).
* ltl2tgta should not offer options --ba, --monitor, --tgba and such.
* the relabel() function could incorrectly unregister old atomic
propositions even if they are still used in the output (e.g., if
a&p0 is relabeled to p0&p1). This could cause ltldo and on-line
translator to report errors.
New in spot 2.0.2 (2016-06-17)
......@@ -2,6 +2,7 @@ We are grateful to these people for their comments, help, or
Akim Demaille
Ayrat Khalimov
Caroline Lemieux
Christian Dax
Christopher Ziegler
......@@ -27,6 +27,7 @@ namespace spot
bddPair* pairs = bdd_newpair();
auto d = aut->get_dict();
std::vector<int> vars;
std::set<int> newvars;
for (auto& p: *relmap)
......@@ -34,10 +35,15 @@ namespace spot
int newv = aut->register_ap(p.second);
bdd_setpair(pairs, oldv, newv);
for (auto& t: aut->edges())
t.cond = bdd_replace(t.cond, pairs);
// Erase all the old variable that are not reused in the new set.
// (E.g., if we relabel a&p0 into p0&p1 we should not unregister
// p0)
for (auto v: vars)
if (newvars.find(v) == newvars.end())
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Laboratoire de Recherche et
# Copyright (C) 2015, 2016 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# This file is part of Spot, a model checking library.
......@@ -35,3 +35,9 @@ ltlcross 'ltl2tgba' 'ltl3dra' -f '(<>((((p0) &&
&& ([](p3))) || ((p1) && (!([](p3)))))))) || ((!(p0)) && ([](((!(p1))
&& ([](p3))) || ((p1) && (!([](p3))))))))) && (((p0) && (!(<>(p2))))
|| ((!(p0)) && (<>(p2)))))))'
# This used to trigger an assertion because the formula "a=0"&p0 was
# relabeled p0&p1, and then p0 was unregistered despite being one of
# the new variables.
ltldo ltl3dra -f '"a=0" & p0' | grep 'AP: 2.*p0'
Supports Markdown
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