Class Derivation<T extends Rule<?,?>>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
org.tweetyproject.commons.util.rules.Derivation<T>
- Type Parameters:
T
- the specific rule class
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,SequencedCollection<T>
This class models a derivation, i.e. a minimal (with respect to set
inclusion) sequence of rules [R1, ... ,Rn] such that for any
Ri and for any p in the premise of Ri there is an Rj with j > i
and the conclusion of Rj equals p.
- Author:
- Matthias Thimm
- See Also:
-
Constructor Summary
ConstructorDescriptionDerivation
(List<T> rules) Creates a new derivation with the given sequence of rules. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends Rule<?,
?>>
Set<Derivation<S>> allDerivations
(Collection<? extends S> rules) Returns the set of all possible derivations from the set of rules.static <S extends Rule<?,
?>>
Set<Derivation<S>> allDerivations
(Collection<? extends S> rules, Formula conclusion) Returns the set of all possible derivations with the given conclusion from the set of rules.boolean
Returns the conclusion of this derivation.int
hashCode()
boolean
Checks whether this derivation is founded, i.e.boolean
Checks whether this derivation is minimal with respect to set inclusion.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
Derivation
-
-
Method Details
-
getConclusion
Returns the conclusion of this derivation.- Returns:
- the conclusion of this derivation.
-
allDerivations
public static <S extends Rule<?,?>> Set<Derivation<S>> allDerivations(Collection<? extends S> rules) Returns the set of all possible derivations from the set of rules.- Type Parameters:
S
- the type of rules- Parameters:
rules
- a set of rules- Returns:
- the set of all possible derivations
-
allDerivations
public static <S extends Rule<?,?>> Set<Derivation<S>> allDerivations(Collection<? extends S> rules, Formula conclusion) Returns the set of all possible derivations with the given conclusion from the set of rules.- Type Parameters:
S
- the type of rules- Parameters:
rules
- a set of rulesconclusion
- the conclusion- Returns:
- the set of all possible derivations with the given conclusion
-
isFounded
public boolean isFounded()Checks whether this derivation is founded, i.e. whether every formula appearing in the premise of a rule is also the conclusion of a previous rule.- Returns:
- "true" if this derivation is founded.
-
isMinimal
public boolean isMinimal()Checks whether this derivation is minimal with respect to set inclusion. This is equivalent to checking whether every conclusion besides the first is used in a premise and no conclusion appear twice.- Returns:
- "true" if this derivation is minimal.
-
hashCode
-
equals
-