Package net.sf.tweety.logics.rpcl.syntax
Class RelationalProbabilisticConditional
- java.lang.Object
-
- net.sf.tweety.logics.commons.syntax.RelationalFormula
-
- net.sf.tweety.logics.rcl.syntax.RelationalConditional
-
- net.sf.tweety.logics.rpcl.syntax.RelationalProbabilisticConditional
-
- All Implemented Interfaces:
Formula
,Rule<FolFormula,FolFormula>
,ClassicalFormula
,ComplexLogicalFormula
,Conjunctable
,Disjunctable
,Invertable
,LogicStructure
,ProbabilityAware
,QuantifiedFormula
,SimpleLogicalFormula
public class RelationalProbabilisticConditional extends RelationalConditional
This class represents a relational probabilistic conditional, i.e. a structure (B|A)[p] with first-order formulas A and B and a probability p.
Premise and conclusion of this conditional must confirm to a fol language without quantifiers and without functions (@see net.sf.tweety.logics.firstorderlogic.lang.FolLanguageNoQuantifiersNoFunctions)- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description RelationalProbabilisticConditional(FolFormula premise, FolFormula conclusion, Probability probability)
Creates a new conditional with the given premise, conclusion and probability.RelationalProbabilisticConditional(FolFormula conclusion, Probability probability)
Creates a new conditional with the given conclusion and probability and a tautological premise.RelationalProbabilisticConditional(RelationalConditional conditional, Probability probability)
Creates a new relational probabilistic conditional with the given conditional and probability
-
Method Summary
Modifier and Type Method Description RelationalProbabilisticConditional
complement()
boolean
equals(java.lang.Object obj)
Probability
getProbability()
Returns the probability of this conditional.int
hashCode()
RelationalFormula
substitute(Term<?> v, Term<?> t)
Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.logics.rcl.syntax.RelationalConditional
addPremise, addPremises, clone, combineWithAnd, combineWithOr, containsQuantifier, getAtoms, getConclusion, getFunctors, getPredicates, getPremise, getQuantifierVariables, getSignature, getTerms, getTerms, getUnboundVariables, getUniformProbability, isClosed, isClosed, isConstraint, isFact, isLiteral, isWellBound, isWellBound, setConclusion
-
Methods inherited from class net.sf.tweety.logics.commons.syntax.RelationalFormula
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
-
-
-
-
Constructor Detail
-
RelationalProbabilisticConditional
public RelationalProbabilisticConditional(FolFormula premise, FolFormula conclusion, Probability probability)
Creates a new conditional with the given premise, conclusion and probability.- Parameters:
premise
- a fol formula.conclusion
- a fol formula.probability
- a probability.
-
RelationalProbabilisticConditional
public RelationalProbabilisticConditional(FolFormula conclusion, Probability probability)
Creates a new conditional with the given conclusion and probability and a tautological premise.- Parameters:
conclusion
- a fol formula.probability
- a probability.
-
RelationalProbabilisticConditional
public RelationalProbabilisticConditional(RelationalConditional conditional, Probability probability)
Creates a new relational probabilistic conditional with the given conditional and probability- Parameters:
conditional
- a relational conditional.probability
- a probability.
-
-
Method Detail
-
getProbability
public Probability getProbability()
Returns the probability of this conditional.- Returns:
- the probability of this conditional.
-
substitute
public RelationalFormula substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
Description copied from class:RelationalFormula
Substitutes 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:
substitute
in interfaceComplexLogicalFormula
- Overrides:
substitute
in classRelationalConditional
- 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).
-
toString
public java.lang.String toString()
- Overrides:
toString
in classRelationalConditional
-
complement
public RelationalProbabilisticConditional complement()
- Specified by:
complement
in interfaceInvertable
- Overrides:
complement
in classRelationalConditional
- Returns:
- the complement of this formula.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Overrides:
hashCode
in classRelationalConditional
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Overrides:
equals
in classRelationalConditional
-
-