public class NLPRule extends ComplexLogicalFormulaAdapter implements ComplexLogicalFormula, Rule<FolFormula,FolFormula>
| Modifier and Type | Field and Description |
|---|---|
(package private) FolFormula |
conclusion |
(package private) java.util.Set<FolFormula> |
premise |
| Constructor and Description |
|---|
NLPRule() |
NLPRule(FolFormula conclusion) |
NLPRule(FolFormula conclusion,
java.util.Collection<FolFormula> premise) |
NLPRule(FolFormula conclusion,
FolFormula premise) |
NLPRule(NLPRule other) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPremise(FolFormula premise) |
void |
addPremises(java.util.Collection<? extends FolFormula> premises) |
private void |
checkFormula(FolFormula formula)
Helper methods checks if the given FOL formula is supported by the nested logic
program language, that means it checks if it contains quantifiers and if that
is the case it throws a LanguageException
|
NLPRule |
clone()
Creates a deep copy of this formula
|
boolean |
equals(java.lang.Object other) |
java.util.Set<FOLAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
FolFormula |
getConclusion()
Returns the conclusion of this rule.
|
java.lang.Class<? extends Predicate> |
getPredicateCls() |
java.util.Set<Predicate> |
getPredicates()
Processes the set of all predicates which appear in this
formula
|
java.util.Collection<FolFormula> |
getPremise()
Returns the premise of this rule.
|
FolSignature |
getSignature()
Returns the signature of the language of this formula.
|
java.util.Set<Term<?>> |
getTerms() |
int |
hashCode() |
boolean |
isConstraint() |
boolean |
isFact() |
void |
setConclusion(FolFormula conclusion) |
NLPRule |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
containsTermsOfType, exchange, getTerms, isGround, isLiteral, isWellFormed, substitutefinalize, getClass, notify, notifyAll, toString, wait, wait, waitexchange, isGround, isWellFormed, substituteisLiteralcontainsTermsOfType, getTermsFolFormula conclusion
java.util.Set<FolFormula> premise
public NLPRule()
public NLPRule(NLPRule other)
public NLPRule(FolFormula conclusion)
public NLPRule(FolFormula conclusion, FolFormula premise)
public NLPRule(FolFormula conclusion, java.util.Collection<FolFormula> premise)
public void addPremise(FolFormula premise) throws LanguageException
addPremise in interface Rule<FolFormula,FolFormula>LanguageExceptionpublic void addPremises(java.util.Collection<? extends FolFormula> premises)
addPremises in interface Rule<FolFormula,FolFormula>public void setConclusion(FolFormula conclusion) throws LanguageException
setConclusion in interface Rule<FolFormula,FolFormula>LanguageExceptionprivate void checkFormula(FolFormula formula) throws LanguageException
formula - The formula which gets checkedLanguageExceptionpublic java.util.Collection<FolFormula> getPremise()
RulegetPremise in interface Rule<FolFormula,FolFormula>public FolFormula getConclusion()
RulegetConclusion in interface Rule<FolFormula,FolFormula>public FolSignature getSignature()
FormulagetSignature in interface FormulagetSignature in interface Rule<FolFormula,FolFormula>public boolean isFact()
isFact in interface Rule<FolFormula,FolFormula>public boolean isConstraint()
isConstraint in interface Rule<FolFormula,FolFormula>public java.util.Set<FOLAtom> getAtoms()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulapublic java.util.Set<Predicate> getPredicates()
SimpleLogicalFormulagetPredicates in interface SimpleLogicalFormulapublic java.lang.Class<? extends Predicate> getPredicateCls()
getPredicateCls in interface SimpleLogicalFormulapublic java.util.Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic NLPRule substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
ComplexLogicalFormulasubstitute in interface ComplexLogicalFormulav - the term to be substituted.t - the term to substitute.java.lang.IllegalArgumentException - if "v" and "t" are of different sortspublic int hashCode()
hashCode in interface SimpleLogicalFormulahashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in interface SimpleLogicalFormulaequals in class java.lang.Objectpublic NLPRule clone()
SimpleLogicalFormulaclone in interface ComplexLogicalFormulaclone in interface SimpleLogicalFormulaclone in class ComplexLogicalFormulaAdapter