Skip to content

Commit 57e0b2f

Browse files
authored
[analysis] Improve lattice fuzzer (#6050)
Implement new `RandomLattice` and `RandomFullLattice` utilities that are lattices randomly created from other lattices. By recursively using themselves as the parameter lattices for lattices like `Inverted` and `Lift`, these random lattices can become arbitrarily nested. Decouple the checking of lattice properties from the checking of transfer function properties by creating a new, standalone `checkLatticeProperties` function.
1 parent 0aa46e4 commit 57e0b2f

File tree

3 files changed

+525
-119
lines changed

3 files changed

+525
-119
lines changed

src/analysis/lattices/inverted.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ template<FullLattice L> struct Inverted {
3535
Element getBottom() const noexcept { return lattice.getTop(); }
3636
Element getTop() const noexcept { return lattice.getBottom(); }
3737
LatticeComparison compare(const Element& a, const Element& b) const noexcept {
38-
return reverseComparison(lattice.compare(a, b));
38+
return lattice.compare(b, a);
3939
}
4040
bool join(Element& self, Element other) const noexcept {
4141
return lattice.meet(self, other);

src/analysis/lattices/lift.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ template<Lattice L> struct Lift {
4040
};
4141

4242
L lattice;
43+
4344
Lift(L&& lattice) : lattice(std::move(lattice)) {}
4445

4546
Element getBottom() const noexcept { return {std::nullopt}; }

0 commit comments

Comments
 (0)