Skip to content

Commit 7244caa

Browse files
committed
clarify comments
1 parent 2d00ed6 commit 7244caa

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/analysis/lattice.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@ concept Lattice = requires(const L& lattice,
4646
// Lattices must have elements.
4747
typename L::Element;
4848
requires std::copyable<typename L::Element>;
49-
// We need to be able to get the bottom element.
49+
// Get the bottom element of this lattice.
5050
{ lattice.getBottom() } noexcept -> std::same_as<typename L::Element>;
51-
// Elements should be comparable. TODO: use <=> and std::three_way_comparable
52-
// once we support C++20 everywhere.
51+
// Compare two elements of this lattice. TODO: use <=> and
52+
// std::three_way_comparable once we support C++20 everywhere.
5353
{
5454
lattice.compare(constElem, constElem)
5555
} noexcept -> std::same_as<LatticeComparison>;
56-
// We need to be able to get the least upper bound of two elements and know
57-
// whether any change was made.
56+
// Modify `elem` in-place to be the join (aka least upper bound) of `elem` and
57+
// `constElem`, returning true iff `elem` was modified, i.e. if it was not
58+
// already an upper bound of `constElem`.
5859
{ lattice.join(elem, constElem) } noexcept -> std::same_as<bool>;
5960
};
6061

src/analysis/lattices/powerset.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ class FiniteIntPowersetLattice {
8585
// Returns an instance of the bottom lattice element.
8686
Element getBottom() const noexcept;
8787

88-
// Calculates the LUB of this element with some other element and sets
89-
// this element to the LUB in place. Returns true if this element before
90-
// this method call was different than the LUB.
88+
// Modifies `self` to be the join (aka least upper bound) of `self` and
89+
// `other`. Returns true if `self` was modified, i.e. if it was not already an
90+
// upper bound of `other`.
9191
bool join(Element& self, const Element& other) const noexcept;
9292
};
9393

0 commit comments

Comments
 (0)