public class FlatRangeSet extends FlatPred
Modifier and Type | Field and Description |
---|---|
protected Bounds |
bounds_
The most recent variable bounds information.
|
protected net.sourceforge.czt.z.util.Factory |
factory_ |
Constructor and Description |
---|
FlatRangeSet(net.sourceforge.czt.z.ast.ZName lowerBound,
net.sourceforge.czt.z.ast.ZName upperBound,
net.sourceforge.czt.z.ast.ZName set)
Creates a FlatRangeSet object, with optional bounds.
|
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(net.sourceforge.czt.util.Visitor<R> visitor)
Calls visitor.visitPred (preferably) or visitor.visitTerm.
|
Mode |
chooseMode(Envir env)
Chooses the mode in which the predicate can be evaluated.
|
static int |
getAverageClosedRange() |
BigInteger |
getBound(int which) |
boolean |
inferBounds(Bounds bnds)
Saves the Bounds information for later use.
|
boolean |
nextEvaluation()
Does the actual evaluation
|
static void |
setAverageClosedRange(int size)
Sets the average expected size of a closed range a..b.
|
static void |
setAverageClosedRange(String str)
A convenience method for setting the average expected size
of a closed range a..b.
|
String |
toString()
A default implementation of toString.
|
freeVars, getArgs, getEnvir, getLastArg, getMode, indent, modeAllDefined, modeCollection, modeFunction, modeOneOutput, printArg, printBinOp, printLastArg, printName, printQuant, setMode, startEvaluation
protected net.sourceforge.czt.z.util.Factory factory_
protected Bounds bounds_
public FlatRangeSet(net.sourceforge.czt.z.ast.ZName lowerBound, net.sourceforge.czt.z.ast.ZName upperBound, net.sourceforge.czt.z.ast.ZName set)
lowerBound
- a lower bound expression, or null for no bound.upperBound
- an upper bound expression, or null for no bound.set
- the name of the resulting set of integers.public static int getAverageClosedRange()
public static void setAverageClosedRange(int size)
averageClosedRange
- should be 2..1000000000.public static void setAverageClosedRange(String str)
str
- An integer in string form.public boolean inferBounds(Bounds bnds)
inferBounds
in class FlatPred
bnds
- The database of lower and upper bounds for integer variables.The default implementation infers nothing and returns false.
public BigInteger getBound(int which)
public Mode chooseMode(Envir env)
chooseMode
in class FlatPred
public boolean nextEvaluation()
nextEvaluation
in class FlatPred
public String toString()
FlatPred
public <R> R accept(net.sourceforge.czt.util.Visitor<R> visitor)
FlatPred
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.