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, substitutefinalize, getClass, notify, notifyAll, wait, wait, waitgetSignatureprivate 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()
QuantifiedFormulacontainsQuantifier in interface QuantifiedFormulapublic java.util.Set<FOLAtom> getAtoms()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulagetAtoms in class RelationalFormulapublic java.util.Set<Predicate> getPredicates()
SimpleLogicalFormulagetPredicates in interface SimpleLogicalFormulapublic java.util.Set<Variable> getUnboundVariables()
getUnboundVariables in interface QuantifiedFormulapublic boolean isFact()
isFact in interface Rule<FolFormula,FolFormula>public boolean isClosed()
QuantifiedFormulaisClosed in interface QuantifiedFormulapublic boolean isClosed(java.util.Set<Variable> boundVariables)
QuantifiedFormulaisClosed in interface QuantifiedFormulaboundVariables - the variables assumed to be bound.public boolean isWellBound()
QuantifiedFormulaisWellBound in interface QuantifiedFormulapublic boolean isWellBound(java.util.Set<Variable> boundVariables)
QuantifiedFormulaisWellBound in interface QuantifiedFormulaboundVariables - the variables assumed to be bound.public RelationalFormula substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
RelationalFormulasubstitute in interface ComplexLogicalFormulasubstitute in class RelationalFormulav - 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 RelationalFormulapublic java.util.Set<Functor> getFunctors()
getFunctors in class RelationalFormulapublic FolFormula getConclusion()
RulegetConclusion in interface Rule<FolFormula,FolFormula>public java.util.Collection<? extends FolFormula> getPremise()
RulegetPremise in interface Rule<FolFormula,FolFormula>public Conjunction combineWithAnd(Conjuctable f)
ConjuctablecombineWithAnd in interface ConjuctablecombineWithAnd in class RelationalFormulaf - a formula to be combined with AND and this.public Disjunction combineWithOr(Disjunctable f)
combineWithOr in interface DisjunctablecombineWithOr in class RelationalFormulaf - a formula to be combined with OR and this.public RelationalFormula complement()
complement in interface Invertablecomplement in class RelationalFormulapublic int hashCode()
hashCode in interface SimpleLogicalFormulahashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface SimpleLogicalFormulaequals in class java.lang.Objectpublic Probability getUniformProbability()
getUniformProbability in interface ProbabilityAwaregetUniformProbability in class RelationalFormulapublic boolean isLiteral()
isLiteral in interface SimpleLogicalFormulapublic java.util.Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
LogicStructuregetTerms in interface LogicStructurecls - The Class structure containing type information about the
searched termpublic java.util.Set<Variable> getQuantifierVariables()
getQuantifierVariables in interface QuantifiedFormulapublic RelationalConditional clone()
SimpleLogicalFormulaclone in interface ComplexLogicalFormulaclone in interface SimpleLogicalFormulaclone in class RelationalFormulapublic 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>