diff -ruN klic-3.003-2002-01-15a/Configure klic-3.003-2002-01-18/Configure
--- klic-3.003-2002-01-15a/Configure	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2002-01-18/Configure	Fri Jan 18 15:37:50 2002
@@ -456,7 +456,7 @@
 INCLUDESH=runtime/config/$disttype/config.h.sh
 fi
 
-if [ "$CROSS" = "false" ]; then
+if [ "$CROSS" = "false" ]; false; then
 : ::::::::::::::::::: SHARED Memory SETTING ::::::::::::::::::::
 echo ' '
 echo $n "Configure for shared memory parallel KLIC? "$c
diff -ruN klic-3.003-2002-01-15a/MANIFEST klic-3.003-2002-01-18/MANIFEST
--- klic-3.003-2002-01-15a/MANIFEST	Tue Jan  1 17:09:10 2002
+++ klic-3.003-2002-01-18/MANIFEST	Fri Jan 18 15:37:50 2002
@@ -171,6 +171,7 @@
 ./include/klic/sighndl.h
 ./include/klic/stdc.h
 ./include/klic/struct.h
+./include/klic/susp.h
 ./include/klic/unify.h
 ./klic-version
 ./rmon
@@ -379,7 +380,6 @@
 ./runtime/stack.kl1
 ./runtime/step.c
 ./runtime/step.h
-./runtime/susp.h
 ./runtime/sysc.c
 ./runtime/sysc.ext
 ./runtime/sysc.kl1
