#ifndef wasm_analysis_lattices_bool_h
#define wasm_analysis_lattices_bool_h
#include "../lattice.h"
namespace wasm::analysis {
struct Bool {
using Element = bool;
Element getBottom() const noexcept { return false; }
Element getTop() const noexcept { return true; }
LatticeComparison compare(Element a, Element b) const noexcept {
return a > b ? GREATER : a == b ? EQUAL : LESS;
}
bool join(Element& joinee, Element joiner) const noexcept {
if (!joinee && joiner) {
joinee = joiner;
return true;
}
return false;
}
bool meet(Element& meetee, Element meeter) const noexcept {
if (meetee && !meeter) {
meetee = meeter;
return true;
}
return false;
}
};
#if __cplusplus >= 202002L
static_assert(Lattice<Bool>);
#endif
}
#endif