Package net.sf.tweety.commons.util.rules
Class RuleSet<T extends Rule<?,?>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<T>
-
- net.sf.tweety.commons.util.rules.RuleSet<T>
-
- Type Parameters:
T
- the specific rule class
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.Set<T>
- Direct Known Subclasses:
AspicArgumentationTheory
,NLPProgram
,Program
public class RuleSet<T extends Rule<?,?>> extends java.util.HashSet<T>
This class represents a set of rules and provides several auxiliary methods for accessing such a set.- Author:
- Matthias Thimm, Tim Janus
- See Also:
- Serialized Form
-
-
Method Summary
Modifier and Type Method Description java.util.Set<Formula>
getConclusions()
Returns all conclusions of all rules of this rule set.java.util.Set<Formula>
getPremises()
Returns all premises appearing in this rule set.java.util.Set<T>
getRulesWithConclusion(Formula f)
Returns all rules this set with the given conclusionRuleSet<T>
getSyntacticModule(Formula f)
Returns the maximal subset of this rule set that is closed under "syntactic" neighbourhood relationship for the given formula.-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
-
-
-
-
Constructor Detail
-
RuleSet
public RuleSet()
Creates a new empty rule set.
-
RuleSet
public RuleSet(java.util.Collection<? extends T> rules)
Creates a new rule set with the given rules- Parameters:
rules
- a collection of rules.
-
-
Method Detail
-
getRulesWithConclusion
public java.util.Set<T> getRulesWithConclusion(Formula f)
Returns all rules this set with the given conclusion- Parameters:
f
- a formula- Returns:
- all rules this set with the given conclusion
-
getConclusions
public java.util.Set<Formula> getConclusions()
Returns all conclusions of all rules of this rule set.- Returns:
- all conclusions of all rules of this rule set.
-
getPremises
public java.util.Set<Formula> getPremises()
Returns all premises appearing in this rule set.- Returns:
- all premises appearing in this rule set.
-
getSyntacticModule
public RuleSet<T> getSyntacticModule(Formula f)
Returns the maximal subset of this rule set that is closed under "syntactic" neighbourhood relationship for the given formula. A formula/rule has a "syntactic" neighbourhood relationship with a rule iff they share vocabulary elements.- Parameters:
f
- some formula- Returns:
- a rule set.
-
-