Package net.sf.tweety.lp.nlp.syntax
Class NLPRule
- java.lang.Object
- 
- net.sf.tweety.logics.commons.syntax.ComplexLogicalFormulaAdapter
- 
- net.sf.tweety.lp.nlp.syntax.NLPRule
 
 
- 
- All Implemented Interfaces:
- Formula,- Rule<FolFormula,FolFormula>,- ComplexLogicalFormula,- LogicStructure,- SimpleLogicalFormula
 
 public class NLPRule extends ComplexLogicalFormulaAdapter implements ComplexLogicalFormula, Rule<FolFormula,FolFormula> A rule of a nested logic program. A nested logic program contains not quantified first order formulas.- Author:
- Tim Janus
 
- 
- 
Constructor SummaryConstructors Constructor Description NLPRule()NLPRule(FolFormula conclusion)NLPRule(FolFormula conclusion, java.util.Collection<FolFormula> premise)NLPRule(FolFormula conclusion, FolFormula premise)NLPRule(NLPRule other)
 - 
Method SummaryModifier and Type Method Description voidaddPremise(FolFormula premise)voidaddPremises(java.util.Collection<? extends FolFormula> premises)NLPRuleclone()Creates a deep copy of this formulabooleanequals(java.lang.Object other)java.util.Set<FolAtom>getAtoms()Processes the set of all atoms which appear in this formulaFolFormulagetConclusion()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 formulajava.util.Collection<FolFormula>getPremise()Returns the premise of this rule.FolSignaturegetSignature()Returns the signature of the language of this formula.java.util.Set<Term<?>>getTerms()inthashCode()booleanisConstraint()booleanisFact()voidsetConclusion(FolFormula conclusion)NLPRulesubstitute(Term<?> v, Term<?> t)Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- 
Methods inherited from class net.sf.tweety.logics.commons.syntax.ComplexLogicalFormulaAdaptercontainsTermsOfType, exchange, getTerms, isGround, isLiteral, isWellFormed, substitute
 - 
Methods inherited from class java.lang.ObjectgetClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormulaexchange, isGround, isWellFormed, substitute
 - 
Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructurecontainsTermsOfType, getTerms
 - 
Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormulaisLiteral
 
- 
 
- 
- 
- 
Constructor Detail- 
NLPRulepublic NLPRule() 
 - 
NLPRulepublic NLPRule(NLPRule other) 
 - 
NLPRulepublic NLPRule(FolFormula conclusion) 
 - 
NLPRulepublic NLPRule(FolFormula conclusion, FolFormula premise) 
 - 
NLPRulepublic NLPRule(FolFormula conclusion, java.util.Collection<FolFormula> premise) 
 
- 
 - 
Method Detail- 
addPremisepublic void addPremise(FolFormula premise) throws LanguageException - Specified by:
- addPremisein interface- Rule<FolFormula,FolFormula>
- Throws:
- LanguageException
 
 - 
addPremisespublic void addPremises(java.util.Collection<? extends FolFormula> premises) - Specified by:
- addPremisesin interface- Rule<FolFormula,FolFormula>
 
 - 
setConclusionpublic void setConclusion(FolFormula conclusion) throws LanguageException - Specified by:
- setConclusionin interface- Rule<FolFormula,FolFormula>
- Throws:
- LanguageException
 
 - 
getPremisepublic java.util.Collection<FolFormula> getPremise() Description copied from interface:RuleReturns the premise of this rule.- Specified by:
- getPremisein interface- Rule<FolFormula,FolFormula>
- Returns:
- the premise of this rule.
 
 - 
getConclusionpublic FolFormula getConclusion() Description copied from interface:RuleReturns the conclusion of this rule.- Specified by:
- getConclusionin interface- Rule<FolFormula,FolFormula>
- Returns:
- the conclusion of this rule.
 
 - 
getSignaturepublic FolSignature getSignature() Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
- getSignaturein interface- Formula
- Specified by:
- getSignaturein interface- Rule<FolFormula,FolFormula>
- Returns:
- the signature of the language of this formula.
 
 - 
isFactpublic boolean isFact() - Specified by:
- isFactin interface- Rule<FolFormula,FolFormula>
 
 - 
isConstraintpublic boolean isConstraint() - Specified by:
- isConstraintin interface- Rule<FolFormula,FolFormula>
 
 - 
getAtomspublic java.util.Set<FolAtom> getAtoms() Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
- getAtomsin interface- SimpleLogicalFormula
- Returns:
- The set of all atoms
 
 - 
getPredicatespublic java.util.Set<Predicate> getPredicates() Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
- getPredicatesin interface- SimpleLogicalFormula
- Returns:
- all predicates that appear in this formula
 
 - 
getPredicateClspublic java.lang.Class<? extends Predicate> getPredicateCls() - Specified by:
- getPredicateClsin interface- SimpleLogicalFormula
- Returns:
- The class description of the predicate used by this formula.
 
 - 
getTermspublic java.util.Set<Term<?>> getTerms() - Specified by:
- getTermsin interface- LogicStructure
- Returns:
- a set containing all terms of this logical structure
 
 - 
substitutepublic NLPRule substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException Description copied from interface:ComplexLogicalFormulaSubstitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- Specified by:
- substitutein interface- ComplexLogicalFormula
- Parameters:
- v- the term to be substituted.
- t- the term to substitute.
- Returns:
- a formula where every occurrence of "v" is replaced by "t".
- Throws:
- java.lang.IllegalArgumentException- if "v" and "t" are of different sorts
 
 - 
hashCodepublic int hashCode() - Specified by:
- hashCodein interface- SimpleLogicalFormula
- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object other) - Specified by:
- equalsin interface- SimpleLogicalFormula
- Overrides:
- equalsin class- java.lang.Object
 
 - 
clonepublic NLPRule clone() Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
- clonein interface- ComplexLogicalFormula
- Specified by:
- clonein interface- SimpleLogicalFormula
- Specified by:
- clonein class- ComplexLogicalFormulaAdapter
- Returns:
- the cloned formula
 
 
- 
 
-