some fixes in info

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@507 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-06-01 04:29:01 +00:00
parent c80ac669de
commit c5e66af5d1
12 changed files with 2287 additions and 2452 deletions

View File

@ -1,116 +1,112 @@
/************************************************************************* /*************************************************************************
* * * *
* YAP Prolog %W% %G% * YAP Prolog %W% %G%
* * * *
* Yap Prolog was developed at NCCUP - Universidade do Porto * * Yap Prolog was developed at NCCUP - Universidade do Porto *
* * * *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * * Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* * * *
************************************************************************** **************************************************************************
* * * *
* File: Atoms.h.m4 * * File: Atoms.h.m4 *
* Last rev: 19/2/88 * * Last rev: 19/2/88 *
* mods: * * mods: *
* comments: atom properties header file for YAP * * comments: atom properties header file for YAP *
* * * *
*************************************************************************/ *************************************************************************/
#undef EXTERN #undef EXTERN
#ifndef ADTDEFS_C #ifndef ADTDEFS_C
#define EXTERN static #define EXTERN static
#else #else
#define EXTERN #define EXTERN
#endif #endif
/********* operations for atoms ****************************************/ /********* operations for atoms ****************************************/
/* Atoms are assumed to be uniquely represented by an OFFSET and to have /* Atoms are assumed to be uniquely represented by an OFFSET and to have
associated with them a struct of type AtomEntry associated with them a struct of type AtomEntry
The two functions The two functions
RepAtom : Atom -> *AtomEntry RepAtom : Atom -> *AtomEntry
AbsAtom : *AtomEntry -> Atom AbsAtom : *AtomEntry -> Atom
are used to encapsulate the implementation of atoms are used to encapsulate the implementation of atoms
*/ */
typedef struct AtomEntryStruct *Atom; typedef struct AtomEntryStruct *Atom;
typedef struct PropEntryStruct *Prop; typedef struct PropEntryStruct *Prop;
/* I can only define the structure after I define the actual atoms */ /* I can only define the structure after I define the actual atoms */
/* atom structure */ /* atom structure */
typedef struct AtomEntryStruct typedef struct AtomEntryStruct {
{ Atom NextOfAE; /* used to build hash chains */
Atom NextOfAE; /* used to build hash chains */ Prop PropsOfAE; /* property list for this atom */
Prop PropsOfAE; /* property list for this atom */ #if defined(YAPOR) || defined(THREADS)
#if defined(YAPOR) || defined(THREADS) rwlock_t ARWLock;
rwlock_t ARWLock; #endif
#endif
char StrOfAE[MIN_ARRAY]; /* representation of atom as a string */
char StrOfAE[MIN_ARRAY]; /* representation of atom as a string */ }
} AtomEntry;
AtomEntry;
/* Props and Atoms are stored in chains, ending with a NIL */
/* Props and Atoms are stored in chains, ending with a NIL */ #if USE_OFFSETS
#if USE_OFFSETS # define EndOfPAEntr(P) ( Addr(P) == AtomBase)
# define EndOfPAEntr(P) ( Addr(P) == AtomBase) #else
#else # define EndOfPAEntr(P) ( Addr(P) == NIL )
# define EndOfPAEntr(P) ( Addr(P) == NIL ) #endif
#endif
#define AtomName(at) RepAtom(at)->StrOfAE
#define AtomName(at) RepAtom(at)->StrOfAE
/* ********************** Properties **********************************/
/* ********************** Properties **********************************/
#if USE_OFFSETS
#if USE_OFFSETS #define USE_OFFSETS_IN_PROPS 1
#define USE_OFFSETS_IN_PROPS 1 #else
#else #define USE_OFFSETS_IN_PROPS 0
#define USE_OFFSETS_IN_PROPS 0 #endif
#endif
typedef SFLAGS PropFlags;
typedef SFLAGS PropFlags;
/* basic property entry structure */
/* basic property entry structure */ typedef struct PropEntryStruct {
typedef struct PropEntryStruct Prop NextOfPE; /* used to chain properties */
{ PropFlags KindOfPE; /* kind of property */
Prop NextOfPE; /* used to chain properties */ } PropEntry;
PropFlags KindOfPE; /* kind of property */
} /* ************************* Functors **********************************/
PropEntry;
/* Functor data type
/* ************************* Functors **********************************/ abstype Functor = atom # int
with MkFunctor(a,n) = ...
/* Functor data type and NameOfFunctor(f) = ...
abstype Functor = atom # int and ArityOfFunctor(f) = ... */
with MkFunctor(a,n) = ...
and NameOfFunctor(f) = ... #define MaxArity 255
and ArityOfFunctor(f) = ... */
#define MaxArity 255 #define FunctorProperty ((PropFlags)(0xbb00))
/* functor property */
#define FunctorProperty ((PropFlags)(0xbb00)) typedef struct FunctorEntryStruct {
Prop NextOfPE; /* used to chain properties */
/* functor property */ PropFlags KindOfPE; /* kind of property */
typedef struct FunctorEntryStruct unsigned int ArityOfFE; /* arity of functor */
{ Atom NameOfFE; /* back pointer to owner atom */
Prop NextOfPE; /* used to chain properties */ Prop PropsOfFE; /* pointer to list of properties for this functor */
PropFlags KindOfPE; /* kind of property */ #if defined(YAPOR) || defined(THREADS)
unsigned int ArityOfFE; /* arity of functor */ rwlock_t FRWLock;
Atom NameOfFE; /* back pointer to owner atom */ #endif
Prop PropsOfFE; /* pointer to list of properties for this functor */ } FunctorEntry;
#if defined(YAPOR) || defined(THREADS)
rwlock_t FRWLock; typedef FunctorEntry *Functor;
#endif
}
FunctorEntry;
typedef FunctorEntry *Functor;

