public abstract class DelpRule extends RelationalFormula implements Rule<FolFormula,FolFormula>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<FolFormula> |
body
The body of the rule (these must be a literals).
|
protected FolFormula |
head
The head of the rule (this must be a literal).
|
| Constructor and Description |
|---|
DelpRule(FolFormula head,
java.util.Collection<? extends FolFormula> body)
Default constructor; initializes head and body of the rule
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPremise(FolFormula premise) |
void |
addPremises(java.util.Collection<? extends FolFormula> premises) |
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 o) |
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() |
(package private) abstract java.lang.String |
getSymbol() |
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 |
isApplicable(java.util.Collection<? extends FolFormula> literals)
Checks whether this rule is applicaple in the given context
|
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() |
boolean |
isGround()
Checks whether there appear any variables in this rule
|
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) |
abstract 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, clone, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, getSignature, isWellFormed, substitutefinalize, getClass, notify, notifyAll, wait, wait, waitgetSignatureprotected FolFormula head
protected java.util.Set<FolFormula> body
DelpRule(FolFormula head, java.util.Collection<? extends FolFormula> body)
head - a literalbody - a set of literalsabstract java.lang.String getSymbol()
public boolean isApplicable(java.util.Collection<? extends FolFormula> literals)
literals - a set of literalspublic boolean isGround()
isGround in interface ComplexLogicalFormulaisGround in class RelationalFormulapublic java.util.Collection<? extends FolFormula> getPremise()
RulegetPremise in interface Rule<FolFormula,FolFormula>public FolFormula getConclusion()
RulegetConclusion 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 java.util.Set<Predicate> getPredicates()
SimpleLogicalFormulagetPredicates in interface SimpleLogicalFormulapublic java.util.Set<FOLAtom> getAtoms()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulagetAtoms 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 boolean isFact()
isFact in interface Rule<FolFormula,FolFormula>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>public boolean containsQuantifier()
QuantifiedFormulacontainsQuantifier in interface QuantifiedFormulapublic abstract 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.util.Set<Variable> getUnboundVariables()
getUnboundVariables in interface QuantifiedFormulapublic 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 java.util.Set<Functor> getFunctors()
getFunctors in class RelationalFormulapublic Probability getUniformProbability()
getUniformProbability in interface ProbabilityAwaregetUniformProbability in class RelationalFormulapublic java.lang.String toString()
toString in class RelationalFormulapublic boolean equals(java.lang.Object o)
equals in interface SimpleLogicalFormulaequals in class java.lang.Objectpublic int hashCode()
hashCode in interface SimpleLogicalFormulahashCode in class java.lang.Object