* src/ltlast/formulae.hh: Rename as ...
* src/ltlast/formula.hh: ... this. * src/ltlast/Makefile.am (libltlast_a_SOURCES): Adjust. * src/ltlast/formula.hh (formulae): Rename as ... (formula): ... this. Adjust all uses.
This commit is contained in:
parent
532f9131f5
commit
ef2d6323e0
22 changed files with 104 additions and 97 deletions
|
|
@ -10,7 +10,7 @@ libltlast_a_SOURCES = \
|
|||
binop.hh \
|
||||
constant.cc \
|
||||
constant.hh \
|
||||
formulae.hh \
|
||||
formula.hh \
|
||||
multop.cc \
|
||||
multop.hh \
|
||||
predecl.hh \
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
# define SPOT_LTLAST_ATOMIC_PROP_HH
|
||||
|
||||
#include <string>
|
||||
#include "formulae.hh"
|
||||
#include "formula.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
namespace ltl
|
||||
{
|
||||
|
||||
class atomic_prop : public formulae
|
||||
class atomic_prop : public formula
|
||||
{
|
||||
public:
|
||||
atomic_prop(std::string name);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace spot
|
|||
{
|
||||
namespace ltl
|
||||
{
|
||||
binop::binop(type op, formulae* first, formulae* second)
|
||||
binop::binop(type op, formula* first, formula* second)
|
||||
: op_(op), first_(first), second_(second)
|
||||
{
|
||||
}
|
||||
|
|
@ -27,25 +27,25 @@ namespace spot
|
|||
v.visit(this);
|
||||
}
|
||||
|
||||
const formulae*
|
||||
const formula*
|
||||
binop::first() const
|
||||
{
|
||||
return first_;
|
||||
}
|
||||
|
||||
formulae*
|
||||
formula*
|
||||
binop::first()
|
||||
{
|
||||
return first_;
|
||||
}
|
||||
|
||||
const formulae*
|
||||
const formula*
|
||||
binop::second() const
|
||||
{
|
||||
return second_;
|
||||
}
|
||||
|
||||
formulae*
|
||||
formula*
|
||||
binop::second()
|
||||
{
|
||||
return second_;
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
#ifndef SPOT_LTLAST_BINOP_HH
|
||||
# define SPOT_LTLAST_BINOP_HH
|
||||
|
||||
#include "formulae.hh"
|
||||
#include "formula.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
namespace ltl
|
||||
{
|
||||
|
||||
class binop : public formulae
|
||||
class binop : public formula
|
||||
{
|
||||
public:
|
||||
// And and Or are not here. Because they
|
||||
// are often nested we represent them as multops.
|
||||
enum type { Xor, Implies, Equiv, U, R };
|
||||
|
||||
binop(type op, formulae* first, formulae* second);
|
||||
binop(type op, formula* first, formula* second);
|
||||
virtual ~binop();
|
||||
|
||||
virtual void accept(visitor& v);
|
||||
virtual void accept(const_visitor& v) const;
|
||||
|
||||
const formulae* first() const;
|
||||
formulae* first();
|
||||
const formulae* second() const;
|
||||
formulae* second();
|
||||
const formula* first() const;
|
||||
formula* first();
|
||||
const formula* second() const;
|
||||
formula* second();
|
||||
|
||||
type op() const;
|
||||
const char* op_name() const;
|
||||
|
||||
private:
|
||||
type op_;
|
||||
formulae* first_;
|
||||
formulae* second_;
|
||||
formula* first_;
|
||||
formula* second_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
#ifndef SPOT_LTLAST_CONSTANT_HH
|
||||
# define SPOT_LTLAST_CONSTANT_HH
|
||||
|
||||
#include "formulae.hh"
|
||||
#include "formula.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
namespace ltl
|
||||
{
|
||||
|
||||
class constant : public formulae
|
||||
class constant : public formula
|
||||
{
|
||||
public:
|
||||
enum type { False, True };
|
||||
|
|
@ -19,8 +19,8 @@ namespace spot
|
|||
virtual void accept(visitor& v);
|
||||
virtual void accept(const_visitor& v) const;
|
||||
|
||||
const formulae* child() const;
|
||||
formulae* child();
|
||||
const formula* child() const;
|
||||
formula* child();
|
||||
|
||||
type val() const;
|
||||
const char* val_name() const;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace spot
|
|||
namespace ltl
|
||||
{
|
||||
|
||||
class formulae
|
||||
class formula
|
||||
{
|
||||
public:
|
||||
virtual void accept(visitor& v) = 0;
|
||||
|
|
@ -7,7 +7,7 @@ namespace spot
|
|||
{
|
||||
namespace ltl
|
||||
{
|
||||
multop::multop(type op, formulae* first, formulae* second)
|
||||
multop::multop(type op, formula* first, formula* second)
|
||||
: op_(op)
|
||||
{
|
||||
children_.reserve(2);
|
||||
|
|
@ -16,9 +16,9 @@ namespace spot
|
|||
}
|
||||
|
||||
void
|
||||
multop::add(formulae* f)
|
||||
multop::add(formula* f)
|
||||
{
|
||||
// If the formulae we add is itself a multop for the same operator,
|
||||
// If the formula we add is itself a multop for the same operator,
|
||||
// merge its children with ours.
|
||||
multop* p = dynamic_cast<multop*>(f);
|
||||
if (p && p->op() == op())
|
||||
|
|
@ -26,7 +26,7 @@ namespace spot
|
|||
unsigned ps = p->size();
|
||||
for (unsigned i = 0; i < ps; ++i)
|
||||
children_.push_back(p->nth(i));
|
||||
// that sub-formulae is now useless
|
||||
// that sub-formula is now useless
|
||||
delete f;
|
||||
}
|
||||
else
|
||||
|
|
@ -57,13 +57,13 @@ namespace spot
|
|||
return children_.size();
|
||||
}
|
||||
|
||||
const formulae*
|
||||
const formula*
|
||||
multop::nth(unsigned n) const
|
||||
{
|
||||
return children_[n];
|
||||
}
|
||||
|
||||
formulae*
|
||||
formula*
|
||||
multop::nth(unsigned n)
|
||||
{
|
||||
return children_[n];
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@
|
|||
# define SPOT_LTLAST_MULTOP_HH
|
||||
|
||||
#include <vector>
|
||||
#include "formulae.hh"
|
||||
#include "formula.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
namespace ltl
|
||||
{
|
||||
|
||||
class multop : public formulae
|
||||
class multop : public formula
|
||||
{
|
||||
public:
|
||||
enum type { Or, And };
|
||||
|
||||
// A multop has at least two arguments.
|
||||
multop(type op, formulae* first, formulae* second);
|
||||
multop(type op, formula* first, formula* second);
|
||||
// More argument can be added.
|
||||
void add(formulae* f);
|
||||
void add(formula* f);
|
||||
|
||||
virtual ~multop();
|
||||
|
||||
|
|
@ -25,15 +25,15 @@ namespace spot
|
|||
virtual void accept(const_visitor& v) const;
|
||||
|
||||
unsigned size() const;
|
||||
const formulae* nth(unsigned n) const;
|
||||
formulae* nth(unsigned n);
|
||||
const formula* nth(unsigned n) const;
|
||||
formula* nth(unsigned n);
|
||||
|
||||
type op() const;
|
||||
const char* op_name() const;
|
||||
|
||||
private:
|
||||
type op_;
|
||||
std::vector<formulae*> children_;
|
||||
std::vector<formula*> children_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace spot {
|
|||
struct unop;
|
||||
struct constant;
|
||||
struct binop;
|
||||
struct formulae;
|
||||
struct formula;
|
||||
struct multop;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace spot
|
|||
{
|
||||
namespace ltl
|
||||
{
|
||||
unop::unop(type op, formulae* child)
|
||||
unop::unop(type op, formula* child)
|
||||
: op_(op), child_(child)
|
||||
{
|
||||
}
|
||||
|
|
@ -27,13 +27,13 @@ namespace spot
|
|||
v.visit(this);
|
||||
}
|
||||
|
||||
const formulae*
|
||||
const formula*
|
||||
unop::child() const
|
||||
{
|
||||
return child_;
|
||||
}
|
||||
|
||||
formulae*
|
||||
formula*
|
||||
unop::child()
|
||||
{
|
||||
return child_;
|
||||
|
|
|
|||
|
|
@ -1,33 +1,33 @@
|
|||
#ifndef SPOT_LTLAST_UNOP_HH
|
||||
# define SPOT_LTLAST_UNOP_HH
|
||||
|
||||
#include "formulae.hh"
|
||||
#include "formula.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
namespace ltl
|
||||
{
|
||||
|
||||
class unop : public formulae
|
||||
class unop : public formula
|
||||
{
|
||||
public:
|
||||
enum type { Not, X, F, G };
|
||||
|
||||
unop(type op, formulae* child);
|
||||
unop(type op, formula* child);
|
||||
virtual ~unop();
|
||||
|
||||
virtual void accept(visitor& v);
|
||||
virtual void accept(const_visitor& v) const;
|
||||
|
||||
const formulae* child() const;
|
||||
formulae* child();
|
||||
const formula* child() const;
|
||||
formula* child();
|
||||
|
||||
type op() const;
|
||||
const char* op_name() const;
|
||||
|
||||
private:
|
||||
type op_;
|
||||
formulae* child_;
|
||||
formula* child_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue