Interface Clause
The
Clause
interface represents a logical clause, which is a disjunction (OR) of literals in propositional logic.
Clauses are fundamental components in SAT solvers and are used to encode constraints and logical formulas.- Author:
- Mathias Hofer
-
Method Summary
Modifier and TypeMethodDescriptionstatic Clause
of()
Creates a clause with no literals.static Clause
of
(Collection<? extends Literal> literals) Creates a clause from a collection of literals.static Clause
of
(Collection<? extends Literal> literals, Literal l) Creates a clause from a collection of literals and an additional literal.static Clause
of
(Collection<? extends Literal> literals, Literal l1, Literal l2) Creates a clause from a collection of literals and two additional literals.static Clause
Creates a clause from a collection of literals and three additional literals.static Clause
Creates a clause by extending an existing clause with an additional literal.static Clause
Creates a clause with a single literal.static Clause
Creates a clause with two literals.static Clause
Creates a clause with three literals.int
size()
Returns the number of literals in this clause.stream()
Returns a stream of literals contained in this clause.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
stream
-
size
int size()Returns the number of literals in this clause.- Returns:
- the size of the clause
-
of
Creates a clause with no literals. This represents an empty clause.- Returns:
- a clause with no literals
-
of
-
of
-
of
-
of
-
of
Creates a clause from a collection of literals.- Parameters:
literals
- a collection of literals- Returns:
- a clause containing the literals from the collection
-
of
Creates a clause from a collection of literals and an additional literal.- Parameters:
literals
- a collection of literalsl
- the additional literal- Returns:
- a new clause containing the literals from the collection plus the additional literal
-
of
Creates a clause from a collection of literals and two additional literals.- Parameters:
literals
- a collection of literalsl1
- the first additional literall2
- the second additional literal- Returns:
- a new clause containing the literals from the collection plus the additional literals
-
of
Creates a clause from a collection of literals and three additional literals.- Parameters:
literals
- a collection of literalsl1
- the first additional literall2
- the second additional literall3
- the third additional literal- Returns:
- a new clause containing the literals from the collection plus the additional literals
-