public class Program extends RuleSet<Rule> implements LogicProgram<DLPHead,DLPElement,Rule>
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
kill warning
|
private FolSignature |
signature
The signature of the logic program
|
Constructor and Description |
---|
Program()
Default Ctor: Does nothing
|
Program(java.util.Collection<Rule> base)
Add all rules from base to this program.
|
Program(Program other)
Copy Ctor: Used by clone method
|
Modifier and Type | Method and Description |
---|---|
void |
add(Program other)
Adds another programs content to the content of this program.
|
void |
addFact(DLPHead fact)
Adds the given fact to the program
|
void |
addFact(DLPLiteral fact) |
private void |
calcSignature() |
Program |
clone() |
static Program |
defaultification(Program p)
Creates the defaultifictation p_d of a given program p.
|
Program |
exchange(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and at the same time replaces all occurrences of term "t"
by term "v" and eventually returns the new formula.
|
FolSignature |
getSignature()
Returns the signature of the language of this knowledge base.
|
boolean |
isExtendedProgram()
Checks if the program is an extended programs, that means the heads of the
literals have not more than one literal.
|
boolean |
isGround()
Checks whether this program is ground, i.e.
|
Program |
reduct(java.util.Collection<DLPLiteral> state)
Returns the reduct of this program wrt.
|
Program |
substitute(java.util.Map<? extends Term<?>,? extends Term<?>> map)
Substitutes all occurrences of all terms "v" in map.keyset() in this formula
by map.get(v) and returns the new formula.
|
Program |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
java.lang.String |
toString() |
java.lang.String |
toStringFlat() |
getConclusions, getPremises, getRulesWithConclusion
add, clear, contains, isEmpty, iterator, remove, size, spliterator
addAll, containsAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID
private FolSignature signature
public Program()
public Program(Program other)
public Program(java.util.Collection<Rule> base)
base
- a collection of rulespublic void add(Program other)
other
- Reference to the other program.public java.lang.String toString()
toString
in interface BeliefBase
toString
in interface LogicProgram<DLPHead,DLPElement,Rule>
toString
in class java.util.AbstractCollection<Rule>
public boolean isExtendedProgram()
public java.lang.String toStringFlat()
public static Program defaultification(Program p)
p
- The program which is not defaultificated yetpublic void addFact(DLPLiteral fact)
public FolSignature getSignature()
BeliefBase
getSignature
in interface BeliefBase
getSignature
in interface LogicProgram<DLPHead,DLPElement,Rule>
private void calcSignature()
public boolean isGround()
public Program reduct(java.util.Collection<DLPLiteral> state)
state
- some set of literalspublic void addFact(DLPHead fact)
LogicProgram
addFact
in interface LogicProgram<DLPHead,DLPElement,Rule>
public Program substitute(Term<?> v, Term<?> t)
LogicProgram
substitute
in interface LogicProgram<DLPHead,DLPElement,Rule>
v
- the term to be substituted.t
- the term to substitute.public Program substitute(java.util.Map<? extends Term<?>,? extends Term<?>> map) throws java.lang.IllegalArgumentException
LogicProgram
substitute
in interface LogicProgram<DLPHead,DLPElement,Rule>
map
- a mapping defining which terms to be substituted.java.lang.IllegalArgumentException
- if any term and its mapping are of different sortspublic Program exchange(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
LogicProgram
exchange
in interface LogicProgram<DLPHead,DLPElement,Rule>
v
- a term.t
- a term.java.lang.IllegalArgumentException
- if "v" and "t" are of different sorts