|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.logic.ELPRule
edu.udo.cs.ie.cowbots.elpParser.dlp.DLPRule
public class DLPRule
this class extends from its father class ELPRule. stand by parsing
ELPRule
Field Summary | |
---|---|
(package private) java.util.ArrayList<DLPLiteral> |
body
|
(package private) java.util.ArrayList<DLPLiteral> |
head
|
Constructor Summary | |
---|---|
DLPRule()
Create a default rule. |
|
DLPRule(DLPRule other)
creates new rule which prepare to change its content, based on a existed rule. |
|
DLPRule(int maxHead,
int maxBody)
An user defined rule with prospective body and head length. |
Method Summary | |
---|---|
void |
addBodies(java.util.Collection<DLPLiteral> lits)
|
void |
addBody(DLPLiteral l)
add a literal to body |
void |
addHead(DLPLiteral l)
add a literal to head |
protected java.lang.String |
dumpLiteralList(java.util.ArrayList<DLPLiteral> ll,
java.lang.String sep)
internal helper function to dump a list of literals |
java.util.ArrayList<DLPLiteral> |
getBodies()
|
DLPLiteral |
getBody(int i)
returns the i-literal in Body |
DLPLiteral |
getHead(int i)
returns the i-literal in head |
boolean |
isConjunctive()
indicated whether there is one more literals in the read of the rule. |
boolean |
isConstraint()
returns true if the rule is a constraint (no head literals) and at least one literal(it is indifferently true or negative or strict negative) |
boolean |
isDisjunctive()
indicated whether there is one more literals in the read of the rule. |
boolean |
isFact()
returns true whether the rule has only one or more literal for head and they are facts, but no body literals. |
boolean |
isRule()
returns true if it is a complete rule what means at least one literal for body and one for head |
int |
nBody()
returns the size of body, including arithmetical expressions. |
int |
nHead()
returns the size of head |
void |
resolve()
overview during parse. |
void |
resolvedConstraint()
|
void |
resolvedFact()
|
void |
resolvedRule()
|
protected java.lang.String |
toDlpString()
|
Methods inherited from class edu.udo.cs.ie.cowbots.logic.ELPRule |
---|
addBody, addBody, addHead, dumpLitList, getBody, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.util.ArrayList<DLPLiteral> head
java.util.ArrayList<DLPLiteral> body
Constructor Detail |
---|
public DLPRule()
DLPRule
public DLPRule(int maxHead, int maxBody)
maxHead
- Integer
maxBody
- Integer
DLPRule
public DLPRule(DLPRule other)
other
- rule to copy DLPRule
Method Detail |
---|
public boolean isFact()
isFact
in class ELPRule
Boolean
DLPLiteral
public boolean isConstraint()
isConstraint
in class ELPRule
Boolean
public boolean isRule()
Boolean
public boolean isDisjunctive()
isDisjunctive
in class ELPRule
Boolean
public boolean isConjunctive()
Boolean
public void addHead(DLPLiteral l)
l
- DLPLiteral
public void addBody(DLPLiteral l)
l
- DLPLiteral
public java.util.ArrayList<DLPLiteral> getBodies()
public void addBodies(java.util.Collection<DLPLiteral> lits)
public void resolve()
public void resolvedFact()
DLPRule#resolve()}
public void resolvedConstraint()
DLPRule#resolve()}
public void resolvedRule()
DLPRule#resolve()}
protected java.lang.String toDlpString()
ELPRule#toString()}
protected java.lang.String dumpLiteralList(java.util.ArrayList<DLPLiteral> ll, java.lang.String sep)
ll
- list of literalssep
- literal separator string
string
public int nHead()
nHead
in class ELPRule
public int nBody()
nBody
in class ELPRule
Integer
public DLPLiteral getHead(int i)
getHead
in class ELPRule
literal
- index Integer
DLPLiteral
public DLPLiteral getBody(int i)
getBody
in class ELPRule
literal
- index Integer
DLPLiteral
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |