-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant DC verification #510
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
cee6cc2
to
02b27b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
02b27b6
to
5e7dbbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
ebd4eae
to
deaa199
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
a90e568
to
3d0b351
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
ce333d9
to
9e2a146
Compare
9e2a146
to
f805864
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
f805864
to
992bb4b
Compare
|
||
} // namespace python_bindings | ||
py::bind_vector<std::vector<std::pair<size_t, size_t>>>(main_module, "vector_pair"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue with the standard conversion?
// @brief Represents a column operand for Predicate. | ||
// | ||
// A predicate (e.g., t.A == s.A) comprises three elements: | ||
// the column operand from the first tuple ("t.A"), the comparison operator | ||
// ("=="), and the column operand from the second tuple ("s.A"). The `ColumnOperand` class | ||
// encapsulates the column operand part of a predicate, such as "t.A" or "s.A". | ||
// | ||
// A constant value also can be a column operand thus boost::optional is utilized | ||
// | ||
// The class distinguishes between operands derived from the first tuple (t) and those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not seem to be resolved, I still see the comment about is_first_tuple_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only resolved for my convenience. I haven't yet uploaded a new version that fixes this issue thus didn't ask for re-review. I think this is a common practice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, my bad, sorry :)
// @brief Represents a column operand for Predicate. | ||
// | ||
// A predicate (e.g., t.A == s.A) comprises three elements: | ||
// the column operand from the first tuple ("t.A"), the comparison operator | ||
// ("=="), and the column operand from the second tuple ("s.A"). The `ColumnOperand` class | ||
// encapsulates the column operand part of a predicate, such as "t.A" or "s.A". | ||
// | ||
// A constant value also can be a column operand thus boost::optional is utilized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// A constant value also can be a column operand thus boost::optional is utilized | |
// A constant value also can be a column operand thus std::optional is utilized |
// @brief Represents a column operand for Predicate. | ||
// | ||
// A predicate (e.g., t.A == s.A) comprises three elements: | ||
// the column operand from the first tuple ("t.A"), the comparison operator | ||
// ("=="), and the column operand from the second tuple ("s.A"). The `ColumnOperand` class | ||
// encapsulates the column operand part of a predicate, such as "t.A" or "s.A". | ||
// | ||
// A constant value also can be a column operand thus boost::optional is utilized | ||
// | ||
// The class distinguishes between operands derived from the first tuple (t) and those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not seem to be resolved, I still see the comment about is_first_tuple_
enum class Tuple { kS, kT, kMixed }; | ||
|
||
// @brief Represents a column operand for Predicate. | ||
// | ||
// A predicate (e.g., t.A == s.A) comprises three elements: | ||
// the column operand from the first tuple ("t.A"), the comparison operator | ||
// ("=="), and the column operand from the second tuple ("s.A"). The `ColumnOperand` class | ||
// encapsulates the column operand part of a predicate, such as "t.A" or "s.A". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to me to grasp what kMixed
represents here. I suggest you to add the explanation to this comment right here that explains what "t" and "s" means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kMixed
is used for defining a tuple on Predicate
since it may have ColumnPredicate
's with kS
and sT
tuples. We could also create two enums, for Predicate
and ColumnPredicate
but I'm not sure, couldn't come up with other solution.
std::byte* val = type->Allocate(); | ||
type->ValueFromStr(val, str_val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to ignore:
I would use type_
here. Makes more sense to me that in constructor we filled some private fields first and then called methods on those fields, instead on what we filled them with (though it's the same pointer, naturally)
bool operator!=(ColumnOperand const& rhs) const { | ||
return !(*this == rhs); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think C++20 can do this automatically with bool operator!=(ColumnOperand const& rhs) = default
assuming operator==
is provided
// The class distinguishes between operands derived from the first tuple (t) and those | ||
// from the second tuple (s) using a boolean flag `is_first_tuple_`, where `true` indicates an | ||
// operand from the first tuple (t), and `false` indicates an operand from the second | ||
// tuple (s). | ||
class ColumnOperand { | ||
private: | ||
Column const* column_; | ||
bool is_first_tuple_; | ||
std::optional<dc::Tuple> tuple_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does std::optional
here achieve?
I might be wrong, but I think the only real usage of a tuple_
is within a GetTuple
method which assert that it has value anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, a ColumnOperand
may have a tuple_
variable initialized or may not. If a ColumnOperand
is a constant value, then tuple_
is not initialized. In this case accessing tuple_
is not allowed. I should definitely write it above
Now it is possible to pass an option that tells the algorithm whether to collect violations or not.
16a6c92
to
240a539
Compare
Add DC verification with constant predicactes, add violations highlights and minimization algorithm