better emulation of SWI atom_t and functor_t.

This commit is contained in:
Vitor Santos Costa 2010-05-03 14:26:56 +01:00
parent fa63422c51
commit 31554991c8
20 changed files with 1023 additions and 919 deletions

View File

@ -192,6 +192,8 @@ AtomAdjust(Atom a)
#define rehash(oldcode, NOfE, KindOfEntries)
#define RestoreSWIHash()
#include "rheap.h"
static void

View File

@ -28,6 +28,7 @@ static char SccsId[] = "%W% %G%";
#include "alloc.h"
#include "clause.h"
#include "Foreign.h"
#ifdef LOW_LEVEL_TRACER
#include "tracer.h"
#endif
@ -1067,6 +1068,16 @@ InitLogDBErasedMarker(void)
INIT_CLREF_COUNT(Yap_heap_regs->logdb_erased_marker);
}
#define SWIAtomToAtom(X) SWI_Atoms[(X)>>1]
static void
InitSWIAtoms(void)
{
int i=0, j=0;
#include "iswiatoms.h"
Yap_InitSWIHash();
}
static void
InitAtoms(void)
{

View File

@ -1180,6 +1180,13 @@ rehash(CELL *oldcode, int NOfE, int KindOfEntries)
}
}
static void
RestoreSWIHash(void)
{
Yap_InitSWIHash();
}
#include "rheap.h"
/* restore the atom entries which are invisible for the user */
@ -1300,7 +1307,6 @@ RestoreHashPreds(void)
Yap_FreeAtomSpace((ADDR)np);
}
/*
* This is the really tough part, to restore the whole of the heap
*/

View File

