Package net.sf.tweety.logics.cl.syntax
Class Conditional
- java.lang.Object
-
- net.sf.tweety.logics.cl.syntax.Conditional
-
- All Implemented Interfaces:
Formula
,Rule<PlFormula,PlFormula>
,SimpleLogicalFormula
- Direct Known Subclasses:
ProbabilisticConditional
public class Conditional extends java.lang.Object implements SimpleLogicalFormula, Rule<PlFormula,PlFormula>
This class represents a basic conditional (B|A) with formulas A,B.- Author:
- Matthias Thimm, Tim Janus
-
-
Constructor Summary
Constructors Constructor Description Conditional(PlFormula conclusion)
Creates a new conditional with a tautological premise and given conclusion.Conditional(PlFormula premise, PlFormula conclusion)
Creates a new conditional with the given premise and conclusion.
-
Method Summary
Modifier and Type Method Description void
addPremise(PlFormula premise)
void
addPremises(java.util.Collection<? extends PlFormula> premises)
Conditional
clone()
Creates a deep copy of this formulaConjunction
combineWithAnd(Conjunctable f)
Disjunction
combineWithOr(Disjunctable f)
Conditional
complement()
boolean
equals(java.lang.Object obj)
java.util.Set<Proposition>
getAtoms()
Processes the set of all atoms which appear in this formulaPlFormula
getConclusion()
Returns the conclusion of this rule.java.lang.Class<? extends Predicate>
getPredicateCls()
java.util.Set<? extends Predicate>
getPredicates()
Processes the set of all predicates which appear in this formulajava.util.Collection<PlFormula>
getPremise()
Returns the premise of this rule.Signature
getSignature()
Returns the signature of the language of this formula.int
hashCode()
boolean
isConstraint()
boolean
isFact()
Checks whether this conditional is a fact, i.e.boolean
isLiteral()
void
setConclusion(PlFormula conclusion)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Conditional
public Conditional(PlFormula conclusion)
Creates a new conditional with a tautological premise and given conclusion.- Parameters:
conclusion
- the conclusion (a formula) of this conditional.
-
-
Method Detail
-
getPremise
public java.util.Collection<PlFormula> getPremise()
Description copied from interface:Rule
Returns the premise of this rule.- Specified by:
getPremise
in interfaceRule<PlFormula,PlFormula>
- Returns:
- the premise of this rule.
-
getConclusion
public PlFormula getConclusion()
Description copied from interface:Rule
Returns the conclusion of this rule.- Specified by:
getConclusion
in interfaceRule<PlFormula,PlFormula>
- Returns:
- the conclusion of this rule.
-
isFact
public boolean isFact()
Checks whether this conditional is a fact, i.e. has a tautological premise.
-
getSignature
public Signature getSignature()
Description copied from interface:Formula
Returns the signature of the language of this formula.- Specified by:
getSignature
in interfaceFormula
- Specified by:
getSignature
in interfaceRule<PlFormula,PlFormula>
- Returns:
- the signature of the language of this formula.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
combineWithAnd
public Conjunction combineWithAnd(Conjunctable f)
-
combineWithOr
public Disjunction combineWithOr(Disjunctable f)
-
complement
public Conditional complement()
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Overrides:
equals
in classjava.lang.Object
-
getAtoms
public java.util.Set<Proposition> getAtoms()
Description copied from interface:SimpleLogicalFormula
Processes the set of all atoms which appear in this formula- Specified by:
getAtoms
in interfaceSimpleLogicalFormula
- Returns:
- The set of all atoms
-
getPredicates
public java.util.Set<? extends Predicate> getPredicates()
Description copied from interface:SimpleLogicalFormula
Processes the set of all predicates which appear in this formula- Specified by:
getPredicates
in interfaceSimpleLogicalFormula
- Returns:
- all predicates that appear in this formula
-
clone
public Conditional clone()
Description copied from interface:SimpleLogicalFormula
Creates a deep copy of this formula- Specified by:
clone
in interfaceSimpleLogicalFormula
- Returns:
- the cloned formula
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteral
in interfaceSimpleLogicalFormula
- Returns:
- true if the formula represents a literal in the language or false otherwise
-
getPredicateCls
public java.lang.Class<? extends Predicate> getPredicateCls()
- Specified by:
getPredicateCls
in interfaceSimpleLogicalFormula
- Returns:
- The class description of the predicate used by this formula.
-
isConstraint
public boolean isConstraint()
- Specified by:
isConstraint
in interfaceRule<PlFormula,PlFormula>
-
setConclusion
public void setConclusion(PlFormula conclusion)
- Specified by:
setConclusion
in interfaceRule<PlFormula,PlFormula>
-
addPremise
public void addPremise(PlFormula premise)
- Specified by:
addPremise
in interfaceRule<PlFormula,PlFormula>
-
addPremises
public void addPremises(java.util.Collection<? extends PlFormula> premises)
- Specified by:
addPremises
in interfaceRule<PlFormula,PlFormula>
-
-