lp.unit
Class GeneralizedLogicProgram
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
java.util.LinkedHashSet<LpRule>
lp.unit.GeneralizedLogicProgram
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<LpRule>, Collection<LpRule>, Set<LpRule>, LogicProgram
- Direct Known Subclasses:
- TransformedDlp, TransformedEvolp
public class GeneralizedLogicProgram
- extends LinkedHashSet<LpRule>
- implements LogicProgram
A default implementation of the LogicProgram
interface.
- Version:
- 1.0.0
- Author:
- Martin Slota
- See Also:
- Serialized Form
Constructor Summary |
GeneralizedLogicProgram()
Creates a new instance of GeneralizedLogicProgram representing an
empty logic program. |
Method Summary |
LpRule |
get(int index)
Returns the i -th rule in this logic program. |
boolean |
isGround()
Returns true iff this logic programs contains only ground rules,
i.e. rules that contain no variables. |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
GD
private static final LpGroundDecider GD
- A static
LpGroundDecider
instance used in the isGround()
method.
GeneralizedLogicProgram
public GeneralizedLogicProgram()
- Creates a new instance of
GeneralizedLogicProgram
representing an
empty logic program.
get
public LpRule get(int index)
- Returns the
i
-th rule in this logic program. Rules are required
to be in the order they were added to the program (just like in a list) .
But this order is not important when determining if two logic programs
are equal. Multiple appearance of one rule is also not important in this
respect.
- Specified by:
get
in interface LogicProgram
isGround
public boolean isGround()
- Returns
true
iff this logic programs contains only ground rules,
i.e. rules that contain no variables.
- Specified by:
isGround
in interface LogicProgram
- Returns:
- as specified above
- See Also:
LpGroundDecider.isGround(LpStructureUnit)