Class HsInconsistencyMeasure<B extends BeliefBase,S extends Formula>
- java.lang.Object
-
- net.sf.tweety.logics.commons.analysis.BeliefSetInconsistencyMeasure<S>
-
- net.sf.tweety.logics.commons.analysis.HsInconsistencyMeasure<B,S>
-
- Type Parameters:
B
- some belief base typeS
- some formula type
- All Implemented Interfaces:
PostulateEvaluatable<S>
,InconsistencyMeasure<BeliefSet<S,?>>
public class HsInconsistencyMeasure<B extends BeliefBase,S extends Formula> extends BeliefSetInconsistencyMeasure<S>
This class implements the Hitting Set inconsistency measure as proposed in [Thimm, 2014, in preparation]. The inconsistency value is defined as one plus the minimal number of interpretations, s.t. every formula of the belief set is satisfied by at least one interpretation. This is equivalent in the cardinality of a minimal partitioning of the knowledge base such that each partition is consistent.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private InterpretationIterator<S,B,? extends Interpretation<B,S>>
it
Used for iterating over interpretations of the underlying language.-
Fields inherited from interface net.sf.tweety.logics.commons.analysis.InconsistencyMeasure
MEASURE_TOLERANCE
-
-
Constructor Summary
Constructors Constructor Description HsInconsistencyMeasure(InterpretationIterator<S,B,? extends Interpretation<B,S>> it)
Creates a new inconsistency measure that uses the interpretations given by the given iterator.
-
Method Summary
Modifier and Type Method Description private java.util.Collection<Interpretation<B,S>>
getHittingSet(java.util.Collection<S> formulas, int card, java.util.Collection<Interpretation<B,S>> interpretations)
Determines a hitting set of the given cardinality.java.lang.Double
inconsistencyMeasure(java.util.Collection<S> formulas)
This method measures the inconsistency of the given set of formulas.private boolean
isHittingSet(java.util.Collection<S> formulas, java.util.Collection<Interpretation<B,S>> candidate)
Checks whether the given candidate is a hitting set.java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.logics.commons.analysis.BeliefSetInconsistencyMeasure
inconsistencyMeasure
-
-
-
-
Field Detail
-
it
private InterpretationIterator<S extends Formula,B extends BeliefBase,? extends Interpretation<B extends BeliefBase,S extends Formula>> it
Used for iterating over interpretations of the underlying language.
-
-
Constructor Detail
-
HsInconsistencyMeasure
public HsInconsistencyMeasure(InterpretationIterator<S,B,? extends Interpretation<B,S>> it)
Creates a new inconsistency measure that uses the interpretations given by the given iterator.- Parameters:
it
- some interpretation iterator.
-
-
Method Detail
-
inconsistencyMeasure
public java.lang.Double inconsistencyMeasure(java.util.Collection<S> formulas)
Description copied from class:BeliefSetInconsistencyMeasure
This method measures the inconsistency of the given set of formulas.- Specified by:
inconsistencyMeasure
in classBeliefSetInconsistencyMeasure<S extends Formula>
- Parameters:
formulas
- a collection of formulas.- Returns:
- a Double indicating the degree of inconsistency.
-
getHittingSet
private java.util.Collection<Interpretation<B,S>> getHittingSet(java.util.Collection<S> formulas, int card, java.util.Collection<Interpretation<B,S>> interpretations)
Determines a hitting set of the given cardinality. If no such hitting set exists null is returned.- Parameters:
formulas
- a collection of formulascard
- some cardinality.interpretations
- in addition to the card interpretations also use this set for satisfying formulas.- Returns:
- a hitting set or null.
-
isHittingSet
private boolean isHittingSet(java.util.Collection<S> formulas, java.util.Collection<Interpretation<B,S>> candidate)
Checks whether the given candidate is a hitting set.- Parameters:
formulas
- some set of formulascandidate
- some set of interpretation.- Returns:
- "true" if the candidate is a hitting set.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-