* src/ltlenv/environment.hh (require): Return a formula, not
an atomic_prop. * src/ltlast/atomic_prop.hh (atomic_prop): New argument env. (environment_): New member. (env): New method. * src/ltlast/atomic_prop.cc (atomic_prop, env): Likewise. * src/ltlenv/defaultenv.cc (require): Pass *this as the environment argument to atomic_prop. * src/ltlvisit/clone.cc (visit(const atomic_prop*)): Also copy the environment. * src/ltlvisit/nenoform.cc (visit(const atomic_prop*)): Likewise.
This commit is contained in:
parent
a30a0638b9
commit
2a0f88373e
8 changed files with 37 additions and 10 deletions
|
|
@ -6,8 +6,8 @@ namespace spot
|
|||
namespace ltl
|
||||
{
|
||||
|
||||
atomic_prop::atomic_prop(std::string name)
|
||||
: name_(name)
|
||||
atomic_prop::atomic_prop(const std::string& name, environment& env)
|
||||
: name_(name), env_(&env)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -32,5 +32,12 @@ namespace spot
|
|||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
environment&
|
||||
atomic_prop::env() const
|
||||
{
|
||||
return *env_;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
#include "formula.hh"
|
||||
#include "ltlenv/environment.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
|
@ -12,15 +13,17 @@ namespace spot
|
|||
class atomic_prop : public formula
|
||||
{
|
||||
public:
|
||||
atomic_prop(std::string name);
|
||||
atomic_prop(const std::string& name, environment& env);
|
||||
virtual ~atomic_prop();
|
||||
|
||||
virtual void accept(visitor& visitor);
|
||||
virtual void accept(const_visitor& visitor) const;
|
||||
|
||||
const std::string& name() const;
|
||||
environment& env() const;
|
||||
private:
|
||||
std::string name_;
|
||||
environment* env_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue