-
Notifications
You must be signed in to change notification settings - Fork 747
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
[analysis] Implement Flat lattice #6039
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
#else | ||
template<typename T> | ||
#endif | ||
struct Flat { |
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.
PR description could be a comment in the header.
c545121
to
d1fe61a
Compare
LatticeComparison compare(const Element& a, const Element& b) const noexcept { | ||
if (a.index() < b.index()) { | ||
return LESS; | ||
} else if (a.index() > b.index()) { |
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 interface is index() from?
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 built into std::variant
: https://en.cppreference.com/w/cpp/utility/variant/index
Given a type `T`, `Flat<T>` is the lattice where none of the values of `T` are comparable except with themselves, but they are all greater than a common bottom element not in `T` and less than a common top element also not in `T`.
Given a type `T`, `Flat<T>` is the lattice where none of the values of `T` are comparable except with themselves, but they are all greater than a common bottom element not in `T` and less than a common top element also not in `T`.
Given a type
T
,Flat<T>
is the lattice where none of the values ofT
arecomparable except with themselves, but they are all greater than a common bottom
element not in
T
and less than a common top element also not inT
.