Class ExclusiveDisjunction
java.lang.Object
org.tweetyproject.logics.pl.syntax.PlFormula
org.tweetyproject.logics.pl.syntax.AssociativePlFormula
org.tweetyproject.logics.pl.syntax.ExclusiveDisjunction
- All Implemented Interfaces:
- Iterable<PlFormula>,- Collection<PlFormula>,- List<PlFormula>,- SequencedCollection<PlFormula>,- Formula,- AssociativeFormulaSupport.AssociativeSupportBridge,- AssociativeFormula<PlFormula>,- ClassicalFormula,- Conjunctable,- Disjunctable,- Invertable,- ProbabilityAware,- SimpleLogicalFormula
This class represents an exclusive disjunction (XOR) in propositional logic.
- Author:
- Anna Gessler, Matthias Thimm
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new (empty) exclusive disjunction.ExclusiveDisjunction(Collection<? extends PlFormula> formulas) Creates a new XOR formula with the given inner formulas.ExclusiveDisjunction(PlFormula first, PlFormula second) Creates a new exclusive disjunction with the two given formulae
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates a deep copy of this formulaThis method collapses all associative operations appearing in this term, e.g.getModels(PlSignature sig) Returns the set of models of this formula wrt.booleanisClause()Checks whether this formula is a clause, i.e.replace(Proposition p, PlFormula f, int i) Replaces the ith instance of the proposition p by f.toCnf()This method returns this formula in conjunctive normal form (CNF).toNnf()This method returns this formula in negation normal form (NNF).trim()Removes duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations.Methods inherited from class org.tweetyproject.logics.pl.syntax.AssociativePlFormulaadd, add, add, addAll, addAll, clear, contains, containsAll, createEmptySignature, equals, get, getAtoms, getFormulas, getFormulas, getLiterals, getPredicates, getSignature, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, numberOfOccurrences, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray, toStringMethods inherited from class org.tweetyproject.logics.pl.syntax.PlFormulacombineWithAnd, combineWithOr, complement, getModels, getPredicateCls, getPrimeImplicants, getUniformProbability, isConjunctiveClause, isLiteral, resolvableWith, resolveWith, toBlakeCanonicalForm, toDnfMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.ListaddFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliteratorMethods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.SimpleLogicalFormulagetPredicateCls, isLiteral
- 
Constructor Details- 
ExclusiveDisjunctionCreates a new XOR formula with the given inner formulas.- Parameters:
- formulas- a collection of formulas.
 
- 
ExclusiveDisjunctionpublic ExclusiveDisjunction()Creates a new (empty) exclusive disjunction.
- 
ExclusiveDisjunction
 
- 
- 
Method Details- 
collapseAssociativeFormulasDescription copied from class:PlFormulaThis method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
- collapseAssociativeFormulasin class- PlFormula
- Returns:
- the collapsed formula.
 
- 
toNnf
- 
cloneDescription copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
- clonein interface- SimpleLogicalFormula
- Specified by:
- clonein class- PlFormula
- Returns:
- the cloned formula
 
- 
createEmptyFormula- Returns:
- an empty version of the AssociativeFormula
 
- 
getOperatorSymbol- Returns:
- A String representing the operator which connects two items of the associative formula.
 
- 
getEmptySymbol- Returns:
- A String representing an empty version of the Associative Formula implementation
 
- 
toCnfDescription copied from class:PlFormulaThis method returns this formula in conjunctive normal form (CNF). A formula is in CNF iff it is a conjunction of disjunctions and in NNF. The CNF generated by this method is not necessarily minimal.
- 
trimDescription copied from class:PlFormulaRemoves duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations. Simplifies equivalences and implications with equivalent formulas (A=>A, A<=>A) to tautologies.
- 
getModelsDescription copied from class:PlFormulaReturns the set of models of this formula wrt. the given signature.
- 
isClause
- 
replaceDescription copied from class:PlFormulaReplaces the ith instance of the proposition p by f.
 
-