kodkod.ast
Class IntExpression

java.lang.Object
  extended by kodkod.ast.IntExpression
All Implemented Interfaces:
Node
Direct Known Subclasses:
BinaryIntExpression, ExprToIntCast, IfIntExpression, IntConstant, SumExpression, UnaryIntExpression

public abstract class IntExpression
extends java.lang.Object
implements Node

A Node whose value is an integer rather than a relational expression.

Author:
Emina Torlak

Method Summary
 IntExpression abs()
          Returns an IntExpression that represents the absolute value of this int expression.
abstract
<E,F,D,I> I
accept(ReturnVisitor<E,F,D,I> visitor)
          Accepts the given visitor and returns the result of the visit (i.e.
abstract  void accept(VoidVisitor visitor)
          Accepts the given void visitor by calling visitor.visit(this).
 IntExpression and(IntExpression intexpr)
          Returns an IntExpression that represents the bitwise AND of this and the given int node.
 IntExpression apply(UnaryIntExpression.Operator op)
          Returns an expression that represents the application of the given unary operator to this integer expression.
 Formula compare(IntComparisonFormula.Operator op, IntExpression intexpr)
          Returns a formula comparing this and the given integer expression using the specified operatior.
 IntExpression compose(BinaryIntExpression.Operator op, IntExpression intexpr)
          Returns an expression that combines this and the given integer expression using the specified operatior.
 IntExpression divide(IntExpression intexpr)
          Returns an IntExpression that represents the quotient of the division between this and the given int node.
 Formula eq(IntExpression intexpr)
          Returns a formula stating that the given int expression and this have the same value.
 Formula gt(IntExpression intexpr)
          Returns a formula stating that the value of this int expression is greater than the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.GT, intexpr).
 Formula gte(IntExpression intexpr)
          Returns a formula stating that the value of this int expression is greater than or equal to the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.GTE, intexpr).
 Formula lt(IntExpression intexpr)
          Returns a formula stating that the value of this int expression is less than the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.LT, intexpr).
 Formula lte(IntExpression intexpr)
          Returns a formula stating that the value of this int expression is less than or equal to the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.LTE, intexpr).
 IntExpression minus(IntExpression intexpr)
          Returns an IntExpression that represents the difference between this and the given int node.
 IntExpression modulo(IntExpression intexpr)
          Returns an IntExpression that represents the remainder of the division between this and the given int node.
 IntExpression multiply(IntExpression intexpr)
          Returns an IntExpression that represents the product of this and the given int node.
 IntExpression negate()
          Returns an IntExpression that represents the negation of this int expression.
 IntExpression not()
          Returns an IntExpression that represents the bitwise negation of this int expression.
 IntExpression or(IntExpression intexpr)
          Returns an IntExpression that represents the bitwise OR of this and the given int node.
 IntExpression plus(IntExpression intexpr)
          Returns an IntExpression that represents the sum of this and the given int node.
 IntExpression sha(IntExpression intexpr)
          Returns an IntExpression that represents the right shift of this and the given int node, with sign extension.
 IntExpression shl(IntExpression intexpr)
          Returns an IntExpression that represents the left shift of this by the given int node.
 IntExpression shr(IntExpression intexpr)
          Returns an IntExpression that represents the right shift of this and the given int node, with zero extension.
 IntExpression signum()
          Returns an IntExpression that represents the sign of this int expression.
 IntExpression sum(Decls decls)
          Returns an integer expression that is the sum of all values that this integer expression can take given the provided declarations.
 Expression toExpression()
          Returns an expression whose meaning is the singleton set containing the atom that represents the integer given by this integer expression.
 IntExpression xor(IntExpression intexpr)
          Returns an IntExpression that represents the bitwise XOR of this and the given int node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

eq

public final Formula eq(IntExpression intexpr)
Returns a formula stating that the given int expression and this have the same value. The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.EQ, intexpr).

Returns:
{f: Formula | f <=> this = other }

lt

public final Formula lt(IntExpression intexpr)
Returns a formula stating that the value of this int expression is less than the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.LT, intexpr).

Returns:
{f: Formula | f <=> this < other }

lte

public final Formula lte(IntExpression intexpr)
Returns a formula stating that the value of this int expression is less than or equal to the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.LTE, intexpr).

Returns:
{f: Formula | f <=> this <= other }

gt

public final Formula gt(IntExpression intexpr)
Returns a formula stating that the value of this int expression is greater than the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.GT, intexpr).

Returns:
{f: Formula | f <=> this > other }

gte

public final Formula gte(IntExpression intexpr)
Returns a formula stating that the value of this int expression is greater than or equal to the value of the given int expression The effect of this method is the same as calling this.compose(IntComparisonFormula.Operator.GTE, intexpr).

Returns:
{f: Formula | f <=> this >= other }

compare

public Formula compare(IntComparisonFormula.Operator op,
                       IntExpression intexpr)
Returns a formula comparing this and the given integer expression using the specified operatior.

Returns:
{f: Formula | f <=> this op intexpr }