diff -ruN klic-3.003-2002-01-15a/include/klic/g_extinl.h klic-3.003-2002-01-18/include/klic/g_extinl.h
--- klic-3.003-2002-01-15a/include/klic/g_extinl.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2002-01-18/include/klic/g_extinl.h	Thu Jan  1 09:00:00 1970
@@ -1,18 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1993, 1995 Institute for New Generation Computer Technology 
-%       (Read COPYRIGHT for detailed information.) 
-%   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
-%       (Read COPYRIGHT-JIPDEC for detailed information.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_G_EXTINL_H_
-#define _KLIC_G_EXTINL_H_
-
-extern void GD_suspend();
-extern void GD_make_argblock();
-extern void GD_make_var();
-extern void GD_make_goal_of_new();
-extern void GD_make_goal_of_root();
-extern void GD_make_goal_of_mehtod();
-
-#endif /* _KLIC_G_EXTINL_H_ */
diff -ruN klic-3.003-2002-01-15a/include/klic/susp.h klic-3.003-2002-01-18/include/klic/susp.h
--- klic-3.003-2002-01-15a/include/klic/susp.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2002-01-18/include/klic/susp.h	Fri Jan 18 15:37:50 2002
@@ -0,0 +1,139 @@
+/* ---------------------------------------------------------- 
+%   (C)1994 Institute for New Generation Computer Technology 
+%       (Read COPYRIGHT for detailed information.) 
+%   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
+%       (Read COPYRIGHT-JIPDEC for detailed information.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_SUSP_H_
+#define _KLIC_SUSP_H_
+
+/******************************
+  Suspension Structures
+*******************************/
+
+/*
+  Variables _with_ suspended goals are represented as
+    a two-word pointer loop,
+    the second word being the suspension record structure.
+*/
+
+struct hook {
+  struct hook* next;		/* next suspension structure */
+  union goal_or_consumer {
+    long l;			/* long integer for tag manipulation */
+    struct goalrec* g;		/* pointer to a goal record */
+    struct consumer_object* o;	/* pointer to a consumer object */
+  } u;
+};
+
+#define CONSUMER_HOOK_TAG 1
+
+#define is_consumer_hook(u) \
+  ((u.l&CONSUMER_HOOK_TAG) == 1)
+
+#define tag_consumer_hook(obj) \
+  ((struct consumer_object*) ((long)(obj)+CONSUMER_HOOK_TAG))
+
+#define untag_consumer_hook(obj) \
+  ((struct consumer_object*) ((long)(obj)-CONSUMER_HOOK_TAG))
+
+struct susprec {
+  q backpt;
+  union {
+    struct hook first_hook;
+    long l;
+  } u;
+};
+
+#define suspp(x)	((struct susprec*) ((unsigned long)(x) - VARREF))
+
+#define allocnewsusp(var,srec)						\
+do{									\
+  q* temp;								\
+  heapalloc(temp, (sizeof(struct susprec))/sizeof(q)+1, (q*));		\
+  initnewsusp(temp, (var), (srec));					\
+}while(0)
+
+#define makenewsusp(var,srec,allocp)					\
+do{									\
+  initnewsusp((allocp), (var), (srec));					\
+  (allocp) += sizeof(struct susprec)/sizeof(q)+1;			\
+}while(0)
+
+#define initnewsusp(temp,var,srec)					\
+do{									\
+  (var) = makeref(temp);						\
+  (srec) = (struct susprec*) ((temp) + 1);				\
+  derefone(var) = (q) (srec);						\
+  (srec)->backpt = (var);						\
+  (srec)->u.first_hook.next = &(srec)->u.first_hook;			\
+}while(0)
+
+#define allochook(oldhook,newhook)					\
+do{									\
+  heapalloc((newhook), sizeof(struct hook)/sizeof(q), (struct hook*));	\
+  initnewhook((oldhook), (newhook));					\
+}while(0)
+
+#define addhook(oldhook,newhook,allocp)					\
+do{									\
+  (newhook) = (struct hook*) (allocp);					\
+  initnewhook((oldhook), (newhook));					\
+  (allocp) += sizeof(struct hook) / sizeof(q);				\
+}while(0)
+
+#define initnewhook(oldhook,newhook)					\
+do{									\
+  (newhook)->next= (oldhook)->next;					\
+  (oldhook)->next = (newhook);						\
+}while(0)
+
+/*
+  generator object support
+*/
+
+struct generator_susp {
+  q backpt;
+  union {
+    struct generator_object* o;
+    long l;
+  } u;
+};
+
+#define generator_suspp(susp) ((struct generator_susp*) (susp))
+
+#define GENERATOR_OBJECT_TAG 1
+
+#define is_generator_susp(u) \
+  ((u.l)&GENERATOR_OBJECT_TAG == 1)
+
+#define tag_generator_susp(obj) \
+  ((struct generator_object*) ((long)(obj) + GENERATOR_OBJECT_TAG))
+
+#define untag_generator_susp(obj) \
+  ((struct generator_object*) ((long)(obj) - GENERATOR_OBJECT_TAG))
+
+#define allocnewgensusp(var,gsusp) \
+do{ \
+  q* tmp; \
+  heapalloc(tmp, (sizeof(struct generator_susp))/sizeof(q)+1, (q*)); \
+  initnewgensusp(tmp, (var), (gsusp)); \
+}while(0)
+
+#define initnewgensusp(tmp, var, gsusp) \
+do{ \
+  (var) = makeref(tmp); \
+  (gsusp) = (struct generator_susp*) ((tmp) + 1); \
+  derefone(var) = (q) (gsusp); \
+  (gsusp)->backpt = (var); \
+}while(0)
+
+/* Perpetual Suspension Detection */
+
+struct suspended_goal_rec {
+  struct goalrec* goal;
+  struct suspended_goal_rec* next;
+};
+
+#endif /* _KLIC_SUSP_H_ */
diff -ruN klic-3.003-2002-01-15a/runtime/Makefile.tail klic-3.003-2002-01-18/runtime/Makefile.tail
--- klic-3.003-2002-01-15a/runtime/Makefile.tail	Mon Dec 31 12:04:47 2001
+++ klic-3.003-2002-01-18/runtime/Makefile.tail	Fri Jan 18 15:40:54 2002
@@ -478,7 +478,7 @@
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h
 gc.o: gc.c \
-    timing.h gobj.h susp.h \
+    timing.h gobj.h ../include/klic/susp.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
@@ -521,7 +521,7 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/unify.h
 faisus.o: faisus.c \
-    susp.h gobj.h \
+    ../include/klic/susp.h gobj.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/alloc.h ../include/klic/control.h \
@@ -533,7 +533,7 @@
     ../include/klic/alloc.h ../include/klic/control.h \
     schedule.h
 print.o: print.c \
-    gobj.h susp.h \
+    gobj.h ../include/klic/susp.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
@@ -541,7 +541,7 @@
     ../include/klic/functorstuffs.h ../include/klic/atomstuffs.h \
     ../include/klic/g_methtab.h
 unify.o: unify.c \
-    schedule.h gobj.h susp.h \
+    schedule.h gobj.h ../include/klic/susp.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
@@ -564,7 +564,7 @@
     ../include/klic/g_extern.h \
     ../include/klic/g_methtab.h ../include/klic/functorstuffs.h \
     ../include/klic/atomstuffs.h ../include/klic/gd_macro.h \
-    susp.h
+    ../include/klic/susp.h
 trace.o: trace.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -572,7 +572,7 @@
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
     ../include/klic/functorstuffs.h \
-    susp.h trace.h traceio.h 
+    ../include/klic/susp.h trace.h traceio.h 
 otbl.o: otbl.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -794,7 +794,7 @@
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/g_methtab.h ../include/klic/g_basic.h \
-    ../include/klic/gg_macro.h susp.h \
+    ../include/klic/gg_macro.h ../include/klic/susp.h \
     ../include/klic/gg_methtab.h
 atomt.o: atomt.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
@@ -1117,9 +1117,9 @@
     ../include/klic/atomstuffs.h ../include/klic/distpkt.h \
     ../include/klic/generic.h ../include/klic/index.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
-    gobj.h susp.h interpe.h rmon.h ge_exref.h
+    gobj.h ../include/klic/susp.h interpe.h rmon.h ge_exref.h
 datamsg.o: datamsg.c \
-    timing.h gobj.h susp.h interpe.h \
+    timing.h gobj.h ../include/klic/susp.h interpe.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
@@ -1144,7 +1144,7 @@
     ../include/klic/control.h ../include/klic/unify.h \
     ../include/klic/index.h ../include/klic/gb.h ../include/klic/bb.h \
     ../include/klic/g_basic.h ../include/klic/g_extern.h \
-    susp.h \
+    ../include/klic/susp.h \
     ../include/klic/gg_macro.h interpe.h \
     ../include/klic/distpkt.h ../include/klic/distio.h \
     ../include/klic/distproc.h ../include/klic/atomstuffs.h \
@@ -1260,7 +1260,7 @@
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
     ../include/klic/functorstuffs.h \
-    susp.h trace.h traceio.h \
+    ../include/klic/susp.h trace.h traceio.h \
     ../include/klic/distio.h ../include/klic/distproc.h 
 sched-d.o: sched-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
@@ -1311,7 +1311,7 @@
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
     ../include/klic/functorstuffs.h \
-    susp.h trace.h traceio.h \
+    ../include/klic/susp.h trace.h traceio.h \
     ../include/klic/distio.h ../include/klic/distproc.h 
 kmain-t.o: kmain-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
@@ -1344,19 +1344,19 @@
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
     ../include/klic/functorstuffs.h \
-    susp.h trace.h traceio.h 
+    ../include/klic/susp.h trace.h traceio.h 
 gc-t.o: gc-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/functorstuffs.h \
-    ../include/klic/g_methtab.h timing.h gobj.h susp.h
+    ../include/klic/g_methtab.h timing.h gobj.h ../include/klic/susp.h
 faisus-t.o: faisus-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/alloc.h ../include/klic/control.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
-    susp.h gobj.h
+    ../include/klic/susp.h gobj.h
 print-t.o: print-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -1364,13 +1364,13 @@
     ../include/klic/control.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/functorstuffs.h ../include/klic/atomstuffs.h \
     ../include/klic/g_methtab.h \
-    gobj.h susp.h
+    gobj.h ../include/klic/susp.h
 unify-t.o: unify-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/gb.h \
-    ../include/klic/g_methtab.h schedule.h gobj.h susp.h
+    ../include/klic/g_methtab.h schedule.h gobj.h ../include/klic/susp.h
 recsusp.o: recsusp.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h 
diff -ruN klic-3.003-2002-01-15a/runtime/alloc.c klic-3.003-2002-01-18/runtime/alloc.c
--- klic-3.003-2002-01-15a/runtime/alloc.c	Sat Jan 12 20:05:30 2002
+++ klic-3.003-2002-01-18/runtime/alloc.c	Fri Jan 18 15:37:50 2002
@@ -42,7 +42,7 @@
   heaplimit = real_heaplimit = new_space_top+heapsize;
   heapbottom = real_heaplimit+incrementsize;
   heaptop = heapp = new_space_top;
-  real_heapbytesize = (unsigned long)heaptop - (unsigned long)heapbottom;
+  real_heapbytesize = (unsigned long) heapbottom - (unsigned long) heaptop;
   this_more_space = 0;
   gc_hooktab_size = 32;
   num_gc_hooks = 0;
diff -ruN klic-3.003-2002-01-15a/runtime/cntlmsg.c klic-3.003-2002-01-18/runtime/cntlmsg.c
--- klic-3.003-2002-01-15a/runtime/cntlmsg.c	Mon Jan  7 15:17:49 2002
+++ klic-3.003-2002-01-18/runtime/cntlmsg.c	Fri Jan 18 15:37:50 2002
@@ -23,7 +23,7 @@
 
 #include "timing.h"
 #include "gobj.h"
-#include "susp.h"
+#include <klic/susp.h>
 #include "interpe.h"
 #include "rmon.h"
 #include "ge_exref.h"
diff -ruN klic-3.003-2002-01-15a/runtime/datamsg.c klic-3.003-2002-01-18/runtime/datamsg.c
--- klic-3.003-2002-01-15a/runtime/datamsg.c	Sun Jan 13 13:03:18 2002
+++ klic-3.003-2002-01-18/runtime/datamsg.c	Fri Jan 18 15:37:50 2002
@@ -26,7 +26,7 @@
 
 #include <klic/gb.h>
 #include "gobj.h"
-#include "susp.h"
+#include <klic/susp.h>
 
 #include <stdio.h>
 
diff -ruN klic-3.003-2002-01-15a/runtime/faisus.c klic-3.003-2002-01-18/runtime/faisus.c
--- klic-3.003-2002-01-15a/runtime/faisus.c	Sun Jan 13 11:09:27 2002
+++ klic-3.003-2002-01-18/runtime/faisus.c	Fri Jan 18 15:37:50 2002
@@ -11,7 +11,7 @@
 /* interrupt_goal, check_stack_for_alternatively */
 #include <klic/primitives.h>
 
-#include "susp.h"
+#include <klic/susp.h>
 #include <klic/generic.h>
 #include "gobj.h"
 
diff -ruN klic-3.003-2002-01-15a/runtime/gc.c klic-3.003-2002-01-18/runtime/gc.c
--- klic-3.003-2002-01-15a/runtime/gc.c	Sat Jan 12 20:06:35 2002
+++ klic-3.003-2002-01-18/runtime/gc.c	Fri Jan 18 15:37:50 2002
@@ -11,7 +11,7 @@
 #include <stdio.h>
 #include <klic/functorstuffs.h>  /* arityof */
 #include "gobj.h"
-#include "susp.h"
+#include <klic/susp.h>
 
 #ifdef DEBUGLIB
 #include "trace.h"  /* trace_deadlock */
diff -ruN klic-3.003-2002-01-15a/runtime/ge_exref.c klic-3.003-2002-01-18/runtime/ge_exref.c
--- klic-3.003-2002-01-15a/runtime/ge_exref.c	Sat Jan 12 20:05:30 2002
+++ klic-3.003-2002-01-18/runtime/ge_exref.c	Fri Jan 18 15:37:50 2002
@@ -15,7 +15,7 @@
 #include <klic/bb.h>
 #include <klic/g_basic.h>
 #include <klic/g_extern.h>
-#include "susp.h"
+#include <klic/susp.h>
 #include <klic/gg_macro.h>
 
 #include "interpe.h"
diff -ruN klic-3.003-2002-01-15a/runtime/generic.c klic-3.003-2002-01-18/runtime/generic.c
--- klic-3.003-2002-01-15a/runtime/generic.c	Tue Jan 15 10:41:31 2002
+++ klic-3.003-2002-01-18/runtime/generic.c	Fri Jan 18 15:37:50 2002
@@ -12,7 +12,7 @@
 #include <klic/atomstuffs.h>
 #include <stdio.h>
 #include <klic/gd_macro.h>
-#include "susp.h"
+#include <klic/susp.h>
 #include <klic/distpkt.h>  /* combuf */
 
 #define G_NEW_GOAL &predicate_generic_xnew_3
diff -ruN klic-3.003-2002-01-15a/runtime/gg_shbusy.c klic-3.003-2002-01-18/runtime/gg_shbusy.c
--- klic-3.003-2002-01-15a/runtime/gg_shbusy.c	Sat Jan 12 13:23:24 2002
+++ klic-3.003-2002-01-18/runtime/gg_shbusy.c	Fri Jan 18 15:37:50 2002
@@ -14,7 +14,7 @@
 #include <klic/g_methtab.h>
 #include <klic/g_basic.h>
 #include <klic/gg_macro.h>
-#include "susp.h"
+#include <klic/susp.h>
 #include "shm.h"
 
 #define GG_CLASS_NAME() shbusy
diff -ruN klic-3.003-2002-01-15a/runtime/gg_shvar.c klic-3.003-2002-01-18/runtime/gg_shvar.c
--- klic-3.003-2002-01-15a/runtime/gg_shvar.c	Sat Jan 12 13:20:15 2002
+++ klic-3.003-2002-01-18/runtime/gg_shvar.c	Fri Jan 18 15:37:50 2002
@@ -11,7 +11,7 @@
 #include <klic/g_methtab.h>
 #include <klic/g_basic.h>
 #include <klic/gg_macro.h>
-#include "susp.h"
+#include <klic/susp.h>
 #include "gobj.h"
 #include "shm.h"
 
diff -ruN klic-3.003-2002-01-15a/runtime/print.c klic-3.003-2002-01-18/runtime/print.c
--- klic-3.003-2002-01-15a/runtime/print.c	Fri Jan 11 09:58:24 2002
+++ klic-3.003-2002-01-18/runtime/print.c	Fri Jan 18 15:37:50 2002
@@ -13,7 +13,7 @@
 #include <klic/atomstuffs.h>  /* functoratomname, namestringof */
 #include <stdio.h>
 #include "gobj.h"
-#include "susp.h"
+#include <klic/susp.h>
 
 #ifdef DEBUGLIB
 #include "trace.h"  /* subterm_sp, fprint_goal */
diff -ruN klic-3.003-2002-01-15a/runtime/random.c klic-3.003-2002-01-18/runtime/random.c
--- klic-3.003-2002-01-15a/runtime/random.c	Sun Jan  6 13:29:43 2002
+++ klic-3.003-2002-01-18/runtime/random.c	Fri Jan 18 15:37:50 2002
@@ -14,7 +14,7 @@
 #include <klic/g_methtab.h>
 #include <klic/g_basic.h>
 #include <klic/gg_macro.h>
-#include "susp.h"
+#include <klic/susp.h>
 
 #include <stdio.h>
 
diff -ruN klic-3.003-2002-01-15a/runtime/shm_gc.c klic-3.003-2002-01-18/runtime/shm_gc.c
--- klic-3.003-2002-01-15a/runtime/shm_gc.c	Wed Jan  2 14:44:16 2002
+++ klic-3.003-2002-01-18/runtime/shm_gc.c	Fri Jan 18 15:37:50 2002
@@ -12,7 +12,7 @@
 #include <klic/primitives.h>
 #include <klic/functorstuffs.h>  /* arityof */
 #include "gobj.h"
-#include "susp.h"
+#include <klic/susp.h>
 #include "shm.h"
 #include <time.h>
 
diff -ruN klic-3.003-2002-01-15a/runtime/shm_obj.c klic-3.003-2002-01-18/runtime/shm_obj.c
--- klic-3.003-2002-01-15a/runtime/shm_obj.c	Wed Jan  2 14:44:16 2002
+++ klic-3.003-2002-01-18/runtime/shm_obj.c	Fri Jan 18 15:37:50 2002
@@ -12,7 +12,7 @@
 #include <klic/functorstuffs.h>
 #include <klic/index.h>
 #include <klic/unify.h>
-#include "susp.h"
+#include <klic/susp.h>
 #include <klic/gg_macro.h>
 #include "shm.h"
 
diff -ruN klic-3.003-2002-01-15a/runtime/shm_throw.c klic-3.003-2002-01-18/runtime/shm_throw.c
--- klic-3.003-2002-01-15a/runtime/shm_throw.c	Wed Jan  2 14:44:16 2002
+++ klic-3.003-2002-01-18/runtime/shm_throw.c	Fri Jan 18 15:37:50 2002
@@ -10,7 +10,7 @@
 #include <klic/primitives.h>
 #include <klic/unify.h>
 #include <klic/functorstuffs.h>  /* arityof */
-#include "susp.h"
+#include <klic/susp.h>
 #include "gobj.h"
 #include "shm.h"  /* last_shm_var */
 #include <signal.h>
diff -ruN klic-3.003-2002-01-15a/runtime/susp.h klic-3.003-2002-01-18/runtime/susp.h
--- klic-3.003-2002-01-15a/runtime/susp.h	Fri Dec 28 13:46:47 2001
+++ klic-3.003-2002-01-18/runtime/susp.h	Thu Jan  1 09:00:00 1970
@@ -1,139 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994 Institute for New Generation Computer Technology 
-%       (Read COPYRIGHT for detailed information.) 
-%   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
-%       (Read COPYRIGHT-JIPDEC for detailed information.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_SUSP_H_
-#define _KLIC_SUSP_H_
-
-/******************************
-  Suspension Structures
-*******************************/
-
-/*
-  Variables _with_ suspended goals are represented as
-    a two-word pointer loop,
-    the second word being the suspension record structure.
-*/
-
-struct hook {
-  struct hook* next;		/* next suspension structure */
-  union goal_or_consumer {
-    long l;			/* long integer for tag manipulation */
-    struct goalrec* g;		/* pointer to a goal record */
-    struct consumer_object* o;	/* pointer to a consumer object */
-  } u;
-};
-
-#define CONSUMER_HOOK_TAG 1
-
-#define is_consumer_hook(u) \
-  ((u.l&CONSUMER_HOOK_TAG) == 1)
-
-#define tag_consumer_hook(obj) \
-  ((struct consumer_object*) ((long)(obj)+CONSUMER_HOOK_TAG))
-
-#define untag_consumer_hook(obj) \
-  ((struct consumer_object*) ((long)(obj)-CONSUMER_HOOK_TAG))
-
-struct susprec {
-  q backpt;
-  union {
-    struct hook first_hook;
-    long l;
-  } u;
-};
-
-#define suspp(x)	((struct susprec*) ((unsigned long)(x) - VARREF))
-
-#define allocnewsusp(var,srec)						\
-do{									\
-  q* temp;								\
-  heapalloc(temp, (sizeof(struct susprec))/sizeof(q)+1, (q*));		\
-  initnewsusp(temp, (var), (srec));					\
-}while(0)
-
-#define makenewsusp(var,srec,allocp)					\
-do{									\
-  initnewsusp((allocp), (var), (srec));					\
-  (allocp) += sizeof(struct susprec)/sizeof(q)+1;			\
-}while(0)
-
-#define initnewsusp(temp,var,srec)					\
-do{									\
-  (var) = makeref(temp);						\
-  (srec) = (struct susprec*) ((temp) + 1);				\
-  derefone(var) = (q) (srec);						\
-  (srec)->backpt = (var);						\
-  (srec)->u.first_hook.next = &(srec)->u.first_hook;			\
-}while(0)
-
-#define allochook(oldhook,newhook)					\
-do{									\
-  heapalloc((newhook), sizeof(struct hook)/sizeof(q), (struct hook*));	\
-  initnewhook((oldhook), (newhook));					\
-}while(0)
-
-#define addhook(oldhook,newhook,allocp)					\
-do{									\
-  (newhook) = (struct hook*) (allocp);					\
-  initnewhook((oldhook), (newhook));					\
-  (allocp) += sizeof(struct hook) / sizeof(q);				\
-}while(0)
-
-#define initnewhook(oldhook,newhook)					\
-do{									\
-  (newhook)->next= (oldhook)->next;					\
-  (oldhook)->next = (newhook);						\
-}while(0)
-
-/*
-  generator object support
-*/
-
-struct generator_susp {
-  q backpt;
-  union {
-    struct generator_object* o;
-    long l;
-  } u;
-};
-
-#define generator_suspp(susp) ((struct generator_susp*) (susp))
-
-#define GENERATOR_OBJECT_TAG 1
-
-#define is_generator_susp(u) \
-  ((u.l)&GENERATOR_OBJECT_TAG == 1)
-
-#define tag_generator_susp(obj) \
-  ((struct generator_object*) ((long)(obj) + GENERATOR_OBJECT_TAG))
-
-#define untag_generator_susp(obj) \
-  ((struct generator_object*) ((long)(obj) - GENERATOR_OBJECT_TAG))
-
-#define allocnewgensusp(var,gsusp) \
-do{ \
-  q* tmp; \
-  heapalloc(tmp, (sizeof(struct generator_susp))/sizeof(q)+1, (q*)); \
-  initnewgensusp(tmp, (var), (gsusp)); \
-}while(0)
-
-#define initnewgensusp(tmp, var, gsusp) \
-do{ \
-  (var) = makeref(tmp); \
-  (gsusp) = (struct generator_susp*) ((tmp) + 1); \
-  derefone(var) = (q) (gsusp); \
-  (gsusp)->backpt = (var); \
-}while(0)
-
-/* Perpetual Suspension Detection */
-
-struct suspended_goal_rec {
-  struct goalrec* goal;
-  struct suspended_goal_rec* next;
-};
-
-#endif /* _KLIC_SUSP_H_ */
diff -ruN klic-3.003-2002-01-15a/runtime/trace.c klic-3.003-2002-01-18/runtime/trace.c
--- klic-3.003-2002-01-15a/runtime/trace.c	Tue Jan  1 14:17:47 2002
+++ klic-3.003-2002-01-18/runtime/trace.c	Fri Jan 18 15:37:50 2002
@@ -11,7 +11,7 @@
 #include <klic/predinfo.h>
 #include <klic/generic.h>
 #include <klic/functorstuffs.h>  /* arityof */
-#include "susp.h"
+#include <klic/susp.h>
 #include <stdio.h>
 #include <setjmp.h>
 
diff -ruN klic-3.003-2002-01-15a/runtime/unify.c klic-3.003-2002-01-18/runtime/unify.c
--- klic-3.003-2002-01-15a/runtime/unify.c	Tue Jan 15 17:52:57 2002
+++ klic-3.003-2002-01-18/runtime/unify.c	Fri Jan 18 15:37:50 2002
@@ -12,7 +12,7 @@
 #include "schedule.h"
 #include <klic/gb.h>
 #include "gobj.h"
-#include "susp.h"
+#include <klic/susp.h>
 #include <klic/unify.h>  /* do_unify* */
 #ifdef DEBUGLIB
 #include "trace.h"  /* trace_flag, trace_resumption */
