Class NLPRule

  • All Implemented Interfaces:
    net.sf.tweety.commons.Formula, net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>, net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula, net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure, net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

    public class NLPRule
    extends net.sf.tweety.logics.commons.syntax.ComplexLogicalFormulaAdapter
    implements net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula, net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
    A rule of a nested logic program. A nested logic program contains not quantified first order formulas.
    Author:
    Tim Janus
    • Constructor Summary

      Constructors 
      Constructor Description
      NLPRule()  
      NLPRule​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)  
      NLPRule​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion, Collection<net.sf.tweety.logics.fol.syntax.FolFormula> premise)  
      NLPRule​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion, net.sf.tweety.logics.fol.syntax.FolFormula premise)  
      NLPRule​(NLPRule other)  
    • Method Summary

      Modifier and Type Method Description
      void addPremise​(net.sf.tweety.logics.fol.syntax.FolFormula premise)  
      void addPremises​(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> premises)  
      NLPRule clone()  
      boolean equals​(Object other)  
      Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAtoms()  
      net.sf.tweety.logics.fol.syntax.FolFormula getConclusion()  
      Class<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicateCls()  
      Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()  
      Collection<net.sf.tweety.logics.fol.syntax.FolFormula> getPremise()  
      net.sf.tweety.logics.fol.syntax.FolSignature getSignature()  
      Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()  
      int hashCode()  
      boolean isConstraint()  
      boolean isFact()  
      void setConclusion​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)  
      NLPRule substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)  
      • Methods inherited from class net.sf.tweety.logics.commons.syntax.ComplexLogicalFormulaAdapter

        containsTermsOfType, exchange, getTerms, isGround, isLiteral, isWellFormed, substitute
      • Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula

        exchange, isGround, isWellFormed, substitute
      • Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure

        containsTermsOfType, getTerms
      • Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

        isLiteral
    • Constructor Detail

      • NLPRule

        public NLPRule()
      • NLPRule

        public NLPRule​(NLPRule other)
      • NLPRule

        public NLPRule​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)
      • NLPRule

        public NLPRule​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion,
                       net.sf.tweety.logics.fol.syntax.FolFormula premise)
      • NLPRule

        public NLPRule​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion,
                       Collection<net.sf.tweety.logics.fol.syntax.FolFormula> premise)
    • Method Detail

      • addPremise

        public void addPremise​(net.sf.tweety.logics.fol.syntax.FolFormula premise)
                        throws net.sf.tweety.logics.commons.error.LanguageException
        Specified by:
        addPremise in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
        Throws:
        net.sf.tweety.logics.commons.error.LanguageException
      • addPremises

        public void addPremises​(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> premises)
        Specified by:
        addPremises in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • setConclusion

        public void setConclusion​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)
                           throws net.sf.tweety.logics.commons.error.LanguageException
        Specified by:
        setConclusion in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
        Throws:
        net.sf.tweety.logics.commons.error.LanguageException
      • getPremise

        public Collection<net.sf.tweety.logics.fol.syntax.FolFormula> getPremise()
        Specified by:
        getPremise in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • getConclusion

        public net.sf.tweety.logics.fol.syntax.FolFormula getConclusion()
        Specified by:
        getConclusion in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • getSignature

        public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
        Specified by:
        getSignature in interface net.sf.tweety.commons.Formula
        Specified by:
        getSignature in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • isFact

        public boolean isFact()
        Specified by:
        isFact in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • isConstraint

        public boolean isConstraint()
        Specified by:
        isConstraint in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • getAtoms

        public Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAtoms()
        Specified by:
        getAtoms in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • getPredicates

        public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
        Specified by:
        getPredicates in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • getPredicateCls

        public Class<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicateCls()
        Specified by:
        getPredicateCls in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • getTerms

        public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • substitute

        public NLPRule substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
                                  net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
                           throws IllegalArgumentException
        Specified by:
        substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Throws:
        IllegalArgumentException
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object other)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object
      • clone

        public NLPRule clone()
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        clone in class net.sf.tweety.logics.commons.syntax.ComplexLogicalFormulaAdapter