2001-04-09 20:54:03 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* *
|
|
|
|
* YAP Prolog %W% %G% *
|
|
|
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
|
|
|
* *
|
|
|
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
|
|
|
* File: Yap.proto *
|
|
|
|
* mods: *
|
|
|
|
* comments: Function declarations for YAP *
|
2002-11-11 17:38:10 +00:00
|
|
|
* version: $Id: Yapproto.h,v 1.28 2002-11-11 17:37:58 vsc Exp $ *
|
2001-04-09 20:54:03 +01:00
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
/* prototype file for Yap */
|
|
|
|
|
|
|
|
#define STD_PROTO(F,A) F A
|
|
|
|
#define STATIC_PROTO(F,A) static F A
|
|
|
|
|
|
|
|
|
|
|
|
typedef Int (*CPredicate)(void);
|
|
|
|
|
|
|
|
typedef Int (*CmpPredicate)(Term, Term);
|
|
|
|
|
|
|
|
|
|
|
|
/* absmi.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Int STD_PROTO(_YAP_absmi,(int));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* adtdefs.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Term STD_PROTO(_YAP_ArrayToList,(Term *,int));
|
|
|
|
int STD_PROTO(_YAP_GetName,(char *,UInt,Term));
|
|
|
|
Term STD_PROTO(_YAP_GetValue,(Atom));
|
|
|
|
Atom STD_PROTO(_YAP_LookupAtom,(char *));
|
|
|
|
Atom STD_PROTO(_YAP_FullLookupAtom,(char *));
|
|
|
|
void STD_PROTO(_YAP_LookupAtomWithAddress,(char *,AtomEntry *));
|
|
|
|
Prop STD_PROTO(_YAP_NewPredPropByFunctor,(struct FunctorEntryStruct *, SMALLUNSGN));
|
|
|
|
Prop STD_PROTO(_YAP_NewPredPropByAtom,(struct AtomEntryStruct *, SMALLUNSGN));
|
|
|
|
Functor STD_PROTO(_YAP_UnlockedMkFunctor,(AtomEntry *,unsigned int));
|
|
|
|
Functor STD_PROTO(_YAP_MkFunctor,(Atom,unsigned int));
|
|
|
|
void STD_PROTO(_YAP_MkFunctorWithAddress,(Atom,unsigned int,FunctorEntry *));
|
|
|
|
void STD_PROTO(_YAP_PutValue,(Atom,Term));
|
|
|
|
void STD_PROTO(_YAP_ReleaseAtom,(Atom));
|
|
|
|
Term STD_PROTO(_YAP_StringToList,(char *));
|
|
|
|
Term STD_PROTO(_YAP_StringToListOfAtoms,(char *));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-10-17 01:05:29 +01:00
|
|
|
long STD_PROTO(_YAP_InitSlot,(Term));
|
2002-10-21 23:14:29 +01:00
|
|
|
long STD_PROTO(_YAP_NewSlots,(int));
|
2002-10-17 01:05:29 +01:00
|
|
|
Term STD_PROTO(_YAP_GetFromSlot,(long));
|
|
|
|
void STD_PROTO(_YAP_RecoverSlots,(int));
|
|
|
|
Term STD_PROTO(_YAP_GetFromSlot,(long));
|
|
|
|
Term *STD_PROTO(_YAP_AddressFromSlot,(long));
|
|
|
|
void STD_PROTO(_YAP_PutInSlot,(long, Term));
|
|
|
|
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
#if SFUNC
|
|
|
|
Term STD_PROTO(MkSFTerm,(Functor,int,Term *,Term));
|
|
|
|
CELL STD_PROTO(*ArgsOfSFTerm,(Term));
|
|
|
|
#endif
|
|
|
|
|
2002-11-11 17:38:10 +00:00
|
|
|
Prop STD_PROTO(_YAP_GetPredPropByAtom,(Atom, SMALLUNSGN));
|
|
|
|
Prop STD_PROTO(_YAP_GetPredPropByFunc,(Functor, SMALLUNSGN));
|
|
|
|
Prop STD_PROTO(_YAP_GetPredPropHavingLock,(Atom,unsigned int,SMALLUNSGN));
|
|
|
|
Prop STD_PROTO(_YAP_GetExpProp,(Atom,unsigned int));
|
|
|
|
Prop STD_PROTO(_YAP_GetExpPropHavingLock,(AtomEntry *,unsigned int));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-06-04 19:21:55 +01:00
|
|
|
/* agc.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_atom_gc, (void));
|
|
|
|
void STD_PROTO(_YAP_init_agc, (void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* alloc.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_SizeOfBlock,(CODEADDR));
|
|
|
|
void STD_PROTO(_YAP_FreeCodeSpace,(char *));
|
|
|
|
char *STD_PROTO(_YAP_AllocAtomSpace,(unsigned int));
|
|
|
|
char *STD_PROTO(_YAP_AllocCodeSpace,(unsigned int));
|
|
|
|
ADDR STD_PROTO(_YAP_AllocFromForeignArea,(Int));
|
|
|
|
int STD_PROTO(_YAP_ExtendWorkSpace,(Int));
|
|
|
|
void STD_PROTO(_YAP_FreeAtomSpace,(char *));
|
|
|
|
int STD_PROTO(_YAP_FreeWorkSpace, (void));
|
|
|
|
void STD_PROTO(_YAP_InitMemory,(int,int,int));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* amasm.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
OPCODE STD_PROTO(_YAP_opcode,(op_numbers));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* analyst.c */
|
|
|
|
#ifdef ANALYST
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitAnalystPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* ANALYST */
|
|
|
|
|
|
|
|
/* arrays.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitArrayPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* attvar.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Term STD_PROTO(_YAP_CurrentAttVars,(void));
|
|
|
|
void STD_PROTO(_YAP_InitAttVarPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* bb.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitBBPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* bignum.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitBigNums,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* c_interface.c */
|
2002-09-09 18:40:12 +01:00
|
|
|
Int STD_PROTO(YAP_Execute,(struct pred_entry *, CPredicate));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* cdmgr.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_addclause,(Term,CODEADDR,int,int));
|
|
|
|
Term STD_PROTO(_YAP_all_calls,(void));
|
|
|
|
Atom STD_PROTO(_YAP_ConsultingFile,(void));
|
|
|
|
Int STD_PROTO(_YAP_PredForCode,(CODEADDR, Atom *, Int *, SMALLUNSGN *));
|
|
|
|
void STD_PROTO(_YAP_InitCdMgr,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#if EMACS
|
|
|
|
int STD_PROTO(where_new_clause, (Prop, int));
|
|
|
|
#endif
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_init_consult,(int, char *));
|
|
|
|
void STD_PROTO(_YAP_end_consult,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* cmppreds.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_compare_terms,(Term,Term));
|
|
|
|
void STD_PROTO(_YAP_InitCmpPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* compiler.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
CODEADDR STD_PROTO(_YAP_cclause,(Term, int, int));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* computils.c */
|
|
|
|
|
|
|
|
/* corout.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitCoroutPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef COROUTINING
|
2002-11-11 17:38:10 +00:00
|
|
|
Term STD_PROTO(_YAP_ListOfWokenGoals,(void));
|
|
|
|
void STD_PROTO(_YAP_WakeUp,(CELL *));
|
|
|
|
void STD_PROTO(_YAP_mark_all_suspended_goals,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* dbase.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_DBTrailOverflow,(void));
|
|
|
|
CELL STD_PROTO(_YAP_EvalMasks,(Term,CELL *));
|
|
|
|
void STD_PROTO(_YAP_InitBackDB,(void));
|
|
|
|
void STD_PROTO(_YAP_InitDBPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* errors.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_exit,(int));
|
|
|
|
yamop *STD_PROTO(_YAP_Error,(yap_error_number,Term,char *msg, ...));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* eval.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitEval,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* exec.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Term STD_PROTO(_YAP_ExecuteCallMetaCall,(SMALLUNSGN mod));
|
|
|
|
void STD_PROTO(_YAP_InitExecFs,(void));
|
|
|
|
Int STD_PROTO(_YAP_JumpToEnv,(Term));
|
|
|
|
int STD_PROTO(_YAP_RunTopGoal,(Term));
|
|
|
|
Int STD_PROTO(_YAP_execute_goal,(Term, int, SMALLUNSGN));
|
|
|
|
int STD_PROTO(_YAP_exec_absmi,(int));
|
|
|
|
void STD_PROTO(_YAP_trust_last,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* grow.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Int STD_PROTO(_YAP_total_stack_shift_time,(void));
|
|
|
|
void STD_PROTO(_YAP_InitGrowPreds, (void));
|
|
|
|
int STD_PROTO(_YAP_growheap, (int));
|
|
|
|
int STD_PROTO(_YAP_growstack, (long));
|
|
|
|
int STD_PROTO(_YAP_growtrail, (long));
|
|
|
|
int STD_PROTO(_YAP_growglobal, (CELL **));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* heapgc.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Int STD_PROTO(_YAP_total_gc_time,(void));
|
|
|
|
void STD_PROTO(_YAP_init_gc,(void));
|
|
|
|
int STD_PROTO(_YAP_is_gc_verbose, (void));
|
|
|
|
int STD_PROTO(_YAP_gc, (Int, CELL *, yamop *));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* init.c */
|
|
|
|
#ifdef DEBUG
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_DebugPutc,(int,int));
|
|
|
|
void STD_PROTO(_YAP_DebugSetIFile,(char *));
|
|
|
|
void STD_PROTO(_YAP_DebugEndline,(void));
|
|
|
|
int STD_PROTO(_YAP_DebugGetc,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_IsOpType,(char *));
|
|
|
|
void STD_PROTO(_YAP_InitStacks,(int,int,int,int,int,int));
|
|
|
|
void STD_PROTO(_YAP_InitCPred,(char *, unsigned long int, CPredicate, int));
|
|
|
|
void STD_PROTO(_YAP_InitAsmPred,(char *, unsigned long int, int, CPredicate, int));
|
|
|
|
void STD_PROTO(_YAP_InitCmpPred,(char *, unsigned long int, CmpPredicate, CPredicate, int));
|
|
|
|
void STD_PROTO(_YAP_InitCPredBack,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,int));
|
|
|
|
void STD_PROTO(_YAP_InitYaamRegs,(void));
|
|
|
|
void STD_PROTO(_YAP_ReInitWallTime, (void));
|
|
|
|
int STD_PROTO(_YAP_OpDec,(int,char *,Atom));
|
|
|
|
|
|
|
|
/* inlines.c */
|
|
|
|
void STD_PROTO(_YAP_InitInlines,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* iopreds.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitPlIO,(void));
|
|
|
|
void STD_PROTO(_YAP_InitBackIO,(void));
|
|
|
|
void STD_PROTO(_YAP_InitIOPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* depth_lim.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitItDeepenPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* load_foreign.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitLoadForeign,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* mavar.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitMaVarCPreds,(void));
|
|
|
|
Term STD_PROTO(_YAP_NewTimedVar,(Term));
|
|
|
|
Term STD_PROTO(_YAP_NewEmptyTimedVar,(void));
|
|
|
|
Term STD_PROTO(_YAP_ReadTimedVar,(Term));
|
|
|
|
Term STD_PROTO(_YAP_UpdateTimedVar,(Term, Term));
|
|
|
|
|
|
|
|
/* modules.c */
|
|
|
|
SMALLUNSGN STD_PROTO(_YAP_LookupModule,(Term));
|
|
|
|
Term STD_PROTO(_YAP_Module_Name, (CODEADDR));
|
|
|
|
void STD_PROTO(_YAP_InitModules, (void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-02-11 20:46:41 +00:00
|
|
|
#if HAVE_MPI
|
|
|
|
/* mpi.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitMPI,(void));
|
2002-02-11 20:46:41 +00:00
|
|
|
#endif
|
|
|
|
|
2002-10-03 18:29:46 +01:00
|
|
|
#if HAVE_MPE
|
|
|
|
/* mpe.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitMPE,(void));
|
2002-10-03 18:29:46 +01:00
|
|
|
#endif
|
|
|
|
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
/* other.c */
|
|
|
|
Term STD_PROTO(_YAP_MkApplTerm,(Functor,unsigned int,Term *));
|
|
|
|
Term STD_PROTO(_YAP_MkNewApplTerm,(Functor,unsigned int));
|
|
|
|
Term STD_PROTO(_YAP_MkNewPairTerm,(void));
|
|
|
|
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* parser.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_IsPrefixOp,(Prop,int *,int *));
|
|
|
|
int STD_PROTO(_YAP_IsInfixOp,(Prop,int *,int *,int *));
|
|
|
|
int STD_PROTO(_YAP_IsPosfixOp,(Prop,int *,int *));
|
|
|
|
Term STD_PROTO(_YAP_Parse,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* save.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
int STD_PROTO(_YAP_SavedInfo,(char *,char *,CELL *,CELL *,CELL *));
|
|
|
|
int STD_PROTO(_YAP_Restore,(char *, char *));
|
|
|
|
void STD_PROTO(_YAP_InitSavePreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* scanner.c */
|
|
|
|
|
|
|
|
/* sort.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitSortPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* stdpreds.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitBackCPreds,(void));
|
|
|
|
void STD_PROTO(_YAP_InitCPreds,(void));
|
|
|
|
void STD_PROTO(_YAP_show_statistics,(void));
|
|
|
|
Int STD_PROTO(_YAP_creep,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* sysbits.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_set_fpu_exceptions,(int));
|
|
|
|
Int STD_PROTO(_YAP_cputime,(void));
|
|
|
|
Int STD_PROTO(_YAP_walltime,(void));
|
|
|
|
int STD_PROTO(_YAP_dir_separator,(int));
|
|
|
|
int STD_PROTO(_YAP_volume_header,(char *));
|
|
|
|
void STD_PROTO(_YAP_InitSysPath,(void));
|
|
|
|
#if MAC
|
|
|
|
void STD_PROTO(_YAP_SetTextFile,(char *));
|
|
|
|
#endif
|
|
|
|
void STD_PROTO(_YAP_cputime_interval,(Int *,Int *));
|
|
|
|
void STD_PROTO(_YAP_walltime_interval,(Int *,Int *));
|
|
|
|
void STD_PROTO(_YAP_InitSysbits,(void));
|
|
|
|
void STD_PROTO(_YAP_InitSysPreds,(void));
|
|
|
|
int STD_PROTO(_YAP_TrueFileName, (char *, char *, int));
|
|
|
|
int STD_PROTO(_YAP_ProcessSIGINT,(void));
|
|
|
|
double STD_PROTO(_YAP_random, (void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* tracer.c */
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitLowLevelTrace,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* unify.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitAbsmi,(void));
|
|
|
|
void STD_PROTO(_YAP_InitUnify,(void));
|
|
|
|
int STD_PROTO(_YAP_IUnify,(register CELL d0,register CELL d1));
|
|
|
|
op_numbers STD_PROTO(_YAP_op_from_opcode,(OPCODE));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* userpreds.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitUserCPreds,(void));
|
|
|
|
void STD_PROTO(_YAP_InitUserBacks,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* utilpreds.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
Term STD_PROTO(_YAP_CopyTerm,(Term));
|
|
|
|
void STD_PROTO(_YAP_InitUtilCPreds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* yap.c */
|
|
|
|
|
|
|
|
/* ypsocks.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_InitSockets,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef USE_SOCKET
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_init_socks,(char *, long));
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* opt.preds.c */
|
2002-11-11 17:38:10 +00:00
|
|
|
void STD_PROTO(_YAP_init_optyap_preds,(void));
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|