lp.unit
Class TransformedDlp

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by java.util.LinkedHashSet<LpRule>
                  extended by lp.unit.GeneralizedLogicProgram
                      extended by 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

Field Summary
private  Map<TransDlpRuleType,LogicProgram> ruleGroups
          A mapping of types to logic programs.
 
Constructor Summary
TransformedDlp()
          Creates a new instance of TransformedDlp.
 
Method Summary
 boolean add(LpRule rule, TransDlpRuleType type)
          Adds the rule rule to this program and remembers it to be of type type.
 LogicProgram getGroup(TransDlpRuleType type)
          Returns a LogicProgram containing all rules of type type from this program.
 
Methods inherited from class lp.unit.GeneralizedLogicProgram
get, isGround
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

ruleGroups

private final Map<TransDlpRuleType,LogicProgram> ruleGroups
A mapping of types to logic programs.

Constructor Detail

TransformedDlp

public TransformedDlp()
Creates a new instance of TransformedDlp. It is intially empty.

Method Detail

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 add
type - 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