@ -22,6 +22,8 @@
#include <stdio.h>
#endif
#include "../include/dswiatoms.h"
#ifndef INT_KEYS_DEFAULT_SIZE
#define INT_KEYS_DEFAULT_SIZE 256
#endif
@ -30,6 +32,11 @@
#define MAX_DLMALLOC_HOLES 32
typedef struct swi_reverse_hash {
ADDR key;
Int pos;
} swi_rev_hash;
typedef struct memory_hole {
ADDR start;
ADDR end;

View File

@ -454,6 +454,7 @@ void STD_PROTO(Yap_InitMYDDAS_TopLevelPreds,(void));
/* yap2swi.c */
void STD_PROTO(Yap_swi_install,(void));
void STD_PROTO(Yap_InitSWIHash,(void));
/* ypsocks.c */
void STD_PROTO(Yap_InitSockets,(void));

View File

@ -296,3 +296,7 @@
#define ForeignCodeBase Yap_heap_regs->foreign_code_base
#define ForeignCodeTop Yap_heap_regs->foreign_code_top
#define ForeignCodeMax Yap_heap_regs->foreign_code_max
#define SWI_Atoms Yap_heap_regs->swi_atoms
#define SWI_Functors Yap_heap_regs->swi_functors
#define SWI_ReverseHash Yap_heap_regs->swi_reverse_hash

View File

@ -296,3 +296,7 @@
ADDR foreign_code_base;
ADDR foreign_code_top;
ADDR foreign_code_max;
Atom swi_atoms[N_SWI_ATOMS];
Functor swi_functors[N_SWI_FUNCTORS];
struct swi_reverse_hash swi_reverse_hash[N_SWI_HASH];

View File

@ -296,3 +296,7 @@
Yap_heap_regs->foreign_code_base = NULL;
Yap_heap_regs->foreign_code_top = NULL;
Yap_heap_regs->foreign_code_max = NULL;
InitSWIAtoms();

View File

@ -651,6 +651,19 @@ CleanSIndex(StaticIndex *idx, int recurse)
}
}
static void
RestoreSWIAtoms(void)
{
int i, j;
for (i=0; i < N_SWI_ATOMS; i++) {
SWI_Atoms[i] = AtomAdjust(SWI_Atoms[i]);
}
for (j=0; j < N_SWI_FUNCTORS; j++) {
SWI_Functors[j] = FuncAdjust(SWI_Functors[j]);
}
RestoreSWIHash();
}
static void
RestorePredHash(void)
{

View File

@ -296,3 +296,7 @@
RestoreSWIAtoms();

View File

@ -106,6 +106,7 @@ MYDDAS_VERSION=MYDDAS-0.9.1
INTERFACE_HEADERS = \
$(srcdir)/include/c_interface.h \
$(srcdir)/include/clause_list.h \
$(srcdir)/include/dswiatoms.h \
$(srcdir)/include/udi.h \
$(srcdir)/include/rtree_udi.h \
$(srcdir)/include/yap_structs.h \
@ -114,26 +115,41 @@ INTERFACE_HEADERS = \
$(srcdir)/include/SWI-Stream.h
HEADERS = \
$(srcdir)/H/TermExt.h $(srcdir)/H/Atoms.h \
$(srcdir)/H/Tags_32bits.h $(srcdir)/H/Tags_32Ops.h \
$(srcdir)/H/Tags_32LowTag.h $(srcdir)/H/Tags_64bits.h \
$(srcdir)/H/Tags_24bits.h $(srcdir)/H/sshift.h \
$(srcdir)/H/Yap.h $(srcdir)/H/Yatom.h \
$(srcdir)/H/TermExt.h \
$(srcdir)/H/Atoms.h \
$(srcdir)/H/Tags_32bits.h \
$(srcdir)/H/Tags_32Ops.h \
$(srcdir)/H/Tags_32LowTag.h \
$(srcdir)/H/Tags_64bits.h \
$(srcdir)/H/Tags_24bits.h \
$(srcdir)/H/sshift.h \
$(srcdir)/H/Yap.h \
$(srcdir)/H/Yatom.h \
$(srcdir)/H/YapHeap.h \
$(srcdir)/H/Regs.h $(srcdir)/H/Yapproto.h \
$(srcdir)/H/absmi.h $(srcdir)/H/alloc.h \
$(srcdir)/H/amidefs.h $(srcdir)/H/amiops.h $(srcdir)/H/arrays.h \
$(srcdir)/H/arith2.h $(srcdir)/H/attvar.h \
$(srcdir)/H/clause.h $(srcdir)/H/compile.h \
$(srcdir)/H/corout.h $(srcdir)/H/dlmalloc.h \
$(srcdir)/H/Regs.h \
$(srcdir)/H/Yapproto.h \
$(srcdir)/H/absmi.h \
$(srcdir)/H/alloc.h \
$(srcdir)/H/amidefs.h \
$(srcdir)/H/amiops.h \
$(srcdir)/H/arrays.h \
$(srcdir)/H/arith2.h \
$(srcdir)/H/attvar.h \
$(srcdir)/H/clause.h \
$(srcdir)/H/compile.h \
$(srcdir)/H/corout.h \
$(srcdir)/H/dlmalloc.h \
$(srcdir)/H/dglobals.h \
$(srcdir)/H/dhstruct.h \
$(srcdir)/H/eval.h $(srcdir)/H/heapgc.h \
$(srcdir)/H/eval.h \
$(srcdir)/H/heapgc.h \
$(srcdir)/H/hglobals.h \
$(srcdir)/H/hstruct.h \
$(srcdir)/H/iglobals.h \
$(srcdir)/H/ihstruct.h \
$(srcdir)/H/index.h $(srcdir)/H/iopreds.h \
$(srcdir)/H/index.h \
$(srcdir)/H/iopreds.h \
$(srcdir)/H/iswiatoms.h \
$(srcdir)/H/rclause.h \
$(srcdir)/H/rglobals.h \
$(srcdir)/H/rheap.h \

View File

@ -15,9 +15,11 @@
<h1>Changes in YAP-5.1</h1>
<h2>Yap-6.0.4:</h2>
<h2>Yap-6.0.5:</h2>
<ul>
<li> .</li>
<li> IMPROVEMENT: better emulation of SWI atom_t and functor_t. Now
they can be defined to be a constant.</li>
<li> FIXED: 64 bit complaints in Matlab interface.</li>
</ul>

View File

@ -9358,8 +9358,18 @@ matrices are multi-dimensional and compact. In contrast to static
arrays. these arrays are allocated in the stack. Matrices are available
by loading the library @code{library(matrix)}.
Accessing the matlab dynamic libraries can be complicated. In Linux
machines, to use this interface, you may have to set the environment
variable @t{LD_LIBRARY_PATH}. Next, follows an example using bash in a
64-bit Linux PC:
@example
export LD_LIBRARY_PATH=''$MATLAB_HOME"/sys/os/glnxa64:''$MATLAB_HOME"/bin/glnxa64:''$LD_LIBRARY_PATH"
@end example
where @code{MATLAB_HOME} is the directory where matlab is installed
at. Please replace @code{ax64} for @code{x86} on a 32-bit PC.
Notice that the functionality in this library is only partial. Please
contact the YAP maintainers if you need for extra functionality.
contact the YAP maintainers if you require extra functionality.
@table @code

View File

@ -19,6 +19,7 @@
#include <Yap.h>
#include <Yatom.h>
#include <YapHeap.h>
#include <eval.h>
#if HAVE_MATH_H
@ -89,15 +90,46 @@
#define ERR_CHARS_TYPE 37 /* char *, term */
#define ERR_MUST_BE_VAR 38 /* int argn, term_t term */
#define addr_hash(V) (((CELL) (V)) >> 4 & (N_SWI_HASH-1))
static void
add_to_hash(Int i, ADDR key)
{
UInt h = addr_hash(key);
while (SWI_ReverseHash[h].key) {
h = (h+1)%N_SWI_HASH;
}
SWI_ReverseHash[h].key = key;
SWI_ReverseHash[h].pos = i;
}
static atom_t
in_hash(ADDR key)
{
UInt h = addr_hash(key);
while (SWI_ReverseHash[h].key) {
if (SWI_ReverseHash[h].key == key)
return SWI_ReverseHash[h].pos;
h = (h+1)%N_SWI_HASH;
}
return 0;
}
static inline atom_t
AtomToSWIAtom(Atom at)
{
atom_t ats;
if ((ats = in_hash((ADDR)at)))
return ats;
return (atom_t)at;
}
static inline Atom
SWIAtomToAtom(atom_t at)
{
if ((CELL)at & 1)
return SWI_Atoms[at>>1];
return (Atom)at;
}
@ -114,15 +146,33 @@ SWIModuleToModule(module_t m)
static inline functor_t
FunctorToSWIFunctor(Functor at)
{
atom_t ats;
if ((ats = in_hash((ADDR)at)))
return (functor_t)ats;
return (functor_t)at;
}
static inline Functor
SWIFunctorToFunctor(functor_t at)
{
if ((CELL)at & 1)
return SWI_Functors[at>>1];
return (Functor)at;
}
void
Yap_InitSWIHash(void)
{
int i, j;
memset(SWI_ReverseHash, N_SWI_HASH, sizeof(swi_rev_hash));
for (i=0; i < N_SWI_ATOMS; i++) {
add_to_hash(i, (ADDR)SWI_Atoms[i]);
}
for (j=0; j < N_SWI_FUNCTORS; j++) {
add_to_hash(j, (ADDR)SWI_Functors[j]);
}
}
static void
PredicateInfo(void *p, Atom* a, unsigned long int* arity, Term* m)
{
@ -1028,26 +1078,6 @@ X_API int PL_raise_exception(term_t exception)
return 0;
}
#define ATOM_instantiation_error AtomToSWIAtom(AtomInstantiationError)
#define ATOM_max_files AtomToSWIAtom(AtomMaxFiles)
#define ATOM_no_memory AtomToSWIAtom(AtomNoMemory)
#define ATOM_procedure AtomToSWIAtom(AtomProcedure)
#define ATOM_system_error AtomToSWIAtom(AtomSystemError)
#define ATOM_variable AtomToSWIAtom(AtomVariable)
#define FUNCTOR_error2 FunctorToSWIFunctor(FunctorError)
#define FUNCTOR_context2 FunctorToSWIFunctor(FunctorContext2)
#define FUNCTOR_divide2 FunctorToSWIFunctor(FunctorSlash)
#define FUNCTOR_domain_error2 FunctorToSWIFunctor(FunctorDomainError)
#define FUNCTOR_existence_error2 FunctorToSWIFunctor(FunctorExistenceError)
#define FUNCTOR_evaluation_error1 FunctorToSWIFunctor(FunctorEvaluationError)
#define FUNCTOR_not_implemented2 FunctorToSWIFunctor(FunctorNotImplemented)
#define FUNCTOR_permission_error3 FunctorToSWIFunctor(FunctorPermissionError)
#define FUNCTOR_representation_error1 FunctorToSWIFunctor(FunctorRepresentationError)
#define FUNCTOR_resource_error1 FunctorToSWIFunctor(FunctorResourceError)
#define FUNCTOR_timeout_error2 FunctorToSWIFunctor(FunctorTimeoutError)
#define FUNCTOR_type_error2 FunctorToSWIFunctor(FunctorTypeError)
static char *
OsError(void)
{

View File

@ -418,810 +418,3 @@ F UPlus Plus 1
F VBar VBar 2
F Var Var 1
A abort "abort"
A aborted "$aborted"
A abs "abs"
A access "access"
A acos "acos"
A agc "agc"
A agc_gained "agc_gained"
A agc_margin "agc_margin"
A agc_time "agc_time"
A alias "alias"
A allow_variable_name_as_functor "allow_variable_name_as_functor"
A alnum "alnum"
A alpha "alpha"
A alternative "alternative"
A and "/\\"
A anonvar "_"
A append "append"
A ar_equals "=:="
A ar_not_equal "=\\="
A argument "argument"
A argumentlimit "argumentlimit"
A ascii "ascii"
A asin "asin"
A assert "assert"
A asserta "asserta"
A at "at"
A at_equals "=@="
A at_exit "at_exit"
A at_larger "@>"
A at_larger_eq "@>="
A at_not_equals "\\=@="
A at_smaller "@<"
A at_smaller_eq "@=<"
A atan "atan"
A atom "atom"
A atom_garbage_collection "atom_garbage_collection"
A atomic "atomic"
A atoms "atoms"
A att "att"
A attributes "attributes"
A attvar "attvar"
A autoload "autoload"
A backquoted_string "backquoted_string"
A backslash "\\"
A backtrace "backtrace"
A bar "|"
A begin "begin"
A binary "binary"
A bind "bind"
A block "block"
A bof "bof"
A bom "bom"
A bool "bool"
A brace_term_position "brace_term_position"
A break "break"
A btree "btree"
A buffer "buffer"
A buffer_size "buffer_size"
A built_in_procedure "built_in_procedure"
A busy "busy"
A byte "byte"
A call "call"
A callable "callable"
A callpred "$callpred"
A canceled "canceled"
A case_sensitive_file_names "case_sensitive_file_names"
A catch "catch"
A ceil "ceil"
A ceiling "ceiling"
A char_type "char_type"
A character "character"
A character_code "character_code"
A character_escapes "character_escapes"
A chars "chars"
A chdir "chdir"
A chmod "chmod"
A choice "choice"
A clause "clause"
A clause_reference "clause_reference"
A close "close"
A close_on_abort "close_on_abort"
A close_option "close_option"
A cm "cm"
A cntrl "cntrl"
A co "co"
A codes "codes"
A collected "collected"
A collections "collections"
A colon ":"
A comma ","
A comments "comments"
A compound "compound"
A context "context"
A context_module "context_module"
A continue "continue"
A core "core"
A core_left "core_left"
A cos "cos"
A cputime "cputime"
A create "create"
A csym "csym"
A csymf "csymf"
A cumulative "cumulative"
A curl "{}"
A current "current"
A current_input "current_input"
A current_output "current_output"
A cut "!"
A cut_call "cut_call"
A cut_exit "cut_exit"
A cut_parent "cut_parent"
A cutted "cut"
A date "date"
A db_reference "db_reference"
A dc_call_prolog "$c_call_prolog"
A dcall "<meta-call>"
A dcall_cleanup "$call_cleanup"
A dcatch "$catch"
A dcut "$cut"
A dde_error "dde_error"
A dde_handle "dde_handle"
A debug "debug"
A debug_on_error "debug_on_error"
A debugger_print_options "debugger_print_options"
A debugger_show_context "debugger_show_context"
A debugging "debugging"
A dec10 "dec10"
A default "default"
A defined "defined"
A delete "delete"
A depth_limit_exceeded "depth_limit_exceeded"
A destroy "destroy"
A detached "detached"
A detect "detect"
A development "development"
A dexit "$exit"
A dforeign_registered "$foreign_registered"
A dgarbage_collect "$garbage_collect"
A digit "digit"
A directory "directory"
A discontiguous "discontiguous"
A div "//"
A divide "/"
A dload "$load"
A dmessage_queue "$message_queue"
A dmutex "$mutex"
A domain_error "domain_error"
A dos "dos"
A dot "."
A dots "dots"
A double_quotes "double_quotes"
A doublestar "**"
A dprof_node "$profile_node"
A dstream "$stream"
A dthread_init "$thread_init"
A dthrow "$throw"
A dtime "$time"
A dwakeup "$wakeup"
A dynamic "dynamic"
A e "e"
A encoding "encoding"
A end "end"
A end_of_file "end_of_file"
A end_of_line "end_of_line"
A end_of_stream "end_of_stream"
A environment "environment"
A eof "eof"
A eof_action "eof_action"
A eof_code "eof_code"
A equal "equal"
A equals "="
A erase "erase"
A erased "erased"
A error "error"
A eval "eval"
A evaluable "evaluable"
A evaluation_error "evaluation_error"
A exception "exception"
A exclusive "exclusive"
A execute "execute"
A exist "exist"
A existence_error "existence_error"
A exit "exit"
A exited "exited"
A exp "exp"
A export "export"
A exports "exports"
A exported "exported"
A expression "expression"
A externals "externals"
A fact "fact"
A factor "factor"
A fail "fail"
A failure_error "failure_error"
A false "false"
A feature "feature"
A file "file"
A file_name "file_name"
A file_name_variables "file_name_variables"
A file_no "file_no"
A flag "flag"
A flag_value "flag_value"
A float "float"
A float_format "float_format"
A float_fractional_part "float_fractional_part"
A float_integer_part "float_integer_part"
A float_overflow "float_overflow"
A float_underflow "float_underflow"
A floor "floor"
A force "force"
A foreign "foreign"
A foreign_function "$foreign_function"
A foreign_return_value "foreign_return_value"
A fork "fork"
A frame "frame"
A frame_attribute "frame_attribute"
A frame_finished "frame_finished"
A frame_reference "frame_reference"
A free_of_attvar "free_of_attvar"
A freeze "freeze"
A full "full"
A functor_name "functor_name"
A functors "functors"
A fx "fx"
A fy "fy"
A garbage_collected "<garbage_collected>"
A garbage_collection "garbage_collection"
A gc "gc"
A gctime "gctime"
A getcwd "getcwd"
A global "global"
A global_shifts "global_shifts"
A global_stack "global_stack"
A globallimit "globallimit"
A globalused "globalused"
A goal "goal"
A goal_expansion "goal_expansion"
A grammar "-->"
A graph "graph"
A gvar "gvar"
A halt "halt"
A has_alternatives "has_alternatives"
A hash "hash"
A hashed "hashed"
A hat "^"
A heap "heap"
A heaplimit "heaplimit"
A heapused "heapused"
A help "help"
A hidden "hidden"
A hide_childs "hide_childs"
A history_depth "history_depth"
A ifthen "->"
A ignore "ignore"
A ignore_ops "ignore_ops"
A imported "imported"
A imported_procedure "imported_procedure"
A index "index"
A indexed "indexed"
A inf "inf"
A inferences "inferences"
A infinite "infinite"
A informational "informational"
A init_file "init_file"
A initialization "initialization"
A input "input"
A inserted_char "inserted_char"
A instantiation_error "instantiation_error"
A int "int"
A int64_t "int64_t"
A int_overflow "int_overflow"
A integer "integer"
A integer_expression "integer_expression"
A interrupt "interrupt"
A io_error "io_error"
A io_mode "io_mode"
A ioctl "ioctl"
A is "is"
A iso "iso"
A iso_latin_1 "iso_latin_1"
A isovar "$VAR"
A join "join"
A jump "jump"
A kernel "kernel"
A key "key"
A larger ">"
A larger_equal ">="
A level "level"
A li "li"
A limit "limit"
A line "line"
A line_count "line_count"
A list "list"
A list_position "list_position"
A listing "listing"
A local "local"
A local_shifts "local_shifts"
A local_stack "local_stack"
A locale "locale"
A locallimit "locallimit"
A localused "localused"
A lock "lock"
A locked "locked"
A log "log"
A log10 "log10"
A long "long"
A low "low"
A lower "lower"
A lsb "lsb"
A lshift "<<"
A main "main"
A mark "mark"
A matches "matches"
A max "max"
A max_arity "max_arity"
A max_dde_handles "max_dde_handles"
A max_depth "max_depth"
A max_files "max_files"
A max_path_length "max_path_length"
A max_size "max_size"
A max_variable_length "max_variable_length"
A memory "memory"
A message "message"
A message_lines "message_lines"
A message_queue "message_queue"
A message_queue_property "message_queue_property"
A meta_argument "meta_argument"
A meta_argument_specifier "meta_argument_specifier"
A meta_predicate "meta_predicate"
A min "min"
A min_free "min_free"
A minus "-"
A mismatched_char "mismatched_char"
A mod "mod"
A mode "mode"
A modify "modify"
A module "module"
A module_property "module_property"
A module_transparent "module_transparent"
A modules "modules"
A msb "msb"
A multifile "multifile"
A mutex "mutex"
A mutex_option "mutex_option"
A mutex_property "mutex_property"
A natural "natural"
A newline "newline"
A nil "[]"
A nlink "nlink"
A no_memory "no_memory"
A nodebug "nodebug"
A non_empty_list "non_empty_list"
A none "none"
A noprofile "noprofile"
A not "not"
A not_equals "\\="
A not_implemented "not_implemented"
A not_less_than_one "not_less_than_one"
A not_less_than_zero "not_less_than_zero"
A not_provable "\\+"
A not_strickt_equals "\\=="
A not_unique "not_unique"
A number "number"
A number_of_clauses "number_of_clauses"
A numbervar_option "numbervar_option"
A numbervars "numbervars"
A occurs_check "occurs_check"
A octet "octet"
A off "off"
A on "on"
A open "open"
A operator "operator"
A operator_priority "operator_priority"
A operator_specifier "operator_specifier"
A optimise "optimise"
A or "\\/"
A order "order"
A output "output"
A pair "pair"
A paren "paren"
A parent "parent"
A parent_goal "parent_goal"
A partial "partial"
A past "past"
A past_end_of_stream "past_end_of_stream"
A pattern "pattern"
A pc "pc"
A period "period"
A permission_error "permission_error"
A pi "pi"
A pipe "pipe"
A plain "plain"
A plus "+"
A popcount "popcount"
A portray "portray"
A position "position"
A posix "posix"
A powm "powm"
A predicate_indicator "predicate_indicator"
A predicates "predicates"
A print "print"
A print_message "print_message"
A priority "priority"
A private_procedure "private_procedure"
A procedure "procedure"
A profile_mode "profile_mode"
A profile_no_cpu_time "profile_no_cpu_time"
A profile_node "profile_node"
A program "program"
A program_counter "program_counter"
A prolog "prolog"
A prompt "|:"
A property "property"
A protocol "protocol"
A prove ":-"
A punct "punct"
A query "?-"
A question_mark "?"
A queue_option "queue_option"
A quiet "quiet"
A quote "quote"
A quoted "quoted"
A radix "radix"
A random "random"
A random_option "random_option"
A rational "rational"
A rationalize "rationalize"
A rdiv "rdiv"
A read "read"
A read_option "read_option"
A readline "readline"
A real_time "real_time"
A receiver "receiver"
A record "record"
A record_position "record_position"
A redefine "redefine"
A redo "redo"
A references "references"
A rem "rem"
A rename "rename"
A report_error "report_error"
A reposition "reposition"
A representation_error "representation_error"
A representation_errors "representation_errors"
A reset "reset"
A resource_error "resource_error"
A resource_handle "resource_handle"
A retry "retry"
A round "round"
A rshift ">>"
A running "running"
A runtime "runtime"
A save_class "save_class"
A save_option "save_option"
A seed "seed"
A seek_method "seek_method"
A select "select"
A semicolon ";"
A separated "separated"
A set "set"
A setup_call_catcher_cleanup "setup_call_catcher_cleanup"
A shared "shared"
A shared_object "shared_object"
A shared_object_handle "shared_object_handle"
A shell "shell"
A sign "sign"
A signal "signal"
A signal_handler "signal_handler"
A silent "silent"
A sin "sin"
A singletons "singletons"
A size "size"
A skip "skip"
A smaller "<"
A smaller_equal "=<"
A softcut "*->"
A source_sink "source_sink"
A space "space"
A spy "spy"
A sqrt "sqrt"
A stack "stack"
A stack_parameter "stack_parameter"
A stack_shifts "stack_shifts"
A stacks "stacks"
A stand_alone "stand_alone"
A star "*"
A start "start"
A stat "stat"
A static_procedure "static_procedure"
A statistics "statistics"
A status "status"
A stderr "stderr"
A stream "stream"
A stream_option "stream_option"
A stream_or_alias "stream_or_alias"
A stream_position "$stream_position"
A stream_property "stream_property"
A strict_equal "=="
A string "string"
A string_position "string_position"
A subterm_positions "subterm_positions"
A suffix "suffix"
A syntax_error "syntax_error"
A syntax_errors "syntax_errors"
A system "system"
A system_error "system_error"
A system_init_file "system_init_file"
A system_thread_id "system_thread_id"
A system_time "system_time"
A tan "tan"
A term "term"
A term_expansion "term_expansion"
A term_position "term_position"
A terminal "terminal"
A terminal_capability "terminal_capability"
A text "text"
A thread "thread"
A thread_cputime "thread_cputime"
A thread_initialization "thread_initialization"
A thread_local "thread_local"
A thread_local_procedure "thread_local_procedure"
A thread_option "thread_option"
A thread_property "thread_property"
A threads "threads"
A threads_created "threads_created"
A throw "throw"
A tilde "~"
A time "time"
A time_stamp "time_stamp"
A timeout "timeout"
A timeout_error "timeout_error"
A timezone "timezone"
A to_lower "to_lower"
A to_upper "to_upper"
A top "top"
A top_level "top_level"
A toplevel "toplevel"
A trace "trace"
A trace_any "trace_any"
A trace_call "trace_call"
A trace_exit "trace_exit"
A trace_fail "trace_fail"
A trace_gc "trace_gc"
A trace_redo "trace_redo"
A traceinterc "prolog_trace_interception"
A tracing "tracing"
A trail "trail"
A trail_shifts "trail_shifts"
A traillimit "traillimit"
A trailused "trailused"
A transparent "transparent"
A transposed_char "transposed_char"
A transposed_word "transposed_word"
A true "true"
A truncate "truncate"
A tty "tty"
A tty_control "tty_control"
A type "type"
A type_error "type_error"
A undefined "undefined"
A undefined_global_variable "undefined_global_variable"
A undefinterc "$undefined_procedure"
A unicode_be "unicode_be"
A unicode_le "unicode_le"
A unify "unify"
A unique "unique"
A univ "=.."
A unknown "unknown"
A unlimited "unlimited"
A unlock "unlock"
A unlocked "unlocked"
A update "update"
A upper "upper"
A user "user"
A user_error "user_error"
A user_input "user_input"
A user_output "user_output"
A utc "UTC"
A utf8 "utf8"
A v "v"
A var "$VAR$"
A variable "variable"
A variable_names "variable_names"
A variables "variables"
A very_deep "very_deep"
A vmi "vmi"
A volatile "volatile"
A wakeup "wakeup"
A warning "warning"
A wchar_t "wchar_t"
A white "white"
A write "write"
A write_attributes "write_attributes"
A write_option "write_option"
A xdigit "xdigit"
A xf "xf"
A xfx "xfx"
A xfy "xfy"
A xml "xml"
A xor "xor"
A xpceref "@"
A yf "yf"
A yfx "yfx"
A yfy "yfy"
A zero_divisor "zero_divisor"
F abs 1
F access 1
F acos 1
F alias 1
F and 2
F ar_equals 2
F ar_not_equal 2
F asin 1
F assert 1
F asserta 1
F atan 1
F atan 2
F atom 1
F att 3
F backslash 1
F bar 2
F block 3
F bom 1
F brace_term_position 3
F break 1
F break 2
F break 3
F buffer 1
F buffer_size 1
F busy 2
F call 1
F callpred 2
F catch 3
F ceil 1
F ceiling 1
F chars 1
F chars 2
F clause 1
F close_on_abort 1
F codes 1
F codes 2
F colon 2
F comma 2
F context 2
F cos 1
F cputime 0
F curl 1
F cut_call 1
F cut_exit 1
F date 9
F dcall 1
F dcut 1
F dde_error 2
F debugging 1
F detached 1
F dexit 2
F dforeign_registered 2
F dgarbage_collect 1
F div 2
F divide 2
F dmessage_queue 1
F dmutex 1
F domain_error 2
F dot 2
F doublestar 2
F dprof_node 1
F dstream 1
F dthread_init 0
F dthrow 1
F dtime 2
F dwakeup 1
F e 0
F encoding 1
F end_of_stream 1
F eof_action 1
F equals 2
F erased 1
F error 2
F eval 1
F evaluation_error 1
F exception 1
F exception 3
F existence_error 2
F exited 1
F exp 1
F exports 1
F fail 0
F failure_error 1
F file 1
F file 4
F file_name 1
F file_no 1
F float 1
F float_fractional_part 1
F float_integer_part 1
F floor 1
F foreign_function 1
F frame 3
F frame_finished 1
F goal_expansion 2
F hat 2
F ifthen 2
F input 0
F integer 1
F interrupt 1
F io_error 2
F is 2
F isovar 1
F larger 2
F larger_equal 2
F line_count 1
F list_position 4
F listing 1
F locked 2
F log 1
F log10 1
F lsb 1
F lshift 2
F nlink 1
F max 2
F max_size 1
F message_lines 1
F min 2
F minus 1
F minus 2
F mod 2
F mode 1
F msb 1
F newline 1
F not_implemented 2
F not_provable 1
F occurs_check 2
F or 2
F output 0
F permission_error 3
F pi 0
F pipe 1
F plus 1
F plus 2
F popcount 1
F portray 1
F position 1
F powm 3
F print 1
F print_message 2
F procedure 2
F prove 1
F prove 2
F punct 2
F random 1
F rational 1
F rationalize 1
F rdiv 2
F rem 2
F reposition 1
F representation_error 1
F representation_errors 1
F resource_error 1
F retry 1
F round 1
F rshift 2
F semicolon 2
F setup_call_catcher_cleanup 4
F shared_object 2
F shell 2
F sign 1
F signal 1
F signal 2
F sin 1
F singletons 1
F size 1
F smaller 2
F smaller_equal 2
F softcut 2
F spy 1
F sqrt 1
F star 2
F status 1
F stream 4
F stream_position 4
F string 1
F string 2
F string_position 2
F syntax_error 1
F syntax_error 3
F tan 1
F term_expansion 2
F term_position 5
F timeout 1
F timeout_error 2
F trace 1
F traceinterc 3
F tracing 1
F true 0
F truncate 1
F tty 1
F type 1
F type_error 2
F undefinterc 4
F var 1
F wakeup 3
F warning 3
F xor 2
F xpceref 1
F dc_call_prolog 0
F strict_equal 2

View File

@ -338,3 +338,7 @@ ADDR foreign_code_base ForeignCodeBase =NULL void
ADDR foreign_code_top ForeignCodeTop =NULL void
ADDR foreign_code_max ForeignCodeMax =NULL void
/* SWI atoms and functors */
Atom swi_atoms[N_SWI_ATOMS] SWI_Atoms InitSWIAtoms() RestoreSWIAtoms()
Functor swi_functors[N_SWI_FUNCTORS] SWI_Functors void void
struct swi_reverse_hash swi_reverse_hash[N_SWI_HASH] SWI_ReverseHash void void

865
misc/SWIATOMS Normal file
View File

@ -0,0 +1,865 @@
# Definition table of atoms functors used somewhere in the C-code.
# format:
#
# A <name> <string>: --> #define ATOM_<name> into <string>
# F <name> <arity> --> #define FUNCTOR_<name><arity>
# (A name should exist as well)
#
# This file is processed using defatom, compiled from defatom.c to
# produce pl-atom.ic, pl-atom.ih, pl-funct.ic and pl-funct.ih.
A abort "abort"
A aborted "$aborted"
A abs "abs"
A access "access"
A acos "acos"
A acyclic_term "acyclic_term"
A add_import "add_import"
A address "address"
A agc "agc"
A agc_gained "agc_gained"
A agc_margin "agc_margin"
A agc_time "agc_time"
A alias "alias"
A allow_variable_name_as_functor "allow_variable_name_as_functor"
A alnum "alnum"
A alpha "alpha"
A alternative "alternative"
A and "/\\"
A anonvar "_"
A append "append"
A ar_equals "=:="
A ar_not_equal "=\\="
A argument "argument"
A argumentlimit "argumentlimit"
A as "as"
A ascii "ascii"
A asin "asin"
A assert "assert"
A asserta "asserta"
A at "at"
A at_equals "=@="
A at_exit "at_exit"
A at_larger "@>"
A at_larger_eq "@>="
A at_not_equals "\\=@="
A at_smaller "@<"
A at_smaller_eq "@=<"
A atan "atan"
A atom "atom"
A atom_garbage_collection "atom_garbage_collection"
A atomic "atomic"
A atoms "atoms"
A att "att"
A attributes "attributes"
A attvar "attvar"
A autoload "autoload"
A backquoted_string "backquoted_string"
A backslash "\\"
A backtrace "backtrace"
A bar "|"
A begin "begin"
A binary "binary"
A bind "bind"
A bitor "\\/"
A bof "bof"
A bom "bom"
A bool "bool"
A boolean "boolean"
A brace_term_position "brace_term_position"
A break "break"
A btree "btree"
A buffer "buffer"
A buffer_size "buffer_size"
A built_in_procedure "built_in_procedure"
A busy "busy"
A bw_xor "><"
A byte "byte"
A call "call"
A callable "callable"
A callpred "$callpred"
A canceled "canceled"
A case_sensitive_file_names "case_sensitive_file_names"
A catch "catch"
A ceil "ceil"
A ceiling "ceiling"
A char_type "char_type"
A character "character"
A character_code "character_code"
A character_escapes "character_escapes"
A chars "chars"
A chdir "chdir"
A chmod "chmod"
A choice "choice"
A clause "clause"
A clause_reference "clause_reference"
A close "close"
A close_on_abort "close_on_abort"
A close_option "close_option"
A cm "cm"
A cntrl "cntrl"
A co "co"
A codes "codes"
A collected "collected"
A collections "collections"
A colon ":"
A comma ","
A comments "comments"
A compound "compound"
A context "context"
A context_module "context_module"
A continue "continue"
A core "core"
A core_left "core_left"
A cos "cos"
A cputime "cputime"
A create "create"
A csym "csym"
A csymf "csymf"
A cumulative "cumulative"
A curl "{}"
A current "current"
A current_input "current_input"
A current_output "current_output"
A cut "!"
A cut_call "cut_call"
A cut_exit "cut_exit"
A cut_parent "cut_parent"
A cutted "cut"
A cyclic_term "cyclic_term"
A dand "$and"
A date "date"
A db_reference "db_reference"
A dc_call_prolog "$c_call_prolog"
A dcall "<meta-call>"
A dcall_cleanup "$call_cleanup"
A dcatch "$catch"
A dcut "$cut"
A dde_error "dde_error"
A dde_handle "dde_handle"
A debug "debug"
A debug_on_error "debug_on_error"
A debugger_print_options "debugger_print_options"
A debugger_show_context "debugger_show_context"
A debugging "debugging"
A dec10 "dec10"
A default "default"
A defined "defined"
A delete "delete"
A depth_limit_exceeded "depth_limit_exceeded"
A destroy "destroy"
A detached "detached"
A detect "detect"
A development "development"
A dexit "$exit"
A dforeign_registered "$foreign_registered"
A dgarbage_collect "$garbage_collect"
A digit "digit"
A directory "directory"
A discontiguous "discontiguous"
A div "//"
A divide "/"
A dload "$load"
A dmessage_queue "$message_queue"
A dmutex "$mutex"
A domain_error "domain_error"
A dos "dos"
A dot "."
A dots "dots"
A double_quotes "double_quotes"
A doublestar "**"
A dprof_node "$profile_node"
A drecover_and_rethrow "$recover_and_rethrow"
A dstream "$stream"
A dthread_init "$thread_init"
A dthrow "$throw"
A dtime "$time"
A dvard "$VAR$"
A dwakeup "$wakeup"
A dynamic "dynamic"
A e "e"
A encoding "encoding"
A end "end"
A end_of_file "end_of_file"
A end_of_line "end_of_line"
A end_of_stream "end_of_stream"
A environment "environment"
A eof "eof"
A eof_action "eof_action"
A eof_code "eof_code"
A epsilon "epsilon"
A equal "equal"
A equals "="
A erase "erase"
A erased "erased"
A error "error"
A eval "eval"
A evaluable "evaluable"
A evaluation_error "evaluation_error"
A exception "exception"
A exclusive "exclusive"
A execute "execute"
A exist "exist"
A existence_error "existence_error"
A exit "exit"
A exited "exited"
A exp "exp"
A export "export"
A exported "exported"
A exports "exports"
A expression "expression"
A external_exception "external_exception"
A externals "externals"
A fact "fact"
A factor "factor"
A fail "fail"
A failure_error "failure_error"
A false "false"
A feature "feature"
A file "file"
A file_name "file_name"
A file_name_variables "file_name_variables"
A file_no "file_no"
A flag "flag"
A flag_value "flag_value"
A float "float"
A float_format "float_format"
A float_fractional_part "float_fractional_part"
A float_integer_part "float_integer_part"
A float_overflow "float_overflow"
A float_underflow "float_underflow"
A floor "floor"
A force "force"
A foreign "foreign"
A foreign_function "$foreign_function"
A foreign_return_value "foreign_return_value"
A fork "fork"
A frame "frame"
A frame_attribute "frame_attribute"
A frame_finished "frame_finished"
A frame_reference "frame_reference"
A free_of_attvar "free_of_attvar"
A freeze "freeze"
A full "full"
A functor_name "functor_name"
A functors "functors"
A fx "fx"
A fy "fy"
A garbage_collected "<garbage_collected>"
A garbage_collection "garbage_collection"
A gc "gc"
A gcd "gcd"
A gctime "gctime"
A getcwd "getcwd"
A global "global"
A global_shifts "global_shifts"
A global_stack "global_stack"
A globallimit "globallimit"
A globalused "globalused"
A goal "goal"
A goal_expansion "goal_expansion"
A grammar "-->"
A graph "graph"
A ground "ground"
A gvar "gvar"
A halt "halt"
A has_alternatives "has_alternatives"
A hash "hash"
A hashed "hashed"
A hat "^"
A heap "heap"
A heaplimit "heaplimit"
A heapused "heapused"
A help "help"
A hidden "hidden"
A hide_childs "hide_childs"
A history_depth "history_depth"
A ifthen "->"
A ignore "ignore"
A ignore_ops "ignore_ops"
A imported "imported"
A imported_procedure "imported_procedure"
A index "index"
A indexed "indexed"
A inf "inf"
A inferences "inferences"
A infinite "infinite"
A informational "informational"
A init_file "init_file"
A initialization "initialization"
A input "input"
A inserted_char "inserted_char"
A instantiation_error "instantiation_error"
A int "int"
A int64_t "int64_t"
A int_overflow "int_overflow"
A integer "integer"
A integer_expression "integer_expression"
A interrupt "interrupt"
A io_error "io_error"
A io_mode "io_mode"
A ioctl "ioctl"
A is "is"
A iso "iso"
A iso_latin_1 "iso_latin_1"
A isovar "$VAR"
A join "join"
A jump "jump"
A kernel "kernel"
A key "key"
A larger ">"
A larger_equal ">="
A level "level"
A li "li"
A limit "limit"
A line "line"
A line_count "line_count"
A list "list"
A list_position "list_position"
A listing "listing"
A local "local"
A local_shifts "local_shifts"
A local_stack "local_stack"
A locale "locale"
A locallimit "locallimit"
A localused "localused"
A lock "lock"
A locked "locked"
A log "log"
A log10 "log10"
A long "long"
A low "low"
A lower "lower"
A lsb "lsb"
A lshift "<<"
A main "main"
A mark "mark"
A matches "matches"
A max "max"
A max_arity "max_arity"
A max_dde_handles "max_dde_handles"
A max_depth "max_depth"
A max_files "max_files"
A max_frame_size "max_frame_size"
A max_path_length "max_path_length"
A max_size "max_size"
A max_variable_length "max_variable_length"
A memory "memory"
A message "message"
A message_lines "message_lines"
A message_queue "message_queue"
A message_queue_property "message_queue_property"
A meta_argument "meta_argument"
A meta_argument_specifier "meta_argument_specifier"
A meta_predicate "meta_predicate"
A min "min"
A min_free "min_free"
A minus "-"
A mismatched_char "mismatched_char"
A mod "mod"
A mode "mode"
A modify "modify"
A module "module"
A module_property "module_property"
A module_transparent "module_transparent"
A modules "modules"
A msb "msb"
A multifile "multifile"
A mutex "mutex"
A mutex_option "mutex_option"
A mutex_property "mutex_property"
A natural "natural"
A newline "newline"
A next_argument "next_argument"
A nil "[]"
A nlink "nlink"
A no_memory "no_memory"
A nodebug "nodebug"
A non_empty_list "non_empty_list"
A none "none"
A nonvar "nonvar"
A noprofile "noprofile"
A normal "normal"
A not "not"
A not_equals "\\="
A not_implemented "not_implemented"
A not_less_than_one "not_less_than_one"
A not_less_than_zero "not_less_than_zero"
A not_provable "\\+"
A not_strickt_equals "\\=="
A not_unique "not_unique"
A number "number"
A number_of_clauses "number_of_clauses"
A numbervar_option "numbervar_option"
A numbervars "numbervars"
A occurs_check "occurs_check"
A octet "octet"
A off "off"
A on "on"
A open "open"
A operator "operator"
A operator_priority "operator_priority"
A operator_specifier "operator_specifier"
A optimise "optimise"
A or "or"
A order "order"
A output "output"
A pair "pair"
A paren "paren"
A parent "parent"
A parent_goal "parent_goal"
A partial "partial"
A past "past"
A past_end_of_stream "past_end_of_stream"
A pattern "pattern"
A pc "pc"
A period "period"
A permission_error "permission_error"
A pi "pi"
A pipe "pipe"
A plain "plain"
A plus "+"
A popcount "popcount"
A portray "portray"
A position "position"
A posix "posix"
A powm "powm"
A predicate_indicator "predicate_indicator"
A predicates "predicates"
A print "print"
A print_message "print_message"
A priority "priority"
A private_procedure "private_procedure"
A procedure "procedure"
A profile_mode "profile_mode"
A profile_no_cpu_time "profile_no_cpu_time"
A profile_node "profile_node"
A program "program"
A program_counter "program_counter"
A prolog "prolog"
A prolog_flag "prolog_flag"
A prolog_flag_access "prolog_flag_access"
A prolog_flag_option "prolog_flag_option"
A prolog_flag_type "prolog_flag_type"
A prompt "|:"
A property "property"
A protocol "protocol"
A prove ":-"
A punct "punct"
A query "?-"
A question_mark "?"
A queue_option "queue_option"
A quiet "quiet"
A quote "quote"
A quoted "quoted"
A radix "radix"
A random "random"
A random_option "random_option"
A rational "rational"
A rationalize "rationalize"
A rdiv "rdiv"
A read "read"
A read_only "read_only"
A read_option "read_option"
A read_write "read_write"
A readline "readline"
A real_time "real_time"
A receiver "receiver"
A record "record"
A record_position "record_position"
A redefine "redefine"
A redo "redo"
A references "references"
A rem "rem"
A rename "rename"
A report_error "report_error"
A reposition "reposition"
A representation_error "representation_error"
A representation_errors "representation_errors"
A reset "reset"
A resource_error "resource_error"
A resource_handle "resource_handle"
A retry "retry"
A round "round"
A rshift ">>"
A running "running"
A runtime "runtime"
A save_class "save_class"
A save_option "save_option"
A seed "seed"
A seek_method "seek_method"
A select "select"
A semicolon ";"
A separated "separated"
A set "set"
A setup_call_catcher_cleanup "setup_call_catcher_cleanup"
A shared "shared"
A shared_object "shared_object"
A shared_object_handle "shared_object_handle"
A shell "shell"
A sign "sign"
A signal "signal"
A signal_handler "signal_handler"
A silent "silent"
A sin "sin"
A singletons "singletons"
A size "size"
A size_t "size_t"
A skip "skip"
A smaller "<"
A smaller_equal "=<"
A softcut "*->"
A source_sink "source_sink"
A space "space"
A spacing "spacing"
A spare "spare"
A spy "spy"
A sqrt "sqrt"
A stack "stack"
A stack_parameter "stack_parameter"
A stack_shifts "stack_shifts"
A stacks "stacks"
A stand_alone "stand_alone"
A standard "standard"
A star "*"
A start "start"
A stat "stat"
A static_procedure "static_procedure"
A statistics "statistics"
A status "status"
A stderr "stderr"
A stream "stream"
A stream_option "stream_option"
A stream_or_alias "stream_or_alias"
A stream_pair "stream_pair"
A stream_position "$stream_position"
A stream_property "stream_property"
A strict_equal "=="
A string "string"
A string_position "string_position"
A subterm_positions "subterm_positions"
A suffix "suffix"
A syntax_error "syntax_error"
A syntax_errors "syntax_errors"
A system "system"
A system_error "system_error"
A system_init_file "system_init_file"
A system_thread_id "system_thread_id"
A system_time "system_time"
A tan "tan"
A temporary_files "temporary_files"
A term "term"
A term_expansion "term_expansion"
A term_position "term_position"
A terminal "terminal"
A terminal_capability "terminal_capability"
A text "text"
A thread "thread"
A thread_cputime "thread_cputime"
A thread_initialization "thread_initialization"
A thread_local "thread_local"
A thread_local_procedure "thread_local_procedure"
A thread_option "thread_option"
A thread_property "thread_property"
A threads "threads"
A threads_created "threads_created"
A throw "throw"
A tilde "~"
A time "time"
A time_stamp "time_stamp"
A timeout "timeout"
A timeout_error "timeout_error"
A timezone "timezone"
A to_lower "to_lower"
A to_upper "to_upper"
A top "top"
A top_level "top_level"
A toplevel "toplevel"
A trace "trace"
A trace_any "trace_any"
A trace_call "trace_call"
A trace_exit "trace_exit"
A trace_fail "trace_fail"
A trace_gc "trace_gc"
A trace_redo "trace_redo"
A traceinterc "prolog_trace_interception"
A tracing "tracing"
A trail "trail"
A trail_shifts "trail_shifts"
A traillimit "traillimit"
A trailused "trailused"
A transparent "transparent"
A transposed_char "transposed_char"
A transposed_word "transposed_word"
A true "true"
A truncate "truncate"
A tty "tty"
A tty_control "tty_control"
A type "type"
A type_error "type_error"
A undefined "undefined"
A undefined_global_variable "undefined_global_variable"
A undefinterc "$undefined_procedure"
A unicode_be "unicode_be"
A unicode_le "unicode_le"
A unify "unify"
A unify_determined "?="
A unique "unique"
A univ "=.."
A unknown "unknown"
A unlimited "unlimited"
A unload "unload"
A unlock "unlock"
A unlocked "unlocked"
A update "update"
A upper "upper"
A user "user"
A user_error "user_error"
A user_flags "user_flags"
A user_input "user_input"
A user_output "user_output"
A utc "UTC"
A utf8 "utf8"
A v "v"
A var "var"
A variable "variable"
A variable_names "variable_names"
A variables "variables"
A very_deep "very_deep"
A vmi "vmi"
A volatile "volatile"
A wakeup "wakeup"
A walltime "walltime"
A warning "warning"
A wchar_t "wchar_t"
A when_condition "when_condition"
A white "white"
A write "write"
A write_attributes "write_attributes"
A write_option "write_option"
A xdigit "xdigit"
A xf "xf"
A xfx "xfx"
A xfy "xfy"
A xml "xml"
A xor "xor"
A xpceref "@"
A yf "yf"
A yfx "yfx"
A yfy "yfy"
A zero_divisor "zero_divisor"
F abs 1
F access 1
F acos 1
F alias 1
F and 2
F ar_equals 2
F ar_not_equal 2
F asin 1
F assert 1
F asserta 1
F atan 1
F atan 2
F atom 1
F att 3
F backslash 1
F bar 2
F bitor 2
F bom 1
F brace_term_position 3
F break 1
F break 2
F break 3
F buffer 1
F buffer_size 1
F busy 2
F bw_xor 2
F call 1
F callpred 2
F catch 3
F ceil 1
F ceiling 1
F chars 1
F chars 2
F clause 1
F close_on_abort 1
F codes 1
F codes 2
F colon 2
F comma 2
F context 2
F cos 1
F cputime 0
F curl 1
F cut_call 1
F cut_exit 1
F dand 2
F date 3
F date 9
F dc_call_prolog 0
F dcall 1
F dcut 1
F dde_error 2
F debugging 1
F detached 1
F dexit 2
F dforeign_registered 2
F dgarbage_collect 1
F div 2
F divide 2
F dmessage_queue 1
F dmutex 1
F domain_error 2
F dot 2
F doublestar 2
F dprof_node 1
F drecover_and_rethrow 2
F dstream 1
F dthread_init 0
F dthrow 1
F dtime 2
F dvard 1
F dwakeup 1
F e 0
F encoding 1
F end_of_stream 1
F eof_action 1
F epsilon 0
F equals 2
F erased 1
F error 2
F eval 1
F evaluation_error 1
F exception 1
F exception 3
F existence_error 2
F exited 1
F exp 1
F exports 1
F external_exception 1
F fail 0
F failure_error 1
F file 1
F file 4
F file_name 1
F file_no 1
F float 1
F float_fractional_part 1
F float_integer_part 1
F floor 1
F foreign_function 1
F frame 3
F frame_finished 1
F gcd 2
F goal_expansion 2
F ground 1
F hat 2
F ifthen 2
F input 0
F integer 1
F interrupt 1
F io_error 2
F is 2
F isovar 1
F larger 2
F larger_equal 2
F line_count 1
F list_position 4
F listing 1
F locked 2
F log 1
F log10 1
F lsb 1
F lshift 2
F max 2
F max_size 1
F message_lines 1
F min 2
F minus 1
F minus 2
F mod 2
F mode 1
F msb 1
F newline 1
F nlink 1
F nonvar 1
F not_implemented 2
F not_provable 1
F occurs_check 2
F or 1
F output 0
F permission_error 3
F pi 0
F pipe 1
F plus 1
F plus 2
F popcount 1
F portray 1
F position 1
F powm 3
F print 1
F print_message 2
F procedure 2
F prove 1
F prove 2
F punct 2
F random 1
F rational 1
F rationalize 1
F rdiv 2
F rem 2
F reposition 1
F representation_error 1
F representation_errors 1
F resource_error 1
F retry 1
F round 1
F rshift 2
F semicolon 2
F setup_call_catcher_cleanup 4
F shared_object 2
F shell 2
F sign 1
F signal 1
F signal 2
F sin 1
F singletons 1
F size 1
F smaller 2
F smaller_equal 2
F softcut 2
F spy 1
F sqrt 1
F star 2
F status 1
F stream 4
F stream_position 4
F strict_equal 2
F string 1
F string 2
F string_position 2
F syntax_error 1
F syntax_error 3
F tan 1
F term_expansion 2
F term_position 5
F timeout 1
F timeout_error 2
F trace 1
F traceinterc 3
F tracing 1
F true 0
F truncate 1
F tty 1
F type 1
F type_error 2
F undefinterc 4
F unify_determined 2
F var 1
F wakeup 3
F warning 3
F xor 2
F xpceref 1

View File

@ -15,7 +15,6 @@ main :-
file_filter_with_init('misc/ATOMS','H/tatoms.h',gen_fields, Warning, ['tatoms.h']),
file_filter_with_init('misc/ATOMS','H/iatoms.h',gen_decl, Warning, ['iatoms.h']),
file_filter_with_init('misc/ATOMS','H/ratoms.h',gen_rcov, Warning, ['ratoms.h']).
% file_filter_with_init('misc/ATOMS','packages/PLStream/natoms.h', gen_swiatoms, Warning, ['natoms.h']).
warning('~n /* This file, ~a, was generated automatically by \"yap -L misc/buildatoms\"~n please do not update, update misc/ATOMS instead */~n~n').
@ -64,17 +63,3 @@ gen_decl(Inp,Out) :-
% split(Inp," ",["F",Name,Arity]), !,
% append([" Functor_",Name,Arity," = Yap_MkFunctor(Atom_",Name,",",Arity,");"],Out).
gen_swi(Inp,Out) :-
split(Inp," ",["A",Atom,String]), !,
append(["#define ATOM_",Atom," YAP_AtomToSWIAtom(Atom_",Atom,")"],Out).
gen_swi(Inp,Out) :-
split(Inp," ",["F",Name,Arity]), !,
append(["#define FUNCTOR_",Name,Arity," YAP_FunctorToSWIFunctor(Functor_",Name,Arity,")"],Out).

View File

@ -12,7 +12,11 @@ typedef int bool;
/* atom_t macro layer */
#define NULL_ATOM ((atom_t)0)
#if __YAP_PROLOG__
#include "dswiatoms.h"
#else
#include "atoms.h"
#endif
#if HAVE_STRING_H
#include <string.h>
#endif

View File

@ -345,67 +345,6 @@ between(I,M,J) :-
'$between_inf'(I1,J).
plus(X, Y, Z) :-
(
var(X)
->
(
integer(Y), integer(Z)
->
'$minus'(Z,Y,X)
;
'$plus_error'(X,Y,Z)
)
;
integer(X)
->
(
var(Y)
->
(
integer(Z)
->
'$minus'(Z,X,Y)
;
'$plus_error'(X,Y,Z)
)
;
integer(Y)
->
(
integer(Z)
->
'$minus'(Z,Y,X)
;
var(Z)
->
'$plus'(X,Y,Z)
;
'$plus_error'(X,Y,Z)
)
;
'$plus_error'(X,Y,Z)
)
;
'$plus_error'(X,Y,Z)
).
'$plus_error'(X,Y,Z) :-
nonvar(X),
\+ integer(X),
'$do_error'(type_error(integer, X),plus(X,Y,Z)).
'$plus_error'(X,Y,Z) :-
nonvar(Y),
\+ integer(Y),
'$do_error'(type_error(integer, Y),plus(X,Y,Z)).
'$plus_error'(X,Y,Z) :-
nonvar(Z),
\+ integer(Z),
'$do_error'(type_error(integer, Z),plus(X,Y,Z)).
'$plus_error'(X,Y,Z) :-
'$do_error'(instantiation_error,plus(X,Y,Z)).
% M and N nonnegative integers, N is the successor of M
succ(M,N) :-
(