public abstract class AbstractMlnReasoner extends Reasoner
Modifier and Type | Field and Description |
---|---|
private FolSignature |
signature
The signature of the reasoner.
|
Constructor and Description |
---|
AbstractMlnReasoner(BeliefBase beliefBase)
Creates a new reasoner for the given Markov logic network.
|
AbstractMlnReasoner(BeliefBase beliefBase,
FolSignature signature)
Creates a new reasoner for the given Markov logic network.
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeWeight(HerbrandInterpretation hInt)
Computes the (unnormalized) weight of the given Herbrand interpretation
with respect to the formulas in this reasoner's MLN.
|
protected abstract double |
doQuery(FolFormula query)
Performs the actual querying.
|
protected FolSignature |
getSignature()
Returns the signature used for reasoning.
|
protected int |
numberOfGroundSatisfactions(FolFormula formula,
HerbrandInterpretation hInt)
Computes the number of instantiations of the formula, wrt.
|
Answer |
query(Formula query)
This method determines the answer of the given query
wrt.
|
abstract void |
reset()
Resets this reasoner (removes cached files etc.)
|
getKnowledgeBase
private FolSignature signature
public AbstractMlnReasoner(BeliefBase beliefBase)
beliefBase
- a Markov logic network.public AbstractMlnReasoner(BeliefBase beliefBase, FolSignature signature)
beliefBase
- a Markov logic network.signature
- another signature (if the probability distribution should be defined
on that one (that one should subsume the signature of the Markov logic network)protected FolSignature getSignature()
public abstract void reset()
public Answer query(Formula query)
Reasoner
protected double computeWeight(HerbrandInterpretation hInt)
hInt
- a Herbrand interpretationprotected int numberOfGroundSatisfactions(FolFormula formula, HerbrandInterpretation hInt)
formula
- some fol formula.hInt
- a Herbrand interpretation.protected abstract double doQuery(FolFormula query)
query
- a fol formula guaranteed to be ground.