Package openllet.core
Class DependencySet
- java.lang.Object
-
- openllet.core.DependencySet
-
public class DependencySet extends java.lang.ObjectDependencySet for concepts and edges in the ABox for backjumping- Author:
- Evren Sirin
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.logging.Logger_loggerstatic DependencySetDUMMYA dummy dependency set that is used just to indicate there is a dependencystatic DependencySetEMPTYAn empty dependency setstatic DependencySetINDEPENDENTUsed for assertions that are true by nature, i.e. an _individual always has type owl:Thingstatic intNO_BRANCHstatic IntSetZERO
-
Constructor Summary
Constructors Constructor Description DependencySet(int branch)Create a dependency set that _depends on a single _branchDependencySet(java.util.Set<openllet.aterm.ATermAppl> explain)Creates a dependency set with no dependency and a set of explanation atomsDependencySet(openllet.aterm.ATermAppl explainAtom)Creates a dependency set with no dependency and single explanation atom
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int b)Add the integer valuebto this DependencySet.DependencySetcache()Return a dummy representation of this DependencySet such thatthis.isIndependent() == this.copyForCache().isIndependent()The returned copy will not be accurate w.r.t. any other function call, e.g.booleancontains(int b)DependencySetcopy(int newBranch)intgetBranch()IntSetgetDepends()java.util.Set<openllet.aterm.ATermAppl>getExplain()booleanisIndependent()intmax()voidremove(int b)Remove the integer valuebfrom this DependencySet.voidremoveExplain(openllet.aterm.ATermAppl assertion)Remove explanation sets which contain references to a syntactic assertionvoidsetExplain(java.util.Set<openllet.aterm.ATermAppl> explain)intsize()java.lang.StringtoString()DependencySetunion(java.util.Set<openllet.aterm.ATermAppl> explain, boolean doExplanation)DependencySetunion(DependencySet ds, boolean doExplanation)
-
-
-
Field Detail
-
_logger
public static final java.util.logging.Logger _logger
-
NO_BRANCH
public static final int NO_BRANCH
- See Also:
- Constant Field Values
-
EMPTY
public static final DependencySet EMPTY
An empty dependency set
-
INDEPENDENT
public static final DependencySet INDEPENDENT
Used for assertions that are true by nature, i.e. an _individual always has type owl:Thing
-
ZERO
public static final IntSet ZERO
-
DUMMY
public static final DependencySet DUMMY
A dummy dependency set that is used just to indicate there is a dependency
-
-
Constructor Detail
-
DependencySet
public DependencySet(int branch)
Create a dependency set that _depends on a single _branch- Parameters:
branch- Branch number
-
DependencySet
public DependencySet(openllet.aterm.ATermAppl explainAtom)
Creates a dependency set with no dependency and single explanation atom- Parameters:
explainAtom-
-
DependencySet
public DependencySet(java.util.Set<openllet.aterm.ATermAppl> explain)
Creates a dependency set with no dependency and a set of explanation atoms- Parameters:
explain-
-
-
Method Detail
-
copy
public DependencySet copy(int newBranch)
- Parameters:
newBranch-- Returns:
- a new DependencySet object with a new _branch number where the IntSet is openllet.shared.hash (changing one will change the other).
-
contains
public boolean contains(int b)
- Parameters:
b-- Returns:
- true if
bis in this set.
-
add
public void add(int b)
Add the integer valuebto this DependencySet.- Parameters:
b-
-
remove
public void remove(int b)
Remove the integer valuebfrom this DependencySet.- Parameters:
b-
-
isIndependent
public boolean isIndependent()
- Returns:
- true if there is no dependency on a non-deterministic _branch
-
getBranch
public int getBranch()
- Returns:
- the _branch number when the dependency set was created
-
size
public int size()
- Returns:
- the number of elements in this set.
-
max
public int max()
- Returns:
- the maximum value in this set.
-
union
public DependencySet union(DependencySet ds, boolean doExplanation)
- Parameters:
ds-doExplanation-- Returns:
- a new DependencySet and all the elements of
thisandds.
-
union
public DependencySet union(java.util.Set<openllet.aterm.ATermAppl> explain, boolean doExplanation)
- Parameters:
explain-doExplanation-- Returns:
- the union as dependencySet
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
removeExplain
public void removeExplain(openllet.aterm.ATermAppl assertion)
Remove explanation sets which contain references to a syntactic assertion- Parameters:
assertion-
-
getDepends
public IntSet getDepends()
-
setExplain
public void setExplain(java.util.Set<openllet.aterm.ATermAppl> explain)
- Parameters:
explain- the explain to set
-
getExplain
public java.util.Set<openllet.aterm.ATermAppl> getExplain()
- Returns:
- the set of explanations associated with this DependencySet.
-
cache
public DependencySet cache()
Return a dummy representation of this DependencySet such thatthis.isIndependent() == this.copyForCache().isIndependent()The returned copy will not be accurate w.r.t. any other function call, e.g.contains(int)for the copy will return different results for the copy. This function does not create a new DependencySet object so will not require additional memory. Caching this copy is more appropriate so we don't waste space for storing the actual dependency set or the explanation which are not used in caches anyway.- Returns:
- the dummy dependency set, the cache
-
-