Package net.sf.tweety.logics.pl.syntax
Class PlBeliefSet
- java.lang.Object
-
- net.sf.tweety.commons.BeliefSet<PlFormula,PlSignature>
-
- net.sf.tweety.logics.pl.syntax.PlBeliefSet
-
- All Implemented Interfaces:
java.lang.Iterable<PlFormula>
,java.util.Collection<PlFormula>
,BeliefBase
- Direct Known Subclasses:
CompilationNode
,DeductiveKnowledgeBase
public class PlBeliefSet extends BeliefSet<PlFormula,PlSignature>
This class represents a knowledge base of propositional formulae.- Author:
- Matthias Thimm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
PlBeliefSet.PlFormulaHashCodeComparator
Comparator for sorting propositional formulas by comparing hash codes.
-
Field Summary
-
Fields inherited from class net.sf.tweety.commons.BeliefSet
EQUALS_USES_SIGNATURE, signature
-
-
Constructor Summary
Constructors Constructor Description PlBeliefSet()
Creates a new (empty) knowledge base.PlBeliefSet(java.util.Collection<? extends PlFormula> formulas)
Creates a new knowledge base with the given set of formulas.
-
Method Summary
Modifier and Type Method Description java.util.List<PlFormula>
getCanonicalOrdering()
Force ordering on belief set based on comparison of hash codes.PlSignature
getMinimalSignature()
Returns the signature of the language of this knowledge base.java.util.Collection<PlBeliefSet>
getSyntaxComponents()
Returns the set of syntax components of this belief set, i.e.protected PlSignature
instantiateSignature()
Instantiates the signature which is attached to the belief base.Conjunction
toCnf()
This method returns this belief set in conjunctive normal form (CNF).-
Methods inherited from class net.sf.tweety.commons.BeliefSet
add, addAll, clear, contains, containsAll, equals, getSignature, hashCode, instantiateSet, isEmpty, iterator, remove, removeAll, retainAll, setSignature, size, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
PlBeliefSet
public PlBeliefSet()
Creates a new (empty) knowledge base.
-
PlBeliefSet
public PlBeliefSet(java.util.Collection<? extends PlFormula> formulas)
Creates a new knowledge base with the given set of formulas.- Parameters:
formulas
- a set of formulas.
-
-
Method Detail
-
toCnf
public Conjunction toCnf()
This method returns this belief set in conjunctive normal form (CNF). A formula is in CNF iff it is a conjunction of disjunctions and in NNF.- Returns:
- the formula in CNF.
-
getSyntaxComponents
public java.util.Collection<PlBeliefSet> getSyntaxComponents()
Returns the set of syntax components of this belief set, i.e. a partitioning {K1,...,Kn} of K (a disjoint union K1u...uKn=K) such that the signatures of K1,...,Kn are pairwise disjoint.- Returns:
- the set of syntax components of this belief set
-
getCanonicalOrdering
public java.util.List<PlFormula> getCanonicalOrdering()
Force ordering on belief set based on comparison of hash codes.- Returns:
- list of "canonically" ordered formulas
- See Also:
PlBeliefSet.PlFormulaHashCodeComparator
-
getMinimalSignature
public PlSignature getMinimalSignature()
Description copied from interface:BeliefBase
Returns the signature of the language of this knowledge base.- Returns:
- the signature of the language of this knowledge base.
-
instantiateSignature
protected PlSignature instantiateSignature()
Description copied from class:BeliefSet
Instantiates the signature which is attached to the belief base.- Specified by:
instantiateSignature
in classBeliefSet<PlFormula,PlSignature>
- Returns:
- the signature of this belief base
-
-