PsiTerm (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.osf.base

## Class PsiTerm

- java.lang.Object
- - hlt.osf.base.OsfExpression
  - - hlt.osf.base.PsiTerm

- All Implemented Interfaces:
    Contextable

      public class PsiTerm
      extends OsfExpression

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PsiTerm()`
    `PsiTerm(SortExpression sort)`
    `PsiTerm(java.lang.String sortName)`
    `PsiTerm(Tag tag)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addContiguousPositionSubterm(PsiTerm psiterm)` This stores the provided term at the next contiguous position, whether or not a term is already stored there.
    `PsiTerm` | `deref()`
    `java.lang.String` | `displayForm()` Returns a pretty-printed form of this ψ-term.
    `static boolean` | `evaluateSorts()` Returns the current sort expression evaluation flag's value.
    `java.util.HashMap` | `features()`
    `PsiTerm` | `getNextContiguousPositionSubterm()` Returns the subterm at the next contiguous position if any, or `null`) if there isn't any.
    `PsiTerm` | `getSubterm(Feature feature)` This returns the subterm for the specified feature (which may be `null`).
    `PsiTerm` | `getSubterm(int position)` This returns the subterm at the given position if there is one stored there, or `null` otherwise, where positions are counted sarting from 1.
    `int` | `maxPosition()`
    `PsiTerm` | `merge(PsiTerm other)` This merges the uninterpreted structure of the specified ψ-term into this one's as explained in the specification, and returns this ψ-term resulting after the merging.
    `ArrayList` | `positions()`
    `java.lang.StringBuffer` | `prettyPrint(int margin, java.util.HashSet tags)` Returns a pretty printed form of this ψ-term, starting at the specified margin width and the array list of already processed tags.
    `PsiTerm` | `setSort(SortExpression sort)` Sets this ψ-term's sort expression to the provided one and returns this ψ-term.
    `void` | `setSubterm(Feature feature, PsiTerm psiterm)` This stores the provided term for the specified feature, whether or not a term is already stored there.
    `void` | `setSubterm(int position, PsiTerm psiterm)` This stores the provided ψ-term at the specified position (counting positions from 1), whether or not a term is already stored there.
    `PsiTerm` | `setTag(Tag tag)` Set this tag's ψ-term to the specified tag, sets the specified tag's term to this ψ-term, and returns this tag.
    `SortExpression` | `sort()` Returns the sort expression of this ψ-term, or `null` if none has been set for it yet.
    `Tag` | `tag()`
    `static void` | `toggleSortEvaluation()` Toggles sort expression evaluation.

    - ### Methods inherited from class hlt.osf.base.OsfExpression

      `context, setContext`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PsiTerm

          public PsiTerm()

    - #### PsiTerm

          public PsiTerm(Tag tag)

    - #### PsiTerm

          public PsiTerm(java.lang.String sortName)

    - #### PsiTerm

          public PsiTerm(SortExpression sort)

  - ### Method Detail

    - #### tag

          public Tag tag()

    - #### deref

          public PsiTerm deref()

    - #### setTag

          public PsiTerm setTag(Tag tag)

      Set this tag's ψ-term to the specified tag, sets the specified tag's term to this ψ-term, and returns this tag.

    - #### sort

          public SortExpression sort()

      Returns the sort expression of this ψ-term, or `null` if none has been set for it yet.

    - #### setSort

          public PsiTerm setSort(SortExpression sort)

      Sets this ψ-term's sort expression to the provided one and returns this ψ-term.

    - #### positions

          public ArrayList positions()

    - #### features

          public java.util.HashMap features()

    - #### maxPosition

          public int maxPosition()

    - #### getNextContiguousPositionSubterm

          public PsiTerm getNextContiguousPositionSubterm()

      Returns the subterm at the next contiguous position if any, or `null`) if there isn't any.

    - #### addContiguousPositionSubterm

          public void addContiguousPositionSubterm(PsiTerm psiterm)

      This stores the provided term at the next contiguous position, whether or not a term is already stored there.

    - #### getSubterm

          public PsiTerm getSubterm(int position)

      This returns the subterm at the given position if there is one stored there, or `null` otherwise, where positions are counted sarting from 1.

    - #### setSubterm

          public void setSubterm(int position,
                        PsiTerm psiterm)

      This stores the provided ψ-term at the specified position (counting positions from 1), whether or not a term is already stored there.

    - #### getSubterm

          public PsiTerm getSubterm(Feature feature)

      This returns the subterm for the specified feature (which may be `null`).

    - #### setSubterm

          public void setSubterm(Feature feature,
                        PsiTerm psiterm)

      This stores the provided term for the specified feature, whether or not a term is already stored there.

    - #### merge

          public PsiTerm merge(PsiTerm other)

      This merges the uninterpreted structure of the specified ψ-term into this one's as explained in the specification, and returns this ψ-term resulting after the merging. This assumes that the specified ψ-term has been dereferenced to its true identity. NB: Merging subterms must ensure dereferencing them first.

    - #### displayForm

          public java.lang.String displayForm()

      Returns a pretty-printed form of this ψ-term.
      Specified by:
        `displayForm` in class `OsfExpression`

    - #### evaluateSorts

          public static boolean evaluateSorts()

      Returns the current sort expression evaluation flag's value.

    - #### toggleSortEvaluation

          public static void toggleSortEvaluation()

      Toggles sort expression evaluation.

    - #### prettyPrint

          public java.lang.StringBuffer prettyPrint(int margin,
                                           java.util.HashSet tags)

      Returns a pretty printed form of this ψ-term, starting at the specified margin width and the array list of already processed tags.