public class Section extends java.util.ArrayList<Section.ELEMENT> implements java.lang.Cloneable
Section.ELEMENT
.Section.ELEMENT
,
Section.MAP
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
Section.ELEMENT
Represents the elements contained in a section.
|
static class |
Section.MAP
Class MAP represents map from variables to their sections.
|
Constructor and Description |
---|
Section(ArrayAccess acc)
Constructs a section with the specified array access.
|
Section(int dimension)
Constructs a section with the specified dimension.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Section.ELEMENT elem)
Adds a new element in the section.
|
Section |
clone()
Clones a section object.
|
boolean |
containsSymbols(java.util.Set<Symbol> vars)
Checks if the section contains the specified variables.
|
Section |
differenceFrom(Section other,
RangeDomain rd)
Performs difference operation between two sections with the specified
range domain.
|
void |
expandMay(RangeDomain rd,
java.util.Set<Symbol> vars)
Expand every section under the constraints given by the range domain.
|
void |
expandMust(RangeDomain rd,
java.util.Set<Symbol> ivs,
java.util.Set<Symbol> vars)
Expand every section under the constraints given by the range domain.
|
int |
getDimension()
returns a dimension
|
Section |
intersectWith(Section other,
RangeDomain rd)
Performs intersection operation between two sections with the specified
range domain.
|
boolean |
isArray()
Checks if the section is for an array variable.
|
boolean |
isScalar()
Checks if the section is for a scalar variable.
|
void |
removeAffected(Symbol var)
Removes section elements that contain the specified variable.
|
void |
removeSideAffected(FunctionCall fc)
Removes section elements that is affected by the specified function call.
|
void |
substituteForward(RangeDomain rd,
java.util.Set<Symbol> avoid)
Substitutes any variables having symbolic constant values in the section
avoiding cases that produces expression having a variable in the
"avoid" set.
|
java.lang.String |
toString()
Converts this section to a string.
|
Section |
unionWith(Section other,
RangeDomain rd)
Performs union operation between two sections with the specified range
domain.
|
public Section(int dimension)
dimension
- the dimension of the array. -1 for scalar variables.public Section(ArrayAccess acc)
acc
- the array access expression.public Section clone()
clone
in class java.util.ArrayList<Section.ELEMENT>
public boolean add(Section.ELEMENT elem)
add
in interface java.util.Collection<Section.ELEMENT>
add
in interface java.util.List<Section.ELEMENT>
add
in class java.util.ArrayList<Section.ELEMENT>
elem
- the new element to be added.public int getDimension()
public boolean isScalar()
public boolean isArray()
public boolean containsSymbols(java.util.Set<Symbol> vars)
public void expandMay(RangeDomain rd, java.util.Set<Symbol> vars)
rd
- the given range domain.vars
- the set of symbols to be expanded.public void expandMust(RangeDomain rd, java.util.Set<Symbol> ivs, java.util.Set<Symbol> vars)
rd
- the given range domain.ivs
- the set of symbols to be expanded.vars
- the set of symbols that should not be part of the expansion.public void substituteForward(RangeDomain rd, java.util.Set<Symbol> avoid)
public Section intersectWith(Section other, RangeDomain rd)
other
- the section being intersected with.rd
- the supporting range domain.public Section unionWith(Section other, RangeDomain rd)
other
- the section being unioned with.rd
- the supporting range domain.public Section differenceFrom(Section other, RangeDomain rd)
other
- the other section from which this section is differenced.rd
- the supporting range domain.public void removeAffected(Symbol var)
public void removeSideAffected(FunctionCall fc)
public java.lang.String toString()
toString
in class java.util.AbstractCollection<Section.ELEMENT>