public class DependencySet extends Object
| Modifier and Type | Field and Description |
|---|---|
static DependencySet |
DUMMY
A dummy dependency set that is used just to indicate there is a
dependency
|
static DependencySet |
EMPTY
An empty dependency set
|
static DependencySet |
INDEPENDENT
Used for assertions that are true by nature, i.e.
|
static Logger |
log |
static int |
NO_BRANCH |
static IntSet |
ZERO |
| Constructor and Description |
|---|
DependencySet(aterm.ATermAppl explainAtom)
Creates a dependency set with no dependency and single explanation atom
|
DependencySet(int branch)
Create a dependency set that depends on a single branch
|
DependencySet(Set<aterm.ATermAppl> explain)
Creates a dependency set with no dependency and a set of explanation
atoms
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int b)
Add the integer value
b to this DependencySet. |
DependencySet |
cache()
Return a dummy representation of this DependencySet such that
this.isIndependent() == this.copyForCache().isIndependent()
The returned copy will not be accurate w.r.t. |
boolean |
contains(int b)
Return true if
b is in this set. |
DependencySet |
copy(int newBranch)
Creates a new DependencySet object with a new branch number where the IntSet
is shared (changing one will change the other).
|
int |
getBranch()
Get the branch number when the dependency set was created
|
IntSet |
getDepends() |
Set<aterm.ATermAppl> |
getExplain()
Return the set of explanations associated with this DependencySet.
|
boolean |
isIndependent()
Return true if there is no dependency on a non-deterministic branch
|
int |
max()
Return the maximum value in this set.
|
void |
remove(int b)
Remove the integer value
b from this DependencySet. |
void |
removeExplain(aterm.ATermAppl assertion)
Remove explanation sets which contain references to a syntactic assertion
|
void |
setDepends(IntSet depends) |
void |
setExplain(Set<aterm.ATermAppl> explain) |
int |
size()
Return the number of elements in this set.
|
String |
toString() |
DependencySet |
union(DependencySet ds,
boolean doExplanation)
Create a new DependencySet and all the elements of
this
and ds. |
DependencySet |
union(IntSet set)
Create a new DependencySet and all the elements of
this
and set . |
DependencySet |
union(Set<aterm.ATermAppl> explain,
boolean doExplanation) |
public static final Logger log
public static final int NO_BRANCH
public static final DependencySet EMPTY
public static final DependencySet INDEPENDENT
public static final IntSet ZERO
public static final DependencySet DUMMY
public DependencySet(int branch)
branch - Branch numberpublic DependencySet(aterm.ATermAppl explainAtom)
public DependencySet(Set<aterm.ATermAppl> explain)
public DependencySet copy(int newBranch)
public boolean contains(int b)
b is in this set.b - public void add(int b)
b to this DependencySet.b - public void remove(int b)
b from this DependencySet.b - public boolean isIndependent()
public int getBranch()
public int size()
public int max()
public DependencySet union(IntSet set)
this
and set .ds - public DependencySet union(DependencySet ds, boolean doExplanation)
this
and ds.ds - doExplanation - public DependencySet union(Set<aterm.ATermAppl> explain, boolean doExplanation)
explain - doExplanation - public void removeExplain(aterm.ATermAppl assertion)
assertion - public void setDepends(IntSet depends)
public IntSet getDepends()
public void setExplain(Set<aterm.ATermAppl> explain)
explain - the explain to setpublic Set<aterm.ATermAppl> getExplain()
public DependencySet cache()
this.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.Copyright © 2019. All rights reserved.