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 formulabooleangetAtoms()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
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:RuleReturns the premise of this rule.- Specified by:
getPremisein interfaceRule<PlFormula,PlFormula> - Returns:
- the premise of this rule.
-
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
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
-
combineWithOr
-
complement
-
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
Description copied from interface:RuleSet the conclusion of this rule.- Specified by:
setConclusionin interfaceRule<PlFormula,PlFormula> - Parameters:
conclusion- some formula
-
addPremise
Description copied from interface:RuleAdd the given premise to this rule.- Specified by:
addPremisein interfaceRule<PlFormula,PlFormula> - Parameters:
premise- some formula
-
addPremises
Description copied from interface:RuleAdd the given premises to this rule.- Specified by:
addPremisesin interfaceRule<PlFormula,PlFormula> - Parameters:
premises- some formulas
-