Class test_utils::VectorContainer¶
Inherits the following classes: Paramita::ClauseContainer
Public Attributes¶
| Type | Name |
|---|---|
| std::vector< Paramita::Clause > | m_clauses |
Public Static Attributes inherited from Paramita::ClauseContainer¶
| Type | Name |
|---|---|
| constexpr const char *const | m_interface_id = "Paramita::ClauseContainer" |
Public Static Attributes inherited from Paramita::Plugin¶
See Paramita::Plugin
| Type | Name |
|---|---|
| constexpr const char *const | m_interface_id = "Paramita::Plugin" |
Public Functions¶
| Type | Name |
|---|---|
| virtual | add_clause (const Paramita::Clause & clause) override Add a single clause. |
| virtual std::uint64_t | max_var () override const Get the largest variable used by the container. |
| virtual | set_minimum_var (std::uint64_t var) override Sets the maximum variable known to the container to at least this one. |
Public Functions inherited from Paramita::ClauseContainer¶
| Type | Name |
|---|---|
| ClauseContainer () = default Constructor that initializes an empty container. |
|
| ClauseContainer (const ClauseContainer &) = delete Deleted copy constructor (pure interface). |
|
| ClauseContainer (ClauseContainer &&) = delete Deleted move constructor (pure interface). |
|
| virtual | add_clause (const Clause & clause) = 0 Add a single clause. |
| virtual | add_clauses (const std::vector< Clause > & clauses) Add multiple clauses to the container. |
| virtual | add_lit (Literal lit) Add a clause literal by literal. |
| virtual ClauseContainer * | clone () Clones the current CNF Container. |
| virtual std::uint64_t | max_var () const = 0 Get the largest variable used by the container. |
| virtual int | num_clauses () const Get the number of clauses hold currently by the container. |
| ClauseContainer & | operator= (const ClauseContainer & container) = delete Deleted copy assignment (pure interface). |
| ClauseContainer & | operator= (ClauseContainer &&) = delete Deleted move assignment (pure interface). |
| virtual | set_minimum_var (std::uint64_t var) = 0 Sets the maximum variable known to the container to at least this one. |
| ~ClauseContainer () override Virtual destructor for the container. |
Public Functions inherited from Paramita::Plugin¶
See Paramita::Plugin
| Type | Name |
|---|---|
| Plugin () = default |
|
| Plugin (const Plugin &) = delete Deleted constructor (pure interface). |
|
| Plugin (Plugin &&) = delete Deleted constructor (pure interface). |
|
| virtual ParameterType | get (const std::string & name) Get the parameter's value. |
| virtual ParameterSpace | get_parameter_space () Get the parameter space for this class. |
| Plugin & | operator= (const Plugin & container) = delete Deleted constructor (pure interface). |
| Plugin & | operator= (Plugin &&) = delete Deleted constructor (pure interface). |
| virtual | set (const std::string & name, const ParameterType & value) Set a parameter. |
| virtual | ~Plugin () = default |
Public Attributes Documentation¶
variable m_clauses¶
Public Functions Documentation¶
function add_clause¶
Add a single clause.
The clause is represented as a sequence of literals. Each literal is represented as an integer, where its absolut value is the identifier of a variable. A positive integer represents the variable and a negative integer its negation.
Parameters:
clauseThe clause to be added to the container.
Implements Paramita::ClauseContainer::add_clause
function max_var¶
Get the largest variable used by the container.
The largest variable is determined by its identifier.
Note:
Note that this does not mean that the container has clauses containing literals for all the variables between 1 and CnfContainerinterface::max_var, there may be gaps.
Warning:
If the container creates variables internally, this method MUST also consider those variables, even if the user did not add them directly. This ensures that the user cannot generate variable clashes when adding new clauses to the container.
Postcondition:
The return value is equal or larger to the absolute value for any literal passed to add_clause, add_clauses, or add_lit.
Returns:
The (positive) integer representing the largest variable.
Implements Paramita::ClauseContainer::max_var
function set_minimum_var¶
Sets the maximum variable known to the container to at least this one.
This method can be used to ensure that the container knows a certain variable. If the container internally generates new variables, or if someone relies on the ClauseContainer::max_var method to determine the next free variable, this method ensures that existing variables cannot be reused.
Postcondition:
The value returned by max_var must be larger or equal than the one provided.
Postcondition:
The value returned by max_var cannot be reduced by this call.
Parameters:
varThe variable to be registered to the container.
Implements Paramita::ClauseContainer::set_minimum_var