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
ConstructorsConstructorDescriptionConditional(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 TypeMethodDescriptionvoidaddPremise(PlFormula premise) Add the given premise to this rule.voidaddPremises(Collection<? extends PlFormula> premises) Add the given premises to this rule.clone()Creates a deep copy of this formulaCombines this conditional with another formula using logical conjunction (AND).Combines this conditional with another formula using logical disjunction (OR).Returns the complement of this conditional.booleangetAtoms()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.inthashCode()booleanisConstraintbooleanisFact()Checks whether this conditional is a fact, i.e.booleanvoidsetConclusion(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
-
-
Method Details
-
getPremise
Description copied from interface:RuleReturns the premise of this rule.- Specified by:
getPremisein interfaceRule<PlFormula,PlFormula> - Returns:
- the premise of this rule.
-
getConclusion
-
isFact
-
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
-
combineWithAnd
Combines this conditional with another formula using logical conjunction (AND).This operation is unsupported for conditionals, and calling this method will result in an exception.
- Parameters:
f- the formula to combine with.- Returns:
- this method will not return anything as it throws an exception.
- Throws:
UnsupportedOperationException- because conditionals cannot be combined using AND.
-
combineWithOr
Combines this conditional with another formula using logical disjunction (OR).This operation is unsupported for conditionals, and calling this method will result in an exception.
- Parameters:
f- the formula to combine with.- Returns:
- this method will not return anything as it throws an exception.
- Throws:
UnsupportedOperationException- because conditionals cannot be combined using OR.
-
complement
Returns the complement of this conditional.The complement is a new conditional with the same premise but with the complement of the conclusion.
- Returns:
- a new conditional that represents the complement of this conditional.
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceSimpleLogicalFormula- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceSimpleLogicalFormula- Overrides:
equalsin classObject
-
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
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
Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
clonein interfaceSimpleLogicalFormula- 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
- Specified by:
getPredicateClsin interfaceSimpleLogicalFormula- Returns:
- The class description of the predicate used by this formula.
-
isConstraint
public boolean isConstraint()Description copied from interface:RuleisConstraint- Specified by:
isConstraintin interfaceRule<PlFormula,PlFormula> - Returns:
- whether the rule is a constraint
-
setConclusion
-
addPremise
-
addPremises
Description copied from interface:RuleAdd the given premises to this rule.- Specified by:
addPremisesin interfaceRule<PlFormula,PlFormula> - Parameters:
premises- some formulas
-