jdrew.oo.td.builtins
Class RegisterBuiltin

java.lang.Object
  extended by jdrew.oo.td.builtins.TDBuiltin
      extended by jdrew.oo.td.builtins.RegisterBuiltin

public class RegisterBuiltin
extends TDBuiltin

The class implements a "builtin" for registering a new clause into the running knowledge base. While this would not normally be considered a built-in relation it is implement as such to provide for easy implementation.

Title: OO jDREW

Description: Reasoning Engine for the Semantic Web - Supporting OO RuleML 0.88

Copyright: Copyright (c) 2005

Version:
0.89
Author:
Marcel A. Ball

Constructor Summary
RegisterBuiltin(BackwardReasoner br, java.lang.String symbol)
          Constructs a new object to implement the register built-in relation.
 
Method Summary
 DefiniteClause buildResult(BackwardReasoner.GoalList gl, int term)
          This method performs the actions necessary to implement the register built-in relation.
 int getSymbol()
          Access the symbol code for the assert built-in relation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegisterBuiltin

public RegisterBuiltin(BackwardReasoner br,
                       java.lang.String symbol)
Constructs a new object to implement the register built-in relation. This constructor must be passed a reference to the backward reasoner object that the built-in will be registered in.

Parameters:
br - BackwardReasoner - The backward reasoner engine that will register this built-in relationship.
symbol - String - the symbol string
Method Detail

getSymbol

public int getSymbol()
Access the symbol code for the assert built-in relation.

Overrides:
getSymbol in class TDBuiltin
Returns:
int The symbol code for the assert built-in relation.

buildResult

public DefiniteClause buildResult(BackwardReasoner.GoalList gl,
                                  int term)
This method performs the actions necessary to implement the register built-in relation. This will assert the clause that is the parameter to the assert into the running knowledge base and cause the goal to succeed.

Overrides:
buildResult in class TDBuiltin
Parameters:
gl - GoalList goal list that contains the call to the assert built-in relation.
term - int An index into the atoms (array) of the clause (0 is the head, i = 1..n is the ith atom of the body of the clause) to the atom that is the call to the assert built-in relation.
Returns:
DefiniteClause A clause that will successfully unify with the call to the built-in if it should succeed. null or a fact that will not unify (null is preferred as it is more efficient) should be returned if the call to built-in relation should not succeed.