|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.logic.ELP
public class ELP
this class models an extended logic program. it consists of a set of rules (and fact and constraints).
Field Summary | |
---|---|
(package private) java.util.ArrayList<ELPRule> |
rules
|
Constructor Summary | |
---|---|
ELP()
|
|
ELP(Literal l)
|
Method Summary | |
---|---|
void |
add(ELP program2)
this methods adds all rules from the given program to this program |
void |
addRaw(java.lang.String s)
adds a raw, unchecked string as the head of a new rule to the elp. this method can be used to pass arbitrary statements to the program. it also removes the last '.' from the input string. |
void |
addRule(ELPRule r)
|
Alphabet |
getAlphabet()
returns the alphabet of this program (set of all functor symbols) |
java.util.List<ELPLiteral> |
getFacts()
return all literals that are facts (even disjunctive) |
ELPRule |
getRule(int i)
get rule i |
java.util.ArrayList<ELPRule> |
getRules()
returns all elp rules in this program |
static ELP |
loadFrom(java.lang.String filename)
loads an elp from a file ressource |
ELP |
merge(ELP other)
merges this and another elp and return a new elp |
int |
nRules()
number of rules in elp |
void |
saveAs(java.lang.String filename)
store elp on disc |
void |
split(java.util.Collection<ELPLiteral> literals,
java.util.Collection<ELPRule> rules)
splits the given program into rules and facts. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.util.ArrayList<ELPRule> rules
Constructor Detail |
---|
public ELP(Literal l)
public ELP()
Method Detail |
---|
public void addRule(ELPRule r)
public java.lang.String toString()
toString
in class java.lang.Object
public int nRules()
public ELPRule getRule(int i)
i
-
public java.util.ArrayList<ELPRule> getRules()
public java.util.List<ELPLiteral> getFacts()
public void saveAs(java.lang.String filename)
file
- output filename (like foo.elp or bar.txt)public static ELP loadFrom(java.lang.String filename)
filename
- file to read elp frompublic ELP merge(ELP other)
other
- second elp to merge with
public void addRaw(java.lang.String s)
s
- text string added to programpublic Alphabet getAlphabet()
public void split(java.util.Collection<ELPLiteral> literals, java.util.Collection<ELPRule> rules)
literals
- output container for all literalsrules
- output container for all rulespublic void add(ELP program2)
program2
- program to add
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |