more bug fixes:

- make readline use packages, not old YAP code
- fix ! over backtrack cps
- fix write list
This commit is contained in:
ubu32
2011-02-15 05:54:19 -08:00
parent 140318ff16
commit 57f5ef8cfc
18 changed files with 341 additions and 403 deletions

View File

@@ -1556,26 +1556,28 @@ prune(choiceptr cp)
if (ASP > (CELL *)PROTECT_FROZEN_B(B))
ASP = (CELL *)PROTECT_FROZEN_B(B);
while (B->cp_b < cp) {
if (POP_CHOICE_POINT(cp))
if (POP_CHOICE_POINT(B->cp_b))
{
POP_EXECUTE();
}
B = B->cp_b;
}
}
if (POP_CHOICE_POINT(B->cp_b))
{
POP_EXECUTE();
}
#ifdef YAPOR
CUT_prune_to(cp);
CUT_prune_to(cp);
#endif /* YAPOR */
if (SHOULD_CUT_UP_TO(B,cp)) {
/* cut ! */
#ifdef TABLING
abolish_incomplete_subgoals(B);
abolish_incomplete_subgoals(B);
#endif /* TABLING */
HB = PROTECT_FROZEN_H(B->cp_b);
HB = PROTECT_FROZEN_H(B->cp_b);
#include "trim_trail.h"
B = B->cp_b;
SET_BB(PROTECT_FROZEN_B(B));
}
B = B->cp_b;
SET_BB(PROTECT_FROZEN_B(B));
}
}
static inline

View File

@@ -548,7 +548,7 @@ Yap_unify_constant(register Term a, register Term cons)
static inline int
do_cut(int i) {
#ifdef CUT_C
while (POP_CHOICE_POINT(B->cp_b)) {
if (POP_CHOICE_POINT(B->cp_b)) {
cut_c_pop();
}
#endif

View File

@@ -31,9 +31,8 @@ struct cut_c_str{
}
#define POP_CHOICE_POINT(B) \
(((CELL *)Yap_REGS.CUT_C_TOP != (CELL *)Yap_LocalBase) && ((CELL *)B == (CELL *)Yap_REGS.CUT_C_TOP))
//(((int)Yap_REGS.CUT_C_TOP != (int)Yap_LocalBase) && ((int)B > (int)Yap_REGS.CUT_C_TOP))
#define POP_CHOICE_POINT(cp) \
(((CELL *)Yap_REGS.CUT_C_TOP != (CELL *)Yap_LocalBase) && ((CELL *)(cp) > (CELL *)Yap_REGS.CUT_C_TOP))
#define POP_EXECUTE() \

View File

@@ -23,6 +23,8 @@
#include <stdio.h>
#include <wchar.h>
#include "SWI-Stream.h"
#ifndef YAP_STDIO
#define YP_printf printf