Class Conditional

  • All Implemented Interfaces:
    net.sf.tweety.commons.Formula, net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.pl.syntax.PlFormula,​net.sf.tweety.logics.pl.syntax.PlFormula>, net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

    public class Conditional
    extends Object
    implements net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula, net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.pl.syntax.PlFormula,​net.sf.tweety.logics.pl.syntax.PlFormula>
    This class represents a basic conditional (B|A) with formulas A,B.
    Author:
    Matthias Thimm, Tim Janus
    • Constructor Summary

      Constructors 
      Constructor Description
      Conditional​(net.sf.tweety.logics.pl.syntax.PlFormula conclusion)
      Creates a new conditional with a tautological premise and given conclusion.
      Conditional​(net.sf.tweety.logics.pl.syntax.PlFormula premise, net.sf.tweety.logics.pl.syntax.PlFormula conclusion)
      Creates a new conditional with the given premise and conclusion.
    • Constructor Detail

      • Conditional

        public Conditional​(net.sf.tweety.logics.pl.syntax.PlFormula conclusion)
        Creates a new conditional with a tautological premise and given conclusion.
        Parameters:
        conclusion - the conclusion (a formula) of this conditional.
      • Conditional

        public Conditional​(net.sf.tweety.logics.pl.syntax.PlFormula premise,
                           net.sf.tweety.logics.pl.syntax.PlFormula conclusion)
        Creates a new conditional with the given premise and conclusion.
        Parameters:
        premise - the premise (a formula) of this conditional.
        conclusion - the conclusion (a formula) of this conditional.
    • Method Detail

      • getPremise

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

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

        public boolean isFact()
        Checks whether this conditional is a fact, i.e. has a tautological premise.
        Specified by:
        isFact in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.pl.syntax.PlFormula,​net.sf.tweety.logics.pl.syntax.PlFormula>
        Returns:
        "true" iff this conditional is a fact.
      • getSignature

        public net.sf.tweety.commons.Signature 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.pl.syntax.PlFormula,​net.sf.tweety.logics.pl.syntax.PlFormula>
      • combineWithAnd

        public net.sf.tweety.logics.pl.syntax.Conjunction combineWithAnd​(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable f)
      • combineWithOr

        public net.sf.tweety.logics.fol.syntax.Disjunction combineWithOr​(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable f)
      • 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 obj)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object
      • getAtoms

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

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

        public Conditional clone()
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        clone in class Object
      • isLiteral

        public boolean isLiteral()
        Specified by:
        isLiteral 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
      • isConstraint

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

        public void setConclusion​(net.sf.tweety.logics.pl.syntax.PlFormula conclusion)
        Specified by:
        setConclusion in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.pl.syntax.PlFormula,​net.sf.tweety.logics.pl.syntax.PlFormula>
      • addPremise

        public void addPremise​(net.sf.tweety.logics.pl.syntax.PlFormula premise)
        Specified by:
        addPremise in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.pl.syntax.PlFormula,​net.sf.tweety.logics.pl.syntax.PlFormula>
      • addPremises

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