Package apron

Class Texpr1BinNode

java.lang.Object
apron.Texpr1Node
apron.Texpr1BinNode
All Implemented Interfaces:
Serializable, Cloneable

public class Texpr1BinNode extends Texpr1Node implements Cloneable, Serializable
Class of binary operator nodes in Texpr1Node level 1 expression trees.
See Also:
  • Field Details

  • Constructor Details

    • Texpr1BinNode

      public Texpr1BinNode(int o, int rtyp, int rdi, Texpr1Node lAr, Texpr1Node rAr)
      Creates a new binary operator node, with the specified operator, rounding type, rounding direction, left and right arguments.

      The subtree arguments are referenced, not copied.

    • Texpr1BinNode

      public Texpr1BinNode(int o, Texpr1Node lAr, Texpr1Node rAr)
      Creates a new binary operator node, with the specified operator, and left and right arguments, and no rounding.

      The subtree arguments are referenced, not copied.

  • Method Details

    • shallowCopy

      public Texpr1Node shallowCopy()
      Description copied from class: Texpr1Node
      Shallow copy.
      Specified by:
      shallowCopy in class Texpr1Node
    • deepCopy

      public Texpr1Node deepCopy()
      Description copied from class: Texpr1Node
      Deep copy.
      Specified by:
      deepCopy in class Texpr1Node
    • toTexpr0Node

      public Texpr0Node toTexpr0Node(Environment e)
      Description copied from class: Texpr1Node
      Converts the level 1 tree to a level 0 tree in the given environment.
      Specified by:
      toTexpr0Node in class Texpr1Node
    • toString

      public String toString()
      Description copied from class: Texpr1Node
      Converts the expression tree to a String.
      Specified by:
      toString in class Texpr1Node
    • getOperation

      public int getOperation()
    • setOperation

      public void setOperation(int o)
    • getRoundingType

      public int getRoundingType()
    • setRoundingType

      public void setRoundingType(int t)
    • getRoundingDirection

      public int getRoundingDirection()
    • setRoundingDirection

      public void setRoundingDirection(int d)
    • getLeftArgument

      public Texpr1Node getLeftArgument()
    • setLeftArgument

      public void setLeftArgument(Texpr1Node n)
    • getRightArgument

      public Texpr1Node getRightArgument()
    • setRightArgument

      public void setRightArgument(Texpr1Node n)
    • getDepth

      public int getDepth()
      Description copied from class: Texpr1Node
      Returns the depth of the expression tree.
      Specified by:
      getDepth in class Texpr1Node
    • getSize

      public int getSize()
      Description copied from class: Texpr1Node
      Returns the number of internal nodes in the tree.
      Specified by:
      getSize in class Texpr1Node
    • hasVar

      public boolean hasVar(Var var)
      Description copied from class: Texpr1Node
      Whether the variable var occurs in the tree.
      Specified by:
      hasVar in class Texpr1Node
    • fillVars

      protected void fillVars(HashSet<Var> set)
      Description copied from class: Texpr1Node
      Used internally for getVars.
      Specified by:
      fillVars in class Texpr1Node
    • isIntervalCst

      public boolean isIntervalCst()
      Description copied from class: Texpr1Node
      Whether the expression is constant.
      Specified by:
      isIntervalCst in class Texpr1Node
    • isIntervalLinear

      public boolean isIntervalLinear()
      Description copied from class: Texpr1Node
      Whether the expression is linear with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalLinear in class Texpr1Node
    • isIntervalPolynomial

      public boolean isIntervalPolynomial()
      Description copied from class: Texpr1Node
      Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalPolynomial in class Texpr1Node
    • isIntervalPolyfrac

      public boolean isIntervalPolyfrac()
      Description copied from class: Texpr1Node
      Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalPolyfrac in class Texpr1Node
    • isScalar

      public boolean isScalar()
      Description copied from class: Texpr1Node
      Whether all coefficients are scalar (non interval).
      Specified by:
      isScalar in class Texpr1Node
    • substitute

      public Texpr1Node substitute(Var var, Texpr1Node t)
      Description copied from class: Texpr1Node
      Substitutes all occurrences of the variable var with the tree t.

      this is modified in-place.

      As some nodes can change their kind (a node for a variable var becomes the root of the tree t), a new root node is returned.

      Specified by:
      substitute in class Texpr1Node
    • hashCode

      public int hashCode()
      Description copied from class: Texpr1Node
      Recursive hashing.
      Specified by:
      hashCode in class Texpr1Node
    • isEqual

      public boolean isEqual(Texpr1Node t)
      Description copied from class: Texpr1Node
      Structural (recursive) equality.
      Specified by:
      isEqual in class Texpr1Node
    • getPrecedence

      public int getPrecedence()
      Description copied from class: Texpr1Node
      Precedence of the node, used when printing.
      Specified by:
      getPrecedence in class Texpr1Node
    • equals

      public boolean equals(Object x)
      Description copied from class: Texpr1Node
      Whether x is a Texpr1 tree and structurally equal to this.
      Specified by:
      equals in class Texpr1Node