lp.unit
Class TransformedDlp
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
java.util.LinkedHashSet<LpRule>
lp.unit.GeneralizedLogicProgram
lp.unit.TransformedDlp
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<LpRule>, Collection<LpRule>, Set<LpRule>, LogicProgram
public class TransformedDlp
- extends GeneralizedLogicProgram
Represents the normal logic program that was constructed from a dynamic
logic program. It can be used as an ordinary logic program but it also offers
the possibility to remember the types of the rules in it. A rule of a
specific type can be added by using the
add(LpRule, TransDlpRuleType)
method. The
getGroup(TransDlpRuleType)
will return all rules that were added
with a specific type.
- Version:
- 1.0.0
- Author:
- Martin Slota
- See Also:
DlpTransformer.transform(DynamicLogicProgram)
,
Serialized Form
Constructor Summary |
TransformedDlp()
Creates a new instance of TransformedDlp . |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ruleGroups
private final Map<TransDlpRuleType,LogicProgram> ruleGroups
- A mapping of types to logic programs.
TransformedDlp
public TransformedDlp()
- Creates a new instance of
TransformedDlp
. It is intially empty.
add
public boolean add(LpRule rule,
TransDlpRuleType type)
- Adds the rule
rule
to this program and remembers it to be of type
type
.
- Parameters:
rule
- the rule to addtype
- type of the rule
- Returns:
true
if this program did not already contain the
specified rule
getGroup
public LogicProgram getGroup(TransDlpRuleType type)
- Returns a
LogicProgram
containing all rules of type type
from this program.
- Parameters:
type
- type of the rules that should returned
- Returns:
- as specified above