- java.lang.Object
-
- org.logicng.formulas.Formula
-
- org.logicng.formulas.NAryOperator
-
- org.logicng.formulas.Or
-
public final class Or extends NAryOperator
Boolean disjunction.Invariants: - has at least two elements - does not contain duplicates - does not contain complementary literals - does not contain constants
- Since:
- 1.0
- Version:
- 2.2.0
-
-
Field Summary
-
Fields inherited from class org.logicng.formulas.NAryOperator
operands
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)booleanevaluate(Assignment assignment)Evaluates this formula with a given assignment.inthashCode()booleanisCNFClause()Returnstrueif this formula is a CNF clause,falseotherwise.-
Methods inherited from class org.logicng.formulas.NAryOperator
compareOperands, containsNode, containsVariable, hashCode, isAtomicFormula, isConstantFormula, iterator, negate, numberOfOperands, restrict, stream, substitute
-
Methods inherited from class org.logicng.formulas.Formula
apply, apply, bdd, bdd, clearCaches, cnf, containsVariable, factory, functionCacheEntry, holds, holds, implies, isCNF, isContradiction, isDNF, isEquivalentTo, isImpliedBy, isNNF, isSatisfiable, isTautology, literals, nnf, numberOfAtoms, numberOfInternalNodes, numberOfNodes, predicateCacheEntry, setFunctionCacheEntry, setPredicateCacheEntry, setPredicateCacheEntry, setTransformationCacheEntry, substitute, toString, transform, transform, transformationCacheEntry, type, variables
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
evaluate
public boolean evaluate(Assignment assignment)
Description copied from class:FormulaEvaluates this formula with a given assignment. A literal not covered by the assignment evaluates tofalseif it is positive, otherwise it evaluates totrue.
-
isCNFClause
public boolean isCNFClause()
Returnstrueif this formula is a CNF clause,falseotherwise.- Returns:
trueif this formula is a CNF clause
-
-