Package apron

Class Texpr0Intern

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

public class Texpr0Intern extends Object implements Cloneable, Serializable
Class of level 0 expression trees in opaque Apron representation.

A Texpr0Intern represents an expression tree, with unary and binary operator nodes, and Coeff constant and variables (represented by dimension) leaves.

A Texpr0Intern encapsulates an Apron ap_texpr0_t object, an opaque object that can be passed to and retreived from Apron abstract domains. Texpr0Intern objects can be converted from and to Texpr0Node concrete expression trees for construction and inspection.

See Also:
  • Constructor Details

    • Texpr0Intern

      public Texpr0Intern(Texpr0Node t)
      Converts a Java concrete tree to an opaque Apron tree (deep copy).
    • Texpr0Intern

      public Texpr0Intern(Linexpr0 e)
      Converts a linear expression to a comb-like expression tree.
    • Texpr0Intern

      public Texpr0Intern(Texpr0Intern c)
      Deep copy.
  • Method Details

    • finalize

      protected void finalize()
      Deallocates the underlying ap_texpr0_t Apron object.
      Overrides:
      finalize in class Object
    • toTexpr0Node

      public Texpr0Node toTexpr0Node()
      Converts an opaque Apron tree to a concrete Java tree.
    • getDepth

      public int getDepth()
      Returns the depth of the expression tree.
    • getSize

      public int getSize()
      Returns the number of internal nodes in the tree.
    • maxDim

      public int maxDim()
      Maximum occurring dimension + 1.
    • hasDim

      public boolean hasDim(int dim)
      Whether the dimension dim is present.
    • getDims

      public int[] getDims()
      Returns an ordered list of all occurring dimensions.
    • isIntervalCst

      public boolean isIntervalCst()
      Whether the expression is constant.
    • isIntervalLinear

      public boolean isIntervalLinear()
      Whether the expression is linear with interval or scalar coefficients, and there is no rounding.
    • isIntervalPolynomial

      public boolean isIntervalPolynomial()
      Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.
    • isIntervalPolyfrac

      public boolean isIntervalPolyfrac()
      Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.
    • isScalar

      public boolean isScalar()
      Whether all coefficients are scalar (non interval).
    • substitute

      public void substitute(int dim, Texpr0Intern t)
      Substitutes all occurrences of the dimension dim with the expression tree t.
    • substituteCopy

      public Texpr0Intern substituteCopy(int dim, Texpr0Intern t)
      Returns a copy of this where all occurrences of the dimension dim are substituted with the expression tree t.
    • addDimensions

      public void addDimensions(Dimchange c)
      Adds some dimensions and shifts coefficients accordingly.
    • addDimensionsCopy

      public Texpr0Intern addDimensionsCopy(Dimchange c)
      Returns a copy of this with some dimensions added.
    • removeDimensions

      public void removeDimensions(Dimchange c)
      Removes some dimensions and shifts coefficients accordingly.
    • removeDimensionsCopy

      public Texpr0Intern removeDimensionsCopy(Dimchange c)
      Returns a copy of this with some dimensions removed.
    • permuteDimensions

      public void permuteDimensions(Dimperm p)
      Permutes some dimensions in the expression.
    • permuteDimensionsCopy

      public Texpr0Intern permuteDimensionsCopy(Dimperm p)
      Returns a copy of this with some dimensions permuted.
    • hashCode

      public int hashCode()
      Recursive hashing.
      Overrides:
      hashCode in class Object
    • isEqual

      public boolean isEqual(Texpr0Intern t)
      Structural (recursive) equality.
    • toString

      public String toString()
      Converts the expression tree to a String.

      Dimension i is denoted as xi.

      Overrides:
      toString in class Object
    • toString

      public String toString(Var[] names)
      Converts the expression tree to a String.

      Dimension i is denoted by names[i].

    • toString

      public String toString(String[] names)
    • clone

      public Texpr0Intern clone()
      Returns a deep copy of this.
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object x)
      Whether x is a Texpr0Intern tree and structurally equal to this.
      Overrides:
      equals in class Object