Commit 6380968f authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

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).
parent 957ba664
......@@ -68,8 +68,10 @@ namespace spot
is.psl_formula = false;
is.accepting_eword = false;
break;
case Closure:
case NegClosure:
is.not_marked = false;
// fall through
case Closure:
is.boolean = false;
is.ltl_formula = false;
is.eltl_formula = false;
......
......@@ -29,103 +29,6 @@ namespace spot
{
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
{
formula* result_;
......@@ -415,15 +318,5 @@ namespace spot
return v.has_mark();
}
bool
has_mark(const formula* f)
{
has_mark_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();
}
}
}
......@@ -35,8 +35,6 @@ namespace spot
formula* mark_concat_ops(const formula* f);
bool simplify_mark(formula*& f);
bool has_mark(const formula* f);
}
}
......
......@@ -1394,7 +1394,7 @@ namespace spot
*new_flag = true;
// Perform the actual translation.
v_.reset(!has_mark(f));
v_.reset(!f->is_marked());
f->accept(v_);
translated t;
t.symbolic = v_.result();
......
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