lp.unit
Class DynamicLogicProgram
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<LogicProgram>
lp.unit.DynamicLogicProgram
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<LogicProgram>, Collection<LogicProgram>, List<LogicProgram>, RandomAccess
public class DynamicLogicProgram
- extends ArrayList<LogicProgram>
Represents a dynamic logic program, i.e. a sequence of logic programs.
In the semantics of dynamic logic programs, the rules from programs further
in the sequence are preferred over rules from preceding programs.
- Version:
- 1.0.0
- Author:
- Martin Slota
- See Also:
LogicProgram
,
GeneralizedLogicProgram
,
Serialized Form
Constructor Summary |
DynamicLogicProgram()
Creates a new instance of DynamicLogicProgram . |
DynamicLogicProgram(int initialCapacity)
Creates a new instance of DynamicLogicProgram with the specified
initial capacity. |
Method Summary |
boolean |
add(LogicProgram program)
Adds program to end of this dynamic logic program. |
boolean |
isGround()
Returns true iff all programs in the sequence are also ground. |
Methods inherited from class java.util.ArrayList |
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
DynamicLogicProgram
public DynamicLogicProgram()
- Creates a new instance of
DynamicLogicProgram
.
DynamicLogicProgram
public DynamicLogicProgram(int initialCapacity)
- Creates a new instance of
DynamicLogicProgram
with the specified
initial capacity.
- Parameters:
initialCapacity
- the initial capacity of this ArrayList
add
public boolean add(LogicProgram program)
- Adds
program
to end of this dynamic logic program. In case it is
null
, an immutable empty program is added.
- Specified by:
add
in interface Collection<LogicProgram>
- Specified by:
add
in interface List<LogicProgram>
- Overrides:
add
in class ArrayList<LogicProgram>
- Parameters:
program
- the program to add
- Returns:
true
- See Also:
EmptyProgram
isGround
public boolean isGround()
- Returns
true
iff all programs in the sequence are also ground.
- Returns:
- as specified above
- See Also:
LogicProgram.isGround()