Package net.sf.tweety.logics.cl.reasoner
Class CReasoner
- java.lang.Object
-
- net.sf.tweety.logics.cl.reasoner.AbstractConditionalLogicReasoner
-
- net.sf.tweety.logics.cl.reasoner.CReasoner
-
- All Implemented Interfaces:
ModelProvider<Conditional,ClBeliefSet,RankingFunction>
,QualitativeReasoner<ClBeliefSet,PlFormula>
,Reasoner<java.lang.Boolean,ClBeliefSet,PlFormula>
public class CReasoner extends AbstractConditionalLogicReasoner
This class models a c-reasoner for conditional logic. Reasoning is performed by computing a minimal c-representation for the given knowledge base.
A c-representation for a conditional knowledge base R={r1,...,rn} is a ranking function k such that k accepts every conditional in R (k |= R) and if there are numbers k0,k1+,k1-,...,kn+,kn- with
k(w)=k0 + \sum_{w verifies ri} ki+ + \sum_{w falsifies ri} kj- for every w. A c-representation is minimal if k0+...+kn- is minimal. This reasoner uses mathematical optimization for solving the above problem and is usually faster than the brute force approach.
See Gabriele Kern-Isberner. Conditionals in nonmonotonic reasoning and belief revision. Lecture Notes in Computer Science, Volume 2087. 2001.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description CReasoner()
-
Method Summary
Modifier and Type Method Description private Statement
getAcceptanceConstraint(Conditional cond, java.util.Map<PossibleWorld,IntegerVariable> ranks)
For the given conditional (B|A) and the given ranks of possible worlds, this method constructs the inequation k(AB) < k(A-B) where k(AB) is the minimum of the ranks of the interpretations that satisfy AB.RankingFunction
getModel(ClBeliefSet kb)
Returns a single (dedicated) model of the given belief base.private Statement
getRankConstraint(PossibleWorld w, IntegerVariable ranki, java.util.Map<Conditional,IntegerVariable> kappa_pos, java.util.Map<Conditional,IntegerVariable> kappa_neg)
For the given interpretation "i" and the given kappas, this method computes the constraint
k("i")=\sum_{"i" verifies ri} ki+ + \sum_{"i" falsifies ri} kj--
Methods inherited from class net.sf.tweety.logics.cl.reasoner.AbstractConditionalLogicReasoner
getModels, query
-
-
-
-
Method Detail
-
getAcceptanceConstraint
private Statement getAcceptanceConstraint(Conditional cond, java.util.Map<PossibleWorld,IntegerVariable> ranks)
For the given conditional (B|A) and the given ranks of possible worlds, this method constructs the inequation k(AB) < k(A-B) where k(AB) is the minimum of the ranks of the interpretations that satisfy AB.- Parameters:
cond
- a conditionalranks
- a map from possible worlds to integer variables- Returns:
- an inequation representing the acceptance of the conditional
-
getRankConstraint
private Statement getRankConstraint(PossibleWorld w, IntegerVariable ranki, java.util.Map<Conditional,IntegerVariable> kappa_pos, java.util.Map<Conditional,IntegerVariable> kappa_neg)
For the given interpretation "i" and the given kappas, this method computes the constraint
k("i")=\sum_{"i" verifies ri} ki+ + \sum_{"i" falsifies ri} kj-- Parameters:
w
- a possible world.ranki
- the rank (an integer variable) of interpretation "i".kappa_pos
- the positive penalties for interpretations.kappa_neg
- the negative penalties for interpretations.- Returns:
- the mathematical statement
-
getModel
public RankingFunction getModel(ClBeliefSet kb)
Description copied from interface:ModelProvider
Returns a single (dedicated) model of the given belief base. If the implemented method allows for more than one dedicated model, the selection may be non-deterministic.- Specified by:
getModel
in interfaceModelProvider<Conditional,ClBeliefSet,RankingFunction>
- Specified by:
getModel
in classAbstractConditionalLogicReasoner
- Parameters:
kb
- some belief base- Returns:
- a selected model of the belief base.
-
-