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
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description private PlFormulaconclusionThe conclusion of this conditional.private PlFormulapremiseThe premise of this conditional. 
- 
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 voidaddPremise(PlFormula premise)voidaddPremises(java.util.Collection<? extends PlFormula> premises)Conditionalclone()Creates a deep copy of this formulaConjunctioncombineWithAnd(Conjunctable f)DisjunctioncombineWithOr(Disjunctable f)Conditionalcomplement()booleanequals(java.lang.Object obj)java.util.Set<Proposition>getAtoms()Processes the set of all atoms which appear in this formulaPlFormulagetConclusion()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.SignaturegetSignature()Returns the signature of the language of this formula.inthashCode()booleanisConstraint()booleanisFact()Checks whether this conditional is a fact, i.e.booleanisLiteral()voidsetConclusion(PlFormula conclusion)java.lang.StringtoString() 
 - 
 
- 
- 
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:RuleReturns the premise of this rule.- Specified by:
 getPremisein interfaceRule<PlFormula,PlFormula>- Returns:
 - the premise of this rule.
 
 
- 
getConclusion
public PlFormula getConclusion()
Description copied from interface:RuleReturns the conclusion of this rule.- Specified by:
 getConclusionin 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:FormulaReturns the signature of the language of this formula.- Specified by:
 getSignaturein interfaceFormula- Specified by:
 getSignaturein interfaceRule<PlFormula,PlFormula>- Returns:
 - the signature of the language of this formula.
 
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin 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:
 hashCodein interfaceSimpleLogicalFormula- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Specified by:
 equalsin interfaceSimpleLogicalFormula- Overrides:
 equalsin classjava.lang.Object
 
- 
getAtoms
public java.util.Set<Proposition> getAtoms()
Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
 getAtomsin interfaceSimpleLogicalFormula- Returns:
 - The set of all atoms
 
 
- 
getPredicates
public java.util.Set<? extends Predicate> getPredicates()
Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
 getPredicatesin interfaceSimpleLogicalFormula- Returns:
 - all predicates that appear in this formula
 
 
- 
clone
public Conditional clone()
Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
 clonein interfaceSimpleLogicalFormula- Overrides:
 clonein classjava.lang.Object- Returns:
 - the cloned formula
 
 
- 
isLiteral
public boolean isLiteral()
- Specified by:
 isLiteralin 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:
 getPredicateClsin interfaceSimpleLogicalFormula- Returns:
 - The class description of the predicate used by this formula.
 
 
- 
isConstraint
public boolean isConstraint()
- Specified by:
 isConstraintin interfaceRule<PlFormula,PlFormula>
 
- 
setConclusion
public void setConclusion(PlFormula conclusion)
- Specified by:
 setConclusionin interfaceRule<PlFormula,PlFormula>
 
- 
addPremise
public void addPremise(PlFormula premise)
- Specified by:
 addPremisein interfaceRule<PlFormula,PlFormula>
 
- 
addPremises
public void addPremises(java.util.Collection<? extends PlFormula> premises)
- Specified by:
 addPremisesin interfaceRule<PlFormula,PlFormula>
 
 - 
 
 -