LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk::FuzzySet Class Reference

Represents a set where the membership predicate can take three values: true, false, and "unknown". More...

#include <MemberOverwriteAnalysis.h>

Public Member Functions

bool contains (llvm::StringRef key) const
 key \in *this == true (key is definitely present)
bool doesNotContain (llvm::StringRef key) const
 key \in *this == false (key is definitely not present)
bool insert (llvm::StringRef key)
 Mark key as definitely present.
bool remove (llvm::StringRef key)
 Mark key as definitely not present.
bool intersect (const FuzzySet &other)
 Perform an intersection in-place.
bool operator== (const FuzzySet &other) const =default

Friends

llvm::raw_ostream & operator<< (llvm::raw_ostream &os, const FuzzySet &set)

Detailed Description

Represents a set where the membership predicate can take three values: true, false, and "unknown".

This is useful for building a lattice for intersection analysis. Internally, we represent the set as a mapping of elements to "present/not present" Booleans; any element for which this mapping doesn't exist is in the default "don't know" state.

Definition at line 24 of file MemberOverwriteAnalysis.h.

Member Function Documentation

◆ contains()

bool llzk::FuzzySet::contains ( llvm::StringRef key) const
inline

key \in *this == true (key is definitely present)

Parameters
key

Definition at line 43 of file MemberOverwriteAnalysis.h.

◆ doesNotContain()

bool llzk::FuzzySet::doesNotContain ( llvm::StringRef key) const
inline

key \in *this == false (key is definitely not present)

Parameters
key

Definition at line 47 of file MemberOverwriteAnalysis.h.

◆ insert()

bool llzk::FuzzySet::insert ( llvm::StringRef key)
inline

Mark key as definitely present.

Parameters
key

Definition at line 51 of file MemberOverwriteAnalysis.h.

◆ intersect()

bool llzk::FuzzySet::intersect ( const FuzzySet & other)
inline

Perform an intersection in-place.

If an element is only known about in one of the two sets being intersected, keep it as-is; otherwise, intersect it as normal.

Parameters
other
Returns
true if this set was modified, false otherwise

Definition at line 61 of file MemberOverwriteAnalysis.h.

◆ operator==()

bool llzk::FuzzySet::operator== ( const FuzzySet & other) const
default

◆ remove()

bool llzk::FuzzySet::remove ( llvm::StringRef key)
inline

Mark key as definitely not present.

Parameters
key

Definition at line 55 of file MemberOverwriteAnalysis.h.

◆ operator<<

llvm::raw_ostream & operator<< ( llvm::raw_ostream & os,
const FuzzySet & set )
friend

Definition at line 87 of file MemberOverwriteAnalysis.h.


The documentation for this class was generated from the following file: