public class AlchemyMlnReasoner extends AbstractMlnReasoner
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
inferCmd
The console command for Alchemy inference.
|
| Constructor and Description |
|---|
AlchemyMlnReasoner(BeliefBase beliefBase)
Creates a new AlchemyMlnReasoner for the given Markov logic network.
|
AlchemyMlnReasoner(BeliefBase beliefBase,
FolSignature signature)
Creates a new AlchemyMlnReasoner for the given Markov logic network.
|
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
alchemyStringForFormula(RelationalFormula formula)
Returns the string in Alchemy syntax representing the given formula.
|
private java.lang.String |
alchemyStringForTerm(Term<?> t)
Returns the string in Alchemy syntax representing the given term.
|
double |
doQuery(FolFormula query)
Performs the actual querying.
|
void |
reset()
Resets this reasoner (removes cached files etc.)
|
void |
setAlchemyInferenceCommand(java.lang.String inferCmd)
Sets the console command for Alchemy inference (default is 'infer').
|
private java.io.File |
writeAlchemyMlnFile(MarkovLogicNetwork mln,
FolSignature signature,
FolFormula formula)
Writes the given MLN wrt.
|
computeWeight, getSignature, numberOfGroundSatisfactions, querygetKnowledgeBasepublic AlchemyMlnReasoner(BeliefBase beliefBase)
beliefBase - a Markov logic network.public AlchemyMlnReasoner(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)public void setAlchemyInferenceCommand(java.lang.String inferCmd)
inferCmd - the console command for Alchemy inference.public double doQuery(FolFormula query)
AbstractMlnReasonerdoQuery in class AbstractMlnReasonerquery - a fol formula guaranteed to be ground.private java.io.File writeAlchemyMlnFile(MarkovLogicNetwork mln, FolSignature signature, FolFormula formula) throws java.io.IOException
mln - some MLN.signature - some fol signature.queryFormula - the query formula that has to be encoded as well.java.io.IOException - if file writing fails.private java.lang.String alchemyStringForFormula(RelationalFormula formula)
formula - some FOL formulaprivate java.lang.String alchemyStringForTerm(Term<?> t)
tern - some FOL ternpublic void reset()
AbstractMlnReasonerreset in class AbstractMlnReasoner