aterm.pure
Class PureFactory

java.lang.Object
  |
  +--aterm.pure.PureFactory
All Implemented Interfaces:
ATermFactory

public class PureFactory
extends java.lang.Object
implements ATermFactory


Field Summary
 
Fields inherited from interface aterm.ATermFactory
START_OF_SHARED_TEXT_FILE
 
Constructor Summary
PureFactory()
           
PureFactory(int term_table_size, int afun_table_size)
           
 
Method Summary
static int abbrevSize(int abbrev)
           
 aterm.ATermList getEmpty()
           
 aterm.ATerm importTerm(aterm.ATerm term)
          Creates an ATerm by importing it from another ATermFactory.
 aterm.ATerm make(aterm.ATerm pattern, java.util.List args)
          Creates a new ATerm given a pattern and a list of arguments.
 aterm.ATerm make(java.lang.String trm)
          Equivalent of parse.
 aterm.ATerm make(java.lang.String pattern, java.util.List args)
          Creates a new ATerm given a string pattern and a list of arguments.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1)
          Creates a new ATerm given a pattern and a single argument.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1, java.lang.Object arg2)
          Creates a new ATerm given a pattern and a fixed number of arguments.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Creates a new ATerm given a pattern and a fixed number of arguments.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Creates a new ATerm given a pattern and a fixed number of arguments.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Creates a new ATerm given a pattern and a fixed number of arguments.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6)
          Creates a new ATerm given a pattern and a fixed number of arguments.
 aterm.ATerm make(java.lang.String pattern, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7)
          Creates a new ATerm given a pattern and a fixed number of arguments.
 aterm.AFun makeAFun(java.lang.String name, int arity, boolean isQuoted)
          Creates an AFun object
 aterm.ATermAppl makeAppl(aterm.AFun fun)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm[] args)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm[] args, aterm.ATermList annos)
           
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg1, aterm.ATerm arg2)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg1, aterm.ATerm arg2, aterm.ATerm arg3)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg1, aterm.ATerm arg2, aterm.ATerm arg3, aterm.ATerm arg4)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg1, aterm.ATerm arg2, aterm.ATerm arg3, aterm.ATerm arg4, aterm.ATerm arg5)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg1, aterm.ATerm arg2, aterm.ATerm arg3, aterm.ATerm arg4, aterm.ATerm arg5, aterm.ATerm arg6)
          Creates a function application.
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATerm arg1, aterm.ATerm arg2, aterm.ATerm arg3, aterm.ATerm arg4, aterm.ATerm arg5, aterm.ATerm arg6, aterm.ATerm arg7)
           
 aterm.ATermAppl makeAppl(aterm.AFun fun, aterm.ATermList args)
          Creates a function application.
 aterm.ATermBlob makeBlob(byte[] data)
          Creates an ATermBlob (Binary Large OBject).
 aterm.ATermBlob makeBlob(byte[] data, aterm.ATermList annos)
           
 aterm.ATermInt makeInt(int val)
          Creates a new ATermInt object
 aterm.ATermInt makeInt(int val, aterm.ATermList annos)
           
 aterm.ATermList makeList()
          Creates an empty ATermList object
 aterm.ATermList makeList(aterm.ATerm singleton)
          Creates a singleton ATermList object.
 aterm.ATermList makeList(aterm.ATerm first, aterm.ATermList next)
          Creates a head-tail style ATermList.
 aterm.ATermList makeList(aterm.ATerm first, aterm.ATermList next, aterm.ATermList annos)
           
 aterm.ATermPlaceholder makePlaceholder(aterm.ATerm type)
          Creates an ATermPlaceholder object.
 aterm.ATermPlaceholder makePlaceholder(aterm.ATerm type, aterm.ATermList annos)
           
 aterm.ATermReal makeReal(double val)
          Creates a new ATermReal object
 aterm.ATermReal makeReal(double val, aterm.ATermList annos)
           
 aterm.ATerm parse(java.lang.String trm)
          Creates a new ATerm by parsing a string.
 aterm.ATerm readFromBinaryFile(java.io.InputStream stream)
          Creates an ATerm from a binary stream.
 aterm.ATerm readFromFile(java.io.InputStream stream)
          Creates an ATerm from a stream.
 aterm.ATerm readFromFile(java.lang.String file)
          Creates an ATerm from a given filename.
 aterm.ATerm readFromSharedTextFile(java.io.InputStream stream)
          Creates an ATerm from a shared text stream.
 aterm.ATerm readFromTextFile(java.io.InputStream stream)
          Creates an ATerm from a text stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PureFactory

public PureFactory()

PureFactory

public PureFactory(int term_table_size,
                   int afun_table_size)
Method Detail

abbrevSize

public static int abbrevSize(int abbrev)

makeInt

public aterm.ATermInt makeInt(int val)
Description copied from interface: ATermFactory
Creates a new ATermInt object

Specified by:
makeInt in interface ATermFactory
Parameters:
val - the integer value to be stored.
Returns:
the constructed ATermInt object.

makeInt

public aterm.ATermInt makeInt(int val,
                              aterm.ATermList annos)

makeReal

public aterm.ATermReal makeReal(double val)
Description copied from interface: ATermFactory
Creates a new ATermReal object

Specified by:
makeReal in interface ATermFactory
Parameters:
val - the double value to be stored.
Returns:
the constructed ATermReal object.

makeReal

public aterm.ATermReal makeReal(double val,
                                aterm.ATermList annos)

makeList

public aterm.ATermList makeList()
Description copied from interface: ATermFactory
Creates an empty ATermList object

Specified by:
makeList in interface ATermFactory
Returns:
the (empty) ATermList.

makeList

public aterm.ATermList makeList(aterm.ATerm singleton)
Description copied from interface: ATermFactory
Creates a singleton ATermList object.

Specified by:
makeList in interface ATermFactory
Parameters:
singleton - the element to be placed in the list.
Returns:
the singleton ATermList object.

makeList

public aterm.ATermList makeList(aterm.ATerm first,
                                aterm.ATermList next)
Description copied from interface: ATermFactory
Creates a head-tail style ATermList.

Specified by:
makeList in interface ATermFactory
Parameters:
first - the head of the list.
next - the tail of the list.
Returns:
the constructed ATermList.

makeList

public aterm.ATermList makeList(aterm.ATerm first,
                                aterm.ATermList next,
                                aterm.ATermList annos)

makePlaceholder

public aterm.ATermPlaceholder makePlaceholder(aterm.ATerm type)
Description copied from interface: ATermFactory
Creates an ATermPlaceholder object.

Specified by:
makePlaceholder in interface ATermFactory
Parameters:
type - the type of the hole in the placeholder.
Returns:
the constructed ATermPlaceholder.

makePlaceholder

public aterm.ATermPlaceholder makePlaceholder(aterm.ATerm type,
                                              aterm.ATermList annos)

makeBlob

public aterm.ATermBlob makeBlob(byte[] data)
Description copied from interface: ATermFactory
Creates an ATermBlob (Binary Large OBject).

Specified by:
makeBlob in interface ATermFactory
Parameters:
data - the data to be stored in the blob.
Returns:
the constructed ATermBlob.

makeBlob

public aterm.ATermBlob makeBlob(byte[] data,
                                aterm.ATermList annos)

makeAFun

public aterm.AFun makeAFun(java.lang.String name,
                           int arity,
                           boolean isQuoted)
Description copied from interface: ATermFactory
Creates an AFun object

Specified by:
makeAFun in interface ATermFactory
Parameters:
name - the name of the function symbol.
arity - the arity of the function symbol.
isQuoted - whether the function symbol is quoted ("foo") or not (foo).
Returns:
the constructed AFun.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm[] args)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
args - an array containing the arguments.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm[] args,
                                aterm.ATermList annos)

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATermList args)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
args - an ATermList containing the arguments.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
arg - the argument of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg1,
                                aterm.ATerm arg2)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
arg1 - the first argument of the application.
arg2 - the second argument of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg1,
                                aterm.ATerm arg2,
                                aterm.ATerm arg3)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
arg1 - the first argument of the application.
arg2 - the second argument of the application.
arg3 - the third argument of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg1,
                                aterm.ATerm arg2,
                                aterm.ATerm arg3,
                                aterm.ATerm arg4)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
arg1 - the first argument of the application.
arg2 - the second argument of the application.
arg3 - the third argument of the application.
arg4 - the fourth argument of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg1,
                                aterm.ATerm arg2,
                                aterm.ATerm arg3,
                                aterm.ATerm arg4,
                                aterm.ATerm arg5)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
arg1 - the first argument of the application.
arg2 - the second argument of the application.
arg3 - the third argument of the application.
arg4 - the fourth argument of the application.
arg5 - the fifth argument of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg1,
                                aterm.ATerm arg2,
                                aterm.ATerm arg3,
                                aterm.ATerm arg4,
                                aterm.ATerm arg5,
                                aterm.ATerm arg6)
Description copied from interface: ATermFactory
Creates a function application.

Specified by:
makeAppl in interface ATermFactory
Parameters:
fun - the function symbol of the application.
arg1 - the first argument of the application.
arg2 - the second argument of the application.
arg3 - the third argument of the application.
arg4 - the fourth argument of the application.
arg5 - the fifth argument of the application.
arg6 - the sixth argument of the application.
Returns:
the constructed function application.

makeAppl

public aterm.ATermAppl makeAppl(aterm.AFun fun,
                                aterm.ATerm arg1,
                                aterm.ATerm arg2,
                                aterm.ATerm arg3,
                                aterm.ATerm arg4,
                                aterm.ATerm arg5,
                                aterm.ATerm arg6,
                                aterm.ATerm arg7)

getEmpty

public aterm.ATermList getEmpty()

parse

public aterm.ATerm parse(java.lang.String trm)
Description copied from interface: ATermFactory
Creates a new ATerm by parsing a string.

Specified by:
parse in interface ATermFactory
Parameters:
trm - the string representation of the term
Returns:
the parsed term.
See Also:
ATermFactory.make(String)

make

public aterm.ATerm make(java.lang.String trm)
Description copied from interface: ATermFactory
Equivalent of parse.

Specified by:
make in interface ATermFactory
Parameters:
trm - the string representation of the term
Returns:
the parsed term.
See Also:
ATermFactory.parse(String)

make

public aterm.ATerm make(java.lang.String pattern,
                        java.util.List args)
Description copied from interface: ATermFactory
Creates a new ATerm given a string pattern and a list of arguments. First the string pattern is parsed into an ATerm. Then the holes in the pattern are filled with arguments taken from the supplied list of arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the string pattern containing a placeholder for each argument.
args - the list of arguments to be filled into the placeholders.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a single argument. This convenience method creates an ATerm from a pattern and one argument.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the argument.
arg1 - the argument to be filled into the hole.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1,
                        java.lang.Object arg2)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a fixed number of arguments. This convenience method creates an ATerm from a pattern and two arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the arguments.
arg1 - the argument to be filled into the first hole.
arg2 - the argument to be filled into the second hole.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1,
                        java.lang.Object arg2,
                        java.lang.Object arg3)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a fixed number of arguments. This convenience method creates an ATerm from a pattern and three arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the arguments.
arg1 - the argument to be filled into the first hole.
arg2 - the argument to be filled into the second hole.
arg3 - the argument to be filled into the third hole.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1,
                        java.lang.Object arg2,
                        java.lang.Object arg3,
                        java.lang.Object arg4)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a fixed number of arguments. This convenience method creates an ATerm from a pattern and four arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the arguments.
arg1 - the argument to be filled into the first hole.
arg2 - the argument to be filled into the second hole.
arg3 - the argument to be filled into the third hole.
arg4 - the argument to be filled into the fourth hole.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1,
                        java.lang.Object arg2,
                        java.lang.Object arg3,
                        java.lang.Object arg4,
                        java.lang.Object arg5)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a fixed number of arguments. This convenience method creates an ATerm from a pattern and five arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the arguments.
arg1 - the argument to be filled into the first hole.
arg2 - the argument to be filled into the second hole.
arg3 - the argument to be filled into the third hole.
arg4 - the argument to be filled into the fourth hole.
arg5 - the argument to be filled into the fifth hole.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1,
                        java.lang.Object arg2,
                        java.lang.Object arg3,
                        java.lang.Object arg4,
                        java.lang.Object arg5,
                        java.lang.Object arg6)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a fixed number of arguments. This convenience method creates an ATerm from a pattern and six arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the arguments.
arg1 - the argument to be filled into the first hole.
arg2 - the argument to be filled into the second hole.
arg3 - the argument to be filled into the third hole.
arg4 - the argument to be filled into the fourth hole.
arg5 - the argument to be filled into the fifth hole.
arg6 - the argument to be filled into the sixth hole.
Returns:
the constructed term.

make

public aterm.ATerm make(java.lang.String pattern,
                        java.lang.Object arg1,
                        java.lang.Object arg2,
                        java.lang.Object arg3,
                        java.lang.Object arg4,
                        java.lang.Object arg5,
                        java.lang.Object arg6,
                        java.lang.Object arg7)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a fixed number of arguments. This convenience method creates an ATerm from a pattern and seven arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for the arguments.
arg1 - the argument to be filled into the first hole.
arg2 - the argument to be filled into the second hole.
arg3 - the argument to be filled into the third hole.
arg4 - the argument to be filled into the fourth hole.
arg5 - the argument to be filled into the fifth hole.
arg6 - the argument to be filled into the sixth hole.
arg7 - the argument to be filled into the seventh hole.
Returns:
the constructed term.

make

public aterm.ATerm make(aterm.ATerm pattern,
                        java.util.List args)
Description copied from interface: ATermFactory
Creates a new ATerm given a pattern and a list of arguments. The holes in the pattern are filled with arguments taken from the supplied list of arguments.

Specified by:
make in interface ATermFactory
Parameters:
pattern - the pattern containing a placeholder for each argument.
args - the list of arguments to be filled into the placeholders.
Returns:
the constructed term.

readFromTextFile

public aterm.ATerm readFromTextFile(java.io.InputStream stream)
                             throws java.io.IOException
Description copied from interface: ATermFactory
Creates an ATerm from a text stream.

Specified by:
readFromTextFile in interface ATermFactory
Parameters:
stream - the inputstream to read the ATerm from.
Returns:
the parsed ATerm.
java.io.IOException

readFromSharedTextFile

public aterm.ATerm readFromSharedTextFile(java.io.InputStream stream)
                                   throws java.io.IOException
Description copied from interface: ATermFactory
Creates an ATerm from a shared text stream.

Specified by:
readFromSharedTextFile in interface ATermFactory
Parameters:
stream - the inputstream to read the ATerm from.
Returns:
the parsed ATerm.
java.io.IOException

readFromBinaryFile

public aterm.ATerm readFromBinaryFile(java.io.InputStream stream)
Description copied from interface: ATermFactory
Creates an ATerm from a binary stream.

Specified by:
readFromBinaryFile in interface ATermFactory
Parameters:
stream - the inputstream to read the ATerm from.
Returns:
the parsed ATerm.

readFromFile

public aterm.ATerm readFromFile(java.io.InputStream stream)
                         throws java.io.IOException
Description copied from interface: ATermFactory
Creates an ATerm from a stream. This function determines the type of stream (text, shared, binary) and parses the ATerm accordingly.

Specified by:
readFromFile in interface ATermFactory
Parameters:
stream - the inputstream to read the ATerm from.
Returns:
the parsed ATerm.
java.io.IOException

readFromFile

public aterm.ATerm readFromFile(java.lang.String file)
                         throws java.io.IOException
Description copied from interface: ATermFactory
Creates an ATerm from a given filename.

Specified by:
readFromFile in interface ATermFactory
Parameters:
file - the filename to read the ATerm from.
Returns:
the parsed ATerm.
java.io.IOException

importTerm

public aterm.ATerm importTerm(aterm.ATerm term)
Description copied from interface: ATermFactory
Creates an ATerm by importing it from another ATermFactory.

Specified by:
importTerm in interface ATermFactory
Parameters:
term - the term (possibly from another ATermFactory) to rebuild in this factory.
Returns:
the imported ATerm.