View File

@ -18,7 +18,7 @@
* Last rev: December 90 * * Last rev: December 90 *
* mods: * * mods: *
* comments: Tag Scheme for machines with 24 bits adresses (m68000) * * comments: Tag Scheme for machines with 24 bits adresses (m68000) *
* version: $Id: Tags_24bits.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ * * version: $Id: Tags_24bits.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/ *************************************************************************/
/* Version for 24 bit addresses (68000) /* Version for 24 bit addresses (68000)

View File

@ -18,7 +18,7 @@
* Last rev: December 90 * * Last rev: December 90 *
* mods: * * mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses * * comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_32LowTag.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ * * version: $Id: Tags_32LowTag.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#define TAG_LOW_BITS_32 1 #define TAG_LOW_BITS_32 1
@ -72,10 +72,10 @@ property list
#define NumberBits /* 0x0000000aL */ MKTAG(0x2,2) #define NumberBits /* 0x0000000aL */ MKTAG(0x2,2)
#define NumberMask /* 0x0000000bL */ MKTAG(0x2,3) #define NumberMask /* 0x0000000bL */ MKTAG(0x2,3)
#define NonTagPart(V) (Unsigned(V)>>(SHIFT_LOW_TAG+SHIFT_HIGH_TAG)) #define NonTagPart(V) ((Unsigned(V)>>1) & ~LowTagBits)
#define TAGGED(TAG,V) (((Unsigned(V)<<(SHIFT_HIGH_TAG+SHIFT_LOW_TAG+1))>>1)|(TAG)) #define TAGGED(TAG,V) (((Unsigned(V)<<(SHIFT_HIGH_TAG+SHIFT_LOW_TAG+1))>>1)|(TAG))
#define NONTAGGED(TAG,V) ((Unsigned(V)<<(SHIFT_HIGH_TAG+SHIFT_LOW_TAG+1))>>1) #define NONTAGGED(TAG,V) ((Unsigned(V)<<(SHIFT_HIGH_TAG+SHIFT_LOW_TAG+1))>>1)
#define TAGGEDA(TAG,V) ((Unsigned(V) << (SHIFT_HIGH_TAG+SHIFT_LOW_TAG))|(TAG)) #define TAGGEDA(TAG,V) ((Unsigned(V) << 1)|(TAG))
#define CHKTAG(t,Tag) ((Unsigned(t)&TagBits)==Tag) #define CHKTAG(t,Tag) ((Unsigned(t)&TagBits)==Tag)
/* bits that should not be used by anyone but us */ /* bits that should not be used by anyone but us */

