clang 20.0.0git
|
A boolean formula in 3-CNF (conjunctive normal form with at most 3 literals per clause). More...
#include "clang/Analysis/FlowSensitive/CNFFormula.h"
Classes | |
class | Iterator |
An iterator over all literals of all clauses in the formula. More... | |
Public Member Functions | |
CNFFormula (Variable LargestVar) | |
void | addClause (ArrayRef< Literal > lits) |
Adds the L1 v ... v Ln clause to the formula. | |
bool | knownContradictory () const |
Returns whether the formula is known to be contradictory. | |
Variable | largestVar () const |
Returns the largest variable in the formula. | |
ClauseID | numClauses () const |
Returns the number of clauses in the formula. | |
size_t | clauseSize (ClauseID C) const |
Returns the number of literals in clause C . | |
llvm::ArrayRef< Literal > | clauseLiterals (ClauseID C) const |
Returns the literals of clause C . | |
Iterator | startOfClause (ClauseID C) |
Returns an iterator to the first literal of clause C . | |
Friends | |
class | Iterator |
A boolean formula in 3-CNF (conjunctive normal form with at most 3 literals per clause).
Definition at line 68 of file CNFFormula.h.
|
explicit |
Definition at line 99 of file CNFFormula.cpp.
Adds the L1 v ... v Ln
clause to the formula.
Requirements:
Li
must not be NullLit
.
All literals in the input that are not NullLit
must be distinct.
Definition at line 105 of file CNFFormula.cpp.
References clang::dataflow::NullLit.
Referenced by clang::dataflow::buildCNF().
|
inline |
Returns the literals of clause C
.
If knownContradictory()
is false, each clause has at least one literal.
Definition at line 129 of file CNFFormula.h.
References clang::C, and clauseSize().
Referenced by clang::dataflow::buildCNF().
Returns the number of literals in clause C
.
Definition at line 122 of file CNFFormula.h.
References clang::C.
Referenced by clang::dataflow::buildCNF(), and clauseLiterals().
|
inline |
Returns whether the formula is known to be contradictory.
This is the case if any of the clauses is empty.
Definition at line 112 of file CNFFormula.h.
|
inline |
Returns the largest variable in the formula.
Definition at line 115 of file CNFFormula.h.
|
inline |
Returns the number of clauses in the formula.
Valid clause IDs are in the range [1, numClauses()
].
Definition at line 119 of file CNFFormula.h.
Referenced by clang::dataflow::buildCNF().
Returns an iterator to the first literal of clause C
.
Definition at line 166 of file CNFFormula.h.
References clang::C.
|
friend |
Definition at line 163 of file CNFFormula.h.