sum

public final IntExpression sum(Decls decls)
Returns an integer expression that is the sum of all values that this integer expression can take given the provided declarations.

Returns:
{e: IntExpression | [[e]] = sum decls | this }

plus

public final IntExpression plus(IntExpression intexpr)
Returns an IntExpression that represents the sum of this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.PLUS, intexpr).

Returns:
{e: IntExpression | [[e]] = this + intexpr }

minus

public final IntExpression minus(IntExpression intexpr)
Returns an IntExpression that represents the difference between this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.MINUS, intexpr).

Returns:
{e: IntExpression | [[e]] = this - intexpr }

multiply

public final IntExpression multiply(IntExpression intexpr)
Returns an IntExpression that represents the product of this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.MULTIPLY, intexpr).

Returns:
{e: IntExpression | [[e]] = this * intexpr }

divide

public final IntExpression divide(IntExpression intexpr)
Returns an IntExpression that represents the quotient of the division between this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.DIVIDE, intexpr).

Returns:
{e: IntExpression | [[e]] = this / intexpr }

modulo

public final IntExpression modulo(IntExpression intexpr)
Returns an IntExpression that represents the remainder of the division between this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.MODULO, intexpr).

Returns:
{e: IntExpression | [[e]] = this % intexpr }

and

public final IntExpression and(IntExpression intexpr)
Returns an IntExpression that represents the bitwise AND of this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.AND, intexpr).

Returns:
{e: IntExpression | [[e]] = this & intexpr }

or

public final IntExpression or(IntExpression intexpr)
Returns an IntExpression that represents the bitwise OR of this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.OR, intexpr).

Returns:
{e: IntExpression | [[e]] = this | intexpr }

xor

public final IntExpression xor(IntExpression intexpr)
Returns an IntExpression that represents the bitwise XOR of this and the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.XOR, intexpr).

Returns:
{e: IntExpression | [[e]] = this & intexpr }

shl

public final IntExpression shl(IntExpression intexpr)
Returns an IntExpression that represents the left shift of this by the given int node. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.SHL, intexpr).

Returns:
{e: IntExpression | [[e]] = this << intexpr }

shr

public final IntExpression shr(IntExpression intexpr)
Returns an IntExpression that represents the right shift of this and the given int node, with zero extension. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.SHR, intexpr).

Returns:
{e: IntExpression | [[e]] = this >>> intexpr }

sha

public final IntExpression sha(IntExpression intexpr)
Returns an IntExpression that represents the right shift of this and the given int node, with sign extension. The effect of this method is the same as calling this.compose(BinaryIntExpression.Operator.SHA, intexpr).

Returns:
{e: IntExpression | [[e]] = this >> intexpr }

compose

public final IntExpression compose(BinaryIntExpression.Operator op,
                                   IntExpression intexpr)
Returns an expression that combines this and the given integer expression using the specified operatior.

Returns:
{e: IntExpression | [[e]] = this op intexpr }

negate

public final IntExpression negate()
Returns an IntExpression that represents the negation of this int expression. The effect of this method is the same as calling this.apply(UnaryIntExpression.Operator.MINUS).

Returns:
{e: IntExpression | [[e]] = -[[e]] }

not

public final IntExpression not()
Returns an IntExpression that represents the bitwise negation of this int expression. The effect of this method is the same as calling this.apply(UnaryIntExpression.Operator.NOT).

Returns:
{e: IntExpression | [[e]] = ~[[e]] }

abs

public final IntExpression abs()
Returns an IntExpression that represents the absolute value of this int expression. The effect of this method is the same as calling this.apply(UnaryIntExpression.Operator.ABS).

Returns:
{e: IntExpression | [[e]] = abs([[e]]) }

signum

public final IntExpression signum()
Returns an IntExpression that represents the sign of this int expression. The effect of this method is the same as calling this.apply(UnaryIntExpression.Operator.SGN).

Returns:
{e: IntExpression | [[e]] = signum([[e]]) }

apply

public final IntExpression apply(UnaryIntExpression.Operator op)
Returns an expression that represents the application of the given unary operator to this integer expression.

Returns:
{e: IntExpression | [[e]] = op ( [[this]] ) }

toExpression

public final Expression toExpression()
Returns an expression whose meaning is the singleton set containing the atom that represents the integer given by this integer expression.

Returns:
an expression whose meaning is the singleton set containing the atom that represents the integer given by this integer expression.

accept

public abstract <E,F,D,I> I accept(ReturnVisitor<E,F,D,I> visitor)
Accepts the given visitor and returns the result of the visit (i.e. the result of the call visitor.visit(this))

Specified by:
accept in interface Node
Returns:
the result of being visited by the given visitor
See Also:
Node.accept(kodkod.ast.visitor.ReturnVisitor)

accept

public abstract void accept(VoidVisitor visitor)
Accepts the given void visitor by calling visitor.visit(this).

Specified by:
accept in interface Node
See Also:
Node.accept(kodkod.ast.visitor.VoidVisitor)