Remove the has_mark() function in favor of the is_marked() method.

* src/ltlast/unop.cc (NegClosure): Reset is.not_marked.
* src/ltlvisit/mark.hh,
src/ltlvisit/mark.cc (has_mark_visitor, has_mark): Remove.
* src/tgbaalgos/ltl2tgba_fm.cc: Use f->is_marked() instead
of has_mark(f).
This commit is contained in:
Alexandre Duret-Lutz 2010-12-09 14:10:05 +01:00
parent 957ba664b7
commit 6380968f32
4 changed files with 4 additions and 111 deletions

View file

@ -68,8 +68,10 @@ namespace spot
is.psl_formula = false; is.psl_formula = false;
is.accepting_eword = false; is.accepting_eword = false;
break; break;
case Closure:
case NegClosure: case NegClosure:
is.not_marked = false;
// fall through
case Closure:
is.boolean = false; is.boolean = false;
is.ltl_formula = false; is.ltl_formula = false;
is.eltl_formula = false; is.eltl_formula = false;

View file

@ -29,103 +29,6 @@ namespace spot
{ {
namespace namespace
{ {
class has_mark_visitor : public visitor
{
bool result_;
public:
has_mark_visitor()
: result_(false)
{
}
~has_mark_visitor()
{
}
bool
result()
{
return result_;
}
void
visit(atomic_prop*)
{
}
void
visit(constant*)
{
}
void
visit(bunop*)
{
}
void
visit(unop* uo)
{
switch (uo->op())
{
case unop::NegClosure:
result_ = true;
return;
case unop::Finish:
case unop::Closure:
case unop::Not:
case unop::X:
case unop::F:
case unop::G:
return;
}
/* Unreachable code. */
assert(0);
}
void
visit(automatop*)
{
}
void
visit(multop* mo)
{
unsigned mos = mo->size();
for (unsigned i = 0; i < mos && !result_; ++i)
result_ = recurse(mo->nth(i));
}
void
visit(binop* bo)
{
switch (bo->op())
{
case binop::EConcatMarked:
result_ = true;
return;
case binop::Xor:
case binop::Implies:
case binop::Equiv:
case binop::U:
case binop::W:
case binop::M:
case binop::R:
case binop::EConcat:
case binop::UConcat:
return;
}
/* Unreachable code. */
assert(0);
}
bool
recurse(const formula* f)
{
return has_mark(f);
}
};
class simplify_mark_visitor : public visitor class simplify_mark_visitor : public visitor
{ {
formula* result_; formula* result_;
@ -415,15 +318,5 @@ namespace spot
return v.has_mark(); return v.has_mark();
} }
bool
has_mark(const formula* f)
{
has_mark_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();
}
} }
} }

View file

@ -35,8 +35,6 @@ namespace spot
formula* mark_concat_ops(const formula* f); formula* mark_concat_ops(const formula* f);
bool simplify_mark(formula*& f); bool simplify_mark(formula*& f);
bool has_mark(const formula* f);
} }
} }

View file

@ -1394,7 +1394,7 @@ namespace spot
*new_flag = true; *new_flag = true;
// Perform the actual translation. // Perform the actual translation.
v_.reset(!has_mark(f)); v_.reset(!f->is_marked());
f->accept(v_); f->accept(v_);
translated t; translated t;
t.symbolic = v_.result(); t.symbolic = v_.result();