Class AbstractMlnReasoner

    • Constructor Detail

      • AbstractMlnReasoner

        public AbstractMlnReasoner()
    • Method Detail

      • query

        public java.lang.Double query​(MarkovLogicNetwork mln,
                                      FolFormula query,
                                      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,
                                       HerbrandInterpretation hInt,
                                       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​(FolFormula formula,
                                                  HerbrandInterpretation hInt,
                                                  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,
                                          FolFormula query,
                                          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.