public class RelationalConditional extends RelationalFormula implements Rule<FolFormula,FolFormula>
Modifier and Type | Field and Description |
---|---|
private FolFormula |
conclusion
The conclusion of the conditional.
|
private FolFormula |
premise
The premise of the conditional.
|
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addPremise(FolFormula premise) |
void |
addPremises(java.util.Collection<? extends FolFormula> premises) |
RelationalConditional |
clone()
Creates a deep copy of this formula
|
Conjunction |
combineWithAnd(Conjuctable f)
Returns a conjunction of this and the given formula.
|
Disjunction |
combineWithOr(Disjunctable f) |
RelationalFormula |
complement() |
boolean |
containsQuantifier()
Checks whether this formula contains any quantification.
|
boolean |
equals(java.lang.Object obj) |
java.util.Set<FOLAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
FolFormula |
getConclusion()
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
formula
|
java.util.Collection<? extends FolFormula> |
getPremise()
Returns the premise of this rule.
|
java.util.Set<Variable> |
getQuantifierVariables() |
java.util.Set<Term<?>> |
getTerms() |
<C extends Term<?>> |
getTerms(java.lang.Class<C> cls)
Processes the set containing all terms of type C.
|
java.util.Set<Variable> |
getUnboundVariables() |
Probability |
getUniformProbability() |
int |
hashCode() |
boolean |
isClosed()
Checks whether this formula is closed, i.e.
|
boolean |
isClosed(java.util.Set<Variable> boundVariables)
Checks whether this formula is closed, i.e.
|
boolean |
isConstraint() |
boolean |
isFact()
Checks whether this conditional is a fact, i.e.
|
boolean |
isLiteral() |
boolean |
isWellBound()
Checks whether this formula is well-bound, i.e.
|
boolean |
isWellBound(java.util.Set<Variable> boundVariables)
Checks whether this formula is well-bound, i.e.
|
void |
setConclusion(FolFormula conclusion) |
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() |
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, getSignature, isGround, isWellFormed, substitute
finalize, getClass, notify, notifyAll, wait, wait, wait
getSignature
private FolFormula premise
private FolFormula conclusion
public RelationalConditional(FolFormula premise, FolFormula conclusion)
premise
- a fol formula.conclusion
- a fol formula.public RelationalConditional(FolFormula conclusion)
conclusion
- a fol formula.public boolean containsQuantifier()
QuantifiedFormula
containsQuantifier
in interface QuantifiedFormula
public java.util.Set<FOLAtom> getAtoms()
SimpleLogicalFormula
getAtoms
in interface SimpleLogicalFormula
getAtoms
in class RelationalFormula
public java.util.Set<Predicate> getPredicates()
SimpleLogicalFormula
getPredicates
in interface SimpleLogicalFormula
public java.util.Set<Variable> getUnboundVariables()
getUnboundVariables
in interface QuantifiedFormula
public boolean isFact()
isFact
in interface Rule<FolFormula,FolFormula>
public boolean isClosed()
QuantifiedFormula
isClosed
in interface QuantifiedFormula
public boolean isClosed(java.util.Set<Variable> boundVariables)
QuantifiedFormula
isClosed
in interface QuantifiedFormula
boundVariables
- the variables assumed to be bound.public boolean isWellBound()
QuantifiedFormula
isWellBound
in interface QuantifiedFormula
public boolean isWellBound(java.util.Set<Variable> boundVariables)
QuantifiedFormula
isWellBound
in interface QuantifiedFormula
boundVariables
- the variables assumed to be bound.public RelationalFormula substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
RelationalFormula
substitute
in interface ComplexLogicalFormula
substitute
in class RelationalFormula
v
- the term to be substituted.t
- the term to substitute.java.lang.IllegalArgumentException
- if "v" and "t" are of different sorts
(NOTE: this exception is only thrown when "v" actually appears in this
formula).public java.lang.String toString()
toString
in class RelationalFormula
public java.util.Set<Functor> getFunctors()
getFunctors
in class RelationalFormula
public FolFormula getConclusion()
Rule
getConclusion
in interface Rule<FolFormula,FolFormula>
public java.util.Collection<? extends FolFormula> getPremise()
Rule
getPremise
in interface Rule<FolFormula,FolFormula>
public Conjunction combineWithAnd(Conjuctable f)
Conjuctable
combineWithAnd
in interface Conjuctable
combineWithAnd
in class RelationalFormula
f
- a formula to be combined with AND and this.public Disjunction combineWithOr(Disjunctable f)
combineWithOr
in interface Disjunctable
combineWithOr
in class RelationalFormula
f
- a formula to be combined with OR and this.public RelationalFormula complement()
complement
in interface Invertable
complement
in class RelationalFormula
public int hashCode()
hashCode
in interface SimpleLogicalFormula
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface SimpleLogicalFormula
equals
in class java.lang.Object
public Probability getUniformProbability()
getUniformProbability
in interface ProbabilityAware
getUniformProbability
in class RelationalFormula
public boolean isLiteral()
isLiteral
in interface SimpleLogicalFormula
public java.util.Set<Term<?>> getTerms()
getTerms
in interface LogicStructure
public <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
LogicStructure
getTerms
in interface LogicStructure
cls
- The Class structure containing type information about the
searched termpublic java.util.Set<Variable> getQuantifierVariables()
getQuantifierVariables
in interface QuantifiedFormula
public RelationalConditional clone()
SimpleLogicalFormula
clone
in interface ComplexLogicalFormula
clone
in interface SimpleLogicalFormula
clone
in class RelationalFormula
public boolean isConstraint()
isConstraint
in interface Rule<FolFormula,FolFormula>
public void setConclusion(FolFormula conclusion)
setConclusion
in interface Rule<FolFormula,FolFormula>
public void addPremise(FolFormula premise)
addPremise
in interface Rule<FolFormula,FolFormula>
public void addPremises(java.util.Collection<? extends FolFormula> premises)
addPremises
in interface Rule<FolFormula,FolFormula>