Error Codes


Initialization Errors

100, INIT, Unknown .cfg parameter: %s
The parameter %s is not a valid Amzi! configuration parameter. It was encountered in either an Amzi! configuration file (.cfg) or an configurationstring passed by a host language application during Logic Server initialization.
101, INIT, Unable to open log file: %s
An attempt to open the logfile %s failed.
102 , INIT, Attempt to open log %s before closing log %s
The application tried to open logfile %s when is was already open.
103 , INIT, An operating system error, %d, occurred when calling InitPreds() for LSX %s.
Once a Logic Server Extension (.lsx) has been loaded by the Logic Server, the Logic Server looks for and calls the function InitPreds() which should be defined in the LSX. This error message indicates that the operating system returned an error code, %d, when attempting to get the address of InitPreds() in the LSX. This error code indicates there was a problem other than the most common problem of not being able to find the InitPreds() entry point.
104, INIT, The initialization procedure InitPreds() was not found for LSX %s.
Once a Logic Server Extension (.lsx) has been loaded by the Logic Server, the Logic Server looks for and calls the function InitPreds() which should be defined in the LSX. This error message indicates that the LSX was successfully loaded, but the Logic Server could not find the InitPreds() entry point.

The problem could be simply that InitPreds() is not defined in the LSX, or, if it is defined, that it is not defined correctly. Look at the sample LSXs for your environment and make sure that InitPreds() in your LSX is defined the same way.
105, INIT, An operating system error, %d, occurred when attempting to load LSX %s.
There are a few common errors that can occur when the Logic Server attempts to load a Logic Server Extension (.lsx). This message indicates the operating system encountered an error, %d, that is not that common. Consult the operating system documentation to determine the nature of the problem.
106, INIT, The operating system could not find LSX %s.
The operating system was unable to find the named Logic Server Extension. This is probably due to a simple environment patherror, or other such directory error.
107, INIT, The operating system could not find one of the dynamic/shared libraries necessary to load LSX %s.
The Logic Server Extension DLL (.lsx) %s could not be loaded. Apparently it requires other dynamic/shared libraries as part of its load, and one of those libraries could not be loaded.
108, INIT, The operating system failed to initialize LSX %s.
The operating system failed to initialize the Logic Server Extension (.lsx) %s correctly. Make sure main entry points in the LSX are specified correctly. See the sample LSXs for examples.
109, ABORT, Runtime trashed, re-install
The Amzi! engine has been corrupted. Re-install the product.

API Errors

200, API, API function was called before the .xpl file was loaded
Most Logic Server API (LSAPI) functions require a loaded Prolog load module (.xpl file) before they can be executed. This is required because part of the Prolog runtime system is implemented in Prolog, and that Prolog code (alib.plm) is linked with every .xpl file. The .xpl file can be your full Prolog program, or just a stub to get the Logic Server started.

Check the sequence of LSAPI calls in the host language program to make sure an lsLoad is called before any LSAPI calls to manipulate the logic base (but after the Logic Server is initialized). If you just want a stub .xpl file, you can link just alib.plm into amzi.xpl.
201, API, Logic Server call to uninitialized engine.
The first Logic Server API (LSAPI) call must be either lsInit or lsInit2. Without one of these occurring first, you can't execute any other LSAPI functions.
202, API, Can't add extended predicates after a .xpl file is loaded.
Extended predicates, entered with lsAddPred or lsInitPreds, must be defined after the Logic Server is initialized and before the .xpl file is loaded. This is because the .xpl loader uses extended predicate definitions to resolve references to extended predicates.
203, API, API function called with invalid index (%d) for structure %s.
In a Logic Server API call that takes a structure and argument index, the index was not valid for the structure. That is, it was either less than 1 or greater than the arity of the structure.
204, API, API function called with invalid list index (%d). Must be 1 or 2.
A list can be considered as a structure with two arguments. In this case the term in the Logic Server API call was a list and it was given an index that was not either 1, the head, or 2, the tail.
205, API, API function cannot map Prolog term to a string: %s.
A Logic Server API call is trying to map the Prolog term '%s' to a string, but that term is not an atom, character list or string.
206, API, API function cannot map Prolog term to an integer: %s.
A Logic Server API call is trying to map the Prolog term '%s' to an integer, but that term cannot be converted to an integer.
207, API, API function cannot map Prolog term to a float: %s.
A Logic Server API call is trying to map the Prolog term '%s' to a float, but that term cannot be converted to a float.
208, API, API function cannot map Prolog term to an address: %s.
A Logic Server API call is trying to map the Prolog term '%s' to an address, but that term cannot be converted to an address.
209, API, API function called with bad type code for conversion, %d.
A Logic Server API call is trying to map a Prolog term to a host language type, but the type, '%d', is not a valid host language type specification.
210, API, API function GetFA called with term that is not an atom, structure or list: %s.
The term '%s' was passed to the Logic Server API function GetFA, but the term is not a structure, atom or list, so it can't be broken up into a functor and arity.
211, API, API function List function called with non-list argument.
A non-list term was passed to a Logic Server API function that requires a list argument.
212, API, API function called with a bad stream ID.
A Logic Server API function that either sets or gets stream information was passed an invalid stream identifier.
213, API, API function request length of term that was not an atom or string.
A Logic Server API function that attempts to calculate the length of an atom or string Prolog term was not passed a term that is an atom or string.
214, API, API function requested type of invalid Prolog term.
A Logic Server API function that returns the type of a Prolog term was given a Prolog term that is not a known type. This error should not happen, so it is likely that the term pointer has been corrupted.
215, API, API function called with string too long, or not null-terminated: %s.
A Logic Server API function was called with a string argument that is either longer than allowed or not null-terminated. If you think the string is formatted correctly, then increase the Amzi! initialization parameter readbuffer.
216, API, API function called with bad host language type.
A Logic Server API function that maps Prolog terms to host language variables was called with a bad type indicator for the host language.
217, EXEC, Extended predicate error: %s
An extended predicate has thrown an error with the descriptive string '%s'.

Load Errors

300, LOAD, %s is not a valid Prolog load file
'%s has either been corrupted or is not a valid load file for this release. Rebuild the file. If the problem persists, contact Amzi! technical support.
301, LOAD, Maximum atoms in a load file (%d) exceeded, global %d, local %d
The load file has exceeded the maximum number of atoms. Increase the Amzi! configuration parameter 'maxatoms'.
302, LOAD, Load module compiled with earlier version, recompile
The load module was not compiled and linked using the current version. Rebuild the file and try again.
303, LOAD, Too many clause references (%d), increase MAXCLAUSES
While loading a load module, one of the predicates was found to have too many clauses. Either split the predicate into multiple predicates with fewer clauses, or increase the Amzi! configuration parameter 'maxclauses'.
If you decide to split the predicate, the following model can be used. If the original predicate had clauses such as:
      duck(a1).
      duck(a2).
      ...
      duck(b1).
      duck(b2).
      ...
You can rewrite the predicate as follows, without changing program behavior.
      duck(X) :- duck1(X).
      duck(X) :- duck2(X).

      duck1(a1).
      duck1(a2).
      ...
      duck2(b1).
      duck2(b2).
      ...
304, LOAD, Too many local atoms, limit %d
The load module had too many atoms, increase the Amzi! initialization parameter 'maxatoms'. If the problem persists, you might be able to replace some of the atom definitions in your program with strings. Strings are slower for pattern matching, but are not limited in space.
305, FATAL, Load buffer overflow, increase DESTBUF
An internal buffer has overflowed while loading a program. Increase the Amzi! initialization parameter 'destbuf'.
306, LOAD, Missing local predicates:\n%s
This error only occurs in modules, which are indicated by the presence of either a :-import or :-export directive at the beginning of the file. In a module, all predicates that are not declared in import or export directives are considered 'local' to the module. All goals in clauses in a module refer to either 'global' predicates (mentioned in export or import directives) or local predicates in the file.

The error can be caused by simply failing to have a local predicate that was meant to be defined.

It can also be caused by goals that refer to clauses that the application expects will be created dynamically with 'asssert's. In this case it is necessary to mention the dynamic predicates in either an :-import or :-export statement.

This error can also occur when porting from a different Prolog to Amzi!. If the other predicate has built-in predicates that are not supported in Amzi!, then the occurrence of goals calling those predicates will trigger this error as well. In these cases, the predicate must be simulated, or the code redesigned, or Amzi! contacted to see if the predicate can be added.
307, LOAD, Corrupted .xpl file: %s
The .xpl file '%s' has become corrupted. Recreate the file and try the application again. If the problem persists, call Amzi! technical support.
308, LOAD, Maximum load modules exceeded
You have exceeded the system limit for load modules in a single execution. Contact Amzi! technical support if your application needs require a larger number of load modules.
309, ABORT, Error in load file
While loading a .PLM or .xpl file, it was discovered that the .PLM or .xpl file was corrupted. Try rebuilding the offending file. If that doesn't fix the problem, contact Amzi! technical support.
310, ABORT, Error loading local atom table
This is an internal error, indicating a problem during load with the local atom table of a module. Contact Amzi! technical support.
311, ABORT, Too long an atom in compiled code
An atom name was encountered during a load that was longer than the read buffer. If you have an extremely long atom name, then increase the Amzi! initialization paratemeter 'readbuffer'.
312, ABORT, Code too long to load
The buffer used to hold each compiled predicate during load was not big enough for one of your predicates. Increase the Amzi! initialization parameter 'srcbuf'.
313, ABORT, Too many variables in clause
During loading, one of the clauses was found to have more variables than the system had space for. Increase the Amzi! initialization paramenter 'maxvars'.
314, ABORT, Load file corrupted, aborting.
This is an internal error caused by a corrupted load file. Rebuild the file, and if the problem persists contact Amzi! technical support.
315, LOAD, Predicate too long to load, subdivide it.
This error is caused by a predicate that is too long for the internal 16-bit integer jumps. It must be broken up into smaller predicates, that might have a master predicate that calls each of the smaller chunks in turn.

I/O Errors

400, READ, String/atom too long
A string or atom has exceeded an internal buffer used for manipulating strings and atoms. Increase the Amzi! initialization parameter 'readbuffer'.
401, READ, Bad character %d '%c'
The reader encountered a character it could not parse. Fix the source code so the bad character is no longer used.
402, READ, Bad hex number format, must be 0x...
The reader was attempting to read what it thought was a hexadecimal number, but the number was not formatted correctly. Check the format, fix the program and try again.
403, READ, Too many variables
The reader encountered a clause with too many variables. Either redesign the clause or increase the Amzi! initialization parameter 'maxvars'.
404, READ, Term too long to read
The reader encountered a term that overflowed the internal read buffer. Either break the term up or increase the Amzi! initialization parameter 'readbuffer'.
405, READ, Read stack full
The reader encountered a term whos complexity caused an internal overflow. Either simplify the term or increase the Amzi! initialization paramteter 'readdepth'.
406, READ, Unexpected delimiter
The reader encountered a delimiter character when it did not expect one. The term being read is syntactically incorrect.
407, READ, Unexpected operator
The reader has been confused by the term being read. The term is syntactically incorrect, although the problem might be something other than an operator definition problem. Fix the problem and try again.
408, READ, Read parsing error, parse stack: %d
The reader ran into a problem interpreting an operator expression. If you don't find an error in your code, contact Amzi! technical support with the code that causes the error.
409, READ, Atom name too long to read, max size: %ld
An atom in the code had a name longer than the read buffer. Increase the Amzi! initialization parameter 'readbuffer', or use a shorter name for the atom.
410, READ, Reader confused, expected an atom
The reader encountered an internal error. If the code appears correct to you, contact Amzi! technical support with the offending code.
411, READ, Bad internal type in read parse
An internal reader error occurred. If the problem isn't obvious with your code, contact Amzi! technical support with the offending code.
412, READ, Unable to read valid term in string
While trying to read a term from a string, the reader was unable to parse a valid term from that string.
413, EXEC, Bad file handle passed in, %d
A file I/O predicate was called with the invalid handle '%d'.
414, EXEC, Attempt to redirect stream to unopened file/window, %s
A file I/O predicate was called with handle that does not correspond to an open file.
415, EXEC, Buffer has overflowed by %d during a write.
Write operations use the same internal buffer as read operations. This message indicates that a write operation has exceeded the buffer length. Increase the Amzi! initialization parameter 'readbuffer'.
416, EXEC, Attempt to set stream to non-open I/O handle, %d
When attempting to change the current or user default I/O stream, an invalid handle was specified. This problem might occur from use of see or tell predicates or Logic Server API calls that set the current streams.
417, EXEC, Prolog file I/O error
An undetermined I/O error occur when writing to a file.
418, EXEC, Path length too long
A file predicate was called with a file name/path specification that is longer than the allowable path name for the platform.
419, FATAL, Unexpected end-of-file
An unexpected end-of-file error occurred while reading a file. This error can occur with an improperly formatted binary file, .PLM or .xpl, or with a file of Prolog source in which the end-of-file was encountered in the middle of reading a Prolog term.
420, EXEC, Can't open file %s
An attempt to open the file '%s' failed.
421, EXEC, IO error: %s
An I/O error occurred. '%s' provides additional information on where the error occurred.
422, FATAL, Too many files opened
There are too many files opened from Prolog. Close some before trying to open others. If your application really needs this many files open, contact Amzi! technical support.
423, EXEC, Oops error (%s), call Amzi!
An internal error has occurred during Prolog I/O. If it is not clear how your program could have caused such an error, contact Amzi! technical support.

Arithmetic Errors

