Class Disjunction
java.lang.Object
org.tweetyproject.logics.pl.syntax.PlFormula
org.tweetyproject.logics.pl.syntax.AssociativePlFormula
org.tweetyproject.logics.pl.syntax.Disjunction
- 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 a disjunction in propositional logic.
- Author:
- Matthias Thimm, Tim Janus
-
Constructor Summary
ConstructorDescriptionCreates a new (empty) disjunction.Disjunction
(Collection<? extends PlFormula> formulas) Creates a new disjunction with the given inner formulas.Disjunction
(PlFormula... formulas) constructorDisjunction
(PlFormula first, PlFormula second) Creates a new disjunction with the two given formulae -
Method Summary
Modifier 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.boolean
isClause()
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.AssociativePlFormula
add, 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, toString
Methods inherited from class org.tweetyproject.logics.pl.syntax.PlFormula
combineWithAnd, combineWithOr, complement, getModels, getPredicateCls, getPrimeImplicants, getUniformProbability, isConjunctiveClause, isLiteral, resolvableWith, resolveWith, toBlakeCanonicalForm, toDnf
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
Methods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.SimpleLogicalFormula
getPredicateCls, isLiteral
-
Constructor Details
-
Disjunction
Creates a new disjunction with the given inner formulas.- Parameters:
formulas
- a collection of formulas.
-
Disjunction
-
Disjunction
public Disjunction()Creates a new (empty) disjunction. -
Disjunction
-
-
Method Details
-
collapseAssociativeFormulas
Description copied from class:PlFormula
This method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulas
in classPlFormula
- Returns:
- the collapsed formula.
-
toNnf
-
clone
Description copied from interface:SimpleLogicalFormula
Creates a deep copy of this formula- Specified by:
clone
in interfaceSimpleLogicalFormula
- Specified by:
clone
in classPlFormula
- 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
-
toCnf
Description copied from class:PlFormula
This 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. -
trim
Description copied from class:PlFormula
Removes duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations. Simplifies equivalences and implications with equivalent formulas (A=>A, A<=>A) to tautologies. -
getModels
Description copied from class:PlFormula
Returns the set of models of this formula wrt. the given signature. -
isClause
-
replace
Description copied from class:PlFormula
Replaces the ith instance of the proposition p by f.
-