Class SInE


public class SInE extends InferenceEngine
Author:
Krystof Hoder - Minor changes by Adam Pease
  • Constructor Details

  • Method Details

    • getNewInstance

      public static SInE getNewInstance(String kbFileName)
    • getFactory

      public static InferenceEngine.EngineFactory getFactory()
    • loadNonKif

      public List<String> loadNonKif(File kbFile)
      Loads formulas from given source.
    • loadFormulas

      public void loadFormulas(Iterable<String> formulaSource)
      Loads formulas from given source.
      Parameters:
      formulaSource - Iterable object that contains strings representing formulas.
    • getSymbols

      public Set<String> getSymbols(String form)
      Returns all symbols occurring in given formula.
      Parameters:
      form - Formula to get symbols from.
      Returns:
      Symbols occurring in given formula.
    • getSymbols

      public Set<String> getSymbols(Collection<String> forms)
    • get1RequiredFormulas

      public Set<String> get1RequiredFormulas(Collection<String> symbols)
      Returns formulas that are directly required by given symbols (in the sense of requirements map).
      Parameters:
      symbols - Symbols whose required formulas will be found.
      Returns:
      Formulas required by symbols.
    • getRequiredSymbols

      public Set<String> getRequiredSymbols(Collection<String> symbols)
      Returns all symbols transitively required by given symbols (in the sense of requirements map).
      Parameters:
      symbols - Collection of symbols to be closed under requirements relation.
      Returns:
      Closure of given collection of symbols under requirements relation.
    • getRequiredFormulas

      public Set<String> getRequiredFormulas(Collection<String> symbols)
      Returns formulas that are transitively required by given symbols (in the sense of requirements map).
      Parameters:
      symbols - Symbols whose required formulas will be found.
      Returns:
      Formulas transitively required by symbols.
    • performSelection

      public Set<String> performSelection(String form)
      Performs axiom selection for given query.
      Parameters:
      form - Formula, according to which axioms will be selected.
      Returns:
      Selected formulas.
    • submitQuery

      public String submitQuery(String formula, int timeLimit, int bindingsLimit) throws IOException
      Description copied from class: InferenceEngine
      Submit a query.
      Specified by:
      submitQuery in class InferenceEngine
      Parameters:
      formula - query in the KIF syntax
      timeLimit - time limit for answering the query (in seconds)
      bindingsLimit - limit on the number of bindings
      Returns:
      answer to the query (in the XML syntax)
      Throws:
      IOException - should not normally be thrown
    • assertFormula

      public String assertFormula(String formula)
      Description copied from class: InferenceEngine
      Add an assertion.
      Specified by:
      assertFormula in class InferenceEngine
      Parameters:
      formula - asserted formula in the KIF syntax
      Returns:
      answer to the assertion (in the XML syntax)
    • test

      public static void test(String[] args)
      A simple test to load a KB file and pose a query, which are the first and second item, respectively, given on the command line.
    • main

      public static void main(String[] args) throws Exception
      A simple test to load a KB file and pose a query, which are the first and second item, respectively, given on the command line.
      Throws:
      Exception