Term
Date: 2020-06-16

org.jpl7

## Class Term

- java.lang.Object
- - org.jpl7.Term

- Direct Known Subclasses:
    Atom, Compound, Dict, Float, Integer, JRef, Rational, Variable

      public abstract class Term
      extends java.lang.Object

  Term is the abstract base class for Compound, Atom, Variable, Integer and Float, which comprise a Java-oriented concrete syntax for Prolog. You cannot create instances of Term directly; rather, you should create instances of Term's concrete subclasses. Alternatively, use textToTerm() to construct a Term from its conventional Prolog source text representation.

  Copyright (C) 2004 Paul Singleton

  Copyright (C) 1998 Fred Dushin

  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Term()` This default constructor enables subclasses to define their own default constructors

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Term` | `arg(int i)` returns the i-th (1+) argument of a Term; defined only for Compound
    `Term[]` | `args()` The arguments of this Term.
    `int` | `arity()` the arity of a Compound, Atom, Integer or Float
    `static java.lang.String[]` | `atomListToStringArray(Term t)` Converts a term representing a list of atoms into an array of Strings, each element in the array being a String for the corresponding atom e.g., [a, b, 1
    `java.lang.String` | `atomType()`
    `java.math.BigInteger` | `bigValue()` the value (as a java.math.BigInteger) of an Integer, whether or not it is big
    `double` | `doubleValue()` the value (as a double) of an Integer or Float
    `float` | `floatValue()` the value (as a float) of an Integer or Float
    `protected void` | `getSubst(java.util.Map<java.lang.String,Term> varnames_to_Terms, java.util.Map<term_t,Variable> vars_to_Vars)` This method computes a substitution from a Term (the current object).
    `protected static void` | `getSubsts(java.util.Map<java.lang.String,Term> varnames_to_Terms, java.util.Map<term_t,Variable> vars_to_Vars, Term[] args)` Just calls computeSubstitution for each Term in the array.
    `protected static Term` | `getTerm(java.util.Map<term_t,Variable> vars_to_Vars, term_t term)` create and return a org.jpl7.Term representation of the given Prolog term
    `protected static Term` | `getTerm(term_t term)`
    `boolean` | `hasFunctor(java.math.BigInteger name, int arity)` Tests whether this Term's functor has 'name' and 'arity'
    `boolean` | `hasFunctor(double name, int arity)` Tests whether this Term's functor has 'name' and 'arity'
    `boolean` | `hasFunctor(long name, int arity)` Tests whether this Term's functor has 'name' and 'arity'
    `boolean` | `hasFunctor(java.lang.String name, int arity)` Whether this Term's functor has 'name' and 'arity' (c.f.
    `static Term` | `intArrayArrayToList(int[][] a)` Converts an array of arrays of int to a corresponding JPL list of lists
    `static Term` | `intArrayToList(int[] a)` Converts an array of int to a corresponding JPL list
    `int` | `intValue()` returns the value (as an int) of an Integer or Float
    `boolean` | `isAtom()` whether this Term is an Atom (of any type)
    `protected boolean` | `isAtomOfNameType(java.lang.String name, java.lang.String type)` Tests whether this Term is an Atom with name and type.
    `boolean` | `isBig()` Tests whether this Integer's value is too big to represent as a long.
    `boolean` | `isBigInteger()` Tests whether this Term is an Integer whose value is too big to represent as a long
    `boolean` | `isCompound()` Tests whether this Term is a Compound.
    `boolean` | `isFloat()` Tests whether this Term is an org.jpl7.Float.
    `boolean` | `isInteger()` Tests whether this Term is an org.jpl7.Integer.
    `boolean` | `isJFalse()` Tests whether this Term is a 'jfalse' structure, i.e.
    `boolean` | `isJNull()` Tests whether this Term is a 'jnull' structure, i.e.
    `boolean` | `isJRef()` Tests whether this Term is a (non-null, non-String) JPL reference to a Java object, e.g.
    `boolean` | `isJTrue()` Tests whether this Term is a 'jtrue' structure, i.e.
    `boolean` | `isJVoid()` Tests whether this Term is a 'jvoid' structure, i.e.
    `boolean` | `isList()` whether the Term represents a proper list
    `static boolean` | `isList(Term term)` whether the Term represents a proper list
    `boolean` | `isListNil()` Tests whether this Term denotes an empty list within the current syntax ("traditional" or "modern").
    `boolean` | `isListPair()` Tests whether this Term is a list pair within the current syntax ("traditional" or "modern").
    `boolean` | `isVariable()` Tests whether this Term is a Variable.
    `java.lang.Object` | `jrefToObject()` Deprecated. Use `object()`
    `int` | `listLength()`
    `static int` | `listLength(Term term)`
    `Term[]` | `listToTermArray()` converts a proper list to an array of terms, else throws an exception
    `static Term[]` | `listToTermArray(Term t)` converts a proper list to an array of terms, else throws an exception
    `long` | `longValue()` The (long) value of a Float or Integer.
    `java.lang.String` | `name()` The name of an Atom, Compound or Variable.
    `java.lang.Object` | `object()` The Object which this org.jpl7.JRef refers to, iff this Term is a JRef or just JPL.JNULL.
    `static Term` | `objectToJRef(java.lang.Object object)` Deprecated. Use `JPL.newJRef(java.lang.Object)`
    `protected abstract void` | `put(java.util.Map<java.lang.String,term_t> varnames_to_vars, term_t term)` Cache the reference to the Prolog term_t here.
    `protected void` | `put(term_t term)`
    `protected Term` | `putParams(Term plist)`
    `Term` | `putParams(Term[] params)` This internal method is public because it needs to be callable via JNI, but it is not part of JPL's public API and should not be used by applications.
    `protected Term` | `putParams1(IntHolder next, Term[] ps)`
    `protected static Term[]` | `putParams2(Term[] ts, IntHolder next, Term[] ps)`
    `static void` | `putTerm(java.lang.Object obj, term_t termref)`
    `protected static term_t` | `putTerms(java.util.Map<java.lang.String,term_t> varnames_to_vars, Term[] args)` This static method converts an array of Terms to a *consecutive* sequence of term_t objects.
    `java.lang.Object` | `ref()` Deprecated. Use `JRef.object()`
    `void` | `setName(java.lang.String name)`
    `static Term` | `stringArrayToList(java.lang.String[] a)` Converts an array of String to a corresponding JPL list of atoms
    `static Term` | `termArrayToList(Term[] terms)` Converts an array of Terms to a JPL representation of a Prolog list of terms whose members correspond to the respective array elements.
    `static Term` | `textParamsToTerm(java.lang.String text, Term[] params)` Converts a Prolog source text to a corresponding JPL Term (in which each Variable has the appropriate name from the source text), replacing successive occurrences of ? in the text by the corresponding element of Term[] params.
    `static Term` | `textToTerm(java.lang.String text)` Converts a Prolog source text (as a String) to a corresponding JPL Term (in which each Variable has the appropriate name from the source text).
    `static java.lang.String` | `toString(Term[] args)` Converts a list of Terms to a String.
    `Term[]` | `toTermArray()` Deprecated. Use `listToTermArray()`
    `abstract int` | `type()` returns the type of this term, as one of org.jpl7.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
    `abstract java.lang.String` | `typeName()` returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" or "JRef"

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

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

- - ### Constructor Detail

    - #### Term

          protected Term()

      This default constructor enables subclasses to define their own default constructors

  - ### Method Detail

    - #### arg

          public Term arg(int i)

      returns the i-th (1+) argument of a Term; defined only for Compound
      Parameters:
        `i` - the index of argument to return
      Returns:
        the i-th argument of a (Compound) Term
      Throws:
        `JPLException` - if Term is not a Compound

    - #### args

          public Term[] args()

      The arguments of this Term.

      Note that a SWI Prolog 7.x compound term can have zero arguments.

      This method returns an empty Term[] from an Atom, Float, Integer or JRef, approximating the behaviour of SWI Prolog's =../2

      Returns:
        the arguments of a Compound
      Throws:
        `JPLException` - if the Term is a Variable

    - #### arity

          public int arity()

      the arity of a Compound, Atom, Integer or Float
      Returns:
        the arity of a Compound, Atom, Integer or Float
      Throws:
        `JPLException` - if the Term is a Variable

    - #### atomType

          public java.lang.String atomType()

      Returns:
        the type ("text", "string", "reserved_symbol", "jref" etc.) of an Atom
      Throws:
        `JPLException` - if the Term is not an Atom

    - #### name

          public java.lang.String name()

      The name of an Atom, Compound or Variable.
      Returns:
        the name of an Atom, Compound or Variable.
      Throws:
        `JPLException` - if this Term is not an Atom, Compound or Variable.

    - #### setName

          public void setName(java.lang.String name)

    - #### textToTerm

          public static Term textToTerm(java.lang.String text)

      Converts a Prolog source text (as a String) to a corresponding JPL Term (in which each Variable has the appropriate name from the source text).
      Parameters:
        `text` - A Prolog source text denoting a term
      Returns:
        Term a JPL Term equivalent to the given source text
      Throws:
        `PrologException` - containing error(syntax_error(_),_) if text is invalid as a term.

    - #### textParamsToTerm

          public static Term textParamsToTerm(java.lang.String text,
                                              Term[] params)

      Converts a Prolog source text to a corresponding JPL Term (in which each Variable has the appropriate name from the source text), replacing successive occurrences of ? in the text by the corresponding element of Term[] params. (New in JPL 3.0.4) Throws PrologException containing error(syntax_error(_),_) if text is invalid.
      Parameters:
        `text` - A Prolog source text denoting a term
        `params` - parameters to be injected in each ?
      Returns:
        Term a JPL Term equivalent to the given source text

    - #### intValue

          public int intValue()

      returns the value (as an int) of an Integer or Float
      Returns:
        the value (as an int) of an Integer or Float
      Throws:
        `JPLException` - if this Term is a Compound, Atom or Variable

    - #### longValue

          public long longValue()

      The (long) value of a Float or Integer.
      Returns:
        the (long) value of a Float or Integer.
      Throws:
        `JPLException` - if this Term is not a Float or Integer.

    - #### bigValue

          public java.math.BigInteger bigValue()

      the value (as a java.math.BigInteger) of an Integer, whether or not it is big
      Returns:
        the value (as a java.math.BigInteger) of an Integer, whether or not it is big
      Throws:
        `JPLException` - if the Term is not an Integer

    - #### doubleValue

          public double doubleValue()

      the value (as a double) of an Integer or Float
      Returns:
        the value (as a double) of an Integer or Float
      Throws:
        `JPLException` - if the Term is neither an Integer nor a Float

    - #### floatValue

          public float floatValue()

      the value (as a float) of an Integer or Float
      Returns:
        the value (as a float) of an Integer or Float
      Throws:
        `JPLException` - if the Term is neither an Integer nor a Float

    - #### getTerm

          protected static Term getTerm(java.util.Map<term_t,Variable> vars_to_Vars,
                                        term_t term)

      create and return a org.jpl7.Term representation of the given Prolog term
      Parameters:
        `vars_to_Vars` - A Map from Prolog variables to org.jpl7.Variable instances
        `term` - The Prolog term (in a term_t holder) to convert
      Returns:
        The converted Term subclass instance.

    - #### getTerm

          protected static Term getTerm(term_t term)

    - #### hasFunctor

          public boolean hasFunctor(java.lang.String name,
                                    int arity)

      Whether this Term's functor has 'name' and 'arity' (c.f. behaviour of SWI Prolog's functor/3)
      Parameters:
        `name` - a possible name for the functor of a term
        `arity` - an arity 0+
      Returns:
        whether this Term's functor has 'name' and 'arity'
      Throws:
        `JPLException` - if this Term is a Variable

    - #### hasFunctor

          public boolean hasFunctor(long name,
                                    int arity)

      Tests whether this Term's functor has 'name' and 'arity'

      For Float and Integer, mimics behaviour of SWI Prolog's functor/3

      Parameters:
        `name` - a possible name for the functor of a term
        `arity` - an arity 0+
      Returns:
        whether this Term's functor has 'name' and 'arity'
      Throws:
        `JPLException` - if this Term is a Variable

    - #### hasFunctor

          public boolean hasFunctor(java.math.BigInteger name,
                                    int arity)

      Tests whether this Term's functor has 'name' and 'arity'

      For Float and Integer, mimics behaviour of SWI Prolog's functor/3

      Parameters:
        `name` - a possible name for the functor of a term
        `arity` - an arity 0+
      Returns:
        whether this Term's functor has 'name' and 'arity'
      Throws:
        `JPLException` - if this Term is a Variable

    - #### hasFunctor

          public boolean hasFunctor(double name,
                                    int arity)

      Tests whether this Term's functor has 'name' and 'arity'

      For Float and Integer, mimics behaviour of SWI Prolog's functor/3

      Parameters:
        `name` - a possible name for the functor of a term
        `arity` - an arity 0+
      Returns:
        whether this Term's functor has 'name' and 'arity'
      Throws:
        `JPLException` - if this Term is a Variable

    - #### isAtom

          public final boolean isAtom()

      whether this Term is an Atom (of any type)
      Returns:
        whether this Term is an Atom (of any type)

    - #### isAtomOfNameType

          protected boolean isAtomOfNameType(java.lang.String name,
                                             java.lang.String type)

      Tests whether this Term is an Atom with name and type.
      Parameters:
        `name` - any String
        `type` - an Atom (blob) type, e.g. "text", "reserved_symbol", "string", "jref"
      Returns:
        whether this Term is an Atom with name and type

    - #### isBig

          public boolean isBig()

      Tests whether this Integer's value is too big to represent as a long.

      Use this in contexts where the Term is known to be an Integer.

      Returns:
        whether this Integer's value is too big to represent as a long
      Throws:
        `JPLException` - if Term is not an org.jpl7.Integer
      See Also:
        `isBigInteger()`

    - #### isBigInteger

          public boolean isBigInteger()

      Tests whether this Term is an Integer whose value is too big to represent as a long
      Returns:
        whether this Term is an Integer whose value is too big to represent as a long
      See Also:
        `isBig()`

    - #### isCompound

          public final boolean isCompound()

      Tests whether this Term is a Compound.
      Returns:
        whether this Term is a Compound.

    - #### isFloat

          public final boolean isFloat()

      Tests whether this Term is an org.jpl7.Float.
      Returns:
        whether this Term is an org.jpl7.Float.

    - #### isInteger

          public final boolean isInteger()

      Tests whether this Term is an org.jpl7.Integer.
      Returns:
        whether this Term is an org.jpl7.Integer.

    - #### isJFalse

          public boolean isJFalse()

      Tests whether this Term is a 'jfalse' structure, i.e. @(false).
      Returns:
        whether this Term is a 'jfalse' structure, i.e. @(false).

    - #### isJNull

          public boolean isJNull()

      Tests whether this Term is a 'jnull' structure, i.e. @(null).
      Returns:
        whether this Term is a 'jnull' structure, i.e. @(null).

    - #### isJRef

          public final boolean isJRef()

      Tests whether this Term is a (non-null, non-String) JPL reference to a Java object, e.g. <jref>(0x1234560)
      Returns:
        whether this Term is a (non-null, non-String) reference to a Java object, e.g. <jref>(0x1234560)
      See Also:
        `JRef.object()`

    - #### isJTrue

          public boolean isJTrue()

      Tests whether this Term is a 'jtrue' structure, i.e. @(true).
      Returns:
        whether this Term is a 'jtrue' structure, i.e. @(true).

    - #### isJVoid

          public boolean isJVoid()

      Tests whether this Term is a 'jvoid' structure, i.e. @(void).
      Returns:
        whether this Term is a 'jvoid' structure, i.e. @(void).

    - #### isVariable

          public final boolean isVariable()

      Tests whether this Term is a Variable.
      Returns:
        whether this Term is a Variable.

    - #### object

          public java.lang.Object object()

      The Object which this org.jpl7.JRef refers to, iff this Term is a JRef or just JPL.JNULL.
      Returns:
        the Object which this Term refers to, iff this Term is a JRef.
      Throws:
        `JPLException` - if this Term is not a JRef or not NULL term

    - #### objectToJRef

          @Deprecated
          public static final Term objectToJRef(java.lang.Object object)

      Deprecated. Use `JPL.newJRef(java.lang.Object)`
      Returns the JREF term for an object
      Parameters:
        `object` - object of interest
      Returns:
        a new JRef which references object, or @(null) if object == null.
      Throws:
        `JPLException` - if object is a String.

    - #### put

          protected void put(term_t term)

    - #### put

          protected abstract void put(java.util.Map<java.lang.String,term_t> varnames_to_vars,
                                      term_t term)

      Cache the reference to the Prolog term_t here.
      Parameters:
        `varnames_to_vars` - A Map from variable names to JPL Variables.
        `term` - A (previously created) term_t which is to be put with a Prolog term-type appropriate to the Term type (e.g., Atom, Variable, Compound, etc.) on which the method is invoked.)

    - #### putParams

          public Term putParams(Term[] params)

      This internal method is public because it needs to be callable via JNI, but it is not part of JPL's public API and should not be used by applications.
      Parameters:
        `params` - a list of terms to fill the ? placeholders in the Term object
      Returns:
        a new term representing the original term with all its placeholders ? replaced by the corresponding successive parameter
      Throws:
        `JPLException` - if there are more actual than formal parameters.

    - #### putParams

          protected Term putParams(Term plist)

    - #### putParams1

          protected Term putParams1(IntHolder next,
                                    Term[] ps)

    - #### putParams2

          protected static Term[] putParams2(Term[] ts,
                                             IntHolder next,
                                             Term[] ps)

    - #### putTerm

          public static void putTerm(java.lang.Object obj,
                                     term_t termref)

    - #### putTerms

          protected static term_t putTerms(java.util.Map<java.lang.String,term_t> varnames_to_vars,
                                           Term[] args)

      This static method converts an array of Terms to a *consecutive* sequence of term_t objects. Note that the first term_t object returned is a term_t class (structure); the succeeding term_t objects are consecutive references obtained by incrementing the *value* field of the term_t.
      Parameters:
        `varnames_to_vars` - Map from variable names to JPL Variables.
        `args` - An array of org.jpl7.Term references.
      Returns:
        consecutive term_t references (first of which is a structure)

    - #### ref

          @Deprecated
          public java.lang.Object ref()

      Deprecated. Use `JRef.object()`
      The (non-null, non-String) object which this org.jpl7.JRef references.
      Returns:
        the (non-null, non-String) object which this org.jpl7.JRef references.
      Throws:
        `JPLException` - if this Term is not a JRef

    - #### jrefToObject

          @Deprecated
          public java.lang.Object jrefToObject()

      Deprecated. Use `object()`
      Returns:
        the Object which this JRef references

    - #### getSubst

          protected void getSubst(java.util.Map<java.lang.String,Term> varnames_to_Terms,
                                  java.util.Map<term_t,Variable> vars_to_Vars)

      This method computes a substitution from a Term (the current object). The bindings Map varnames_to_Terms maps names of Variables to Terms. Thus, a substitution is as it is in mathematical logic, a sequence of the form \sigma = {t_0/x_0, ..., t_n/x_n}. Once the substitution is computed, the substitution should satisfy \sigma T = t where T is the Term from which the substitution is computed, and t is the term_t which results from the Prolog query.

      A second Map, vars_to_Vars, is required: this table holds the Variables that occur (thus far) in the unified term. The Variable instances in this table are guaranteed to be unique and are keyed on Strings which are Prolog internal representations of the variables.

      Parameters:
        `varnames_to_Terms` - table holding Term substitutions, keyed on names of Variables.
        `vars_to_Vars` - A Map holding the Variables that occur thus far in the term; keyed by internal (Prolog) string rep.

    - #### getSubsts

          protected static void getSubsts(java.util.Map<java.lang.String,Term> varnames_to_Terms,
                                          java.util.Map<term_t,Variable> vars_to_Vars,
                                          Term[] args)

      Just calls computeSubstitution for each Term in the array.
      Parameters:
        `varnames_to_Terms` - a Map from variable names to Terms (what each variable string is to be replaced by)
        `vars_to_Vars` - a Map from Prolog variables (which may be bounded in the engine) to JPL Variables (which are Java objects)
        `args` - an array of Terms to which the substitution is to be applied

    - #### toString

          public static java.lang.String toString(Term[] args)

      Converts a list of Terms to a String.
      Parameters:
        `args` - An array of Terms to convert
      Returns:
        String representation of a list of Terms

    - #### type

          public abstract int type()

      returns the type of this term, as one of org.jpl7.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
      Returns:
        the type of this term, as one of org.jpl7.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc

    - #### typeName

          public abstract java.lang.String typeName()

      returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" or "JRef"
      Returns:
        the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" or "JRef"

    - #### isListNil

          public boolean isListNil()

      Tests whether this Term denotes an empty list within the current syntax ("traditional" or "modern").
      Returns:
        whether this Term denotes an empty list within the current syntax ("traditional" or "modern").
      See Also:
        `JPL.getSyntax()`

    - #### isListPair

          public boolean isListPair()

      Tests whether this Term is a list pair within the current syntax ("traditional" or "modern"). Note that a list pair may not be a list itself and hence isList() will return false as the second argument many not be a list
      Returns:
        whether this Term is a list pair within the current syntax ("traditional" or "modern").

    - #### isList

          public final boolean isList()

      whether the Term represents a proper list
      Returns:
        whether the Term represents a proper list

    - #### isList

          public static final boolean isList(Term term)

      whether the Term represents a proper list
      Parameters:
        `term` - the term to check if it is a list
      Returns:
        whether the Term represents a proper list

    - #### listLength

          public static int listLength(Term term)

      Parameters:
        `term` - any Term
      Returns:
        the length of the proper list which the Term represents, else -1

    - #### listLength

          public int listLength()

      Returns:
        the length of the proper list which the Term represents, else -1

    - #### stringArrayToList

          public static Term stringArrayToList(java.lang.String[] a)

      Converts an array of String to a corresponding JPL list of atoms
      Parameters:
        `a` - An array of String objects
      Returns:
        Term a JPL list of atoms corresponding to the given String array

    - #### intArrayToList

          public static Term intArrayToList(int[] a)

      Converts an array of int to a corresponding JPL list
      Parameters:
        `a` - An array of int values
      Returns:
        Term a JPL list corresponding to the given int array

    - #### intArrayArrayToList

          public static Term intArrayArrayToList(int[][] a)

      Converts an array of arrays of int to a corresponding JPL list of lists
      Parameters:
        `a` - An array of arrays of int values
      Returns:
        Term a JPL list of lists corresponding to the given int array of arrays

    - #### termArrayToList

          public static Term termArrayToList(Term[] terms)

      Converts an array of Terms to a JPL representation of a Prolog list of terms whose members correspond to the respective array elements.
      Parameters:
        `terms` - An array of Term
      Returns:
        Term a list of the array elements

    - #### atomListToStringArray

          public static java.lang.String[] atomListToStringArray(Term t)

      Converts a term representing a list of atoms into an array of Strings, each element in the array being a String for the corresponding atom e.g., [a, b, 1
      Parameters:
        `t` - a term representing a list of atoms
      Returns:
        an array of Strings, each element, null if t is not a list of atoms

    - #### listToTermArray

          public static Term[] listToTermArray(Term t)

      converts a proper list to an array of terms, else throws an exception
      Returns:
        an array of terms whose successive elements are the corresponding members of the list (if it is a list)
      Throws:
        `JPLException` - if the term passed is not itself a Prolog list term

    - #### listToTermArray

          public final Term[] listToTermArray()

      converts a proper list to an array of terms, else throws an exception
      Returns:
        an array of terms whose successive elements are the corresponding members of the list (if it is a list)
      Throws:
        `JPLException` - if the term passed is not itself a Prolog list term

    - #### toTermArray

          @Deprecated
          public final Term[] toTermArray()

      Deprecated. Use `listToTermArray()`