Class AtomType

java.lang.Object
fr.inria.rules.integraal.util.AtomType

public class AtomType extends Object
Computes the signature (or type) of an atom. More precisely, for each position i of atom p(x1,..,xn), it is determined whether
(1) x_i is a constant or a variable and
(2) there are multiple occurrences of the same variable.
  • Field Details

    • VARIABLE

      public static final int VARIABLE
      Mask for a Variable
      See Also:
    • CONSTANT_OR_FROZEN_VAR_OR_GROUND_FUNCTIONAL_TERM

      public static final int CONSTANT_OR_FROZEN_VAR_OR_GROUND_FUNCTIONAL_TERM
      Mask for a constant
      See Also:
    • FUNCTIONAL_TERM_WITH_VARS

      public static final int FUNCTIONAL_TERM_WITH_VARS
      Mask for a functional term that still contains variables.
      See Also:
  • Constructor Details

    • AtomType

      public AtomType(Atom atom)
      Creates the mask of the atom
      Parameters:
      atom - atom to mask
    • AtomType

      public AtomType(Atom atom, Substitution s)
      Creates the mask of the atom
      Parameters:
      atom - atom to mask
      s - substitution
  • Method Details

    • getType

      public int getType(int index)
      Returns the mask value computed for the term at the supplied position.
      Parameters:
      index - position in the atom
      Returns:
      the type of the term at the given position
    • isThereConstant

      public boolean isThereConstant()
      Indicates whether the atom contains at least one constant-like term.
      Returns:
      true iff there is a constant in the atom
    • isThereFunctionalTermWithVars

      public boolean isThereFunctionalTermWithVars()
      Indicates whether the atom contains a functional term with variables.
      Returns:
      true iff there is a functional term with variables in the atom
    • isThereConstraint

      public boolean isThereConstraint()
      Indicates whether the atom contains a repeated variable constraint.
      Returns:
      true iff there is a constraint in the atom