Class Conditional
java.lang.Object
org.tweetyproject.logics.cl.syntax.Conditional
- All Implemented Interfaces:
Formula
,Rule<PlFormula,
,PlFormula> SimpleLogicalFormula
- Direct Known Subclasses:
ProbabilisticConditional
This class represents a basic conditional (B|A) with formulas A,B.
- Author:
- Matthias Thimm, Tim Janus
-
Constructor Summary
ConstructorDescriptionConditional
(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 TypeMethodDescriptionvoid
addPremise
(PlFormula premise) Add the given premise to this rule.void
addPremises
(Collection<? extends PlFormula> premises) Add the given premises to this rule.clone()
Creates a deep copy of this formulaboolean
getAtoms()
Processes the set of all atoms which appear in this formulaReturns the conclusion of this rule.Processes the set of all predicates which appear in this formulaReturns the premise of this rule.Returns the signature of the language of this formula.int
hashCode()
boolean
isConstraintboolean
isFact()
Checks whether this conditional is a fact, i.e.boolean
void
setConclusion
(PlFormula conclusion) Set the conclusion of this rule.toString()
-
Constructor Details
-
Conditional
Creates a new conditional with a tautological premise and given conclusion.- Parameters:
conclusion
- the conclusion (a formula) of this conditional.
-
Conditional
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 Details
-
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
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
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
-
combineWithAnd
-
combineWithOr
-
complement
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Overrides:
equals
in classObject
-
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
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
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
- Specified by:
getPredicateCls
in interfaceSimpleLogicalFormula
- Returns:
- The class description of the predicate used by this formula.
-
isConstraint
public boolean isConstraint()Description copied from interface:Rule
isConstraint- Specified by:
isConstraint
in interfaceRule<PlFormula,
PlFormula> - Returns:
- whether the rule is a constraint
-
setConclusion
Description copied from interface:Rule
Set the conclusion of this rule.- Specified by:
setConclusion
in interfaceRule<PlFormula,
PlFormula> - Parameters:
conclusion
- some formula
-
addPremise
Description copied from interface:Rule
Add the given premise to this rule.- Specified by:
addPremise
in interfaceRule<PlFormula,
PlFormula> - Parameters:
premise
- some formula
-
addPremises
Description copied from interface:Rule
Add the given premises to this rule.- Specified by:
addPremises
in interfaceRule<PlFormula,
PlFormula> - Parameters:
premises
- some formulas
-