View File

@ -18,7 +18,7 @@
* Last rev: December 90 * * Last rev: December 90 *
* mods: * * mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses * * comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_32Ops.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ * * version: $Id: Tags_32Ops.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/ *************************************************************************/
/* /*

View File

@ -18,7 +18,7 @@
* Last rev: December 90 * * Last rev: December 90 *
* mods: * * mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses * * comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_32bits.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ * * version: $Id: Tags_32bits.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/ *************************************************************************/
/* Original version for 32 bit addresses machines, /* Original version for 32 bit addresses machines,

View File

@ -18,7 +18,7 @@
* Last rev: December 90 * * Last rev: December 90 *
* mods: * * mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses * * comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_64bits.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ * * version: $Id: Tags_64bits.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#define TAG_64BITS 1 #define TAG_64BITS 1

View File

@ -17,7 +17,7 @@
* File: TermExt.h * * File: TermExt.h *
* mods: * * mods: *
* comments: Extensions to standard terms for YAP * * comments: Extensions to standard terms for YAP *
* version: $Id: TermExt.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ * * version: $Id: TermExt.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#if USE_OFFSETS #if USE_OFFSETS

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -228,15 +228,6 @@ inline EXTERN Atom AtomAdjust(Atom at)
inline EXTERN Term AtomTermAdjust(Term);
inline EXTERN Term AtomTermAdjust(Term at)
{
return (Term) ((at) );
}
inline EXTERN Prop PropAdjust(Prop); inline EXTERN Prop PropAdjust(Prop);
inline EXTERN Prop PropAdjust(Prop p) inline EXTERN Prop PropAdjust(Prop p)
@ -251,11 +242,20 @@ inline EXTERN Atom AtomAdjust(Atom);
inline EXTERN Atom AtomAdjust(Atom at) inline EXTERN Atom AtomAdjust(Atom at)
{ {
return (Atom) ((Atom)(CharP(at)+HDiff) ); return (Atom) ((at == NULL ? (at) : (Atom)(CharP(at)+HDiff) ));
} }
#if MMAP_ADDR >= 0x40000000
inline EXTERN Prop PropAdjust(Prop);
inline EXTERN Prop PropAdjust(Prop p)
{
return (Prop) ((p == NULL ? (p) : (Prop)(CharP(p)+HDiff)) );
}
#endif
inline EXTERN Term AtomTermAdjust(Term); inline EXTERN Term AtomTermAdjust(Term);
@ -265,27 +265,6 @@ inline EXTERN Term AtomTermAdjust(Term at)
} }
#else
inline EXTERN Term AtomTermAdjust(Term);
inline EXTERN Term AtomTermAdjust(Term at)
{
return (Term) (MkAtomTerm((Atom)(CharP(AtomOfTerm(at)+HDiff))) );
}
#endif
inline EXTERN Prop PropAdjust(Prop);
inline EXTERN Prop PropAdjust(Prop p)
{
return (Prop) ((Prop)(CharP(p)+HDiff) );
}
#endif
#if TAGS_FAST_OPS #if TAGS_FAST_OPS
inline EXTERN Term BlobTermAdjust(Term); inline EXTERN Term BlobTermAdjust(Term);
@ -393,7 +372,16 @@ inline EXTERN PredEntry * PtoPredAdjust(PredEntry *);
inline EXTERN PredEntry * PtoPredAdjust(PredEntry * ptr) inline EXTERN PredEntry * PtoPredAdjust(PredEntry * ptr)
{ {
return (PredEntry *) (((CELL *)(CharP(ptr) + HDiff)) ); return (PredEntry *) (((PredEntry *)(CharP(ptr) + HDiff)) );
}
inline EXTERN ArrayEntry * PtoArrayEAdjust(ArrayEntry *);
inline EXTERN ArrayEntry * PtoArrayEAdjust(ArrayEntry * ptr)
{
return (ArrayEntry *) (((ArrayEntry *)(CharP(ptr) + HDiff)) );
} }

View File

@ -12,7 +12,13 @@ cd ../OPTYap
splat splat
cd ../VC cd ../VC
splat splat
cd include cd ../LGPL
splat
cd pillow
splat
cd examples
splat
cd ../../../include
splat splat
/bin/cp config.h config.h.mine /bin/cp config.h config.h.mine
/bin/cp ../../../bins/cyg/*.h . /bin/cp ../../../bins/cyg/*.h .

View File

@ -847,7 +847,7 @@ CC="cc -64" $YAP_SRC_PATH/configure --...
@cindex booting @cindex booting
We next describe how to invoke Yap in Unix systems. We next describe how to invoke Yap in Unix systems.
@node Running Yap Interactively,Running Prolog Files, ,Run @node Running Yap Interactively, ,Running Prolog Files,Run
@section Running Yap Interactively @section Running Yap Interactively
Most often you will want to use Yap in interactive mode. Assuming that Most often you will want to use Yap in interactive mode. Assuming that
@ -924,7 +924,7 @@ YAP will try to find library files from the YAPSHAREDIR/library
directory. directory.
@end itemize @end itemize
@node Running Prolog Files, ,Interactive Mode, Run @node Running Prolog Files, Running Yap Interactively, , Run
@section Running Prolog Files @section Running Prolog Files
YAP can also be used to run Prolog files as scripts, at least in YAP can also be used to run Prolog files as scripts, at least in
@ -2473,9 +2473,9 @@ be @code{unknown}, and the second argument should be either
@code{error}, @code{warning}, @code{fail}, or a goal. @code{error}, @code{warning}, @code{fail}, or a goal.
@item user:unknown_predicate_handler(+G,+M,?NG) @item user:unknown_predicate_handler(+G,+M,?NG)
@findex user:unknown_predicate_handler/3 @findex unknown_predicate_handler/3
@syindex user:unknown_predicate_handler/3 @syindex unknown_predicate_handler/3
@cnindex user:unknown_predicate_handler/3 @cnindex unknown_predicate_handler/3
The user may also define clauses for The user may also define clauses for
@code{user:unknown_predicate_handler/3} hook predicate. This @code{user:unknown_predicate_handler/3} hook predicate. This
user-defined procedure is called before any system processing for the user-defined procedure is called before any system processing for the
@ -5312,9 +5312,9 @@ for DCG rules is applied, together with the arithmetic optimizer
whenever the compilation of arithmetic expressions is in progress. whenever the compilation of arithmetic expressions is in progress.
@item user:goal_expansion(+@var{G},+@var{M},-@var{NG}) @item user:goal_expansion(+@var{G},+@var{M},-@var{NG})
@findex user:goal_expansion/3 @findex goal_expansion/3
@snindex user:goal_expansion/3 @snindex goal_expansion/3
@cnindex user:goal_expansion/3 @cnindex goal_expansion/3
Yap now supports @code{goal_expansion/3}. This is an user-defined Yap now supports @code{goal_expansion/3}. This is an user-defined
procedure that is called after term expansion when compiling or procedure that is called after term expansion when compiling or
asserting goals for each sub-goal in a clause. The first argument is asserting goals for each sub-goal in a clause. The first argument is