Interface ReasoningSymbolTable

All Superinterfaces:
AutoCloseable, Closeable, Iterable<Object>, SymbolTable
All Known Implementing Classes:
AbstractSymbolTable, MultiSymbolTable, ReasoningSymbolTableNotInternalize, ReasoningSymbolTableRAM, SymbolTableBplus, SymbolTableRAM

public interface ReasoningSymbolTable extends SymbolTable
As an extension of the symbol table it provides methods for matching and substituting terms
  • Method Details

    • createNonGroundFunction

      Function createNonGroundFunction(Function t) throws SemReasonerException, IOException
      Compile a non-ground user term into a non-ground internal term. This internal term is hidden. It should be used in the internal operations
      created by a rule compiler. It must be used for matching operations and for substitution operations (see methods below)
      Specified by:
      createNonGroundFunction in interface SymbolTable
      Parameters:
      t - , the user term
      Returns:
      term (Function)
      Throws:
      IOException
      SemReasonerException
    • match

      boolean match(Object t, long groundterm, long[] substitutions) throws IOException, SemReasonerException
      Match returns for each variable v in t the symbol s v has to be substituted by.
      The result provides for variable position p the code of s.
      Specified by:
      match in interface SymbolTable
      Parameters:
      t - , the entity (Variable, Function, Long, Literal)
      groundterm - , the code of the ground term
      substitutions - , the substitutions substitutions[variable position] is substituted term for variable
      Returns:
      true, if match operation was successful
      Throws:
      IOException
      SemReasonerException
    • matchArguments

      boolean matchArguments(Object t, long[] groundtermarguments, long[] substitutions) throws IOException, SemReasonerException
      Match returns for each variable v in t the symbol s v has to be substituted by to match the arguments of t
      with groundtermarguments. The result provides for variable position p the code of s
      Specified by:
      matchArguments in interface SymbolTable
      Parameters:
      t - , the entity (Variable, Function, Long, Literal)
      groundtermarguments - , the codes of the arguments of the ground term
      substitutions - , the substitutions substitutions[variable position] is substituted term for variable
      Returns:
      true, if match operation was successful
      Throws:
      IOException
      SemReasonerException
    • substitute

      long substitute(Object t, long[] substitutions) throws SemReasonerException, IOException
      substitutes the variables in an internal term by the codes found in substitutions, internalizes the resulting term and returns the code of the term Attention: do not use this method with same object t in several threads in parallel, it is NOT threadsafe! If you want to do that you have to create a clone of t for every thread!
      Specified by:
      substitute in interface SymbolTable
      Parameters:
      t - , entity (Variable, Function, Long, Literal)
      substitutions -
      Returns:
      Throws:
      IOException
      SemReasonerException
    • substituteArguments

      long[] substituteArguments(Object t, long[] substitutions) throws SemReasonerException, IOException
      substitutes the variables in a compound t by the codes found in substitutions, internalizes the resulting terms and returns the arguments of t. Attention: do not use this method with same object t in several threads in parallel, it is NOT threadsafe! If you want to do that you have to create a clone of t for every thread!
      Specified by:
      substituteArguments in interface SymbolTable
      Parameters:
      t - , entity (Variable, Function, Long, Literal)
      substitutions -
      Returns:
      Throws:
      IOException
      SemReasonerException
    • unifiable

      boolean unifiable(Object t, Object f) throws SemReasonerException, IOException
      Unifiable returns whether two structures are unifiable This method is cheaper than unify as it delivers no result substitutions
      Specified by:
      unifiable in interface SymbolTable
      Parameters:
      t - , the first entity (Variable, Function, Long, Literal)
      f - , the second entity (Variable, Function, Long, Literal)
      Returns:
      true, if unifiable operation was successful
      Throws:
      IOException
      SemReasonerException
    • isCreatedDuringReasoning

      boolean isCreatedDuringReasoning(long code)
      indicated for a code, that the corresponding symbol has been created during reasoning
      Parameters:
      code -
      Returns: