Add support for ELTL (AST & parser), and an adaptation of LaCIM

for ELTL.  This is a new version of the work started in 2008 with
LTL and ELTL formulae now sharing the same class hierarchy.

* configure.ac: Adjust for src/eltlparse/ and src/eltltest/
directories, and call AX_BOOST_BASE.
* m4/boost.m4: New file defining AX_BOOST_BASE([MINIMUM-VERSION]).
* src/Makefile.am: Add eltlparse and eltltest.
* src/eltlparse/: New directory.  Contains the ELTL parser.
* src/eltltest/: New directory.  Contains tests related to
ELTL (parser and AST).
* src/ltlast/Makefile.am: Adjust for ELTL AST files.
* src/ltlast/automatop.cc, src/ltlast/automatop.hh: New files.
Represent automaton operators nodes used in ELTL ASTs.
* src/ltlast/nfa.cc, src/ltlast/nfa.hh: New files.  Represent
simple NFAs used internally by automatop nodes.
* src/ltlast/allnode.hh, src/ltlast/predecl.hh,
src/ltlast/visitor.hh: Adjust for automatop.
* src/ltlvisit/basicreduce.cc, src/ltlvisit/clone.cc,
src/ltlvisit/clone.hh, src/ltlvisit/contain.cc,
src/ltlvisit/dotty.cc, src/ltlvisit/nenoform.cc,
src/ltlvisit/postfix.cc, src/ltlvisit/postfix.hh,
src/ltlvisit/reduce.cc, src/ltlvisit/syntimpl.cc,
src/ltlvisit/tostring.cc: Because LTL and ELTL formulae share the
same class hierarchy, LTL visitors need to handle automatop nodes
to compile.  When it's meaningful the visitor applies on automatop
nodes or simply assert(0) otherwise.
* src/tgba/tgbabddconcretefactory.cc (create_anonymous_state),
src/tgba/tgbabddconcretefactory.hh (create_anonymous_state): New
function used by the LaCIM translation algorithm for ELTL.
* src/tgbaalgos/Makefile.am: Adjust for eltl2tgba_lacim* files.
* src/tgbaalgos/eltl2tgba_lacim.cc,
src/tgbaalgos/eltl2tgba_lacim.hh: New files.  Implementation of
the LaCIM translation algorithm for ELTL.
* src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_lacim.cc:
Handle automatop nodes in the translation by an assert(0).
* src/tgbatest/Makefile.am: Adjust for eltl2tgba.* files.
* src/src/tgbatest/eltl2tgba.cc, src/tgbatest/eltl2tgba.test: New
files
This commit is contained in:
Damien Lefortier 2009-03-02 17:31:12 +01:00
parent 90332d8d77
commit 2fbcd7e52f
46 changed files with 2509 additions and 3 deletions

View file

@ -285,6 +285,12 @@ namespace spot
assert(0);
}
void
visit(automatop*)
{
assert(0);
}
void
visit(multop* mo)
{

View file

@ -65,6 +65,15 @@ namespace spot
recurse(bo->first()), recurse(bo->second()));
}
void
clone_visitor::visit(automatop* ao)
{
automatop::vec* res = new automatop::vec;
for (unsigned i = 0; i < ao->size(); ++i)
res->push_back(recurse(ao->nth(i)));
result_ = automatop::instance(ao->nfa(), res);
}
void
clone_visitor::visit(multop* mo)
{

View file

@ -47,6 +47,7 @@ namespace spot
void visit(atomic_prop* ap);
void visit(unop* uo);
void visit(binop* bo);
void visit(automatop* mo);
void visit(multop* mo);
void visit(constant* c);

View file

@ -231,6 +231,12 @@ namespace spot
}
}
void
visit(automatop*)
{
assert(0);
}
void
visit(multop* mo)
{

View file

@ -75,6 +75,12 @@ namespace spot
uo->child()->accept(*this);
}
void
visit(const automatop*)
{
assert(0);
}
void
visit(const multop* mo)
{

View file

@ -151,6 +151,21 @@ namespace spot
assert(0);
}
void
visit(automatop* ao)
{
if (negated_)
{
negated_ = false;
ao->negated_ = true;
}
automatop::vec* res = new automatop::vec;
unsigned aos = ao->size();
for (unsigned i = 0; i < aos; ++i)
res->push_back(recurse(ao->nth(i)));
result_ = automatop::instance(ao->nfa(), res);
}
void
visit(multop* mo)
{

View file

@ -55,6 +55,15 @@ namespace spot
doit(bo);
}
void
postfix_visitor::visit(automatop* ao)
{
unsigned s = ao->size();
for (unsigned i = 0; i < s; ++i)
ao->nth(i)->accept(*this);
doit(ao);
}
void
postfix_visitor::visit(multop* mo)
{
@ -94,6 +103,12 @@ namespace spot
doit_default(mo);
}
void
postfix_visitor::doit(automatop* ao)
{
doit_default(ao);
}
void
postfix_visitor::doit(constant* c)
{

View file

@ -45,12 +45,14 @@ namespace spot
void visit(unop* uo);
void visit(binop* bo);
void visit(multop* mo);
void visit(automatop* c);
void visit(constant* c);
virtual void doit(atomic_prop* ap);
virtual void doit(unop* uo);
virtual void doit(binop* bo);
virtual void doit(multop* mo);
virtual void doit(automatop* mo);
virtual void doit(constant* c);
virtual void doit_default(formula* f);
};

View file

@ -188,6 +188,12 @@ namespace spot
result_ = binop::instance(bo->op(), f1, f2);
}
void
visit(automatop*)
{
assert(0);
}
void
visit(multop* mo)
{

View file

@ -122,6 +122,12 @@ namespace spot
assert(0);
}
void
visit(const automatop*)
{
assert(0);
}
void
visit(const multop* mo)
{
@ -281,6 +287,12 @@ namespace spot
assert(0);
}
void
visit(const automatop*)
{
assert(0);
}
void
visit(const multop* mo)
{
@ -479,6 +491,12 @@ namespace spot
assert(0);
}
void
visit(const automatop*)
{
assert(0);
}
void
visit(const multop* mo)
{

View file

@ -154,6 +154,27 @@ namespace spot
os_ << ")";
}
void
visit(const automatop* ao)
{
// Warning: this string isn't parsable.
bool top_level = top_level_;
top_level_ = false;
if (!top_level)
os_ << "(";
os_ << ao->nfa()->get_name() << "(";
unsigned max = ao->size();
ao->nth(0)->accept(*this);
for (unsigned n = 1; n < max; ++n)
{
os_ << ",";
ao->nth(n)->accept(*this);
}
os_ << ")";
if (!top_level)
os_ << ")";
}
void
visit(const multop* mo)
{
@ -284,6 +305,27 @@ namespace spot
os_ << ")";
}
void
visit(const automatop* ao)
{
// Warning: this string isn't parsable.
bool top_level = top_level_;
top_level_ = false;
if (!top_level)
os_ << "(";
os_ << ao->nfa()->get_name() << "(";
unsigned max = ao->size();
ao->nth(0)->accept(*this);
for (unsigned n = 1; n < max; ++n)
{
os_ << ",";
ao->nth(n)->accept(*this);
}
os_ << ")";
if (!top_level)
os_ << ")";
}
void
visit(const multop* mo)
{