Class AbstractMlnReasoner

    • Method Summary

      Modifier and Type Method Description
      protected double computeWeight​(MarkovLogicNetwork mln, net.sf.tweety.logics.fol.semantics.HerbrandInterpretation hInt, net.sf.tweety.logics.fol.syntax.FolSignature signature)
      Computes the (unnormalized) weight of the given Herbrand interpretation with respect to the formulas in this reasoner's MLN.
      protected abstract double doQuery​(MarkovLogicNetwork mln, net.sf.tweety.logics.fol.syntax.FolFormula query, net.sf.tweety.logics.fol.syntax.FolSignature signature)
      Performs the actual querying.
      protected int numberOfGroundSatisfactions​(net.sf.tweety.logics.fol.syntax.FolFormula formula, net.sf.tweety.logics.fol.semantics.HerbrandInterpretation hInt, net.sf.tweety.logics.fol.syntax.FolSignature signature)
      Computes the number of instantiations of the formula, wrt.
      Double query​(MarkovLogicNetwork mln, net.sf.tweety.logics.fol.syntax.FolFormula query)  
      Double query​(MarkovLogicNetwork mln, net.sf.tweety.logics.fol.syntax.FolFormula query, net.sf.tweety.logics.fol.syntax.FolSignature signature)
      Queries the given MLN wrt.
    • Constructor Detail

      • AbstractMlnReasoner

        public AbstractMlnReasoner()
    • Method Detail

      • query

        public Double query​(MarkovLogicNetwork mln,
                            net.sf.tweety.logics.fol.syntax.FolFormula query)
        Specified by:
        query in interface net.sf.tweety.commons.Reasoner<Double,​MarkovLogicNetwork,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • query

        public Double query​(MarkovLogicNetwork mln,
                            net.sf.tweety.logics.fol.syntax.FolFormula query,
                            net.sf.tweety.logics.fol.syntax.FolSignature signature)
        Queries the given MLN wrt. the given signature
        Parameters:
        mln - some mln
        query - some query
        signature - some signature
        Returns:
        the answer to the query
      • computeWeight

        protected double computeWeight​(MarkovLogicNetwork mln,
                                       net.sf.tweety.logics.fol.semantics.HerbrandInterpretation hInt,
                                       net.sf.tweety.logics.fol.syntax.FolSignature signature)
        Computes the (unnormalized) weight of the given Herbrand interpretation with respect to the formulas in this reasoner's MLN.
        Parameters:
        mln - an MLN
        hInt - a Herbrand interpretation
        signature - the underlying signature
        Returns:
        the (unnormalized) weight of the given Herbrand interpretation
      • numberOfGroundSatisfactions

        protected int numberOfGroundSatisfactions​(net.sf.tweety.logics.fol.syntax.FolFormula formula,
                                                  net.sf.tweety.logics.fol.semantics.HerbrandInterpretation hInt,
                                                  net.sf.tweety.logics.fol.syntax.FolSignature signature)
        Computes the number of instantiations of the formula, wrt. the given signature, that are satisfied in the given Herbrand interpretation.
        Parameters:
        formula - some fol formula.
        hInt - a Herbrand interpretation.
        signature - the underlying signature
        Returns:
        the number of instantiations of the formula, wrt. the given signature, that are satisfied in the given Herbrand interpretation.
      • doQuery

        protected abstract double doQuery​(MarkovLogicNetwork mln,
                                          net.sf.tweety.logics.fol.syntax.FolFormula query,
                                          net.sf.tweety.logics.fol.syntax.FolSignature signature)
        Performs the actual querying.
        Parameters:
        mln - an MLN
        query - a fol formula guaranteed to be ground.
        signature - the signature
        Returns:
        the answer of the query.