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() |
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(MarkovLogicNetwork mln,
FolFormula query,
FolSignature signature)
Performs the actual querying.
|
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, numberOfGroundSatisfactions, query, query
public void setAlchemyInferenceCommand(java.lang.String inferCmd)
inferCmd
- the console command for Alchemy inference.public double doQuery(MarkovLogicNetwork mln, FolFormula query, FolSignature signature)
AbstractMlnReasoner
doQuery
in class AbstractMlnReasoner
mln
- an MLNquery
- 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 tern