forge.solve
Class ForgeBounds

java.lang.Object
  extended by forge.solve.ForgeBounds
All Implemented Interfaces:
ProgramElement

public final class ForgeBounds
extends java.lang.Object
implements ProgramElement

Bounds type and the intial value of variables by constants.

Author:
Greg Dennis (gdennis@mit.edu)

Constructor Summary
ForgeBounds(ForgeProgram program, int bitWidth, java.util.Map<InstanceDomain,java.lang.Integer> scopes)
           
 
Method Summary
 int bitWidth()
          Return the bitwidth of integers in this bound.
 BooleanAtom boolAtom(boolean value)
          Return the boolean atom with the given value.
 void boundInitial(ForgeVariable var, ForgeConstant lower, ForgeConstant upper)
          Bounds the initial value of the given variable anove and below.
 ForgeConstant.Unary empty()
          Return the empty unary constant.
 ForgeConstant empty(int arity)
          Return the empty constant of the given arity.
 ForgeConstant.Unary extent(ForgeDomain type)
          Return the extent of the given domain type.
 ForgeConstant extent(ForgeType.Tuple type)
          Return the extent of the given tuple type.
 ForgeConstant.Unary extent(ForgeType.Unary type)
          Return the extent of the given unary type.
 ForgeConstant extent(ForgeType type)
          Return the extent of the given type.
 ForgeConstant initialLowerBound(ForgeVariable var)
          Return the initial lower bound for the given variable.
 ForgeConstant initialUpperBound(ForgeVariable var)
          Return the initial upper bound for the given variable.
 InstanceAtom instanceAtom(InstanceDomain idom, int atomIndex)
          Return the ith atom allocated for the given instance domain.
 InstanceAtom instanceAtom(InstanceLiteral ilit)
          Return the atom allocated for the given instance literal.
 int instanceBound(InstanceDomain idom)
          Return the number of atoms to which the given domain is limited.
 IntegerAtom intAtom(int value)
          Return integer atom with the given value.
 int maxIntValue()
          Return the maximum integer allowed by the bitwidth.
 int minIntValue()
          Return the minimum integer allowed by the bitwidth.
 ForgeProgram program()
          Returns the program to which this element belongs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForgeBounds

public ForgeBounds(ForgeProgram program,
                   int bitWidth,
                   java.util.Map<InstanceDomain,java.lang.Integer> scopes)
Method Detail

program

public ForgeProgram program()
Description copied from interface: ProgramElement
Returns the program to which this element belongs.

Specified by:
program in interface ProgramElement

empty

public ForgeConstant.Unary empty()
Return the empty unary constant.


empty

public ForgeConstant empty(int arity)
Return the empty constant of the given arity.


boolAtom

public BooleanAtom boolAtom(boolean value)
Return the boolean atom with the given value.


bitWidth

public int bitWidth()
Return the bitwidth of integers in this bound.


minIntValue

public int minIntValue()
Return the minimum integer allowed by the bitwidth.


maxIntValue

public int maxIntValue()
Return the maximum integer allowed by the bitwidth.


intAtom

public IntegerAtom intAtom(int value)
Return integer atom with the given value.


instanceBound

public int instanceBound(InstanceDomain idom)
Return the number of atoms to which the given domain is limited.


instanceAtom

public InstanceAtom instanceAtom(InstanceDomain idom,
                                 int atomIndex)
Return the ith atom allocated for the given instance domain.


instanceAtom

public InstanceAtom instanceAtom(InstanceLiteral ilit)
Return the atom allocated for the given instance literal.


extent

public ForgeConstant.Unary extent(ForgeDomain type)
Return the extent of the given domain type.


extent

public ForgeConstant.Unary extent(ForgeType.Unary type)
Return the extent of the given unary type.


extent

public ForgeConstant extent(ForgeType.Tuple type)
Return the extent of the given tuple type.


extent

public ForgeConstant extent(ForgeType type)
Return the extent of the given type.


boundInitial

public void boundInitial(ForgeVariable var,
                         ForgeConstant lower,
                         ForgeConstant upper)
Bounds the initial value of the given variable anove and below.


initialLowerBound

public ForgeConstant initialLowerBound(ForgeVariable var)
Return the initial lower bound for the given variable.


initialUpperBound

public ForgeConstant initialUpperBound(ForgeVariable var)
Return the initial upper bound for the given variable.