builtin.h

00001 /* File:      builtin.h
00002 ** Author(s): Warren, Xu, Swift, Sagonas, Freire, Rao
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 1999
00006 ** 
00007 ** XSB is free software; you can redistribute it and/or modify it under the
00008 ** terms of the GNU Library General Public License as published by the Free
00009 ** Software Foundation; either version 2 of the License, or (at your option)
00010 ** any later version.
00011 ** 
00012 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00013 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00015 ** more details.
00016 ** 
00017 ** You should have received a copy of the GNU Library General Public License
00018 ** along with XSB; if not, write to the Free Software Foundation,
00019 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 **
00021 ** $Id: builtin.h,v 1.73 2006/05/22 20:47:45 tswift Exp $
00022 ** 
00023 */
00024 
00025 #define BUILTIN_TBL_SZ 256
00026 
00027 /************************************************************************/
00028 /*      The following is the set of all primitive predicates.           */
00029 /************************************************************************/
00030 
00031 #define PSC_NAME         1
00032 #define PSC_ARITY        2
00033 #define PSC_TYPE         3
00034 #define PSC_PROP         4
00035 #define PSC_SET_TYPE     5
00036 #define PSC_SET_PROP     6
00037 #define PSC_SET_SPY      7
00038 #define PSC_EP           8
00039 #define PSC_SET_EP       9
00040 
00041 #define TERM_NEW_MOD    10
00042 #define TERM_PSC        11
00043 #define TERM_TYPE       12
00044 #define TERM_COMPARE    13
00045 #define TERM_NEW        14
00046 #define TERM_ARG        15
00047 #define TERM_SET_ARG    16
00048 #define STAT_FLAG       17
00049 #define STAT_SET_FLAG   18
00050 #define BUFF_ALLOC      19
00051 #define BUFF_WORD       20
00052 #define BUFF_SET_WORD   21
00053 #define BUFF_BYTE       22
00054 #define BUFF_SET_BYTE   23
00055 #define CODE_CALL       24
00056 
00057 #define STR_LEN         25
00058 #define SUBSTRING       26
00059 #define STR_CAT         27
00060 #define STR_CMP         28
00061 #define STRING_SUBSTITUTE 29
00062 #define STR_MATCH       30
00063 
00064 #define CALL0           31
00065 /* some other builtins that might need hard implementation */
00066 #define STAT_STA        32
00067 #define STAT_CPUTIME    33
00068 #define CODE_LOAD       34
00069 #define BUFF_SET_VAR    35
00070 #define BUFF_DEALLOC    36
00071 #define BUFF_CELL       37
00072 #define BUFF_SET_CELL   38
00073 #define COPY_TERM       39
00074 #define XWAM_STATE      40
00075 /* check for substring */
00076 #define DIRNAME_CANONIC 41
00077 /* for efficiency reasons, the following predicates are also implemented */
00078 #define PSC_INSERT      42
00079 #define PSC_IMPORT      43
00080 #define PSC_DATA        44
00081 
00082 #define PSC_INSERTMOD   46
00083 
00084 #define FILE_GETTOKEN   48
00085 #define FILE_PUTTOKEN   49
00086 #define TERM_HASH       50
00087 #define UNLOAD_SEG      51
00088 #define LOAD_OBJ        52
00089 
00090 #define WH_RANDOM       53
00091 
00092 #define GETENV                   54
00093 #define SYS_SYSCALL              55
00094 #define SYS_SYSTEM               56
00095 #define SYS_GETHOST              57
00096 #define SYS_ERRNO                58
00097 
00098 #define FILE_WRITEQUOTED         61
00099 #define GROUND                   62
00100 
00101 #define INTERN_STRING            65
00102 #define EXPAND_FILENAME          66
00103 #define TILDE_EXPAND_FILENAME    67
00104 #define IS_ABSOLUTE_FILENAME     68
00105 #define PARSE_FILENAME           69
00106 #define ALMOST_SEARCH_MODULE     70
00107 #define EXISTING_FILE_EXTENSION  71
00108 #define DO_ONCE                  72
00109 
00110 /* for efficiency, implemented these in C */
00111 #define CONGET_TERM              75
00112 #define CONSET_TERM              76
00113 
00114 #define STORAGE_BUILTIN          77
00115 
00116 #define GET_DATE                 80
00117 #define STAT_WALLTIME            81
00118 
00119 #define PSC_GET_SET_ENV_BYTE     99
00120 #define PSC_ENV                 100
00121 #define PSC_SPY                 101
00122 #define PSC_TABLED              102
00123 #define PSC_SET_TABLED          103
00124 
00125 #define IS_INCOMPLETE           104
00126 
00127 #define GET_PTCP                107
00128 #define GET_PRODUCER_CALL       108
00129 #define DEREFERENCE_THE_BUCKET  109
00130 #define PAIR_PSC                110
00131 #define PAIR_NEXT               111
00132 #define NEXT_BUCKET             112
00133 
00134 #define SLG_NOT                 114
00135 #define LRD_SUCCESS             115
00136 
00137 #define IS_XWAMMODE             117
00138 #define CLOSE_OPEN_TABLES       118
00139 
00140 #define FILE_FUNCTION           123
00141 #define SLASH_BUILTIN           124
00142 
00143 #define ABOLISH_TABLE_INFO      126
00144 #define ZERO_OUT_PROFILE        127
00145 #define WRITE_OUT_PROFILE       128
00146 #define ASSERT_CODE_TO_BUFF     129
00147 #define ASSERT_BUFF_TO_CLREF    130
00148 
00149 #define FILE_READ_CANONICAL     133
00150 #define GEN_RETRACT_ALL         134
00151 
00152 #define DB_GET_LAST_CLAUSE      135
00153 #define DB_RETRACT0             136
00154 #define DB_GET_CLAUSE           137
00155 #define DB_BUILD_PRREF          138
00156 #define DB_ABOLISH0             139
00157 #define DB_RECLAIM0             140
00158 #define DB_GET_PRREF            141
00159 
00160 #define FORMATTED_IO            142
00161 #define TABLE_STATUS            143
00162 #define GET_DELAY_LISTS         144
00163 #define ABOLISH_TABLE_CALL      145
00164 #define ABOLISH_TABLE_PREDICATE 146
00165 #define TRIE_ASSERT             147
00166 #define TRIE_RETRACT            148
00167 #define TRIE_DELETE_RETURN      149
00168 #define TRIE_GET_RETURN         150
00169 #define TRIE_UNIFY_CALL         151     /* get_calls/1 */
00170 #define GET_LASTNODE_CS_RETSKEL 152
00171 #define TRIE_GET_CALL           153     /* get_call/3 */
00172 #define BREG_RETSKEL            154
00173 #define TRIE_RETRACT_SAFE       155
00174 #define ABOLISH_MODULE_TABLES   156
00175 #define TRIE_ASSERT_HDR_INFO    157
00176 
00177 #define TRIMCORE                158
00178 #define NEWTRIE                 159
00179 #define TRIE_INTERN             160
00180 #define TRIE_INTERNED           161
00181 #define TRIE_DISPOSE            162
00182 #define BOTTOM_UP_UNIFY         163
00183 #define DELETE_TRIE             164
00184 #define TRIE_DISPOSE_NR         165
00185 #define TRIE_UNDISPOSE          166
00186 #define RECLAIM_UNINTERNED_NR   167
00187 #define GLOBALVAR               168
00188 
00189 #define SET_TABLED_EVAL         170
00190 
00191 #define UNIFY_WITH_OCCURS_CHECK  171
00192 #define PUT_ATTRIBUTES          172
00193 #define GET_ATTRIBUTES          173
00194 #define DELETE_ATTRIBUTES       174
00195 #define ATTV_UNIFY              175
00196 
00197 /* This is the builtin where people should put their private, experimental
00198    builtin code. SEE THE EXAMPLE IN private_builtin.c to UNDERSTAND HOW TO DO
00199    IT. Note: even though this is a single builtin, YOU CAN SIMULATE ANY NUMBER
00200    OF BUILTINS WITH IT.  */
00201 #define PRIVATE_BUILTIN         180
00202 
00203 #define SEGFAULT_HANDLER        182
00204 
00205 #define FLOAT_OP        188
00206 #define IS_ATTV                 189 /* similar to IS_LIST */
00207 #define VAR             190
00208 #define NONVAR                  191
00209 #define ATOM                    192
00210 #define INTEGER                 193
00211 #define REAL                    194
00212 #define NUMBER                  195
00213 #define ATOMIC                  196
00214 #define COMPOUND                197
00215 #define CALLABLE                198
00216 #define IS_LIST                 199
00217 #define FUNCTOR                 200
00218 #define ARG                     201
00219 #define UNIV                    202
00220 #define IS_MOST_GENERAL_TERM    203
00221 
00222 #define HiLog_ARG               204
00223 #define HiLog_UNIV              205
00224 
00225 #define ATOM_CODES              207
00226 #define ATOM_CHARS              208
00227 #define NUMBER_CHARS            209
00228 #define PUT                     210
00229 #define TAB                     211
00230 #define NUMBER_CODES            212
00231 #define IS_CHARLIST             213
00232 #define NUMBER_DIGITS           214
00233 
00234 #define SORT                    220
00235 #define KEYSORT                 221
00236 #define PARSORT                 222
00237 
00238 #define DYNAMIC_CODE_FUNCTION   223
00239 
00240 #define FINDALL_FREE            229
00241 
00242 #define ORACLE_QUERY            230
00243 #define ODBC_EXEC_QUERY         231
00244 
00245 #define SET_SCOPE_MARKER        232
00246 #define UNWIND_STACK            233
00247 #define CLEAN_UP_BLOCK          234
00248 
00249 #define THREAD_REQUEST          235
00250 #define MT_RANDOM_REQUEST       236
00251 
00252 /* added by dsw to support profiling, and backtracing */
00253 #define XSB_PROFILE             237
00254 #define XSB_BACKTRACE           238
00255 
00256 /* added by TLS Power function */
00257 #define XSB_POW                 239
00258 
00259 /* added by Bart Demoen & Kostis Sagonas for debugging and convenience */
00260 #define PRINT_LS                240
00261 #define PRINT_TR                241
00262 #define PRINT_HEAP              242
00263 #define PRINT_CP                243
00264 #define PRINT_REGS              244
00265 #define PRINT_ALL_STACKS        245
00266 
00267 #define EXP_HEAP                246
00268 #define MARK_HEAP               247
00269 #define GC_STUFF                248
00270 #define FINDALL_INIT            249
00271 #define FINDALL_ADD             250
00272 #define FINDALL_GET_SOLS        251
00273 #define SOCKET_REQUEST          252
00274 #define JAVA_INTERRUPT          253
00275 #define FORCE_TRUTH_VALUE       254
00276 
00277 /* This hook is for Interprolog */
00278 #define INTERPROLOG_CALLBACK    255
00279 
00280 /* cons for jumpcof calls */
00281 #define ATOM_TEST               1
00282 #define INTEGER_TEST            2
00283 #define REAL_TEST               3
00284 #define NUMBER_TEST             4
00285 #define ATOMIC_TEST             5
00286 #define COMPOUND_TEST           6
00287 #define CALLABLE_TEST           7
00288 #define IS_LIST_TEST            8
00289 #define IS_MOST_GENERAL_TERM_TEST 9
00290 #define IS_ATTV_TEST            10
00291 #define VAR_TEST                11
00292 #define NONVAR_TEST             12
00293 
00294 #define PLUS_FUNCT 1
00295 #define MINUS_FUNCT 2
00296 #define TIMES_FUNCT 3
00297 #define DIV_FUNCT 4
00298 #define BITAND_FUNCT 5
00299 #define BITOR_FUNCT 6
00300 
00301 #define BITNOT_FUNCT 7
00302 #define IDIV_FUNCT 8
00303 
00304 #define SIN_FUNCT 9
00305 #define COS_FUNCT 10
00306 #define TAN_FUNCT 11
00307 
00308 #define FLOAT_FUNCT 13
00309 #define FLOOR_FUNCT 14
00310 #define EXP_FUNCT 15
00311 #define LOG_FUNCT 16
00312 #define LOG10_FUNCT 17
00313 #define SQRT_FUNCT 18
00314 #define ASIN_FUNCT 19
00315 #define ACOS_FUNCT 20
00316 #define ATAN_FUNCT 21
00317 #define ABS_FUNCT 22
00318 #define TRUNC_FUNCT 23
00319 #define ROUND_FUNCT 24
00320 #define CEIL_FUNCT 25
00321 
00322 #define BITSHIFTL_FUNCT 26
00323 #define BITSHIFTR_FUNCT 27
00324 #define UMINUS_FUNCT 28
00325 

Generated on Wed Jul 26 13:30:38 2006 for XSB by  doxygen 1.4.5