Class RelationalRankingFunction
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<RclBeliefSet,RelationalConditional>
-
- net.sf.tweety.logics.rcl.semantics.RelationalRankingFunction
-
- All Implemented Interfaces:
net.sf.tweety.commons.Interpretation<RclBeliefSet,RelationalConditional>
public class RelationalRankingFunction extends net.sf.tweety.commons.AbstractInterpretation<RclBeliefSet,RelationalConditional>
A relational ranking function (or relational ordinal conditional function, ROCF) that maps Herbrand interpretations to integers.
See W. Spohn. Ordinal conditional functions: a dynamic theory of epistemic states. In W.L. Harper and B. Skyrms, editors, Causation in Decision, Belief Change, and Statistics, II, pages 105-134. Kluwer Academic Publishers, 1988.
See also [Kern-Isberner,Thimm, "A Ranking Semantics for Relational Defaults", in preparation].- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description RelationalRankingFunction(net.sf.tweety.logics.fol.syntax.FolSignature signature)Creates a new ranking function mapping each given interpretation to zero.
-
Method Summary
Modifier and Type Method Description Set<net.sf.tweety.logics.fol.semantics.HerbrandInterpretation>getPossibleInterpretations()Returns all interpretations that are mapped to a rank unequal to INFINITY.voidnormalize()Normalizes this OCF, i.e.IntegernumFalsifiedInstances(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w, RelationalConditional rc)Returns the number of instances of "rc" that are falsified by the given interpretation.IntegernumVerifiedInstances(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w, RelationalConditional rc)Returns the number of instances of "rc" that are verified by the given interpretation.Integerrank(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w)Gets the rank of the given Herbrand interpretation.Integerrank(net.sf.tweety.logics.fol.syntax.FolFormula formula)Gets the rank of the given sentence (ground formula).booleansatisfies(RclBeliefSet beliefBase)booleansatisfies(RelationalConditional formula)voidsetRank(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w, Integer value)Sets the rank for the given Herbrand interpretation.StringtoString()
-
-
-
Field Detail
-
INFINITY
public static final Integer INFINITY
Integer used to define infinity.
-
-
Method Detail
-
rank
public Integer rank(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w) throws IllegalArgumentException
Gets the rank of the given Herbrand interpretation.- Parameters:
w- a Herbrand interpretation.- Returns:
- the rank of the given Herbrand interpretation.
- Throws:
IllegalArgumentException- if the given Herbrand interpretation has no rank in this ranking function.
-
setRank
public void setRank(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w, Integer value)Sets the rank for the given Herbrand interpretation.- Parameters:
w- a Herbrand interpretation.value- the rank for the Herbrand interpretation.
-
rank
public Integer rank(net.sf.tweety.logics.fol.syntax.FolFormula formula) throws IllegalArgumentException
Gets the rank of the given sentence (ground formula). Throws an IllegalArgumentException when the language of the formula does not correspond to the language of the interpretations this ranking function is defined on or the formula is not a sentence. Otherwise the rank of a formula is defined as the minimal rank of its satisfying interpretations.- Parameters:
formula- a formula.- Returns:
- the rank of the given formula.
- Throws:
IllegalArgumentException- if the languages of the formula does not correspond to the language of the interpretations this ranking function is defined on or the formula is not a sentence.
-
satisfies
public boolean satisfies(RelationalConditional formula) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
satisfies
public boolean satisfies(RclBeliefSet beliefBase) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
normalize
public void normalize()
Normalizes this OCF, i.e. appropriately shifts the ranks such that the minimal rank equals zero.
-
getPossibleInterpretations
public Set<net.sf.tweety.logics.fol.semantics.HerbrandInterpretation> getPossibleInterpretations()
Returns all interpretations that are mapped to a rank unequal to INFINITY.- Returns:
- all interpretations that are mapped to a rank unequal to INFINITY.
-
numFalsifiedInstances
public Integer numFalsifiedInstances(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w, RelationalConditional rc)
Returns the number of instances of "rc" that are falsified by the given interpretation.- Parameters:
w- a Herbrand interpretation.rc- a relational conditional.- Returns:
- the number of instances of "rc" that are falsified by the given interpretation.
-
numVerifiedInstances
public Integer numVerifiedInstances(net.sf.tweety.logics.fol.semantics.HerbrandInterpretation w, RelationalConditional rc)
Returns the number of instances of "rc" that are verified by the given interpretation.- Parameters:
w- a Herbrand interpretation.rc- a relational conditional.- Returns:
- the number of instances of "rc" that are verified by the given interpretation.
-
-