-
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] Add a FullLattice concept and Inverted lattice #6038
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
template<typename L> | ||
concept FullLattice = | ||
Lattice<L> && requires(const L& lattice, | ||
const typename L::Element& constElem, |
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.
Can you explain why access to L::Element& is needed as both a const and !const?
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.
This is for the join
and meet
operations, which need to take a mutable reference as their first argument because it will be modified in-place. Otherwise all other uses of elements are const
.
const typename L::Element& constElem, | ||
typename L::Element& elem) { | ||
{ lattice.getTop() } noexcept -> std::same_as<typename L::Element>; | ||
{ lattice.meet(elem, constElem) } noexcept -> std::same_as<bool>; |
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 meet intended to be the greatest lower bound?
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.
Yes, will add a comment.
The FullLattice concept extends the base Lattice with `getTop` and `meet` operations. The `Inverted` lattice uses these operations to reverse the order of an arbitrary full lattice, for example to create a lattice of integers ordered by `>` rather than by `<`.
…y#6038) The FullLattice concept extends the base Lattice with `getTop` and `meet` operations. The `Inverted` lattice uses these operations to reverse the order of an arbitrary full lattice, for example to create a lattice of integers ordered by `>` rather than by `<`.
The FullLattice concept extends the base Lattice with
getTop
andmeet
operations. The
Inverted
lattice uses these operations to reverse the order ofan arbitrary full lattice, for example to create a lattice of integers ordered
by
>
rather than by<
.