|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.lehigh.swat.obione.RuleGoalTree
public class RuleGoalTree
Models the rule goal tree of the PDMS.
| Field Summary | |
|---|---|
private int |
counter
|
private Node |
current
|
private LAVProcessor |
lp
|
private GoalNode |
root
|
private Rewrite |
rw
|
private java.util.ArrayList<org.semanticweb.kaon2.api.rules.Variable> |
varList
|
| Constructor Summary | |
|---|---|
RuleGoalTree(GoalNode g)
Constucts a RG tree with a goal node as its root The goal node's label should be the query goal and the rule nodes label should be the query itself. |
|
| Method Summary | |
|---|---|
(package private) GoalNode |
addAndNode(GoalNode gn,
RuleNode rule)
Adds an andNode (i.e a GAV definitional expansion of a goal node) |
(package private) GoalNode |
addOrNode(GoalNode gn,
RuleNode rule)
Adds an orNode (i.e Performs a LAV definitional expansion of a goal node) |
void |
addRuleNode(GoalNode g,
Map m)
Adds a rule node child to goal node |
private org.semanticweb.kaon2.api.rules.Literal |
applySub(java.util.HashMap theta,
org.semanticweb.kaon2.api.rules.Literal l)
|
private org.semanticweb.kaon2.api.rules.Rule |
applySubToRule(java.util.HashMap theta,
org.semanticweb.kaon2.api.rules.Rule r)
|
private java.util.List<org.semanticweb.kaon2.api.rules.Variable> |
getExistentialVariables(org.semanticweb.kaon2.api.rules.Rule r)
Helper function |
GoalNode |
getRoot()
|
java.util.Vector<Node> |
getSiblings(Node n)
Gets the siblings given a node |
static void |
main(java.lang.String[] args)
|
private org.semanticweb.kaon2.api.rules.Rule |
makeFresh(org.semanticweb.kaon2.api.rules.Rule r)
Helper method, makes all exisistential variables fresh variables existential variables are all non distingusiged variables |
void |
showTree(Node start,
int indentLevel)
|
private java.util.HashMap |
unify(org.semanticweb.kaon2.api.rules.Literal l1,
org.semanticweb.kaon2.api.rules.Literal l2)
Helper method for unifying two predicates |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private GoalNode root
private Node current
private java.util.ArrayList<org.semanticweb.kaon2.api.rules.Variable> varList
private int counter
private LAVProcessor lp
private Rewrite rw
| Constructor Detail |
|---|
public RuleGoalTree(GoalNode g)
| Method Detail |
|---|
public void addRuleNode(GoalNode g,
Map m)
g - m -
GoalNode addAndNode(GoalNode gn,
RuleNode rule)
gn - Goal node to be expanded
GoalNode addOrNode(GoalNode gn,
RuleNode rule)
gn - Goal node to be expandedrn - Rule that will be appliedpublic GoalNode getRoot()
public void showTree(Node start,
int indentLevel)
public java.util.Vector<Node> getSiblings(Node n)
n -
public static void main(java.lang.String[] args)
throws org.semanticweb.kaon2.api.KAON2Exception,
java.lang.InterruptedException
org.semanticweb.kaon2.api.KAON2Exception
java.lang.InterruptedException
private org.semanticweb.kaon2.api.rules.Rule applySubToRule(java.util.HashMap theta,
org.semanticweb.kaon2.api.rules.Rule r)
private org.semanticweb.kaon2.api.rules.Literal applySub(java.util.HashMap theta,
org.semanticweb.kaon2.api.rules.Literal l)
private java.util.HashMap unify(org.semanticweb.kaon2.api.rules.Literal l1,
org.semanticweb.kaon2.api.rules.Literal l2)
l1 - l2 -
private org.semanticweb.kaon2.api.rules.Rule makeFresh(org.semanticweb.kaon2.api.rules.Rule r)
-
private java.util.List<org.semanticweb.kaon2.api.rules.Variable> getExistentialVariables(org.semanticweb.kaon2.api.rules.Rule r)
r -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||