Package net.sf.tweety.arg.delp.syntax
Class DelpRule
- java.lang.Object
-
- net.sf.tweety.logics.commons.syntax.RelationalFormula
-
- net.sf.tweety.arg.delp.syntax.DelpRule
-
- All Implemented Interfaces:
net.sf.tweety.commons.Formula,net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>,net.sf.tweety.logics.commons.syntax.interfaces.ClassicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable,net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable,net.sf.tweety.logics.commons.syntax.interfaces.Invertable,net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure,net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware,net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
- Direct Known Subclasses:
DefeasibleRule,DelpFact,StrictRule
public abstract class DelpRule extends net.sf.tweety.logics.commons.syntax.RelationalFormula implements net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>This method is the superclass for both a strict rule and a defeasible rule in defeasible logic programming and captures their common attributes and methods.- Author:
- Matthias Thimm, Tim Janus
-
-
Method Summary
Modifier and Type Method Description voidaddPremise(net.sf.tweety.logics.fol.syntax.FolFormula premise)voidaddPremises(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> premises)net.sf.tweety.logics.fol.syntax.ConjunctioncombineWithAnd(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable f)net.sf.tweety.logics.fol.syntax.DisjunctioncombineWithOr(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable f)net.sf.tweety.logics.commons.syntax.RelationalFormulacomplement()booleancontainsQuantifier()booleanequals(Object o)Set<net.sf.tweety.logics.fol.syntax.FolAtom>getAtoms()net.sf.tweety.logics.fol.syntax.FolFormulagetConclusion()Set<net.sf.tweety.logics.commons.syntax.Functor>getFunctors()Set<net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula>getPremise()Set<net.sf.tweety.logics.commons.syntax.Variable>getQuantifierVariables()net.sf.tweety.logics.fol.syntax.FolSignaturegetSignature()Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getTerms()<C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
Set<C>getTerms(Class<C> cls)Set<net.sf.tweety.logics.commons.syntax.Variable>getUnboundVariables()net.sf.tweety.math.probability.ProbabilitygetUniformProbability()inthashCode()booleanisApplicable(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> literals)Checks whether this rule is applicaple in the given contextliterals,booleanisClosed()booleanisClosed(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)booleanisConstraint()booleanisFact()booleanisGround()Checks whether there appear any variables in this rulebooleanisLiteral()booleanisWellBound()booleanisWellBound(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)voidsetConclusion(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)abstract net.sf.tweety.logics.commons.syntax.RelationalFormulasubstitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)StringtoString()
-
-
-
Field Detail
-
head
protected net.sf.tweety.logics.fol.syntax.FolFormula head
The head of the rule (this must be a literal).
-
body
protected Set<net.sf.tweety.logics.fol.syntax.FolFormula> body
The body of the rule (these must be a literals).
-
-
Method Detail
-
isApplicable
public boolean isApplicable(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> literals)
Checks whether this rule is applicaple in the given contextliterals,- Parameters:
literals- a set of literals- Returns:
trueiff this rule is applicaple, i.e., if the body of the rule is a subset of the given set of literals
-
isGround
public boolean isGround()
Checks whether there appear any variables in this rule- Specified by:
isGroundin interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Overrides:
isGroundin classnet.sf.tweety.logics.commons.syntax.RelationalFormula- Returns:
trueiff there appears no variable in this rule
-
getPremise
public Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> getPremise()
- Specified by:
getPremisein interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
getConclusion
public net.sf.tweety.logics.fol.syntax.FolFormula getConclusion()
- Specified by:
getConclusionin interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
combineWithAnd
public net.sf.tweety.logics.fol.syntax.Conjunction combineWithAnd(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable f)
- Specified by:
combineWithAndin interfacenet.sf.tweety.logics.commons.syntax.interfaces.Conjunctable- Specified by:
combineWithAndin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
combineWithOr
public net.sf.tweety.logics.fol.syntax.Disjunction combineWithOr(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable f)
- Specified by:
combineWithOrin interfacenet.sf.tweety.logics.commons.syntax.interfaces.Disjunctable- Specified by:
combineWithOrin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
complement
public net.sf.tweety.logics.commons.syntax.RelationalFormula complement()
- Specified by:
complementin interfacenet.sf.tweety.logics.commons.syntax.interfaces.Invertable- Specified by:
complementin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
getPredicates
public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
- Specified by:
getPredicatesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
-
getAtoms
public Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAtoms()
- Specified by:
getAtomsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getAtomsin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteralin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
-
getTerms
public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
- Specified by:
getTermsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
-
getTerms
public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms(Class<C> cls)
- Specified by:
getTermsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
-
getQuantifierVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()
- Specified by:
getQuantifierVariablesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isFact
public boolean isFact()
- Specified by:
isFactin interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
isConstraint
public boolean isConstraint()
- Specified by:
isConstraintin interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
setConclusion
public void setConclusion(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)
- Specified by:
setConclusionin interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
addPremise
public void addPremise(net.sf.tweety.logics.fol.syntax.FolFormula premise)
- Specified by:
addPremisein interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
addPremises
public void addPremises(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> premises)
- Specified by:
addPremisesin interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
containsQuantifier
public boolean containsQuantifier()
- Specified by:
containsQuantifierin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
substitute
public abstract net.sf.tweety.logics.commons.syntax.RelationalFormula substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) throws IllegalArgumentException- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
substitutein classnet.sf.tweety.logics.commons.syntax.RelationalFormula- Throws:
IllegalArgumentException
-
getUnboundVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
- Specified by:
getUnboundVariablesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isClosed
public boolean isClosed(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
- Specified by:
isClosedin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isWellBound
public boolean isWellBound()
- Specified by:
isWellBoundin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isWellBound
public boolean isWellBound(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
- Specified by:
isWellBoundin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
getFunctors
public Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()
- Specified by:
getFunctorsin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
getUniformProbability
public net.sf.tweety.math.probability.Probability getUniformProbability()
- Specified by:
getUniformProbabilityin interfacenet.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware- Specified by:
getUniformProbabilityin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
toString
public String toString()
- Specified by:
toStringin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
getSignature
public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula- Specified by:
getSignaturein interfacenet.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,net.sf.tweety.logics.fol.syntax.FolFormula>
-
-