Package net.sf.tweety.arg.aba.syntax
Class Assumption<T extends Formula>
- java.lang.Object
-
- net.sf.tweety.arg.aba.syntax.AbaElement<T>
-
- net.sf.tweety.arg.aba.syntax.AbaRule<T>
-
- net.sf.tweety.arg.aba.syntax.Assumption<T>
-
- Type Parameters:
T
- is the type of the language that the ABA theory's rules range over
- All Implemented Interfaces:
Formula
,Rule<T,T>
,ComplexLogicalFormula
,LogicStructure
,SimpleLogicalFormula
public class Assumption<T extends Formula> extends AbaRule<T>
This class models an assumption of an ABA theory.- Author:
- Nils Geilen (geilenn@uni-koblenz.de)
-
-
Constructor Summary
Constructors Constructor Description Assumption(T assumption)
Creates a new assumption
-
Method Summary
Modifier and Type Method Description void
addPremise(T premise)
void
addPremises(java.util.Collection<? extends T> premises)
AbaElement<T>
clone()
Creates a deep copy of this formulaboolean
equals(java.lang.Object obj)
T
getConclusion()
Returns the conclusion of this rule.T
getFormula()
Returns the inner formula of this assumption.java.util.Set<? extends Predicate>
getPredicates()
Processes the set of all predicates which appear in this formulajava.util.Collection<? extends T>
getPremise()
Returns the premise of this rule.Signature
getSignature()
Returns the signature of the language of this formula.java.util.Set<Term<?>>
getTerms()
<C extends Term<?>>
java.util.Set<C>getTerms(java.lang.Class<C> cls)
Processes the set containing all terms of type C.int
hashCode()
boolean
isAssumption()
boolean
isConstraint()
boolean
isFact()
boolean
isLiteral()
void
setConclusion(T conclusion)
Assumption<T>
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.arg.aba.syntax.AbaElement
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getAtoms, getPredicateCls, getUnboundVariables, isGround, isWellFormed, substitute
-
-
-
-
Constructor Detail
-
Assumption
public Assumption(T assumption)
Creates a new assumption- Parameters:
assumption
- the assumed formula
-
-
Method Detail
-
isFact
public boolean isFact()
-
isConstraint
public boolean isConstraint()
-
setConclusion
public void setConclusion(T conclusion)
-
addPremise
public void addPremise(T premise)
-
addPremises
public void addPremises(java.util.Collection<? extends T> premises)
-
getSignature
public Signature getSignature()
Description copied from interface:Formula
Returns the signature of the language of this formula.- Returns:
- the signature of the language of this formula.
-
getPremise
public java.util.Collection<? extends T> getPremise()
Description copied from interface:Rule
Returns the premise of this rule.- Returns:
- the premise of this rule.
-
getConclusion
public T getConclusion()
Description copied from interface:Rule
Returns the conclusion of this rule.- Returns:
- the conclusion of this rule.
-
getFormula
public T getFormula()
Returns the inner formula of this assumption.- Returns:
- the inner formula of this assumption.
-
isAssumption
public boolean isAssumption()
- Specified by:
isAssumption
in classAbaRule<T extends Formula>
- Returns:
- whether this rule is an assumption
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Overrides:
equals
in classjava.lang.Object
-
getPredicates
public java.util.Set<? extends Predicate> getPredicates()
Description copied from interface:SimpleLogicalFormula
Processes the set of all predicates which appear in this formula- Returns:
- all predicates that appear in this formula
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteral
in interfaceSimpleLogicalFormula
- Overrides:
isLiteral
in classAbaElement<T extends Formula>
- Returns:
- true if the formula represents a literal in the language or false otherwise
-
getTerms
public java.util.Set<Term<?>> getTerms()
- Returns:
- a set containing all terms of this logical structure
-
getTerms
public <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
Description copied from interface:LogicStructure
Processes the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.- Type Parameters:
C
- the type of terms- Parameters:
cls
- The Class structure containing type information about the searched term- Returns:
- A set containing all terms of type C of this logical structure
-
clone
public AbaElement<T> clone()
Description copied from interface:SimpleLogicalFormula
Creates a deep copy of this formula- Specified by:
clone
in interfaceComplexLogicalFormula
- Specified by:
clone
in interfaceSimpleLogicalFormula
- Specified by:
clone
in classAbaElement<T extends Formula>
- Returns:
- the cloned formula
-
substitute
public Assumption<T> substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
Description copied from interface:ComplexLogicalFormula
Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- Specified by:
substitute
in interfaceComplexLogicalFormula
- Specified by:
substitute
in classAbaElement<T extends Formula>
- 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
-
-