A class to represent an assignment of boolean values to propositions. A World can be partially restrictive, i.e., some propositions do not have to be assigned a value, in which case it can take on any value. Our notion of a World is similar to a set of truth assignments in propositional logic.
More...
#include <ompl/control/planners/ltl/World.h>
|
| World (unsigned int numProps) |
| Initializes a world with a given number of propositions.
|
bool | operator[] (unsigned int i) const |
| Returns the boolean value of a given proposition in this World. Reports an error if the proposition has not set in this World.
|
bool & | operator[] (unsigned int i) |
| Returns the boolean value of a given proposition in this World. Creates a boolean value for the proposition if one does not already exist.
|
unsigned int | numProps () const |
| Returns the number of propositions declared for this World. Not all of the propositions have necessarily been set.
|
bool | satisfies (const World &w) const |
| Returns whether this World propositionally satisfies a given World w. Specifically, returns true iff for every proposition p assigned in w, p is assigned in this World and this[p] == w[p].
|
std::string | formula () const |
| Returns a formatted string representation of this World, as a conjunction of literals.
|
const std::unordered_map< unsigned int, bool > & | props () const |
| Returns this World's underlying proposition-to-boolean assignment map.
|
bool | operator== (const World &w) const |
| Returns whether this World is equivalent to a given World, by comparing their truth assignment maps.
|
void | clear () |
| Clears this world's truth assignment.
|
A class to represent an assignment of boolean values to propositions. A World can be partially restrictive, i.e., some propositions do not have to be assigned a value, in which case it can take on any value. Our notion of a World is similar to a set of truth assignments in propositional logic.
Definition at line 71 of file World.h.
◆ World()
ompl::control::World::World |
( |
unsigned int | numProps | ) |
|
Initializes a world with a given number of propositions.
Definition at line 43 of file World.cpp.
◆ clear()
void ompl::control::World::clear |
( |
| ) |
|
Clears this world's truth assignment.
Definition at line 99 of file World.cpp.
◆ formula()
std::string ompl::control::World::formula |
( |
| ) |
const |
Returns a formatted string representation of this World, as a conjunction of literals.
Definition at line 77 of file World.cpp.
◆ numProps()
unsigned int ompl::control::World::numProps |
( |
| ) |
const |
Returns the number of propositions declared for this World. Not all of the propositions have necessarily been set.
Definition at line 60 of file World.cpp.
◆ operator==()
bool ompl::control::World::operator== |
( |
const World & | w | ) |
const |
Returns whether this World is equivalent to a given World, by comparing their truth assignment maps.
Definition at line 94 of file World.cpp.
◆ operator[]() [1/2]
bool & ompl::control::World::operator[] |
( |
unsigned int | i | ) |
|
Returns the boolean value of a given proposition in this World. Creates a boolean value for the proposition if one does not already exist.
Definition at line 55 of file World.cpp.
◆ operator[]() [2/2]
bool ompl::control::World::operator[] |
( |
unsigned int | i | ) |
const |
Returns the boolean value of a given proposition in this World. Reports an error if the proposition has not set in this World.
Definition at line 47 of file World.cpp.
◆ props()
const std::unordered_map< unsigned int, bool > & ompl::control::World::props |
( |
| ) |
const |
Returns this World's underlying proposition-to-boolean assignment map.
Definition at line 89 of file World.cpp.
◆ satisfies()
bool ompl::control::World::satisfies |
( |
const World & | w | ) |
const |
Returns whether this World propositionally satisfies a given World w. Specifically, returns true iff for every proposition p assigned in w, p is assigned in this World and this[p] == w[p].
Definition at line 65 of file World.cpp.
◆ std::hash< World >
friend struct std::hash< World > |
|
friend |
◆ numProps_
unsigned int ompl::control::World::numProps_ |
|
protected |
◆ props_
std::unordered_map<unsigned int, bool> ompl::control::World::props_ |
|
protected |
The documentation for this class was generated from the following files: