LSAPI Reference

There are two primary interfaces to the LSAPI:

Main entry points to set up Prolog environment (LogicServer Class)

These methods provide the basic API services. They are used to initialize and close down the Prolog environment.

  • AddLSX
  • AddPred
  • Close
  • Init
  • Init2
  • InitLSX
  • InitPreds *
  • Load
  • LoadFromMemory (URL)
  • Main
  • Reset
  • Calling Prolog from the host language (LogicServer Class)

    These are the methods that actually call predicate in a Prolog module. The query term can be represented as a string or a Prolog term. The methods return the term representing the result, or the value 0 if the query fails.

  • Call
  • CallStr
  • ClearCall
  • Exec
  • ExecStr
  • Redo
  • Logicbase asserting and retracting (LogicServer Class)

    These methods make it easy to assert and retract dynamic clauses to and from Prolog's logicbase.

  • Asserta
  • AssertaStr
  • Assertz
  • AssertzStr
  • Retract
  • RetractStr
  • String/Term conversion functions (LogicServer Class)

    These methods convert strings to terms and terms to strings. The 'Q' version create quoted strings when necessary for atoms and strings that require delimiter symbols. They are necessary for those cases when you want to use the resulting string in another query. TermToStr is especially useful during development to display the results of a Prolog query.

  • StrTermLen
  • StrToTerm
  • TermToStr
  • TermToStrQ
  • Making Prolog types (LogicServer Class)

    These methods create Prolog types from the host environments types.

  • MakeAddr *
  • MakeAtom
  • MakeFloat
  • MakeInt
  • MakeStr
  • Getting values from Prolog terms (LogicServer Class)

    These methods get host environment types from Prolog terms.

  • GetFloatTerm
  • GetIntTerm
  • GetStrTerm
  • GetTerm *
  • GetTermType
  • Structure manipulation functions (LogicServer Class)

    These methods let you create and take apart terms that represent structures. This is especially useful for retrieving arguments in a query. For example, for the query 'sibling(mary, X)' GetStrArg can be used to retrieve the second argument of the strucutre.

  • GetArity
  • GetArg
  • GetArgType
  • GetFA *
  • GetFloatArg
  • GetFunctor
  • GetIntArg
  • GetStrArg
  • MakeFA
  • StrArgLen
  • Unify *
  • UnifyArg *
  • UnifyAtomArg
  • UnifyFloatArg
  • UnifyIntArg
  • UnifyStrArg
  • List manipulation functions (LogicServer Class)

    These methods let you create Prolog lists, add items to lists and retrieve items from lists. The Get__Head family of functions can be used in loops to get all the items in a list (in conjunction with GetTail).

  • GetFloatHead
  • GetIntHead
  • GetHead
  • GetStrHead
  • GetTail
  • MakeList
  • PopList *
  • PushList
  • Parameter manipulating functions for building extended predicates (LogicServer Class)

    These methods let you get and set (unify) the parameters that are passed with a Prolog extended predicate. The term parameter is used to distinguish them from functor arguments, although in pure Prolog terminology the parameters are simply the arguments of the functor of the extended predicate. For example, if you implemented an extended predicate called get_url/1, these predicates would let you unify a URL with the first parameter of that predicate.

  • GetFloatParm
  • GetIntParm
  • GetParm
  • GetStrParm
  • GetParmType
  • StrParmLen
  • UnifyAtomParm
  • UnifyFloatParm
  • UnifyIntParm
  • UnifyParm
  • UnifyStrParm
  • Stream I/O functions (LogicServer Class)

    These methods let you redirect the input and output streams.

  • GetStream *
  • SetInput *
  • SetIOArg *
  • SetOutput *
  • SetStream *
  • Miscellaneous functions (LogicServer Class)

  • GetVersion
  • SetCommandArgs *
  • Error handling (LSException Class)

    These methods are all implemented as part of the LSException class, and let you get details about the exception.

  • ErrRaise *
  • GetCallStack
  • GetMsg
  • GetMessage *
  • GetReadBuffer
  • GetReadFileName
  • GetReadLineno
  • GetRC
  • GetType
  • * Not available in all implementations

    LSAPI Data Types

    Return Values

    API functions return a variety of types. Many return the requested value: string, integer, float, etc. Some that initiate Prolog execution or unification return TF, a Prolog true/false, or a term with a 0 value signifying failure. Implementations that support exceptions, indicate errors by throwing an exception. Other implementations return RC, an error checkable function return.

    TF

    if an integer, can be TRUE (1), FALSE (0) or some other number which indicates a Prolog error; otherwise is the implementation-specific boolean values 'true' or 'false' (boolean in Java/.NET)

    RC

    can be OK (0), or some other number which indicates a Prolog error

    Prolog Term Types

    Many API functions require you to specify the type of the Prolog term, pTYPE. pTYPE is an enumerated constant with these values.

    pATOM an atom
    pINT an integer
    pSTR a string (delimited by ``)
    pFLOAT a floating point number
    pSTRUCT a structure
    pLIST a list
    pTERM a term
    pADDR the address of a Prolog value
    pVAR a Prolog variable
    pWSTR a Unicode string
    pWATOM a Unicode atom
    pREAL an infinite precision real number

    Environment Data Types

    Other API functions require you to specify the type of the host language variable, cTYPE. cTYPE is an enumerated constant with these values.

    cAATOM an atom (used to indicate a host string will become an atom) (see cATOM below)
    cASTR an ANSI character string (see cSTR below)
    cINT an integer
    cLONG a long
    cSHORT a short
    cFLOAT a single precision floating point number
    cDOUBLE a double precision floating point number
    cADDR the address of a value
    cTERM a term
    cWSTR a Unicode string
    cWATOM a Unicode atom
    cSTR a cover type mapped to cASTR or cWSTR depending on whether _UNICODE is specified or not
    cATOM a cover type mapped to cAATOM or cWATOM depending on whether _UNICODE is specified or not
    cMOD Special type, indicating the first argument of a :/2 structure, often used in module:goal pattern. Result is stored as cTERM
    cGOAL Special type, indicating the second argument of a :/2 structure, often used in module:goal pattern. Result is stored as cTERM

    Prolog Exeception Types

    The exectipn types, ExType, are:

    Prolog Stream Values

    A few API functions manipulate Prolog I/O streams. They use the enumerated constant STREAM to identify the streams. Values of STREAM are

    CUR_IN
    CUR_OUT
    CUR_ERR
    USER_IN
    USER_OUT
    USER_ERR

    LSAPI Function/Method Parameter Types

    Other defined types are:

    ARITY

    a Prolog arity (uintCH)

    BYTEptr

    a pointer to a byte (usually 32 bits)

    CELL

    a Prolog cell

    double

    a floating point number (implementation specific, usually a double)

    ENGid

    ID value for a Logic Server engine

    ExtPred

    a function pointer for an extended predicate

    int

    an integer number (implementation specific, usually an int)

    intC

    an integer the size of a Prolog cell (usually 32 bits)

    intCH

    an integer half the size of a Prolog cell (usually 16 bits)

    STRING

    a pointer to a string Unicode or ASCII depending upon the interface (C++: wstring or string. Java: String. .NET: String*)

    TERM

    a Prolog term (C++/Delphi: pointer to a CELL. Java/.NET: long)

    TERMptr

    a pointer to TERM

    uintC

    an unsigned intC

    uintCH

    an unsigned intCH

    VOIDptr

    a pointer to anything or an integer that is the same size as a pointer (usually 32 bits)

    See logicserver.h or each implementation's source or include files for the exact implementations of all data types.

    LSAPI Function/Method Descriptions

    AddLSX

    Description:

    void AddLSX(STRING lsxname, VOIDptr vp);
    RC lsAddLSX(ENGid cureng, STRING lsxname, VOIDptr vp);

    cureng
    Current engine identifier
    lsxname
    Name of the LSX file to load
    vp
    Pointer or a long, can be used to identify calling application.

    Remarks:

    Causes the Logic Server to load the specified LSX file. Like other API functions that initialize extended predicates, AddLSX() must come after a call to lsInit() and before a call to lsLoad().

    LSXs can also be loaded dynamically from Prolog with the loadlsx predicate.

    See loadlsx, Extended Predicate Libraries (LSXs) and Writing Extended Predicates

    Return Value:

    OK if everything worked

    Example:

    AddPred

    Description:

    void AddPred(STRING name, ARITY arity, PrologPredicate fptr); (.NET)
    void AddPred(STRING PredName, ARITY Arity, STRING Class, STRING Method, Object Obj); (Java)
    void AddPred(STRING functor, ARITY arity, ExtPred fptr, VOIDptr vp);
    RC lsAddPred(ENGid cureng, STRING functor, ARITY arity, ExtPred fptr, VOIDptr vp)

    cureng
    Current engine identifier
    functor
    Functor of the extended predicate
    arity
    Arity of the extended predicate
    fptr
    Function pointer to host language implementation
    vp
    Pointer to anything to be passed to the extended predicate

    Remarks:

    Adds the predicate functor/arity to the extended predicate table, mapping it to the function pointed to by fptr or designated by named class and method in the specified object (for Java). Like InitPreds(), AddPred() must be called between the calls to Init() and Load().

    The VOIDptr argument is used in the callback. This argument is passed as the first argument to the extended predicate. This feature allows you to implement call backs to member functions of class. The extended predicate becomes a dispatch function, that uses the argument as a pointer to an object that is used to implement the extended predicate. See the C++ PetsCB and Rubik's cube samples for an example of this technique.

    NOTE that when InitPreds is called, this fourth argument is automatically generated to be the engine ID, so call back functions get the engine ID passed as a parameter.

    See Extended Predicate Libraries (LSXs) and Writing Extended Predicates

    Return Value:

    Returns OK if it worked.

    Example:

    Asserta

    Description:

    void Asserta(TERM term);
    RC lsAsserta(ENGid cureng, TERM term);

    cureng
    Current engine identifier
    term
    Term to be asserted

    Remarks:

    Asserts the term to the logicbase as the first clause under the key which is the term's functor. Same as Prolog asserta/1 and assert/1.

    See Asserting and Retracting to and from the logicbase

    Return Value:

    Returns OK if it worked, NOTOK if some indeterminate error happened, and an atom (small positive integer) if the term redefined a protected predicate.

    AssertaStr

    Description:

    void AssertaStr(STRING str);
    RC lsAssertaStr(ENGid cureng, STRING str);

    cureng
    Current engine identifier
    str
    String representation of term to be asserted

    Remarks:

    A convenient form of Asserta() that uses a string instead of a term. Asserts the term to the logicbase as the first clause under the key which is the term's functor. Same as Prolog asserta/1 and assert/1.

    See Asserting and Retracting to and from the Prolog Logicbase

    Return Value:

    Returns OK if it worked, NOTOK if some indeterminate error happened, and an atom (small positive integer) if the term redefined a protected predicate.

    Example:

    Assertz

    Description:

    void Assertz(TERM term);
    RC lsAssertz(ENGid cureng, TERM term);

    cureng
    Current engine identifier
    term
    Term to be asserted

    Remarks:

    Asserts the term to the logicbase as the last clause under the key which is the term's functor. Same as Prolog assertz/1.

    See Asserting and Retracting to and from the Prolog Logicbase

    Return Value:

    Returns OK if it worked, NOTOK if some indeterminate error happened, and an atom (small positive integer) if the term redefined a protected predicate.

    Example:

    AssertzStr

    Description:

    void AssertzStr(STRING str);
    RC lsAssertzStr(ENGid cureng, STRING str);

    cureng
    Current engine identifier
    str
    String representation of term to be asserted

    Remarks:

    A convenient form of Assertz() that uses a string instead of a term. Asserts the term to the logicbase as the last clause under the key which is the term's functor. Same as Prolog assertz/1.

    See Asserting and Retracting to and from the Prolog Logicbase

    Return Value:

    Returns OK if it worked, NOTOK if some indeterminate error happened, and an atom (small positive integer) if the term redefined a protected predicate.

    Example:

    Call

    Description:

    TERM Call(TERM term);
    TF lsCall(ENGid cureng, TERMptr termp);

    cureng
    Current engine identifier
    term
    Term to be called
    termp
    Pointer to term to be called

    Remarks:

    Once a term has been created it can be passed to the Amzi! interpreter with Call(). This is equivalent to the Prolog statement call(X) where X is a Prolog term. Call() is intended for use with Redo() to backtrack through multiple solutions. If backtracking won't be used, then use Exec() instead to avoid unnecessary growth of the Prolog execution control stack.

    See Calling Terms

    Return Value:

    Returns the term, or 0 on failure.
    Returns TRUE/FALSE

    Example:

    CallStr

    Description:

    TERM CallStr(STRING str);
    TF lsCallStr(ENGid cureng, TERMptr termp, STRING str);

    cureng
    Current engine identifier
    termp
    Returns the term corresponding to string
    str
    The string representation of a term to call

    Remarks:

    CallStr() is a more convenient form of Call() that lets you use the string representation of a Prolog term or query. It is intended for use with Redo() to backtrack through multiple solutions. If backtracking won't be used, then use ExecStr() instead to avoid unnecessary growth of the Prolog execution control stack.

    See String Passing Interface

    Return Value:

    Returns the term, or 0 on failure.
    Returns TRUE/FALSE

    Example:

    ClearCall

    Description:

    void ClearCall();
    RC lsClearCall(ENGid cureng)

    cureng
    Current engine indentifier

    Remarks:

    A call to Call() or CallStr() causes the Prolog engine to build a backtracking choice point on the Prolog control stack. Successive calls to lsRedo() will cause the choice point to be removed when there are no more choices.

    If you do not exhaust all the choices with Redo() calls, then a call to ClearCall() can be made to remove the choice point from the stack. It is not in general necessary, but is good form and might be required if the Call() is in a tight loop, thus using up the control stack.

    Call() and CallStr() should not be used when the call is intended to be executed only once. For those situations Exec() and ExecStr() should be used, which do not add a choice point to the Prolog control stack.

    See Scope of Logic Server Terms

    Return Value:

    OK

    Close

    Description:

    void Close();
    RC lsClose(ENGid cureng);

    cureng
    Current engine identifier

    Remarks:

    Closes down the Prolog environment, closing Prolog streams and freeing all memory allocated by Prolog.

    See Main Entry Points

    Return Value:

    OK

    Example:

    ErrRaise *

    Description:

    void ErrRaise(STRING msg);
    RC lsErrRaise(ENGid cureng, STRING msg)

    cureng
    Current engine identifier
    msg
    The string to use in the error message

    Remarks:

    Causes an Exec type Prolog error to be raised with the specified error message.

    See Error Handling

    Exec

    Description:

    TERM Exec(TERM term);
    TF lsExec(ENGid cureng, TERMptr termp);

    cureng
    Current engine identifier
    term
    Term to execute
    termp
    Pointer to term to execute

    Remarks:

    Exec() and ExecStr() are similar to Call() and CallStr(). The only difference is the Exec functions are intended to be called only once and not backtracked into. That is, you cannot call Redo() after Exec(), but you can after Call().

    The advantage of Exec() calls over Call() calls is they do not add anything to the Prolog execution stack, so they can be called with no overhead. The disadvantage, of course, is you can't backtrack through them.

    See Calling Terms

    Return Value:

    Returns the term, or 0 on failure.
    Returns TRUE/FALSE

    ExecStr

    Description:

    TERM ExecStr(STRING str);
    TF ExecStr(TERMptr termp, STRING str);
    TF lsExecStr(ENGid cureng, TERMptr termp, STRING str);

    cureng
    Current engine identifier
    termp
    Returns the term corresponding to string
    str
    The string representation of a term to call

    Remarks:

    ExecStr() is a more convenient form of Exec() that lets you use the string representation of a Prolog term or query.

    See String Passing Interface

    Return Value:

    Returns the term, or 0 on failure.
    Returns TRUE/FALSE

    Example:

    GetArg

    Description:

    TERM GetArg(TERM term, int iarg);
    RC lsGetArg(ENGid cureng, TERM term, int iarg, cTYPE ctype, VOIDptr valp);

    cureng
    Current engine identifier
    term
    The term whose argument is being retrieved
    iarg
    The argument number, starting at 1
    ctype
    The type of variable being set
    valp
    Pointer to where to put the value

    Remarks:

    Used to extract arguments from complex structures.

    If GetArg() is used with the :/2 operator, it assumes it is a module specification, and uses that operator's second argument instead. See example below. In other words, it does the right thing when a module qualifier is used in an lsExec or Call(). If you really want to get the arguments of a :/2 structure, use the special ctypes cMOD and/or cGOAL to get the first and second arguments, respectively, as cTERMs.

    Visual Basic Note: When retrieving strings from VB, you must specify 'ByVal' for the VOIDptr val argument.

    See Mapping Prolog Arguments to Host Variables

    Return Value:

    Returns the term, or 0 on failure.
    OK if it worked, NOTOK if it didn't.

    Example:

    Example:

    GetArgType

    Description:

    pTYPE GetArgType(TERM term, int iarg);
    pTYPE lsGetArgType(ENGid cureng, TERM term, int iarg);

    cureng
    Current engine identifier
    term
    Term to examine
    iarg
    Which argument of the term to test

    Remarks:

    Gets the type of the iargth argument of term, assuming term is a structure.

    If lsGetArgType is used with the :/2 operator, it assumes it is a module specification, and uses that operator's second argument instead. See discussion in GetArg().

    See Mapping Prolog Arguments to Host Variables

    Return Value:

    pTYPE, see the Data Types section for possible values.

    GetArity

    Description:

    int GetArity(TERM term);

    term
    Term representing a structure

    Remarks:

    Returns the arity of a term. See GetFunctor() to get the functor.

    See Manipulating Structures

    Return Value:

    The arity

    GetExceptCallStack
    (LSException) GetCallStack

    Description:

    STRING GetCallStack(int len);
    RC lsGetExceptCallStack(ENGid cureng, STRING str, int len)

    cureng
    Current engine identifier
    str
    String buffer big enough to hold the call stack
    len
    Length of str

    Remarks:

    Gets the call stack when the current exception occurred.

    See Error Handling

    Return Value:

    The string representing the call stack
    OK

    Example:

    GetExceptMsg
    (LSException) GetMsg
    (LSException) GetMessage

    Description:

    STRING GetMsg(int len);
    STRING GetMessage(int len);
    RC lsGetExceptMsg(ENGid cureng, STRING str, int len);

    cureng
    Current engine identifier
    str
    String buffer to hold error message
    len
    Length of str

    Remarks:

    Gets the message for the current error.

    See Error Handling

    Return Value:

    The message string
    OK

    Example:

    Example:

    rc = lsLoad(CurEng, xplname);
    if (rc != 0)
    {
       lsGetExceptMsg(CurEng, errmsg, 1024);
       printf("Fatal Error #%d loading Amzi! Logic Server .xpl file:\n%s", rc, errmsg);
    }
    

    GetExceptReadBuffer
    (LSException) GetReadBuffer

    Description:

    STRING GetReadBuffer(int len);
    RC lsGetExceptReadBuffer(ENGid cureng, STRING str, int len)

    cureng
    Current engine identifier
    str
    String buffer big enough to hold the current read buffer
    len
    Length of str

    Remarks:

    Gets the current read buffer which includes the words "<-Near Here->" to indicate the location of the read error, or at least where the Prolog reader realized it was in trouble.

    See Error Handling

    Return Value:

    The read buffer.
    OK

    Example:

    GetExceptReadFileName
    (LSException) GetReadFileName

    Description:

    STRING GetReadFileName(int len);
    RC lsGetExceptReadBuffer(ENGid cureng, STRING str, int len)

    cureng
    Current engine identifier
    str
    String buffer big enough to hold a file name and path
    len
    Length of str

    Remarks:

    Gets the name of the file, if any, that was open when a read error occurred. The name is an empty string if the read error occurred during string I/O or console I/O.

    See Error Handling

    Return Value:

    The name of the file that caused the read error.
    OK

    Example:

    GetExceptReadLineno
    (LSException) GetReadLineno

    Description:

    int GetReadLineno();
    int CLSException::GetReadLineno();
    int lsGetExceptReadLineno(ENGid cureng)

    cureng
    Current engine identifier

    Remarks:

    If the read error occurred during file I/O, this function returns a line number in the file close to where the error occurred.

    See Error Handling

    Return Value:

    The line number where the read error occurred.
    OK

    Example:

    GetExceptType
    (LSException) GetType

    Description:

    ExType GetType();
    ExType CLSException::GetType();
    ExType lsGetExceptType(ENGid cureng)

    cureng
    Current engine identifier

    Remarks:

    Returns the type of the current exception. See the section on Data Types for the values of ExType.

    See Error Handling

    Return Value:

    The exception type

    Example:

    GetExceptRC
    (LSException) GetRC

    Description:

    RC GetRC();
    RC CLSException::GetRC();
    RC lsGetExceptRC(ENGid cureng)

    cureng
    Current engine identifier

    Remarks:

    Returns the return code of the current exception.

    See Error Handling

    Return Value:

    The return code

    Example:

    GetFA *

    Description:

    void GetFA(TERM term, STRING functor, ARITYptr, arityp);
    RC lsGetFA(ENGid cureng, TERM term, STRING functor, ARITYptr arityp);

    cureng
    Current engine identifier
    term
    Term to be dissected
    functor
    String which will contain the functor
    arityp
    Pointer to an integer of type ARITY that will have the arity

    Remarks:

    This function lets you determine the functor and arity of a term. If the term is an atom, then the arity will be 0. If the term is a list then the functor will be "." and the arity 2.

    See Manipulating Structures

    Return Value:

    Returns OK for the three types of terms described above, returns NOTOK if the term is not a legal atom, structure or list.

    Example:

    GetFloatArg

    Description:

    double GetFloatArg(TERM term, int iarg);

    term
    The term whose argument is being retrieved
    iarg
    The argument number, starting at 1

    Remarks:

    Gets the double value of the iarg'th argument of the term.

    See Mapping Prolog Arguments to Host Variables

    Return Value:

    Returns the double argument.

    GetFloatHead

    Description:

    double GetFloatHead(TERM term);

    term
    Term representing a list

    Remarks:

    Returns the floating point value of the head of the list represented by term.

    See Manipulating Lists

    Return Value:

    The floating point value.

    GetFloatParm

    Description:

    double GetFloatParm(int iparm);

    iparm
    Number of the parameter to get, starting at 1

    Remarks:

    When implementing extended predicates, gets the floating point value of the iparm'th paramete.

    See Writing Extended Predicates

    Return Value:

    The floating point parameter.

    GetFloatTerm

    Description:

    double GetFloatTerm(TERM term);

    term
    The term to retrieve the value of

    Remarks:

    Returns the floating point value of the term.

    See Handling Varying Prolog Types

    Return Value:

    The double value.

    GetFunctor

    Description:

    STRING GetFunctor(TERM term);

    term
    Term representing a structure

    Remarks:

    Returns the functor of a term. See GetArity() to get the arity.

    See Manipulating Structures

    Return Value:

    The functor

    Example:

    GetHead

    Description:

    TERM GetHead(TERM term);
    RC lsGetHead(ENGid cureng, TERM term, cTYPE ctype, VOIDptr valp)

    cureng
    Current engine identifier
    term
    Term representing a list
    ctype
    Type of variable to be filled
    valp
    Address of the variable

    Remarks:

    The term representing the head of the list is returned or stored in valp. See the Data Types section for legal values of cTYPE.

    See Manipulating Lists

    Return Value:

    A term representing the head of the list, or 0 if failure.
    OK if everything worked, NOTOK if it failed. Note that it will fail if term does not represent a list or if term represents the empty list.

    Example:

    GetIntArg

    Description:

    int GetIntArg(TERM term, int iarg);

    term
    The term whose argument is being retrieved
    iarg
    The argument number, starting at 1

    Remarks:

    Gets the integer value of the iarg'th argument of the term.

    See Mapping Prolog Arguments to Host Variables

    Return Value:

    Returns the integer argument.

    Example:

    GetIntHead

    Description:

    int GetIntHead(TERM term);

    term
    Term representing a list

    Remarks:

    Returns the integer value of the head of the list represented by term.

    See Manipulating Lists

    Return Value:

    The integer value.

    GetIntParm

    Description:

    int GetIntParm(int iparm);

    iparm
    Number of the parameter to get, starting with 1

    Remarks:

    When implementing extended predicates,gets the integer value of the iparmth parameter.

    See Writing Extended Predicates

    Return Value:

    The integer parameter.

    GetIntTerm

    Description:

    int GetIntTerm(TERM term);

    term
    The term to retrieve the value of

    Remarks:

    Returns the integer value of the term.

    See Handling Varying Prolog Types

    Return Value:

    The integer value.

    GetParm

    Description:

    TERM GetParm(int iparm);
    RC lsGetParm(ENGid cureng, int iparm, cTYPE ctype, VOIDptr valp);

    cureng
    Current engine identifier
    iparm
    Number of the parameter to get, starting with 1
    ctype
    C/C++ type to retrieve a value into
    valp
    Pointer to the C/C++ variable to hold the value

    Remarks:

    When implementing extended predicates, gets the C/C++ value of the iparm'th parameter, where 1 is the first parameter. See the Data Types section for legal values of cTYPE.

    See Writing Extended Predicates

    Return Value:

    A term representing the parameter, or 0 if failure.
    OK if successful.

    Example:

    GetParmType

    Description:

    pTYPE GetParmType(int iparm);
    pTYPE lsGetParmType(ENGid cureng, int iparm);

    cureng
    Current engine identifier
    iparm
    Number of the parameter whose type is returned

    Remarks:

    When implementing extended predicates GetParmType() gets the parameter type of the iparm'th parameter.

    See Writing Extended Predicates

    Return Value:

    pTYPE, see the Data Types section for legal values of pTYPE.

    Examples:

    GetStrArg

    Description:

    STRING GetStrArg(TERM term, int iarg);

    term
    The term whose argument is being retrieved
    iarg
    The argument number, starting at 1

    Remarks:

    Gets the string value of the iarg'th argument of the term.

    See Mapping Prolog Arguments to Host Variables

    Return Value:

    Returns the string argument.

    GetStrHead

    Description:

    STRING GetStrHead(TERM term);

    term
    Term representing a list

    Remarks:

    Returns the string value of the head of the list represented by term.

    See Manipulating Lists

    Return Value:

    The string value.

    GetStrParm

    Description:

    STRING GetStrParm(int iparm);

    iparm
    Number of the parameter to get, starting with 1

    Remarks:

    When implementing extended predicates, gets the string value of the iparm'th parameter.

    See Writing Extended Predicates

    Return Value:

    The string parameter.

    GetStrTerm

    Description:

    STRING GetStrTerm(TERM term);

    term
    The term to retrieve the value of

    Remarks:

    Returns the string value of the term.

    See Handling Varying Prolog Types

    Return Value:

    The string value.

    GetStream *

    Description:

    int GetStream(STREAM stream);
    int lsGetStream(ENGid cureng, STREAM stream);

    cureng
    Current engine identifier
    stream
    Stream identifier

    Remarks:

    Gets the current integer handle of the stream specified by stream. See the section on Data Types for the legal values of STREAM.

    See Capturing Prolog I/O

    Return Value:

    The integer handle of the stream.

    GetTail

    Description:

    TERM GetTail(TERM term);
    TERM lsGetTail(ENGid cureng, TERM term)

    cureng
    Current engine identifier
    term
    Term representing a list

    Remarks:

    The term representing the tail of the list is returned.

    See Manipulating Lists

    Return Value:

    The term representing the tail. Returns 0 if term does not represent a list or if term represents the empty list.

    Example:

    GetTerm *

    Description:

    void GetTerm(TERM term, cTYPE ctype, VOIDptr valp);
    RC lsGetTerm(ENGid cureng, TERM term, cTYPE ctype, VOIDptr valp);
     
    cureng
    Current engine identifier
    term
    Term from which value is to be taken
    ctype
    C type to receive the value
    valp
    Pointer to the C/C++ variable

    Remarks:

    Copies the value of the term into the variable of type ctype pointed to by valp. See the Data Types section for legal values of cTYPE.

    See Handling Varying Prolog Types

    Return Value:

    OK if it worked.

    GetTermType

    Description:

    pTYPE GetTermType(TERM term);
    pTYPE lsGetTermType(ENGid cureng, TERM term);

    cureng
    Current engine identifier
    term
    Term

    Remarks:

    Get the type of the term.

    Return Value:

    Returns the Prolog type of the term. See the Data Types section for legal values of pTYPE.

    See Handling Varying Prolog Types

    Example:

    Example:

    GetVersion

    Description:

    STRING GetVersion();
    RC lsGetVersion(ENGid cureng, STRING str);

    cureng
    Current engine identifier
    str
    String to hold version

    Remarks:

    Copies/returns the current version information into the string.

    See Miscellaneous API Functions

    Return Value:

    A string representing the version name and number.
    OK

    Init

    Description:

    void Init(STRING ininame);
    RC lsInit(ENGid *cureng, STRING ininame);

    cureng
    Pointer to the new engine identifier
    ininame
    Name of .cfg file used for stacks etc.

    Remarks:

    Initializes the Prolog environment, using <filename>.cfg if present. If it's not present, then it uses amzi.cfg and system defaults. It can be called with an empty string, "", if you don't care to look for an application specific .cfg file. Must be called once, and before Load() is called.

    See Main Entry Points

    Return Value:

    OK if everything worked.

    Example:

    Init2

    Description:

    void Init2(STRING iniparams);
    RC lsInit2(ENGid *cureng, STRING iniparams);

    cureng
    Pointer to the new engine identifier
    iniparams
    INI parameters used for stacks etc.

    Remarks:

    Initializes the Prolog environment, using the .cfg parameters specified in the iniparams string. The string is of the format "parm1=val1, parm2=val2..". The .cfg parameters can be specified using their full name or with their abbreviation. See the section on INI parameters for a list.

    Either Init() or Init2() must be called once, and before Load() is called.

    See Main Entry Points

    Return Value:

    OK if everything worked.

    Example:

    InitLSX

    Description

    void InitLSX(VOIDptr p);
    RC lsInitLSX(ENGid cureng, VOIDptr p);

    cureng
    Current engine identifier
    p
    Pointer, passed back to extended predicates when called.

    Remarks:

    Causes the Logic Server to look for the 'loadlsx' .cfg file parameter, and load any .lsx files listed there. The pointer can be used for anything, but often is used to identify the calling object or application.

    This entry point is only needed if the application is setting the pointer. If lsInitLSX is not called, then the LSXs listed in the .cfg file are automatically loaded with the pointer set to NULL.

    See Extended Predicate Libraries (LSXs) and Writing Extended Predicates

    Return Value:

    OK if everything worked

    InitPreds *

    Description:

    void InitPreds(PRED_INITptr predtabp);
    RC lsInitPreds(ENGid cureng, PRED_INITptr predtabp);

    cureng
    Current engine identifier
    predtabp
    Predicate table pointer

    Remarks:

    Initializes the predicate table pointed to by predtabp. An application can initialize any number of predicate tables. This should be called after the call to lsInit() and before calling any Prolog functions.

    See Extended Predicate Libraries (LSXs) and Writing Extended Predicates

    Return Value:

    OK if everything worked.

    Example:

    Load

    Description:

    void Load(STRING xplname);
    RC lsLoad(ENGid cureng, STRING xplname);

    cureng
    Current engine identifier
    xplname
    Name of the .xpl file

    Remarks:

    Loads the compiled and linked Prolog program, xplname. You must call Load() or LoadFromMemory() once after calling Init(). If you want to load multiple compiled Prolog files, the rest need to be loaded as .plm files using ExecStr() to call the load predicate with the name of the .plm file to load.

    See Main Entry Points

    Return Value:

    OK if it worked.

    Example:

    LoadFromMemory (URL)

    Description:

    void LoadFromMemory(STRING xplname, int codelength, BYTEptr code);
    RC lsLoad(ENGid cureng, STRING xplname, int codelength, BYTEptr code);
    public void LoadFromURL(String XPLName, URL url) throws LSException, IOException (Java-only)

    cureng
    Current engine identifier
    xplname
    Name of the .xpl file
    codelength
    Length of the .xpl file in memory
    code
    Pointer to the .xpl file in memory

    Remarks:

    Loads the compiled and linked Prolog program, xplname from the specified memory address. You must call Load() or LoadFromMemory() once after calling Init(). If you want to load multiple compiled Prolog files, the rest need to be loaded as .plm files using ExecStr() to call the load predicate with the name of the .plm file to load.

    For Java, there is an additional method, LoadFromURL that will read an .xpl file from a Java URL which can be in a JAR file or on the Internet.

    See Main Entry Points

    Return Value:

    OK if it worked.

    Example:

    Main

    Description:

    TF Main();
    TF lsMain(ENGid cureng);

    cureng
    Current engine identifier

    Remarks:

    Calls main/0 of the loaded Prolog .xpl file.

    See Main Entry Points

    Return Value:

    Prolog TRUE/FALSE depending on success or failure.

    Example:

    MakeAddr *

    Description:

    void MakeAddr(TERMptr termp, VOIDptr valp);
    RC lsMakeAddr(ENGid cureng, TERMptr termp, VOIDptr valp);

    cureng
    Current engine identifier
    termp
    Pointer to a term
    valp
    An address

    Remarks:

    Creates a term of type pADDR from the pointer valp.

    See Making Simple Terms

    Return Value:

    OK if it worked.

    MakeAtom

    Description:

    TERM MakeAtom(STRING str);
    RC lsMakeAtom(ENGid cureng, TERMptr termp, STRING str);

    cureng
    Current engine identifier
    termp
    Pointer to a term
    str
    String representing a Prolog atom

    Remarks:

    Creates a term of type pATOM from the string str.

    See Making Simple Terms

    Return Value:

    A term representing the atom.
    OK if it worked.

    MakeFA

    Description:

    TERM MakeFA(STRING functor, ARITY arity);
    RC lsMakeFA(ENGid cureng, TERMptr termp, STRING functor, ARITY arity);

    cureng
    Current engine identifier
    termp
    Pointer to a term
    functor
    String representing the functor
    arity
    Arity of the term

    Remarks:

    Creates a term with the specified functor and arity. The arguments are all unbound variables which may be left as is or set to specific values using UnifyArg().

    See Manipulating Structures

    Return Value:

    A term representing the structure.
    OK if it worked.

    Example:

    MakeFloat

    Description:

    TERM MakeFloat(double f);
    RC lsMakeFloat(ENGid cureng, TERMptr termp, double f);

    cureng
    Current engine identifier
    termp
    Pointer to a term
    f
    Double precision floating point number

    Remarks:

    Creates a term of type pFLOAT from the double float f.

    See Making Simple Terms

    Return Value:

    A term representing the floating point value.
    OK if it worked.

    MakeInt

    Description:

    TERM MakeInt(intC i);
    RC lsMakeInt(ENGid cureng, TERMptr termp, intC i);

    cureng
    Current engine identifier
    termp
    Pointer to a term
    i
    Integer

    Remarks:

    Creates a term of type pINT from the integer i.

    See Making Simple Terms

    Return Value:

    A term representing the integer.
    OK if it worked.

    MakeList

    Description:

    TERM MakeList();
    RC lsMakeList(ENGid cureng, TERMptr termp);

    cureng
    Current engine identifier
    termp
    Pointer to term that will point to new list

    Remarks:

    Creates an empty list pointed to by tp.

    See Making Simple Terms

    Return Value:

    A term representing the list.
    OK if it worked.

    MakeStr

    Description:

    TERM MakeStr(STRING str);
    RC lsMakeStr(ENGid cureng, TERMptr termp, STRING str);

    cureng
    Current engine identifier
    termp
    Pointer to a term
    str
    String

    Remarks:

    Creates a term of type pSTR from the string str.

    See Making Simple Terms

    Return Value:

    A term representing the string.
    OK if it worked.

    PopList *

    Description:

    void PopList(TERMptr listp, cTYPE ctype, VOIDptr valp);
    RC lsPopList(ENGid cureng, TERMptr listp, cTYPE ctype, VOIDptr valp);

    cureng
    Current engine identifier
    listp
    Term pointing to a list or empty list
    ctype
    Type of the term to be popped
    valp
    The location to store the popped term

    Remarks:

    Pops the term of type ctype from the head of the list and save it in valp. See the Data Types section for possible values of cTYPE.

    See Manipulating Lists

    Return Value:

    OK if everything worked, NOTOK if it failed. Failure will occur if tp does not point to a list.

    Example:

    PushList

    Description:

    TERM PushList(TERM list, TERM term);
    RC lsPushList(ENGid cureng, TERMptr listp, TERM term)

    cureng
    Current engine identifier
    listp
    Term pointing to a list or empty list
    term
    Term to be pushed on the list

    Remarks:

    The term is pushed on the head of the list and listp points to this new head of list.

    See Manipulating Lists

    Return Value:

    A term representing the new head of the list.
    OK if everything worked, NOTOK if it failed. Failure will occur if tp does not point to a list.

    Redo

    Description:

    TF Redo();
    TF lsRedo(ENGid cureng);

    cureng
    Current engine identifier

    Remarks:

    Causes Prolog to backtrack and retry the last Call(), CallStr(), or Redo(). The term used in the initiating Call() or CallStr() is unified with a new value if the redo is successful. Redo() can be used in a while loop to get all the solutions to a Prolog query.

    See String Passing Interface and Scope of Logic Server Terms

    Return Value:

    TRUE/FALSE. A loop that has the TF return code as its condition will loop until there are no more solutions.

    Example:

    Reset

    Description:

    void Reset();
    RC lsReset(ENGid cureng);

    cureng
    Current engine identifier

    Remarks:

    Resets the Prolog stacks and runtime environment. Leaves the logicbase unchanged, so all load programs and assert terms are still present.

    See Error Handling

    Return Value:

    OK if successful.

    Retract

    Description:

    TF Retract(TERM term);
    TF lsRetract(ENGid cureng, TERM term);

    cureng
    Current engine identifier
    term
    Term to retract

    Remarks:

    Retracts the first term in the logicbase that unifies with the specified term; term has the unified value, so Retract() can be used to retrieve and process terms as they're being retracted.

    See Asserting and Retracting to and from the Prolog Logicbase

    Return Value:

    TRUE/FALSE

    Example:

    RetractStr

    Description:

    TF RetractStr(STRING str);
    TF lsRetractStr(ENGid cureng, STRING str);

    cureng
    Current engine identifier
    str
    String representation of term

    Remarks:

    Retracts the first term in the logicbase that unifies with the term represented by the string str.

    See Asserting and Retracting to and from the Prolog Logicbase

    Return Value:

    TRUE/FALSE

    Example:

    SetCommandArgs *

    Description:

    void SetCommandArgs(int argc, char** argv);
    RC lsSetCommandArgs(ENGid cureng, int argc, char** argv);

    cureng
    Current engine identifier
    argc
    Count of arguments
    argv
    Array of arguments

    Remarks:

    Passes the values of argc and argv to the Prolog engine so it can process command line arguments if desired. It is necessary to do this if the Prolog code uses the predicate 'command_line/1'.

    See Miscellaneous API Functions

    Return Value:

    OK

    Example:

    SetInput *

    Description:

    void SetInput(int (* mygetc)(VOIDptr vp), void(*myungetc)(VOIDptr vp, int c));
    RC lsSetInput(ENGid cureng, int (* mygetc)(VOIDptr vp), void(*myungetc)(VOIDptr vp, int c));

    cureng
    Current engine identifier
    mygetc
    A function that gets a character
    myungetc
    A function that ungets the last character

    Remarks:

    When any input stream is set to 3, Amzi! Prolog uses these functions for reading user input from that stream.

    See Capturing Prolog I/O

    Return Value:

    OK if it worked.

    SetIOArg

    Description:

    void SetIOArg(VOIDptr vp);
    RC lsSetIOArg(ENGid cureng, VOIDptr vp);

    cureng
    Current engine identifier
    vp
    The argument to include in I/O calls

    Remarks:

    When any input stream is set to 3, the vp argument is included in the calls to the getc, ungetc, putc and puts functions defined by SetInput() and SetOutput().

    See Capturing Prolog I/O

    Return Value:

    OK if it worked.

    SetOutput

    Description:

    void SetOutput(void (*myputc)(VOIDptr vp, int c), void (*myputs)(VOIDptr vp, STRING s));
    RC lsSetOutput(ENGid cureng, void (*myputc)(VOIDptr vp, int c), void (*myputs)(VOIDptr vp, STRING s));

    cureng
    Current engine identifier
    myputc
    A function that puts a character
    myputs
    A function that puts a string

    Remarks:

    When any output stream is set to 3, Amzi! Prolog uses these functions for writing to the stream.

    See Capturing Prolog I/O

    Return Value:

    OK if it worked.

    SetStream

    Description:

    SetStream(STREAM stream, int handle);
    RC lsSetStream(ENGid cureng, STREAM stream, int handle);

    cureng
    Current engine identifier
    stream
    The stream to set
    handle
    The handle to set it to

    Remarks:

    Sets the stream to the integer handle. Typically this will be used to set the stream to 3, reserved for user-defined function I/O. It might also be used to reset the stream to its old value, obtained from a prior call to GetStream(). See the section on Data Types for the legal values of STREAM.

    See Capturing Prolog I/O

    Return Value:

    OK if it worked.

    StrArgLen

    Description:

    int StrArgLen(TERM term, int iarg);
    int lsStrArgLen(ENGid cureng, TERM term, int iarg);

    cureng
    Current engine identifier
    term
    Term defining a structure
    iarg
    Number of the structure argument

    Remarks:

    Used to determine the length of string to be returned from a lsGetArg() where the argument is either a string or an atom.

    See Mapping Prolog Arguments to Host Variables

    Return Value:

    The length of the string/atom at the iargth parameter, or NOTOK (-1) if term is not a string.

    StrParmLen

    Description:

    int StrParmLen(int iparm);
    int lsStrParmLen(ENGid cureng, int iparm);

    cureng
    Current engine identifier
    iparm
    Number of the parameter

    Remarks:

    Used to determine the length of string to be returned from a lsGetParm() where the parameter is either a string or an atom.

    See Writing Extended Predicates

    Return Value:

    The length of the string/atom at the iparmth parameter, or NOTOK (-1) if term is not a string.

    StrTermLen

    Description:

    int StrTermLen(TERM term);
    int lsStrTermLen(ENGid cureng, TERM term);

    cureng
    Current engine identifier
    term
    Term representing a string

    Remarks:

    Used to determine the maximum length of string to be returned from a GetTerm() or GetHead() where the parameter is either a string or an atom. This length includes all possible quotes in case TermToStrQ() is used.

    See String Passing Interface

    Return Value:

    The length of the string/atom at the iparmth parameter, or NOTOK (-1) if term is not a string.

    StrToTerm

    Description:

    TERM StrToTerm(STRING str);
    RC lsStrToTerm(ENGid cureng, TERMptr termp, STRING str);

    cureng
    Current engine identifier
    termp
    Pointer to term created from string
    str
    String to be used to generate a term

    Remarks:

    Reads the string and creates a term from it.

    See Calling Terms

    Return Value:

    A term representing the string.
    OK if it worked.

    Example:

    TermToStr

    Description:

    STRING TermToStr(TERM term);
    RC lsTermToStr(ENGid cureng, TERM term, STRING str, int len);

    cureng
    Current engine identifier
    term
    Term to translate to a string
    str
    Pointer to string buffer to hold value
    len
    Length of string buffer, used to prevent overflows

    Remarks:

    Writes the term to the string which is len bytes long.

    See String Passing Interface

    Return Value:

    The string representing the term.
    OK if it worked.

    Example:

    TermToStrQ

    Description:

    STRING TermToStrQ(TERM term);
    RC lsTermToStrQ(ENGid cureng, TERM term, STRING str, int len);

    cureng
    Current engine identifier
    term
    Term to translate to a string
    str
    Pointer to string buffer to hold value
    len
    Length of string buffer, used to prevent overflows

    Remarks:

    This function is the same as TermToStr(), except the string is created with quoted atoms where necessary. This makes it possible to feed the same string back to Prolog.

    See String Passing Interface

    Return Value:

    The string representing the term with atoms quoted.
    OK if it worked.

    Example:

    Unify *

    Description:

    TF Unify(TERM term1, TERM term2);
    TF lsUnify(ENGid cureng, TERM term1, TERM term2);

    cureng
    Current engine identifier
    term1
    Term to unify
    term2
    Term to unify

    Remarks:

    Unifies the two terms. Unify() does a full Prolog unification between the two terms. Unlike other functions which return TF, Unify() does not set and reset Prolog break and error handling.

    See Manipulating Structures

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    UnifyArg *

    Description:

    TF UnifyArg(TERMptr termp, int iarg, cTYPE ctype, VOIDptr valp);
    TF lsUnifyArg(ENGid cureng, TERMptr termp, int iarg, cTYPE ctype, VOIDptr valp);

    cureng
    Current engine identifier
    termp
    Pointer to the structure term whose argument is to be set
    iarg
    The number of the argument, starting at 1
    ctype
    The type of the variable
    valp
    Pointer to the variable

    Remarks:

    Used to build complex terms, UnifyArg() lets you individually set the arguments of term. Used in conjunction with MakeFA(), as well as Prolog terms picked up from calls to Prolog.

    See Manipulating Structures

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    Example:

    UnifyAtomArg

    Description:

    TERM UnifyAtomArg(TERM term, int iarg, STRING str);

    term
    The structure term whose argument is to be set
    iarg
    The number of the argument, starting at 1
    str
    The string value of the atom

    Remarks:

    Used to build complex terms, UnifyAtomArg() lets you individually set the argument of a structure to the specified atom value. Used in conjunction with MakeFA(), as well as Prolog terms picked up from calls to Prolog.

    See Manipulating Structures

    Return Value:

    The new term with the unified argument, or 0 if failure.

    UnifyAtomParm

    Description:

    TF UnifyAtomParm(int iparm, STRING str);

    iparm
    The number of the parameter to set, starting at 1
    str
    The atom to unify with the parameter

    Remarks:

    Unify the iparm'th parameter of an extended predicate with the atom in the passed string.

    See Writing Extended Predicates

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    Example:

    UnifyFloatArg

    Description:

    TERM UnifyFloatArg(TERM term, int iarg, double value);

    term
    The structure term whose argument is to be set
    iarg
    The number of the argument, starting at 1
    value
    The floating point value

    Remarks:

    Used to build complex terms, UnifyFloatArg() lets you individually set the argument of a structure to the specified floating point value. Used in conjunction with MakeFA(), as well as Prolog terms picked up from calls to Prolog.

    See Manipulating Structures

    Return Value:

    The new term with the unified argument, or 0 if failure.

    UnifyFloatParm

    Description:

    TF UnifyFloatParm(int iparm, double f);

    iparm
    The number of the parameter to set, starting at 1
    f
    The double to unify with the parameter

    Remarks:

    Unify the iparm'th parameter of an extended predicate with the double.

    See Writing Extended Predicates

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    UnifyIntArg

    Description:

    TERM UnifyIntArg(TERM term, int iarg, int value);

    term
    The structure term whose argument is to be set
    iarg
    The number of the argument, starting at 1
    value
    The integer value

    Remarks:

    Used to build complex terms, UnifyIntArg() lets you individually set the argument of a structure to the specified integer value. Used in conjunction with MakeFA(), as well as Prolog terms picked up from calls to Prolog.

    See Manipulating Structures

    Return Value:

    The new term with the unified argument, or 0 if failure.

    UnifyIntParm

    Description:

    TF UnifyIntParm(int iparm, int value);

    iparm
    The number of the parameter to set, starting at 1
    value
    The integer value to unify with the parameter

    Remarks:

    Unify the iparm'th parameter of an extended predicate with the integer.

    See Writing Extended Predicates

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    Example:

    UnifyParm

    Description:

    TF UnifyParm(int iparm, TERM term);
    TF UnifyParm(int iparm, cTYPE ctype, VOIDptr valp);
    TF lsUnifyParm(ENGid cureng, int iparm, cTYPE ctype, VOIDptr valp);

    cureng
    Current engine identifier
    term
    The term to unify with the parameter
    iparm
    The number of the parameter to set, starting at 1
    ctype
    The type of the variable
    valp
    A pointer to the variable

    Remarks:

    Unify the iparm'th parameter of an extended predicate with the 'term' or the 'variable'. Note that there are two types for representing strings, cATOM and cSTR. While they are both strings, they unify as either a Prolog atom or a Prolog string depending on which is used.

    See Writing Extended Predicates

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    Example:

    UnifyStrArg

    Description:

    TERM UnifyStrArg(TERM term, int iarg, STRING str);

    term
    The structure term whose argument is to be set
    iarg
    The number of the argument, starting at 1
    str
    The string value

    Remarks:

    Used to build complex terms, UnifyStrArg() lets you individually set the argument of a structure to the specified string. Used in conjunction with MakeFA(), as well as Prolog terms picked up from calls to Prolog.

    See Manipulating Structures

    Return Value:

    The new term with the unified argument, or 0 if failure.

    UnifyStrParm

    Description:

    TF UnifyStrParm(int iparm, STRING str);

    iparm
    The number of the parameter to set, starting at 1
    str
    The string to unify with the parameter
     

    Remarks:

    Unify the iparm'th parameter of an extended predicate with the string.

    See Writing Extended Predicates

    Return Value:

    TRUE/FALSE depending on whether the unification succeeded or failed.

    Example:

    Copyright ©1987-2011 Amzi! inc. All Rights Reserved. Amzi! is a registered trademark and Logic Server is a trademark of Amzi! inc.