Class AlchemyMlnReasoner

    • Field Detail

      • inferCmd

        private java.lang.String inferCmd
        The console command for Alchemy inference.
    • Constructor Detail

      • AlchemyMlnReasoner

        public AlchemyMlnReasoner()
    • Method Detail

      • setAlchemyInferenceCommand

        public void setAlchemyInferenceCommand​(java.lang.String inferCmd)
        Sets the console command for Alchemy inference (default is 'infer').
        Parameters:
        inferCmd - the console command for Alchemy inference.
      • writeAlchemyMlnFile

        private java.io.File writeAlchemyMlnFile​(MarkovLogicNetwork mln,
                                                 FolSignature signature,
                                                 FolFormula formula)
                                          throws java.io.IOException
        Writes the given MLN wrt. the given signature to a temporary file in Alchemy syntax.
        Parameters:
        mln - some MLN.
        signature - some fol signature.
        formula - the query formula that has to be encoded as well.
        Returns:
        the file object of the Alchemy MLN file.
        Throws:
        java.io.IOException - if file writing fails.
      • alchemyStringForFormula

        private java.lang.String alchemyStringForFormula​(RelationalFormula formula)
        Returns the string in Alchemy syntax representing the given formula.
        Parameters:
        formula - some FOL formula
        Returns:
        the string in Alchemy syntax representing the given formula.
      • alchemyStringForTerm

        private java.lang.String alchemyStringForTerm​(Term<?> t)
        Returns the string in Alchemy syntax representing the given term.
        Parameters:
        t - some FOL tern
        Returns:
        the string in Alchemy syntax representing the given term.