|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.deri.iris.rules.RuleManipulator
public class RuleManipulator
A collection of useful rule manipulation operations.
| Constructor Summary | |
|---|---|
RuleManipulator()
|
|
| Method Summary | |
|---|---|
IRule |
addBodyLiteral(IRule rule,
ILiteral literal)
Add a literal to a rule body. |
IRule |
addEquality(IRule rule,
ITerm term1,
ITerm term2)
Append an equality term to the rule body. |
IRule |
addInequality(IRule rule,
ITerm term1,
ITerm term2)
Append an inequality term to the rule body. |
static IQuery |
removeDuplicateLiterals(IQuery query)
Creates a new query with all duplicates removed. |
IRule |
removeDuplicateLiterals(IRule rule)
Traverse the body literals and remove any duplicates. |
IRule |
removeUnnecessaryEqualityBuiltins(IRule rule)
Remove positive equalities that equate something to itself. |
IAtom |
replace(IAtom atom,
ITerm remove,
ITerm replaceWith)
|
IRule |
replace(IRule rule,
boolean processHead,
ITerm remove,
ITerm replaceWith)
Replace all occurrences of 'remove' with 'replaceWith'. |
IRule |
replaceVariablesWithConstants(IRule rule,
boolean strict)
Iterate the rule looking for positive variable==constant exact equalities. |
IRule |
replaceVariablesWithVariables(IRule rule)
Iterate the rule looking for positive variable=variable equality built-ins. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RuleManipulator()
| Method Detail |
|---|
public IRule addEquality(IRule rule,
ITerm term1,
ITerm term2)
rule - The rule to process.term1 - The first argument to the equality.term2 - The second argument to the equality.
public IRule addInequality(IRule rule,
ITerm term1,
ITerm term2)
rule - The rule to process.term1 - The first argument to the inequality.term2 - The second argument to the inequality.
public IRule addBodyLiteral(IRule rule,
ILiteral literal)
rule - The rule to process.literal - The literal to add.
public static IQuery removeDuplicateLiterals(IQuery query)
query - the query from where to take the literals
public IRule removeDuplicateLiterals(IRule rule)
rule - The rule to examine.
public IRule replaceVariablesWithVariables(IRule rule)
rule - The rule to process.
public IRule replaceVariablesWithConstants(IRule rule,
boolean strict)
rule - The rule to processstrict - True, do replacements only for exact equalities.
False, use any equality.
public IRule removeUnnecessaryEqualityBuiltins(IRule rule)
rule - The rule to process.
public IRule replace(IRule rule,
boolean processHead,
ITerm remove,
ITerm replaceWith)
rule - The rule to modifyprocessHead - true, to modifix the head as well as the bodyremove - The term to removereplaceWith - The term to replace with
public IAtom replace(IAtom atom,
ITerm remove,
ITerm replaceWith)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||