500, EXEC, Bad arguments for arithmetic operator, %s
The arithmetic operator '%s' requires integer arguments, but was given non-integer arguments instead.
501, EXEC, Bad argument for arithmetic evaluation, %s
A term being evaluated arithmetically contained the value '%s' which is not valid for arithmetic evaluation. Arithmetic evaluation occurs for the arguments of the 'is' operator and arithmetic comparison operators.
502, EXEC, 0 division
An arithmetic expression included a division by zero.

Execution Errors

1000, EXEC, Attempt to assert a previously compiled or protected predicate: %s.
The application tried to assert the predicate '%s', which has already been loaded as a compiled predicate, or is a system predicate.

This error often occurs when a program contains discontiguous clauses defining a predicate that were not declared as either discontiguous or multifile. This type of program will run interpreted OK, but when compiled, each set of clauses compiles into a separate block. When the compiled module is loaded this error will be generated when the loader tries to load the second block of clauses.

This error can also result from a simple typing error. If, for example, a clause ends in a comma, rather than a period, or a clause has a period in the middle of the goals, rather than a comma, the compiler might think you are defining the comma operator.

Another common typing error is to miss an argument in one clause of a predicate that has many clauses. This will insert a predicate of the wrong arity in between the clauses with the correct arity.

Look at the compiler output to make sure the clauses that are compiled represent the predicates you think should be defined in your program.
1001, ABORT, User exit
The application program executed the goal abort(1)
1002, FATAL, User reset
The application program executed the goal abort(0).
1003, ABORT, User abort
The application program executed the goal abort(2).
1004, ABORT, Bad op code in compiled code
While executing compiled Prolog code, a bad Prolog op code was encountered. This should not happen, and indicates that the compiled code was somehow corrupted. Unless you suspect your host language application is corrupting memory, contact Amzi! technical support.
1005, INTERNAL, Bad choice point heap reference
During heap garbage collection, a bad heap reference was found. This is an internal error that shouldn't occur. Contact Amzi! technical support. In the meantime you can work around the problem by increasing the heap size with an Amzi! initialization parameter or, if the code is running interpreted, by compiling the code.
1006, ABORT, Bad data type in load file
While loading a .PLM or .xpl file a bad tag was found. This is an internal error, indicating the file being loaded is corrupted. Recreate the file and if the problem persists contact Amzi! technical support.
1007, ABORT, Attempt to allocate too big a chunk
This is an internal error, contact Amzi! technical support.
1008, ABORT, Bad term on heap during GC
This is an internal error triggered during heap garbage collection. Contact Amzi! technical support. In the meantime you can work around the problem by increasing the heap size with an Amzi! initialization parameter or, if the code is running interpreted, by compiling the code.
1009, ABORT, Heap has overflowed before garbage collection
A percentage of the heap is reserved for overflow. This error indicates that that percentage was not enough to prevent the heap from overflowing before garbage collection could take place. Increase the Amzi! initialization parameter 'heapbumper'.
1010, ABORT, Memory allocation error
This is an internal error indicating an error in the memory management sub-system. Contact Amzi! technical support.
1011, ABORT, String to char list string buffer overflow
1This is an internal error indicating a string being converted to a list of codes was longer than its internal buffer. This shouldn't happen. Contact Amzi! technical support.
1012, ABORT, No more space for things
Certain Prolog types are stored in a separate area of memory. These include long integers, strings and addresses. This message indicates that storage area is full. You can increase this storage by increasing the Amzi! initialization parameter 'thingblksz'. Garbage collection should make this message relatively rare. If you don't think your application should run out of this storage, contact Amzi! technical support.
1013, ABORT, Write error parsing term
This is an internal error indicating the write function was unable to process a term to be written. Contact Amzi! technical support.
1014, ABORT, Out of memory allocating: %s
There is insufficient memory available to continue running the application. The resource being allocated when memory ran out was '%s'.
1015, EXEC, Attempt to retract a protected predicate: %s
The application as attempted to retract the predicate '%s', which is either a system predicate or a protected predicate.
1016, FATAL, Heap space full, compile code or increase heap
The heap became full before the garbage collector could be called. You can increase the heap with the Amzi! initialization parameter 'heap', or you can give the garbage collector a better chance by increasing the 'heapbumper' initialization parameter.

If your program is running interpreted, you can greatly reduce the heap usage by compiling the program. This is because compiled code optimizes both speed and the use of internal resources, such as the heap. If the problem still persists, you might have to replace some recursive control structures in your application with repeat/fail control structures.
1017, FATAL, Heap fully compacted, no more space, compile code or increase heap
The heap is full and can not be further garbage collected. You can increase the heap with the Amzi! initialization parameter 'heap'.

