You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(72) |
Jul
(30) |
Aug
(31) |
Sep
(41) |
Oct
(22) |
Nov
(70) |
Dec
(98) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(194) |
Feb
(127) |
Mar
(47) |
Apr
(83) |
May
(154) |
Jun
(149) |
Jul
(49) |
Aug
(64) |
Sep
(98) |
Oct
(104) |
Nov
(99) |
Dec
(109) |
| 2003 |
Jan
(72) |
Feb
(105) |
Mar
(76) |
Apr
(66) |
May
(20) |
Jun
(51) |
Jul
(67) |
Aug
(16) |
Sep
(24) |
Oct
(52) |
Nov
(43) |
Dec
(92) |
| 2004 |
Jan
(16) |
Feb
(145) |
Mar
(137) |
Apr
(140) |
May
(29) |
Jun
(214) |
Jul
(167) |
Aug
(202) |
Sep
(188) |
Oct
(228) |
Nov
(283) |
Dec
(250) |
| 2005 |
Jan
(107) |
Feb
(162) |
Mar
(100) |
Apr
(110) |
May
(144) |
Jun
(19) |
Jul
(23) |
Aug
(127) |
Sep
(20) |
Oct
(76) |
Nov
(85) |
Dec
(171) |
| 2006 |
Jan
(86) |
Feb
(134) |
Mar
(213) |
Apr
(70) |
May
(81) |
Jun
(25) |
Jul
(6) |
Aug
(36) |
Sep
(20) |
Oct
(21) |
Nov
(368) |
Dec
(164) |
| 2007 |
Jan
(239) |
Feb
(126) |
Mar
(148) |
Apr
(24) |
May
(48) |
Jun
(238) |
Jul
(18) |
Aug
(13) |
Sep
(59) |
Oct
(73) |
Nov
(224) |
Dec
(39) |
| 2008 |
Jan
(53) |
Feb
(92) |
Mar
(134) |
Apr
(81) |
May
(53) |
Jun
(210) |
Jul
(31) |
Aug
(38) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2009 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-18 18:31:22
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv13248/C
Modified Files:
absmi.c
Log Message:
cleanup error messages in functor/3
Index: absmi.c
===================================================================
RCS file: /cvsroot/yap/C/absmi.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- absmi.c 2001/06/08 14:52:53 1.7
+++ absmi.c 2001/06/18 18:31:19 1.8
@@ -1977,7 +1977,7 @@
* *cannot* fail before having woken up all suspended goals.
*/
/* make sure we are here because of an awoken goal */
- if (CFREG == Unsigned(LCL0)) {
+ if (CFREG == Unsigned(LCL0) && !(PrologMode & AbortMode)) {
Term WGs = ReadTimedVar(WokenGoals);
Term my_goal = AbsAppl(H);
@@ -10103,7 +10103,7 @@
if (IsIntegerTerm(d1))
d1 = IntegerOfTerm(d1);
else {
- Error(TYPE_ERROR_INTEGER,ARG3,"functor/3");
+ Error(TYPE_ERROR_INTEGER,d1,"functor/3");
FAIL();
}
if (!IsAtomicTerm(d0)) {
@@ -10206,7 +10206,7 @@
if (IsIntegerTerm(d1))
d1 = IntegerOfTerm(d1);
else {
- Error(TYPE_ERROR_INTEGER,ARG3,"functor/3");
+ Error(TYPE_ERROR_INTEGER,d1,"functor/3");
FAIL();
}
/* We made it!!!!! we got in d0 the name, in d1 the arity and
@@ -10388,7 +10388,7 @@
if (IsIntegerTerm(d1))
d1 = IntegerOfTerm(d1);
else {
- Error(TYPE_ERROR_INTEGER,ARG3,"functor/3");
+ Error(TYPE_ERROR_INTEGER,d1,"functor/3");
FAIL();
}
if (!IsAtomicTerm(d0)) {
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-18 18:24:02
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv11224/C
Modified Files:
exec.c
Log Message:
fix HBREG mess
Index: exec.c
===================================================================
RCS file: /cvsroot/yap/C/exec.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- exec.c 2001/06/08 14:52:53 1.7
+++ exec.c 2001/06/18 18:24:00 1.8
@@ -446,7 +446,7 @@
/* Wow, we're gonna cut!!! */
B = pt0;
#endif /* YAPOR */
- HBREG = PROTECT_FROZEN_H(B);
+ HB = PROTECT_FROZEN_H(B);
}
return(TRUE);
} else if (a == AtomFail || a == AtomFalse)
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-18 18:23:23
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv11082/C
Modified Files:
heapgc.c
Log Message:
fix debugging messages and bad comparison
Index: heapgc.c
===================================================================
RCS file: /cvsroot/yap/C/heapgc.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- heapgc.c 2001/06/12 16:31:09 1.19
+++ heapgc.c 2001/06/18 18:23:14 1.20
@@ -1414,7 +1414,7 @@
case _retry_profiled:
{
Atom at;
- UInt arity;
+ Int arity;
SMALLUNSGN mod;
if (PredForCode((CODEADDR)gc_B->cp_ap, &at, &arity, &mod))
YP_fprintf(YP_stderr,"B %p (%s) at %s/%d with %d,%d\nf", gc_B, op_names[opnum], RepAtom(at)->StrOfAE, arity, gc_B->cp_h-H0, total_marked);
@@ -2644,8 +2644,8 @@
YP_fprintf(YP_stderr,"[GC] Oops on iptop-H (%d) vs %d\n", iptop-(CELL_PTR *)H, total_marked);
#endif
if (iptop < (CELL_PTR *)ASP && 10*total_marked < H-H0) {
- int effectiveness = (((H-H0)-total_marked)*100)/(H-H0);
#ifdef DEBUG
+ int effectiveness = (((H-H0)-total_marked)*100)/(H-H0);
YP_fprintf(YP_stderr,"[GC] using pointers (%d)\n", effectiveness);
#endif
quicksort((CELL_PTR *)H, 0, (iptop-(CELL_PTR *)H)-1);
|
|
From: Stasinos T. K. <sta...@us...> - 2001-06-13 17:52:36
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv3905
Modified Files:
tracer.c
Log Message:
fixed inconsistency between between the two declarations of TracePutchar()
Index: tracer.c
===================================================================
RCS file: /cvsroot/yap/C/tracer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- tracer.c 2001/05/21 20:00:05 1.4
+++ tracer.c 2001/06/13 17:52:33 1.5
@@ -29,7 +29,7 @@
int do_low_level_trace = FALSE;
static int do_trace_primitives = TRUE;
- int
+static int
TracePutchar(int sno, int ch)
{
return(YP_putc(ch, YP_stderr)); /* use standard error stream, which is supposed to be 2*/
|
|
From: Stasinos T. K. <sta...@us...> - 2001-06-13 17:18:42
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv28684
Modified Files:
c_interface.c
Log Message:
fix a declaration-definition inconsistency in YapCloseAllOpenStreams() and an unreachable code bug in YapOpenStream()
Index: c_interface.c
===================================================================
RCS file: /cvsroot/yap/C/c_interface.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- c_interface.c 2001/05/24 15:26:41 1.3
+++ c_interface.c 2001/06/13 17:18:38 1.4
@@ -793,7 +793,7 @@
{
BACKUP_H();
- return(CloseStreams(FALSE));
+ CloseStreams(FALSE);
RECOVER_H();
}
@@ -801,10 +801,13 @@
X_API Term
YapOpenStream(void *fh, char *name, Term nm, int flags)
{
+ Term retv;
+
BACKUP_H();
- return(OpenStream((FILE *)fh, name, nm, flags));
+ retv = OpenStream((FILE *)fh, name, nm, flags);
RECOVER_H();
+ return retv;
}
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-12 18:30:20
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv19498/C
Modified Files:
sysbits.c iopreds.c
Log Message:
Improve readline code:
don't flush if we change output stream;
use readline from interrupt handler.
Index: sysbits.c
===================================================================
RCS file: /cvsroot/yap/C/sysbits.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sysbits.c 2001/06/08 19:10:43 1.4
+++ sysbits.c 2001/06/12 17:25:28 1.5
@@ -81,6 +81,9 @@
#include <sys/param.h>
#endif
#endif
+#if HAVE_LIBREADLINE
+#include <readline/readline.h>
+#endif
STATIC_PROTO (void InitPageSize, (void));
STATIC_PROTO (void InitTime, (void));
@@ -1060,6 +1063,11 @@
#endif
+
+#if HAVE_LIBREADLINE
+static char *_line = NULL;
+#endif
+
void
ProcessSIGINT(void)
{
@@ -1070,12 +1078,18 @@
int ch0;
#endif
+#if HAVE_LIBREADLINE
+ if (_line != (char *) NULL && _line != (char *) EOF)
+ free (_line);
+ _line = readline ("Action (h for help): ");
+ if (_line == (char *)NULL || _line == (char *)EOF)
+ continue;
+ ch = _line[0];
+#else
YP_fprintf(YP_stderr, "\nAction (h for help): ");
ch = YP_getchar ( );
-#if HAVE_LIBREADLINE
- if (!in_readline)
-#endif
while ((YP_getchar()) != '\n');
+#endif
switch (ch)
{
case 'a':
@@ -1094,13 +1108,8 @@
#ifdef VAX
VaxFixFrame (CritMode);
#endif
-#if HAVE_LIBREADLINE
/* we cannot abort until we finish readline :-( */
- if (in_readline) {
- /* readline must eat a newline, otherwise we will
- have to wait before we do the Abort() */
- } else if (!(PrologMode & CritMode)) {
-#endif
+ if (!(PrologMode & CritMode)) {
#if defined(__MINGW32__) || _MSC_VER
/* we can't do a direct abort, so ask the system to do it for us */
p_creep();
@@ -1201,10 +1210,6 @@
YP_fprintf(YP_stderr, " e for exit\n t for trace\n s for statistics\n");
break;
}
-#if HAVE_LIBREADLINE
- /* we must do the reading now, because libreadline won't have a chance here */
- while ((YP_getchar()) != '\n');
-#endif
}
}
Index: iopreds.c
===================================================================
RCS file: /cvsroot/yap/C/iopreds.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- iopreds.c 2001/06/11 18:42:11 1.14
+++ iopreds.c 2001/06/12 17:25:28 1.15
@@ -760,8 +760,6 @@
static char *_line = (char *) NULL;
-int in_readline = FALSE;
-
static int cur_out_sno = 2;
#define READLINE_OUT_BUF_MAX 256
@@ -776,8 +774,7 @@
ReadlinePutc (int sno, int ch)
{
if (ReadlinePos != ReadlineBuf &&
- (sno != cur_out_sno ||
- ReadlinePos - ReadlineBuf == READLINE_OUT_BUF_MAX-1 ||
+ (ReadlinePos - ReadlineBuf == READLINE_OUT_BUF_MAX-1 /* overflow */ ||
#if MAC || _MSC_VER
ch == 10 ||
#endif
@@ -824,7 +821,6 @@
rl_instream = Stream[sno].u.file.file;
rl_outstream = Stream[cur_out_sno].u.file.file;
/* window of vulnerability opened */
- in_readline = TRUE;
if (newline) {
char *cptr = Prompt, ch;
@@ -848,7 +844,6 @@
}
}
newline=FALSE;
- in_readline = FALSE;
strncpy (Prompt, RepAtom (*AtPrompt)->StrOfAE, MAX_PROMPT);
/* window of vulnerability closed */
if (PrologMode & AbortMode) {
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-12 17:47:10
|
Update of /cvsroot/yap/H In directory usw-pr-cvs1:/tmp/cvs-serv19498/H Modified Files: yapio.h Log Message: Improve readline code: don't flush if we change output stream; use readline from interrupt handler. Index: yapio.h =================================================================== RCS file: /cvsroot/yap/H/yapio.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- yapio.h 2001/05/21 20:00:05 1.4 +++ yapio.h 2001/06/12 17:25:28 1.5 @@ -283,10 +283,6 @@ /* grow.c */ int STD_PROTO(growstack_in_parser, (tr_fr_ptr *, TokEntry **, VarEntry **)); -#ifdef HAVE_LIBREADLINE -extern int in_readline; -#endif - #if HAVE_ERRNO_H #include <errno.h> #else |
|
From: Vitor S. C. <vs...@us...> - 2001-06-12 16:31:11
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv8738/C
Modified Files:
heapgc.c
Log Message:
always send debugging messages to stderr.
Index: heapgc.c
===================================================================
RCS file: /cvsroot/yap/C/heapgc.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- heapgc.c 2001/06/11 15:15:17 1.18
+++ heapgc.c 2001/06/12 16:31:09 1.19
@@ -798,16 +798,16 @@
else if (IsUnboundVar((CELL)current)) vars[gc_var]++;
else vars[gc_ref]++;
} else if (IsApplTerm(ccurr)) {
- // printf("%p: f->%p\n",current,RepAppl(ccurr));
+ /* printf("%p: f->%p\n",current,RepAppl(ccurr)); */
vars[gc_appl]++;
} else if (IsPairTerm(ccurr)) {
- // printf("%p: l->%p\n",current,RepPair(ccurr));
+ /* printf("%p: l->%p\n",current,RepPair(ccurr)); */
vars[gc_list]++;
} else if (IsAtomTerm(ccurr)) {
- // printf("%p: %s\n",current,RepAtom(AtomOfTerm(ccurr))->StrOfAE);
+ /* printf("%p: %s\n",current,RepAtom(AtomOfTerm(ccurr))->StrOfAE); */
vars[gc_atom]++;
} else if (IsIntTerm(ccurr)) {
- // printf("%p: %d\n",current,IntOfTerm(ccurr));
+ /* printf("%p: %d\n",current,IntOfTerm(ccurr)); */
vars[gc_int]++;
}
#endif
@@ -1417,9 +1417,9 @@
UInt arity;
SMALLUNSGN mod;
if (PredForCode((CODEADDR)gc_B->cp_ap, &at, &arity, &mod))
- printf("B %p (%s) at %s/%d with %d,%d\nf", gc_B, op_names[opnum], RepAtom(at)->StrOfAE, arity, gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s) at %s/%d with %d,%d\nf", gc_B, op_names[opnum], RepAtom(at)->StrOfAE, arity, gc_B->cp_h-H0, total_marked);
else
- printf("B %p (%s) with %d,%d\n", gc_B, op_names[opnum], gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s) with %d,%d\n", gc_B, op_names[opnum], gc_B->cp_h-H0, total_marked);
}
break;
#ifdef TABLING
@@ -1430,11 +1430,11 @@
op_numbers caller_op = op_from_opcode(ENV_ToOp(gc_B->cp_cp));
/* first condition checks if this was a meta-call */
if ((caller_op != _call && caller_op != _fcall) || pe == NULL) {
- printf("B %p (%s) with %d,%d\n", gc_B, op_names[opnum], gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s) with %d,%d\n", gc_B, op_names[opnum], gc_B->cp_h-H0, total_marked);
} else if (pe->ArityOfPE)
- printf("B %p (%s for %s/%d) with %d,%d\n", gc_B, op_names[opnum], RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE, gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s for %s/%d) with %d,%d\n", gc_B, op_names[opnum], RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE, gc_B->cp_h-H0, total_marked);
else
- printf("B %p (%s for %s/0) with %d,%d\n", gc_B, op_names[opnum], RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE, gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s for %s/0) with %d,%d\n", gc_B, op_names[opnum], RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE, gc_B->cp_h-H0, total_marked);
}
break;
#endif
@@ -1442,11 +1442,11 @@
{
PredEntry *pe = (PredEntry *)gc_B->cp_ap->u.ld.p;
if (pe == NULL) {
- printf("B %p (%s) with %d\n", gc_B, op_names[opnum], total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s) with %d\n", gc_B, op_names[opnum], total_marked);
} else if (pe->ArityOfPE)
- printf("B %p (%s for %s/%d) with %d,%d\n", gc_B, op_names[opnum], RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE, gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s for %s/%d) with %d,%d\n", gc_B, op_names[opnum], RepAtom(NameOfFunctor(pe->FunctorOfPred))->StrOfAE, pe->ArityOfPE, gc_B->cp_h-H0, total_marked);
else
- printf("B %p (%s for %s/0) with %d,%d\n", gc_B, op_names[opnum], RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE, gc_B->cp_h-H0, total_marked);
+ YP_fprintf(YP_stderr,"B %p (%s for %s/0) with %d,%d\n", gc_B, op_names[opnum], RepAtom((Atom)(pe->FunctorOfPred))->StrOfAE, gc_B->cp_h-H0, total_marked);
}
}
#endif /* CHECK_CHOICEPOINTS */
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-12 16:16:01
|
Update of /cvsroot/yap/pl In directory usw-pr-cvs1:/tmp/cvs-serv4780/pl Modified Files: preds.yap Log Message: bug in abolish Index: preds.yap =================================================================== RCS file: /cvsroot/yap/pl/preds.yap,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- preds.yap 2001/06/11 20:23:57 1.4 +++ preds.yap 2001/06/12 16:15:58 1.5 @@ -382,14 +382,21 @@ \+ atom(M), !, throw(error(type_error(atom,Na), Msg)). -'$old_abolish'(V) :- - '$abolish_all'. +'$old_abolish'(V) :- var(V), !, + '$abolish_all_old'. '$old_abolish'(M:N) :- !, '$mod_switch'(M,'$old_abolish'(N)). '$old_abolish'([]) :- !. '$old_abolish'([H|T]) :- !, abolish(H), abolish(T). '$old_abolish'(N/A) :- abolish(N,A). +'$abolish_all_old' :- + current_predicate(_,P), + functor(P, Na, Ar), + '$abolish_old'(Na/Ar), + fail. +'$abolish_all_old'. + '$abolishd'(T) :- '$recordedp'(T,_,R), erase(R), fail. '$abolishd'(T) :- '$kill_dynamic'(T), fail. |
|
From: Stasinos T. K. <sta...@us...> - 2001-06-12 14:08:03
|
Update of /cvsroot/yap/docs
In directory usw-pr-cvs1:/tmp/cvs-serv3011
Modified Files:
yap.tex
Log Message:
a few typos corrected
Index: yap.tex
===================================================================
RCS file: /cvsroot/yap/docs/yap.tex,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- yap.tex 2001/06/11 20:20:36 1.18
+++ yap.tex 2001/06/12 14:07:59 1.19
@@ -1,4 +1,4 @@
-\input texinfo @c -*-texinfo-*-
+\input texinfo @c -*- mode: texinfo; coding: latin-1; -*-
@c %**start of header
@setfilename yap.info
@@ -375,7 +375,7 @@
Online documentation is available for YAP at:
- @url{http://www.ncc.up.pt/~vsc/Yap/}
+ @url{http://www.ncc.up.pt/~vsc/Yap/}
Recent versions of Yap, including both source and selected binaries,
can be found from this same URL.
@@ -743,10 +743,10 @@
@code{boot.yap}, so write:
@example
- -b $YAPSRC\pl\boot.yap
+ -b $YAPSRC\pl\boot.yap
@end example
- in @code{Project.Project Settings.Debug.Program Arguments}.
+ in @code{Project.Project Settings.Debug.Program Arguments}.
@item You need the sockets and yap libraries. Add
@@ -6418,39 +6418,39 @@
@table @code
@item add_to_heap(+@var{Heap},+@var{key},+@var{Datum},-@var{NewHeap})
-@findex add_to_heap/4
-@syindex add_to_heap/4
-@cnindex add_to_heap/4
+@findex add_to_heap/4
+@syindex add_to_heap/4
+@cnindex add_to_heap/4
Inserts the new @var{Key-Datum} pair into the heap. The insertion is not
stable, that is, if you insert several pairs with the same @var{Key} it
is not defined which of them will come out first, and it is possible for
any of them to come out first depending on the history of the heap.
@item get_from_heap(+@var{Heap},-@var{key},-@var{Datum},-@var{Heap})
-@findex get_from_heap/4
-@syindex get_from_heap/4
-@cnindex get_from_heap/4
+@findex get_from_heap/4
+@syindex get_from_heap/4
+@cnindex get_from_heap/4
Returns the @var{Key-Datum} pair in @var{OldHeap} with the smallest
@var{Key}, and also a @var{Heap} which is the @var{OldHeap} with that
pair deleted.
@item heap_size(+@var{Heap}, -@var{Size})
-@findex heap_size/2
-@syindex heap_size/2
-@cnindex heap_size/2
+@findex heap_size/2
+@syindex heap_size/2
+@cnindex heap_size/2
Reports the number of elements currently in the heap.
@item heap_to_list(+@var{Heap}, -@var{List})
-@findex heap_to_list/2
-@syindex heap_to_list/2
-@cnindex heap_to_list/2
+@findex heap_to_list/2
+@syindex heap_to_list/2
+@cnindex heap_to_list/2
Returns the current set of @var{Key-Datum} pairs in the @var{Heap} as a
@var{List}, sorted into ascending order of @var{Keys}.
@item list_to_heap(+@var{List}, -@var{Heap})
-@findex list_to_heap/2
-@syindex list_to_heap/2
-@cnindex list_to_heap/2
+@findex list_to_heap/2
+@syindex list_to_heap/2
+@cnindex list_to_heap/2
Takes a list of @var{Key-Datum} pairs (such as keysort could be used to sort)
and forms them into a heap.
@@ -7381,10 +7381,10 @@
@cnindex file_property/2
The atom @var{File} corresponds to an existing file, and @var{Property}
will be unified with a property of this file. The poperties are of the
-form @code{type(@var{Type))}, which gives whether the file is a regular
+form @code{type(@var{Type})}, which gives whether the file is a regular
file, a directory, a fifo file, or of unknown type;
-@code{size(@var{Size))}, with gives the size for a file, and
-@code{mod_time(@var{Time))}, which gives the last time a file was
+@code{size(@var{Size})}, with gives the size for a file, and
+@code{mod_time(@var{Time})}, which gives the last time a file was
modified according to some Operating System dependent
timestamp. Properties can be obtained through backtracking:
@@ -8048,13 +8048,13 @@
YAP now supports the attributed variables packaged developed at OFAI by
Christian Holzbaur. Attributes are a means of declaring that an
arbitrary term is a property for a variable. These properties can be
-update during forward execution. Moreover, the unification algorithm is
+updated during forward execution. Moreover, the unification algorithm is
aware of attributed variables and will call user defined handlers when
trying to unify these variables.
Attributed variables provide an elegant abstraction over which one can
extend Prolog systems. Their main application so far has been in
-implement constraint handlers, such as Holzbaur's CLPQR and Fruewirth
+implementing constraint handlers, such as Holzbaur's CLPQR and Fruewirth
and Holzbaur's CHR, but other applications have been proposed in the
literature.
@@ -8108,7 +8108,7 @@
One single such declaration is allowed per module @var{Module}.
Although the YAP module system is predicate based, attributes are local
-to modules. This is is implemented by rewriting all calls to the
+to modules. This is implemented by rewriting all calls to the
builtins that manipulate attributes so that attribute names are
preprocessed depending on the module. The @code{user:goal_expansion/3}
mechanism is used for this purpose.
@@ -8220,8 +8220,8 @@
@node Projecting Attributes, Attribute Examples, Displaying Attributes, Attributed Variables
-Constraint solvers must be able project a set of constraints to a set of
-variables. This is useful when displaying the solution to a goal, but
+Constraint solvers must be able to project a set of constraints to a set
+of variables. This is useful when displaying the solution to a goal, but
may also be used to manipulate computations. The user-defined
@code{project_attributes/2} is responsible for implementing this
projection.
@@ -8253,7 +8253,7 @@
@node Attribute Examples, ,Projecting Attributes, Attributed Variables
The following two examples example is taken from the SICStus Prolog manual. It
-sketchs the implementation of simple a finite domain ``solver''. Note
+sketches the implementation of a simple finite domain ``solver''. Note
that an industrial strength solver would have to provide a wider range
of functionality and that it quite likely would utilize a more efficient
representation for the domains proper. The module exports a single
@@ -8317,7 +8317,7 @@
Note that the ``implied binding'' @code{Other=El} was deferred until after
the completion of @code{verify_attribute/3}. Otherwise, there might be a
-danger of recursively invoke @code{verify_attribute/3}, which might bind
+danger of recursively invoking @code{verify_attribute/3}, which might bind
@code{Var}, which is not allowed inside the scope of @code{verify_attribute/3}.
Deferring unifications into the third argument of @code{verify_attribute/3}
effectively serializes th calls to @code{verify_attribute/3}.
@@ -13046,5 +13046,3 @@
@contents
@bye
-
-
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 20:24:00
|
Update of /cvsroot/yap/pl
In directory usw-pr-cvs1:/tmp/cvs-serv5415/pl
Modified Files:
preds.yap
Log Message:
fix '$abolish_all'
Index: preds.yap
===================================================================
RCS file: /cvsroot/yap/pl/preds.yap,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- preds.yap 2001/05/28 19:54:53 1.3
+++ preds.yap 2001/06/11 20:23:57 1.4
@@ -342,7 +342,7 @@
'$abolish_all' :-
current_predicate(_,P),
functor(P, Na, Ar),
- '$new_abolish'(Na, Ar),
+ '$new_abolish'(Na/Ar),
fail.
'$abolish_all'.
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 20:20:39
|
Update of /cvsroot/yap/library
In directory usw-pr-cvs1:/tmp/cvs-serv4666/library
Modified Files:
random.yap
Log Message:
change library(random) to use O'Keefe code.
Index: random.yap
===================================================================
RCS file: /cvsroot/yap/library/random.yap,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- random.yap 2001/04/09 19:53:44 1.1.1.1
+++ random.yap 2001/06/11 20:20:36 1.2
@@ -15,6 +15,13 @@
* *
*************************************************************************/
+% original code from RA O'Keefe.
+
+% This is algorithm AS 183 from Applied Statistics. I also have a C
+% version. It is really very good. It is straightforward to make a
+% version which yields 15-bit random integers using only integer
+% arithmetic.
+
:- module(random, [
random/1,
random/3,
@@ -24,79 +31,90 @@
setrand/1
]).
+:- load_foreign_files([random], [], init_random).
+
-random(X) :- X is random.
+% random(R) binds R to a new random number in [0.0,1.0)
-random(X, LOW, UPPER) :- integer(LOW), integer(UPPER), !,
- X is integer(random*(UPPER-LOW))+LOW.
-random(X, LOW, UPPER) :-
- X is random*(UPPER-LOW)+LOW.
-
-randseq(L, M, Rs) :-
- integer(L),
- L > 0,
- integer(M),
- M > 0,
- M > L,
- randseq(L, M, [], Rs).
-
-randseq(0, _, Rs, Rs) :- !.
-randseq(K, N, Set, Rs) :-
- X is integer(random*N),
- not_in(Set, X), !,
- K1 is K-1,
- randseq(K1, N, [X|Set], Rs).
-randseq(K, N, Set, Rs) :-
- randseq(K, N, Set, Rs).
-
-not_in([], _).
-not_in([X|L], Y) :- X \= Y,
- not_in(L, Y).
-
-randset(L, M, Rs) :-
- integer(L),
- L > 0,
- integer(M),
- M > 0,
- M > L,
- randset(L, M, [], Rs).
-
-randset(0, _, Rs, Rs) :- !.
-randset(K, N, Set, Rs) :-
- X is integer(random*N),
- addnew(Set, X, NSet), !,
- K1 is K-1,
- randset(K1, N, NSet, Rs).
-randset(K, N, Set, Rs) :-
- randset(K, N, Set, Rs).
-
-addnew([], Y, [Y]).
-addnew([X|L], Y, [Y,X|L]) :- X > Y, !.
-addnew([X|L], Y, [X|NSet]) :-
- X < Y,
- addnew(L, Y, NSet).
-
-getrand(rand(X,Y,Z)) :-
- srandom(Seed0),
- Seed is abs(Seed0),
- X is Seed mod 30269,
- Seed1 is Seed // 30269,
- Y is Seed1 mod 30307,
- Seed2 is Seed1 // 30307,
- Z is Seed2 mod 30323.
+% random(L, U, R) binds R to a random integer in [L,U)
+% when L and U are integers (note that U will NEVER be generated),
+% or to a random floating number in [L,U) otherwise.
+
+random(L, U, R) :- integer(L), integer(U), !,
+ random(X),
+ R is L+integer((U-L)*X).
+random(L, U, R) :-
+ number(L), number(U), !,
+ random(X),
+ R is L+((U-L)*X).
+
+/* There are two versions of this operation.
+
+ randset(K, N, S)
+
+ generates a random set of K integers in the range 1..N.
+ The result is an ordered list, such as setof might produce.
+
+ randseq(K, N, L)
+
+ generates a random sequence of K integers, the order is as
+ random as we can make it.
+*/
+
+
+randset(K, N, S) :-
+ K >= 0,
+ K =< N,
+ randset(K, N, [], S).
+
+
+randset(0, _, S, S) :- !.
+randset(K, N, Si, So) :-
+ random(X),
+ X * N < K, !,
+ J is K-1,
+ M is N-1,
+ randset(J, M, [N|Si], So).
+randset(K, N, Si, So) :-
+ M is N-1,
+ randset(K, M, Si, So).
+
+
+randseq(K, N, S) :-
+ randseq(K, N, L, []),
+ keysort(L, R),
+ strip_keys(R, S).
+
+randseq(0, _, S, S) :- !.
+randseq(K, N, [Y-N|Si], So) :-
+ random(X),
+ X * N < K, !,
+ random(Y),
+ J is K-1,
+ M is N-1,
+ randseq(J, M, Si, So).
+randseq(K, N, Si, So) :-
+ M is N-1,
+ randseq(K, M, Si, So).
+
+
+strip_keys([], []) :- !.
+strip_keys([_-K|L], [K|S]) :-
+ strip_keys(L, S).
setrand(rand(X,Y,Z)) :-
integer(X),
- X > 1,
- X < 30269,
integer(Y),
- Y > 1,
- Y < 30307,
integer(Z),
- Z > 1,
- Z < 30323,
- Seed is X + 30269*(Y + 30307*Z),
- srandom(Seed).
+ X > 0,
+ X < 30269,
+ Y > 0,
+ Y < 30307,
+ Z > 0,
+ Z < 30323,
+ setrand(X,Y,Z).
+
+
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 20:20:39
|
Update of /cvsroot/yap/docs
In directory usw-pr-cvs1:/tmp/cvs-serv4666/docs
Modified Files:
yap.tex
Log Message:
change library(random) to use O'Keefe code.
Index: yap.tex
===================================================================
RCS file: /cvsroot/yap/docs/yap.tex,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- yap.tex 2001/06/08 14:52:54 1.17
+++ yap.tex 2001/06/11 20:20:36 1.18
@@ -6889,9 +6889,9 @@
@cindex queue
The following random number operations are included with the
-@code{use_module(library(random))} command. The random numbers packages
-uses the Operating underlying random number generator, so random numbers
-are not necessarily repeatable.
+@code{use_module(library(random))} command. Since Yap-4.3.19 Yap uses
+the O'Keefe public-domain algorithm, based on the "Applied Statistics"
+algorithm AS183.
@table @code
@@ -6922,14 +6922,14 @@
@syindex randseq/3
@cnindex randseq/3
Unify @var{Numbers} with a list of @var{LENGTH} unique random integers
-in the range @code{[1 ...@var{HIGH})}.
+in the range @code{[1 ...@var{MAX})}.
@item randset(+@var{LENGTH}, +@var{MAX}, -@var{Numbers})
@findex randset/3
@syindex randset/3
@cnindex randset/3
Unify @var{Numbers} with an ordered list of @var{LENGTH} unique random
-integers in the range @code{[1 ...@var{HIGH})}.
+integers in the range @code{[1 ...@var{MAX})}.
@item setrand(+@var{Key})
@findex setrand/1
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 20:20:39
|
Update of /cvsroot/yap/library/random
In directory usw-pr-cvs1:/tmp/cvs-serv4666/library/random
Added Files:
Makefile.in random.c random.def
Log Message:
change library(random) to use O'Keefe code.
--- NEW FILE: Makefile.in ---
#
# default base directory for YAP installation
#
ROOTDIR = @prefix@
#
# where the binary should be
#
BINDIR = $(ROOTDIR)/bin
#
# where YAP should look for libraries
#
LIBDIR=$(ROOTDIR)/lib/Yap
#
#
CC=@CC@
CFLAGS= @CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
#
#
# You shouldn't need to change what follows.
#
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
SHELL=/bin/sh
RANLIB=@RANLIB@
srcdir=@srcdir@
SHLIB_CFLAGS=@SHLIB_CFLAGS@
SHLIB_SUFFIX=@SHLIB_SUFFIX@
#4.1VPATH=@srcdir@:@srcdir@/OPTYap
CWD=$(PWD)
#
OBJS=random.o
SOBJS=random@SHLIB_SUFFIX@
#in some systems we just create a single object, in others we need to
# create a libray
all: @NEWSHOBJ@
sobjs: $(SOBJS)
dll: random@SHLIB_SUFFIX@
random.o: $(srcdir)/random.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/random.c -o random.o
%.so: %.o
@SHLIB_LD@ -o $@ $<
random.so: random.o
@SHLIB_LD@ -o random.so random.o
#
# create a new DLL library on cygwin environments
#
# DLLNAME: name of the new dll
# OBJS: list of object files I want to put in
# LIBS: list of libraries to link with
# DEFFILE is the name of the definitions file.
# BASEFILE temporary
# EXPFILE temporary
# ENTRY is the entry point int WINAPI startup (HINSTANCE, DWORD, LPVOID)
#
DLLTOOL=dlltool
DLLNAME=random.dll
DLL_LIBS=-L /usr/lib/mingw -lmoldname -lcrtdll -lkernel32 -L../.. -lWYap
BASE_FILE=random.base
EXP_FILE=random.exp
DEF_FILE=$(srcdir)/random.def
ENTRY_FUNCTION=_win_random@12
#
random.dll: $(OBJS)
$(LD) -s --base-file $(BASE_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) -s --base-file $(BASE_FILE) $(EXP_FILE) -dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) $(EXP_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR)
install_mingw32: dll
$(INSTALL_PROGRAM) -m 755 random.dll $(LIBDIR)/random.dll
clean:
rm -f *.o *.so *~ $(OBJS) *.BAK
--- NEW FILE: random.c ---
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: regexp.c *
* Last rev: *
* mods: *
* comments: regular expression interpreter *
* *
*************************************************************************/
#include "config.h"
#include "c_interface.h"
#include <math.h>
void PROTO(init_random, (void));
static short a1 = 27314, b1 = 9213, c1 = 17773;
static int
p_random(void)
{
flt fli;
Int t1, t2, t3;
t1 = (a1 * 171) % 30269;
t2 = (b1 * 172) % 30307;
t3 = (c1 * 170) % 30323;
fli = (t1/30269.0) + (t2/30307.0) + (t3/30323.0);
a1 = t1;
b1 = t2;
c1 = t3;
return(unify(ARG1, MkFloatTerm(fli-(int)(fli))));
}
static int
p_setrand(void)
{
a1 = IntOfTerm(ARG1);
b1 = IntOfTerm(ARG2);
c1 = IntOfTerm(ARG3);
return(TRUE);
}
static int
p_getrand(void)
{
return(unify(ARG1,MkIntTerm(a1)) &&
unify(ARG2,MkIntTerm(b1)) &&
unify(ARG3,MkIntTerm(c1)));
}
void
init_random(void)
{
UserCPredicate("random", p_random, 1);
UserCPredicate("setrand", p_setrand, 3);
UserCPredicate("getrand", p_getrand, 3);
}
#ifdef _WIN32
#include <windows.h>
int WINAPI PROTO(win_random, (HANDLE, DWORD, LPVOID));
int WINAPI win_random(HANDLE hinst, DWORD reason, LPVOID reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return 1;
}
#endif
--- NEW FILE: random.def ---
EXPORTS
init_random
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 20:20:38
|
Update of /cvsroot/yap
In directory usw-pr-cvs1:/tmp/cvs-serv4666
Modified Files:
Makefile.in TO_DO configure configure.in
Log Message:
change library(random) to use O'Keefe code.
Index: TO_DO
===================================================================
RCS file: /cvsroot/yap/TO_DO,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TO_DO 2001/06/11 17:40:16 1.7
+++ TO_DO 2001/06/11 20:20:36 1.8
@@ -13,6 +13,10 @@
- document system(library)
- document new interface functions.
- ^C can break code.
+- check library(random)
+- add more precision when outputting floats.
+- make statistics/0 better looking.
+- mask when installing.
TO CHECK:
- bad register allocation for a(X,Y) :- X is Y+2.3 ?
Index: configure
===================================================================
RCS file: /cvsroot/yap/configure,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- configure 2001/06/11 15:12:07 1.6
+++ configure 2001/06/11 20:20:36 1.7
@@ -1,145 +1,46 @@
#! /bin/sh
+
# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.50.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
[...9936 lines suppressed...]
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
make depend
Index: configure.in
===================================================================
RCS file: /cvsroot/yap/configure.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- configure.in 2001/06/11 15:12:07 1.6
+++ configure.in 2001/06/11 20:20:36 1.7
@@ -595,7 +595,7 @@
mkdir -p CHR
mkdir -p CLPQR
-AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile)
+AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile .depend library/Makefile CHR/Makefile CLPQR/Makefile)
make depend
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 20:15:13
|
Update of /cvsroot/yap/library/random In directory usw-pr-cvs1:/tmp/cvs-serv3587/library/random Log Message: Directory /cvsroot/yap/library/random added to the repository |
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 18:42:14
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv15255/C
Modified Files:
iopreds.c
Log Message:
missing break in ~n option for format.
Index: iopreds.c
===================================================================
RCS file: /cvsroot/yap/C/iopreds.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- iopreds.c 2001/06/11 17:47:02 1.13
+++ iopreds.c 2001/06/11 18:42:11 1.14
@@ -4093,6 +4093,7 @@
format_putc(sno, (int) '\n');
column_boundary = 0;
pad_max = pad_entries;
+ break;
case 'N':
if (!size_args) {
arg_size = 1;
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 17:47:05
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv2687/C
Modified Files:
iopreds.c
Log Message:
fix && instead of &
Index: iopreds.c
===================================================================
RCS file: /cvsroot/yap/C/iopreds.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- iopreds.c 2001/06/11 17:40:16 1.12
+++ iopreds.c 2001/06/11 17:47:02 1.13
@@ -364,7 +364,7 @@
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc;
- if (Stream[0].status && Tty_Stream_f &&
+ if (Stream[0].status & Tty_Stream_f &&
s->u.file.name == Stream[0].u.file.name)
s->stream_putc = ReadlinePutc;
} else
@@ -412,7 +412,7 @@
/* if a tty have a special routine to call readline */
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
- if (Stream[0].status && Tty_Stream_f &&
+ if (Stream[0].status & Tty_Stream_f &&
s->u.file.name == Stream[0].u.file.name)
s->stream_putc = ReadlinePutc;
s->stream_getc = ReadlineGetc;
@@ -912,7 +912,7 @@
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc;
- if (Stream[0].status && Tty_Stream_f &&
+ if (Stream[0].status & Tty_Stream_f &&
s->u.file.name == Stream[0].u.file.name)
s->stream_putc = ReadlinePutc;
} else
@@ -1216,7 +1216,7 @@
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc;
- if (Stream[0].status && Tty_Stream_f &&
+ if (Stream[0].status & Tty_Stream_f &&
s->u.file.name == Stream[0].u.file.name)
s->stream_putc = ReadlinePutc;
} else
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 17:40:19
|
Update of /cvsroot/yap/H In directory usw-pr-cvs1:/tmp/cvs-serv1391/H Modified Files: Heap.h Log Message: support recent readlines. Index: Heap.h =================================================================== RCS file: /cvsroot/yap/H/Heap.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Heap.h 2001/06/08 19:10:43 1.5 +++ Heap.h 2001/06/11 17:40:16 1.6 @@ -78,6 +78,9 @@ consult_obj *consultbase; consult_obj *consultlow; Int consultcapacity; +#if HAVE_LIBREADLINE + char *readline_buf, *readline_pos; +#endif #if USE_THREADED_CODE opentry *op_rtable; #endif @@ -478,5 +481,9 @@ #define ConsultLow (heap_regs->consultlow ) /* current maximum number of cells in consult stack */ #define ConsultCapacity (heap_regs->consultcapacity ) +#if HAVE_LIBREADLINE +#define ReadlineBuf heap_regs->readline_buf +#define ReadlinePos heap_regs->readline_pos +#endif |
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 17:40:19
|
Update of /cvsroot/yap In directory usw-pr-cvs1:/tmp/cvs-serv1391 Modified Files: TO_DO changes4.3.html Log Message: support recent readlines. Index: changes4.3.html =================================================================== RCS file: /cvsroot/yap/changes4.3.html,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- changes4.3.html 2001/06/11 15:12:07 1.27 +++ changes4.3.html 2001/06/11 17:40:16 1.28 @@ -16,6 +16,8 @@ <h2>Yap-4.3.19:</h2> <ul> + <li>FIXED: support newer versions of readline by moving text + to prompt.</li> <li>FIXED: upgrade to autoconf 2.5.</li> <li>FIXED: catch and throw should not leave unnecessary choice-points behind.</li> |
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 17:40:19
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv1391/C
Modified Files:
iopreds.c
Log Message:
support recent readlines.
Index: iopreds.c
===================================================================
RCS file: /cvsroot/yap/C/iopreds.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- iopreds.c 2001/06/08 13:38:07 1.11
+++ iopreds.c 2001/06/11 17:40:16 1.12
@@ -140,6 +140,7 @@
#endif
#if HAVE_LIBREADLINE
STATIC_PROTO (int ReadlineGetc, (int));
+STATIC_PROTO (int ReadlinePutc, (int,int));
#endif
STATIC_PROTO (int PlUnGetc, (int));
STATIC_PROTO (Term MkStream, (int));
@@ -363,6 +364,9 @@
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc;
+ if (Stream[0].status && Tty_Stream_f &&
+ s->u.file.name == Stream[0].u.file.name)
+ s->stream_putc = ReadlinePutc;
} else
#endif
{
@@ -408,6 +412,9 @@
/* if a tty have a special routine to call readline */
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
+ if (Stream[0].status && Tty_Stream_f &&
+ s->u.file.name == Stream[0].u.file.name)
+ s->stream_putc = ReadlinePutc;
s->stream_getc = ReadlineGetc;
} else
#endif
@@ -755,11 +762,49 @@
int in_readline = FALSE;
+static int cur_out_sno = 2;
+
+#define READLINE_OUT_BUF_MAX 256
+
static void
InitReadline(void) {
-
+ ReadlineBuf = (char *)AllocAtomSpace(READLINE_OUT_BUF_MAX+1);
+ ReadlinePos = ReadlineBuf;
}
+static int
+ReadlinePutc (int sno, int ch)
+{
+ if (ReadlinePos != ReadlineBuf &&
+ (sno != cur_out_sno ||
+ ReadlinePos - ReadlineBuf == READLINE_OUT_BUF_MAX-1 ||
+#if MAC || _MSC_VER
+ ch == 10 ||
+#endif
+ ch == '\n')) {
+#if MAC || _MSC_VER
+ if (ch == 10)
+ {
+ ch = '\n';
+ }
+#endif
+ if (ch == '\n') {
+ ReadlinePos[0] = '\n';
+ ReadlinePos++;
+ }
+ ReadlinePos[0] = '\0';
+ fputs( ReadlineBuf, Stream[sno].u.file.file);
+ ReadlinePos = ReadlineBuf;
+ if (ch == '\n') {
+ console_count_output_char(ch,Stream+sno,sno);
+ return((int) '\n');
+ }
+ }
+ *ReadlinePos++ = ch;
+ console_count_output_char(ch,Stream+sno,sno);
+ return ((int) ch);
+}
+
/*
reading from the console is complicated because we need to
know whether to prompt and so on...
@@ -776,8 +821,8 @@
/* Only sends a newline if we are at the start of a line */
if (_line != (char *) NULL && _line != (char *) EOF)
free (_line);
- rl_instream = stdin;
- rl_outstream = stderr;
+ rl_instream = Stream[sno].u.file.file;
+ rl_outstream = Stream[cur_out_sno].u.file.file;
/* window of vulnerability opened */
in_readline = TRUE;
if (newline) {
@@ -794,7 +839,13 @@
_line = readline ("");
}
} else {
- _line = readline ("");
+ if (ReadlinePos != ReadlineBuf) {
+ ReadlinePos[0] = '\0';
+ ReadlinePos = ReadlineBuf;
+ _line = readline (ReadlineBuf);
+ } else {
+ _line = readline ("");
+ }
}
newline=FALSE;
in_readline = FALSE;
@@ -861,6 +912,9 @@
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc;
+ if (Stream[0].status && Tty_Stream_f &&
+ s->u.file.name == Stream[0].u.file.name)
+ s->stream_putc = ReadlinePutc;
} else
#endif
{
@@ -1162,6 +1216,9 @@
#if HAVE_LIBREADLINE
if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc;
+ if (Stream[0].status && Tty_Stream_f &&
+ s->u.file.name == Stream[0].u.file.name)
+ s->stream_putc = ReadlinePutc;
} else
#endif
{
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 15:15:20
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv680/C
Modified Files:
heapgc.c
Log Message:
get rid of pesky debugging message
Index: heapgc.c
===================================================================
RCS file: /cvsroot/yap/C/heapgc.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- heapgc.c 2001/06/11 15:09:36 1.17
+++ heapgc.c 2001/06/11 15:15:17 1.18
@@ -1200,10 +1200,6 @@
trail_cell = TrailTerm(trail_ptr);
- if (trail_cell == 0xa0000006) {
- printf("Oops at %p->%x\n", trail_ptr, trail_cell);
- }
-
if (IsVarTerm(trail_cell)) {
CELL *hp = (CELL *)trail_cell;
/* if a variable older than the current CP has not been marked yet,
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 15:12:10
|
Update of /cvsroot/yap/OPTYap
In directory usw-pr-cvs1:/tmp/cvs-serv31838/OPTYap
Modified Files:
opt.preds.c
Log Message:
support for configure 2.5
recover memory in catch/throw.
Index: opt.preds.c
===================================================================
RCS file: /cvsroot/yap/OPTYap/opt.preds.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- opt.preds.c 2001/05/28 19:54:53 1.2
+++ opt.preds.c 2001/06/11 15:12:07 1.3
@@ -35,12 +35,12 @@
** Local functions declaration **
** ------------------------------------- */
+static int p_default_sequential(void);
#ifdef YAPOR
static realtime current_time(void);
static int yapor_on(void);
static int start_yapor(void);
static int p_sequential(void);
-static int p_default_sequential(void);
static int p_execution_mode(void);
static int p_performance(void);
static int p_parallel_new_answer(void);
@@ -106,7 +106,40 @@
** Local functions **
** ------------------------- */
+static
+int p_default_sequential(void) {
#ifdef YAPOR
+ Term t;
+ t = Deref(ARG1);
+ if (IsVarTerm(t)) {
+ Term ta;
+ if (SEQUENTIAL_IS_DEFAULT)
+ ta = MkAtomTerm(LookupAtom("on"));
+ else
+ ta = MkAtomTerm(LookupAtom("off"));
+ Bind((CELL *)t, ta);
+ return(TRUE);
+ }
+ if (IsAtomTerm(t)) {
+ char *s;
+ s = RepAtom(AtomOfTerm(t))->StrOfAE;
+ if (strcmp(s, "on") == 0) {
+ SEQUENTIAL_IS_DEFAULT = TRUE;
+ return(TRUE);
+ }
+ if (strcmp(s,"off") == 0) {
+ SEQUENTIAL_IS_DEFAULT = FALSE;
+ return(TRUE);
+ }
+ }
+ return(FALSE);
+#else
+ return(TRUE);
+#endif
+}
+
+
+#ifdef YAPOR
static
realtime current_time(void) {
/* to get time as Yap */
@@ -171,35 +204,6 @@
pe = RepPredProp(PredProp(at, arity));
pe->PredFlags |= SequentialPredFlag;
return (TRUE);
-}
-
-
-static
-int p_default_sequential(void) {
- Term t;
- t = Deref(ARG1);
- if (IsVarTerm(t)) {
- Term ta;
- if (SEQUENTIAL_IS_DEFAULT)
- ta = MkAtomTerm(LookupAtom("on"));
- else
- ta = MkAtomTerm(LookupAtom("off"));
- Bind((CELL *)t, ta);
- return(TRUE);
- }
- if (IsAtomTerm(t)) {
- char *s;
- s = RepAtom(AtomOfTerm(t))->StrOfAE;
- if (strcmp(s, "on") == 0) {
- SEQUENTIAL_IS_DEFAULT = TRUE;
- return(TRUE);
- }
- if (strcmp(s,"off") == 0) {
- SEQUENTIAL_IS_DEFAULT = FALSE;
- return(TRUE);
- }
- }
- return(FALSE);
}
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 15:12:10
|
Update of /cvsroot/yap/pl
In directory usw-pr-cvs1:/tmp/cvs-serv31838/pl
Modified Files:
boot.yap
Log Message:
support for configure 2.5
recover memory in catch/throw.
Index: boot.yap
===================================================================
RCS file: /cvsroot/yap/pl/boot.yap,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- boot.yap 2001/06/08 19:10:43 1.9
+++ boot.yap 2001/06/11 15:12:07 1.10
@@ -1144,20 +1144,20 @@
'$catch'(G,_,_,I,_) :-
% on entry we push the catch choice point
X is '$last_choice_pt',
- '$catch_call'(X,G,I).
+ '$catch_call'(X,G,I, NX),
+ (X = NX -> !, '$erase_catch_elements'(I) ; true).
% someone sent us a throw.
'$catch'(_,C,A,_,M) :-
array_element('$catch_queue', 1, X), X \= '$',
update_array('$catch_queue', 1, '$'),
- array_element('$catch_queue', 0, catch(_,Lev,Q)),
+ array_element('$catch_queue', 0, catch(_,Lev,Q)), !,
update_array('$catch_queue', 0, Q),
'$db_clean_queues'(Lev),
+ '$erase_catch_elements'(Lev),
( C=X -> '$current_module'(_,M), '$execute'(A) ; throw(X)).
% normal exit: make sure we only erase what we should erase!
'$catch'(_,_,_,I,_) :-
- array_element('$catch_queue', 0, OldCatch),
- '$erase_catch_elements'(OldCatch, I, Catch),
- update_array('$catch_queue', 0, Catch),
+ '$erase_catch_elements'(I),
fail.
'$erase_catch_elements'(catch(X, J, P), I, Catch) :-
@@ -1165,14 +1165,15 @@
'$erase_catch_elements'(P, I, Catch).
'$erase_catch_elements'(Catch, _, Catch).
-'$catch_call'(X,G,I) :-
+'$catch_call'(X,G,I,NX) :-
array_element('$catch_queue', 0, OldCatch),
update_array('$catch_queue', 0, catch(X,I,OldCatch)),
'$execute'(G),
- ( % on exit remove the catch
+ NX is '$last_choice_pt',
+ (
array_element('$catch_queue', 0, catch(X,I,Catch)),
update_array('$catch_queue', 0, Catch)
- ;
+ ;
% on backtracking reinstate the catch before backtracking to G
array_element('$catch_queue', 0, Catch),
update_array('$catch_queue', 0, catch(X,I,Catch)),
@@ -1195,14 +1196,16 @@
'$system_catch'(G,_,_,I,_) :-
% on entry we push the catch choice point
X is '$last_choice_pt',
- '$system_catch_call'(X,G,I).
+ '$system_catch_call'(X,G,I,NX),
+ ( X = NX -> !, '$erase_catch_elements'(I) ; true).
% someone sent us a throw.
'$system_catch'(_,C,A,_,M0) :-
array_element('$catch_queue', 1, X), X \= '$',
update_array('$catch_queue', 1, '$'),
- array_element('$catch_queue', 0, catch(_,Lev,Q)),
- '$db_clean_queues'(Lev),
+ array_element('$catch_queue', 0, catch(_,Lev,Q)), !,
update_array('$catch_queue', 0, Q),
+ '$db_clean_queues'(Lev),
+ '$erase_catch_elements'(Lev),
( C=X ->
'$current_module'(_,M0),
(A = M:G -> '$mod_switch'(M,G) ; '$mod_switch'(M0,A))
@@ -1211,15 +1214,19 @@
).
% normal exit: make sure we only erase what we should erase!
'$system_catch'(_,_,_,I,_) :-
+ '$erase_catch_elements'(I),
+ fail.
+
+'$erase_catch_elements'(I) :-
array_element('$catch_queue', 0, OldCatch),
'$erase_catch_elements'(OldCatch, I, Catch),
- update_array('$catch_queue', 0, Catch),
- fail.
+ update_array('$catch_queue', 0, Catch).
-'$system_catch_call'(X,G,I) :-
+'$system_catch_call'(X,G,I, NX) :-
array_element('$catch_queue', 0, OldCatch),
update_array('$catch_queue', 0, catch(X,I,OldCatch)),
'$execute0'(G),
+ NX is '$last_choice_pt',
( % on exit remove the catch
array_element('$catch_queue', 0, catch(X,I,Catch)),
update_array('$catch_queue', 0, Catch)
|
|
From: Vitor S. C. <vs...@us...> - 2001-06-11 15:12:10
|
Update of /cvsroot/yap
In directory usw-pr-cvs1:/tmp/cvs-serv31838
Modified Files:
TO_DO changes4.3.html config.guess config.sub configure
configure.in
Log Message:
support for configure 2.5
recover memory in catch/throw.
Index: changes4.3.html
===================================================================
RCS file: /cvsroot/yap/changes4.3.html,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- changes4.3.html 2001/06/08 19:10:43 1.26
+++ changes4.3.html 2001/06/11 15:12:07 1.27
@@ -16,6 +16,10 @@
<h2>Yap-4.3.19:</h2>
<ul>
+ <li>FIXED: upgrade to autoconf 2.5.</li>
+ <li>FIXED: catch and throw should not leave unnecessary
+ choice-points behind.</li>
+ <li>FIXED: make catch cleanup queue of findall entries.</li>
<li>FIXED: change catch and throw to use arrays.</li>
<li>CLEANUP: split TRAIL_REF.</li>
<li>FIXED: give correct type to FreeBlocks.</li>
Index: config.guess
===================================================================
RCS file: /cvsroot/yap/config.guess,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- config.guess 2001/04/09 19:53:27 1.1.1.1
+++ config.guess 2001/06/11 15:12:07 1.2
@@ -1,7 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
-#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+timestamp='2001-06-01'
+
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
[...1226 lines suppressed...]
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
Index: config.sub
===================================================================
RCS file: /cvsroot/yap/config.sub,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- config.sub 2001/04/09 19:53:27 1.1.1.1
+++ config.sub 2001/06/11 15:12:07 1.2
@@ -1,6 +1,10 @@
#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+timestamp='2001-05-30'
+
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
[...994 lines suppressed...]
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
Index: configure
===================================================================
RCS file: /cvsroot/yap/configure,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configure 2001/06/06 19:10:49 1.5
+++ configure 2001/06/11 15:12:07 1.6
@@ -1,46 +1,145 @@
#! /bin/sh
-
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by Autoconf 2.50.
#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
[...9930 lines suppressed...]
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
make depend
Index: configure.in
===================================================================
RCS file: /cvsroot/yap/configure.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- configure.in 2001/06/06 19:10:49 1.5
+++ configure.in 2001/06/11 15:12:07 1.6
@@ -12,7 +12,7 @@
AC_SUBST(C_INTERF_FLAGS)
AC_CYGWIN
-if test $ac_cv_cygwin = yes -a "$CC" = "gcc"
+if test "$ac_cv_cygwin" = "yes" -a "$CC" = "gcc"
then
CC="gcc -mno-cygwin"
fi
|