public class NLPProgram extends RuleSet<NLPRule> implements LogicProgram<FolFormula,FolFormula,NLPRule>
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
kill warning
|
Constructor and Description |
---|
NLPProgram() |
Modifier and Type | Method and Description |
---|---|
void |
addFact(FolFormula fact)
Adds the given fact to the program
|
NLPProgram |
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.
|
java.util.Set<FolFormula> |
getFacts() |
FolSignature |
getSignature()
Returns the signature of the language of this knowledge base.
|
NLPProgram |
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.
|
NLPProgram |
substitute(Term<?> t,
Term<?> v)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
getConclusions, getPremises, getRulesWithConclusion
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
addAll, containsAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
toString
private static final long serialVersionUID
public java.util.Set<FolFormula> getFacts()
public void addFact(FolFormula fact)
LogicProgram
addFact
in interface LogicProgram<FolFormula,FolFormula,NLPRule>
public FolSignature getSignature()
BeliefBase
getSignature
in interface BeliefBase
getSignature
in interface LogicProgram<FolFormula,FolFormula,NLPRule>
public NLPProgram substitute(Term<?> t, Term<?> v)
LogicProgram
substitute
in interface LogicProgram<FolFormula,FolFormula,NLPRule>
t
- the term to be substituted.v
- the term to substitute.public NLPProgram substitute(java.util.Map<? extends Term<?>,? extends Term<?>> map) throws java.lang.IllegalArgumentException
LogicProgram
substitute
in interface LogicProgram<FolFormula,FolFormula,NLPRule>
map
- a mapping defining which terms to be substituted.java.lang.IllegalArgumentException
- if any term and its mapping are of different sortspublic NLPProgram exchange(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
LogicProgram
exchange
in interface LogicProgram<FolFormula,FolFormula,NLPRule>
v
- a term.t
- a term.java.lang.IllegalArgumentException
- if "v" and "t" are of different sorts