If your program is running interpreted, you can greatly reduce the heap usage by compiling the program. This is because compiled code optimizes both speed and the use of internal resources, such as the heap.

If the problem still persists, you might have to replace some recursive control structures in your application with repeat/fail control structures.
1018, ABORT, Memory not aligned on 4-byte boundary for %s. Contact Amzi!
This is an internal error that should not occur. It indicates that the internal control structure '%s' is not properly aligned. Contact Amzi! technical support.
1019, FATAL, Too many references to the same clause
The dynamic database garbage collection routines keep track of the active use of each clause. This error means one particular clause is being simultaneously accessed a great many times. This should not be an ordinary occurence.
1020, FATAL, Trail space full, %ld of %ld. Compile code or increase trail
The trail stack has overflowed. If your program is running interpreted, you can decrease trail use by compiling the code. You can also increase the amount of trail space with the Amzi! initialization paramteter 'trail'.
1021, FATAL, Control stack full. Compile code or increase control
The Prolog execution control stack is full. Compiling your code will decrease the impact on the control stack for recursive predicates. You can also increase the Amzi! initialization parameter 'control' to create a larger control stack. If the problem persists, you might have to replace some recursive loops in your program with repeat/fail loops.
1022, EXEC, Argument instantiation error: %s.
An argument to a built-in predicate was not correctly instantiated, as indicated by the additional information '%s' provided in the message.
1023, EXEC, Argument type error: %s.
An argument to a built-in predicate was not the correct type, as indicated by the additional information '%s' provided in the message.
1024, EXEC, Maximum number of atoms exceeded (%d). Use strings or increase atomtable
The atom table is full. You can increase the size of the atom table using the Amzi! initialization parameter 'maxatoms'.

You might also consider using strings instead of atoms for some situations in your program. Strings are slower to unify, because they compare character by character, but are not as limited in storage. So if there are places where you use atoms simply to display information, then those terms are probably better stored as strings.
1025, EXEC, Too many variables
A call to the built-in predicate 'functo'r requested an arity that is greater than the maximum number of variables allowed. Either correct the call or increase the Amzi! initialization parameter 'maxvars'.
1026, EXEC, Op error
An attempt to create an operator has failed. Check the operator definition statements for syntactical correctness.
1027, EXEC, System pred - bad argument
A built-in predicate had a bad argument. Either it was the wrong type or it was not correctly instantiated (a variable when it should be bound, or bound when it should be a variable).
1028, EXEC, Needed integer argument
A call to the built-in predicate arg had an argument number that was not an integer.
1029, FATAL, Break
The user hit break during execution of a program, or while reading input.
1030, FATAL, Local stack full, compile code or increase local
The local stack is full. You can minimize impact on the local stack by compiling your code. You can increase the local stack with the Amzi! initialization parameter 'local'.
1031, EXEC, Too many variables in term (copyt)
A term with too many variables was being added to the dynamic database. Either simplify the term or increase the Amzi! initialization parameter 'maxvars'.
1032, FATAL, Bad op code, %d, at offset %d
A bad opcode was encountered when loading compiled code. Try rebuilding the file and if that doesn't correct the problem, contact Amzi! technical support.
1033, EXEC, Bad system argument: %s
A built-in predicate had an invalid argument. The text '%s' provides further information.
1034, EXEC, User throw: %s
A throw or cut_tag predicate was called with a tag for which there was no catch or tag. The offending tag is '%s'.
1035, EXEC, Execution error: %s
An execution error occurred during the call to a built-in predicate in the Prolog portion of the runtime library. The message '%s' provides more information.
1036, FATAL, Unreachable cuttag
A tag for a catch wound up in a position on the control stack where it could not be reached. This is an internal error. Contact Amzi! technical support.
1037, FATAL, Bad cut
A cut, probably in a compiled not or if-then-else ( -> ; ), did not cut correctly. If the problem occurs in a cut in one of the two constructs mentioned above, recode that section without the embedded cut.
1038, EXEC, String too long, increase .cfg parameter 'readbuffer'
A string predicate or operation created a string that is longer than the internal buffer. Increase the Amzi! initialization parameter 'readbuffer'.
1039, ABORT, Unlock software before use.
The system was still locked when it was used. Unlock the software and then continue. Contact Amzi! technical support if you have questions.
1040, INTERNAL, Bad built-in predicate
An internal error occurred accessing a built-in predicate. Contact Amzi! technical support.
1041, INTERNAL, Built-in or extended predicate %s/%d had a bad return code: %d
A built-in predicate encountered an internal error. Contact Amzi! technical support.

Copyright ©1987-2000 Amzi! inc. All Rights Reserved.