Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Oct 21, 2023

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 <.

template<typename L>
concept FullLattice =
Lattice<L> && requires(const L& lattice,
const typename L::Element& constElem,
Copy link
Collaborator

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?

Copy link
Member Author

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>;
Copy link
Collaborator

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?

Copy link
Member Author

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.

@tlively
Copy link
Member Author

tlively commented Oct 25, 2023

Merge activity

  • Oct 25, 1:00 PM: @tlively started a stack merge that includes this pull request via Graphite.
  • Oct 25, 2:55 PM: Graphite rebased this pull request as part of a merge.
  • Oct 25, 3:30 PM: @tlively merged this pull request with Graphite.

Base automatically changed from int-lattice to main October 25, 2023 18:55
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 `<`.
@tlively tlively merged commit 6ba0f3d into main Oct 25, 2023
@tlively tlively deleted the full-lattice branch October 25, 2023 19:30
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
…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 `<`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants