Class RelationalConditional
- java.lang.Object
- 
- org.tweetyproject.logics.commons.syntax.RelationalFormula
- 
- org.tweetyproject.logics.rcl.syntax.RelationalConditional
 
 
- 
- All Implemented Interfaces:
- Formula,- Rule<FolFormula,FolFormula>,- ClassicalFormula,- ComplexLogicalFormula,- Conjunctable,- Disjunctable,- Invertable,- LogicStructure,- ProbabilityAware,- QuantifiedFormula,- SimpleLogicalFormula
 - Direct Known Subclasses:
- RelationalProbabilisticConditional
 
 public class RelationalConditional extends RelationalFormula implements Rule<FolFormula,FolFormula> Instances of this class represent relational conditionals.
 Premise and conclusion of this conditional must confirm to a fol language without quantifiers and without functions (@see org.tweetyproject.logics.firstorderlogic.lang.FolLanguageNoQuantifiersNoFunctions)- Author:
- Matthias Thimm TODO dont use relation formula cause it is a Quantified formula that not support or and etc.
 
- 
- 
Constructor SummaryConstructors Constructor Description RelationalConditional(FolFormula conclusion)Creates a new conditional with the given conclusion and a tautological premise.RelationalConditional(FolFormula premise, FolFormula conclusion)Creates a new conditional with the given premise and conclusion.
 - 
Method SummaryModifier and Type Method Description voidaddPremise(FolFormula premise)Add the given premise to this rule.voidaddPremises(java.util.Collection<? extends FolFormula> premises)Add the given premises to this rule.RelationalConditionalclone()Creates a deep copy of this formulaConjunctioncombineWithAnd(Conjunctable f)Returns a conjunction of this and the given formula.DisjunctioncombineWithOr(Disjunctable f)RelationalFormulacomplement()booleancontainsQuantifier()Checks whether this formula contains any quantification.booleanequals(java.lang.Object obj)java.util.Set<FolAtom>getAtoms()Processes the set of all atoms which appear in this formulaFolFormulagetConclusion()Returns the conclusion of this rule.java.util.Set<Functor>getFunctors()java.util.Set<Predicate>getPredicates()Processes the set of all predicates which appear in this formulajava.util.Collection<? extends FolFormula>getPremise()Returns the premise of this rule.java.util.Set<Variable>getQuantifierVariables()FolSignaturegetSignature()Returns the signature of the language of this formula.java.util.Set<Term<?>>getTerms()<C extends Term<?>>
 java.util.Set<C>getTerms(java.lang.Class<C> cls)Processes the set containing all terms of type C.java.util.Set<Variable>getUnboundVariables()ProbabilitygetUniformProbability()inthashCode()booleanisClosed()Checks whether this formula is closed, i.e.booleanisClosed(java.util.Set<Variable> boundVariables)Checks whether this formula is closed, i.e.booleanisConstraint()booleanisFact()Checks whether this conditional is a fact, i.e.booleanisLiteral()booleanisWellBound()Checks whether this formula is well-bound, i.e.booleanisWellBound(java.util.Set<Variable> boundVariables)Checks whether this formula is well-bound, i.e.voidsetConclusion(FolFormula conclusion)Set the conclusion of this rule.RelationalFormulasubstitute(Term<?> v, Term<?> t)Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.java.lang.StringtoString()- 
Methods inherited from class org.tweetyproject.logics.commons.syntax.RelationalFormulaallGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
 
- 
 
- 
- 
- 
Constructor Detail- 
RelationalConditionalpublic RelationalConditional(FolFormula premise, FolFormula conclusion) Creates a new conditional with the given premise and conclusion.- Parameters:
- premise- a fol formula.
- conclusion- a fol formula.
 
 - 
RelationalConditionalpublic RelationalConditional(FolFormula conclusion) Creates a new conditional with the given conclusion and a tautological premise.- Parameters:
- conclusion- a fol formula.
 
 
- 
 - 
Method Detail- 
containsQuantifierpublic boolean containsQuantifier() Description copied from interface:QuantifiedFormulaChecks whether this formula contains any quantification.- Specified by:
- containsQuantifierin interface- QuantifiedFormula
- Returns:
- "true" if this formula contains a quantification.
 
 - 
getAtomspublic java.util.Set<FolAtom> getAtoms() Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
- getAtomsin interface- SimpleLogicalFormula
- Specified by:
- getAtomsin class- RelationalFormula
- Returns:
- all atoms that appear in this formula.
 
 - 
getPredicatespublic java.util.Set<Predicate> getPredicates() Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
- getPredicatesin interface- SimpleLogicalFormula
- Returns:
- all predicates that appear in this formula
 
 - 
getUnboundVariablespublic java.util.Set<Variable> getUnboundVariables() - Specified by:
- getUnboundVariablesin interface- QuantifiedFormula
- Returns:
- a set of of unbound variables
 
 - 
isFactpublic boolean isFact() Checks whether this conditional is a fact, i.e. has a tautological premise.- Specified by:
- isFactin interface- Rule<FolFormula,FolFormula>
- Returns:
- "true" iff this conditional is a fact.
 
 - 
isClosedpublic boolean isClosed() Description copied from interface:QuantifiedFormulaChecks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier.- Specified by:
- isClosedin interface- QuantifiedFormula
- Returns:
- "true" if this formula is closed, "false" otherwise.
 
 - 
isClosedpublic boolean isClosed(java.util.Set<Variable> boundVariables) Description copied from interface:QuantifiedFormulaChecks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier. Every variable in "boundVariables" is already assumed to be bound.- Specified by:
- isClosedin interface- QuantifiedFormula
- Parameters:
- boundVariables- the variables assumed to be bound.
- Returns:
- "true" if this formula is closed wrt. "boundVariables", "false" otherwise.
 
 - 
isWellBoundpublic boolean isWellBound() Description copied from interface:QuantifiedFormulaChecks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier's range.- Specified by:
- isWellBoundin interface- QuantifiedFormula
- Returns:
- "true" if this formula is well-bound, "false" otherwise.
 
 - 
isWellBoundpublic boolean isWellBound(java.util.Set<Variable> boundVariables) Description copied from interface:QuantifiedFormulaChecks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier range. Every variable in "boundVariables" is assumed to be bound already.- Specified by:
- isWellBoundin interface- QuantifiedFormula
- Parameters:
- boundVariables- the variables assumed to be bound.
- Returns:
- "true" if this formula is well-bound, "false" otherwise.
 
 - 
substitutepublic RelationalFormula substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException Description copied from class:RelationalFormulaSubstitutes all occurrences of term "v" in this formula by term "t" and returns the new formula. NOTE: if "v" is a variable and bound to a quantifier then "v" is not substituted in that quantifiers inner formula.- Specified by:
- substitutein interface- ComplexLogicalFormula
- Specified by:
- substitutein class- RelationalFormula
- Parameters:
- v- the term to be substituted.
- t- the term to substitute.
- Returns:
- a formula where every occurrence of "v" is replaced by "t".
- Throws:
- java.lang.IllegalArgumentException- if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula).
 
 - 
toStringpublic java.lang.String toString() - Specified by:
- toStringin class- RelationalFormula
 
 - 
getFunctorspublic java.util.Set<Functor> getFunctors() - Specified by:
- getFunctorsin class- RelationalFormula
- Returns:
- all functors that appear in this formula.
 
 - 
getConclusionpublic FolFormula getConclusion() Description copied from interface:RuleReturns the conclusion of this rule.- Specified by:
- getConclusionin interface- Rule<FolFormula,FolFormula>
- Returns:
- the conclusion of this rule.
 
 - 
getPremisepublic java.util.Collection<? extends FolFormula> getPremise() Description copied from interface:RuleReturns the premise of this rule.- Specified by:
- getPremisein interface- Rule<FolFormula,FolFormula>
- Returns:
- the premise of this rule.
 
 - 
combineWithAndpublic Conjunction combineWithAnd(Conjunctable f) Description copied from interface:ConjunctableReturns a conjunction of this and the given formula.- Specified by:
- combineWithAndin interface- Conjunctable
- Specified by:
- combineWithAndin class- RelationalFormula
- Parameters:
- f- a formula to be combined with AND and this.
- Returns:
- a conjunction of this and the given formula.
 
 - 
combineWithOrpublic Disjunction combineWithOr(Disjunctable f) - Specified by:
- combineWithOrin interface- Disjunctable
- Specified by:
- combineWithOrin class- RelationalFormula
- Parameters:
- f- a formula to be combined with OR and this.
- Returns:
- a disjunction of this and the given formula.
 
 - 
complementpublic RelationalFormula complement() - Specified by:
- complementin interface- Invertable
- Specified by:
- complementin class- RelationalFormula
- Returns:
- the complement of this formula.
 
 - 
hashCodepublic int hashCode() - Specified by:
- hashCodein interface- SimpleLogicalFormula
- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Specified by:
- equalsin interface- SimpleLogicalFormula
- Overrides:
- equalsin class- java.lang.Object
 
 - 
getUniformProbabilitypublic Probability getUniformProbability() - Specified by:
- getUniformProbabilityin interface- ProbabilityAware
- Specified by:
- getUniformProbabilityin class- RelationalFormula
- Returns:
- this formula's probability in the uniform distribution.
 
 - 
isLiteralpublic boolean isLiteral() - Specified by:
- isLiteralin interface- SimpleLogicalFormula
- Returns:
- true if the formula represents a literal in the language or false otherwise
 
 - 
getTermspublic java.util.Set<Term<?>> getTerms() - Specified by:
- getTermsin interface- LogicStructure
- Returns:
- a set containing all terms of this logical structure
 
 - 
getTermspublic <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls) Description copied from interface:LogicStructureProcesses the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.- Specified by:
- getTermsin interface- LogicStructure
- Type Parameters:
- C- the type of terms
- Parameters:
- cls- The Class structure containing type information about the searched term
- Returns:
- A set containing all terms of type C of this logical structure
 
 - 
getQuantifierVariablespublic java.util.Set<Variable> getQuantifierVariables() - Specified by:
- getQuantifierVariablesin interface- QuantifiedFormula
- Returns:
- a set containing all quantified variables
 
 - 
clonepublic RelationalConditional clone() Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
- clonein interface- ComplexLogicalFormula
- Specified by:
- clonein interface- SimpleLogicalFormula
- Specified by:
- clonein class- RelationalFormula
- Returns:
- the cloned formula
 
 - 
isConstraintpublic boolean isConstraint() - Specified by:
- isConstraintin interface- Rule<FolFormula,FolFormula>
 
 - 
setConclusionpublic void setConclusion(FolFormula conclusion) Description copied from interface:RuleSet the conclusion of this rule.- Specified by:
- setConclusionin interface- Rule<FolFormula,FolFormula>
- Parameters:
- conclusion- some formula
 
 - 
addPremisepublic void addPremise(FolFormula premise) Description copied from interface:RuleAdd the given premise to this rule.- Specified by:
- addPremisein interface- Rule<FolFormula,FolFormula>
- Parameters:
- premise- some formula
 
 - 
addPremisespublic void addPremises(java.util.Collection<? extends FolFormula> premises) Description copied from interface:RuleAdd the given premises to this rule.- Specified by:
- addPremisesin interface- Rule<FolFormula,FolFormula>
- Parameters:
- premises- some formulas
 
 - 
getSignaturepublic FolSignature getSignature() Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
- getSignaturein interface- Formula
- Specified by:
- getSignaturein interface- Rule<FolFormula,FolFormula>
- Returns:
- the signature of the language of this formula.
 
 
- 
 
-