|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Rule
Represents a rule in the program. A rule consists of a positive head literal and of a conjunction of several body literals. A rule must be range-restricted (also called safe or allowed), which means that each variable from the head must occur in some positive literal in the body.
| Nested Class Summary | |
|---|---|
static class |
Rule.SubsumptionResult
Returns the result of a subsumption check. |
static class |
Rule.SubsumptionType
The enumeration of the types of subsumption relationships. |
| Method Summary | |
|---|---|
int |
getBodyLength()
Returns the number of body literals. |
Literal |
getBodyLiteral(int bodyLiteralIndex)
Returns the body literal with given index. |
Literal[] |
getBodyLiterals()
Returns the array of body literals. |
Rule |
getDLSafeVersion()
Returns the DL-safe version of this rule. |
int |
getHeadLength()
Returns the number of head literals. |
Literal |
getHeadLiteral()
Returns the head literal. |
Literal |
getHeadLiteral(int headLiteralIndex)
Returns the head literal with given index. |
Literal[] |
getHeadLiterals()
Returns the array of head literals. |
boolean |
isHorn()
Returns true if this is a Horn rule with one head literal. |
boolean |
isRangeRestricted()
Checks whether the rule is range-restricted. |
boolean |
isTautology()
Checks if this rule is a tautology. |
Rule |
normalize()
Normalizes this rule by eliminating certain surplus literals. |
Rule.SubsumptionResult |
subsumes(Rule rule)
Checks whether this rule subsumes another rule. |
| Methods inherited from interface org.semanticweb.kaon2.api.Axiom |
|---|
accept, toString |
| Method Detail |
|---|
Literal[] getHeadLiterals()
Literal getHeadLiteral()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - thrown if this is a Horn ruleint getHeadLength()
Literal getHeadLiteral(int headLiteralIndex)
headLiteralIndex - the index of the head literal
Literal[] getBodyLiterals()
int getBodyLength()
Literal getBodyLiteral(int bodyLiteralIndex)
bodyLiteralIndex - the index of the body literal
boolean isHorn()
true if this is a Horn rule with one head literal.
true if this is a Horn rule with one head literalboolean isRangeRestricted()
true if the rule is range-restrictedRule normalize()
null is returned.
null if the rule is a tautology)Rule getDLSafeVersion()
Rule.SubsumptionResult subsumes(Rule rule)
rule - the other rule
true if this rule subsumes the given ruleboolean isTautology()
true if the rule is a tautology
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||