|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Ordered collection of equality constraints. More...
#include <tpl_constraints.H>
Public Member Functions | |
| size_t | size () const noexcept |
| Returns the number of stored constraints. | |
| bool | empty () const noexcept |
| Returns whether the set has no constraints. | |
| void | clear () noexcept |
| Removes all stored constraints. | |
| size_t | add (const T &lhs, const T &rhs, const Source_Span &span={}, const std::string &message="") |
| Appends an equality constraint. | |
| const Equality_Constraint< T > & | constraint (const size_t i) const |
| Returns one stored constraint. | |
Private Attributes | |
| DynArray< Equality_Constraint< T > > | constraints |
Ordered collection of equality constraints.
Constraints are processed in insertion order to keep solver behavior deterministic and easy to test.
| T | Item type compared by each equality constraint. |
Definition at line 83 of file tpl_constraints.H.
|
inline |
Appends an equality constraint.
| lhs | Left-hand side. |
| rhs | Right-hand side. |
| span | Optional source span. |
| message | Optional debug description. |
Definition at line 114 of file tpl_constraints.H.
|
inlinenoexcept |
Removes all stored constraints.
Definition at line 101 of file tpl_constraints.H.
References Aleph::Constraint_Set< T >::constraints.
|
inline |
Returns one stored constraint.
| i | Constraint index. |
| std::out_of_range | If i is invalid. |
Definition at line 134 of file tpl_constraints.H.
References ah_out_of_range_error_unless, and Aleph::Constraint_Set< T >::constraints.
Referenced by Aleph::Compiler_Type_Unifier::solve().
|
inlinenoexcept |
Returns whether the set has no constraints.
Definition at line 95 of file tpl_constraints.H.
References Aleph::Constraint_Set< T >::constraints.
|
inlinenoexcept |
Returns the number of stored constraints.
Definition at line 89 of file tpl_constraints.H.
References Aleph::Constraint_Set< T >::constraints.
Referenced by Aleph::Compiler_Type_Unifier::solve().
|
private |
Definition at line 85 of file tpl_constraints.H.
Referenced by Aleph::Constraint_Set< T >::clear(), Aleph::Constraint_Set< T >::constraint(), Aleph::Constraint_Set< T >::empty(), and Aleph::Constraint_Set< T >::size().