diff -ruN klic-3.003-2002-03-16/Configure klic-3.003-2002-03-19/Configure
--- klic-3.003-2002-03-16/Configure	Fri Mar  8 14:27:38 2002
+++ klic-3.003-2002-03-19/Configure	Tue Mar 19 14:12:12 2002
@@ -401,19 +401,10 @@
 echo $n "Configure also for parallel implementations? "$c
 if ask_yes_or_no no DEF_PARALLEL; then
 PARALELL=true
-echo $n "Configure for distributed memory parallel KLIC? "$c
-if ask_yes_or_no no DEF_DISTSYSTEM; then
 DISTSYSTEM=true
 ARCHIVES="$ARCHIVES libklicd.a"
 DLLIBS="$DLLIBS libklicd\$(DLLEXT)"
 else
-disttype=pvm
-#INCLUDESH=runtime/config/$disttype/config.h.sh
-DISTSYSTEM=false
-ROOTMAKE=root.mk.sh
-INCLUDESH="config.h.sh"
-fi
-else
 PARALLEL=false
 disttype=pvm
 #INCLUDESH=runtime/config/$disttype/config.h.sh
@@ -454,25 +445,6 @@
 
 ROOTMAKE=runtime/config/$disttype/root.mk.sh
 INCLUDESH=runtime/config/$disttype/config.h.sh
-fi
-
-if [ "$CROSS" = "false" ]; false; then
-: ::::::::::::::::::: SHARED Memory SETTING ::::::::::::::::::::
-echo ' '
-echo $n "Configure for shared memory parallel KLIC? "$c
-if ask_yes_or_no no DEF_SHMSYSTEM; then
-  guess_arch
-  if [ $CPU != "Unknown_cpu" ]; then
-     ARCHIVES="$ARCHIVES libklics.a"
-     DLLIBS="$DLLIBS libklics$(DLLEXT)"
-  else 
-    cat <<GAZONK
-# I do not know this machine.
-# Sorry I cannot install Shared-memory parallel KLIC.
-
-GAZONK
-fi
-fi
 fi
 fi
 
diff -ruN klic-3.003-2002-03-16/MANIFEST klic-3.003-2002-03-19/MANIFEST
--- klic-3.003-2002-03-16/MANIFEST	Fri Mar  8 14:27:56 2002
+++ klic-3.003-2002-03-19/MANIFEST	Tue Mar 19 14:14:06 2002
@@ -292,8 +292,6 @@
 ./runtime/gen.kl1
 ./runtime/generic.c
 ./runtime/gfloat.c
-./runtime/gg_shbusy.c
-./runtime/gg_shvar.c
 ./runtime/ggoal.c
 ./runtime/gio.c
 ./runtime/gmerge.c
@@ -367,12 +365,6 @@
 ./runtime/setks.ext
 ./runtime/setks.kl1
 ./runtime/setupcomm
-./runtime/shm.h
-./runtime/shm_gc.c
-./runtime/shm_machine.h
-./runtime/shm_obj.c
-./runtime/shm_rsv.c
-./runtime/shm_throw.c
 ./runtime/signal.c
 ./runtime/splay.c
 ./runtime/splay.ext
@@ -411,57 +403,6 @@
 ./runtime/wakeup.c
 ./runtime/xio.c
 ./sendreport.sh
-./shmtest
-./shmtest/Makefile
-./shmtest/cmpdir
-./shmtest/cmpdir/forward_goal.out
-./shmtest/cmpdir/general_unify_1.out
-./shmtest/cmpdir/general_unify_2.out
-./shmtest/cmpdir/multiple_wait.out
-./shmtest/cmpdir/nqueen12.out
-./shmtest/cmpdir/nqueen13.out
-./shmtest/cmpdir/nqueen14.out
-./shmtest/cmpdir/read.out
-./shmtest/cmpdir/slife.out
-./shmtest/cmpdir/t0thr1.out
-./shmtest/cmpdir/t0thr2.out
-./shmtest/cmpdir/t0thr3.out
-./shmtest/cmpdir/throw.out
-./shmtest/cmpdir/unify.out
-./shmtest/cmpdir/unify_exrefs.out
-./shmtest/cmpdir/vector_built.out
-./shmtest/cmpdir/vector_built_2.out
-./shmtest/cmpdir/wec_exhaust_1.out
-./shmtest/cmpdir/wec_exhaust_2.out
-./shmtest/cmpdir/wec_exhaust_3.out
-./shmtest/cmpdir/wec_indirect.out
-./shmtest/dlife.kl1
-./shmtest/forward_goal.kl1
-./shmtest/general_unify_1.kl1
-./shmtest/general_unify_2.kl1
-./shmtest/lib.kl1
-./shmtest/mesh.kl1
-./shmtest/multiple_wait.kl1
-./shmtest/nq13.kl1
-./shmtest/nqueen.kl1
-./shmtest/read.kl1
-./shmtest/report.perl
-./shmtest/rlib.kl1
-./shmtest/slife.kl1
-./shmtest/stat.perl
-./shmtest/statistics.pl
-./shmtest/t0thr1.kl1
-./shmtest/t0thr2.kl1
-./shmtest/t0thr3.kl1
-./shmtest/throw.kl1
-./shmtest/unify.kl1
-./shmtest/unify_exrefs.kl1
-./shmtest/vector_built.kl1
-./shmtest/vector_built_2.kl1
-./shmtest/wec_exhaust_1.kl1
-./shmtest/wec_exhaust_2.kl1
-./shmtest/wec_exhaust_3.kl1
-./shmtest/wec_indirect.kl1
 ./test
 ./test/Makefile
 ./test/atomfunc.kl1
diff -ruN klic-3.003-2002-03-16/Makefile.tail klic-3.003-2002-03-19/Makefile.tail
--- klic-3.003-2002-03-16/Makefile.tail	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/Makefile.tail	Tue Mar 19 14:15:25 2002
@@ -176,13 +176,6 @@
 		distclean all-test;
 	echo 'Distributed mem. imp.: OK' >disttests.log
 
-shmtests:	compilerdir runtimedir $(DLLTARGET)
-	cd shmtest; \
-	LD_LIBRARY_PATH=../runtime:${LD_LIBRARY_PATH}; \
-	export LD_LIBRARY_PATH; \
-	$(MAKE) PARALLEL="$(PARALLEL)" KLICOPT="$(KLICOPT)" NODES="$(NODES)" \
-		distclean all-test
-
 install-basics: all install-compiler install-runtime $(DLLINSTALLTARGET) install-include
 
 install-compiler: compilerdir
@@ -256,7 +249,6 @@
 	cd runtime; $(MAKE) clean LN="$(LN)" DLLIBS="$(DLLIBS)"
 	cd test; $(MAKE) clean
 	cd disttest; $(MAKE) clean
-	cd shmtest; $(MAKE) clean
 	cd documents; $(MAKE) clean
 	cd rmon; $(MAKE) clean
 	- /bin/rm -f core Makefile.bak *~ \#*\#
@@ -267,7 +259,6 @@
 	cd runtime; $(MAKE) distclean LN="$(LN)" DLLIBS="$(DLLIBS)"
 	cd test; $(MAKE) distclean
 	cd disttest; $(MAKE) distclean
-	cd shmtest; $(MAKE) distclean
 	cd documents; $(MAKE) distclean
 	cd rmon; $(MAKE) distclean
 	- /bin/rm -f Makefile core Makefile.bak config.tmp config.sh \
@@ -280,7 +271,6 @@
 	cd runtime; $(MAKE) realclean LN="$(LN)" DLLIBS="$(DLLIBS)"
 	cd test; $(MAKE) realclean
 	cd disttest; $(MAKE) realclean
-	cd shmtest; $(MAKE) realclean
 	cd documents; $(MAKE) realclean
 	cd rmon; $(MAKE) realclean
 	- /bin/rm -f Makefile core *.bak *.orig version.sed \
diff -ruN klic-3.003-2002-03-16/compiler/klic.c klic-3.003-2002-03-19/compiler/klic.c
--- klic-3.003-2002-03-16/compiler/klic.c	Tue Feb 26 16:48:44 2002
+++ klic-3.003-2002-03-19/compiler/klic.c	Tue Mar 19 14:21:17 2002
@@ -214,7 +214,6 @@
 /* Options */
 
 static char distklic = 0;  /***** added for klicdist *****/
-static char shmklic = 0;  /***** added for klicshm *****/
 
 static char* ofile = NULL;
 static int optlevel = 0;
@@ -508,9 +507,6 @@
     /*** for Distributed KLIC system ***/
     if (distklic) {
       sprintf(bufp, DIST_COMPILER_FLAG, klic_incdir, name, inf->ext);
-    } else if ( shmklic ) {
-      sprintf(bufp, " -DSHM -I%s -I. %s%s",
-        klic_incdir, name, inf->ext);
     } else {
       sprintf(bufp, " -I%s -I. %s%s",
         klic_incdir, name, inf->ext);
@@ -636,8 +632,6 @@
     char* tptr;
     if ( distklic ) {
       tptr = LIBRARIES_D;
-    } else if ( shmklic ) {
-      tptr = LIBRARIES_S;
     } else if ( debug ) {
       tptr = LIBRARIES_T;
     } else {
@@ -781,10 +775,6 @@
 	parallelism = atoi(Optarg()); goto nextarg;
       case 'R': do_recompile = 1; break;
       case 'S': make_asm = 1; break;
-      case 's':
-	if (strcmp(argv[optind],"-shm")==0) {
-	  shmklic = 1; goto nextarg;
-	}
       case 'v': verbose = 1; break;
       case 'n': debug = 0; break;
       case 't':
diff -ruN klic-3.003-2002-03-16/include/Makefile.tail klic-3.003-2002-03-19/include/Makefile.tail
--- klic-3.003-2002-03-16/include/Makefile.tail	Sat Feb 16 10:54:11 2002
+++ klic-3.003-2002-03-19/include/Makefile.tail	Tue Mar 19 14:22:56 2002
@@ -8,8 +8,6 @@
 DISTHEADERS = klic/distio.h klic/distproc.h klic/distpkt.h $(DISTMHEADERS)
               # klic/interpe.h klic/rmon.h
 
-SHMHEADERS = # klic/shm.h klic/shm_machine.h
-
 HEADERS = klic/config.h \
 	klic/alloc.h klic/atomstuffs.h \
 	klic/basic.h klic/bb.h klic/control.h \
@@ -31,14 +29,11 @@
 	# klic/trace.h klic/traceio.h klic/timer.h
 	# klic/g_pointer.h klic/g_termarray.h klic/asyncio.h
 
-
-#ls:
-#	ls ${HEADERS} ${DISTHEADERS} ${SHMHEADERS}
 install:
 	- $(INSTDIR) $(KLICINCLUDE)/klic
 	if (test `pwd` != $(KLICINCLUDE)) then \
 	 	($(INSTALLHDR) $(HEADERS) $(KLICINCLUDE)/klic);\
-		for file in $(DISTHEADERS) $(SHMHEADERS); \
+		for file in $(DISTHEADERS); \
 		do test -f $$file && \
 			$(INSTALLHDR) $$file $(KLICINCLUDE)/klic;\
 		done;\
diff -ruN klic-3.003-2002-03-16/include/klic/basic.h klic-3.003-2002-03-19/include/klic/basic.h
--- klic-3.003-2002-03-16/include/klic/basic.h	Mon Jan 21 20:55:25 2002
+++ klic-3.003-2002-03-19/include/klic/basic.h	Tue Mar 19 14:23:49 2002
@@ -35,10 +35,7 @@
 extern void debug_fprintf();
 extern void klic_fprintf();
 
-/*
-  PARALLEL flag is DIST || SHM.
-*/
-#if defined(DIST) || defined(SHM)
+#ifdef DIST
 #define PARALLEL
 #endif
 
diff -ruN klic-3.003-2002-03-16/include/klic/g_methtab.h klic-3.003-2002-03-19/include/klic/g_methtab.h
--- klic-3.003-2002-03-16/include/klic/g_methtab.h	Mon Mar 11 13:21:48 2002
+++ klic-3.003-2002-03-19/include/klic/g_methtab.h	Tue Mar 19 14:24:19 2002
@@ -41,7 +41,6 @@
 		   struct data_object *another_obj */ );
   q (*hash)( /* struct data_object *obj, unsigned long level */ );
   q (*encode)(/* struct data_object *obj, long node */);
-  q (*shmcopy)(/* struct data_object *obj */);
 };
 
 #define data_objectp(obj) \
diff -ruN klic-3.003-2002-03-16/include/klic/gd_macro.h klic-3.003-2002-03-19/include/klic/gd_macro.h
--- klic-3.003-2002-03-16/include/klic/gd_macro.h	Mon Mar 11 17:41:07 2002
+++ klic-3.003-2002-03-19/include/klic/gd_macro.h	Tue Mar 19 14:24:44 2002
@@ -431,9 +431,4 @@
     combuf *buffer; \
     long depth;
 
-#define GDDEF_SHMCOPY() \
- q \
-  GD_rappend(encode) (GD_SELF) \
-    GD_OBJ_TYPE * GD_SELF;
-
 #endif /* _KLIC_GD_MACRO_H_ */
diff -ruN klic-3.003-2002-03-16/include/klic/gd_methtab.h klic-3.003-2002-03-19/include/klic/gd_methtab.h
--- klic-3.003-2002-03-16/include/klic/gd_methtab.h	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/include/klic/gd_methtab.h	Tue Mar 19 14:26:10 2002
@@ -34,7 +34,6 @@
 
 extern q GD_STD_HASH(struct data_object* GD_SELF, long level);
 extern q GD_STD_ENCODE(struct data_object* self, void* buffer);
-extern q GD_STD_SHMCOPY(struct data_object* self);
 
 
 struct data_object_method_table GD_method_table
@@ -97,12 +96,6 @@
  GD_STD_ENCODE ,
 #else
  GD_rappend(encode) ,
-#endif
-
-#ifndef GDUSE_MY_SHMCOPY
- GD_STD_SHMCOPY
-#else
- GD_rappend(encode)
 #endif
 };
 
diff -ruN klic-3.003-2002-03-16/include/klic/struct.h klic-3.003-2002-03-19/include/klic/struct.h
--- klic-3.003-2002-03-16/include/klic/struct.h	Tue Feb 26 12:32:09 2002
+++ klic-3.003-2002-03-19/include/klic/struct.h	Tue Mar 19 14:27:34 2002
@@ -202,20 +202,6 @@
    /* parallel comm Imp. */
     long my_num0;
     long num_pes0;
-    union {
-      /* shared-memory Imp. */
-      struct {
-	long queued0;
-	struct ex_goalrec* ex_qp0;
-	long currid0;
-	long oldid0;
-	long shm_htop0;
-	long shm_hbyte0;
-	long dummy[10];
-      } shm;
-      /* dist-memory Imp. */
-
-    } aux;
   } par;
 
   q generic_arg0[MAXGENERICARGS]; /* arguments of generic methods */
diff -ruN klic-3.003-2002-03-16/runtime/Makefile.tail klic-3.003-2002-03-19/runtime/Makefile.tail
--- klic-3.003-2002-03-16/runtime/Makefile.tail	Fri Mar  8 15:35:46 2002
+++ klic-3.003-2002-03-19/runtime/Makefile.tail	Tue Mar 19 13:56:28 2002
@@ -5,7 +5,6 @@
 #       (Read COPYRIGHT-JIPDEC for detailed information.)
 # ----------------------------------------------------------
 
-SHMCFLAGS = $(CFLAGS) -DSHM -I../include
 DEFINITIONS=$(DISTCFLAGS) -I../include 
 KLIC =  ../compiler/klic -P$(PARALLEL) $(KLICOPT) \
 	-R -I../include -X. -K$(KL1CMP) -D../compiler/klicdb -v 
@@ -73,7 +72,6 @@
 KL1NODCSRCS = bodyblt.c gunix.c io.c
 KL1DOBJS = bodyblt-d.o gunix-d.o io-d.o
 KL1DSRCS = bodyblt-d.c gunix-d.c io-d.c
-KL1SOBJS = bodyblt-s.o gunix-s.o io.o
 
 EXTS = $(COMMONKL1EXTS) $(KL1EXTS)
 
@@ -99,10 +97,6 @@
 DDEBUGOBJS = debug-d.o gc.o trace-d.o step-d.o
 DDEBUGSRCS = debug-d.c gc.c trace-d.c step-d.c
 
-SDEBUGOBJS = $(DEBUGOBJS) $(GENERIC_SHMOBJS) \
-	kmain-s.o options-s.o debug-s.o newatom-s.o sched-s.o \
-	intrpt-s.o gc-s.o trace-s.o step-s.o
-
 COMMON_GENERIC_SRCS = \
 	gtermarray.c gmerge.c gcode.c gmodule.c ggoal.c gpointer.c random.c
 COMMON_GENERIC_OBJS = \
@@ -112,7 +106,6 @@
 GENERIC_SEQOBJS = gfloat.o gio.o gmvv.o gstring.o
 GENERIC_DSRCS = gfloat-d.c gio-d.c gmvv-d.c gstring-d.c
 GENERIC_DOBJS = gfloat-d.o gio-d.o gmvv-d.o gstring-d.o
-GENERIC_SHMOBJS = gfloat-s.o gio.o gmvv-s.o gstring-s.o
 
 GENERIC_SRCS = $(COMMON_GENERIC_SRCS) $(GENERIC_SEQSRCS)
 
@@ -128,16 +121,9 @@
 	init_dist.o sendrecv.o distrmon.o profile.o \
 	$(DIST_OTHER_OBJS) $(DIST_GENERIC_OBJS)
 
-SHM_GENERIC_SRCS = gg_shvar.c gg_shbusy.c
-SHM_GENERIC_OBJS = gg_shvar.o gg_shbusy.o
-
-SHMSRCS = shm_rsv.c shm_throw.c shm_obj.c shm_gc.c
-SHMOBJS = shm_rsv.o shm_throw.o shm_obj.o shm_gc.o
-
 ALLOBJS = $(COMMONOBJS) $(DEBUGOBJS) \
-	$(KL1NODOBJS) $(KL1DOBJS) $(KL1SOBJS) $(NODOBJS) $(DOBJS) \
-	$(NODDEBUGOBJS) $(DDEBUGOBJS) $(SDEBUGOBJS) \
-	$(DISTOBJS) $(SHMOBJS) $(SHM_GENERIC_OBJS)
+	$(KL1NODOBJS) $(KL1DOBJS) $(NODOBJS) $(DOBJS) \
+	$(NODDEBUGOBJS) $(DDEBUGOBJS) $(DISTOBJS)
 
 uplevel:
 	cd ..;make runtimedir
@@ -162,11 +148,6 @@
 	ar rcv $@ $?
 	$(RANLIB) $@
 
-libklics.a: $(COMMONOBJS) $(KL1SOBJS) $(SDEBUGOBJS) \
-	$(SHM_GENERIC_OBJS) $(SHMOBJS)
-	ar rcv $@ $?
-	$(RANLIB) $@
-
 libklic$(DLLEXT): $(COMMONOBJS) $(KL1NODOBJS) $(NODOBJS)
 	$(LDSHARED) -o $@ $?
 
@@ -178,10 +159,6 @@
 	$(DDEBUGOBJS) $(DOBJS) $(DISTOBJS)
 	$(LDSHARED) -o $@ $?
 
-libklics$(DLLEXT): $(COMMONOBJS) $(KL1SOBJS) $(SDEBUGOBJS) \
-	$(SHM_GENERIC_OBJS) $(SHMOBJS)
-	$(LDSHARED) -o $@ $?
-
 kmain-d.c: kmain.c
 	rm -f $@; $(LN) $? $@
 debug-d.c: debug.c
@@ -262,43 +239,6 @@
 pipedio: pipedio.c
 	$(CC) $(CFLAGS) $(LDFLAGS) -I../include -o pipedio pipedio.c
 
-kmain-s.o: kmain.c options.h
-	$(CC) $(SHMCFLAGS) -c -o kmain-s.o kmain.c
-options-s.o: options.c
-	$(CC) $(SHMCFLAGS) -c -o options-s.o options.c
-gc-s.o: gc.c
-	$(CC) $(SHMCFLAGS) -c -o gc-s.o gc.c
-debug-s.o: debug.c
-	$(CC) $(SHMCFLAGS) -c -o debug-s.o debug.c
-sched-s.o: sched.c
-	$(CC) $(SHMCFLAGS) -c -o sched-s.o sched.c
-newatom-s.o: newatom.c
-	$(CC) $(SHMCFLAGS) -c -o newatom-s.o newatom.c
-bodyblt-s.o: bodyblt.c
-	$(CC) $(SHMCFLAGS) -c -o bodyblt-s.o bodyblt.c
-gunix-s.o: gunix.c
-	$(CC) $(SHMCFLAGS) -c -o gunix-s.o gunix.c
-gmvv-s.o: gmvv.c
-	$(CC) $(SHMCFLAGS) -c -o gmvv-s.o gmvv.c
-gstring-s.o: gstring.c
-	$(CC) $(SHMCFLAGS) -c -o gstring-s.o gstring.c
-gfloat-s.o: gfloat.c
-	$(CC) $(SHMCFLAGS) -c -o gfloat-s.o gfloat.c
-intrpt-s.o: intrpt.c
-	$(CC) $(SHMCFLAGS) -c -o intrpt-s.o intrpt.c
-trace-s.o: trace.c
-	$(CC) $(SHMCFLAGS) -c -o trace-s.o trace.c
-step-s.o: step.c
-	$(CC) $(SHMCFLAGS) -c -o step-s.o step.c
-shm_rsv.o: shm_rsv.c
-	$(CC) $(SHMCFLAGS) -c shm_rsv.c
-shm_throw.o: shm_throw.c
-	$(CC) $(SHMCFLAGS) -c shm_throw.c
-shm_obj.o: shm_obj.c
-	$(CC) $(SHMCFLAGS) -c shm_obj.c
-shm_gc.o: shm_gc.c
-	$(CC) $(SHMCFLAGS) -c shm_gc.c
-
 .kl1.c:
 	$(KL1CMP) $<
 
@@ -531,70 +471,6 @@
 recsusp.o: recsusp.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h 
-gg_shvar.o: gg_shvar.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-gg_shbusy.o: gg_shbusy.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h 
-shm_rsv.o: shm_rsv.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-shm_throw.o: shm_throw.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-shm_obj.o: shm_obj.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-shm_gc.o: shm_gc.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-bodyblt-s.o: bodyblt.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-gunix-s.o: gunix.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-kaim-s.o: kmain.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h options.h
-options-s.o: options.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h options.h
-debug-s.o: debug.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-sched-s.o: sched.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-intrpt-s.o: intrpt.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h
-gc-s.o: gc.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h 
-gmvv-s.o: gmvv.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h 
-gstring-s.o: gstring.c \
-    ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/struct.h ../include/klic/param.h \
-    shm.h shm_machine.h 
 main.o: main.c
 timer.o: timer.c \
     ../include/klic/basic.h ../include/klic/config.h \
diff -ruN klic-3.003-2002-03-16/runtime/debug.c klic-3.003-2002-03-19/runtime/debug.c
--- klic-3.003-2002-03-16/runtime/debug.c	Mon Mar  4 10:38:31 2002
+++ klic-3.003-2002-03-19/runtime/debug.c	Tue Mar 19 14:00:17 2002
@@ -29,10 +29,6 @@
 #define Node_type()  (io_node_flag == 0)
 #endif
 
-#ifdef SHM
-#include "shm.h"
-#endif
-
 /*
   Function name convention:
 
@@ -72,9 +68,6 @@
   }
 #ifdef DIST
   close_network();
-#endif
-#ifdef SHM
-  abend("");
 #endif
   exit(-1);
 }
diff -ruN klic-3.003-2002-03-16/runtime/faisus.c klic-3.003-2002-03-19/runtime/faisus.c
--- klic-3.003-2002-03-16/runtime/faisus.c	Sat Mar  9 11:41:27 2002
+++ klic-3.003-2002-03-19/runtime/faisus.c	Tue Mar 19 14:29:25 2002
@@ -89,18 +89,6 @@
     struct hook* newhook;
     susp = suspp(derefone(reason));  /* for shm implementation */
 
-#ifdef SHM
-    /*
-     * On shared memory implementation,
-     * this `susp' may be instanciated by one of the other processors.
-     * Thus, check again.
-     */
-    if ( !isref(susp) || reason != derefone(susp) ) {
-      resume_same_prio(goal);
-      return;
-    }
-#endif /* SHM */
-
     /* generator object ? */
     if (!is_generator_susp(susp->u)) {
       /* then allocate new hook */
diff -ruN klic-3.003-2002-03-16/runtime/gc.c klic-3.003-2002-03-19/runtime/gc.c
--- klic-3.003-2002-03-16/runtime/gc.c	Tue Mar  5 21:33:33 2002
+++ klic-3.003-2002-03-19/runtime/gc.c	Tue Mar 19 14:06:43 2002
@@ -19,10 +19,6 @@
 #include "interpe.h"
 #endif
 
-#ifdef SHM
-#include "shm.h"
-#endif  /* SHM */
-
 #define generic_gc(obj)  (method_table_of(obj)->gc(obj))
 
 extern const struct predicate queue_empty_pred;
@@ -66,30 +62,6 @@
   gcmax0 = newstack + gcstack_size;
 }
 
-#ifdef SHM
-extern q**
-make_shm_larger_stack(sp)
-  q** sp;
-{
-  declare_globals;
-  q** newstack;
-  shm_gcstack_size *= 2;
-  newstack = (q**) realloc_check((void*) shm_gcstack, shm_gcstack_size*sizeof(q*));
-  sp = newstack + (sp - shm_gcstack);
-  shm_gcstack = newstack;
-  shm_gcmax = newstack + shm_gcstack_size;
-  return sp;
-}
-
-static void push_shm_stack(q* addr)
-{
-  if(shm_sp == shm_gcmax)
-    shm_sp = make_shm_larger_stack(shm_sp);
-  *shm_sp = addr;
-  shm_sp++;
-}
-#endif /* SHM */
-
 static int within_new_space(q* x)
 {
   return (unsigned long)x - (unsigned long)new_space_top() < new_space_size();
@@ -108,22 +80,6 @@
   set_gcsp(gcsp() + 1);
 }
 
-#ifdef SHM
-#define reserve_copy(from, to) \
-if( from == makeref(&from) ){ \
-  to = from = makeref(&to); \
-}else{ \
-  to = from; \
-  if( !isatomic(from) ){ \
-    if( is_shma(from) ){ \
-      push_shm_stack(&to); \
-    }else if( within_old_space(from) ){ \
-      from = makeref(&to); \
-      push_gc_stack(&to); \
-    } \
-  } \
-}
-#else /* not SHM */
 #define reserve_copy(from, to) \
 if( from == makeref(&from) ){ \
   to = from = makeref(&to); \
@@ -134,7 +90,6 @@
     push_gc_stack(&to); \
   } \
 }
-#endif /* not SHM */
 
 #define copy_one_goal(goal, susp)		\
 do{							\
@@ -165,16 +120,6 @@
     obj = *addr;
 
   loop:
-#ifdef SHM
-    if( is_shma(obj) ){
-      *addr = obj;
-      if( ptagof(obj) != ATOMIC ){
-	push_shm_stack(addr);
-      }
-      continue; /* while stack rests */
-    }
-#endif
-
     switch( ptagof(obj) ){
     case ATOMIC:
       *addr = obj;
@@ -257,9 +202,6 @@
 	      goto deref;
 	    }
 	    *addr = value;
-#ifdef SHM
-	    if( is_shma(value) ) push_shm_stack(addr);
-#endif
 	  }else if( value == obj ){
 	    if( within_new_space(addr) ){
 	      *addr = derefone(obj) = makeref(addr);
@@ -387,13 +329,6 @@
   last = &goal_queue_tail;
   for( ; qp != NULL; qp=next ){
     next = qp->next;
-#ifdef SHM
-    if( is_shma(qp) ){
-      qp->next = last;
-      last = qp;
-      continue; /* for qp */
-    }
-#endif
     copy_one_goal(qp, 0);
     copy_terms();
     qp->next = last;
@@ -423,55 +358,8 @@
     gcstack = (q**) malloc_check(gcstack_size*sizeof(q*));
     set_gcsp(gcstack);
     gcmax0 = gcstack + gcstack_size;
-#ifdef SHM
-    shm_gcstack_size = GCSTACKSIZE;
-    shm_gcstack = (q**) malloc(shm_gcstack_size*sizeof(q*));
-    shm_sp = shm_gcstack;
-    shm_gcmax = shm_gcstack+shm_gcstack_size;
-  }else{
-    shm_sp = shm_gcstack;
-#endif
   }
 
-#ifdef SHM
-  /* copy into Shared-memory Generator hook data */
-  {
-    TADDRtbl* nptr;
-    TADDRtbl* sptr = &ADDRtbl;
-    for( sptr=sptr->next; sptr != &ADDRtbl; sptr=nptr ){
-      nptr = sptr->next;
-      switch( ptagof(sptr->localA) ){
-      case CONS:
-      case FUNCTOR: /* generator hook */
-	{
-	  struct generator_object* addi;
-	  Shvar* objp;
-	  q temp;
-	Re_try:
-	  temp = derefone(sptr->globalA);
-	  if( !isref(temp) ){ break; /* switch */ }
-	  if( derefone(temp) != (q) sptr->globalA ){
-	    sptr->globalA = (q*) temp;
-	    goto Re_try;
-	  }
-	  addi = n_lock((q) sptr->globalA, temp);
-	  if( derefone(sptr->globalA) != temp ){ goto Re_try; }
-	  objp = (Shvar*) untag_generator_susp(addi);
-	  if( is_genhook(objp->chain) ){
-	    q tempg;
-	    shm_arg_copy(&sptr->localA, &tempg);
-	    klic_barrier();
-	    *(sptr->globalA) = tempg;
-	    free_local_tbl(sptr);
-	  }else{
-	    n_unlock(temp, addi);
-	  }
-	}
-      }
-    }
-  }
-#endif /* SHM */
-
   set_heaptop(new_space_top());
   set_heapp(new_space_top());
   set_real_heapbytesize(new_space_size());
@@ -488,106 +376,6 @@
   }
   qp = copy_one_queue(qp);
 
-#ifdef SHM
-  {
-    TADDRtbl* nptr;
-    TADDRtbl* sptr = &ADDRtbl;
-    for( sptr=sptr->next; sptr!=&ADDRtbl; sptr=nptr ){
-      nptr = sptr->next;
-      switch( ptagof(sptr->localA) ){
-      case CONS:
-      case FUNCTOR:  /* generator hook but anybody reqested */
-        push_gc_stack((q*) &sptr->localA);
-	copy_terms();
-        push_shm_stack(&sptr->globalA);
-        break;
-      case ATOMIC: /* genarator object (distributed interface) */
-	{
-	  q wk = (q) untag_local(sptr->localA);
-	  if( !derefone(wk) ){ /* consumer */
-	    /* a following line is for debugging of reverse pointer problem. */
-	    static int hirata_bug1;
-
-	    q top = (q) &(sptr->localA);
-	    derefone(wk) = top;
-	    derefone(top) = wk;
-	    push_gc_stack(&top);
-
-	    /* patch for debugging of hirata problem */
-	    hirata_bug1 = 1;
-	    copy_terms();
-	    hirata_bug1 = 0;
-
-	    wk = derefone(top);
-	    if( wk == top )
-	      goto REM_HOOK;
-	    sptr->localA = (q*) tag_local(wk);
-	    derefone(wk) = 0;
-	  }else{ /* generator */
-	    push_gc_stack(&wk);
-	    copy_terms();
-	    sptr->localA = (q*) tag_local(wk);
-	  }
-	  push_shm_stack(&sptr->globalA);
-	  break;
-	}
-      default: /* normal goal */
-	{
-	  struct goalrec* wqp = (struct goalrec*) sptr->localA;
-	  if( !wqp ){ /* skip */
-	  }else if( !wqp->pred ){
-	    sptr->localA = (q*) wqp->next;
-	  }else if( isint(wqp->next) ){
-	    copy_one_goal(wqp, 1);
-	    sptr->localA = (q*) wqp;
-	    copy_terms();
-	    if( isref(sptr->globalA) ){
-	      for(;;){
-		q ww = derefone(sptr->globalA);
-		if( !isref(ww) || (q)sptr->globalA == derefone(ww) ) break;
-		sptr->globalA = (q*) ww;
-	      }
-	    }
-	    push_shm_stack(&sptr->globalA);
-	  }else{
-	  REM_HOOK:
-	    sptr->localA = 0;
-	    /* removes a hook record */
-	    {
-	      struct generator_object* addi;
-	      q sv;
-	      Shvar* objp;
-	      Sinfo *hk, *bsi, *si;
-	      q var = (q) sptr->globalA;
-	      sv = derefone(var);
-	      if( !isref(sv) || derefone(sv) != var ){ goto REM_skip; }
-	      addi = n_lock(var, sv);
-	      if( derefone(var) != sv ) goto REM_skip;
-	      objp = (Shvar*) untag_generator_susp(addi);
-	      hk = objp->chain;
-	      if( hk->indp == sptr ){
-		objp->chain = hk->next;
-		free_local_tbl(sptr);
-	      }else{
-		for( bsi=hk, si=bsi->next; si != NULL; bsi=si, si=si->next ){
-		  if( si->indp == sptr ){
-		    bsi->next = si->next;
-		    free_local_tbl(sptr);
-		    break; /* for si */
-		  }
-		}
-	      }
-	      n_unlock(sv, addi);
-	    REM_skip:
-	      ;
-	    }
-	  }
-	}
-      }
-    }
-  }
-#endif /* SHM */
-
   {
     struct suspended_goal_rec* sgl;
     struct suspended_goal_rec** sgl_tail = &suspended_goal_list0;
@@ -725,9 +513,6 @@
   }
   reset_this_more_space();
   gctimes++;
-#ifdef SHM
-  if( F_shm_gc ) qp = shm_gc(qp);
-#endif
   if( measure_gc ){
     measure(after);
 #ifdef GETRUSAGE
diff -ruN klic-3.003-2002-03-16/runtime/generic.c klic-3.003-2002-03-19/runtime/generic.c
--- klic-3.003-2002-03-16/runtime/generic.c	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/runtime/generic.c	Tue Mar 19 14:30:37 2002
@@ -232,13 +232,6 @@
   return GENERIC_FAILED;
 }
 
-extern q
-GD_STD_SHMCOPY(self)
-  struct data_object* self;
-{
-  fatal("Undefined Data object copied into shared-memory");
-}
-
 /*
   Generator object
 */
diff -ruN klic-3.003-2002-03-16/runtime/gfloat.c klic-3.003-2002-03-19/runtime/gfloat.c
--- klic-3.003-2002-03-16/runtime/gfloat.c	Tue Mar 12 12:51:29 2002
+++ klic-3.003-2002-03-19/runtime/gfloat.c	Tue Mar 19 14:08:00 2002
@@ -17,10 +17,6 @@
 #include "interpe.h"
 #endif
 
-#ifdef SHM
-#include "shm.h"
-#endif
-
 #define GD_CLASS_NAME() float
 #define GD_OBJ_TYPE struct float_object
 #define GD_OBJ_SIZE(obj) (G_SIZE_IN_Q(GD_OBJ_TYPE))
@@ -33,16 +29,6 @@
   } \
 }while(0)
 
-#ifdef SHM
-#define ALIGN_SHM() \
-do{
-  if( sizeof(double) != sizeof(long) ){ \
-    gallocp = (q*) (((unsigned long)gallocp + sizeof(double) - 1) \
-		     & -sizeof(double) ); \
-  }
-}while(0)
-#endif /* SHM */
-
 extern double atof();
 extern q convert_c_string_to_klic_string();
 extern unsigned char* generic_string_body();
@@ -66,25 +52,6 @@
 };
 #endif /* DIST */
 
-#ifdef SHM
-GDDEF_SHMCOPY()
-{
-  G_STD_DECL;
-  GD_OBJ_TYPE* newself;
-
-  for(;;){
-    ALIGN_SHM();
-    newself = (GD_OBJ_TYPE*) gallocp;
-    gallocp = (q*) ((unsigned long)gallocp + sizeof(struct float_object));
-    if( gallocp <= glimit ) break;
-    gallocp = shm_galloc(0);
-  }
-  newself->method_table = GD_SELF->method_table;
-  newself->value = GD_SELF->value;
-  return makefunctor(newself);
-}
-#endif /* SHM */
-
 /* basic method definitions */
 
 GDDEF_GUNIFY()
@@ -361,9 +328,6 @@
 #define GDUSE_MY_GC
 #ifdef DIST
 #define GDUSE_MY_ENCODE
-#endif
-#ifdef SHM
-#define GDUSE_MY_SHMCOPY
 #endif
 #define GDUSE_MY_GENERIC
 #define GDUSE_MY_GGENERIC
diff -ruN klic-3.003-2002-03-16/runtime/gg_shbusy.c klic-3.003-2002-03-19/runtime/gg_shbusy.c
--- klic-3.003-2002-03-16/runtime/gg_shbusy.c	Mon Mar 11 17:16:26 2002
+++ klic-3.003-2002-03-19/runtime/gg_shbusy.c	Thu Jan  1 09:00:00 1970
@@ -1,76 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)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.)
------------------------------------------------------------ */
-/*
-  sample program for generator object
-*/
-#include <stdio.h>
-
-#include <klic/basic.h>  /* fatal */
-#include <klic/struct.h>
-#include <klic/g_methtab.h>
-#include <klic/g_basic.h>
-#include <klic/gg_macro.h>
-#include <klic/susp.h>
-#include <klic/unify.h>  /* do_unify */
-#include "shm.h"
-
-#define GG_CLASS_NAME() shbusy
-#define GG_OBJ_TYPE struct Shbusy
-
-#define One_more()  (do_unify(GG_SELF, GG_TERM))
-
-struct Shbusy {
-  struct generator_object_method_table *method_table;
-};
-
-GGDEF_UNIFY()
-{
-  G_STD_DECL;
-
-  struct generator_object* gobj;
-  q pair = derefone(GG_SELF);
-  if( !isref(pair) || GG_SELF != derefone(pair) ){ One_more(); GG_TERMINATE; }
-  gobj = n_lock(GG_SELF, pair);
-  if( derefone(GG_SELF) == pair ){
-    n_unlock(pair, gobj);
-  }
-  One_more();
-  GG_TERMINATE;
-}
-
-GGDEF_GENERATE()
-{
-  return makecons(0);
-}
-
-GGDEF_SUSPEND()
-{
-  return makecons(0);
-}
-
-GGDEF_PRINT()
-{
-  fprintf(g_fp, "<BUSY Generator %x>", GG_SELF);
-  return 0;
-}
-
-GGDEF_GC()
-{
-  fatal("bug!!!");
-}
-
-#define GGUSE_MY_UNIFY
-#define GGUSE_MY_GENERATE
-#define GGUSE_MY_SUSPEND
-#define GGUSE_MY_GC
-#define GGUSE_MY_PRINT
-
-#include <klic/gg_methtab.h>
-
-GGDEF_NEW()
-{
-}
diff -ruN klic-3.003-2002-03-16/runtime/gg_shvar.c klic-3.003-2002-03-19/runtime/gg_shvar.c
--- klic-3.003-2002-03-16/runtime/gg_shvar.c	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/runtime/gg_shvar.c	Thu Jan  1 09:00:00 1970
@@ -1,343 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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.)
------------------------------------------------------------ */
-#include <stdio.h>
-
-#include <klic/basic.h>  /* fatal */
-#include <klic/struct.h>
-#include <klic/g_methtab.h>
-#include <klic/g_basic.h>
-#include <klic/gg_macro.h>
-#include <klic/susp.h>
-#include <klic/unify.h>  /* do_unify */
-#include "gobj.h"
-#include "shm.h"
-
-#define GENHOOK  1
-#define GENHOPT  1
-
-#define GG_CLASS_NAME() shvar
-#define GG_OBJ_TYPE struct Shvar
-
-#define One_more()  (do_unify(GG_SELF, GG_TERM))
-
-struct Shvar {
-  struct generator_object_method_table *method_table;
-  Sinfo chain;
-};
-
-extern Sinfo* shm_copy_chain();
-extern Sinfo* shm_merge_chain();
-
-static Inline int
-cmp_forward_ptr(q x, q y)
-{
-  declare_globals;
-  int xv = get_space(x);
-  int yv = get_space(y);
-  return (xv==yv) ? (x < y) : (xv < yv);
-}
-
-static Inline int
-is_forward_space_ptr(Sinfo* gp)
-{
-  int ok = 0;
-  int cid;
-  while( (cid = PLNE_ptr[cid]->direct) != -1 ){
-    if( (unsigned long)((long)gp-(long)(PLNE_ptr[cid]->top_addr)) < SHM_SIZE ){
-      ok = 1;
-      break;
-    }
-  }
-  return ok;
-}
-
-GGDEF_UNIFY()
-{
-  G_STD_DECL;
-
-  struct generator_object *addi;
-  Shvar *gobjp;
-  q pair = derefone(GG_SELF);
-  if( !isref(pair) || GG_SELF != derefone(pair) ){ One_more(); GG_TERMINATE; }
-  addi = n_lock(GG_SELF, pair);
-  if( pair != derefone(GG_SELF) ){ One_more(); GG_TERMINATE; }
-
-  gobjp = (Shvar*) untag_generator_susp(addi);
-  GG_SWITCH_ON_TERM(cons, atomic, func, dobj, susp);
-
- atomic:
-  {
-    derefone(GG_SELF) = GG_TERM;
-    if( gobjp->chain ){
-      if( is_genhook(gobjp->chain) ){
-	shm_ck_request(gobjp->chain);
-      }else{
-	shm_resume_goals(gobjp->chain);
-      }
-    }
-    GG_TERMINATE;
-  }
-
- cons:
- func:
- dobj:
-  {
-    q y;
-    if( GENHOOK && !gobjp->chain && !is_shma(GG_TERM)
-	&& (!GENHOPT || last_shm_var == GG_SELF) ){
-      gobjp = create_genhook(GG_TERM, GG_SELF);
-      n_unlock(pair, tag_generator_susp(gobjp));
-    }else{
-      ck_new_galloc(GG_SELF);
-      y = shm_copy(GG_TERM);
-      klic_barrier();
-      derefone(GG_SELF) = y;
-      if( gobjp->chain ){
-	if( is_genhook(gobjp->chain) ){
-	  shm_ck_request(gobjp->chain);
-	}else{
-	  shm_resume_goals(gobjp->chain);
-	}
-      }
-    }
-    GG_TERMINATE;
-  }
-
- susp:
-  {
-    q x = GG_SELF;
-    q temp = pair;
-    struct generator_object* xaddi = addi;
-    Shvar* xobjp = gobjp;
-    q y = GG_TERM;
-    q ytemp;
-    struct generator_object* yaddi;
-    Shvar* yobjp;
-
-  Re_try:
-    ytemp = derefone(y);
-    if( !isref(ytemp) || y != derefone(ytemp) ){
-      n_unlock(temp, xaddi);
-      One_more();
-      GG_TERMINATE;
-    }
-    yaddi = generator_suspp(ytemp)->u.o;
-    /* if yaddi is generator_susp */
-    if( (long)yaddi & 1L ){
-      struct generator_object_method_table* m;
-      yobjp = (Shvar*) untag_generator_susp(yaddi);
-      m = yobjp->method;
-      if( m == SHM_VAR || m == SHM_BUSY ){
-	if( x == y ){
-	  n_unlock(temp, xaddi);
-	  GG_TERMINATE;
-	}
-	if( cmp_forward_ptr(x,y) ){ /* reverse order */
-	  q w;
-	  n_unlock(temp, xaddi);
-	  w = x; x = y; y = w;
-	  w = temp; temp = ytemp; ytemp = w;
-	  xaddi = n_lock(x, temp);
-	  if( temp != derefone(x) ){
-	    One_more();
-	    GG_TERMINATE;
-	  }
-	  xobjp = (Shvar*) untag_generator_susp(xaddi);
-	}
-
-	if( xobjp->chain ){
-	  if( is_genhook(xobjp->chain) ){ /* one is a generator hook. */
-	    derefone(x) = y;
-	    shm_ck_request(xobjp->chain);
-	  }else{              /* one is a normal hook */
-	    yaddi = n_lock(y, ytemp);
-	    if( derefone(y) != ytemp ){
-	      n_unlock(temp,xaddi);
-	      One_more();
-	      GG_TERMINATE;
-	    }
-	    yobjp = (Shvar*) untag_generator_susp(yaddi);
-	    if( yobjp->chain ){
-	      if( is_genhook(yobjp->chain) ){ /* another is a generator hook. */
-		Sinfo* ychain = yobjp->chain;
-		ck_new_galloc(yobjp);
-		/* Don't forget keeping direction */
-		yobjp->chain = shm_copy_chain(xobjp->chain);
-		n_unlock(ytemp, yaddi);
-		derefone(x) = y;
-		shm_ck_request(ychain);
-	      }else{ /* both are ordinary hooks */
-		ck_new_galloc(yobjp);
-		yobjp->chain = shm_merge_chain(xobjp->chain, yobjp->chain);
-		n_unlock(ytemp, yaddi);
-		derefone(x) = y;
-	      }
-	    }else{
-	      ck_new_galloc(y);
-	      if( is_cur_or_forward_ptr(xobjp) ){
-		n_unlock(ytemp, tag_generator_susp(xobjp));
-		derefone(x) = y;
-	      }else{
-		yobjp = (Shvar*) galloc(sizeof(Shvar)/sizeof(q));
-		yobjp->method = SHM_VAR;
-		yobjp->chain = shm_copy_chain(xobjp->chain);
-		n_unlock(ytemp, tag_generator_susp(yobjp));
-		derefone(x) = y;
-	      }
-	    }
-	  }
-	}else{ /* x has no additional info. */
-	  derefone(x) = y;
-	}
-      }else{ /* y is an other local generator object */
-	/* assumes user defined object. Not Exref */
-	if( xobjp->chain ){ /* x has any info */
-	  struct generator_object* gobjy = untag_generator_susp(yaddi);
-	  q tmpy;
-	  tmpy = generic_generate(gobjy);
-	  switch( (long)tmpy ){
-	  case (long) makeref(0):
-	    GG_KL1_UNIFY(x, y);
-	    GG_TERMINATE;
-	  case (long) makecons(0):
-	    fatal("system bug!!!");
-	  default:
-	    derefone(y) = tmpy;
-	    One_more();
-	    GG_TERMINATE;
-	  }
-	}else{ /* x is a simple variable */
-	  xobjp = create_genhook(tag_local(y), x);
-	  n_unlock(temp, tag_generator_susp(xobjp));
-	}
-      }
-    }else{ /* y is a consumer */
-      if( xobjp && is_genhook(xobjp->chain) ){ /* global generator hook */
-	Shvar* tobj = shm_add_consumer(x, 0, y, glbl);
-	shm_ck_request(xobjp->chain);
-	n_unlock(temp, tag_generator_susp(tobj));
-      }else{
-	Shvar* tobj = (Shvar*) shm_add_consumer(x, xobjp, y, glbl);
-	n_unlock(temp, tag_generator_susp(tobj));
-      }
-    }
-    GG_TERMINATE;
-  }
-}
-
-GGDEF_GENERATE()
-{
-  return makecons(0);
-}
-
-GGDEF_SUSPEND()
-{
-  G_STD_DECL;
-  struct generator_object* addi;
-  Sinfo* sptr;
-  Sinfo* gp;
-  Shvar* gvar;
-  q temp = derefone(GG_SELF);
-  if( !isref(temp) )  return makecons(0);
-  if( GG_SELF != derefone(temp) )  return makecons(0);
-  addi = n_lock(GG_SELF, temp);
-  if( derefone(GG_SELF) != temp )  return makecons(0);
-  ck_new_galloc(GG_SELF);
-
-  /* creates shared memory hook chain */
-
-  gvar = (Shvar*) untag_generator_susp(addi);
-  gp = gvar->chain;
-  if( gp == NULL ){ /* First hook */
-    Shvar* gptr = (Shvar*) galloc( (sizeof(Shvar)+sizeof(Sinfo))/sizeof(q) );
-    sptr = (Sinfo*) (gptr+1);
-    gptr->method = SHM_VAR;
-    gptr->chain = sptr;
-    sptr->next = NULL;
-    sptr->PE_num = my_node;
-    sptr->prio = current_prio();
-    sptr->indp = create_local_tbl(GG_GOAL, GG_SELF);
-    n_unlock(temp, tag_generator_susp(gptr));
-    return makeref(0);
-  }
-  /* already any hooks */
-  else if( is_genhook(gp) ){ /* shared generator hook */
-    int pe_num;
-    long prio;
-    TADDRtbl* ind;
-    sptr = (Sinfo*) untag_generator_susp(gp);
-    pe_num = sptr->PE_num;
-    prio = sptr->prio;
-    ind = sptr->indp;
-    if( pe_num == my_node ){
-      q temp;
-      q* tp = ind->globalA;
-      if( !isatomic(ind->localA) ){
-	free_local_tbl(ind);
-	shm_arg_copy(&ind->localA, &temp);
-	klic_barrier();
-	*tp = temp;
-	return makecons(0);
-      }
-    }
-    /* reuses Sinfo */
-    gvar->method = SHM_VAR;
-    gvar->chain = sptr;
-    sptr->PE_num = my_node;
-    sptr->prio = current_prio();
-    sptr->indp = create_local_tbl(GG_GOAL, GG_SELF);
-    shm_request_queueing(pe_num, prio, ind);
-    n_unlock(temp, addi);
-    return makeref(0);
-  }else{ /* ordinary hook */
-    Sinfo* bgp = (Sinfo*) &(gvar->chain);
-    ck_new_galloc(gvar);
-    while( gp != NULL && !is_forward_space_ptr(gp) ){
-      if( gp->PE_num == my_node ){
-	if( (struct goalrec*)(gp->indp->localA) == GG_GOAL ){
-	  n_unlock(temp, addi);
-	  return makeref(0);
-	}else{
-	  break;
-	}
-      }
-      bgp = gp;
-      gp = gp->next;
-    }
-    sptr = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-    bgp->next = sptr;
-    sptr->next = gp;
-    sptr->PE_num = my_node;
-    sptr->prio = current_prio();
-    sptr->indp = create_local_tbl(GG_GOAL, GG_SELF);
-    n_unlock(temp, addi);
-    return makeref(0);
-  }
-}
-
-GGDEF_PRINT()
-{
-  fprintf(g_fp, "<INTEGER GENERATOR %x>", GG_SELF);
-  return 0;
-}
-
-GGDEF_GC()
-{
-  fatal("bug!!!");
-}
-
-#define GGUSE_MY_UNIFY
-#define GGUSE_MY_SUSPEND
-#define GGUSE_MY_GENERATE
-#define GGUSE_MY_GC
-#define GGUSE_MY_PRINT
-
-#include <klic/gg_methtab.h>
-
-GGDEF_NEW()
-{
-}
diff -ruN klic-3.003-2002-03-16/runtime/gmvv.c klic-3.003-2002-03-19/runtime/gmvv.c
--- klic-3.003-2002-03-16/runtime/gmvv.c	Tue Mar 12 12:52:47 2002
+++ klic-3.003-2002-03-19/runtime/gmvv.c	Tue Mar 19 14:08:36 2002
@@ -16,9 +16,6 @@
 #ifdef DIST
 #include "interpe.h"
 #endif
-#ifdef SHM
-#include "shm.h"
-#endif
 
 #include "atom.h"
 #include "funct.h"
@@ -192,35 +189,6 @@
 }
 #endif /* DIST */
 
-
-#ifdef SHM
-GDDEF_SHMCOPY()
-{
-  G_STD_DECL;
-  GD_OBJ_TYPE *newself;
-
-  newself = (GD_OBJ_TYPE *)galloc((sizeof(struct vector_object)));
-  Shallow(GD_SELF);
-  {
-    /* Shallow version */
-    q *body = GD_SELF->body;
-    long size = GD_SELF->index;
-    q *newbody;
-    long k;
-    newbody = (q*)galloc(size);
-    newself->method_table = GD_SELF->method_table;
-    newself->next = VECTOR_SHALLOW_MARK;
-    newself->index = size;
-    newself->iscnst = 1;
-    newself->body = newbody;
-    for (k=0; k<size; k++) {
-        shm_arg_copy(&body[k], &newbody[k]);
-      }
-  }
-  return(makefunctor(newself));
-}
-#endif /* SHM */
-
 /* Generic method */
 
 GDDEF_METHOD(element_2)
@@ -504,9 +472,6 @@
 #define GDUSE_MY_GC
 #ifdef DIST
 #define GDUSE_MY_ENCODE
-#endif
-#ifdef SHM
-#define GDUSE_MY_SHMCOPY
 #endif
 #define GDUSE_MY_GENERIC
 #define GDUSE_MY_GGENERIC
diff -ruN klic-3.003-2002-03-16/runtime/gobj.h klic-3.003-2002-03-19/runtime/gobj.h
--- klic-3.003-2002-03-16/runtime/gobj.h	Sat Mar  9 13:42:24 2002
+++ klic-3.003-2002-03-19/runtime/gobj.h	Tue Mar 19 14:30:57 2002
@@ -23,8 +23,4 @@
 
 #define generic_generate(obj)  (method_table_of(obj)->generate(obj))
 
-/*** for Shared-memory KLIC system ***/
-#define generic_shmcopy(obj) \
-  (method_table_of(obj)->shmcopy(obj))
-
 #endif /* _KLIC_GOBJ_H_ */
diff -ruN klic-3.003-2002-03-16/runtime/gstring.c klic-3.003-2002-03-19/runtime/gstring.c
--- klic-3.003-2002-03-16/runtime/gstring.c	Tue Mar 12 12:53:57 2002
+++ klic-3.003-2002-03-19/runtime/gstring.c	Tue Mar 19 14:08:55 2002
@@ -12,10 +12,6 @@
 #include "atom.h"
 #include "funct.h"
 
-#ifdef SHM
-#include "shm.h"
-#endif
-
 #ifdef DIST
 #include "interpe.h"
 #endif
@@ -175,33 +171,6 @@
 }
 #endif /* DIST */
 
-#ifdef SHM
-GDDEF_SHMCOPY()
-{
-  G_STD_DECL;
-  GD_OBJ_TYPE *newself;
-
-  newself = (GD_OBJ_TYPE *)galloc((sizeof(struct byte_string_object)));
-  Shallow(GD_SELF);
-  newself->method_table = GD_SELF->method_table;
-
-  newself->iscnst = 1;
-  {
-    unsigned char *body = GD_SELF->body;
-    unsigned char *newbody;
-    long size = GD_SELF->index;
-    long qsize = ROUND_UP(size);
-
-    newbody = (unsigned char *)galloc(qsize);
-    newself->next = STRING_SHALLOW_MARK;
-    newself->index = size;
-    newself->body = newbody;
-    BCOPY(body,newbody,qsize*sizeof(q));
-  }
-  return(makefunctor(newself));
-}
-#endif /* SHM */
-
 /* Generic method */
 
 GDDEF_METHOD(string_2)
@@ -580,9 +549,6 @@
 #define GDUSE_MY_GC
 #ifdef DIST
 #define GDUSE_MY_ENCODE
-#endif
-#ifdef SHM
-#define GDUSE_MY_SHMCOPY
 #endif
 #define GDUSE_MY_GENERIC
 #define GDUSE_MY_GGENERIC
diff -ruN klic-3.003-2002-03-16/runtime/gunix.kl1 klic-3.003-2002-03-19/runtime/gunix.kl1
--- klic-3.003-2002-03-16/runtime/gunix.kl1	Sat Mar  9 16:41:10 2002
+++ klic-3.003-2002-03-19/runtime/gunix.kl1	Tue Mar 19 13:58:20 2002
@@ -67,9 +67,6 @@
 #ifdef DIST
   kill_child();
 #endif
-#ifdef SHM
-  abend(\"\");
-#endif
   exit(N);
 }
 
diff -ruN klic-3.003-2002-03-16/runtime/intrpt.c klic-3.003-2002-03-19/runtime/intrpt.c
--- klic-3.003-2002-03-16/runtime/intrpt.c	Tue Mar 12 13:34:07 2002
+++ klic-3.003-2002-03-19/runtime/intrpt.c	Tue Mar 19 14:04:56 2002
@@ -23,10 +23,6 @@
 #define GC_OFF()
 #endif /* not DIST */
 
-#ifdef SHM
-#include "shm.h"
-#endif
-
 extern struct goalrec* klic_gc();
 
 extern int stepping_flag;
@@ -112,18 +108,6 @@
       fatal("Execution aborted by SIGINT");
     }
 
-#ifdef SHM
-    while( (volatile int) ext_queued ){
-      *cur_status = 1;
-      ext_queued = 0;
-      klic_barrier();
-      qp = get_invoked_goals(qp);
-      interrupt_off = -1;
-      heaplimit = real_heaplimit();
-      retry |= (heapp() + this_more_space() >= heaplimit);
-    }
-#endif
-
     /* priority support */
     if( higher_priority_goal0 ){
       higher_priority_goal0 = 0;
@@ -132,20 +116,10 @@
       if( interrupt_off ) heaplimit = real_heaplimit();
     }
 
-#ifdef SHM
-    if( ck_shm_gc() || heapp() + this_more_space() >= real_heaplimit() ){
-      *cur_status = 3;
-    /* ck_shm_gc will call another GC */
-#else
     if( heapp() + this_more_space() >= real_heaplimit() ){
-#endif
       GC_ON();
       qp = klic_gc(qp);
-#ifdef SHM
-      *cur_status = 1;
-#endif
       GC_OFF();
-
       allocp = heapp();
     }
   }while( retry );
diff -ruN klic-3.003-2002-03-16/runtime/kmain.c klic-3.003-2002-03-19/runtime/kmain.c
--- klic-3.003-2002-03-16/runtime/kmain.c	Tue Mar 12 13:34:55 2002
+++ klic-3.003-2002-03-19/runtime/kmain.c	Tue Mar 19 13:59:28 2002
@@ -28,10 +28,6 @@
 #include <signal.h>
 #endif
 
-#ifdef SHM
-#include "shm.h"
-#endif
-
 #ifdef DIST
 #include <time.h>
 #include <sys/types.h>
@@ -113,13 +109,6 @@
     "B",	(union all_type*) &shared_buffer_size, ARG_SIZE,
     "-B <communication buffer size>",
 #endif
-#ifdef SHM
-    "S",        (union all_type*) &SHM_SIZE, ARG_SIZE,
-    "-S <shared-memory heap size>: shared-memory heap size, never expand",
-
-    "D",        (union all_type*) &Disp_child, ARG_SET,
-    "-D: display child process number on UNIX",
-#endif
     "a",	(union all_type*) &max_a_ratio, ARG_DOUBLE,
     "-a <ratio>: active cell ratio to triger heap extension\n" \
     "\t  <ratio> should be a floating point number >0 and <1",
@@ -207,11 +196,6 @@
   void init_virtualized_timer();
   void init_klic_timer_handling();
 #endif
-#ifdef SHM
-  struct timeval time_before;
-  struct timezone tzp;
-  gettimeofday(&time_before, NULL);
-#endif /*SHM*/
   program_name = argv[0];
   total_node = num_pes = 1;
   my_node = 0;
@@ -294,13 +278,6 @@
     maxheapsize0 = heapsize0;
   initalloc();
 
-#ifdef SHM
-  My_glbl = glbl = shm_init(glbl);
-#if 0 /* for Debugging */
-  getchar()
-#endif
-#endif
-
   {
     extern struct goalrec *get_top_priority_queue();
     struct goalrec *qp;
@@ -362,9 +339,6 @@
 #ifdef DIST
       if (IS_MASTER_NODE(my_node))
 #endif
-#ifdef SHM
-      if ( my_node == MASTER )
-#endif
 	enqueue_goal(NULL, HIGHESTPRIO-1, qp, glbl);
 
       current_queue = get_top_priority_queue();
@@ -402,21 +376,6 @@
 #endif /*DIST*/
     }
   }
-#ifdef SHM
-  if ( my_node == MASTER ) {
-    wait(0);
-    {
-      struct timeval time_after;
-      struct timezone tzp;
-      if (!gettimeofday(&time_after, NULL)) {
-	fprintf(stderr,
-		"Response time is %d msec\n",
-		(time_after.tv_sec - time_before.tv_sec)*1000 +
-		(time_after.tv_usec - time_before.tv_usec)/1000);
-      }
-    }
-  }
-#endif /*SHM*/
   return 0;
 }
 
diff -ruN klic-3.003-2002-03-16/runtime/newatom.c klic-3.003-2002-03-19/runtime/newatom.c
--- klic-3.003-2002-03-16/runtime/newatom.c	Fri Feb  8 15:40:09 2002
+++ klic-3.003-2002-03-19/runtime/newatom.c	Tue Mar 19 14:02:07 2002
@@ -14,10 +14,6 @@
 #include <klic/functorstuffs.h>  /* functors, arities */
 #include <klic/newatom.h>
 
-#ifdef SHM
-#include "shm.h"
-#endif
-
 #define Hashsize 1024
 #define Namesize  1024
 
@@ -55,43 +51,9 @@
 static long* nextatom;
 static long* nextfunctor;
 
-
-#ifndef SHM
 static unsigned char* namearea;
 static unsigned char* nameareap;
 
-#else  /* SHM */
-struct atomnamebuff {
-  unsigned char* namea0;
-  unsigned char* namep0;
-};
-
-struct atomnamebuff* shm_namep;
-
-#define namearea  (shm_namep->namea0)
-#define nameareap (shm_namep->namep0)
-
-#define malloc_check(sz) \
-( (Buff_S += (sz)) > Buff_E ? \
-  (char*) abend("Atom Table overflow!") : (char*) (Buff_S - (sz)) )
-
-extern void
-init_shm_atom()
-{
-  struct atomhashtable* tmpahp;
-  struct functorhashtable* tmpfhp;
-  static char* Buff_S = shm_start_addr;
-  static char* Buff_E = Buff_S + ATOM_TABLE_SIZE;
-  shm_namep = (struct atomnamebuff*) malloc_check(sizeof(struct atomnamebuff));
-  tmpahp = (struct atomhashtable*) malloc_check(sizeof(struct atomhashtable));
-  *tmpahp = *atomhp;
-  atomhp = tmpahp;
-  tmpfhp = (struct functorhashtable*) malloc_check(sizeof(struct functorhashtable));
-  *tmpfhp = *functhp;
-  functhp = tmpfhp;
-}
-#endif  /* SHM */
-
 
 static long
 hash_name(name)
@@ -234,10 +196,6 @@
   if( strcmp((char*) name, ".")==0 ) return 1L;
   hashvalue = ((unsigned long) hash_name(name)) % atomhp->hashtablesize;
 
-#ifdef SHM
-  s_lock(a_key());
-#endif
-
  again:
   index = atomhp->table[hashvalue] - 1;
   if( index >= 0 ){
@@ -256,17 +214,11 @@
         nameareap += namelen;
 	*nameareap++ = '\0';
 	nextatom[atomhp->atomid] = -1;
-#ifdef SHM
-	s_unlock(a_key());
-#endif
 	return atomhp->atomid;
       }else{
 	index = index0;
       }
     }
-#ifdef SHM
-    s_unlock(a_key());
-#endif
     return index;
   }else{
     if( atomhp->atomid +1 == atomhp->nametablesize ){
@@ -282,9 +234,6 @@
       nameareap += strlen((char*) name) + 1;
       nextatom[atomhp->atomid] = -1;
     }
-#ifdef SHM
-    s_unlock(a_key());
-#endif
     return atomhp->atomid;
   }
 
@@ -294,9 +243,6 @@
     unsigned char** newatomnames;
     long* newnextatom;
     int i;
-#ifdef SHM
-    if( is_shma(atomnames) ) abend("Can't expand on this version.");
-#endif
     newatomnames = (unsigned char**)
       malloc_check((atomhp->nametablesize) * sizeof(char*)*2);
     newnextatom = (long*)
@@ -338,10 +284,6 @@
   hashvalue =
     ((long)(a_no + arity)) % functhp->hashtablesize;
 
-#ifdef SHM
-  s_lock(f_key());
-#endif
-
  again:
   index = functhp->table[hashvalue] - 1;
   if( index >= 0 ){
@@ -354,18 +296,11 @@
 	functorids[functhp->functorid] = a_no;
         aritiesof[functhp->functorid] = arity;
 	nextfunctor[functhp->functorid] = -1;
-#ifdef SHM
-	s_unlock(f_key());
-#endif
 	return functhp->functorid;
       }else{
 	index = index0;
       }
     }
-
-#ifdef SHM
-    s_unlock(f_key());
-#endif
     return index;
   }else{
     if( functhp->functorid +1 == functhp->functortablesize ){
@@ -377,10 +312,6 @@
       aritiesof[functhp->functorid] = arity;
       nextfunctor[functhp->functorid] = -1;
     }
-
-#ifdef SHM
-    s_unlock(f_key());
-#endif
     return functhp->functorid;
   }
 
@@ -389,9 +320,6 @@
     unsigned long* newaritiesof;
     unsigned long* newnextfunctor;
     int i;
-#ifdef SHM
-    if( is_shma(functorids) ) abend("Can't expand on this version.");
-#endif
     newfunctorids = (unsigned long*)
       malloc_check((functhp->functortablesize) * sizeof(unsigned long)*2);
     newaritiesof = (unsigned long*)
diff -ruN klic-3.003-2002-03-16/runtime/sched.c klic-3.003-2002-03-19/runtime/sched.c
--- klic-3.003-2002-03-16/runtime/sched.c	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/runtime/sched.c	Tue Mar 19 14:32:15 2002
@@ -18,22 +18,6 @@
 
 #include "trace.h"  /* enqueue_trace_rec, trace_enqueued_goals, trace_flag */
 
-#ifdef SHM
-#include <setjmp.h>
-#include "shm.h"
-
-extern jmp_buf klic_topmost;
-
-static module mastersucceed(struct global_variables* glbl, struct goalrec* qp,
-  q* allocp, const struct predicate* toppred );
-
-static module childsucceed(struct global_variables* glbl, struct goalrec* qp,
-  q* allocp, const struct predicate* toppred );
-
-static const struct predicate mastersucceed_pred = { mastersucceed, 0, 0 };
-static const struct predicate childsucceed_pred = { childsucceed, 0, 0 };
-#endif  /* SHM */
-
 #define new_prioqrec(pqr) \
 do{ \
   struct prioqrec* temp; \
@@ -56,12 +40,6 @@
 #ifdef DIST
 extern struct goalrec* send_throw_goal();
 #endif
-#ifdef SHM
-extern struct goalrec* throw_goal_routine();
-#endif
-
-/* temp */
-extern struct ex_goalrec** shm_qp;
 
 
 extern module wait_prio_routine(struct global_variables* glbl,
@@ -122,15 +100,7 @@
   pq->prio = 0;
   allocp = klic_alloc(2);
   allocp[0] = (q) &goal_queue_tail;
-#ifdef SHM
-  if( my_node == MASTER ){
-    allocp[1] = (q) &mastersucceed_pred;
-  }else{
-    allocp[1] = (q) &childsucceed_pred;
-  }
-#else
   allocp[1] = (q) &topsucceed_pred;
-#endif
   pq->q = (struct goalrec*) allocp;
 
   prioq0.next = pq;
@@ -294,11 +264,7 @@
 #ifdef DIST
       return send_throw_goal(intval(penum), gp, qp);
 #else
-# ifdef SHM
-      return throw_goal_routine(intval(penum), qp, gp);
-# else
       return enqueue_goal(qp, current_prio(), gp, glbl);
-# endif
 #endif
     }else return enqueue_goal(qp, current_prio(), gp, glbl);
   }
@@ -383,35 +349,6 @@
   }
 }
 
-#ifdef SHM
-static void
-put_priority_goal(qp, prio)
-  struct goalrec* qp;
-  long prio;
-{
-  declare_globals;
-  struct prioqrec* pq = &prioq0;
-
-  while( pq->next->prio > prio ){
-    pq = pq->next;
-  }
-  if( pq->next->prio == prio ){
-    /* there are some active goals with the same priority */
-    pq = pq->next;
-    qp->next = pq->q;
-    pq->q = qp;
-  }else{
-    /* there are no goals with the same priority */
-    struct prioqrec* newpq;
-    new_prioqrec(newpq);
-    newpq->next = pq->next;
-    pq->next = newpq;
-    newpq->prio = prio;
-    newpq->q = qp;
-    qp->next = &goal_queue_tail;
-  }
-}
-#endif
 
 /*
   queue_empty:
@@ -430,166 +367,7 @@
   const struct predicate* toppred;
 {
   set_heapp(allocp);
-#ifdef SHM
-  if( ext_queued ){
-    ext_queued = 0;
-    qp = get_invoked_goals(&goal_queue_tail);
-    current_queue = qp;
-    return (module) qp->pred->func;
-  }
-#endif
   qp = get_top_priority_queue();
   current_queue = qp;
   return (module) qp->pred->func;
 }
-
-#ifdef SHM
-extern struct goalrec*
-get_invoked_goals(qp)
-  struct goalrec* qp;
-{
-  declare_globals;
-  int key = p_key(my_node);
-
-  struct ex_goalrec *sqp, *eqp;
-
-  s_lock(key);
-  sqp = ex_qp->next;
-  if( sqp == NULL ){ s_unlock(key); return qp; }
-  eqp = sqp;
-  while( eqp->next != NULL ){ eqp = eqp->next; }
-  ex_qp = eqp;
-  s_unlock(key);
-
-  put_priority_queue(qp, current_prio());
-  eqp = sqp;
-  for(;;){
-    put_priority_goal(&eqp->goal, eqp->prio);
-    if( eqp == ex_qp )  break;
-    eqp = eqp->next;
-  }
-
-  return get_top_priority_queue();
-}
-
-
-static module
-mastersucceed(glbl, qp, allocp, toppred)
-  struct global_variables* glbl;
-  struct goalrec* qp;
-  q* allocp;
-  const struct predicate* toppred;
-{
-  int first, i;
-  set_heapp(allocp);
-
-  /* printf("Wait master.\n"); */
-
- WLoop:
-  if( !(ex_qp->next) ){
-    klic_interrupt(qp);
-    if( current_queue != qp ){
-      *cur_status = 1;
-      qp = current_queue;
-      toppred = qp->pred;
-      return (module) toppred->func;
-    }
-
-    {
-      struct global_variables* tglbl;
-      for( i=1; i<total_node; i++ ){
-	tglbl = get_otherPE_glbl(i);
-	if( top_shm_qp[i] != tglbl->par.aux.shm.ex_qp0 ) goto WLoop;
-	if( pe_status[i] ) goto WLoop;
-      }
-      if( ex_qp->next ) goto WLoop;
-      for( i=0; i<total_node; i++ ){ s_lock(p_key(i)); }
-      *cur_status = 0;
-      for( i=0; i<total_node; i++ ){
-	tglbl = get_otherPE_glbl(i);
-	if( ( top_shm_qp[i] == tglbl->par.aux.shm.ex_qp0 ) &&
-	    !pe_status[i] )  continue;
-	for( i=0; i<total_node; i++ ){ s_unlock(p_key(i)); }
-	goto WLoop;
-      }
-      for( i=0; i<total_node; i++ ){  /* One more */
-	tglbl = get_otherPE_glbl(i);
-	if( ( top_shm_qp[i] == tglbl->par.aux.shm.ex_qp0 ) &&
-	    !pe_status[i] )  continue;
-	for( i=0; i<total_node; i++ ){ s_unlock(p_key(i)); }
-	goto WLoop;
-      }
-      for( i=total_node-1; i>=0; i-- ){  /* One more */
-	tglbl = get_otherPE_glbl(i);
-	if( ( top_shm_qp[i] == tglbl->par.aux.shm.ex_qp0 ) &&
-	    !pe_status[i] ) continue;
-	for( i=0; i<total_node; i++ ){ s_unlock(p_key(i)); }
-	goto WLoop;
-      }
-    }
-
-    for( i=0; i<total_node; i++ ){ s_unlock(p_key(i)); }
-
-    if( suspensions() != resumes() ){
-      fatalf(" %d perpetual suspending goals.", suspensions() - resumes());
-    }
-    {
-      struct ex_goalrec* eqp;
-      struct goalrec* qp;
-
-      for( i=1; i<total_node; i++ ){
-	eqp = (struct ex_goalrec*) galloc(4);
-	eqp->prio = HIGHESTPRIO-1;
-	qp = &eqp->goal;
-	qp->next = 0;
-	qp->pred = &topsucceed_pred;
-	shm_goal_stack(eqp, i);
-      }
-      longjmp(klic_topmost, 0);
-    }
-  }
-  qp = get_invoked_goals(qp);
-  {
-    module func;
-    toppred = qp->pred;
-    func = (module) toppred->func;
-    current_queue = qp;
-    return func;
-  }
-}
-
-
-static module
-childsucceed(glbl, qp, allocp, toppred)
-  struct global_variables* glbl;
-  struct goalrec* qp;
-  q* allocp;
-  const struct predicate* toppred;
-{
-  set_heapp(allocp);
-  while( !(ex_qp->next) ){
-    klic_interrupt(qp);
-    if( current_queue != qp ){
-      *cur_status = 1;
-      qp = current_queue;
-      toppred = qp->pred;
-      return (module) toppred->func;
-    }
-    *cur_status = 0;
-  }
-
-  *cur_status = 1;
-  klic_barrier();
-
-  qp = get_invoked_goals(qp);
-  /* dump_queue(qp); */
-
-  {
-    module func;
-    toppred = qp->pred;
-    func = (module) toppred->func;
-    current_queue = qp;
-    return func;
-  }
-}
-#endif  /* SHM */
diff -ruN klic-3.003-2002-03-16/runtime/shm.h klic-3.003-2002-03-19/runtime/shm.h
--- klic-3.003-2002-03-16/runtime/shm.h	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/runtime/shm.h	Thu Jan  1 09:00:00 1970
@@ -1,233 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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_SHM_H_
-#define _KLIC_SHM_H_
-
-/* Machine depending Dec */
-#include "shm_machine.h"
-
-#define currid (glbl->par.aux.shm.currid0)
-#define oldid  (glbl->par.aux.shm.oldid0)
-
-#define SHM_HEAP_TOP (glbl->par.aux.shm.shm_htop0)
-#define SHP_SIZE     (glbl->par.aux.shm.shm_hbyte0)
-
-  /* number of Planes */
-extern long N_PLNE;
-  /* size of 1 Shared-memory plane */
-extern long SHM_SIZE;
-extern long Disp_child;
-
-Extern int shm_trace_lock Init(0);
-
-#define MASTER 0
-
-#define MAX_N_PE  32
-
-  /* Shared-memory address or no */
-#define is_shma(X) \
-    ( (unsigned long)((long)(X)-(long)SHM_HEAP_TOP ) < SHP_SIZE )
-
-/* calculates a hash key for lock */
-#define HTBL_base 0
-#define g_key()  HTBL_base  /* allocating shared-memory */
-#define m_key()  (HTBL_base+1)  /* updating the shared-memory management table */
-#define gc_key() (HTBL_base+2)  /* for Sequential GC */
-#define a_key()  (HTBL_base+3)  /* updating atom table */
-#define f_key()  (HTBL_base+4)  /* updating functor table */
-#define tr_key() (HTBL_base+5)
-#define p_key(penum) (HTBL_base+6 + (penum))  /* queuing a goal to external process */
-
-  /* global generator hook */
-#define is_genhook(X) ((long)(X) & 0x01)
-#define tag_genhook(X) ((Sinfo*)((long)(X)+1))
-#define untag_genhook(X) ((Sinfo*)((long)(X)-1))
-  /* local consumer or generator */
-#define tag_local(x)	((q)((char*)(x) + ATOMIC))
-#define untag_local(x)	((q)((char*)(x) - ATOMIC))
-#define ext_queued (glbl->par.aux.shm.queued0)
-#define ex_qp (glbl->par.aux.shm.ex_qp0)
-
-  /* adjusts the memory boundary */
-#define reckon(sz) ((long)((((sz)+sizeof(long)-1)/sizeof(long))*sizeof(long)))
-#define get_adjust_addr(type,top,inc) \
-  (((type)*) (((char*) (top)) + (reckon(sizeof(type)) * (inc))))
-#define get_otherPE_glbl(n) \
-  get_adjust_addr(struct global_variables, top_shm_glbl, (n))
-
-  /* shared memory alloc */
-#define galloc(Siz) ( { q* addr = gallocp; \
-  ((gallocp+=(Siz)) <= glimit)?addr:shm_galloc(Siz);})
-
-
-#define free_local_tbl(ptr) \
-do{ \
-  TADDRtbl* sl = (TADDRtbl*) (ptr); \
-  (sl->prev)->next = sl->next; \
-  (sl->next)->prev = sl->prev; \
-  sl->next = ADDRtbl_free; \
-  ADDRtbl_free = sl; \
-}while(0)
-
-
-#define get_space(X) ( {\
-    int cid = currid;\
-    int cnt = 1;\
-    int no = 0;\
-    do { \
-      if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr)) < SHM_SIZE ) \
-        { no = cnt; break; } \
-      cnt++; \
-    } while( (cid = PLNE_ptr[cid]->direct) != (-1) ); \
-    no; } )
-
-#define ck_new_galloc(X) \
-do{ \
-    int cid = currid;\
-    while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) { \
-       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) { new_galloc(cid); break; }\
-    }\
-}while(0)
-
-
-#define is_cur_or_forward_ptr(X) ( {\
-    int ok = 0;\
-    int cid = currid;\
-    do {\
-       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) {\
-	 ok = 1; break;\
-       }\
-    } while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) ;\
-    ok; } )
-
-
-  /* Structures */
-typedef struct addr_tbl {
-   struct addr_tbl* next;
-   struct addr_tbl* prev;
-   q* localA;
-   q* globalA;
-} TADDRtbl;
-
-struct ex_goalrec {
-   struct ex_goalrec* next;
-   long prio;
-   struct goalrec goal;
-} ;
-
-typedef struct PE_shook {
-   struct PE_shook*   next;
-   long               PE_num;
-   long               prio;
-   TADDRtbl*          indp;
-} Sinfo;
-
-typedef struct shvar {
-   struct generator_object_method_table* method;
-   Sinfo* chain;
-} Shvar;
-
-/* Management table of a shared memory plain */
-typedef struct {
-   long* top_addr;
-   long* caddr;
-   long  direct;
-   long  demand;
-   long  proc[MAX_N_PE];
-   long* limit1;
-   long* limit2;
-   long* limit3;
-} PLNE;
-
-/* External declarations */
-
-/* lock table address */
-extern int* lockp[];
-
-/* common variables */
-extern int F_shm_gc;
-
-extern volatile PLNE* PLNE_ptr[];
-
-extern int* volatile pe_status;
-extern int* volatile cur_status;
-
-extern struct global_variables* top_shm_glbl;
-
-extern struct ex_goalrec** volatile top_shm_qp;
-
-/* runtime/shm_rsv.c */
-extern char* shm_start_addr;
-extern int ATOM_TABLE_SIZE;
-
-/* memorized the last generated variable on shm */
-extern q last_shm_var;
-
-extern struct generator_object* qSHM_BUSY;
-extern struct generator_object* pSHM_VAR;
-extern struct generator_object_method_table* SHM_BUSY;
-extern struct generator_object_method_table* SHM_VAR;
-
-/* current shared memory top address, limit of myself */
-extern q* gallocp;
-extern q* glimit;
-
-extern TADDRtbl ADDRtbl;
-extern TADDRtbl* ADDRtbl_free;
-
-
-/* Declarations of functions */
-
-/* runtime/shm_rsv.c */
-
-/* common routines */
-extern struct global_variables* shm_init(struct global_variables* glbl);
-
-/* allocate shared memory routines */
-extern q* shm_galloc(int siz);
-
-
-/* runtime/shm_throw.c */
-
-/* copy argument into shared memory */
-extern q shm_copy(q src);
-
-/* stack a goal */
-extern int shm_goal_stack(struct ex_goalrec* goal, int num);
-
-
-/* runtime/shm_obj.c */
-
-extern Shvar* create_genhook(q* la, q* ga);
-
-extern Shvar* shm_add_consumer(
-  q shv, Shvar* shobj, q cvar, struct global_variables* glbl );
-
-extern void shm_ck_request(Sinfo* chain);
-extern void shm_resume_goals(Sinfo* hook);
-
-extern TADDRtbl* create_local_tbl(q* lcl, q* gbl);
-
-
-/* runtime/newatom.c */
-extern void init_shm_atom(void);
-
-/* runtime/sched.c */
-extern struct goalrec* get_invoked_goals(struct goalrec* qp);
-
-/* runtime/shm_gc.c  GC routines */
-extern int ck_shm_gc(void);
-extern struct goalrec* shm_gc(struct goalrec* qp);
-
-/* for GC */
-extern q** shm_gcstack;
-extern q** shm_gcmax;
-extern q** shm_sp;
-extern int shm_gcstack_size;
-
-#endif /* _KLIC_SHM_H_ */
diff -ruN klic-3.003-2002-03-16/runtime/shm_gc.c klic-3.003-2002-03-19/runtime/shm_gc.c
--- klic-3.003-2002-03-16/runtime/shm_gc.c	Mon Feb 25 13:28:20 2002
+++ klic-3.003-2002-03-19/runtime/shm_gc.c	Thu Jan  1 09:00:00 1970
@@ -1,912 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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.)
------------------------------------------------------------ */
-
-#include <stdio.h>
-#include <klic/basic.h>  /* fatalf */
-#include <klic/struct.h>
-#include "timing.h"
-#include <klic/primitives.h>
-#include <klic/functorstuffs.h>  /* arityof */
-#include "gobj.h"
-#include <klic/susp.h>
-#include "shm.h"
-#include <time.h>
-
-extern q** make_shm_larger_stack();
-
-/* ------- Optinal Flags --------------------------------- */
-/* FLAGS                                                                */
-/*      IAFWD   ... Implicit All Forwarding                             */
-/*      ISFWD   ... Implicit Single Forwarding                          */
-/*                                                                      */
-/*      PAR_GC  ... Parallel GC (Parallel Copy)                         */
-/*      SEQ_GC  ... Sequential GC (Sequential Copy)                     */
-/*                                                                      */
-/*      ASYNC_GC... Asynchronous GC (On-the-fly GC)                     */
-/*      SYNC_GC ... Synchronous GC (Stop-and-GC)                        */
-
-/*
-#define TOPDOWN
-/**/
-#define BOTTOMUP
-/**/
-
-/*
-#define ASYNC_GC   /* Asynchronous GC */
-/**/
-#define SYNC_GC    /* Synchronous GC */
-/**/
-
-/*
-#define PAR_GC     /* Parallel GC */
-/**/
-#define SEQ_GC     /* Sequential GC */
-/**/
-
-/*
-#define IAFWD      /* Implicit All Forwarding */
-/**/
-#define ISFWD      /* Implicit Single Forwarding */
-/**/
-
-/* atomic swap(ptr,io) */
-/* *ptr <-> io */
-#define atomic_swap(ptr,io) ( {\
-     register long  v  asm ("g2") = (long) io;   \
-     register long* s1 asm ("g3") = (long*) ptr; \
-     asm volatile ("                            \
-     swap [%%g3],%%g2;                          \
-" : "=g" (v) : "g" (v), "g" (s1) );             \
-  io = (q) v;                                    \
-  } )
-
-/*
-/* BARRIERS                                                             */
-/*  a_barrier ... to make sure mutators may not see uninitialized cells.*/
-/*      Inserted between element initialization and assignment of       */
-/*       new structure to scavenging target cell.                       */
-/*      (necessary only in Asynchronous GC)                             */
-/*  p_barrier ... to make sure other collectors may not copy            */
-/*      nested objects in parallel with the current collector.          */
-/*      Inserted between forwarding and scavenging of nested objects.   */
-/*      This may help but does not ensure avoiding duplicate copying... */
-/*      (necessary only in Asynchronous Parallel GC)                    */
-/*      (In Synchronous Parallel GC, duplicate copying is avoided by    */
-/*      copy locking.)                                                  */
-/*                                                                      */
-#ifdef ASYNC_GC
-#define a_barrier()     klic_barrier()
-#else
-#define a_barrier()
-#endif
-
-#if defined(PAR_GC) && defined(ASYNC_GC)
-#define p_barrier()     klic_barrier()
-#else
-#define p_barrier()
-#endif
-
-/* For debugging */
-#define ASSERT(cond,mess)  /* \
-  if( !(cond) ) \
-    fatalf( "** ASSERT ERROR: %s. **\n", mess ); */
-
-#define push_shm_stack(addr,sp,max)                     \
-{                                                       \
-   if ( (sp) == max )  {                                \
-    (sp) = make_shm_larger_stack(sp);                   \
-    max = shm_gcmax;                                    \
-  }                                                     \
-  *(sp)++ = (q*)(addr);                                 \
-}
-
-#define pop_gc_command()    (q)(*--sp)
-#define push_gc_command(x)  push_shm_stack(x,sp,max)
-
-#define push_VALUE(val)     push_gc_command(val)
-
-#define push_UPDATE(addr)   push_gc_command(makeatomic(addr))
-
-/*              == GC STACK COMMANDS ==                                 */
-/*                                                                      */
-/*  SCAVENGE(x) (identified by VARREF tag)                              */
-/*    q *x ... pointer to (q) in new local or new shared heap           */
-/*    action: copy *x to new shared heap and update *x                  */
-/*                                                                      */
-#define push_SCAVENGE(addr) push_gc_command(makeref(addr))
-
-#define within_new_space(X) (\
-  (unsigned long)((long)(X) - (long)(PLNE_ptr[currid]->top_addr) ) < SHM_SIZE )
-
-/* Global varibles */
-int F_shm_gc;
-q** shm_gcstack;
-q** shm_gcmax;
-q** shm_sp;
-int shm_gcstack_size;
-
-extern struct ex_goalrec** top_shm_next;
-extern struct ex_goalrec** shm_qp;
-extern struct goalrec goal_queue_tail;
-
-static int shm_gc_times = 0;
-static int measure_shmgc = 1;
-
-static void shm_copy_terms(q** sp, q** max);
-static void enter_shm_gc(void);
-static void exit_shm_gc(void);
-
-/* checks shared-memory GC.  called by "intrpt" routine */
-extern int
-ck_shm_gc()
-{
-  declare_globals;
-  if( oldid != currid ){
-    F_shm_gc = 1;
-    return 1;
-  }else if( PLNE_ptr[currid]->caddr > PLNE_ptr[currid]->limit1 ){
-    F_shm_gc = 1;
-    return 1;
-  }else{
-    return 0;
-  }
-}
-
-
-
-#define chase_queue(qp, sp, max)   (\
- {\
-  struct goalrec top;                                            \
-  struct goalrec* before = &top;                                 \
-  top.next = qp;                                                 \
-  for (; qp!=&goal_queue_tail; before=qp,qp=qp->next) {          \
-    if ( is_shma(qp) && !within_new_space(qp) ) {                \
-        int i,arity=qp->pred->arity;                             \
-        struct goalrec* newg = (struct goalrec*)galloc(arity+2); \
-        newg->next = qp->next;                                   \
-        newg->pred = qp->pred;                                   \
-        for(i=0;i<arity;i++) {                                   \
-	  if ( !isatomic( newg->args[i] = qp->args[i] ) ) {      \
-            push_SCAVENGE(&(newg->args[i]));                     \
-	  }                                                      \
-        }                                                        \
-        before->next = qp = newg;                                \
-    }                                                            \
-  };                                                             \
- top.next;} )
-
-#define chase_ex_queue(exqp,sp,max) {              \
-   struct ex_goalrec* eqp;                         \
-   struct ex_goalrec* before =                     \
-      (struct ex_goalrec*)(top_shm_next+my_node);  \
-   before->next = exqp->next;                      \
-   exqp = before;                                  \
-   eqp = before->next;                             \
-   for(; eqp; before=eqp,eqp=eqp->next) {          \
-      if ( !within_new_space(eqp) ) {              \
-         int i,arity=eqp->goal.pred->arity;        \
-         struct ex_goalrec* newg = (struct ex_goalrec*)galloc(arity+4); \
-                                                   \
-         newg->next = eqp->next;                   \
-         newg->prio = eqp->prio;                   \
-         newg->goal.pred = eqp->goal.pred;         \
-         for(i=0;i<arity;i++) {                    \
-           if ( !isatomic( newg->goal.args[i] = eqp->goal.args[i] ) ) {\
-             push_SCAVENGE(&(newg->goal.args[i])); \
-	   }                                       \
-         }                                         \
-         before->next = eqp = newg;                \
-      }                                            \
-   }                                               \
-   *shm_qp = before;                               \
-}
-
-extern struct goalrec*
-shm_gc(qp)
-  struct goalrec* qp;
-{
-  declare_globals;
-  struct prioqrec* pq = prioq().next;
-
-  struct timeval before, after;
-  int i, j;
-  q** sp = shm_sp;
-  q** max = shm_gcmax;
-  int qkey;
-  int key = gc_key();
-  *cur_status = 4;
-
-  /* printf("The %dth process Shared memory GC start!!\n",my_node); */
-  shm_gc_times++;
-
-#ifdef TOPDOWN
-  if( measure_shmgc ){ gettimeofday(&before); }
-#endif
-
-  enter_shm_gc();
-  /* chases my external pool */
-  qkey = p_key(my_node);
-  s_lock(qkey);
-  chase_ex_queue(ex_qp, sp, max);
-  s_unlock(qkey);
-
-  /* chase qp */
-  for( ; pq->prio >= 0; pq = pq->next ){
-    pq->q = chase_queue(pq->q, sp, max);
-  }
-  qp = chase_queue(qp, sp, max);
-
-  shm_copy_terms(sp, max);
-
-  exit_shm_gc();
-
-#ifdef TOPDOWN
-  if( measure_shmgc ){
-    gettimeofday(&after);
-    gcums += (after.tv_sec - before.tv_sec)*1000000+(after.tv_usec-before.tv_usec);
-  }
-#endif
-
-  *cur_status = 3;
-  return qp;
-}
-
-#ifdef TOPDOWN
-/*----------------------------------------------------------------------*/
-/* TOP DOWN TERM COPY		1994/09/20 N.Ichiyoshi			*/
-/*----------------------------------------------------------------------*/
-
-/*		== FORWARDING SCHEMES ==				*/
-/*									*/
-/*  -- Before Copying and Forwarding --					*/
-/*									*/
-/*	    (in old space)						*/
-/*									*/
-/*		+-------+						*/
-/*		|  FH	| (functor header)				*/
-/*		+-------+						*/
-/*		|  X0	| (0-th argument)				*/
-/*		+-------+						*/
-/*		|  X1	| (1-st argument)				*/
-/*		+-------+						*/
-/*		   ...							*/
-/*		+-------+						*/
-/*		|  Xn	| (n-th argument, n = arify)			*/
-/*		+-------+
-/*									*/
-/*  -- After Surface-Level Copying and Forwarding --			*/
-/*									*/
-/*		*** Implicit All Forwarding (IAFWD) ***			*/
-/*									*/
-/*	     (in old space)	      (in new space)			*/
-/*									*/
-/*		+-------+		+-------+			*/
-/*		|  FH	|		|  FH	|			*/
-/*		+-------+		+-------+			*/
-/*		| REF +--------------->	|  X0	|			*/
-/*		+-------+		+-------+			*/
-/*		| REF +--------------->	|  X1	|			*/
-/*		+-------+		+-------+			*/
-/*		   ...			   ...				*/
-/*		+-------+		+-------+			*/
-/*		| REF +--------------->	|  Xn	|			*/
-/*		+-------+		+-------+			*/
-/*									*/
-/*		*** Implicit Single Forwarding (ISFWD) ***		*/
-/*									*/
-/*	     (in old space)	      (in new space)			*/
-/*									*/
-/*		+-------+		+-------+			*/
-/*		|  FH	|		|  FH	|			*/
-/*		+-------+		+-------+			*/
-/*		| REF +--------------->	|  X0	|			*/
-/*		+-------+		+-------+			*/
-/*		| PX1	|		|  X1	|			*/
-/*		+-------+		+-------+			*/
-/*		   ...			   ...				*/
-/*		+-------+		+-------+			*/
-/*		| PXn	|		|  Xn	|			*/
-/*		+-------+		+-------+			*/
-/*									*/
-/*	PXi = Xi, 		       if Xi is atomic,			*/
-/*	      REF to new i-th element, if Xi is not atomic		*/
-/*									*/
-/*  FORWARDING POINTER CELLS
-/*   - For CONS record, cdr contains forwarding pointer.		*/
-/*   - For normal FUNCTOR record, args[0] contains forwarding pointer.	*/
-/*									*/
-/*  ASSUMPTIONS								*/
-/*   (1) The mutator process must not overwrite active cells in		*/
-/*	 shared heap other than unbound shared variables.		*/
-/*	 (In particular, it is assumed that there is no destructive	*/
-/*	 update of structure elements.)					*/
-/*   (2) Under ISF, the mutator must not put REF pointer to new space	*/
-/*	 in a forwarding pointer cell.					*/
-/*   (3) There is no functor with arity = 0.				*/
-/*									*/
-
-/*		== OFFSET VALUES (in number of q cells) == 		*/
-/*									*/
-/*  CDROFFSET	    ... offset of CDR from top of CONS record (=0)	*/
-/*  FIRSTELTOFFSET  ... offset of arg[0] from top of FUNCTOR record (=1)*/
-/*  CARCDROFFSET    ... offset of CAR from CDR (=1)			*/
-/*									*/
-/* N.B. In gcc, these are compiled as constants under -O option.	*/
-/*									*/
-static struct cons dummycons;
-static struct functor dummyfunc;
-#define CDROFFSET	((q*) &(dummycons.cdr) - (q*) &dummycons)
-#define CARCDROFFSET	((q*) &(dummycons.car) - (q*) &(dummycons.cdr))
-#define FIRSTELTOFFSET	((q*) &(dummyfunc.args[0]) - (q*) &dummyfunc)
-
-#define qsizeof_cons	    (sizeof(struct cons)/sizeof(q))	   /* 2 */
-#define qsizeof_functor(n)  (sizeof(struct functor)/sizeof(q)+n-1) /* n+1 */
-
-/*			== COPY LOCK ==					*/
-/*									*/
-/*  In synchronous parallel GC, objects are locked in order to avoid	*/
-/*  duplicate copying.							*/
-/*									*/
-#if defined(SYNC_GC) && defined(PAR_GC)
-#define COPYING_MARK	makeref(sizeof(q))  /* impossible as normal object */
-#endif
-
-static void
-shm_copy_terms(sp, max)
-  q** sp;
-  q** max;
-{
-  declare_globals;
-  q *objp, obj;
-  while( sp > shm_gcstack ){
-    (q) objp = pop_gc_command();
-    ASSERT( isref(objp), "Shared heap topdown GC command error.");
-    objp = refp(objp);	/* objp points to scavenging target cell */
-    obj = *objp;	/* obj is content of scavenging target cell */
-
-  TRO_LOOP:
-
-    ASSERT( !is_shma(objp) || within_new_space(objp), "objp in old space");
-    ASSERT( obj == *objp, "obj != *objp");
-
-    switch( ptagof(obj) ){
-    case CONS: {
-      struct cons *old, *new;
-      old = consp(obj);
-					/* in new space ? */
-      if( within_new_space(old) ) continue;
-					/* already copied ? */
-#ifdef ISFWD
-      if( isref(old->cdr) && within_new_space(refp(old->cdr)) ){
-	*objp = makecons(refp(old->cdr) - CDROFFSET);
-	continue;
-      }
-#endif
-#ifdef IAFWD
-      if( isref(old->cdr) && within_new_space(refp(old->cdr)) &&
-	  old->car == makeref(refp(old->cdr) + CARCDROFFSET) ){
-	*objp = makecons(refp(old->cdr) - CDROFFSET);
-	continue;
-      }
-#endif
-#if defined(SYNC_GC) && defined(PAR_GC)
-      {
-	q x = COPYING_MARK;
-	volatile q* fpp = &(old->cdr);
-	int offset = CDROFFSET;
-	atomic_swap(fpp, x);
-	if( x == COPYING_MARK ){
-	  /* being copied by somebody else */
-	  while( x == COPYING_MARK ) x = *fpp;
-	  ASSERT( isref(x) && within_new_space(refp(x)), "bad fwd");
-	  *objp = makecons(refp(x) - offset);
-	  continue;
-	}
-					/* allocation */
-	new = (struct cons*) galloc(qsizeof_cons);
-	new->cdr = x;			/* initialization of fwdptr position */
-	new->car = old->car;
-      }
-#else  /* !defined(SYNC_GC) || !defined(PAR_GC) */
-					/* allocation */
-      new = (struct cons*) galloc(qsizeof_cons);
-					/* initialization */
-      new->cdr = old->cdr;
-      new->car = old->car;
-#endif
-					/* update of scavenging target */
-      a_barrier();
-      *objp = makecons(new);
-					/* forwarding */
-      old->cdr = makeref(&(new->cdr));
-#ifdef IAFWD
-      old->car = makeref(&(new->car));
-#endif
-					/* nested scavenging */
-      p_barrier();
-      if( isatomic(new->car) ){
-	/* N.B. In IAFWD, new->cdr is already REF to new->car. */
-	objp = &(new->cdr);
-	obj = *objp;
-      }else{
-	push_SCAVENGE(&(new->cdr));
-#ifdef ISFWD
-	old->car = makeref(&(new->car));
-#endif
-	objp = &(new->car);
-	obj = *objp;
-      }
-      goto TRO_LOOP;
-    }
-    case ATOMIC: {
-      continue;
-    }
-    case VARREF: {
-      q temp;
-      if( within_new_space(refp(obj)) ) continue;
-      temp = derefone(obj);
-      if( isref(temp) && obj == derefone(temp) ){	/* double loop */
-        q svar;
-        struct generator_susp* vcell;
-        struct generator_object* addi;
-        Shvar* gvar;
-        addi = n_lock(obj, temp);
-        if( derefone(obj) != temp ){
-          obj = derefone(obj);
-          *objp = obj;
-	  goto TRO_LOOP;
-        }
-        svar = (q) galloc((sizeof(struct generator_susp)/sizeof(q))+1);
-        vcell = (struct generator_susp*) (((q*)svar) + 1);
-        vcell->backpt = (q) svar;
-        derefone(svar) = (q) vcell;
-        gvar = (Shvar*) untag_generator_susp(addi);
-        if( !gvar->chain ){
-	  vcell->u.o = tag_generator_susp(pSHM_VAR);
-        }else if( within_new_space(gvar) ){
-	  vcell->u.o = tag_generator_susp(gvar);
-        }else{
-	  Sinfo* dptr;
-	  Sinfo* sptr;
-	  Shvar* svar = (Shvar*) galloc((sizeof(Shvar)/sizeof(q)));
-	  vcell->u.o = tag_generator_susp(svar);
-	  svar->method = SHM_VAR;
-	  dptr = (Sinfo*) &(svar->chain);
-	  sptr = gvar->chain;
-	  if( !is_genhook(sptr) ){
-	    while( sptr != NULL && !within_new_space(sptr) ){
-	      dptr->next = (Sinfo*) galloc((sizeof(Sinfo)/sizeof(q)));
-	      dptr = dptr->next;
-	      dptr->PE_num = sptr->PE_num;
-	      dptr->prio = sptr->prio;
-	      dptr->indp = sptr->indp;
-	      sptr = sptr->next;
-	    }
-	    dptr->next = sptr;
-	  }else{
-	    if( !within_new_space(sptr) ){
-	      Sinfo* addr = (Sinfo*) galloc((sizeof(Sinfo)/sizeof(q)));
-	      sptr = untag_genhook(sptr);
-	      dptr->next = tag_genhook(addr);
-	      dptr = addr;
-	      dptr->next = 0;
-	      dptr->PE_num = sptr->PE_num;
-	      dptr->prio = sptr->prio;
-	      dptr->indp = sptr->indp;
-	    }else{
-	      dptr->next = sptr;
-	    }
-	  }
-	}
-	a_barrier();
-	derefone(obj) = makeref(svar);
-	*objp = makeref(svar);
-	continue;
-      }else{  /* obj is an invisible pointer */	  
-	*objp = obj = temp;
-	goto TRO_LOOP;
-      }
-    }
-    case FUNCTOR: {
-      int i, arity;
-      q f;
-      struct functor *old, *new;
-      old = functorp(obj);
-					/* in new space ? */
-      if( within_new_space(old) ) continue;
-      f = functor_of(obj);
-      if( isref(f) ){
-	/*--- GENERIC OBJECT (data object) ---*/
-	struct data_object* dobj = (struct data_object*) old;
-	obj = generic_shmcopy(dobj);
-	a_barrier();
-	*objp = obj;
-	continue;
-      }
-      /*--- NORMAL FUNCTOR ---*/
-					/* already copied ? */
-#ifdef ISFWD
-      /* arity > 0 is assumed */
-      if( isref(old->args[0]) && within_new_space(refp(old->args[0])) ){
-	new = (struct functor*) (refp(old->args[0]) - FIRSTELTOFFSET);
-	*objp = makefunctor(new);
-	continue;
-      }
-      arity = arityof(f);
-#endif
-#ifdef IAFWD
-      arity = arityof(f);
-      if( isref(old->args[0]) && within_new_space(refp(old->args[0])) ){
-	q* neweltp = refp(old->args[0]) + 1;
-	int copied = 1;
-	for( i=1; i<arity; i++, neweltp++ ){
-	  if( old->args[i] != makeref(neweltp) ){
-	    copied = 0;
-	    break;  /* exit for statement */
-	  }
-	  /* N.B. If arity is extremely large, neweltp might overflow.	*/
-	  /*   But in that case, makeref(neweltp) becomes makeref(0),	*/
-	  /*   which cannot be equal to old->args[i].			*/
-	}
-	if( copied ){
-	  new = (struct functor*) (refp(old->args[0]) - FIRSTELTOFFSET);
-	  *objp = makefunctor(new);
-	  continue;
-	}
-      }  /* end if */
-#endif
-#if defined(SYNC_GC) && defined(PAR_GC)
-      {
-	q x = COPYING_MARK;
-	volatile q* fpp = &(old->args[0]);
-	int offset = FIRSTELTOFFSET;
-	atomic_swap(fpp,x);
-	if( x == COPYING_MARK ){
-	  /* being copied by somebody else */
-	  while( x == COPYING_MARK ) x = *fpp;
-	  ASSERT( isref(x) && within_new_space(refp(x)), "bad fwd");
-	  *objp = makefunctor(refp(x) - offset);
-	  continue;
-	}
-					/* allocation */
-	new = (struct functor*) galloc(qsizeof_functor(arity));
-					/* initialization */
-	new->functor = f;
-	new->args[0] = x;		/* initialization of fwdptr position */
-	for( i=1; i<arity; i++ ){
-	  new->args[i] = old->args[i];
-	}
-      }
-#else
-					/* allocation */
-      new = (struct functor*) galloc(qsizeof_functor(arity));
-					/* initialization */
-      new->functor = f;
-      for( i=0; i<arity; i++ ){
-	new->args[i] = old->args[i];
-      }
-#endif
-					/* update of scavenging target */
-      a_barrier();
-      *objp = makefunctor(new);
-					/* forwarding */
-      old->args[0] = makeref(&(new->args[0]));
-#ifdef IAFWD
-      for( i=1; i<arity; i++ ){
-	old->args[i] = makeref(&(new->args[i]));
-      }
-#endif
-					/* nested scavenging */
-      p_barrier();
-      for( i=arity-1; i>0; i-- ){
-	if( ! isatomic(new->args[i]) ){
-#ifdef ISFWD
-	  old->args[i] = makeref(&(new->args[i]));
-#endif
-	  push_SCAVENGE(&(new->args[i]));
-	}
-      }
-      objp = &(new->args[0]);
-      obj = *objp;
-      goto TRO_LOOP;
-    } /* case FUNCTOR */
-    default: {
-      ASSERT(0, "Impossible case");
-    }
-    } /* switch statement */
-  } /* while (sp > shm_gcstack) */
-}
-#endif /* TOPDOWN */
-
-#ifdef BOTTOMUP
-static void
-shm_copy_terms(sp, max)
-  q** sp;
-  q** max;
-{
-  declare_globals;
-  q obj;
-  while( sp > shm_gcstack ){
-    q* objp;
-    sp--;
-    objp = *sp;
-    switch( ptagof(objp) ){
-    case ATOMIC: {  /* in case of UPDATE */
-      q* conta = (q*) ((long)objp - ATOMIC);
-      klic_barrier();
-      *conta = obj;
-      break;
-    }
-    case CONS:
-    case FUNCTOR: {
-      obj = (q) objp;
-      break;
-    }
-    default: {
-      obj = *objp;
-
-    ENTRY:
-      switch( ptagof(obj) ){
-      case CONS: {
-	struct cons* new;
-	if( !is_shma(obj) ) break;  /* assume text-area */
-	if( within_new_space(obj) ) break;
-	new = (struct cons*) galloc(2);
-	*objp = makecons(new);
-	push_VALUE(makecons(new));
-	new->cdr = cdr_of(obj);
-	if( !isatomic(new->cdr) ){
-	  push_UPDATE(&cdr_of(obj));
-	  push_SCAVENGE(&new->cdr);
-	}
-	new->car = car_of(obj);
-	if( isatomic(new->car) ) break;
-	push_UPDATE(&car_of(obj));
-	objp = &new->car;
-	obj = *objp;
-	goto ENTRY;
-      }
-      case ATOMIC: { break; }
-      case VARREF: {
-	q temp;
-	if( within_new_space(obj) ){ break; }
-	temp = derefone(obj);
-	if( isref(temp) && obj == derefone(temp) ){
-	  q svar;
-	  struct generator_susp* vcell;
-	  struct generator_object* addi;
-	  Shvar* gvar;
-	  addi = n_lock(obj,temp);
-	  if( derefone(obj) != temp ){
-	    obj = derefone(obj);
-	    *objp = obj;
-	    goto ENTRY;
-	  }
-	  svar = (q) galloc((sizeof(struct generator_susp)/sizeof(q))+1);
-	  vcell = (struct generator_susp*) (((q*)svar) + 1);
-	  vcell->backpt = (q) svar;
-	  derefone(svar) = (q) vcell;
-	  gvar = (Shvar*) untag_generator_susp(addi);
-	  if( !gvar->chain ){
-	    vcell->u.o = tag_generator_susp(pSHM_VAR);
-	  }else if( within_new_space(gvar) ){
-	    vcell->u.o = tag_generator_susp(gvar);
-	  }else{
-	    Sinfo* dptr;
-	    Sinfo* sptr;
-	    Shvar* svar = (Shvar*) galloc((sizeof(Shvar)/sizeof(q)));
-	    vcell->u.o = tag_generator_susp(svar);
-	    svar->method = SHM_VAR;
-	    dptr = (Sinfo*) &(svar->chain);
-	    sptr = gvar->chain;
-	    if( !is_genhook(sptr) ){
-	      while( sptr != NULL && !within_new_space(sptr)){
-		dptr->next = (Sinfo*) galloc((sizeof(Sinfo)/sizeof(q)));
-		dptr = dptr->next;
-		dptr->PE_num = sptr->PE_num;
-		dptr->prio = sptr->prio;
-		dptr->indp = sptr->indp;
-		sptr = sptr->next;
-	      }
-	      dptr->next = sptr;
-	    }else{
-	      if( !within_new_space(sptr) ){
-		Sinfo* addr = (Sinfo*) galloc((sizeof(Sinfo)/sizeof(q)));
-		sptr = untag_genhook(sptr);
-		dptr->next = tag_genhook(addr);
-		dptr = addr;
-		dptr->next = NULL;
-		dptr->PE_num = sptr->PE_num;
-		dptr->prio = sptr->prio;
-		dptr->indp = sptr->indp;
-	      }else{
-		dptr->next = sptr;
-	      }
-	    }
-	  }
-	  klic_barrier();
-	  derefone(obj) = (q) svar;
-	  *objp = obj = (q) svar;
-	  break;
-	}
-
-        {  /* in case of an invisible pointer */
-	  *objp = obj = temp;
-	  goto ENTRY;
-	}
-      }
-      default: {  /* functor */
-	int i, arity, aritym1;
-	struct functor* new;
-	q f;
-	if( !is_shma(obj) ) break;  /* assume text-area */
-	if( within_new_space(obj) ) break;
-	f = functor_of(obj);
-	if( isref(f) ){
-	  struct data_object* dobj = (struct data_object*) functorp(obj);
-	  obj = generic_shmcopy(dobj);
-	  klic_barrier();
-	  *objp = obj;
-	  break;
-	}
-	arity = arityof(f);
-	aritym1 = arity-1;
-	new = (struct functor*) galloc(arity+1);
-	new->functor = f;
-	*objp = makefunctor(new);
-	push_VALUE(makefunctor(new));
-	for( i=0; i<aritym1; i++ ){
-	  new->args[i] = arg(obj, i);
-	  if( !isatomic(new->args[i]) ){
-	    push_UPDATE(&arg(obj,i));
-	    push_SCAVENGE(&(new->args[i]));
-	  }
-	}
-	new->args[aritym1] = arg(obj, aritym1);
-	if( !isatomic(new->args[aritym1]) ){
-	  push_UPDATE(&arg(obj, aritym1));
-	  objp = &(new->args[aritym1]);
-	  obj = *objp;
-	  goto ENTRY;
-	}
-      }
-      }  /* switch(ptogof(obj)) */
-    }
-    }  /* switch(ptagof(objp)) */
-  }  /* while( sp...) */
-}
-#endif /* BOTTOMUP */
-
-
-static void
-get_new_plane()
-{
-  declare_globals;
-  int i, id, j;
-  s_lock(m_key());
-  if( PLNE_ptr[currid]->direct == -1 ){
-    id = (currid + 1) % N_PLNE;
-    for( j=0; j<total_node; j++ ){
-      if( PLNE_ptr[id]->proc[j] ){
-	abend("Shared Memory overflow !!!");
-      }
-    }
-
-    /* initialize table */
-    PLNE_ptr[id]->caddr = PLNE_ptr[id]->top_addr;
-    PLNE_ptr[id]->demand = 0;
-    PLNE_ptr[id]->direct = -1;
-    klic_barrier();
-    PLNE_ptr[currid]->direct = id;
-  }else{
-    id = PLNE_ptr[currid]->direct;
-  }
-  s_unlock(m_key());
-
-  currid = id;
-  PLNE_ptr[currid]->proc[my_node] = 1;
-  gallocp = glimit = (q*) 1;
-}
-
-static void
-enter_shm_gc()
-{
-  declare_globals;
-#ifdef ASYNC_GC
-  if( currid == oldid ){
-    PLNE_ptr[currid]->proc[my_node] = 3;
-    if( PLNE_ptr[currid]->direct == -1 ){
-      get_new_plane();
-    }else{
-      currid = PLNE_ptr[currid]->direct;
-      PLNE_ptr[currid]->proc[my_node] = 2;
-      gallocp = glimit = (q*) 1;
-    }
-  }else{
-    PLNE_ptr[oldid]->proc[my_node] = 10;
-  }
-  {
-    int j, next;
-    next = (currid + 1) % N_PLNE;
-    for( j=0; j<total_node; j++ ){
-      if( PLNE_ptr[next]->proc[j] ){
-	struct global_variables* tglbl = top_shm_glbl + j;
-	tglbl->interrupt_off0 = 0;
-	klic_barrier();
-	tglbl->heaplimit0 = 0;
-      }
-      {
-	int waitC = 1000000;
-	for(;;){
-	  if( !(PLNE_ptr[next]->proc[j]) ) break;
-	  if( !(waitC--) ) abend("Shared-memory overflow!!!");
-	}
-      }
-    }
-    oldid = currid;
-  }
-#endif  /* ASYNCGC */
-#ifdef SYNC_GC
-  {
-    int i, j;
-    if( !PLNE_ptr[currid]->demand ){
-      s_lock(m_key());
-      if( !PLNE_ptr[currid]->demand ){
-	PLNE_ptr[currid]->demand = 1;
-	for( j=0; j<total_node; j++ ){
-	  if( PLNE_ptr[currid]->proc[j] ){
-	    struct global_variables* tglbl = top_shm_glbl + j;
-	    tglbl->interrupt_off0 = 0;
-	    klic_barrier();
-	    tglbl->heaplimit0 = 0;
-	  }
-	}
-	PLNE_ptr[1-currid]->caddr = PLNE_ptr[1-currid]->top_addr;
-	PLNE_ptr[1-currid]->demand = 0;
-      }
-      s_unlock(m_key());
-    }
-    PLNE_ptr[currid]->proc[my_node] = 0;
-    for( i=0; i<total_node; i++)
-      while( PLNE_ptr[currid]->proc[i] )
-	{}
-    currid = 1 - currid;
-    gallocp = glimit = (q*) 1;
-  }
-#endif  /* SYNC_GC */
-#ifdef SEQ_GC
-  s_lock(gc_key());
-#endif
-}
-
-static void
-exit_shm_gc()
-{
-  declare_globals;
-#ifdef SEQ_GC
-  s_unlock(gc_key());
-#endif
-#ifdef SYNC_GC
-  {
-    int i;
-    PLNE_ptr[currid]->proc[my_node] = 1;
-    for( i=0; i<total_node; i++)
-      while( !PLNE_ptr[currid]->proc[i] )
-	{}
-  }
-#endif
-#ifdef ASYNC_GC
-  {
-    int i;
-    for( i=0; i<N_PLNE; i++ ){
-      if( i != currid && i != oldid )  PLNE_ptr[i]->proc[my_node] = 0;
-    }
-    PLNE_ptr[currid]->proc[my_node] = -1;
-  }
-#endif
-  F_shm_gc = 0;
-}
diff -ruN klic-3.003-2002-03-16/runtime/shm_machine.h klic-3.003-2002-03-19/runtime/shm_machine.h
--- klic-3.003-2002-03-16/runtime/shm_machine.h	Wed Jan  2 14:44:16 2002
+++ klic-3.003-2002-03-19/runtime/shm_machine.h	Thu Jan  1 09:00:00 1970
@@ -1,233 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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_SHM_MACHINE_H_
-#define _KLIC_SHM_MACHINE_H_
-
-  /* lock-unlock */
-
-
-#ifdef SPARC
-
-#define n_lock(shvp,sadp) ( { \
-    register int* s1 asm ("g4") = (int*) (shvp); \
-    register int* s2 asm ("g3") = (int*) (sadp); \
-    register struct generator_object* befp asm ("g2");          \
-    register struct generator_object* genp asm ("g5") = qSHM_BUSY; \
-    asm ( "                   \
-0:                            \
-        mov %%g5,%%g2;        \
-        swap [%%g3 + 4],%%g2; \
-        cmp %%g2,%%g5;        \
-        bne 4f;               \
-        nop;                  \
-2:                            \
-        ld [%%g4],%%g2;       \
-        cmp %%g3,%%g2;        \
-        bne 3f;               \
-        nop;                  \
-        ld [%%g3 + 4],%%g2;   \
-        cmp %%g2,%%g5;        \
-        bne 0b;               \
-        nop;                  \
-        b 2b;                 \
-        nop;                  \
-3:                            \
-        mov %%g5,%%g2;        \
-4:                            \
-" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp)  );    \
-  (shvp) = (q) s1;               \
-  befp;                       \
-  } )
-
-#define n_unlock(sadp, genh) \
-do{ \
-    register int* n1 asm ("g3") = (int*) (sadp); \
-    register struct generator_object* n2 asm ("g4") = (genh); \
-    asm volatile ( "         \
-        stbar;               \
-        st %%g4,[%%g3 + 4];  \
-" :  : "g" (n1), "g" (n2) ) ;\
-}while(0)
-
-#define s_lock(key) \
-do{ \
-    register int* val asm ("g3") = lockp[key]; \
-    asm volatile ( "         \
-0:                           \
-        mov -1,%%g2;         \
-        swap [%%g3],%%g2;    \
-        cmp %%g2,0;          \
-        be 3f;               \
-        nop;                 \
-2:                           \
-        ld [%%g3],%%g2;      \
-        cmp %%g2,0;          \
-        be 0b;               \
-        nop;                 \
-        b 2b;                \
-        nop;                 \
-3:                           \
-" :  : "g" (val) : "g2" );   \
-}while(0)
-
-#define s_unlock(key) 
-do{ \
-    register int* val asm ("g3") = lockp[key]; \
-    asm volatile ( "         \
-        stbar;               \
-        st %%g0,[%%g3];      \
-" :  : "g" (val) ) ;         \
-}while(0)
-
-#define klic_barrier()  do{ asm volatile ( "stbar;" : : ); }while(0)
-
-#endif  /* SPARC */
-
-
-#ifdef ALPHA
-
-#define n_lock(shvp,sadp) ( { \
-    register long* s1 asm ("$4") = (long*) (shvp); \
-    register long* s2 asm ("$3") = (long*) (sadp); \
-    register struct generator_object* genp asm ("$5") = qSHM_BUSY; \
-    register struct generator_object* befp asm ("$2");           \
-    asm volatile ( "          \
-1:                            \
-        ldq_l $2,8($3);       \
-        cmpeq $2,$5,$1;       \
-        bne   $1,2f;          \
-        bis   $5,$5,$1;       \
-        stq_c $1,8($3);       \
-        bne   $1,3f;          \
-2:                            \
-        ldq   $2,8($3);       \
-        cmpeq $2,$5,$1;       \
-        beq   $1,1b;          \
-        ldq   $1,($4);        \
-        cmpeq $3,$1,$1;       \
-        beq   $1,3f;          \
-        br    2b;             \
-3:                            \
-        mb;                   \
-" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp) : "$1" );    \
-  (shvp) = (q) s1;               \
-  befp;                       \
-  } )
-
-#define n_unlock(sadp, genh) \
-do{ \
-    register long* n1 asm ("$3") = (long*) (sadp); \
-    register struct generator_object* n2 asm ("$4") = (genh); \
-    asm volatile ( "         \
-        mb;                  \
-        stq $4,8($3);        \
-" :  : "g" (n1), "g" (n2) ) ;\
-}while(0)
-
-#define s_lock(key) \
-do{ \
-    register int* val asm ("$3") = lockp[key]; \
-    asm volatile ( "        \
-1:                          \
-        ldl_l $1,0($3);     \
-        blbs  $1,2f;        \
-        or    $1,1,$2;      \
-        stl_c $2,0($3);     \
-        beq   $2,2f;        \
-        br    3f;           \
-2:                          \
-        ldl   $1,0($3);     \
-        blbc  $1,1b;        \
-        br    2b;           \
-3:                          \
-" :  : "g" (val) : "$1","$2" ); \
-}while(0)
-
-#define s_unlock(key) \
-do{ \
-    register int* val asm ("$3") = lockp[key]; \
-    asm volatile ( "        \
-        mb;                 \
-        stl $31,0($3);      \
-" :  : "g" (val) ) ;        \
-}while(0)
-
-#define klic_barrier()  do{ asm volatile ( "mb;" : : ); }while(0)
-
-#endif  /* ALPHA */
-
-
-#ifdef INTEL
-#define n_lock(shvp, sadp) ({ \
-    register int* s1 asm ("%edx") =  (int *) (shvp);  \
-    register int* s2 asm ("%ecx") =  (int *) (sadp);  \
-    register struct generator_object* befp asm ("%ebx"); \
-    register struct generator_object* genp asm ("%eax") = qSHM_BUSY; \
-    asm ( "                     \
-0:                              \
-        movl  %%eax,%%ebx;      \
-        xchgl 4(%%ecx),%%ebx;   \
-        cmpl  %%ebx,%%eax;      \
-        jne   4f;               \
-2:                              \
-        movl  (%%edx),%%ebx;    \
-        cmpl  %%ecx,%%ebx;      \
-        jne   3f;               \
-        movl  4(%%ecx),%%ebx;   \
-        cmpl  %%ebx,%%eax;      \
-        jne   0b;               \
-        jmp   2b;               \
-3:                              \
-        movl  %%eax,%%ebx;      \
-4:                              \
-" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp)  );    \
-  (shvp) = (q) s1;               \
-  befp;                       \
-  } )
-
-#define n_unlock(sadp,genh) \
-do{ \
-    register int* n1 asm ("%ecx") = (int*) (sadp); \
-    register struct generator_object* n2 asm ("%edx") = (genh); \
-    asm volatile ( "         \
-        movl %%edx,4(%%ecx);  \
-" :  : "g" (n1), "g" (n2) ) ;\
-}while(0)
-
-#define s_lock(key) { \
-    register int* val asm ("%ecx") = lockp[key]; \
-    asm volatile ( "         \
-        movl $0,%%edx;       \
-6:                           \
-        movl $-1,%%ebx;      \
-        xchgl (%%ecx),%%ebx; \
-        cmpl %%ebx,%%edx;    \
-        je  8f;              \
-7:                           \
-        movl (%%ecx),%%ebx;  \
-        cmpl %%ebx,%%edx;    \
-        je  6b;              \
-        jmp 7b;              \
-8:                           \
-" :  : "g" (val) : "%ebx","%edx" );   \
-}while(0)
-
-#define s_unlock(key) \
-do{      \
-    register int* val asm ("ecx") = lockp[key]; \
-    asm volatile ( "         \
-        movl $0,(%%ecx);     \
-" :  : "g" (val) ) ;         \
-}while(0)
-
-#define klic_barrier()  do{;}while(0)
-
-#endif  /* INTEL */
-
-
-#endif /* _KLIC_SHM_MACHINE_H_ */
diff -ruN klic-3.003-2002-03-16/runtime/shm_obj.c klic-3.003-2002-03-19/runtime/shm_obj.c
--- klic-3.003-2002-03-16/runtime/shm_obj.c	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/runtime/shm_obj.c	Thu Jan  1 09:00:00 1970
@@ -1,423 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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.)
------------------------------------------------------------ */
-
-#include <stdio.h>  /* NULL */
-#include <klic/basic.h>
-#include <klic/struct.h>
-#include <klic/primitives.h>  /* enqueue_goal */
-#include <klic/functorstuffs.h>
-#include <klic/index.h>
-#include <klic/unify.h>  /* do_unify */
-#include <klic/susp.h>
-#include <klic/gg_macro.h>
-#include "shm.h"
-
-extern void* calloc();
-
-#define is_cur_space_ptr(X) \
-  ((unsigned long) ((long)(X) - (long)(PLNE_ptr[currid]->top_addr)) < SHM_SIZE)
-
-/* unbound variable in shared memory (representating by a generic object)
-        +-------------------+
-        V                   |
-   +---------+         +----+----+
-   |  var ---+-------->|    *    |
-   +---------+         +---------+
-                     Additional Info.
-                       +---------+
-
-*/
-
-/* definition of an initail generator object on text area */
-
-extern struct generator_object_method_table GG_method_table0(shvar);
-extern struct generator_object_method_table GG_method_table0(shbusy);
-struct generator_object_method_table* SHM_VAR = 
-  &GG_method_table0(shvar);
-struct generator_object_method_table* SHM_BUSY =
-  &GG_method_table0(shbusy);
-Shvar xSHM_VAR = {&GG_method_table0(shvar), 0};
-struct generator_object* pSHM_VAR = (struct generator_object*) &xSHM_VAR;
-Shvar xSHM_BUSY = {&GG_method_table0(shbusy), 0};
-struct generator_object* qSHM_BUSY = tag_generator_susp(&xSHM_BUSY);
-
-
-/* address drive table */
-#define ADDRBULK 2048
-TADDRtbl ADDRtbl = { &ADDRtbl, &ADDRtbl, 0, 0 };
-TADDRtbl* ADDRtbl_free = NULL;
-
-#define new_addr_rec(lrec) \
-{ \
-  TADDRtbl* temp; \
-  temp = ADDRtbl_free; \
-  while( temp == NULL ){ \
-    ADDRtbl_free = more_addr_rec(); \
-  } \
-  ADDRtbl_free = temp->next; \
-  (lrec) = temp; \
-}
-
-
-static module shm_resume(struct global_variables* glbl,
-  struct goalrec* qp, q* allocp, const struct predicate* toppred);
-
-static module shm_request(struct global_variables* glbl,
-  struct goalrec* qp, q* allocp, const struct predicate* toppred);
-
-static const struct predicate shm_xresume_1 = { shm_resume, 0, 1 };
-static const struct predicate shm_xrequest_1 = { shm_request, 0, 1 };
-
-
-static TADDRtbl*
-more_addr_rec()
-{
-  int k;
-  TADDRtbl* bulk = (TADDRtbl*) calloc(ADDRBULK, sizeof(TADDRtbl));
-  for( k = ADDRBULK-1; k > 0; k-- ){
-    bulk[k-1].next = &bulk[k];
-  }
-  bulk[ADDRBULK-1].next = 0;
-  return bulk;
-}
-
-/* d_shm_init
-  initializes free chain of external trigger */
-extern void
-d_shm_init()
-{
-  TADDRtbl* bptr;
-  new_addr_rec(bptr);
-}
-
-
-extern Sinfo*
-shm_copy_chain(xp)
-  Sinfo* xp;
-{
-  declare_globals;
-  Sinfo* ret;
-  Sinfo** retp = &ret;
-  while( xp != NULL && !is_cur_or_forward_ptr(xp) ){
-    Sinfo* sp = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-    *sp = *xp;
-    *retp = sp;
-    retp = (Sinfo**) sp;
-    xp = xp->next;
-  }
-  *retp = xp;
-  return ret;
-}
-
-
-extern Sinfo*
-shm_merge_chain(xp, yp)
-  Sinfo* xp;
-  Sinfo* yp;
-{
-  declare_globals;
-  Sinfo* ret;
-  Sinfo** retp = &ret;
-  while( xp != NULL ){
-    if( !is_cur_or_forward_ptr(xp) ){  /* xp is old */
-      Sinfo* sp = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-      *sp = *xp;
-      *retp = sp;
-      retp = (Sinfo**) sp;
-    }else if( !is_cur_space_ptr(xp) ){  /* xp is new */
-      while( yp != NULL ){
-	if( !is_cur_or_forward_ptr(yp) ){  /* yp is old */
-	  Sinfo* sp = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-	  *sp = *yp;
-	  *retp = sp;
-	  retp = (Sinfo**) sp;
-	}else if( !is_cur_space_ptr(yp) ){  /* yp is new */
-	  while( yp != NULL ){
-	    *retp = yp;
-	    retp = (Sinfo**) yp;
-	    yp = yp->next;
-	  }
-	  *retp = xp;
-	  return ret;
-	}else{        /* yp is cur */
-	  *retp = yp;
-	  retp = (Sinfo**) yp;
-	}
-	yp = yp->next;
-      }
-      *retp = yp;
-    }else{                  /* xp is cur */
-      *retp = xp;
-      retp = (Sinfo**) xp;
-    }
-    xp = xp->next;
-  }
-  /* xp is no more new space */
-  while( yp != NULL ){
-    if( !is_cur_or_forward_ptr(yp) ){  /* yp is old */
-      Sinfo* sp = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-      *sp = *yp;
-      *retp = sp;
-      retp = (Sinfo**) sp;
-    } else break;
-    yp = yp->next;
-  }
-  *retp = yp;
-  return ret;
-}
-
-
-/* shm_add_consumer(shrec,consumer_ref)
-  adds a shared memory variable
-*/
-extern Shvar*
-shm_add_consumer(shv, shobj, cvar, glbl)
-  q shv;
-  Shvar* shobj;
-  q cvar;
-  struct global_variables* glbl;
-{
-  q mid;
-  Sinfo* sptr;
-  ck_new_galloc(shv);
-  if( shobj != NULL && shobj->chain != NULL ){
-    Sinfo* shrec = shobj->chain;
-    Sinfo* bp = (Sinfo*) &(shobj->chain);
-    ck_new_galloc(shrec);
-    while( !is_cur_or_forward_ptr(shrec) ){
-      sptr = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-      *sptr = *shrec;
-      bp->next = sptr;
-      bp = sptr;
-      shrec = sptr->next;
-    }
-    sptr = (Sinfo*) galloc(sizeof(Sinfo)/sizeof(q));
-    bp->next = sptr;
-    sptr->next = shrec;
-    sptr->PE_num = my_node;
-    sptr->prio = current_prio();
-    mid = derefone(cvar);
-    derefone(cvar) = shv;
-    derefone(mid) = 0;
-    sptr->indp = create_local_tbl(tag_local(mid), shv);
-    return shobj;
-  }else{
-    /* add first */
-    Shvar* vr = (Shvar*) galloc((sizeof(Shvar)+sizeof(Sinfo))/sizeof(q));
-    sptr = (Sinfo*) (vr + 1);
-    vr->method = SHM_VAR;
-    vr->chain = sptr;
-    sptr->next = 0;
-    sptr->PE_num = my_node;
-    sptr->prio = current_prio();
-    mid = derefone(cvar);
-    derefone(cvar) = shv;
-    derefone(mid) = 0;
-    sptr->indp = create_local_tbl(tag_local(mid), shv);
-    return vr;
-  }
-}
-
-
-extern Shvar*
-create_genhook(la, ga)
-  q* la;
-  q* ga;
-{
-  declare_globals;
-  Shvar* varp;
-  Sinfo* sptr;
-  ck_new_galloc(ga);
-  varp = (Shvar*) galloc((sizeof(Shvar)+sizeof(Sinfo))/sizeof(q));
-  sptr = (Sinfo*) (varp + 1);
-  varp->method = SHM_VAR;
-  varp->chain = tag_genhook(sptr);
-  sptr->PE_num = my_node;
-  sptr->next = 0;
-  sptr->prio = HIGHESTPRIO - 1;
-  sptr->indp = create_local_tbl(la, ga);
-  return varp;
-}
-
-/* queueing other PE's resume routine
-*/
-static void resume_queueing(Pe_num, suspg, prio)
-  int Pe_num;
-  TADDRtbl* suspg;
-  long prio;
-{
-  struct ex_goalrec* tp;
-  struct goalrec* goal;
-
-  tp = (struct ex_goalrec*) galloc(5);
-  tp->prio = prio;
-  goal = &tp->goal;
-  goal->next = 0;
-  goal->pred = &shm_xresume_1;
-  goal->args[0] = (q) ((unsigned long)suspg + ATOMIC);
-
-  shm_goal_stack(tp, Pe_num);
-}
-
-/* resume waiting process
-*/
-extern void
-shm_resume_goals(hook)
-  Sinfo* hook;
-{
-  declare_globals;
-  q* allocp = heapp();
-
-  while( hook != NULL ){
-    if( hook->PE_num == my_node ){
-      TADDRtbl* sptr = hook->indp;
-      q term = (q) sptr->localA;
-      q shm_term = (q) sptr->globalA;
-
-      free_local_tbl(sptr);
-
-      if( isatomic(term) ){
-	q wp = untag_local(term);
-	q top = (q) &sptr->localA;
-	derefone(top) = wp;
-	derefone(wp) = top;
-	do_unify(top, shm_term);
-	allocp = heapp();
-      }else{
-	struct goalrec* goal = (struct goalrec*) term;
-	if( goal != NULL && isatomic(goal->next) ){
-	  long prio = intval(goal->next);
-	  if( current_prio() != prio ){
-	    enqueue_goal(NULL, prio, goal, glbl);
-	  }else{
-	    resume_same_prio(goal);
-	  }
-	  inc_resumes();
-	}
-      }
-    }else{
-      resume_queueing(hook->PE_num, hook->indp, hook->prio);
-    }
-    hook = hook->next;
-  }
-}
-
-
-extern void
-shm_request_queueing(peno, prio, indp)
-  int peno;
-  long prio;
-  TADDRtbl* indp;
-{
-  struct ex_goalrec* tp;
-  struct goalrec *goal;
-
-  tp = (struct ex_goalrec*) galloc(5);
-  tp->prio = prio;
-  goal = &tp->goal;
-  goal->next = 0;
-  goal->pred = &shm_xrequest_1;
-  goal->args[0] = (q) ((unsigned long)indp + ATOMIC);
-
-  shm_goal_stack(tp, peno);
-}
-
-
-extern void
-shm_ck_request(chain)
-  Sinfo* chain;
-{
-  declare_globals;
-  q* allocp = heapp();
-  Sinfo* sptr = untag_genhook(chain);
-  int penum = sptr->PE_num;
-  TADDRtbl* indp = sptr->indp;
-  if( penum == my_node ){
-    q temp;
-    free_local_tbl(indp);
-    shm_arg_copy(&indp->localA, &temp);
-    do_unify(indp->globalA, temp);
-    allocp = heapp();
-  }else{
-    shm_request_queueing(penum, current_prio(), indp);
-  }
-}
-
-
-extern TADDRtbl*
-create_local_tbl(lcl, gbl)
-  q* lcl;
-  q* gbl;
-{
-  TADDRtbl* sl;
-  new_addr_rec(sl);
-
-  sl->next = ADDRtbl.next;
-  ADDRtbl.next = sl;
-  (sl->next)->prev = sl;
-  sl->prev = &ADDRtbl;
-  sl->localA = lcl;
-  sl->globalA = gbl;
-
-  return sl;
-}
-
-static module
-shm_resume(glbl, qp, allocp, toppred)
-  struct global_variables* glbl;
-  struct goalrec* qp;
-  q* allocp;
-  const struct predicate* toppred;
-{
-  TADDRtbl* tp = (TADDRtbl*) ((unsigned long)(qp->args[0]) - ATOMIC);
-  set_heapp(allocp);
-  free_local_tbl(tp);
-  if( isatomic(tp->localA) ){  /* consumer */
-    q x = (q) untag_local(tp->localA);
-    q top = (q) &(tp->localA);
-    derefone(top) = x;
-    derefone(x) = top;
-    qp = qp->next;
-    do_unify(top, tp->globalA);
-    allocp = heapp();
-  }else{
-    struct goalrec* gp = (struct goalrec*) (tp->localA);
-    if( gp != NULL && isatomic(gp->next) ){
-      gp->next = qp->next;
-      qp = gp;
-      inc_resumes();
-    }else{
-      qp = qp->next;
-    }
-  }
-  current_queue = qp;
-  return (module) (qp->pred)->func;
-}
-
-
-static module
-shm_request(glbl, qp, allocp, toppred)
-  struct global_variables* glbl;
-  struct goalrec* qp;
-  q* allocp;
-  const struct predicate* toppred;
-{
-  TADDRtbl* tp = (TADDRtbl*) ((unsigned long)(qp->args[0]) - ATOMIC);
-  q var = (q) tp->globalA;
-  set_heapp(allocp);
-  free_local_tbl(tp);
-  qp = qp->next;
-
-  if( isatomic(tp->localA) ){  /* local generator object */
-    q x = untag_local(tp->localA);
-    do_unify(x, var);
-  }else{  /* shared-memory generator hook */
-    do_unify(tp->localA, var);
-  }
-  current_queue = qp;
-  return (module) (qp->pred)->func;
-}
diff -ruN klic-3.003-2002-03-16/runtime/shm_rsv.c klic-3.003-2002-03-19/runtime/shm_rsv.c
--- klic-3.003-2002-03-16/runtime/shm_rsv.c	Wed Jan  2 14:44:16 2002
+++ klic-3.003-2002-03-19/runtime/shm_rsv.c	Thu Jan  1 09:00:00 1970
@@ -1,402 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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.)
------------------------------------------------------------ */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <klic/basic.h>
-#include <klic/struct.h>
-#include "shm.h"
-#include <signal.h>
-
-#define MAX_N_PLNE 8
-
-/*
-#define SYNC_GC    /* Synchronous GC */
-/**/
-#define PAGE   4096
-#define HPAGE  2048
-#define N_PAGE  64
-
-/* threshold value (favourable)THV1 %, (compel)THV2 % */
-#define THV1 90
-#define THV2 98
-
-/* table size for locking */
-#define LOCK_size  (6+total_node)
-
-
-/* shm.h */
-
-/* Number of plains (copying GC) */
-long N_PLNE = 3;
-
-long Disp_child = 0;
-
-int ATOM_TABLE_SIZE = 256*PAGE; /* 512KB */
-
-/* Heap size on shared memory */
-long SHM_SIZE = PAGE*N_PAGE;
-
-int* lockp[6+MAX_N_PE];
-volatile PLNE* PLNE_ptr[MAX_N_PLNE];
-char* shm_start_addr;
-struct global_variables* top_shm_glbl;
-int* pe_status;
-int* cur_status;
-struct ex_goalrec** top_shm_qp;
-struct ex_goalrec** shm_qp;
-struct ex_goalrec** top_shm_next;
-
-  /* current shared memory top address of myself */
-q* gallocp = 0;
-  /* current shared memory limit of myself */
-q* glimit = 0;
-
-
-static int MON_SIZE;
-static long SHM_SIZEq;
-static long TOTAL_SIZE;
-
-  /* Management variables on shared memory */
-static struct global_variables* shm_glblp = &globals;
-static int* top_shm_pid;
-
-  /* for Profile */
-static long My_measure;
-static long* volatile Prof_measure = &My_measure;
-
-static long* get_page(int size);
-static int* init_lock(int* addr);
-extern void abend(char* mess);
-
-/* adjusts the memory boundary */
-#define adjust(x) ((long*)((((long)(x)+sizeof(long)-1)/sizeof(long))*sizeof(long)))
-
-/* Initialize shared memory.
-  allocaltes shared memory and intializes shared variables.
-*/
-extern struct global_variables*
-shm_init(glbl)
-  struct global_variables* glbl;
-{
-  long NUM_PE = total_node;
-  long MY_PENO;
-  int fds,i,j;
-  long* addr;
-  char bf[32];
-  long GLOBALS, EXT_INFO, LOCK_AREA, PLANE_INF, PROFILE_B;
-  long BBUF[PAGE/sizeof(long)];
-
-  if ( NUM_PE < 1 || MAX_N_PE <= NUM_PE )  abend(" Number of processes ???");
-  if ( N_PLNE < 2 || MAX_N_PLNE <= N_PLNE )  abend(" Number of spacees ???");
-
-  /* Management size on shared memory */
-  GLOBALS = reckon(sizeof(struct global_variables))*NUM_PE;
-  EXT_INFO = reckon(sizeof(long)*NUM_PE +
-                    sizeof(long)*NUM_PE +
-                    sizeof(struct goalrec*)*NUM_PE +
-                    sizeof(q*)*NUM_PE);
-  LOCK_AREA = reckon(sizeof(int)*LOCK_size);
-  PLANE_INF = reckon(sizeof(PLNE))*N_PLNE;
-  PROFILE_B = sizeof(long)*2;
-
-  MON_SIZE = ATOM_TABLE_SIZE +
-             GLOBALS +
-             EXT_INFO +
-             LOCK_AREA +
-             PLANE_INF +
-             PROFILE_B;
-
-  /* Shared Heap size */
-  SHM_SIZE *= sizeof(q);  /* byte count */
-  SHM_SIZE = ((SHM_SIZE+PAGE-1)/PAGE)*PAGE;
-  SHM_SIZEq = SHM_SIZE/sizeof(q);
-  SHP_SIZE = SHM_SIZE * N_PLNE;
-
-  if ( NUM_PE == 1 ) SHP_SIZE = 0;  /* only 1 process */
-
-  TOTAL_SIZE = MON_SIZE + SHP_SIZE;
-
-  /* management table */
-  sprintf(bf,"/tmp/SHM%d",getpid());
-  fds = open(bf,(O_RDWR|O_CREAT),0644);
-  for(j=0;j<(PAGE/sizeof(long));j++) BBUF[j] = -1;
-  lseek(fds,TOTAL_SIZE,SEEK_SET);
-  write(fds,BBUF,PAGE);
-  /* for(j=0;j<((TOTAL_SIZE+PAGE-1)/PAGE);j++) write(fds,BBUF,PAGE); */
-
-  shm_start_addr =
-    (char*) mmap(0, TOTAL_SIZE, (PROT_READ|PROT_WRITE), MAP_SHARED, fds, 0);
-  if( (long) shm_start_addr == -1 ) {
-    perror(0);
-    exit(1);
-  }
-  close(fds);
-  unlink(bf);
-
-  SHM_HEAP_TOP = MON_SIZE + (long) shm_start_addr;
-  SHP_SIZE += 0xff;  /* allowance */
-  addr = adjust(shm_start_addr+ATOM_TABLE_SIZE);
-  top_shm_glbl = (struct global_variables*) addr;
-  for( i=0; i<NUM_PE; i++ ){
-    *((struct global_variables*) addr)++ = *glbl;
-    addr = adjust(addr);
-  }
-  pe_status = (int*) addr;
-  addr += NUM_PE;
-  top_shm_pid = (int*) addr;
-  addr += NUM_PE;
-  top_shm_qp = (struct ex_goalrec**) addr;
-  addr += NUM_PE;
-  top_shm_next = (struct ex_goalrec**) addr;
-  addr += NUM_PE;
-  addr = adjust(addr);
-
-  for( i=0; i<NUM_PE; i++ ){
-    pe_status[i] = 0;
-    top_shm_qp[i] = (struct ex_goalrec*) (top_shm_next+i);
-    top_shm_next[i] = 0;
-  }
-
-  addr = adjust(init_lock(addr));
-
-  /* local address table initialize */
-  d_shm_init();  /* inits external ADDRTBL */
-
-  for( i=0; i<N_PLNE; i++ ){
-    PLNE_ptr[i] = ((PLNE*) addr)++;
-    addr = adjust(addr);
-  }
-
-  MY_PENO = 0;  /* I am MASTER */
-  if ( NUM_PE == 1 ){  /* only one process */
-    glbl = shm_glblp = top_shm_glbl;
-    my_node = MY_PENO;
-    total_node = NUM_PE;
-    cur_status = pe_status + MY_PENO;
-    shm_qp = top_shm_qp + MY_PENO;
-    shm_glblp->par.aux.shm.ex_qp0 = (struct ex_goalrec*) top_shm_next + MY_PENO;
-    PLNE_ptr[0]->caddr = 0;
-    PLNE_ptr[1]->limit3 = (long*) MAXKLICINT;
-
-    /* This fix is temporary. (from Chik) */
-    init_shm_atom();  /* manages shared atom-id & funct-id */
-    /* end fix */
-
-    return glbl;
-  }
-
-  /* Each Heap plains */
-  SHM_HEAP_TOP = (long) addr;
-  for( i=0; i<N_PLNE; i++ ){
-
-    PLNE_ptr[i]->top_addr = addr;
-
-    PLNE_ptr[i]->caddr = addr;
-    PLNE_ptr[i]->direct = -1;
-    PLNE_ptr[i]->demand = 0;
-    for( j=0; j<=MAX_N_PE; j++ ) PLNE_ptr[i]->proc[j] = 0;
-    PLNE_ptr[i]->limit1 = addr+(SHM_SIZEq*THV1/100);
-    PLNE_ptr[i]->limit2 = addr+(SHM_SIZEq*THV2/100);
-    addr += SHM_SIZEq;
-    PLNE_ptr[i]->limit3 = addr;
-  }
-
-  /* for Profile */
-  Prof_measure = addr;
-  *Prof_measure = 0;
-
-  init_shm_atom();     /* manages shared atom-id & funct-id */
-
-  currid = oldid = 0;
-
-  /* invoke parallel process */
-  {
-    int child;
-    *(top_shm_pid) = getpid();
-    for( i=1; i<NUM_PE; i++ ){
-      pe_status[i] = 1;
-      child = fork();
-      if( child != 0 ){
-	top_shm_pid[i] = child;
-	if( Disp_child )
-	  printf("The %dth-%d Child process start !\n", i, child);
-      }else{
-	MY_PENO = i;
-	break;
-      }
-    }
-  }
-  glbl = shm_glblp = get_otherPE_glbl(MY_PENO);
-  my_node = MY_PENO;
-  total_node = NUM_PE;
-  cur_status = pe_status + MY_PENO;
-  shm_qp = top_shm_qp + MY_PENO;
-  shm_glblp->par.aux.shm.ex_qp0 = (struct ex_goalrec*)(top_shm_next + MY_PENO);
-
-  /* at first 0 plain */
-  /*
-  gallocp = glimit = 0;
-  PLNE_ptr[currid]->proc[MY_PENO] = 1;
-  */
-  /* this allocation will be disappeared */
-  galloc(0);
-
-  return( glbl );
-}
-
-/* galloc
-  allocates shared memory specifyed size
-  if no current space, get from shared memory pool
-*/
-extern q*
-shm_galloc(siz)
-  int siz;
-{
-  declare_globals;
-  q* temp = gallocp;
- GET_L:
-  gallocp += siz;
-  if( gallocp <= glimit )  return temp;
-  if( glimit == 0 ){  /* this means initial state */
-    currid = 0;
-    PLNE_ptr[currid]->proc[my_node] = 1;
-  }
-  if( siz > HPAGE ){
-    int npsize = (1+(siz/HPAGE)) * HPAGE;
-    temp = gallocp = (q*) get_page(npsize);
-    glimit = gallocp + npsize;
-  }else{
-    temp = gallocp = (q*) get_page(HPAGE);
-    glimit = gallocp + HPAGE;
-  }
-  goto GET_L;
-}
-
-/* get_page(siz)
-  get shared memory from shared memory pool
-*/
-static long*
-get_page(siz)
-  int siz;
-{
-  declare_globals;
-  long *temp, *pos;
-  int key = g_key();
-
- ReTry:
-  s_lock(key);
-  pos = PLNE_ptr[currid]->caddr;
-  temp = pos + siz;
-  if( PLNE_ptr[currid]->limit1 >= temp ){
-    PLNE_ptr[currid]->caddr = temp;
-    s_unlock(key);
-    return pos;
-  }
-
-#ifdef SYNC_GC
-  heaplimit = 0;
-#else
-  if( currid != oldid ){
-    if( *cur_status == 4 ){  /* inside GC */
-      abend(" shared memory overflow !!!");
-    }
-    heaplimit = 0;
-  }
-#endif
-
-  if( PLNE_ptr[currid]->limit3 >= temp ){
-    PLNE_ptr[currid]->caddr = temp;
-    s_unlock(key);
-    return pos;
-  }
-  s_unlock(key);
-
-#ifdef SYNC_GC
-  abend(" Shared memory overflow !!!");
-#else
-  /* secondary try */
-  {
-    int i, j;
-    if( PLNE_ptr[currid]->direct == -1 ){
-      int key = m_key();
-      s_lock(key);
-      if( PLNE_ptr[currid]->direct == -1 ){
-	j = (currid + 1) % N_PLNE;
-	for( i=0; i<total_node; i++  ){
-	  if( PLNE_ptr[j]->proc[i] ){
-	    struct global_variables* tglbl = get_otherPE_glbl(i);
-	    tglbl->interrupt_off0 = 0;
-	    klic_barrier();
-	    tglbl->heaplimit0 = 0;
-	    sleep(1);
-	    if( PLNE_ptr[j]->proc[i] ){
-	      abend(" Shared memory overflow !!!");
-	    }
-	  }
-	}
-	/* initialize table */
-	PLNE_ptr[j]->caddr = PLNE_ptr[j]->top_addr;
-	PLNE_ptr[j]->demand = 0;
-	PLNE_ptr[j]->direct = -1;
-	PLNE_ptr[j]->proc[my_node] = 1;
-	PLNE_ptr[currid]->direct = j;
-	currid = j;
-	s_unlock(key);
-	goto ReTry;
-      }
-      s_unlock(key);
-    }
-    currid = PLNE_ptr[currid]->direct;
-    PLNE_ptr[currid]->proc[my_node] = 1;
-    goto ReTry;
-  }
-#endif  /* not SYNC_GC */
-}
-
-/* new_galloc --- change to the new plain from the old plain
-*/
-extern void
-new_galloc(cid)
-  int cid;
-{
-  declare_globals;
-  currid = cid;
-  PLNE_ptr[currid]->proc[my_node] = 1;
-  gallocp = glimit = (q*) 1;
-}
-
-/* initialize a lock table
-*/
-static int*
-init_lock(addr)
-  int* addr;
-{
-  declare_globals;
-  int i, j;
-  for( i=0; i<LOCK_size; i++ ){
-    *addr = 0;
-    lockp[i] = (addr)++;
-  }
-  return (int*) addr;
-}
-
-
-/* abend with a message
-  make sence at debug time
-*/
-extern void
-abend(mess)
-  char* mess;
-{
-  declare_globals;
-  fprintf(stderr, "The %dth process - %s\n", my_node, mess);
-  kill(0, SIGTERM);
-}
diff -ruN klic-3.003-2002-03-16/runtime/shm_throw.c klic-3.003-2002-03-19/runtime/shm_throw.c
--- klic-3.003-2002-03-16/runtime/shm_throw.c	Mon Mar  4 10:44:13 2002
+++ klic-3.003-2002-03-19/runtime/shm_throw.c	Thu Jan  1 09:00:00 1970
@@ -1,510 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,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.)
------------------------------------------------------------ */
-
-#include <klic/basic.h>
-#include <klic/struct.h>
-#include <klic/primitives.h>
-#include <klic/unify.h>
-#include <klic/functorstuffs.h>  /* arityof */
-#include <klic/susp.h>
-#include "gobj.h"
-#include "shm.h"  /* last_shm_var */
-#include <signal.h>
-#include "trace.h"  /* trace_flag, trace_goal */
-
-#define is_locala(X) \
-  ((unsigned long) ((long) (X) - (long) heaptop()) < real_heapbytesize())
-
-#define makeshvar(svar) \
-do{ \
-  struct generator_susp* vcell; \
-  (svar) = (q) galloc((sizeof(struct generator_susp) / sizeof(q)) + 1); \
-  vcell = (struct generator_susp*) (((q*) svar) + 1); \
-  vcell->backpt = (q) (svar); \
-  vcell->u.o = tag_generator_susp(pSHM_VAR); \
-  *((q*) svar) = (q) vcell; \
-}while(0)
-
-#define ck_throw_new_galloc(num) \
-do{ \
-    int cid = currid;\
-    while( (cid=PLNE_ptr[cid]->direct) != -1 ) { \
-       if ( PLNE_ptr[cid]->proc[num] ) {new_galloc(cid);} \
-    }\
-}while(0)
-
-q last_shm_var;
-
-/* phisc_pe(Logical_process_number)
-  convert a logical process number to a phisical shared process number
-*/
-static int
-phisc_pe(NO)
-  int NO;
-{
-    declare_globals;
-    if( 0 <= NO && NO < total_node )
-       return(NO);
-    else
-       abend("Invalid PE number !!!");
-}
-
-/* shm_goal_copy(Local_goal_pointer,priority)
-  copy a goal into shared memory
-*/
-static struct ex_goalrec*
-shm_goal_copy(qp, prio)
-  struct goalrec* qp;
-  long prio;
-{
-  int i, j;
-  int arity = qp->pred->arity;
-  struct ex_goalrec* sgoal;
-  struct goalrec* goal;
-  sgoal = (struct ex_goalrec*) galloc(arity + 4);
-  sgoal->prio = prio;
-  goal = &sgoal->goal;
-  goal->next = 0;
-  goal->pred = qp->pred;
-  for( i=0; i<arity; i++ ){
-    shm_arg_copy(&qp->args[i], &goal->args[i]);
-  }
-  return sgoal;
-}
-
-extern struct goalrec*
-throw_goal_routine(N, qp, gp)
-  int N;  /* logical process number */
-  struct goalrec *qp, *gp;
-{
-  declare_globals;
-  struct goalrec *ng;
-  int k;
-  int num = phisc_pe(N);
-  struct ex_goalrec* sh_goal;
-  *cur_status = 2;
-
-  ck_throw_new_galloc(num);
-
-  if( trace_flag ){
-    static long throw_trace_count = 0;
-    gp = trace_goal(gp, (num+1)*100000+throw_trace_count, NULL);
-    throw_trace_count++;
-  }
-
-  sh_goal = shm_goal_copy(gp, current_prio());
-  shm_goal_stack(sh_goal, num);
-  *cur_status = 1;
-  return qp;
-}
-
-
-/* shm_goal_stack(Shared_goal_pointer,stack_position)
-  stack a goal to shared other process's stack
-*/
-extern int
-shm_goal_stack(goal,num)
-  struct ex_goalrec* goal;
-  int num;
-{
-    struct ex_goalrec* tqp;
-    int key = p_key(num);
-
-    goal->next = 0;
-    klic_barrier();
-    s_lock(key);
-
-    tqp = *(top_shm_qp+num);
-    tqp->next = goal;
-    *(top_shm_qp+num) = goal;
-
-    s_unlock(key);
-
-    {
-      struct global_variables* tglbl = get_otherPE_glbl(num);
-      if (tglbl->current_prio0 < goal->prio ) {
-         tglbl->par.aux.shm.queued0 = 1;
-         tglbl->interrupt_off0 = 0;
-         klic_barrier();
-         tglbl->heaplimit0 = 0;
-      } else {
-         tglbl->par.aux.shm.queued0 = 1;
-         if (tglbl->current_prio0 < goal->prio ) {
-                 tglbl->interrupt_off0 = 0;
-                 klic_barrier();
-                 tglbl->heaplimit0 = 0;
-         }
-      }
-      klic_barrier();
-      tglbl->par.aux.shm.queued0 = 1;
-    }
-}
-
-/* ***************  Copy Routines  ****************************** */
-
-#define ck_arg_copy(x,y) {\
-   if ( isatomic(x) ) y = x;\
-   else if ( isref(x) && x == (q)&(x) ) {\
-     q sv;\
-     makeshvar(sv);\
-     y = x = last_shm_var = sv;\
-   } else {\
-     shm_arg_copy(&x,&y);\
-   }\
-}
-
-#define ck_shm_arg_copy(x,y) {\
-   if ( isatomic(x) ) y = x;\
-   else {\
-     shm_arg_copy(&x,&y);\
-   }\
-}
-
-
-extern q shm_copy(src)
-  q src;  /* SrcAddr */
-{
-  declare_globals;
-   q cnp;
-   q retval;
- ENTRY:
-   switch(ptagof(src)) {
-    case CONS:
-     if ( is_locala(src) ) {
-       cnp = (q)galloc(2);
-       retval = makecons(cnp);
-       ck_arg_copy(car_of(src),car_of(retval));
-       ck_arg_copy(cdr_of(src),cdr_of(retval));
-       return( retval );
-     } else if ( is_shma(src) ) {
-       if ( is_cur_or_forward_ptr(src) )  return(src);
-       /* shared-memory to shared-memory copy */
-       cnp = (q)galloc(2);
-       retval = makecons(cnp);
-       ck_shm_arg_copy(car_of(src),car_of(retval));
-       ck_shm_arg_copy(cdr_of(src),cdr_of(retval));
-       return( retval );
-     } else { /* assume text-area */
-       return(src);
-     }
-    case ATOMIC:
-      return(src);
-    case VARREF: {
-        q temp = derefone(src);
-        if ( !isref(temp) ) { src = temp; goto ENTRY; }
-        if ( src == temp ) {
-           makeshvar(temp);
-           return( derefone(src) = temp );
-        } else {
-           q temp1 = derefone(temp);
-           if ( !isref(temp1) ) { src = temp; goto ENTRY; }
-           if ( src == temp1 ) {
-               declare_globals;
-               if ( is_shma(src) ) { /* shared memory */
-                 if ( is_cur_or_forward_ptr(src) ) {
-                   return( src );
-                 } else { /* Shared-memory to shared-memory movement */
-                   q svar;
-                   struct generator_susp* vcell;
-                   struct generator_object* addi;
-                   Shvar* gvar;
-                   addi = n_lock(src,temp);
-                   if ( derefone(src) != temp ) goto ENTRY;
-                   svar = (q)galloc((sizeof(struct generator_susp)/sizeof(q))+1);
-                   vcell = (struct generator_susp*)(((q*)svar)+1);
-                   vcell->backpt = (q)svar;
-                   derefone(svar) = (q)vcell;
-                   gvar = (Shvar*)untag_generator_susp(addi);
-                   if ( !gvar->chain ) {
-                     vcell->u.o = tag_generator_susp(pSHM_VAR);
-                     klic_barrier();
-                     derefone(src) = svar;
-                     return(svar);
-                   }
-                   if ( is_cur_or_forward_ptr(gvar) ) {
-                     vcell->u.o = tag_generator_susp(gvar);
-                     klic_barrier();
-                     derefone(src) = svar;
-                     return(svar);
-                   } else {
-                     Sinfo* dptr;
-                     Sinfo* sptr;
-                     Shvar* svar = (Shvar*)galloc((sizeof(Shvar)/sizeof(q)));
-                     vcell->u.o = tag_generator_susp(svar);
-                     svar->method = SHM_VAR;
-                     dptr = (Sinfo*)&(svar->chain);
-                     sptr = gvar->chain;
-                     if ( !is_genhook(sptr) ) {
-                       while(sptr && !is_cur_or_forward_ptr(sptr)) {
-                         dptr->next = (Sinfo*)galloc((sizeof(Sinfo)/sizeof(q)));
-                         dptr = dptr->next;
-                         dptr->PE_num = sptr->PE_num;
-                         dptr->prio = sptr->prio;
-                         dptr->indp = sptr->indp;
-                         sptr = sptr->next;
-                       }
-                       dptr->next = sptr;
-                     } else {
-                       if ( !is_cur_or_forward_ptr(sptr) ) {
-                         Sinfo* addr = (Sinfo*)galloc((sizeof(Sinfo)/sizeof(q)));
-                         sptr = untag_genhook(sptr);
-                         dptr->next = tag_genhook(addr);
-                         dptr = addr;
-                         dptr->next = 0;
-                         dptr->PE_num = sptr->PE_num;
-                         dptr->prio = sptr->prio;
-                         dptr->indp = sptr->indp;
-                       } else {
-                         dptr->next = sptr;
-                       }
-                     }
-                   }
-                   klic_barrier();
-                   derefone(src) = svar;
-                   return( svar );
-                 }
-               } else {              /* local memory */
-                 Shvar* hobj;
-                 struct susprec *sp = (struct susprec *)temp;
-                 makeshvar(retval);
-                 if ( is_generator_susp(sp->u) ) {
-                   hobj = create_genhook(tag_local(src),retval);
-                 } else {
-                   hobj = shm_add_consumer(retval,0,src,glbl);
-                 }
-                 *(((struct generator_object**)retval+2)) = tag_generator_susp(hobj);
-                 return( retval );
-               }
-           }
-           src = temp;
-           goto ENTRY;
-        }
-      }
-    default:
-      {  q f = functor_of(src);
-         int i,arity;
-
-	 if ( is_locala(src) ) {
-	   if ( isref(f) ) {
-	     struct data_object *obj
-	       = (struct data_object *)functorp(src);
-	     /* abend("Copied data object into shared memory!!!"); */
-	     return( generic_shmcopy(obj) );
-	   }
-	   arity = arityof(f);
-	   cnp = (q)galloc(arity+1);
-	   retval = makefunctor(cnp);
-	   ((struct functor*)cnp)->functor = functorp(src)->functor;
-	   for(i=0;i<arity;i++) {
-	     ck_arg_copy(functorp(src)->args[i],((struct functor*)cnp)->args[i]);
-	   }
-	   return( retval );
-	 } else if ( is_shma(src) ) {
-           if ( is_cur_or_forward_ptr(src) )  return( src );
-           /* Shared-memory to shared-memory movement */
-           if ( isref(f) ) {
-             struct data_object *obj
-                = (struct data_object *)functorp(src);
-              /* abend("Copied data object into shared memory!!!"); */
-             return( generic_shmcopy(obj) );
-           }
-           arity = arityof(f);
-           cnp = (q)galloc(arity+1);
-           retval = makefunctor(cnp);
-           ((struct functor*)cnp)->functor = functorp(src)->functor;
-           for(i=0;i<arity;i++) {
-             ck_shm_arg_copy(functorp(src)->args[i],((struct functor*)cnp)->args[i]);
-           }
-           return( retval );
-         } else { /* assume text-area */
-	   return( src );
-	 }
-       }
-   }
-}
-
-/* shm_arg_copy(SrcAddr,DistAddr)
-  copy data into shared memory recursively
-*/
-extern void
-shm_arg_copy(srcp, distp)
-  q* srcp;
-  q* distp;
-{
-  declare_globals;
-  q src,cnp;
-  int i;
-
-  ENTRY:
-    src = *srcp;
-    switch(ptagof(src)) {
-    case CONS:
-      if ( is_locala(src) ) {
-	cnp = (q)galloc(2);
-	*distp = makecons(cnp);
-	shm_arg_copy(&car_of(src),&(((struct cons*)cnp)->car));
-	distp = &(((struct cons*)cnp)->cdr);
-	srcp = &cdr_of(src);
-	goto ENTRY;
-      } else if ( is_shma(src) ) {
-        if ( is_cur_or_forward_ptr(src) ) { *distp = src; return; }
-        cnp = (q)galloc(2);
-        shm_arg_copy(&car_of(src),&(((struct cons*)cnp)->car));
-        shm_arg_copy(&cdr_of(src),&(((struct cons*)cnp)->cdr));
-        klic_barrier();
-        *distp = *srcp = makecons(cnp); /* patch */ return;
-      } else { /* assume text-area */
-	*distp = src; return;
-      }
-    case ATOMIC:
-      *distp = src;
-      return;
-    case VARREF: {
-        q temp = derefone(src);
-        if ( !isref(temp) ) { srcp = (q*)src; goto ENTRY; }
-        if ( src == temp ) {
-           makeshvar(temp);
-           *distp = derefone(src) = temp;
-           return;
-        } else {
-           q temp1 = derefone(temp);
-           if ( !isref(temp1) ) { srcp = (q*)src; goto ENTRY; }
-           if ( src == temp1 ) {
-               declare_globals;
-               if ( is_shma(src) ) { /* a shared variable */
-                 if ( is_cur_or_forward_ptr(src) ) {
-                   *distp = src; return;
-                 } else {
-                   q svar;
-                   struct generator_susp* vcell;
-                   struct generator_object* addi;
-                   Shvar* gvar;
-                   addi = n_lock(src,temp);
-                   if ( derefone(src) != temp ) goto ENTRY;
-                   svar = (q)galloc((sizeof(struct generator_susp)/sizeof(q))+1);
-                   vcell = (struct generator_susp*)(((q*)svar)+1);
-                   vcell->backpt = (q)svar;
-                   derefone(svar) = (q)vcell;
-                   gvar = (Shvar*)untag_generator_susp(addi);
-                   if ( !gvar->chain ) {
-                     vcell->u.o = tag_generator_susp(pSHM_VAR);
-                     klic_barrier();
-                     derefone(src) = svar;
-                     *distp = svar;
-                     return;
-                   }
-                   if ( is_cur_or_forward_ptr(gvar) ) {
-                     vcell->u.o = tag_generator_susp(gvar);
-                     klic_barrier();
-                     derefone(src) = svar;
-                     *distp = svar;
-                     return;
-                   } else {
-                     Sinfo* dptr;
-                     Sinfo* sptr;
-                     Shvar* svar = (Shvar*)galloc((sizeof(Shvar)/sizeof(q)));
-                     vcell->u.o = tag_generator_susp(svar);
-                     svar->method = SHM_VAR;
-                     dptr = (Sinfo*)&(svar->chain);
-                     sptr = gvar->chain;
-                     if ( !is_genhook(sptr) ) {
-                       while(sptr && !is_cur_or_forward_ptr(sptr)) {
-                         dptr->next = (Sinfo*)galloc((sizeof(Sinfo)/sizeof(q)));
-                         dptr = dptr->next;
-                         dptr->PE_num = sptr->PE_num;
-                         dptr->prio = sptr->prio;
-                         dptr->indp = sptr->indp;
-                         sptr = sptr->next;
-                       }
-                       dptr->next = sptr;
-                     } else {
-                       if ( !is_cur_or_forward_ptr(sptr) ) {
-                         Sinfo* addr = (Sinfo*)galloc((sizeof(Sinfo)/sizeof(q)));
-                         sptr = untag_genhook(sptr);
-                         dptr->next = tag_genhook(addr);
-                         dptr = addr;
-                         dptr->next = 0;
-                         dptr->PE_num = sptr->PE_num;
-                         dptr->prio = sptr->prio;
-                         dptr->indp = sptr->indp;
-                       } else {
-                         dptr->next = sptr;
-                       }
-                     }
-                   }
-                   klic_barrier();
-                   derefone(src) = svar;
-                   *distp = svar;
-                   return;
-                 }
-               } else {  /* local memory */
-                 Shvar* hobj;
-                 struct susprec* sp = (struct susprec*)temp;
-                 makeshvar(temp1);
-                 if ( is_generator_susp(sp->u) ) {
-                   hobj = create_genhook(tag_local(src),temp1);
-                 } else {
-                   hobj = shm_add_consumer(temp1,0,src,glbl);
-                 }
-                 *(((struct generator_object**)temp1)+2) = tag_generator_susp(hobj);
-                 klic_barrier();
-                 *distp = temp1;
-                 return;
-               }
-           }
-           srcp = (q*)src;
-           goto ENTRY;
-        }
-      }
-    default:
-      {  q f = functor_of(src);
-         int arity;
-
-	 if ( is_locala(src) ) {
-	   if ( isref(f) ) {
-	     struct data_object *obj
-	       = (struct data_object *)functorp(src);
-	     /* abend("Copied data object into shared memory!!!"); */
-	     *distp = generic_shmcopy(obj);
-	     return;
-	   }
-	   arity = arityof(f);
-	   cnp = (q)galloc(arity+1);
-	   *distp = makefunctor(cnp);
-	   ((struct functor*)cnp)->functor = functorp(src)->functor;
-	   for(i=0;i<arity;i++) {
-	     shm_arg_copy(&functorp(src)->args[i],&((struct functor*)cnp)->args[i]);
-	   }
-	   return;
-	 } else if ( is_shma(src) ) { /* Shared to shrared copy */
-           if ( is_cur_or_forward_ptr(src) ) { *distp = src; return; }
-           if ( isref(f) ) {
-             struct data_object *obj
-                = (struct data_object *)functorp(src);
-             /* abend("Copied data object into shared memory!!!"); */
-             q temp = generic_shmcopy(obj);
-	     klic_barrier();
-             *distp = temp;
-             return;
-           }
-           arity = arityof(f);
-           cnp = (q)galloc(arity+1);
-           ((struct functor*)cnp)->functor = functorp(src)->functor;
-
-	   /* First arg is special for Topdown GC */
-           for(i=0;i<arity;i++) {
-             shm_arg_copy(&functorp(src)->args[i],&((struct functor*)cnp)->args[i]);
-           }
-	   klic_barrier();
-	   *distp = *srcp = makefunctor(cnp);
-           return;
-	 } else { /* assume text-area */
-	   *distp = src; return;
-	 }
-       }
-    }
-}
diff -ruN klic-3.003-2002-03-16/runtime/trace.c klic-3.003-2002-03-19/runtime/trace.c
--- klic-3.003-2002-03-16/runtime/trace.c	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19/runtime/trace.c	Tue Mar 19 14:07:13 2002
@@ -17,13 +17,10 @@
 
 #include "trace.h"  /* trace_flag, trace_enqueued_goals, subterm_sp */
 #include "traceio.h"
+
 #ifdef DIST
 #include <klic/distio.h>
 #endif
-#ifdef SHM
-#include "shm.h"
-#endif
-
 
 #define Leaping(info)		((info)->leaping)
 #define Spying(info)		((info)->spying)
diff -ruN klic-3.003-2002-03-16/runtime/traceio.h klic-3.003-2002-03-19/runtime/traceio.h
--- klic-3.003-2002-03-16/runtime/traceio.h	Fri Dec 28 13:46:47 2001
+++ klic-3.003-2002-03-19/runtime/traceio.h	Tue Mar 19 14:32:46 2002
@@ -12,15 +12,8 @@
 #define TRACE_ATTACHIO()	AttachIO()
 #define TRACE_DETACHIO()	DetachIO()
 #else
-# ifdef SHM
-#define TRACE_ATTACHIO() \
-  do{ if (!shm_trace_lock) {s_lock(tr_key()); shm_trace_lock=1;} }while(0)
-#define TRACE_DETACHIO() \
-  do{ shm_trace_lock=0; s_unlock(tr_key()); }while(0)
-# else
 #define TRACE_ATTACHIO()
 #define TRACE_DETACHIO()
-# endif
 #endif
 
 #endif /* _KLIC_TRACEIO_H_ */
diff -ruN klic-3.003-2002-03-16/sendreport.sh klic-3.003-2002-03-19/sendreport.sh
--- klic-3.003-2002-03-16/sendreport.sh	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2002-03-19/sendreport.sh	Tue Mar 19 14:33:22 2002
@@ -115,11 +115,6 @@
    cat disttests.log >>$MAILLOG
 fi
 
-if [ -f shmtests.log ]; then
-   IMP=1
-   cat shmtests.log >>$MAILLOG
-fi
-
 if [ $IMP -eq 0 ]; then
    echo "No implemetation was installed." >>$MAILLOG
 fi
diff -ruN klic-3.003-2002-03-16/shmtest/Makefile klic-3.003-2002-03-19/shmtest/Makefile
--- klic-3.003-2002-03-16/shmtest/Makefile	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/Makefile	Thu Jan  1 09:00:00 1970
@@ -1,783 +0,0 @@
-##---------------------------------------------------------- 
-##   (C)1995 Institute for New Generation Computer Technology 
-##       (Read COPYRIGHT for detailed information.) 
-##----------------------------------------------------------
-# runtime option for test programs
-
-RUNOPT=		# none for shared memory version
-
-# Top directory of KLIC
-TOP=..
-# command prefix to run
-CMD=./
-
-# Maximum Nodes
-NODES = 16
-
-PARALLEL = 10
-
-# KLIC compiler to compile test progs.
-KLIC=$(TOP)/compiler/klic -K$(TOP)/compiler/kl1cmp \
-	-D$(TOP)/compiler/klicdb -X. -I$(TOP)/include -L$(TOP)/runtime
-
-# options to compiler KLIC programs
-KLICSOPT=-v -shm -P$(PARALLEL) -g #$(KLICOPT)
-
-# system dependency
-SYSTEM=$(TOP)/runtime/libklics.a $(TOP)/compiler/kl1cmp $(TOP)/compiler/klic
-
-# Result checking command. You may want to rewrite this on some machines.
-# If you want to see progress of the executino, comment out this macro.
-T= `basename $@ .tst`
-R = | cmp - cmpdir/`basename $@ .tst`.out &&echo ''
-
-TEST = forward_goal.tst general_unify_1.tst general_unify_2.tst \
-	multiple_wait.tst t0thr1.tst t0thr2.tst t0thr3.tst unify_exrefs.tst \
-	vector_built.tst vector_built_2.tst wec_exhaust_1.tst \
-	wec_exhaust_2.tst wec_exhaust_3.tst wec_indirect.tst
-TEST_PROGS = forward_goal general_unify_1 general_unify_2 \
-	multiple_wait t0thr1 t0thr2 t0thr3  unify_exrefs vector_built \
-	vector_built_2 wec_exhaust_1 wec_exhaust_2 wec_exhaust_3 \
-	wec_indirect
-TEST_SRCS = forward_goal.kl1 general_unify_1.kl1 general_unify_2.kl1 \
-	multiple_wait.kl1 t0thr1.kl1 t0thr2.kl1 t0thr3.kl1 unify_exrefs.kl1 \
-	vector_built.kl1 vector_built_2.kl1 wec_exhaust_1.kl1 \
-	wec_exhaust_2.kl1 wec_exhaust_3.kl1 wec_indirect.kl1
-TEST_CSRCS = forward_goal.c general_unify_1.c general_unify_2.c \
-	multiple_wait.c t0thr1.c t0thr2.c t0thr3.c unify_exrefs.c \
-	vector_built.c vector_built_2.c wec_exhaust_1.c \
-	wec_exhaust_2.c wec_exhaust_3.c wec_indirect.c
-TEST_OBJS = forward_goal.o general_unify_1.o general_unify_2.o \
-	multiple_wait.o t0thr1.o t0thr2.o t0thr3.o unify_exrefs.o \
-	vector_built.o vector_built_2.o wec_exhaust_1.o \
-	wec_exhaust_2.o wec_exhaust_3.o wec_indirect.o
-
-MEASURE= nqueen12.tst nqueen13.tst read.tst throw.tst unify.tst slife.tst
-MEASURE_PROGS= nqueen nqueen12 nqueen13 nqueen14  read throw unify slife
-MEASURE_SRCS= nqueen.kl1 read.kl1 throw.kl1 unify.kl1 slife.kl1
-MEASURE_CSRCS= nqueen.c read.c throw.c unify.c slife.c
-MEASURE_OBJS= nqueen.o read.o throw.o unify.o slife.o
-
-SHELL=/bin/sh
-
-dummy:
-	@echo "If you want to measure the performance, run 'make all-measure'";
-	make all-test
-all: all-test all-measure
-forward_goal.tst: forward_goal
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 68 +-7 msec; \
-		echo "$(CMD)forward_goal -p1 $(RUNOPT) $R"; \
-		$(CMD)forward_goal -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 6035 +-165 msec; \
-		echo "$(CMD)forward_goal -p2 $(RUNOPT) $R"; \
-		$(CMD)forward_goal -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 5463 +-320 msec; \
-		echo "$(CMD)forward_goal -p5 $(RUNOPT) $R"; \
-		$(CMD)forward_goal -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 5473 +-249 msec; \
-		echo "$(CMD)forward_goal -p8 $(RUNOPT) $R"; \
-		$(CMD)forward_goal -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 5619 +-233 msec; \
-		echo "$(CMD)forward_goal -p9 $(RUNOPT) $R"; \
-		$(CMD)forward_goal -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-general_unify_1.tst: general_unify_1
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 47 +-10 msec; \
-		echo "$(CMD)general_unify_1 -p1 $(RUNOPT) $R"; \
-		$(CMD)general_unify_1 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 122 +-11 msec; \
-		echo "$(CMD)general_unify_1 -p2 $(RUNOPT) $R"; \
-		$(CMD)general_unify_1 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 150 +-16 msec; \
-		echo "$(CMD)general_unify_1 -p5 $(RUNOPT) $R"; \
-		$(CMD)general_unify_1 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 173 +-17 msec; \
-		echo "$(CMD)general_unify_1 -p8 $(RUNOPT) $R"; \
-		$(CMD)general_unify_1 -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 155 +-11 msec; \
-		echo "$(CMD)general_unify_1 -p9 $(RUNOPT) $R"; \
-		$(CMD)general_unify_1 -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-general_unify_2.tst: general_unify_2
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 38 +-7 msec; \
-		echo "$(CMD)general_unify_2 -p1 $(RUNOPT) $R"; \
-		$(CMD)general_unify_2 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 90 +-11 msec; \
-		echo "$(CMD)general_unify_2 -p2 $(RUNOPT) $R"; \
-		$(CMD)general_unify_2 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 92 +-8 msec; \
-		echo "$(CMD)general_unify_2 -p5 $(RUNOPT) $R"; \
-		$(CMD)general_unify_2 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 114 +-31 msec; \
-		echo "$(CMD)general_unify_2 -p8 $(RUNOPT) $R"; \
-		$(CMD)general_unify_2 -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 111 +-10 msec; \
-		echo "$(CMD)general_unify_2 -p9 $(RUNOPT) $R"; \
-		$(CMD)general_unify_2 -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-multiple_wait.tst: multiple_wait
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 57 +-5 msec; \
-		echo "$(CMD)multiple_wait -p1 $(RUNOPT) $R"; \
-		$(CMD)multiple_wait -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 4593 +-54 msec; \
-		echo "$(CMD)multiple_wait -p2 $(RUNOPT) $R"; \
-		$(CMD)multiple_wait -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 5175 +-176 msec; \
-		echo "$(CMD)multiple_wait -p5 $(RUNOPT) $R"; \
-		$(CMD)multiple_wait -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 5584 +-195 msec; \
-		echo "$(CMD)multiple_wait -p8 $(RUNOPT) $R"; \
-		$(CMD)multiple_wait -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 5738 +-163 msec; \
-		echo "$(CMD)multiple_wait -p9 $(RUNOPT) $R"; \
-		$(CMD)multiple_wait -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-t0thr1.tst: t0thr1
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 45+-4 msec; \
-		echo "$(CMD)t0thr1 -p1 $(RUNOPT) $R"; \
-		$(CMD)t0thr1 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 319 +-15 msec; \
-		echo "$(CMD)t0thr1 -p2 $(RUNOPT) $R"; \
-		$(CMD)t0thr1 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 490 +-14 msec; \
-		echo "$(CMD)t0thr1 -p5 $(RUNOPT) $R"; \
-		$(CMD)t0thr1 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 531 +-12 msec; \
-		echo "$(CMD)t0thr1 -p8 $(RUNOPT) $R"; \
-		$(CMD)t0thr1 -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 561 +-34 msec; \
-		echo "$(CMD)t0thr1 -p9 $(RUNOPT) $R"; \
-		$(CMD)t0thr1 -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-t0thr2.tst: t0thr2
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 37 +-6 msec; \
-		echo "$(CMD)t0thr2 -p1 $(RUNOPT) $R"; \
-		$(CMD)t0thr2 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 289 +-7 msec; \
-		echo "$(CMD)t0thr2 -p2 $(RUNOPT) $R"; \
-		$(CMD)t0thr2 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 345 +-26 msec; \
-		echo "$(CMD)t0thr2 -p5 $(RUNOPT) $R"; \
-		$(CMD)t0thr2 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 342 +-23 msec; \
-		echo "$(CMD)t0thr2 -p8 $(RUNOPT) $R"; \
-		$(CMD)t0thr2 -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 342 +-15 msec; \
-		echo "$(CMD)t0thr2 -p9 $(RUNOPT) $R"; \
-		$(CMD)t0thr2 -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-t0thr3.tst: t0thr3
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 35 +-3 msec; \
-		echo "$(CMD)t0thr3 -p1 $(RUNOPT) $R"; \
-		$(CMD)t0thr3 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 347 +-5 msec; \
-		echo "$(CMD)t0thr3 -p2 $(RUNOPT) $R"; \
-		$(CMD)t0thr3 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 405 +-12 msec; \
-		echo "$(CMD)t0thr3 -p5 $(RUNOPT) $R"; \
-		$(CMD)t0thr3 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 457 +-151 msec; \
-		echo "$(CMD)t0thr3 -p8 $(RUNOPT) $R"; \
-		$(CMD)t0thr3 -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 419 +-12 msec; \
-		echo "$(CMD)t0thr3 -p9 $(RUNOPT) $R"; \
-		$(CMD)t0thr3 -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-unify_exrefs.tst: unify_exrefs
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 55 +-9 msec; \
-		echo "$(CMD)unify_exrefs -p1 $(RUNOPT) $R"; \
-		$(CMD)unify_exrefs -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 588 +-61 msec; \
-		echo "$(CMD)unify_exrefs -p2 $(RUNOPT) $R"; \
-		$(CMD)unify_exrefs -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 993 +-49 msec; \
-		echo "$(CMD)unify_exrefs -p5 $(RUNOPT) $R"; \
-		$(CMD)unify_exrefs -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 1106 +-97 msec; \
-		echo "$(CMD)unify_exrefs -p8 $(RUNOPT) $R"; \
-		$(CMD)unify_exrefs -p8 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 9 ] ; then \
-		echo Reference time is 1066 +-68 msec; \
-		echo "$(CMD)unify_exrefs -p9 $(RUNOPT) $R"; \
-		$(CMD)unify_exrefs -p9 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-vector_built.tst: vector_built
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 130 +-10 msec; \
-		echo "$(CMD)vector_built -p1 $(RUNOPT) $R"; \
-		$(CMD)vector_built -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 1644 +-81 msec; \
-		echo "$(CMD)vector_built -p2 $(RUNOPT) $R"; \
-		$(CMD)vector_built -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 3 ] ; then \
-		echo Reference time is 1451 +-103 msec; \
-		echo "$(CMD)vector_built -p3 $(RUNOPT) $R"; \
-		$(CMD)vector_built -p3 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 1413 +-78 msec; \
-		echo "$(CMD)vector_built -p5 $(RUNOPT) $R"; \
-		$(CMD)vector_built -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 7 ] ; then \
-		echo Reference time is 1533 +-97 msec; \
-		echo "$(CMD)vector_built -p7 $(RUNOPT) $R"; \
-		$(CMD)vector_built -p7 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 10 ] ; then \
-		echo Reference time is 1635 +-76 msec; \
-		echo "$(CMD)vector_built -p10 $(RUNOPT) $R"; \
-		$(CMD)vector_built -p10 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-vector_built_2.tst: vector_built_2
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 100 +-7 msec; \
-		echo "$(CMD)vector_built_2 -p1 $(RUNOPT) $R"; \
-		$(CMD)vector_built_2 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 649 +-66 msec; \
-		echo "$(CMD)vector_built_2 -p2 $(RUNOPT) $R"; \
-		$(CMD)vector_built_2 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 3 ] ; then \
-		echo Reference time is 1570 +-129 msec; \
-		echo "$(CMD)vector_built_2 -p3 $(RUNOPT) $R"; \
-		$(CMD)vector_built_2 -p3 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 1165 +-81 msec; \
-		echo "$(CMD)vector_built_2 -p5 $(RUNOPT) $R"; \
-		$(CMD)vector_built_2 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 7 ] ; then \
-		echo Reference time is 1159 +-59 msec; \
-		echo "$(CMD)vector_built_2 -p7 $(RUNOPT) $R"; \
-		$(CMD)vector_built_2 -p7 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 10 ] ; then \
-		echo Reference time is 1205 +-66 msec; \
-		echo "$(CMD)vector_built_2 -p10 $(RUNOPT) $R"; \
-		$(CMD)vector_built_2 -p10 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-wec_exhaust_1.tst: wec_exhaust_1
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 44 +-6 msec; \
-		echo "$(CMD)wec_exhaust_1 -p1 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_1 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 899 +-97 msec; \
-		echo "$(CMD)wec_exhaust_1 -p2 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_1 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 3 ] ; then \
-		echo Reference time is 1152 +-67 msec; \
-		echo "$(CMD)wec_exhaust_1 -p3 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_1 -p3 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 1104 +-92 msec; \
-		echo "$(CMD)wec_exhaust_1 -p5 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_1 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 7 ] ; then \
-		echo Reference time is 1077 +-73 msec; \
-		echo "$(CMD)wec_exhaust_1 -p7 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_1 -p7 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 10 ] ; then \
-		echo Reference time is 1274 +-71 msec; \
-		echo "$(CMD)wec_exhaust_1 -p10 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_1 -p10 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-
-wec_exhaust_2.tst: wec_exhaust_2
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 77 +-3 msec; \
-		echo "$(CMD)wec_exhaust_2 -p1 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_2 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 10382 +-515 msec; \
-		echo "$(CMD)wec_exhaust_2 -p2 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_2 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 3 ] ; then \
-		echo Reference time is 9816 +-461 msec; \
-		echo "$(CMD)wec_exhaust_2 -p3 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_2 -p3 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 8241 +-688 msec; \
-		echo "$(CMD)wec_exhaust_2 -p5 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_2 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 7 ] ; then \
-		echo Reference time is 7460 +-325 msec; \
-		echo "$(CMD)wec_exhaust_2 -p7 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_2 -p7 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 10 ] ; then \
-		echo Reference time is 7506 +-420 msec; \
-		echo "$(CMD)wec_exhaust_2 -p10 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_2 -p10 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-wec_exhaust_3.tst: wec_exhaust_3
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 89 +-46 msec; \
-		echo "$(CMD)wec_exhaust_3 -p1 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_3 -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 12242 +-340 msec; \
-		echo "$(CMD)wec_exhaust_3 -p2 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_3 -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 3 ] ; then \
-		echo Reference time is 10941 +-260 msec; \
-		echo "$(CMD)wec_exhaust_3 -p3 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_3 -p3 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 8824 +-321 msec; \
-		echo "$(CMD)wec_exhaust_3 -p5 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_3 -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 7 ] ; then \
-		echo Reference time is 8672 +-235 msec; \
-		echo "$(CMD)wec_exhaust_3 -p7 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_3 -p7 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 10 ] ; then \
-		echo Reference time is 9042 +-240 msec; \
-		echo "$(CMD)wec_exhaust_3 -p10 $(RUNOPT) $R"; \
-		$(CMD)wec_exhaust_3 -p10 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-wec_indirect.tst: wec_indirect
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 38 +-9 msec; \
-		echo "$(CMD)wec_indirect -p1 $(RUNOPT) $R"; \
-		$(CMD)wec_indirect -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 4108 +-38 msec; \
-		echo "$(CMD)wec_indirect -p2 $(RUNOPT) $R"; \
-		$(CMD)wec_indirect -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 3 ] ; then \
-		echo Reference time is 4189 +-47 msec; \
-		echo "$(CMD)wec_indirect -p3 $(RUNOPT) $R"; \
-		$(CMD)wec_indirect -p3 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 5 ] ; then \
-		echo Reference time is 4310 +-210 msec; \
-		echo "$(CMD)wec_indirect -p5 $(RUNOPT) $R"; \
-		$(CMD)wec_indirect -p5 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 7 ] ; then \
-		echo Reference time is 4262 +-27 msec; \
-		echo "$(CMD)wec_indirect -p7 $(RUNOPT) $R"; \
-		$(CMD)wec_indirect -p7 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 10 ] ; then \
-		echo Reference time is 4286 +-41 msec; \
-		echo "$(CMD)wec_indirect -p10 $(RUNOPT) $R"; \
-		$(CMD)wec_indirect -p10 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-
-nqueen.tst: nqueen12.tst nqueen13.tst
-nqueen12.tst: nqueen12
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 28344 +-556 msec; \
-		echo "$(CMD)nqueen12 -p1 $(RUNOPT) 12 $R"; \
-		$(CMD)nqueen12 -p1 $(RUNOPT) 12 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 14361 +-487 msec; \
-		echo "$(CMD)nqueen12 -p2 $(RUNOPT) 12 $R"; \
-		$(CMD)nqueen12 -p2 $(RUNOPT) 12 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 4 ] ; then \
-		echo Reference time is 8509 +-205 msec; \
-		echo "$(CMD)nqueen12 -p4 $(RUNOPT) 12 $R"; \
-		$(CMD)nqueen12 -p4 $(RUNOPT) 12 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 5848 +-421 msec; \
-		echo "$(CMD)nqueen12 -p8 $(RUNOPT) 12 $R"; \
-		$(CMD)nqueen12 -p8 $(RUNOPT) 12 $R; \
-		sleep 5; \
-	fi
-nqueen13.tst: nqueen13
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 181149 +-4545 msec; \
-		echo "$(CMD)nqueen13 -p1 $(RUNOPT) 13 $R"; \
-		$(CMD)nqueen13 -p1 $(RUNOPT) 13 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 89356 +-2060 msec; \
-		echo "$(CMD)nqueen13 -p2 $(RUNOPT) 13 $R"; \
-		$(CMD)nqueen13 -p2 $(RUNOPT) 13 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 4 ] ; then \
-		echo Reference time is 45676 +-1451 msec; \
-		echo "$(CMD)nqueen13 -p4 $(RUNOPT) 13 $R"; \
-		$(CMD)nqueen13 -p4 $(RUNOPT) 13 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Reference time is 24863 +-379 msec; \
-		echo "$(CMD)nqueen13 -p8 $(RUNOPT) 13 $R"; \
-		$(CMD)nqueen13 -p8 $(RUNOPT) 13 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 12 ] ; then \
-		echo Reference time is 18085 +-427 msec; \
-		echo "$(CMD)nqueen13 -p12 $(RUNOPT) 13 $R"; \
-		$(CMD)nqueen13 -p12 $(RUNOPT) 13 $R; \
-		sleep 5; \
-	fi
-nqueen14.tst: nqueen14
-	if [ $(NODES) -ge 1 ] ; then \
-		echo "(CMD)nqueen14 -p1 $(RUNOPT) 14 $R"; \
-		(CMD)nqueen14 -p1 $(RUNOPT) 14 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Response time is 601414 msec; \
-		echo "(CMD)nqueen14 -p2 $(RUNOPT) 14 $R"; \
-		(CMD)nqueen14 -p2 $(RUNOPT) 14 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 4 ] ; then \
-		echo Response time is 303094 msec; \
-		echo "(CMD)nqueen14 -p4 $(RUNOPT) 14 $R"; \
-		(CMD)nqueen14 -p4 $(RUNOPT) 14 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 8 ] ; then \
-		echo Response time is 163584 msec; \
-		echo "(CMD)nqueen14 -p8 $(RUNOPT) 14 $R"; \
-		(CMD)nqueen14 -p8 $(RUNOPT) 14 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 12 ] ; then \
-		echo Response time is 128024 msec; \
-		echo "(CMD)nqueen14 -p12 $(RUNOPT) 14 $R"; \
-		(CMD)nqueen14 -p12 $(RUNOPT) 14 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 16 ]
-		echo Response time is 97256 msec; \
-		echo "$(CMD)nqueen14 -p16 $(RUNOPT) 14 $R"; \
-		$(CMD)nqueen14 -p16 $(RUNOPT) 14 $R; \
-		sleep 5; \
-	fi
-read.tst: read
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 20162 +-224 msec; \
-		echo "$(CMD)read -p2 $(RUNOPT) 1000 $R"; \
-		$(CMD)read -p2 $(RUNOPT) 1000 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 40344 +-607 msec; \
-		echo "$(CMD)read -p2 $(RUNOPT) 2000 $R"; \
-		$(CMD)read -p2 $(RUNOPT) 2000 $R; \
-		sleep 5; \
-	fi
-slife.tst: slife
-	if [ $(NODES) -ge 1 ] ; then \
-		echo Reference time is 2629 +-132 msec; \
-		echo "$(CMD)slife -p1 $(RUNOPT) $R"; \
-		$(CMD)slife -p1 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 55100 +-2255 msec; \
-		echo "$(CMD)slife -p2 $(RUNOPT) $R"; \
-		$(CMD)slife -p2 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 4 ] ; then \
-		echo Reference time is 35497 +-1371 msec; \
-		echo "$(CMD)slife -p4 $(RUNOPT) $R"; \
-		$(CMD)slife -p4 $(RUNOPT) $R; \
-		sleep 5; \
-	fi
-throw.tst: throw
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 10110 +-80 msec; \
-		echo "./throw -p2 1000 $R"; \
-		./throw -p2 1000 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 20276 +-469 msec; \
-		echo "./throw -p2 2000 $R"; \
-		./throw -p2 2000 $R; \
-		sleep 5; \
-	fi
-unify.tst: unify
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 10315 +-703 msec; \
-		echo "./unify -p2 1000 $R"; \
-		./unify -p2 1000 $R; \
-		sleep 5; \
-	fi
-	if [ $(NODES) -ge 2 ] ; then \
-		echo Reference time is 20234 +-271 msec; \
-		echo "./unify -p2 2000 $R"; \
-		./unify -p2 2000 $R; \
-		sleep 5; \
-	fi
-
-all-measure: $(MEASURE)
-all-measure-src: $(MEASURE_PROGS)
-all-test: $(TEST)
-all-test-src: $(TEST_PROGS)
-
-forward_goal: forward_goal.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-general_unify_1: general_unify_1.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-general_unify_2: general_unify_2.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-multiple_wait: multiple_wait.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-t0thr1: t0thr1.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-t0thr2: t0thr2.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-t0thr3: t0thr3.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-unify_exrefs: unify_exrefs.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-vector_built: vector_built.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-vector_built_2: vector_built_2.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-wec_exhaust_1: wec_exhaust_1.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-wec_exhaust_2: wec_exhaust_2.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-wec_exhaust_3: wec_exhaust_3.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-wec_indirect: wec_indirect.o lib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o lib.o
-
-
-slife: slife.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o
-nqueen: nqueen.o rlib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o rlib.o
-nqueen12: nqueen
-	rm -f nqueen12; ln nqueen nqueen12
-nqueen13: nqueen
-	rm -f nqueen13; ln nqueen nqueen13
-nqueen14: nqueen
-	rm -f nqueen14; ln nqueen nqueen14
-read: read.o rlib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o rlib.o
-throw: throw.o rlib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o rlib.o
-unify: unify.o rlib.o
-	${KLIC} ${KLICSOPT} -o $@ $@.o rlib.o
-
-$(MEASURE_OBJS) rlib.o $(TEST_OBJS) lib.o: sysupdate.time klicdb.init libklic.db \
-		$(MEASURE_SRCS) rlib.kl1 $(TEST_SRCS) lib.kl1
-	$(KLIC) $(KLICSOPT) -c $(MEASURE_SRCS) rlib.kl1 $(TEST_SRCS) lib.kl1
-
-lib.o: $(SYSTEM) klicdb.init libklic.db
-forward_goal: $(SYSTEM) klicdb.init libklic.db
-general_unify_1: $(SYSTEM) klicdb.init libklic.db
-general_unify_2: $(SYSTEM) klicdb.init libklic.db
-multiple_wait: $(SYSTEM) klicdb.init libklic.db
-t0thr1: $(SYSTEM) klicdb.init libklic.db
-t0thr2: $(SYSTEM) klicdb.init libklic.db
-t0thr3: $(SYSTEM) klicdb.init libklic.db
-unify_exrefs: $(SYSTEM) klicdb.init libklic.db
-vector_built: $(SYSTEM) klicdb.init libklic.db
-vector_built_2: $(SYSTEM) klicdb.init libklic.db
-wec_exhaust_1: $(SYSTEM) klicdb.init libklic.db
-wec_exhaust_2: $(SYSTEM) klicdb.init libklic.db
-wec_exhaust_3: $(SYSTEM) klicdb.init libklic.db
-wec_indirect: $(SYSTEM) klicdb.init libklic.db
-
-klicdb.init: $(TOP)/runtime/klic.db
-	cp -p $(TOP)/runtime/klic.db klicdb.init
-
-libklic.db: $(TOP)/runtime/libklic.db
-	cp -p $(TOP)/runtime/libklic.db .
-sysupdate.time:  $(SYSTEM)
-	make clean;
-	touch sysupdate.time
-depend:
-realclean: distclean
-distclean: clean
-	rm -f \#* *~ *.orig *.rej
-clean:
-	rm -f *.ext *.c *.h libklic.db klicdb.init
-	rm -f *.o core a.out klic.db *.out
-	rm -f $(TEST_PROGS) rm -f $(MEASURE_PROGS)
-	rm -f sysupdate.time
-backups:
-	mv -f *.ext *.c *.h *.o libklic.db klicdb.init \
-	core a.out klic.db \
-	$(TEST_PROGS) $(MEASURE_PROGS) backup
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/forward_goal.out klic-3.003-2002-03-19/shmtest/cmpdir/forward_goal.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/forward_goal.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/forward_goal.out	Thu Jan  1 09:00:00 1970
@@ -1,3 +0,0 @@
-'### InterNode Test [goal throw] Begin ###'
-'(a-d) : 'abcd'...done'
-'### InterNode Test [goal throw] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/general_unify_1.out klic-3.003-2002-03-19/shmtest/cmpdir/general_unify_1.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/general_unify_1.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/general_unify_1.out	Thu Jan  1 09:00:00 1970
@@ -1,6 +0,0 @@
-'### InterNode Test [General Unification (1)] Begin ###'
-'F=f(V), V={F} : (a-e) : 'abcde'...done'
-'V={F}, F=f(V) : (a-e) : 'abcde'...done'
-'F=f(V,V), V={F,F} : (a-c) : 'abc'...done'
-'V={F,F}, F=f(V,V) : (a-c) : 'abc'...done'
-'### InterNode Test [General Unification (1)] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/general_unify_2.out klic-3.003-2002-03-19/shmtest/cmpdir/general_unify_2.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/general_unify_2.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/general_unify_2.out	Thu Jan  1 09:00:00 1970
@@ -1,4 +0,0 @@
-'### InterNode Test [General Unification (2)] Begin ###'
-'F=f(V), V={F} : (a-d) : 'abcd'...done'
-'F=f(V,V), V={F,F} : (a-c) : 'abc'...done'
-'### InterNode Test [General Unification (2)] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/multiple_wait.out klic-3.003-2002-03-19/shmtest/cmpdir/multiple_wait.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/multiple_wait.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/multiple_wait.out	Thu Jan  1 09:00:00 1970
@@ -1,3 +0,0 @@
-'### InterNode Test [Multiple-Wait] Begin ###'
-'test for EXo multiple-wait (a-f) : 'abcdef'...done'
-'### InterNode Test [Multiple-Wait] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/nqueen12.out klic-3.003-2002-03-19/shmtest/cmpdir/nqueen12.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/nqueen12.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/nqueen12.out	Thu Jan  1 09:00:00 1970
@@ -1 +0,0 @@
-14200
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/nqueen13.out klic-3.003-2002-03-19/shmtest/cmpdir/nqueen13.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/nqueen13.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/nqueen13.out	Thu Jan  1 09:00:00 1970
@@ -1 +0,0 @@
-73712
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/nqueen14.out klic-3.003-2002-03-19/shmtest/cmpdir/nqueen14.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/nqueen14.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/nqueen14.out	Thu Jan  1 09:00:00 1970
@@ -1 +0,0 @@
-365596
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/slife.out klic-3.003-2002-03-19/shmtest/cmpdir/slife.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/slife.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/slife.out	Thu Jan  1 09:00:00 1970
@@ -1 +0,0 @@
-122
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/t0thr1.out klic-3.003-2002-03-19/shmtest/cmpdir/t0thr1.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/t0thr1.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/t0thr1.out	Thu Jan  1 09:00:00 1970
@@ -1,5 +0,0 @@
-'### InterNode Test [%throw_goal, %read] Begin ###'
-'Test for throw_goal args (a-e) : 'abcde'...done'
-'Test for throw_goal atom/int/func/nil (a-g) : 'abcdefg'...done'
-'Test for throw_goal vector/list (a-n) : 'abcdefghijklmn'...done'
-'### InterNode Test [%throw_goal, %read] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/t0thr2.out klic-3.003-2002-03-19/shmtest/cmpdir/t0thr2.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/t0thr2.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/t0thr2.out	Thu Jan  1 09:00:00 1970
@@ -1,3 +0,0 @@
-'### InterNode Test [Reexportation] Begin ###'
-'Test for throw_goal vector/list (a-m) : 'abcdefghijklm'...done'
-'### InterNode Test [Reexportation] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/t0thr3.out klic-3.003-2002-03-19/shmtest/cmpdir/t0thr3.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/t0thr3.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/t0thr3.out	Thu Jan  1 09:00:00 1970
@@ -1,3 +0,0 @@
-'### InterNode Test [Return Back %throw_goal] Begin ###'
-'Test for throw_goal throw & back (a-j) : 'abcdefghij'...done'
-'### InterNode Test [Return Back %throw_goal] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/unify_exrefs.out klic-3.003-2002-03-19/shmtest/cmpdir/unify_exrefs.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/unify_exrefs.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/unify_exrefs.out	Thu Jan  1 09:00:00 1970
@@ -1,5 +0,0 @@
-'### InterNode Test [Unification between EXREFs ] Begin ###'
-'gen-exref & gen-exref (a-j) : 'abcdefghij'...done'
-'con-exref & con-exref (a-c) : 'abc'...done'
-'gen-exref & con-exref (a-m) : 'abcdefghijklm'...done'
-'### InterNode Test [Unification between EXREFs ] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/vector_built.out klic-3.003-2002-03-19/shmtest/cmpdir/vector_built.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/vector_built.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/vector_built.out	Thu Jan  1 09:00:00 1970
@@ -1,7 +0,0 @@
-'### InterNode Test [EXREF -> Vector] Begin ###'
-'vector: (a-u) : 'abcdefghijklmnopqrstu'...done'
-'(guard) vector_element : (a-p) : 'abcdefghijklmnop'...done'
-'(body) vector_element : (a-p) : 'abcdefghijklmnop'...done'
-'set_vector_element/4 : (a-w) : 'abcdefghijklmnopqrstuvw'...done'
-'set_vector_element/5 : (a-p) : 'abcdefghijklmnop'...done'
-'### InterNode Test [EXREF -> Vector] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/vector_built_2.out klic-3.003-2002-03-19/shmtest/cmpdir/vector_built_2.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/vector_built_2.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/vector_built_2.out	Thu Jan  1 09:00:00 1970
@@ -1,7 +0,0 @@
-'### InterNode Test [EXREF -> EXREF -> Vector] Begin ###'
-'vector: (a-u) : 'abcdefghijklmnopqrstu'...done'
-'(guard) vector_element : (a-p) : 'abcdefghijklmnop'...done'
-'(body) vector_element : (a-p) : 'abcdefghijklmnop'...done'
-'set_vector_element/4 : (a-w) : 'abcdefghijklmnopqrstuvw'...done'
-'set_vector_element/5 : (a-p) : 'abcdefghijklmnop'...done'
-'### InterNode Test [EXREF -> EXREF -> Vector] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/wec_exhaust_1.out klic-3.003-2002-03-19/shmtest/cmpdir/wec_exhaust_1.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/wec_exhaust_1.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/wec_exhaust_1.out	Thu Jan  1 09:00:00 1970
@@ -1,4 +0,0 @@
-'### InterNode Test [WEC exhausted (1)] Begin ###'
-'unification (a-h) : 'abcdefgh'...done'
-'fetching (a-h) : 'abcdefgh'...done'
-'### InterNode Test [WEC exhausted (1)] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/wec_exhaust_2.out klic-3.003-2002-03-19/shmtest/cmpdir/wec_exhaust_2.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/wec_exhaust_2.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/wec_exhaust_2.out	Thu Jan  1 09:00:00 1970
@@ -1,4 +0,0 @@
-'### InterNode Test [WEC exhausted (2)] Begin ###'
-'chain of exrefs : unification (a-f) : 'abcdef'...done'
-'chain of exrefs : fetching (a-f) : 'abcdef'...done'
-'### InterNode Test [WEC exhausted (2)] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/wec_exhaust_3.out klic-3.003-2002-03-19/shmtest/cmpdir/wec_exhaust_3.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/wec_exhaust_3.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/wec_exhaust_3.out	Thu Jan  1 09:00:00 1970
@@ -1,3 +0,0 @@
-'### InterNode Test [WEC exhausted (3)] Begin ###'
-'unification of chains of exrefs (a-g) : 'abcdefg'...done'
-'### InterNode Test [WEC exhausted (3)] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/cmpdir/wec_indirect.out klic-3.003-2002-03-19/shmtest/cmpdir/wec_indirect.out
--- klic-3.003-2002-03-16/shmtest/cmpdir/wec_indirect.out	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/cmpdir/wec_indirect.out	Thu Jan  1 09:00:00 1970
@@ -1,3 +0,0 @@
-'### InterNode Test [WEC Indirect Exportation] Begin ###'
-'indirect export (a-f) : 'abcdef' ...done'
-'### InterNode Test [WEC Indirect Exportation] End ###'
diff -ruN klic-3.003-2002-03-16/shmtest/dlife.kl1 klic-3.003-2002-03-19/shmtest/dlife.kl1
--- klic-3.003-2002-03-16/shmtest/dlife.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/dlife.kl1	Thu Jan  1 09:00:00 1970
@@ -1,195 +0,0 @@
-% icpsi538::>sys>user>imai>KL1>life.kl1.7, 20-Dec-91 12:19:59, Edit by imai
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mesh64m.ghc 				1987.09.22. GOTO
-%	The counterfeit of LIFE game
-%
-%     General Notes:
-%	The original life game uses eight-neighbours, however, this program
-%	uses only four-neighbours (north, south, east, west).
-%	This test program has following features.
-%	(1) Two dimensional "cell" processes are generated.
-%		- The cell process has two directional streams
-%		  with four neighbours.
-%		- The cell process is linked as a "torus".
-%	(2) The cell process has its own state, which is updated using its
-%	     "current" states of four neighbours'.
-%		- Note that there is no world clock.
-%		- This program has much locality in the stream communication.
-%		- However, this program does not suit for depth-first
-%		  execution.
-%		- As the result, there may occur many suspensions.
-%	(3) The parameters related to the program size can be given by the
-%	     initial states and the state transition function of cells.
-
-%%%%%%%%%%
-% life(G,X,Y,DivX,DivY,R) 
-%	G    : the number of Max life cycles
-%	X    : number of life node for X
-%	Y    : number of life node for Y
-%		(initial state is computed by combination of X and Y)
-%	DivX : Cluster Division for X
-%	DivY : Cluster Division for Y
-%	R    : the result list
-%
-% for Example
-%  +-------------+  X=31, Y=15, DivX=2, DivY=3
-%  |14    |      |
-%  |10    |      |  The number of computing node (cluster) is determined by
-%  |------+------|  number of clusters currently available.
-%  |9     |      |
-%  |5     |      |  In this case, if we have
-%  |------+------|            +---+           +---+           +---+
-%  |4     |      |  3clusters |1|2| 6clusters |4|5| 4clusters |0|1|
-%  |0   14|15  31|            |-+-|           |-+-|           |-+-|
-%  +-------------+            |2|0|           |2|3|           |2|3|
-%                             |-+-|           |-+-|           |-+-|
-%                             |0|1|           |0|1|           |0|1|
-%                             +---+           +---+           +---+
-%                   However even if we have 12 clusters, the mapping is exactly
-%                   same as the case of 6 clusters!!
-:- module main.
-
-main :-	go(N), io:outstream([print(N),nl]).
-
-go(N) :- life(120,38,38,4,4,L), count_1(L,N).
-
-display(A) :- display_console(A) | true.
-
-count_1([SubL|L],N) :- true |
-	count_sub(SubL,0,SubN), count_1(L,N2), N := SubN + N2.
-count_1([],N) :- true | N=0.
-
-count_sub([1|L],N,NFinal) :- true | count_sub(L,~(N+1),NFinal).
-count_sub([0|L],N,NFinal) :- true | count_sub(L,     N,NFinal).
-count_sub([],   N,NFinal) :- true | NFinal = N.
-
-life(G,X,Y,DivX,DivY,R) :- true |
-	init(X,Y,X,Y,Sinit),
-	Config = kumon(X,Y,DivX,DivY),
-	make_row(X,Y,Config,G,Sinit,NS1,NS1,NS2,NS2,R,[]).
-
-%%%%%%%%%%%%%
-% initialize table (by A.Imai)
-%	randomly (not a better function, actually) generate initial table
-%%%%%%%%%%%%%
-
-init(X,Y,TX,TY,List) :- X > 0 |
-	init_col(X,Y,TX,TY,ColL,X),
-	List = [ColL|List1],
-	init(~(X-1),Y,TX,TY,List1).
-init(0,Y,TX,TY,List) :- true | List = [].
-
-init_col(X,Y,TX,TY,List,PrevNum) :- Y > 0 |
-	rand_0_or_1(X,Y,PrevNum,Rand,NewNum),
-	List = [Rand|List1],
-	init_col(X,~(Y-1),TX,TY,List1,NewNum).
-init_col(X,0,TX,TY,List,_) :- true | List = [].
-
-rand_0_or_1(X,Y,PrevNum,Rand,NewNum) :-
-    integer(X), integer(Y), integer(PrevNum) |
-	NewNum := ( PrevNum >> 3 ) + ( X << 2 ) + ( Y >> 2 ),
-	Rand := NewNum mod 2.
-
-%%%%%%%%%%
-% make_row(G,Init,Ns1,Sn1,Ns2,Sn2,Rh,Rt)
-%	G  : the number of Max life cycles
-%	Init : The initial state list
-%		[I_col1,I_col2,....,I_coln]
-%	Ns1,Sn1 : North/south stream
-%	Ns2,Sn2 : North/south stream
-%	Rh,Rt : The result list
-
-make_row(X,Y,Config,G,[I_col|Is],Ns1,Sn1,Ns2,Sn2,Rh,Rt) :- true |
-	Rh=[C|Rhs],
-	compute_node(X,Y,Config,Node),
-	make_col(     X,Y,Config,G,I_col,Ns1,S1 ,Ns2,S2 ,EW1,EW1,EW2,EW2,C  ,[])@node(Node),
-%	make_col(     X,Y,Config,G,I_col,Ns1,S1 ,Ns2,S2 ,EW1,EW1,EW2,EW2,C  ,[]),
-	make_row(~(X-1),Y,Config,G,Is   ,S1 ,Sn1,S2 ,Sn2                ,Rhs,Rt).
-
-make_row(X,Y,Config,G,[]        ,Ns1,Sn1,Ns2,Sn2,Rh,Rt) :- true |
-	Rh = Rt,
-	Sn1=[S1|Ssn1], Sn2=[S2|Ssn2],
-	connect_row(Ns1,Ssn1,Ns2,Ssn2,S1,S2).
-
-%%%%%%%%%%
-% connect_row(Ns1,Sn1,Ns2,Sn2,S1,S2)
-%	Ns1,Sn1,Ns2,Sn2 : North/south stream for make_col
-%	S1,S2 : North/south stream for cells
-
-connect_row([N1|Ns1],Sn1,[N2|Ns2],Sn2,S1,S2) :- true |
-	N1 = S1, N2 = S2, Sn1=[Ss1|Ssn1], Sn2=[Ss2|Ssn2],
-	connect_row(Ns1,Ssn1,Ns2,Ssn2,Ss1,Ss2).
-
-connect_row([]      ,_  ,[]      ,_  ,_ ,_ ) :- true | true.
-
-%%%%%%%%%%
-% make_col(G,I_col,Ns1,Sn1,Ns2,Sn2,Ew1,We1,Ew2,We2,Ch,Ct)
-%	G  : the number of Max life cycles
-%	I_col : the initial state list for colomn
-%	Ns1,Sn1: north/south stream
-%	Ns2,Sn2: north/south stream
-%	Ew1,We1: east/west stream
-%	Ew2,We2: east/west stream
-%	Ch,Ct: The result list for colomn
-
-make_col(X,Y,Config,G,[I|Is],[N1|Ns1],Sn1,[N2|Ns2],Sn2,Ew1,We1,Ew2,We2,Ch,Ct) :-
-    Config=kumon(TX,TY,DivX,DivY) |
-	Ch=[R|Chs],
-	Sn1=[S1|Ssn1], Sn2=[S2|Ssn2],
-	compute_node(X,Y,Config,Node),
-	cell(I,N1,S1,N2,S2,Ew1,WE1,Ew2,WE2,R,G)@node(Node),
-%	cell(I,N1,S1,N2,S2,Ew1,WE1,Ew2,WE2,R,G),
-	make_col(X,~(Y-1),Config,G,Is,Ns1,Ssn1,Ns2,Ssn2,WE1,We1,WE2,We2,Chs,Ct).
-
-make_col(X,Y,Config,G,[]    ,_       ,Sn1,_       ,Sn2,Ew1,We1,Ew2,We2,Ch,Ct) :-
-    true |
-	Ch = Ct, Ew1 = We1, Ew2 = We2, Sn1=[], Sn2=[].
-
-compute_node(X,Y,kumon(TX,TY,DivX,DivY),Node) :- true |
-	current_node(_,TotalNode),
-	Node := ((X/(TX/DivX)) + ((Y/(TY/DivY))*DivX)) mod TotalNode.
-%	Node = 0.
-
-%%%%%%%%%%%
-% cell --> cell1
-
-cell(I,N1,S1,N2,S2,E1,W1,E2,W2,R,G) :- true |
-	N2=[I|On], S1=[I|Os], W2=[I|Ow], E1=[I|Oe],
-	cell1(I,N1,S2,W1,E2,On,Os,Ow,Oe,R,G).
-
-% cell1(X,Ni,Si,Ei,Wi,On,Os,Ow,Oe,R,G)
-%	X  : the state of cell
-%	Ni : the state of the north neighbor cell
-%	Si : the state of the south neighbor cell
-%	Ei : the state of the east neighbor cell
-%	Wi : the state of the west neighbor cell
-%	On,Os,Ow,Oe  : Output stream of internal state to four neighbours
-%	R  : The result output stream head
-%	G  : the number of life cycle (Generation)
-
-cell1(X,[N|Ni],[S|Si],[E|Ei],[W|Wi],On,Os,Ow,Oe,R,G) :- G > 0, G1:=G-1,
-    T1:=S+N, T2:=E+W, T:=T1+T2 | 
-	On=[Y|On1], Os=[Y|Os1], Ow=[Y|Ow1], Oe=[Y|Oe1],
-	change(X,T,Y), cell1(Y,Ni,Si,Ei,Wi,On1,Os1,Ow1,Oe1,R,G1).
-
-cell1(X,_     ,_     ,_     ,_     ,On,Os,Ow,Oe,R,0) :- true |
-	On=[],Os=[],Ow=[],Oe=[],R = X.
-
-%%%%%%%%%%%
-% change(X,T,Y) : The state transition function.
-%		  The following function works as a kind of "differntial
-%		  (Kyoukai-sen chuushutsu)" in the two dimensional pattern
-%		  processing.
-%		  Other function can be given easily.
-%	Y <- f(X,T)
-
-change(0,0,Y) :- true | Y = 1.
-change(0,1,Y) :- true | Y = 0.
-change(0,2,Y) :- true | Y = 1.
-change(0,3,Y) :- true | Y = 0.
-change(0,4,Y) :- true | Y = 1.
-change(1,0,Y) :- true | Y = 0.
-change(1,1,Y) :- true | Y = 1.
-change(1,2,Y) :- true | Y = 0.
-change(1,3,Y) :- true | Y = 1.
-change(1,4,Y) :- true | Y = 0.
diff -ruN klic-3.003-2002-03-16/shmtest/forward_goal.kl1 klic-3.003-2002-03-19/shmtest/forward_goal.kl1
--- klic-3.003-2002-03-16/shmtest/forward_goal.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/forward_goal.kl1	Thu Jan  1 09:00:00 1970
@@ -1,49 +0,0 @@
-% Nodei                          Nodej
-%        goal --(thrown)-->            (1)
-%            <--(thrown)-- goal        (2)
-%        goal --(thrown)-->            (3)
-%            <--(thrown)-- goal        (4)
-%                  :
-
-:- module main. 
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [goal throw] Begin ###',_), 
-	lib:prs(Os2,Os3,'(a-d) : ',_), 
-	test(Os3,Os4,Cs), 
-	Cs=[t(nadd(500,1),out(a)),
-	    t(nadd(500,2),out(b)),
-	    t(nadd(200,1),nadd(300,1),out(c)),
-	    t(nadd(100,3),nadd(500,1),out(d))], 
-	lib:prsl(Os4,Os5,'...done',_), 
-	lib:prsl(Os5,[],'### InterNode Test [goal throw] End ###',_). 
-
-test(Os,OsE,[t(nadd(N,Add),out(Out))|Cs]):- 
-	throw(N,Add,Done,done), 
-	pr(Os,Os2,Done,Out), test(Os2,OsE,Cs). 
-test(Os,OsE,[t(nadd(N1,Add1),nadd(N2,Add2),out(Out))|Cs]):- 
-	throw(N1,Add1,Da,Db), throw(N2,Add2,Db,done), 
-	pr(Os,Os2,Da,Out), test(Os2,OsE,Cs). 
-test(Os,OsE,[]):- Os=OsE. 
-
-throw(N,Add,Da,Db):- N > 0, wait(Add) | 
-	nextNode(Add,Node), throw(~(N-1),Add,Da,Db,Node).  
-throw(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-throw(N,Add,Da,Db,Node):- wait(Node) | throw(N,Add,Da,Db)@node(Node). 
-
-pr(Os,OsE,done,Out):- lib:prs(Os,OsE,Out,_). 
-otherwise. 
-pr(Os,OsE,_,Out):- lib:prs_err(Os,OsE,Out,_). 
-
-%===========================================================================
-nextNode(Add,Node):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	modNode(~(CurrentNode+Add),NumberOfNodes,Node).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
diff -ruN klic-3.003-2002-03-16/shmtest/general_unify_1.kl1 klic-3.003-2002-03-19/shmtest/general_unify_1.kl1
--- klic-3.003-2002-03-16/shmtest/general_unify_1.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/general_unify_1.kl1	Thu Jan  1 09:00:00 1970
@@ -1,137 +0,0 @@
-% test for "general unification" (1)
-
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [General Unification (1)] Begin ###',_), 
-	f1v1(Os2,Os3), 
-	v1f1(Os3,Os4), 
-	f2v2(Os4,Os5), 
-	v2f2(Os5,Os6), 
-	lib:prsl(Os6,[],'### InterNode Test [General Unification (1)] End ###',_). 
-
-%---------------------------------------------------------------------------
-f1v1(Os,OsE):- 
-	lib:prs(Os,Os2,'F=f(V), V={F} : (a-e) : ',_),
-	f1v1(Os2,OsE,Us), 
-	Us = [u(1,f({}),1,a),
-	      u(2,f({f}),3,b),
-	      u(3,f({f({})}),2,c),
-	      u(4,f({f({f})}),4,d),
-	      u(5,f({f({f({})})}),5,e)]. 
-
-f1v1(Os,OsE,[u(N,Func,Add,Out)|Us]):- 
-	nextNode(Add,Node), fork_f1v1(Os,Os2,N,Func,Out,Node), 
-	f1v1(Os2,OsE,Us). 
-f1v1(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-fork_f1v1(Os,Os2,N,Func,Out,Node):- wait(Node) | 
-	fork_exe_f1v1(N,Var,Done,done,Ack)@node(Node), 
-	wait_ufy(Ack,Var,Func), pr(Os,Os2,Done,Out). 
-
-fork_exe_f1v1(N,Func,Da,Db,Ack):- Ack=ack, uf1(N,Func,Da,Db). 
-
-%---------------------------------------------------------------------------
-v1f1(Os,OsE):- 
-	lib:prs(Os,Os2,'V={F}, F=f(V) : (a-e) : ',_),
-	v1f1(Os2,OsE,Us), 
-	Us = [u(1,{f},1,a),
-	      u(2,{f({})},3,b),
-	      u(3,{f({f})},2,c),
-	      u(4,{f({f({})})},4,d),
-	      u(5,{f({f({f})})},5,e)]. 
-
-v1f1(Os,OsE,[u(N,Func,Add,Out)|Us]):- 
-	nextNode(Add,Node), fork_v1f1(Os,Os2,N,Func,Out,Node), 
-	v1f1(Os2,OsE,Us). 
-v1f1(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-fork_v1f1(Os,Os2,N,Func,Out,Node):- wait(Node) | 
-	fork_exe_v1f1(N,Var,Done,done,Ack)@node(Node), 
-	wait_ufy(Ack,Var,Func), pr(Os,Os2,Done,Out). 
-
-fork_exe_v1f1(N,Func,Da,Db,Ack):- Ack=ack, uv1(N,Func,Da,Db). 
-
-%---------------------------------------------------------------------------
-f2v2(Os,OsE):- 
-	lib:prs(Os,Os2,'F=f(V,V), V={F,F} : (a-c) : ',_),
-	f2v2(Os2,OsE,Us), 
-	Us = [u(1,f({},{}),1,a),
-	      u(2,f({f,f},{f,f}),3,b),
-	      u(3,f({f({},{}),f({},{})},{f({},{}),f({},{})}),4,c)]. 
-
-f2v2(Os,OsE,[u(N,Func,Add,Out)|Us]):- 
-	nextNode(Add,Node), fork_f2v2(Os,Os2,N,Func,Out,Node), 
-	f2v2(Os2,OsE,Us). 
-f2v2(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-fork_f2v2(Os,Os2,N,Func,Out,Node):- wait(Node) | 
-	fork_exe_f2v2(N,Var,Done,done,Ack)@node(Node), 
-	wait_ufy(Ack,Var,Func), pr(Os,Os2,Done,Out). 
-
-fork_exe_f2v2(N,Func,Da,Db,Ack):- Ack=ack, uf2(N,Func,Da,Db). 
-
-%---------------------------------------------------------------------------
-v2f2(Os,OsE):- 
-	lib:prs(Os,Os2,'V={F,F}, F=f(V,V) : (a-c) : ',_),
-	v2f2(Os2,OsE,Us), 
-	Us = [u(1,{f,f},1,a),
-	      u(2,{f({},{}),f({},{})},3,b),
-	      u(3,{f({f,f},{f,f}),f({f,f},{f,f})},4,c)]. 
-
-v2f2(Os,OsE,[u(N,Func,Add,Out)|Us]):- 
-	nextNode(Add,Node), fork_v2f2(Os,Os2,N,Func,Out,Node), 
-	v2f2(Os2,OsE,Us). 
-v2f2(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-fork_v2f2(Os,Os2,N,Func,Out,Node):- wait(Node) | 
-	fork_exe_v2f2(N,Var,Done,done,Ack)@node(Node), 
-	wait_ufy(Ack,Var,Func), pr(Os,Os2,Done,Out). 
-
-fork_exe_v2f2(N,Func,Da,Db,Ack):- Ack=ack, uv2(N,Func,Da,Db). 
-
-%---------------------------------------------------------------------------
-uf1(N,Func,Da,Db):- N > 0 | Func = f(V), wv1(~(N-1),V,Da,Db). 
-uf1(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-wv1(N,{F},Da,Db):- N > 0 | uf1(~(N-1),F,Da,Db). 
-wv1(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-%---------------------------------------------------------------------------
-uv1(N,Vec,Da,Db):- N > 0 | Vec = {F}, wf1(~(N-1),F,Da,Db). 
-uv1(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-wf1(N,f(V),Da,Db):- N > 0 | uv1(~(N-1),V,Da,Db). 
-wf1(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-%---------------------------------------------------------------------------
-uf2(N,Func,Da,Db):- N > 0 | 
-	Func = f(V1,V2), wv2(~(N-1),V1,Da,Dab), wv2(~(N-1),V2,Dab,Db). 
-uf2(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-wv2(N,{F1,F2},Da,Db):- N > 0 | uf2(~(N-1),F1,Da,Dab), uf2(~(N-1),F2,Dab,Db). 
-wv2(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-%---------------------------------------------------------------------------
-uv2(N,Vec,Da,Db):- N > 0 | Vec = {F1,F2}, wf2(~(N-1),F1,Da,Dab), wf2(~(N-1),F2,Dab,Db). 
-uv2(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-wf2(N,f(V1,V2),Da,Db):- N > 0 | uv2(~(N-1),V1,Da,Dab), uv2(~(N-1),V2,Dab,Db). 
-wf2(N,_,Da,Db):- N=:=0 | Da=Db. 
-
-%===========================================================================
-wait_ufy(Wait,DataA,DataB):- wait(Wait) | DataA = DataB. 
-
-nextNode(Add,Node):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	modNode(~(CurrentNode+Add),NumberOfNodes,Node).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-pr(Os,Os2,done,Out):- lib:prs(Os,Os2,Out,_). 
-otherwise. 
-pr(Os,Os2,_,Out):- lib:prs_err(Os,Os2,Out,_). 
-
diff -ruN klic-3.003-2002-03-16/shmtest/general_unify_2.kl1 klic-3.003-2002-03-19/shmtest/general_unify_2.kl1
--- klic-3.003-2002-03-16/shmtest/general_unify_2.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/general_unify_2.kl1	Thu Jan  1 09:00:00 1970
@@ -1,81 +0,0 @@
-% test for "general unification" (2)
-
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [General Unification (2)] Begin ###',_), 
-	f1v1(Os2,Os3), 
-	f2v2(Os3,Os4), 
-	lib:prsl(Os4,[],'### InterNode Test [General Unification (2)] End ###',_). 
-
-%---------------------------------------------------------------------------
-f1v1(Os,OsE):- 
-	lib:prs(Os,Os2,'F=f(V), V={F} : (a-d) : ',_),
-	f1v1(Os2,OsE,Us), 
-	Us = [u(0,f({}),1,a),
-	      u(1,f({f({})}),3,b),
-	      u(2,f({f({f({})})}),2,c),
-	      u(3,f({f({f({{f({})}})})}),5,d)]. 
-
-f1v1(Os,OsE,[u(N,Func,Add,Out)|Us]):- 
-	nextNode(Add,Node), fork_f1v1(Os,Os2,N,Func,Out,Node), 
-	f1v1(Os2,OsE,Us). 
-f1v1(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-fork_f1v1(Os,Os2,N,Func,Out,Node):- wait(Node) | 
-	fork_exe_f1v1(N,Var,Done,done,Ack)@node(Node), 
-	wait_ufy(Ack,Var,Func), pr(Os,Os2,Done,Out). 
-
-fork_exe_f1v1(N,Func,Da,Db,Ack):- Ack=ack, uf1(N,Func,Da,Db). 
-
-%---------------------------------------------------------------------------
-f2v2(Os,OsE):- 
-	lib:prs(Os,Os2,'F=f(V,V), V={F,F} : (a-c) : ',_),
-	f2v2(Os2,OsE,Us), 
-	Us = [u(0,f({},{}),1,a),
-	         u(1,f({f({},{}),f({},{})},{f({},{}),f({},{})}),3,b),
-	      u(2,f({f({f({},{}),f({},{})},{f({},{}),f({},{})}),
-		     f({f({},{}),f({},{})},{f({},{}),f({},{})})},
-	            {f({f({},{}),f({},{})},{f({},{}),f({},{})}),
-		     f({f({},{}),f({},{})},{f({},{}),f({},{})})}),4,c)]. 
-f2v2(Os,OsE,[u(N,Func,Add,Out)|Us]):- 
-	nextNode(Add,Node), fork_f2v2(Os,Os2,N,Func,Out,Node), 
-	f2v2(Os2,OsE,Us). 
-f2v2(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-fork_f2v2(Os,Os2,N,Func,Out,Node):- wait(Node) | 
-	fork_exe_f2v2(N,Var,Done,done,Ack)@node(Node), 
-	wait_ufy(Ack,Var,Func), pr(Os,Os2,Done,Out). 
-
-fork_exe_f2v2(N,Func,Da,Db,Ack):- Ack=ack, uf2(N,Func,Da,Db). 
-
-%---------------------------------------------------------------------------
-uf1(N,Func,Da,Db):- N > 0 | 
-	Func = f(V), set_vector_element(V,0,F,_,_), uf1(~(N-1),F,Da,Db). 
-uf1(N,Fund,Da,Db):- N=:=0 | Func = f({}), Da=Db. 
-
-%---------------------------------------------------------------------------
-uf2(N,Func,Da,De):- N > 0 | 
-	Func = f(V1,V2), 
-	set_vector_element(V1,0,F11,_,_), uf2(~(N-1),F11,Da,Db), 
-	set_vector_element(V1,1,F21,_,_), uf2(~(N-1),F21,Db,Dc), 
-	set_vector_element(V2,0,F12,_,_), uf2(~(N-1),F12,Dc,Dd), 
-	set_vector_element(V2,1,F22,_,_), uf2(~(N-1),F22,Dd,De). 
-uf2(N,Func,Da,Db):- N=:=0 | Func = f({},{}), Da=Db. 
-
-%===========================================================================
-wait_ufy(Wait,DataA,DataB):- wait(Wait) | DataA = DataB. 
-
-nextNode(Add,Node):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	modNode(~(CurrentNode+Add),NumberOfNodes,Node).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-pr(Os,Os2,done,Out):- lib:prs(Os,Os2,Out,_). 
-otherwise. 
-pr(Os,Os2,_,Out):- lib:prs_err(Os,Os2,Out,_). 
-
diff -ruN klic-3.003-2002-03-16/shmtest/lib.kl1 klic-3.003-2002-03-19/shmtest/lib.kl1
--- klic-3.003-2002-03-16/shmtest/lib.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/lib.kl1	Thu Jan  1 09:00:00 1970
@@ -1,57 +0,0 @@
-:- module lib.  
-
-io(Os):- ioinit(Ps), checkOs(Os,Ps,ERs,Close), testexit(Close,ERs). 
-
-ioinit(Ps):- klicio:klicio([stdout(normal(Ps))]).  
-
-prs(Os,Os2,Data,Done) :- Os = [putt(Data)|Os2], Done = done. 
-prsl(Os,Os2,Data,Done) :- Os = [putt(Data),nl|Os2], Done = done. 
-prs_err(Os,Os2,Data,Done) :- Os = [putt(err(Data))|Os2], Done = done. 
-
-testexit(0,[]). 
-testexit(0,ERs):- list(ERs) | ERs=[].  
-%			      ^^^^^^ for indicating ERROR.  
-
-checkOs([putt(Out)|Os],Ps,ERs,Close):- atom(Out) | 
-	Ps=[putt(Out)|Ps2], checkOs(Os,Ps2,ERs,Close). 
-checkOs([putt(err(Out))|Os],Ps,ERs,Close):- 
-	Ps=[putt(err(Out))|Ps2], ERs=[putt(Out)|ERs2], 
-	checkOs(Os,Ps2,ERs2,Close). 
-checkOs([nl|Os],Ps,ERs,Close):- Ps=[nl|Ps2], checkOs(Os,Ps2,ERs,Close). 
-checkOs([],Ps,ERs,Close):- Ps=[fclose(Close)], ERs=[]. 
-
-nextNode(Add,Node):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	modNode(~(CurrentNode+Add),NumberOfNodes,Node).  
-
-nextNodes(3,N3s):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	modNode(~(CurrentNode+1),NumberOfNodes,NodeU), 
-	modNode(~(CurrentNode-1),NumberOfNodes,NodeD), 
-	modNode(~((NodeU+NodeD)/2),NumberOfNodes,NodeM), 
-	N3s = [NodeU,NodeD,NodeM]. 
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-waitAndUnify(Wait,X,Y):- wait(Wait) | X=Y. 
-
-waitallAndUnify([Wait|As],X,Y):- wait(Wait) | waitallAndUnify(As,X,Y). 
-waitallAndUnify([],X,Y):- X=Y. 
-
-checkAndPr(Os,Os2,[done|Rs],Data,Done):- 
-	checkAndPr(Os,Os2,Rs,Data,Done). 
-checkAndPr(Os,Os2,[],Data,Done):- prs(Os,Os2,Data,Done). 
-
-eq(Data,Data,Eq):- Eq = done. 
-otherwise. 
-eq(_,_,Eq):- Eq = fail. 
-
-check([done|Ds],Done):- check(Ds,Done). 
-check([],Done):- Done = done. 
-otherwise. 
-check(_,Done):- Done = fail. 
-
diff -ruN klic-3.003-2002-03-16/shmtest/mesh.kl1 klic-3.003-2002-03-19/shmtest/mesh.kl1
--- klic-3.003-2002-03-16/shmtest/mesh.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/mesh.kl1	Thu Jan  1 09:00:00 1970
@@ -1,40 +0,0 @@
-:- module main.
-
-
-main:- go(100,100, Sync, Go, Fin), init(Sync,Go,Fin).
-
-init(Sync,Go,Fin) :- wait(Sync) | Go=Sync, init(Fin).
-init(Fin) :- wait(Fin) | true.  
-
-
-go(X,Y,Sync,Go,Fin) :-
-    true |
-        current_node(C,T),
-	row(0,X,0,T,Y,Sync,[],Fin,[],Go).
-
-row(X0,X1,C0,C1,Y)-Sync-F+Go :-
-    X0+1 =:= X1 |
-        current_node(C,T),
-	col(0,Y,0,C)-Sync-F+Go.
-otherwise.
-row(X0,X1,C0,C1,Y)-Sync-F+Go :-
-  true |
-  X2 := (X0+X1)/2,
-  C2 := (C0+C1)/2,
-  (row(X0,X2,C0,C2,Y)-Sync-F+Go)@node(C0),
-  (row(X2,X1,C2,C1,Y)-Sync-F+Go)@node(C2).
-
-
-col(Y0,Y1,C0,C1)-Sync-F+Go :-
-  Y0 +1 =:= Y1 |
-  w(Go)-Sync-F.
-otherwise.
-col(Y0,Y1,C0,C1)-Sync-F+Go :-
-  Y2 := (Y0+Y1)/2,
-  C2 := (C0+C1)/2,
-  col(Y0,Y2,C0,C2)-Sync-F+Go@node(C0),
-  col(Y2,Y1,C2,C1)-Sync-F+Go@node(C2).
-
-w(Go)-Sync-F:- true | w1(Go)-F.
-
-w1(Go)-F :- wait(Go) | true.
diff -ruN klic-3.003-2002-03-16/shmtest/multiple_wait.kl1 klic-3.003-2002-03-19/shmtest/multiple_wait.kl1
--- klic-3.003-2002-03-16/shmtest/multiple_wait.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/multiple_wait.kl1	Thu Jan  1 09:00:00 1970
@@ -1,170 +0,0 @@
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [Multiple-Wait] Begin ###',Done), 
-	tr(Os2,Done). 
-
-%%%% test for EXo multiple-wait %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr(Os,done):- 
-	lib:prs(Os,Os2,'test for EXo multiple-wait (a-f) : ',Done), 
-	tr_begin(Os2,Done).  
-
-tr_begin(Os,done) :- tr_a(Os). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_a(Os) :- test2(3,6,1,2,Test), tr_a(Os,Test).
-tr_a(Os,done) :- lib:prs(Os,Os2,a,Done), tr_a_end(Os2,Done).
-otherwise.
-tr_a(Os,_) :- lib:prs_err(Os,Os2,a,Done), tr_a_end(Os2,Done).
-tr_a_end(Os,done) :- tr_b(Os).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_b(Os) :- test6(3,6,1,2,3,1,2,3,Test), tr_b(Os,Test).  
-tr_b(Os,done) :- lib:prs(Os,Os2,b,Done), tr_b_end(Os2,Done).  
-otherwise.
-tr_b(Os,_) :- lib:prs_err(Os,Os2,b,Done), tr_b_end(Os2,Done).  
-tr_b_end(Os,done) :- midNode(NextNode), tr_b_next(Os,NextNode).
-tr_b_next(Os,NextNode) :- wait(NextNode) | tr_c(Os)@node(NextNode).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_c(Os) :- test2(3,6,1,-1,Test), tr_c(Os,Test).  
-tr_c(Os,done) :- lib:prs(Os,Os2,c,Done), tr_c_end(Os2,Done).  
-otherwise.
-tr_c(Os,_) :- lib:prs_err(Os,Os2,c,Done), tr_c_end(Os2,Done).  
-tr_c_end(Os,done) :- tr_d(Os).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_d(Os) :- test6(3,6,1,2,3,-2,-3,-4,Test), tr_d(Os,Test).  
-tr_d(Os,done) :- lib:prs(Os,Os2,d,Done), tr_d_end(Os2,Done).  
-otherwise.
-tr_d(Os,_) :- lib:prs_err(Os,Os2,d,Done), tr_d_end(Os2,Done).  
-tr_d_end(Os,done) :- lastNode(NextNode), tr_d_next(Os,NextNode).
-tr_d_next(Os,NextNode) :- wait(NextNode) | tr_e(Os)@node(NextNode).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_e(Os) :- test2(3,6,-2,-3,Test), tr_e(Os,Test).  
-tr_e(Os,done) :- lib:prs(Os,Os2,e,Done), tr_e_end(Os2,Done).  
-otherwise.
-tr_e(Os,_) :- lib:prs_err(Os,Os2,e,Done), tr_e_end(Os2,Done).  
-tr_e_end(Os,done) :- tr_f(Os).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_f(Os) :- test6(3,6,-6,-5,-4,-3,-2,-1,Test), tr_f(Os,Test).
-tr_f(Os,done) :- lib:prs(Os,Os2,f,Done), tr_f_end(Os2,Done).  
-otherwise.
-tr_f(Os,_) :- lib:prs_err(Os,Os2,f,Done), tr_f_end(Os2,Done).  
-tr_f_end(Os,done) :- tr_end(Os). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr_end(Os) :- lib:prsl(Os,Os2,'...done',Done), done(Os2,Done).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-done(Os,done) :- 
-	lib:prsl(Os,Os2,'### InterNode Test [Multiple-Wait] End ###',_), 
-	Os2 = [].  
-
-%===========================================================================
-test2(NR,N,AD,BD,Test2All) :- 
-        nextNode(AD,ADestPE), nextNode(BD,BDestPE), 
-        genFP(ADestPE,Test2,ATerm), genFP(BDestPE,Test2,BTerm), 
-        termDetect([ATerm,BTerm],Test2All), 
-        test2(done,NR,N,ADestPE,BDestPE,Test2).
-test2(done,NR,N,ADestPE,BDestPE,Test2) :- 
-                NR > 0, wait(ADestPE), wait(BDestPE) | 
-        test2l(done,N,ADestPE,BDestPE,TestAll), 
-        test2(TestAll,~(NR-1),N,ADestPE,BDestPE,Test2).
-test2(done,NR,_,_,_,Test2) :- NR = 0 | Test2 = done.
-test2l(done,N,ADestPE,BDestPE,TestAll) :- N > 0 |
-        proc(AVEXo,ATest)@node(ADestPE), 
-        proc(BVEXo,BTest)@node(BDestPE), 
-        suspend2(AVEXo,BVEXo), termDetect([ATest,BTest],Test), 
-        test2l(Test,~(N-1),ADestPE,BDestPE,TestAll). 
-test2l(done,N,_,_,TestAll) :- N = 0 | TestAll = done. 
-suspend2({AEXo},{BEXo}) :- multi2(AEXo,BEXo). 
-multi2({X},BEXo) :- X = ack, single(BEXo).
-multi2(AEXo,{X}) :- X = ack, single(AEXo).
-
-test6(NR,N,AD,BD,CD,DD,ED,FD,Test6All) :- 
-        nextNode(AD,ADestPE), nextNode(BD,BDestPE), nextNode(CD,CDestPE), 
-        nextNode(DD,DDestPE), nextNode(ED,EDestPE), nextNode(FD,FDestPE), 
-        genFP(ADestPE,Test6,ATerm), genFP(BDestPE,Test6,BTerm), 
-        genFP(CDestPE,Test6,CTerm), genFP(DDestPE,Test6,DTerm), 
-        genFP(EDestPE,Test6,ETerm), genFP(FDestPE,Test6,FTerm), 
-        termDetect([ATerm,BTerm,CTerm,DTerm,ETerm,FTerm],Test6All), 
-        test6(done,NR,N,ADestPE,BDestPE,CDestPE,
-                        DDestPE,EDestPE,FDestPE,Test6). 
-test6(done,NR,N,ADestPE,BDestPE,CDestPE,DDestPE,EDestPE,FDestPE,Test6) :- 
-                NR > 0, wait(ADestPE), wait(BDestPE), wait(CDestPE), 
-                        wait(DDestPE), wait(EDestPE), wait(FDestPE) | 
-        test6l(done,N,ADestPE,BDestPE,CDestPE,
-                      DDestPE,EDestPE,FDestPE,TestAll), 
-        test6(TestAll,~(NR-1),N,ADestPE,BDestPE,CDestPE,
-                            DDestPE,EDestPE,FDestPE,Test6). 
-test6(done,NR,_,_,_,_,_,_,_,Test6) :- NR = 0 | Test6 = done. 
-test6l(done,N,ADestPE,BDestPE,CDestPE,DDestPE,EDestPE,FDestPE,TestAll) :- 
-                N > 0 |
-        proc(AVEXo,ATest)@node(ADestPE), 
-        proc(BVEXo,BTest)@node(BDestPE), 
-        proc(CVEXo,CTest)@node(CDestPE), 
-        proc(DVEXo,DTest)@node(DDestPE), 
-        proc(EVEXo,ETest)@node(EDestPE), 
-        proc(FVEXo,FTest)@node(FDestPE), 
-        suspend6(AVEXo,BVEXo,CVEXo,DVEXo,EVEXo,FVEXo), 
-        termDetect([ATest,BTest,CTest,DTest,ETest,FTest],Test), 
-        test6l(Test,~(N-1),ADestPE,BDestPE,CDestPE,
-                           DDestPE,EDestPE,FDestPE,TestAll). 
-test6l(done,N,_,_,_,_,_,_,TestAll) :- N = 0 | TestAll = done. 
-
-suspend6({AEXo},{BEXo},{CEXo},{DEXo},{EEXo},{FEXo}) :- 
-        multi6(AEXo,BEXo,CEXo,DEXo,EEXo,FEXo). 
-multi6({X},BEXo,CEXo,DEXo,EEXo,FEXo) :- 
-        X = ack, single(BEXo), single(CEXo), 
-		 single(DEXo), single(EEXo), single(FEXo).
-multi6(AEXo,{X},CEXo,DEXo,EEXo,FEXo) :- 
-        X = ack, single(AEXo), single(CEXo), 
-		 single(DEXo), single(EEXo), single(FEXo).
-multi6(AEXo,BEXo,{X},DEXo,EEXo,FEXo) :- 
-        X = ack, single(AEXo), single(BEXo), 
-		 single(DEXo), single(EEXo), single(FEXo).
-multi6(AEXo,BEXo,CEXo,{X},EEXo,FEXo) :- 
-        X = ack, single(AEXo), single(BEXo), 
-		 single(CEXo), single(EEXo), single(FEXo).
-multi6(AEXo,BEXo,CEXo,DEXo,{X},FEXo) :- 
-        X = ack, single(AEXo), single(BEXo), 
-		 single(CEXo), single(DEXo), single(FEXo).
-multi6(AEXo,BEXo,CEXo,DEXo,EEXo,{X}) :- 
-        X = ack, single(AEXo), single(BEXo), 
-		 single(CEXo), single(DEXo), single(EEXo).
-
-%===========================================================================
-single({X}) :- X = ack. 
-
-proc(VEXo,Test) :- VEXo = {{X}}, waitACK(X,Test).
-waitACK(ack,Test) :- Test = done. 
-
-%===========================================================================
-termDetect([done|Es],Detect) :- termDetect(Es,Detect).
-termDetect([],Detect) :- Detect = done.
-otherwise.
-termDetect(_,Detect) :- Detect = fail.
-
-genFP(DestPE,Test,Term) :- wait(DestPE) | genFP(Test,Term)@node(DestPE). 
-genFP(done,Term) :- Term = done. 
-otherwise. 
-genFP(_,Term) :- Term = fail. 
-
-%---------------------------------------------------------------------------
-% [Node]
-%---------------------------------------------------------------------------
-nextNode(D,Node):- wait(D) | 
-	current_node(CurrentNode,NumberOfNodes), 
-	CalNode := CurrentNode + D, modNode(CalNode,NumberOfNodes,Node).  
-
-midNode(Node) :- current_node(_,NumberOfNodes), Node := NumberOfNodes/2.
-lastNode(Node) :- current_node(_,NumberOfNodes), Node := NumberOfNodes-1.
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
diff -ruN klic-3.003-2002-03-16/shmtest/nq13.kl1 klic-3.003-2002-03-19/shmtest/nq13.kl1
--- klic-3.003-2002-03-16/shmtest/nq13.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/nq13.kl1	Thu Jan  1 09:00:00 1970
@@ -1,61 +0,0 @@
-:- module main.
-
-main :- io:outstream(Os), N = 13,
-	current_node(Node,NNodes), 
-	generate(N,[],L), 
-        queen(1,0,_,NNodes,L,[],[],NRv),
-        merge(NRv,NRs), 
-	sumNR(NRs,0,NumberOfResults),
-        Os = [print(NumberOfResults),nl].
-
-sumNR([NR|NRs],WSum,Sum) :- wait(NR)|sumNR(NRs,~(WSum+NR),Sum).  
-sumNR([],WSum,Sum) :- WSum = Sum.  
-
-generate(N,T,L) :- N > 0 | T2=[N|T], generate(~(N-1),T2,L).
-generate(N,T,L) :- N =< 0 | L=T.
-
-append([A|X],Y,Z) :- Z=[A|Z1], append(X,Y,Z1).
-append([],   Y,Z) :- Z=Y.
-
-%-------------------------------------------------------------------------
-queen(CL,Num,Num3,NNodes,[P|U],C,L,NRv) :- 
-	append(U,C,N), NRv = {NRv1,NRv2}, 
-	c1(CL,Num,Num2,NNodes,P,1,N,L,L,NRv1), 
-	queen(CL,Num2,Num3,NNodes,U,[P|C],L,NRv2).	 
-queen(_,Num,Num3,_,[],[_|_],_,NRv) :- Num = Num3, NRv = [].  
-
-c1(CL,Num,Num2,NNodes,T,D,N,[P|R],B,NRv) :- T=\= P+D, T=\=P-D, D1:=D+1 | 
-	c1(CL,Num,Num2,NNodes,T,D1,N,R,B,NRv).
-c1(CL,Num,Num2,NNodes,T,D,N,[P|_],B,NRv) :- T=:=P+D | 
-	NRv = [], Num = Num2.  
-c1(CL,Num,Num2,NNodes,T,D,N,[P|_],B,NRv) :- T=:=P-D | 
-	NRv = [], Num = Num2.  
-c1(CL,Num,Num2,NNodes,T,D,N,[],   B,NRv) :- CL =\= 2 | 
-	queen(~(CL+1),Num,Num2,NNodes,N,[],[T|B],NRv).  
-c1(CL,Num,Num2,NNodes,T,D,N,[],   B,NRv) :- CL =:= 2 | 
-	Num2 := Num + 1, Node := Num mod NNodes, 
-	queen_dist(N,[],[T|B],NRv,Node).  
-
-%-------------------------------------------------------------------------
-queen_dist(PU,C,L,NRv,Node) :- Node =\= 0 | 
-	queen_dist(PU,C,L,NRv)@node(Node).  
-queen_dist(PU,C,L,NRv,Node) :- Node =:= 0 | 
-	queen_dist(PU,C,L,NRv)@lower_priority.  
-
-%-------------------------------------------------------------------------
-queen_dist(PU,C,L,NRv) :- 
-	queen(PU,C,L,Rs,[]), count(Rs,0,NR), NRv = [NR].  
-
-count([_|Rs],WNR,NR) :- count(Rs,~(WNR+1),NR).  
-count([],WNR,NR) :- WNR = NR.  
-
-queen([P|U],C,L,I,O) :- 
-	append(U,C,N), c1(P,1,N,L,L,I,X), queen(U,[P|C],L,X,O).	 
-queen([],[_|_],_,I,O) :- I=O.  
-queen([],[],   L,I,O) :- I=[L|O].  
-
-c1(T,D,N,[P|R],B,I,O) :- T=\= P+D, T=\=P-D, D1:=D+1 | 
-	c1(T,D1,N,R,B,I,O).
-c1(T,D,N,[P|_],B,I,O) :- T=:=P+D | I=O.  
-c1(T,D,N,[P|_],B,I,O) :- T=:=P-D | I=O.  
-c1(T,D,N,[],   B,I,O) :- queen(N,[],[T|B],I,O).  
diff -ruN klic-3.003-2002-03-16/shmtest/nqueen.kl1 klic-3.003-2002-03-19/shmtest/nqueen.kl1
--- klic-3.003-2002-03-16/shmtest/nqueen.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/nqueen.kl1	Thu Jan  1 09:00:00 1970
@@ -1,62 +0,0 @@
-:- module main.
-
-main :- unix:argv(ISL), rlib:isltoi(ISL,N), 
-	current_node(Node,NNodes), 
-	generate(N,[],L), queen(1,1,_,NNodes,L,[],[],NRv), merge(NRv,NRs), 
-	sumNR(NRs,0,NumberOfResults), stop_measure(NumberOfResults).  
-
-stop_measure(NumberOfResults) :- wait(NumberOfResults) | 
-	klicio:klicio([stdout(normal([putt(NumberOfResults),nl]))]).
-
-sumNR([NR|NRs],WSum,Sum) :- wait(NR)|sumNR(NRs,~(WSum+NR),Sum).  
-sumNR([],WSum,Sum) :- WSum = Sum.  
-
-generate(N,T,L) :- N > 0 | T2=[N|T], generate(~(N-1),T2,L).
-generate(N,T,L) :- N =< 0 | L=T.
-
-append([A|X],Y,Z) :- Z=[A|Z1], append(X,Y,Z1).
-append([],   Y,Z) :- Z=Y.
-
-%-------------------------------------------------------------------------
-queen(CL,Num,Num3,NNodes,[P|U],C,L,NRv) :- 
-	append(U,C,N), NRv = {NRv1,NRv2}, 
-	c1(CL,Num,Num2,NNodes,P,1,N,L,L,NRv1), 
-	queen(CL,Num2,Num3,NNodes,U,[P|C],L,NRv2).	 
-queen(_,Num,Num3,_,[],[_|_],_,NRv) :- Num = Num3, NRv = [].  
-
-c1(CL,Num,Num2,NNodes,T,D,N,[P|R],B,NRv) :- T=\= P+D, T=\=P-D, D1:=D+1 | 
-	c1(CL,Num,Num2,NNodes,T,D1,N,R,B,NRv).
-c1(CL,Num,Num2,NNodes,T,D,N,[P|_],B,NRv) :- T=:=P+D | 
-	NRv = [], Num = Num2.  
-c1(CL,Num,Num2,NNodes,T,D,N,[P|_],B,NRv) :- T=:=P-D | 
-	NRv = [], Num = Num2.  
-c1(CL,Num,Num2,NNodes,T,D,N,[],   B,NRv) :- CL =\= 2 | 
-	queen(~(CL+1),Num,Num2,NNodes,N,[],[T|B],NRv).  
-c1(CL,Num,Num2,NNodes,T,D,N,[],   B,NRv) :- CL =:= 2 | 
-	Num2 := Num + 1, Node := Num mod NNodes, 
-	queen_dist(N,[],[T|B],NRv,Node).  
-
-%-------------------------------------------------------------------------
-queen_dist(PU,C,L,NRv,Node) :- Node =\= 0 | 
-	queen_dist(PU,C,L,NRv)@node(Node).  
-queen_dist(PU,C,L,NRv,Node) :- Node =:= 0 | 
-	queen_dist(PU,C,L,NRv)@lower_priority.  
-
-%-------------------------------------------------------------------------
-queen_dist(PU,C,L,NRv) :- 
-	queen(PU,C,L,Rs,[]), count(Rs,0,NR), NRv = [NR].  
-
-count([_|Rs],WNR,NR) :- count(Rs,~(WNR+1),NR).  
-count([],WNR,NR) :- WNR = NR.  
-
-queen([P|U],C,L,I,O) :- 
-	append(U,C,N), c1(P,1,N,L,L,I,X), queen(U,[P|C],L,X,O).	 
-queen([],[_|_],_,I,O) :- I=O.  
-queen([],[],   L,I,O) :- I=[L|O].  
-
-c1(T,D,N,[P|R],B,I,O) :- T=\= P+D, T=\=P-D, D1:=D+1 | 
-	c1(T,D1,N,R,B,I,O).
-c1(T,D,N,[P|_],B,I,O) :- T=:=P+D | I=O.  
-c1(T,D,N,[P|_],B,I,O) :- T=:=P-D | I=O.  
-c1(T,D,N,[],   B,I,O) :- queen(N,[],[T|B],I,O).  
-
diff -ruN klic-3.003-2002-03-16/shmtest/read.kl1 klic-3.003-2002-03-19/shmtest/read.kl1
--- klic-3.003-2002-03-16/shmtest/read.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/read.kl1	Thu Jan  1 09:00:00 1970
@@ -1,34 +0,0 @@
-% % read -dp2 N<CR>
-
-%  PEi <--- %read    ---  PEj   (1)
-%  PEi  --- %answer  ---> PEj   (1)
-%  PEi <--- %release ---  PEj   (1)
-%  PEi <--- %unify   ---  PEj   (1)
-
-%  PEi <--- %read    ---  PEj   (2)
-%  PEi  --- %answer  ---> PEj   (2)
-%  PEi <--- %release ---  PEj   (2)
-%  PEi <--- %unify   ---  PEj   (2)
-
-%		:
-
-%  PEi <--- %read    ---  PEj   (N)
-%  PEi  --- %answer  ---> PEj   (N)
-%  PEi <--- %release ---  PEj   (N)
-%  PEi <--- %unify   ---  PEj   (N)
-
-%  PEi <--- %read    ---  PEj   (N+1)
-%  PEi  --- %answer  ---> PEj   (N+1)
-%  PEi <--- %release ---  PEj   (N+1)
-
-:- module main. 
-
-main:- unix:argv(ISL), rlib:isltoi(ISL,N), 
-	current_node(Current,Number), Node:=(Current+1) mod Number, 
-	gen(N,ack,As), con(As)@node(Node). 
-
-gen(N,ack,As):- N > 0 | As=[Ack|As2], gen(~(N-1),Ack,As2). 
-gen(N,ack,As):- N=:=0 | As=[]. 
-
-con([Ack|As]):- Ack=ack, con(As). 
-con([]). 
diff -ruN klic-3.003-2002-03-16/shmtest/report.perl klic-3.003-2002-03-19/shmtest/report.perl
--- klic-3.003-2002-03-16/shmtest/report.perl	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/report.perl	Thu Jan  1 09:00:00 1970
@@ -1,31 +0,0 @@
-#! /usr/local/bin/perl
-# This program summalize the output of test programs.
-# If you want to summalize all test and measurement programs,
-# do the following commands.
-# make all >& log; perl report.perl log
-#
-
-printf("%-39s\t%6s\t%6s\t%-5s\n",
-       "Program", "Ref", "Mesured", "Ratio");
-
-while (<>) {
-    if (/^Reference time is (\d+) / || /^(error)/) {
-	$ref = $1;
-	chop($cmd = <>);
-	$cmd =~	s/\s*[\>\|\&].*//;
-	$cmd =~ s/\s+/ /g;
-    }
-    if (/^Response time is (\d+) msec/) {
-	$res = $1;
-	if ($ref eq "error") {
-	    $ref = " error";
-	    $rat = "  ---";
-	} else {
-	    $ref = sprintf("%6d", $ref);
-	    $rat = sprintf("%5.2f", $ref/$res);
-	}
-	$res = sprintf("%6d", $res);
-	printf("%-39s\t%s\t%6d\t%s\n",
-	       $cmd, $ref, $res, $rat);
-    }
-}
diff -ruN klic-3.003-2002-03-16/shmtest/rlib.kl1 klic-3.003-2002-03-19/shmtest/rlib.kl1
--- klic-3.003-2002-03-16/shmtest/rlib.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/rlib.kl1	Thu Jan  1 09:00:00 1970
@@ -1,6 +0,0 @@
-:- module rlib. 
-
-isltoi([Str|_],Int):- string(Str,Len,_) | istoi(0,Len,Str,0,Int). 
-istoi(N,Len,Str,WInt,Int):- N < Len, string_element(Str,N,C), 48=<C, C=<57 | 
-	istoi(~(N+1),Len,Str,~(WInt*10+C-48),Int). 
-istoi(N,Len,_,WInt,Int):- N =:= Len | WInt=Int. 
diff -ruN klic-3.003-2002-03-16/shmtest/slife.kl1 klic-3.003-2002-03-19/shmtest/slife.kl1
--- klic-3.003-2002-03-16/shmtest/slife.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/slife.kl1	Thu Jan  1 09:00:00 1970
@@ -1,196 +0,0 @@
-% icpsi538::>sys>user>imai>KL1>life.kl1.7, 20-Dec-91 12:19:59, Edit by imai
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mesh64m.ghc 				1987.09.22. GOTO
-%	The counterfeit of LIFE game
-%
-%     General Notes:
-%	The original life game uses eight-neighbours, however, this program
-%	uses only four-neighbours (north, south, east, west).
-%	This test program has following features.
-%	(1) Two dimensional "cell" processes are generated.
-%		- The cell process has two directional streams
-%		  with four neighbours.
-%		- The cell process is linked as a "torus".
-%	(2) The cell process has its own state, which is updated using its
-%	     "current" states of four neighbours'.
-%		- Note that there is no world clock.
-%		- This program has much locality in the stream communication.
-%		- However, this program does not suit for depth-first
-%		  execution.
-%		- As the result, there may occur many suspensions.
-%	(3) The parameters related to the program size can be given by the
-%	     initial states and the state transition function of cells.
-
-%%%%%%%%%%
-% life(G,X,Y,DivX,DivY,R) 
-%	G    : the number of Max life cycles
-%	X    : number of life node for X
-%	Y    : number of life node for Y
-%		(initial state is computed by combination of X and Y)
-%	DivX : Cluster Division for X
-%	DivY : Cluster Division for Y
-%	R    : the result list
-%
-% for Example
-%  +-------------+  X=31, Y=15, DivX=2, DivY=3
-%  |14    |      |
-%  |10    |      |  The number of computing node (cluster) is determined by
-%  |------+------|  number of clusters currently available.
-%  |9     |      |
-%  |5     |      |  In this case, if we have
-%  |------+------|            +---+           +---+           +---+
-%  |4     |      |  3clusters |1|2| 6clusters |4|5| 4clusters |0|1|
-%  |0   14|15  31|            |-+-|           |-+-|           |-+-|
-%  +-------------+            |2|0|           |2|3|           |2|3|
-%                             |-+-|           |-+-|           |-+-|
-%                             |0|1|           |0|1|           |0|1|
-%                             +---+           +---+           +---+
-%                   However even if we have 12 clusters, the mapping is exactly
-%                   same as the case of 6 clusters!!
-:- module main.
-
-main :-	go(N), klicio:klicio([stdout(normal([putt(N),nl]))]).
-
-go(N) :- life(120,16,16,4,4,L), count_1(L,N).
-
-display(A) :- display_console(A) | true.
-
-count_1([SubL|L],N) :- true |
-	count_sub(SubL,0,SubN), count_1(L,N2), N := SubN + N2.
-count_1([],N) :- true | N=0.
-
-count_sub([1|L],N,NFinal) :- true | count_sub(L,~(N+1),NFinal).
-count_sub([0|L],N,NFinal) :- true | count_sub(L,     N,NFinal).
-count_sub([],   N,NFinal) :- true | NFinal = N.
-
-life(G,X,Y,DivX,DivY,R) :- true |
-	init(X,Y,X,Y,Sinit),
-	Config = kumon(X,Y,DivX,DivY),
-	make_row(X,Y,Config,G,Sinit,NS1,NS1,NS2,NS2,R,[]).
-
-%%%%%%%%%%%%%
-% initialize table (by A.Imai)
-%	randomly (not a better function, actually) generate initial table
-%%%%%%%%%%%%%
-
-init(X,Y,TX,TY,List) :- X > 0 |
-	init_col(X,Y,TX,TY,ColL,X),
-	List = [ColL|List1],
-	init(~(X-1),Y,TX,TY,List1).
-init(0,Y,TX,TY,List) :- true | List = [].
-
-init_col(X,Y,TX,TY,List,PrevNum) :- Y > 0 |
-	rand_0_or_1(X,Y,PrevNum,Rand,NewNum),
-	List = [Rand|List1],
-	init_col(X,~(Y-1),TX,TY,List1,NewNum).
-init_col(X,0,TX,TY,List,_) :- true | List = [].
-
-rand_0_or_1(X,Y,PrevNum,Rand,NewNum) :-
-    integer(X), integer(Y), integer(PrevNum) |
-	NewNum := ( PrevNum >> 3 ) + ( X << 2 ) + ( Y >> 2 ),
-	Rand := NewNum mod 2.
-
-%%%%%%%%%%
-% make_row(G,Init,Ns1,Sn1,Ns2,Sn2,Rh,Rt)
-%	G  : the number of Max life cycles
-%	Init : The initial state list
-%		[I_col1,I_col2,....,I_coln]
-%	Ns1,Sn1 : North/south stream
-%	Ns2,Sn2 : North/south stream
-%	Rh,Rt : The result list
-
-make_row(X,Y,Config,G,[I_col|Is],Ns1,Sn1,Ns2,Sn2,Rh,Rt) :- true |
-	Rh=[C|Rhs],
-	compute_node(X,Y,Config,Node),
-	make_col(     X,Y,Config,G,I_col,Ns1,S1 ,Ns2,S2 ,EW1,EW1,EW2,EW2,C  ,[])@node(Node),
-%	make_col(     X,Y,Config,G,I_col,Ns1,S1 ,Ns2,S2 ,EW1,EW1,EW2,EW2,C  ,[]),
-	make_row(~(X-1),Y,Config,G,Is   ,S1 ,Sn1,S2 ,Sn2                ,Rhs,Rt).
-
-make_row(X,Y,Config,G,[]        ,Ns1,Sn1,Ns2,Sn2,Rh,Rt) :- true |
-	Rh = Rt,
-	Sn1=[S1|Ssn1], Sn2=[S2|Ssn2],
-	connect_row(Ns1,Ssn1,Ns2,Ssn2,S1,S2).
-
-%%%%%%%%%%
-% connect_row(Ns1,Sn1,Ns2,Sn2,S1,S2)
-%	Ns1,Sn1,Ns2,Sn2 : North/south stream for make_col
-%	S1,S2 : North/south stream for cells
-
-connect_row([N1|Ns1],Sn1,[N2|Ns2],Sn2,S1,S2) :- true |
-	N1 = S1, N2 = S2, Sn1=[Ss1|Ssn1], Sn2=[Ss2|Ssn2],
-	connect_row(Ns1,Ssn1,Ns2,Ssn2,Ss1,Ss2).
-
-connect_row([]      ,_  ,[]      ,_  ,_ ,_ ) :- true | true.
-
-%%%%%%%%%%
-% make_col(G,I_col,Ns1,Sn1,Ns2,Sn2,Ew1,We1,Ew2,We2,Ch,Ct)
-%	G  : the number of Max life cycles
-%	I_col : the initial state list for colomn
-%	Ns1,Sn1: north/south stream
-%	Ns2,Sn2: north/south stream
-%	Ew1,We1: east/west stream
-%	Ew2,We2: east/west stream
-%	Ch,Ct: The result list for colomn
-
-make_col(X,Y,Config,G,[I|Is],[N1|Ns1],Sn1,[N2|Ns2],Sn2,Ew1,We1,Ew2,We2,Ch,Ct) :-
-    Config=kumon(TX,TY,DivX,DivY) |
-	Ch=[R|Chs],
-	Sn1=[S1|Ssn1], Sn2=[S2|Ssn2],
-	compute_node(X,Y,Config,Node),
-	cell(I,N1,S1,N2,S2,Ew1,WE1,Ew2,WE2,R,G)@node(Node),
-%	cell(I,N1,S1,N2,S2,Ew1,WE1,Ew2,WE2,R,G),
-	make_col(X,~(Y-1),Config,G,Is,Ns1,Ssn1,Ns2,Ssn2,WE1,We1,WE2,We2,Chs,Ct).
-
-make_col(X,Y,Config,G,[]    ,_       ,Sn1,_       ,Sn2,Ew1,We1,Ew2,We2,Ch,Ct) :-
-    true |
-	Ch = Ct, Ew1 = We1, Ew2 = We2, Sn1=[], Sn2=[].
-
-compute_node(X,Y,kumon(TX,TY,DivX,DivY),Node) :- true |
-	current_node(_,TotalNode),
-	Node := ((X/(TX/DivX)) + ((Y/(TY/DivY))*DivX)) mod TotalNode.
-%	Node = 0.
-
-%%%%%%%%%%%
-% cell --> cell1
-
-cell(I,N1,S1,N2,S2,E1,W1,E2,W2,R,G) :- true |
-	N2=[I|On], S1=[I|Os], W2=[I|Ow], E1=[I|Oe],
-	cell1(I,N1,S2,W1,E2,On,Os,Ow,Oe,R,G).
-
-% cell1(X,Ni,Si,Ei,Wi,On,Os,Ow,Oe,R,G)
-%	X  : the state of cell
-%	Ni : the state of the north neighbor cell
-%	Si : the state of the south neighbor cell
-%	Ei : the state of the east neighbor cell
-%	Wi : the state of the west neighbor cell
-%	On,Os,Ow,Oe  : Output stream of internal state to four neighbours
-%	R  : The result output stream head
-%	G  : the number of life cycle (Generation)
-
-cell1(X,[N|Ni],[S|Si],[E|Ei],[W|Wi],On,Os,Ow,Oe,R,G) :- G > 0, G1:=G-1,
-    T1:=S+N, T2:=E+W, T:=T1+T2 | 
-	change(X,T,Y),
-	On=[Y|On1], Os=[Y|Os1], Ow=[Y|Ow1], Oe=[Y|Oe1],
-	cell1(Y,Ni,Si,Ei,Wi,On1,Os1,Ow1,Oe1,R,G1).
-
-cell1(X,_     ,_     ,_     ,_     ,On,Os,Ow,Oe,R,0) :- true |
-	On=[],Os=[],Ow=[],Oe=[],R = X.
-
-%%%%%%%%%%%
-% change(X,T,Y) : The state transition function.
-%		  The following function works as a kind of "differntial
-%		  (Kyoukai-sen chuushutsu)" in the two dimensional pattern
-%		  processing.
-%		  Other function can be given easily.
-%	Y <- f(X,T)
-
-change(0,0,Y) :- true | Y = 1.
-change(0,1,Y) :- true | Y = 0.
-change(0,2,Y) :- true | Y = 1.
-change(0,3,Y) :- true | Y = 0.
-change(0,4,Y) :- true | Y = 1.
-change(1,0,Y) :- true | Y = 0.
-change(1,1,Y) :- true | Y = 1.
-change(1,2,Y) :- true | Y = 0.
-change(1,3,Y) :- true | Y = 1.
-change(1,4,Y) :- true | Y = 0.
diff -ruN klic-3.003-2002-03-16/shmtest/stat.perl klic-3.003-2002-03-19/shmtest/stat.perl
--- klic-3.003-2002-03-16/shmtest/stat.perl	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/stat.perl	Thu Jan  1 09:00:00 1970
@@ -1,20 +0,0 @@
-push(@INC, "/home/kumon/perl.src");
-require 'statistics.pl';
-while (<>) {
-    if (/^\./) {
-#	s/^\.\//\$(CMD)/;
-#	s/-e -S -I10000/\$(RUNOPT)/;
-	chop($file = $_);
-	$on = 1;
-    } elsif (/^Response time is (\d+) msec/ && $on) {
-	$on = 0;
-	$total{$file}.= "$1:";
-    }
-}
-foreach (sort (keys %total)) {
-    @a = split(':', $total{$_});
-    ($ave, $std) = &statistics'ave_std(*a); #';
-        ($min, $max) = &statistics'min_max(*a); #';
-#    printf "%-40s%7d%s%5d %6.2f <%6.2f\n", $_, $ave, '+-', $std, $min/1000, $max/1000;
-    printf "\t@echo Reference time is %d+-%d msec\n\t%s\n", $ave, $std, $_;
-}
diff -ruN klic-3.003-2002-03-16/shmtest/statistics.pl klic-3.003-2002-03-19/shmtest/statistics.pl
--- klic-3.003-2002-03-16/shmtest/statistics.pl	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/statistics.pl	Thu Jan  1 09:00:00 1970
@@ -1,88 +0,0 @@
-package statistics;
-# Copyright 1993, 1994, 1995 Kouichi Kumon. kumon@icot.or.jp
-# perl$B$G=q$$$?E}7WMQ%Q%C%1!<%8$G$9!#(B
-# 1$B0z?tMQ$N$b$N$H(B2$B0z?tMQ$N$b$N$rMQ0U$7$^$7$?!#(B
-# $B8F$S=P$9;~$K$O!"$^$:85%G!<%?$rG[Ns$KF~$l!"$=$NG[Ns$r;2>H$H$7$F(B
-# $B%5%V%k!<%A%s$K0z$-EO$7$^$9!#(B
-# $B7k2L$OG[Ns$G5"$C$F$-$^$9$,!"$=$NCM$O0J2<$K<($9$h$&$J$b$N$K$J$C$F$$$^$9!#(B
-# $B$b$7!"%(%i!<$,5/$3$C$?;~$K$O7k2L$H$7$F(Bundef$B$,JV$k!#(B
-# $B$3$N>l9g$N%A%'%C%/J}K!$H$7$F!"Nc$($P<!$N$h$&$K$9$k!#(B
-# ($ave,$ste)=&ave_std(*x);
-# if (!defined($ave)) { error...; }
-#
-# $BDj5A$5$l$?4X?t$O0J2<$NDL$j!#(B
-# usage statistics'min_max(*x) = ($min, $max);
-# usage statistics'ave_std(*x) = ($ave, $std);
-# usage statistics'ave_std2(*x, *y)=
-#                        ($ave_x, $ave_y, $std_x, $std_y, $correlation);
-# $B2s5"D>@~$O<!$N<0$K$J$k!#(B
-# (y-ave_y)/std_y = (x-ave_x)/std_x * correlation;
-# y = (x-ave_x)/std_x*std_y*correlation+ave_y;
-# y = x/std_x*std_y*correlation + ave_y - ave_x/std_x*std_y*correlation;
-# $B$3$N2s5"<0$H85%G!<%?$H$N8m:9$NI8=`JP:9$O(B
-# std_y * sqrt(1-correlation^2)$B$GI=$5$l$k!#(B
-#
-# $B$3$N7W;;$ONI$/9T$J$&$?$a!"(B
-#$B%i%$%V%i%j$rMQ0U$7$?!#(B
-# usage statistics'regression(statistics'ave_std2(*x, *y))=
-#			(x_coef, y_const, y_err)
-sub regression {
-    ($ave_x, $ave_y, $std_x, $std_y, $correlation) = @_;
-    local($x_coef, $y_const, $y_err);
-    $x_coef = $std_y/$std_x*$correlation;
-    $y_const= $ave_y - $ave_x/$std_x*$std_y*$correlation;
-    $y_err  = $std_y * sqrt(1-$correlation*$correlation);
-    return ($x_coef, $y_const, $y_err);
-}
-    
-
-sub ave_std2 {
-    local(*x, *y)=@_;
-    local($sumx, $sumy, $sumxy, $sumx2, $sumy2);
-    local($avex, $avey, $avexy, $avex2, $avey2);
-    local($i);
-    if (@x != @y || @x == 0) {
-	warn "x(".scalar(@x).") and y(".scalar(@y).
-	    ") have different number of items or no item\n";
-	return undef;
-    }
-    foreach (@x) { $sumx += $_; }
-    foreach (@y) { $sumy += $_; }
-    $avex = $sumx/@x;
-    $avey = $sumy/@y;
-    for ($i = 0; $i < @x; $i++) {
-	$sumx2 += ($x[$i]-$avex)*($x[$i]-$avex);
-	$sumy2 += ($y[$i]-$avey)*($y[$i]-$avey);
-	$sumxy += ($x[$i]-$avex)*($y[$i]-$avey);
-    }
-    return ($avex, $avey, sqrt($sumx2/@x), sqrt($sumy2/@y),
-	    $sumxy/sqrt($sumx2*$sumy2));
-}
-sub ave_std {
-    local(*x)=@_;
-    local($sum, $sum2, $ave, $std);
-    if (@x < 1) {
-	warn "number of elements too few(".scalar(@x).")\n";
-	return undef;
-    }
-    foreach (@x) {
-	$sum += $_;
-    }
-    $ave = $sum/@x;
-    foreach (@x) {
-	$sum2 += ($_-$ave)*($_-$ave);
-    }
-    $std = sqrt($sum2/@x);
-    return ($ave, $std);
-}
-sub min_max {
-    local(*x)=@_;
-    return undef if (@x == 0);
-    local($min, $max)=($x[0], $x[0]);
-    foreach (@x) {
-	$min = $_ if ($min > $_);
-	$max = $_ if ($max < $_);
-    }
-    return ($min, $max);
-}
-1;
diff -ruN klic-3.003-2002-03-16/shmtest/t0thr1.kl1 klic-3.003-2002-03-19/shmtest/t0thr1.kl1
--- klic-3.003-2002-03-16/shmtest/t0thr1.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/t0thr1.kl1	Thu Jan  1 09:00:00 1970
@@ -1,284 +0,0 @@
-% test for "%throw_goal" and "%read" messages
-%
-% number of arguments : 0, 1, 2, ...
-%   a: throw_goal -- no argument
-%   b: throw_goal(1)
-%   c: throw_goal(1,2)
-%   d: throw_goal(1,2,3,4,5,6)
-%   e: throw_goal(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0)
-%
-% arguments are atoms, nils, integers, or functors.  
-%   a: throw_goal(atom)
-%   b: throw_goal([])
-%   c: throw_goal(1234)
-%   d: throw_goal(atom,1234)
-%   e: throw_goal(1234,atom,[])
-%   f: throw_goal(f(a),g(b),h(c))
-%   g: throw_goal(g(1,2,3,4,5))
-%
-% arguments are vectors or lists whose elements are not variables.  
-%   a: throw_goal({})
-%   b: throw_goal({a})
-%   c: throw_goal({1,2,3})
-%   d: throw_goal({1,a,[],2,b})
-%   e: throw_goal({{}})
-%   f: throw_goal({a,{b,c,{d,e,f}}})
-%   g: throw_goal({{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1})
-%   h: throw_goal([a,b,c])
-%   i: throw_goal([a,[b,[c,[d,[e]]]]])
-%   j: throw_goal([1,[2,3,[4,5,6],7,8],9])
-%   k: throw_goal([xyz,a(x),b(y,z)])
-%   l: throw_goal([{a},{b,c},{d,e,f}])
-%   m: throw_goal([a,{b,[c,d],e},{[f,g,h],i,j},k])
-%   n: throw_goal(f(3,{0,[a,b],[[a(1),b(1)]],[[c,d,e],[1,2,f(5)],[]})))
-
-%===========================================================================
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [%throw_goal, %read] Begin ###',Done), 
-	args(Os2,Done). 
-
-%===========================================================================
-args(Os,done):- 
-	lib:prs(Os,Os2,'Test for throw_goal args (a-e) : ',Done), 
-	args_a(Os2,Done).
-
-%%%% a: throw_goal -- no argument
-args_a(Os,done):- nextnode(Node), args_a_exe(Os,Node).
-args_a_exe(Os,Node):- wait(Node) | args_a_ck1(Os)@node(Node).
-args_a_ck1(Os):- lib:prs(Os,Os2,a,Done), args_b(Os2,Done). 
-
-%%%% b: throw_goal(1)
-args_b(Os,done) :- args_b_exe(Os,1).
-args_b_exe(Os,A):- nextnode(Node), args_b_exe(Os,A,Node).
-args_b_exe(Os,A,Node):- wait(Node) | args_b_ck1(Os,A)@node(Node).
-args_b_ck1(Os,1):- lib:prs(Os,Os2,b,Done), args_c(Os2,Done).
-otherwise.
-args_b_ck1(Os,_):- lib:prs_err(Os,Os2,b,Done), args_c(Os2,Done).
-
-%%%% c: throw_goal(1,2)
-args_c(Os,done):- args_c_exe(Os,1,2).
-args_c_exe(Os,A,B):- nextnode(Node), args_c_exe(Os,A,B,Node).
-args_c_exe(Os,A,B,Node):- wait(Node) | args_c_ck1(Os,A,B)@node(Node).
-args_c_ck1(Os,1,2):- lib:prs(Os,Os2,c,Done), args_d(Os2,Done).
-otherwise.
-args_c_ck1(Os,_,_):- lib:prs_err(Os,Os2,c,Done), args_d(Os2,Done).
-
-%%%% d: throw_goal(1,2,3,4,5,6)
-args_d(Os,done):- args_d_exe(Os,1,2,3,4,5,6).
-args_d_exe(Os,A,B,C,D,E,F):- nextnode(Node), args_d_exe(Os,A,B,C,D,E,F,Node).
-args_d_exe(Os,A,B,C,D,E,F,Node):- wait(Node) | args_d_ck1(Os,A,B,C,D,E,F)@node(Node).
-args_d_ck1(Os,1,2,3,4,5,6):- lib:prs(Os,Os2,d,Done), args_e(Os2,Done).
-otherwise.
-args_d_ck1(Os,_,_,_,_,_,_):- 
-	lib:prs_err(Os,Os2,d,Done), args_e(Os2,Done).
-
-%%%% e: throw_goal(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0)
-args_e(Os,done):- args_e_exe(Os,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0).
-args_e_exe(Os,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T):- 
-	nextnode(Node), 
-	args_e_exe(Os,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,Node).
-args_e_exe(Os,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,Node):- wait(Node) | 
-	args_e_ck1(Os,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)@node(Node).
-args_e_ck1(Os,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0):- 
-	lib:prs(Os,Os2,e,Done), args_end(Os2,Done).
-otherwise.
-args_e_ck1(Os,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_):- 
-	lib:prs_err(Os,Os2,e,Done), args_end(Os2,Done).
-
-args_end(Os,done):- lib:prsl(Os,Os2,'...done',Done), aifn(Os2,Done).
-
-%===========================================================================
-aifn(Os,done):- 
-	lib:prs(Os,Os2,'Test for throw_goal atom/int/func/nil (a-g) : ',Done),
-	aifn_a(Os2,Done).
-
-%%%% a: throw_goal(atom)
-aifn_a(Os,done):- aifn_a_exe(Os,atom).
-aifn_a_exe(Os,A):- nextnode(Node), aifn_a_exe(Os,A,Node).
-aifn_a_exe(Os,A,Node):- wait(Node) | aifn_a_ck1(Os,A)@node(Node).
-aifn_a_ck1(Os,atom):- lib:prs(Os,Os2,a,Done), aifn_b(Os2,Done).
-otherwise.
-aifn_a_ck1(Os,_):- lib:prs_err(Os,Os2,a,Done), aifn_b(Os2,Done).
-
-%%%% b: throw_goal([])
-aifn_b(Os,done):- aifn_b_exe(Os,[]).
-aifn_b_exe(Os,A):- nextnode(Node), aifn_b_exe(Os,A,Node).
-aifn_b_exe(Os,A,Node):- wait(Node) | aifn_b_ck1(Os,A)@node(Node).
-aifn_b_ck1(Os,[]):- lib:prs(Os,Os2,b,Done), aifn_c(Os2,Done).
-otherwise.
-aifn_b_ck1(Os,_):- lib:prs_err(Os,Os2,b,Done), aifn_c(Os2,Done).
-
-%%%% c: throw_goal(1234)
-aifn_c(Os,done):- aifn_c_exe(Os,1234).
-aifn_c_exe(Os,A):- nextnode(Node), aifn_c_exe(Os,A,Node).
-aifn_c_exe(Os,A,Node):- wait(Node) | aifn_c_ck1(Os,A)@node(Node).
-aifn_c_ck1(Os,1234):- lib:prs(Os,Os2,c,Done), aifn_d(Os2,Done).
-otherwise.
-aifn_c_ck1(Os,_):- lib:prs_err(Os,Os2,c,Done), aifn_d(Os2,Done).
-
-%%%% d: throw_goal(atom,1234)
-aifn_d(Os,done):- aifn_d_exe(Os,atom,1234).
-aifn_d_exe(Os,A,B):- nextnode(Node), aifn_d_exe(Os,A,B,Node).
-aifn_d_exe(Os,A,B,Node):- wait(Node) | aifn_d_ck1(Os,A,B)@node(Node).
-aifn_d_ck1(Os,atom,1234):- lib:prs(Os,Os2,d,Done), aifn_e(Os2,Done).
-otherwise.
-aifn_d_ck1(Os,_,_):- lib:prs_err(Os,Os2,d,Done), aifn_e(Os2,Done).
-
-%%%% e: throw_goal(1234,atom,[])
-aifn_e(Os,done):- aifn_e_exe(Os,1234,atom,[]).
-aifn_e_exe(Os,A,B,C):- nextnode(Node), aifn_e_exe(Os,A,B,C,Node).
-aifn_e_exe(Os,A,B,C,Node):- wait(Node) | aifn_e_ck1(Os,A,B,C)@node(Node).
-aifn_e_ck1(Os,1234,atom,[]):- lib:prs(Os,Os2,e,Done), aifn_f(Os2,Done).
-otherwise.
-aifn_e_ck1(Os,_,_,_):- lib:prs_err(Os,Os2,e,Done), aifn_f(Os2,Done).
-
-%%%% f: throw_goal(f(a),g(b),h(c))
-aifn_f(Os,done):- aifn_f_exe(Os,f(a),g(b),h(c)).
-aifn_f_exe(Os,A,B,C):- nextnode(Node), aifn_f_exe(Os,A,B,C,Node).
-aifn_f_exe(Os,A,B,C,Node):- wait(Node) | aifn_f_ck1(Os,A,B,C)@node(Node).
-aifn_f_ck1(Os,f(a),g(b),h(c)):- lib:prs(Os,Os2,f,Done), aifn_g(Os2,Done).
-otherwise.
-aifn_f_ck1(Os,_,_,_):- lib:prs_err(Os,Os2,f,Done), aifn_g(Os2,Done).
-
-%%%% g: throw_goal(g(1,2,3,4,5))
-aifn_g(Os,done):- aifn_g_exe(Os,g(1,2,3,4,5)).
-aifn_g_exe(Os,A):- nextnode(Node), aifn_g_exe(Os,A,Node).
-aifn_g_exe(Os,A,Node):- wait(Node) | aifn_g_ck1(Os,A)@node(Node).
-aifn_g_ck1(Os,g(1,2,3,4,5)):- lib:prs(Os,Os2,g,Done), aifn_end(Os2,Done).
-otherwise.
-aifn_g_ck1(Os,_):- lib:prs_err(Os,Os2,g,Done), aifn_end(Os2,Done).
-
-aifn_end(Os,done):- lib:prsl(Os,Os2,'...done',Done), vlarg(Os2,Done).
-
-%===========================================================================
-vlarg(Os,done):- 
-	lib:prs(Os,Os2,'Test for throw_goal vector/list (a-n) : ',Done), 
-	vlarg_a(Os2,Done).
-
-%%%% a: throw_goal({})
-vlarg_a(Os,done):- vlarg_a_exe(Os,{}).
-vlarg_a_exe(Os,A):- nextnode(Node), vlarg_a_exe(Os,A,Node).
-vlarg_a_exe(Os,A,Node):- wait(Node) | vlarg_a_ck1(Os,A)@node(Node).
-vlarg_a_ck1(Os,{}):- lib:prs(Os,Os2,a,Done), vlarg_b(Os2,Done).
-otherwise.
-vlarg_a_ck1(Os,_):- lib:prs_err(Os,Os2,a,Done), vlarg_b(Os2,Done).
-
-%%%% b: throw_goal({a})
-vlarg_b(Os,done):- vlarg_b_exe(Os,{a}).
-vlarg_b_exe(Os,A):- nextnode(Node), vlarg_b_exe(Os,A,Node).
-vlarg_b_exe(Os,A,Node):- wait(Node) | vlarg_b_ck1(Os,A)@node(Node).
-vlarg_b_ck1(Os,{a}):- lib:prs(Os,Os2,b,Done), vlarg_c(Os2,Done).
-otherwise.
-vlarg_b_ck1(Os,_):- lib:prs_err(Os,Os2,b,Done), vlarg_c(Os2,Done).
-
-%%%% c: throw_goal({1,2,3})
-vlarg_c(Os,done):- vlarg_c_exe(Os,{1,2,3}).
-vlarg_c_exe(Os,A):- nextnode(Node), vlarg_c_exe(Os,A,Node).
-vlarg_c_exe(Os,A,Node):- wait(Node) | vlarg_c_ck1(Os,A)@node(Node).
-vlarg_c_ck1(Os,{1,2,3}):- lib:prs(Os,Os2,c,Done), vlarg_d(Os2,Done).
-otherwise.
-vlarg_c_ck1(Os,_):- lib:prs_err(Os,Os2,c,Done), vlarg_d(Os2,Done).
-
-%%%% d: throw_goal({1,a,[],2,b})
-vlarg_d(Os,done):- vlarg_d_exe(Os,{1,a,[],2,b}).
-vlarg_d_exe(Os,A):- nextnode(Node), vlarg_d_exe(Os,A,Node).
-vlarg_d_exe(Os,A,Node):- wait(Node) | vlarg_d_ck1(Os,A)@node(Node).
-vlarg_d_ck1(Os,{1,a,[],2,b}):- lib:prs(Os,Os2,d,Done), vlarg_e(Os2,Done).
-otherwise.
-vlarg_d_ck1(Os,_):- lib:prs_err(Os,Os2,d,Done), vlarg_e(Os2,Done).
-
-%%%% e: throw_goal({{}})
-vlarg_e(Os,done):- vlarg_e_exe(Os,{{}}).
-vlarg_e_exe(Os,A):- nextnode(Node), vlarg_e_exe(Os,A,Node).
-vlarg_e_exe(Os,A,Node):- wait(Node) | vlarg_e_ck1(Os,A)@node(Node).
-vlarg_e_ck1(Os,{{}}):- lib:prs(Os,Os2,e,Done), vlarg_f(Os2,Done).
-otherwise.
-vlarg_e_ck1(Os,_):- lib:prs_err(Os,Os2,e,Done), vlarg_f(Os2,Done).
-
-%%%% f: throw_goal({a,{b,c,{d,e,f}}})
-vlarg_f(Os,done):- E=a, vlarg_f_exe(Os,{a,{b,c,{d,e,f}}}).
-vlarg_f_exe(Os,A):- nextnode(Node), vlarg_f_exe(Os,A,Node).
-vlarg_f_exe(Os,A,Node):- wait(Node) | vlarg_f_ck1(Os,A)@node(Node).
-vlarg_f_ck1(Os,{a,{b,c,{d,e,f}}}):- lib:prs(Os,Os2,f,Done), vlarg_g(Os2,Done).
-otherwise.
-vlarg_f_ck1(Os,_):- lib:prs_err(Os,Os2,f,Done), vlarg_g(Os2,Done).
-
-%%%% g: throw_goal({{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1})
-vlarg_g(Os,done):- vlarg_g_exe(Os,{{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1}).
-vlarg_g_exe(Os,A):- nextnode(Node), vlarg_g_exe(Os,A,Node).
-vlarg_g_exe(Os,A,Node):- wait(Node) | vlarg_g_ck1(Os,A)@node(Node).
-vlarg_g_ck1(Os,{{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1}):- 
-	lib:prs(Os,Os2,g,Done), vlarg_h(Os2,Done).
-otherwise.
-vlarg_g_ck1(Os,_):- lib:prs_err(Os,Os2,g,Done), vlarg_h(Os2,Done).
-
-%%%% h: throw_goal([a,b,c])
-vlarg_h(Os,done):- vlarg_h_exe(Os,[a,b,c]).
-vlarg_h_exe(Os,A):- nextnode(Node), vlarg_h_exe(Os,A,Node).
-vlarg_h_exe(Os,A,Node):- wait(Node) | vlarg_h_ck1(Os,A)@node(Node).
-vlarg_h_ck1(Os,[a,b,c]):- lib:prs(Os,Os2,h,Done), vlarg_i(Os2,Done).
-otherwise.
-vlarg_h_ck1(Os,_):- lib:prs_err(Os,Os2,h,Done), vlarg_i(Os2,Done).
-
-%%%% i: throw_goal([a,[b,[c,[d,[e]]]]])
-vlarg_i(Os,done):- vlarg_i_exe(Os,[a,[b,[c,[d,[e]]]]]).
-vlarg_i_exe(Os,A):- nextnode(Node), vlarg_i_exe(Os,A,Node).
-vlarg_i_exe(Os,A,Node):- wait(Node) | vlarg_i_ck1(Os,A)@node(Node).
-vlarg_i_ck1(Os,[a,[b,[c,[d,[e]]]]]):- lib:prs(Os,Os2,i,Done), vlarg_j(Os2,Done).
-otherwise.
-vlarg_i_ck1(Os,_):- lib:prs_err(Os,Os2,i,Done), vlarg_j(Os2,Done).
-
-%%%% j: throw_goal([1,[2,3,[4,5,6],7,8],9])
-vlarg_j(Os,done):- vlarg_j_exe(Os,[1,[2,3,[4,5,6],7,8],9]).
-vlarg_j_exe(Os,A):- nextnode(Node), vlarg_j_exe(Os,A,Node).
-vlarg_j_exe(Os,A,Node):- wait(Node) | vlarg_j_ck1(Os,A)@node(Node).
-vlarg_j_ck1(Os,[1,[2,3,[4,5,6],7,8],9]):- 
-	lib:prs(Os,Os2,j,Done), vlarg_k(Os2,Done).
-otherwise.
-vlarg_j_ck1(Os,_):- lib:prs_err(Os,Os2,j,Done), vlarg_k(Os2,Done).
-
-%%%% k: throw_goal([xyz,a(x),b(y,z)])
-vlarg_k(Os,done):- vlarg_k_exe(Os,[xyz,a(x),b(y,z)]).
-vlarg_k_exe(Os,A):- nextnode(Node), vlarg_k_exe(Os,A,Node).
-vlarg_k_exe(Os,A,Node):- wait(Node) | vlarg_k_ck1(Os,A)@node(Node).
-vlarg_k_ck1(Os,[xyz,a(x),b(y,z)]):- 
-	lib:prs(Os,Os2,k,Done), vlarg_l(Os2,Done).
-otherwise.
-vlarg_k_ck1(Os,_):- lib:prs_err(Os,Os2,k,Done), vlarg_l(Os2,Done).
-
-%%%% l: throw_goal([{a},{b,c},{d,e,f}])
-vlarg_l(Os,done):- vlarg_l_exe(Os,[{a},{b,c},{d,e,f}]).
-vlarg_l_exe(Os,A):- nextnode(Node), vlarg_l_exe(Os,A,Node).
-vlarg_l_exe(Os,A,Node):- wait(Node) | vlarg_l_ck1(Os,A)@node(Node).
-vlarg_l_ck1(Os,[{a},{b,c},{d,e,f}]):- lib:prs(Os,Os2,l,Done), vlarg_m(Os2,Done).
-otherwise.
-vlarg_l_ck1(Os,_):- lib:prs_err(Os,Os2,l,Done), vlarg_m(Os2,Done).
-
-%%%% m: throw_goal([a,{b,[c,d],e},{[f,g,h],i,j},k])
-vlarg_m(Os,done):- vlarg_m_exe(Os,[a,{b,[c,d],e},{[f,g,h],i,j},k]).
-vlarg_m_exe(Os,A):- nextnode(Node), vlarg_m_exe(Os,A,Node).
-vlarg_m_exe(Os,A,Node):- wait(Node) | vlarg_m_ck1(Os,A)@node(Node).
-vlarg_m_ck1(Os,[a,{b,[c,d],e},{[f,g,h],i,j},k]):- 
-	lib:prs(Os,Os2,m,Done), vlarg_n(Os2,Done).
-otherwise.
-vlarg_m_ck1(Os,_):- lib:prs_err(Os,Os2,m,Done), vlarg_n(Os2,Done).
-
-%%%% n: throw_goal(f(3,{0,[a,b],[[a(1),b(1)]],[[c,d,e],[1,2,f(5)],[]]}))
-vlarg_n(Os,done):- vlarg_n_exe(Os,f(3,{0,[a,b],[[a(1),b(1)]],[[c,d,e],[1,2,f(5)],[]]})).
-vlarg_n_exe(Os,A):- nextnode(Node), vlarg_n_exe(Os,A,Node).
-vlarg_n_exe(Os,A,Node):- wait(Node) | vlarg_n_ck1(Os,A)@node(Node).
-vlarg_n_ck1(Os,f(3,{0,[a,b],[[a(1),b(1)]],[[c,d,e],[1,2,f(5)],[]]})):- 
-	lib:prs(Os,Os2,n,Done), vlarg_end(Os2,Done).
-otherwise.
-vlarg_n_ck1(Os,_):- lib:prs_err(Os,Os2,n,Done), vlarg_end(Os2,Done).
-
-vlarg_end(Os,done):- lib:prsl(Os,Os2,'...done',Done), done(Os2,Done).
-
-%===========================================================================
-done(Os,done):- lib:prsl(Os,Os2,'### InterNode Test [%throw_goal, %read] End ###',_), Os2 = [].  
-
-%===========================================================================
-nextnode(Node):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	Node := (CurrentNode+1) mod NumberOfNodes.
diff -ruN klic-3.003-2002-03-16/shmtest/t0thr2.kl1 klic-3.003-2002-03-19/shmtest/t0thr2.kl1
--- klic-3.003-2002-03-16/shmtest/t0thr2.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/t0thr2.kl1	Thu Jan  1 09:00:00 1970
@@ -1,175 +0,0 @@
-% test for "reexportation" of external references which refer to vectors or lists.  
-
-%   a: throw_goal({})
-%   b: throw_goal({a})
-%   c: throw_goal({1,2,3})
-%   d: throw_goal({1,a,[],2,b})
-%   e: throw_goal({{}})
-%   f: throw_goal({a,{b,c,{d,e,f}}})
-%   g: throw_goal({{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1})
-%   h: throw_goal([a,b,c])
-%   i: throw_goal([a,[b,[c,[d,[e]]]]])
-%   j: throw_goal([1,[2,3,[4,5,6],7,8],9])
-%   k: throw_goal([xyz,a(x),b(y,z)])
-%   l: throw_goal([{a},{b,c},{d,e,f}])
-%   m: throw_goal([a,{b,[c,d],e},{[f,g,h],i,j},k])
-
-%===========================================================================
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [Reexportation] Begin ###',Done), 
-	vlarg(Os2,Done). 
-
-%===========================================================================
-vlarg(Os,done):- 
-	lib:prs(Os,Os2,'Test for throw_goal vector/list (a-m) : ',Done), 
-	vlarg_a(Os2,Done).
-
-%%%% a: throw_goal({})
-vlarg_a(Os,done):- vlarg_a_exe(Os,{}).
-vlarg_a_exe(Os,A):- nextnode(Node), vlarg_a_exe(Os,A,Node).
-vlarg_a_exe(Os,A,Node):- wait(Node) | vlarg_a_mid(Os,A)@node(Node).
-vlarg_a_mid(Os,A):- nextnode(Node), vlarg_a_mid(Os,A,Node).
-vlarg_a_mid(Os,A,Node):- wait(Node) | vlarg_a_ck1(Os,A)@node(Node).
-vlarg_a_ck1(Os,{}):- lib:prs(Os,Os2,a,Done), vlarg_b(Os2,Done).
-otherwise.
-vlarg_a_ck1(Os,_):- lib:prs_err(Os,Os2,a,Done), vlarg_b(Os2,Done).
-
-%%%% b: throw_goal({a})
-vlarg_b(Os,done):- vlarg_b_exe(Os,{a}).
-vlarg_b_exe(Os,A):- nextnode(Node), vlarg_b_exe(Os,A,Node).
-vlarg_b_exe(Os,A,Node):- wait(Node) | vlarg_b_mid(Os,A)@node(Node).
-vlarg_b_mid(Os,A):- nextnode(Node), vlarg_b_mid(Os,A,Node).
-vlarg_b_mid(Os,A,Node):- wait(Node) | vlarg_b_ck1(Os,A)@node(Node).
-vlarg_b_ck1(Os,{a}):- lib:prs(Os,Os2,b,Done), vlarg_c(Os2,Done).
-otherwise.
-vlarg_b_ck1(Os,_):- lib:prs_err(Os,Os2,b,Done), vlarg_c(Os2,Done).
-
-%%%% c: throw_goal({1,2,3})
-vlarg_c(Os,done):- vlarg_c_exe(Os,{1,2,3}).
-vlarg_c_exe(Os,A):- nextnode(Node), vlarg_c_exe(Os,A,Node).
-vlarg_c_exe(Os,A,Node):- wait(Node) | vlarg_c_mid(Os,A)@node(Node).
-vlarg_c_mid(Os,A):- nextnode(Node), vlarg_c_mid(Os,A,Node).
-vlarg_c_mid(Os,A,Node):- wait(Node) | vlarg_c_ck1(Os,A)@node(Node).
-vlarg_c_ck1(Os,{1,2,3}):- lib:prs(Os,Os2,c,Done), vlarg_d(Os2,Done).
-otherwise.
-vlarg_c_ck1(Os,_):- lib:prs_err(Os,Os2,c,Done), vlarg_d(Os2,Done).
-
-%%%% d: throw_goal({1,a,[],2,b})
-vlarg_d(Os,done):- vlarg_d_exe(Os,{1,a,[],2,b}).
-vlarg_d_exe(Os,A):- nextnode(Node), vlarg_d_exe(Os,A,Node).
-vlarg_d_exe(Os,A,Node):- wait(Node) | vlarg_d_mid(Os,A)@node(Node).
-vlarg_d_mid(Os,A):- nextnode(Node), vlarg_d_mid(Os,A,Node).
-vlarg_d_mid(Os,A,Node):- wait(Node) | vlarg_d_ck1(Os,A)@node(Node).
-vlarg_d_ck1(Os,{1,a,[],2,b}):- lib:prs(Os,Os2,d,Done), vlarg_e(Os2,Done).
-otherwise.
-vlarg_d_ck1(Os,_):- lib:prs_err(Os,Os2,d,Done), vlarg_e(Os2,Done).
-
-%%%% e: throw_goal({{}})
-vlarg_e(Os,done):- vlarg_e_exe(Os,{{}}).
-vlarg_e_exe(Os,A):- nextnode(Node), vlarg_e_exe(Os,A,Node).
-vlarg_e_exe(Os,A,Node):- wait(Node) | vlarg_e_mid(Os,A)@node(Node).
-vlarg_e_mid(Os,A):- nextnode(Node), vlarg_e_mid(Os,A,Node).
-vlarg_e_mid(Os,A,Node):- wait(Node) | vlarg_e_ck1(Os,A)@node(Node).
-vlarg_e_ck1(Os,{{}}):- lib:prs(Os,Os2,e,Done), vlarg_f(Os2,Done).
-otherwise.
-vlarg_e_ck1(Os,_):- lib:prs_err(Os,Os2,e,Done), vlarg_f(Os2,Done).
-
-%%%% f: throw_goal({a,{b,c,{d,e,f}}})
-vlarg_f(Os,done):- E=a, vlarg_f_exe(Os,{a,{b,c,{d,e,f}}}).
-vlarg_f_exe(Os,A):- nextnode(Node), vlarg_f_exe(Os,A,Node).
-vlarg_f_exe(Os,A,Node):- wait(Node) | vlarg_f_mid(Os,A)@node(Node).
-vlarg_f_mid(Os,A):- nextnode(Node), vlarg_f_mid(Os,A,Node).
-vlarg_f_mid(Os,A,Node):- wait(Node) | vlarg_f_ck1(Os,A)@node(Node).
-vlarg_f_ck1(Os,{a,{b,c,{d,e,f}}}):- 
-	lib:prs(Os,Os2,f,Done), vlarg_g(Os2,Done).
-otherwise.
-vlarg_f_ck1(Os,_):- lib:prs_err(Os,Os2,f,Done), vlarg_g(Os2,Done).
-
-%%%% g: throw_goal({{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1})
-vlarg_g(Os,done):- 
-	vlarg_g_exe(Os,{{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1}).
-vlarg_g_exe(Os,A):- nextnode(Node), vlarg_g_exe(Os,A,Node).
-vlarg_g_exe(Os,A,Node):- wait(Node) | vlarg_g_mid(Os,A)@node(Node).
-vlarg_g_mid(Os,A):- nextnode(Node), vlarg_g_mid(Os,A,Node).
-vlarg_g_mid(Os,A,Node):- wait(Node) | vlarg_g_ck1(Os,A)@node(Node).
-vlarg_g_ck1(Os,{{{{{5},4,4},3,3,3},2,2,2,2},1,1,1,1,1}):- 
-	lib:prs(Os,Os2,g,Done), vlarg_h(Os2,Done).
-otherwise.
-vlarg_g_ck1(Os,_):- lib:prs_err(Os,Os2,g,Done), vlarg_h(Os2,Done).
-
-%%%% h: throw_goal([a,b,c])
-vlarg_h(Os,done):- vlarg_h_exe(Os,[a,b,c]).
-vlarg_h_exe(Os,A):- nextnode(Node), vlarg_h_exe(Os,A,Node).
-vlarg_h_exe(Os,A,Node):- wait(Node) | vlarg_h_mid(Os,A)@node(Node).
-vlarg_h_mid(Os,A):- nextnode(Node), vlarg_h_mid(Os,A,Node).
-vlarg_h_mid(Os,A,Node):- wait(Node) | vlarg_h_ck1(Os,A)@node(Node).
-vlarg_h_ck1(Os,[a,b,c]):- lib:prs(Os,Os2,h,Done), vlarg_i(Os2,Done).
-otherwise.
-vlarg_h_ck1(Os,_):- lib:prs_err(Os,Os2,h,Done), vlarg_i(Os2,Done).
-
-%%%% i: throw_goal([a,[b,[c,[d,[e]]]]])
-vlarg_i(Os,done):- vlarg_i_exe(Os,[a,[b,[c,[d,[e]]]]]).
-vlarg_i_exe(Os,A):- nextnode(Node), vlarg_i_exe(Os,A,Node).
-vlarg_i_exe(Os,A,Node):- wait(Node) | vlarg_i_mid(Os,A)@node(Node).
-vlarg_i_mid(Os,A):- nextnode(Node), vlarg_i_mid(Os,A,Node).
-vlarg_i_mid(Os,A,Node):- wait(Node) | vlarg_i_ck1(Os,A)@node(Node).
-vlarg_i_ck1(Os,[a,[b,[c,[d,[e]]]]]):- 
-	lib:prs(Os,Os2,i,Done), vlarg_j(Os2,Done).
-otherwise.
-vlarg_i_ck1(Os,_):- lib:prs_err(Os,Os2,i,Done), vlarg_j(Os2,Done).
-
-%%%% j: throw_goal([1,[2,3,[4,5,6],7,8],9])
-vlarg_j(Os,done):- vlarg_j_exe(Os,[1,[2,3,[4,5,6],7,8],9]).
-vlarg_j_exe(Os,A):- nextnode(Node), vlarg_j_exe(Os,A,Node).
-vlarg_j_exe(Os,A,Node):- wait(Node) | vlarg_j_mid(Os,A)@node(Node).
-vlarg_j_mid(Os,A):- nextnode(Node), vlarg_j_mid(Os,A,Node).
-vlarg_j_mid(Os,A,Node):- wait(Node) | vlarg_j_ck1(Os,A)@node(Node).
-vlarg_j_ck1(Os,[1,[2,3,[4,5,6],7,8],9]):- 
-	lib:prs(Os,Os2,j,Done), vlarg_k(Os2,Done).
-otherwise.
-vlarg_j_ck1(Os,_):- lib:prs_err(Os,Os2,j,Done), vlarg_k(Os2,Done).
-
-%%%% k: throw_goal([xyz,a(x),b(y,z)])
-vlarg_k(Os,done):- vlarg_k_exe(Os,[xyz,a(x),b(y,z)]).
-vlarg_k_exe(Os,A):- nextnode(Node), vlarg_k_exe(Os,A,Node).
-vlarg_k_exe(Os,A,Node):- wait(Node) | vlarg_k_mid(Os,A)@node(Node).
-vlarg_k_mid(Os,A):- nextnode(Node), vlarg_k_mid(Os,A,Node).
-vlarg_k_mid(Os,A,Node):- wait(Node) | vlarg_k_ck1(Os,A)@node(Node).
-vlarg_k_ck1(Os,[xyz,a(x),b(y,z)]):- 
-	lib:prs(Os,Os2,k,Done), vlarg_l(Os2,Done).
-otherwise.
-vlarg_k_ck1(Os,_):- lib:prs_err(Os,Os2,k,Done), vlarg_l(Os2,Done).
-
-%%%% l: throw_goal([{a},{b,c},{d,e,f}])
-vlarg_l(Os,done):- vlarg_l_exe(Os,[{a},{b,c},{d,e,f}]).
-vlarg_l_exe(Os,A):- nextnode(Node), vlarg_l_exe(Os,A,Node).
-vlarg_l_exe(Os,A,Node):- wait(Node) | vlarg_l_mid(Os,A)@node(Node).
-vlarg_l_mid(Os,A):- nextnode(Node), vlarg_l_mid(Os,A,Node).
-vlarg_l_mid(Os,A,Node):- wait(Node) | vlarg_l_ck1(Os,A)@node(Node).
-vlarg_l_ck1(Os,[{a},{b,c},{d,e,f}]):- 
-	lib:prs(Os,Os2,l,Done), vlarg_m(Os2,Done).
-otherwise.
-vlarg_l_ck1(Os,_):- lib:prs_err(Os,Os2,l,Done), vlarg_m(Os2,Done).
-
-%%%% m: throw_goal([a,{b,[c,d],e},{[f,g,h],i,j},k])
-vlarg_m(Os,done):- vlarg_m_exe(Os,[a,{b,[c,d],e},{[f,g,h],i,j},k]).
-vlarg_m_exe(Os,A):- nextnode(Node), vlarg_m_exe(Os,A,Node).
-vlarg_m_exe(Os,A,Node):- wait(Node) | vlarg_m_mid(Os,A)@node(Node).
-vlarg_m_mid(Os,A):- nextnode(Node), vlarg_m_mid(Os,A,Node).
-vlarg_m_mid(Os,A,Node):- wait(Node) | vlarg_m_ck1(Os,A)@node(Node).
-vlarg_m_ck1(Os,[a,{b,[c,d],e},{[f,g,h],i,j},k]):- 
-	lib:prs(Os,Os2,m,Done), vlarg_end(Os2,Done).
-otherwise.
-vlarg_m_ck1(Os,_):- lib:prs_err(Os,Os2,m,Done), vlarg_end(Os2,Done).
-
-vlarg_end(Os,done):- lib:prsl(Os,Os2,'...done',Done), done(Os2,Done).
-
-%===========================================================================
-done(Os,done):- lib:prsl(Os,Os2,'### InterNode Test [Reexportation] End ###',_), Os2 = [].  
-
-%===========================================================================
-nextnode(Node):- 
-	builtin:current_node(CurrentNode,NumberOfNodes), 
-	Node := (CurrentNode+1) mod NumberOfNodes.
-
diff -ruN klic-3.003-2002-03-16/shmtest/t0thr3.kl1 klic-3.003-2002-03-19/shmtest/t0thr3.kl1
--- klic-3.003-2002-03-16/shmtest/t0thr3.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/t0thr3.kl1	Thu Jan  1 09:00:00 1970
@@ -1,147 +0,0 @@
-% test for "return back" a %throw_goal message.  
-%
-%   a: throw_goal({1})
-%   b: throw_goal({{},[],3}) 
-%   c: throw_goal({1,a,{},4,[],6}) 
-%   d: throw_goal({a,2,{},b,5,[],7})
-%   e: throw_goal({1,a,{},4,[],b,7,c,[],0,{},2}) 
-%   f: throw_goal([a]) 
-%   g: throw_goal([{},[],3])
-%   h: throw_goal(string#"")
-%   i: throw_goal(string#"S")
-%   j: throw_goal(string#"This is string")
-
-%===========================================================================
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [Return Back %throw_goal] Begin ###',Done), 
-	b(Os2,Done). 
-
-b(Os,done):-
-	lib:prs(Os,Os2,'Test for throw_goal throw & back (a-j) : ',Done), 
-	b_a(Os2,Done). 
-
-%===========================================================================
-%%%% a: throw_goal({1}) 
-b_a(Os,done):- b_a_exe(Os,{1}).
-b_a_exe(Os,A):- nextNode(Next,Current), b_a_exe(Os,A,Next,Current).
-b_a_exe(Os,A,Next,Current):- wait(Next) | b_a_mid(Os,A,Current)@node(Next).
-b_a_mid(Os,A,Back):- wait(Back) | b_a_ck1(Os,A)@node(Back).
-b_a_ck1(Os,{1}):- lib:prs(Os,Os2,a,Done), b_a_nxt(Os2,Done).
-otherwise.
-b_a_ck1(Os,_):- lib:prs_err(Os,Os2,a,Done), b_a_nxt(Os2,Done).
-b_a_nxt(Os,done):- nextNode(Next), b_a_mv(Os,Next).
-b_a_mv(Os,Next):- wait(Next) | b_b(Os,done)@node(Next).
-
-%%%% b: throw_goal({{},[],3}) 
-b_b(Os,done):- b_b_exe(Os,{{},[],3}).
-b_b_exe(Os,A):- nextNode(Next,Current), b_b_exe(Os,A,Next,Current).
-b_b_exe(Os,A,Next,Current):- wait(Next) | b_b_mid(Os,A,Current)@node(Next).
-b_b_mid(Os,A,Back):- wait(Back) | b_b_ck1(Os,A)@node(Back).
-b_b_ck1(Os,{{},[],3}):- lib:prs(Os,Os2,b,Done), b_b_nxt(Os2,Done).
-otherwise.
-b_b_ck1(Os,_):- lib:prs_err(Os,Os2,b,Done), b_b_nxt(Os2,Done).
-b_b_nxt(Os,done):- nextNode(Next), b_b_mv(Os,Next).
-b_b_mv(Os,Next):- wait(Next) | b_c(Os,done)@node(Next).
-
-%%%% c: throw_goal({1,a,{},4,[],6})
-b_c(Os,done):- b_c_exe(Os,{1,a,{},4,[],6}).
-b_c_exe(Os,A):- nextNode(Next,Current), b_c_exe(Os,A,Next,Current).
-b_c_exe(Os,A,Next,Current):- wait(Next) | b_c_mid(Os,A,Current)@node(Next).
-b_c_mid(Os,A,Back):- wait(Back) | b_c_ck1(Os,A)@node(Back).
-b_c_ck1(Os,{1,a,{},4,[],6}):- lib:prs(Os,Os2,c,Done), b_c_nxt(Os2,Done).
-otherwise.
-b_c_ck1(Os,_):- lib:prs_err(Os,Os2,c,Done), b_c_nxt(Os2,Done).
-b_c_nxt(Os,done):- nextNode(Next), b_c_mv(Os,Next).
-b_c_mv(Os,Next):- wait(Next) | b_d(Os,done)@node(Next).
-
-%%%% d: throw_goal({a,2,{},b,5,[],7})
-b_d(Os,done):- b_d_exe(Os,{a,2,{},b,5,[],7}).
-b_d_exe(Os,A):- nextNode(Next,Current), b_d_exe(Os,A,Next,Current).
-b_d_exe(Os,A,Next,Current):- wait(Next) | b_d_mid(Os,A,Current)@node(Next).
-b_d_mid(Os,A,Back):- wait(Back) | b_d_ck1(Os,A)@node(Back).
-b_d_ck1(Os,{a,2,{},b,5,[],7}):- lib:prs(Os,Os2,d,Done), b_d_nxt(Os2,Done).
-otherwise.
-b_d_ck1(Os,_):- lib:prs_err(Os,Os2,d,Done), b_d_nxt(Os2,Done).
-b_d_nxt(Os,done):- nextNode(Next), b_d_mv(Os,Next).
-b_d_mv(Os,Next):- wait(Next) | b_e(Os,done)@node(Next).
-
-%%%% e: throw_goal({1,a,{},4,[],b,7,c,[],0,{},2})
-b_e(Os,done):- b_e_exe(Os,{1,a,{},4,[],b,7,c,[],0,{},2}).
-b_e_exe(Os,A):- nextNode(Next,Current), b_e_exe(Os,A,Next,Current).
-b_e_exe(Os,A,Next,Current):- wait(Next) | b_e_mid(Os,A,Current)@node(Next).
-b_e_mid(Os,A,Back):- wait(Back) | b_e_ck1(Os,A)@node(Back).
-b_e_ck1(Os,{1,a,{},4,[],b,7,c,[],0,{},2}):- lib:prs(Os,Os2,e,Done), b_e_nxt(Os2,Done).
-otherwise.
-b_e_ck1(Os,_):- lib:prs_err(Os,Os2,e,Done), b_e_nxt(Os2,Done).
-b_e_nxt(Os,done):- nextNode(Next), b_e_mv(Os,Next).
-b_e_mv(Os,Next):- wait(Next) | b_f(Os,done)@node(Next).
-
-%%%% f: throw_goal([a])
-b_f(Os,done):- b_f_exe(Os,[a]).
-b_f_exe(Os,A):- nextNode(Next,Current), b_f_exe(Os,A,Next,Current).
-b_f_exe(Os,A,Next,Current):- wait(Next) | b_f_mid(Os,A,Current)@node(Next).
-b_f_mid(Os,A,Back):- wait(Back) | b_f_ck1(Os,A)@node(Back).
-b_f_ck1(Os,[a]):- lib:prs(Os,Os2,f,Done), b_f_nxt(Os2,Done).
-otherwise.
-b_f_ck1(Os,_):- lib:prs_err(Os,Os2,f,Done), b_f_nxt(Os2,Done).
-b_f_nxt(Os,done):- nextNode(Next), b_f_mv(Os,Next).
-b_f_mv(Os,Next):- wait(Next) | b_g(Os,done)@node(Next).
-
-%%%% g: throw_goal([{},[],3])
-b_g(Os,done):- b_g_exe(Os,[{},[],3]).
-b_g_exe(Os,A):- nextNode(Next,Current), b_g_exe(Os,A,Next,Current).
-b_g_exe(Os,A,Next,Current):- wait(Next) | b_g_mid(Os,A,Current)@node(Next).
-b_g_mid(Os,A,Back):- wait(Back) | b_g_ck1(Os,A)@node(Back).
-b_g_ck1(Os,[{},[],3]):- lib:prs(Os,Os2,g,Done), b_g_nxt(Os2,Done).
-otherwise.
-b_g_ck1(Os,_):- lib:prs_err(Os,Os2,g,Done), b_g_nxt(Os2,Done).
-b_g_nxt(Os,done):- nextNode(Next), b_g_mv(Os,Next).
-b_g_mv(Os,Next):- wait(Next) | b_h(Os,done)@node(Next).
-
-%%%% h: throw_goal(string#"")
-b_h(Os,done):- b_h_exe(Os,string#"").
-b_h_exe(Os,A):- nextNode(Next,Current), b_h_exe(Os,A,Next,Current).
-b_h_exe(Os,A,Next,Current):- wait(Next) | b_h_mid(Os,A,Current)@node(Next).
-b_h_mid(Os,A,Back):- wait(Back) | b_h_ck1(Os,A)@node(Back).
-b_h_ck1(Os,string#""):- lib:prs(Os,Os2,h,Done), b_h_nxt(Os2,Done).
-otherwise.
-b_h_ck1(Os,_):- lib:prs_err(Os,Os2,h,Done), b_h_nxt(Os2,Done).
-b_h_nxt(Os,done):- nextNode(Next), b_h_mv(Os,Next).
-b_h_mv(Os,Next):- wait(Next) | b_i(Os,done)@node(Next).
-
-%%%% i: throw_goal(string#"S")
-b_i(Os,done):- b_i_exe(Os,string#"S").
-b_i_exe(Os,A):- nextNode(Next,Current), b_i_exe(Os,A,Next,Current).
-b_i_exe(Os,A,Next,Current):- wait(Next) | b_i_mid(Os,A,Current)@node(Next).
-b_i_mid(Os,A,Back):- wait(Back) | b_i_ck1(Os,A)@node(Back).
-b_i_ck1(Os,string#"S"):- lib:prs(Os,Os2,i,Done), b_i_nxt(Os2,Done).
-otherwise.
-b_i_ck1(Os,_):- lib:prs_err(Os,Os2,i,Done), b_i_nxt(Os2,Done).
-b_i_nxt(Os,done):- nextNode(Next), b_i_mv(Os,Next).
-b_i_mv(Os,Next):- wait(Next) | b_j(Os,done)@node(Next).
-
-%%%% j: throw_goal(string#"This is string")
-b_j(Os,done):- b_j_exe(Os,string#"This is string").
-b_j_exe(Os,A):- nextNode(Next,Current), b_j_exe(Os,A,Next,Current).
-b_j_exe(Os,A,Next,Current):- wait(Next) | b_j_mid(Os,A,Current)@node(Next).
-b_j_mid(Os,A,Back):- wait(Back) | b_j_ck1(Os,A)@node(Back).
-b_j_ck1(Os,string#"This is string"):- lib:prs(Os,Os2,j,Done), b_j_nxt(Os2,Done).
-otherwise.
-b_j_ck1(Os,_):- lib:prs_err(Os,Os2,j,Done), b_j_nxt(Os2,Done).
-b_j_nxt(Os,done):- nextNode(Next), b_j_mv(Os,Next).
-b_j_mv(Os,Next):- wait(Next) | b_end(Os,done)@node(Next).
-
-%---------------------------------------------------------------------------
-b_end(Os,done):- lib:prsl(Os,Os2,'...done',Done), done(Os2,Done). 
-
-%===========================================================================
-done(Os,done):- 
-	lib:prsl(Os,Os2,'### InterNode Test [Return Back %throw_goal] End ###',_), 
-	Os2 = [].  
-
-%===========================================================================
-nextNode(Next):- nextNode(Next,_). 
-nextNode(Next,Current):- 
-	current_node(Current,Number), Next := (Current+1) mod Number.
-
diff -ruN klic-3.003-2002-03-16/shmtest/throw.kl1 klic-3.003-2002-03-19/shmtest/throw.kl1
--- klic-3.003-2002-03-16/shmtest/throw.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/throw.kl1	Thu Jan  1 09:00:00 1970
@@ -1,27 +0,0 @@
-% % throw -dp2 N<CR>
-
-%  PEi  --- %throw ---> PEj   (1)
-%  PEi <--- %throw ---  PEj   (2)
-%  PEi  --- %throw ---> PEj   (3)
-%  PEi <--- %throw ---  PEj   (4)
-%  PEi  --- %throw ---> PEj   (5)
-%  PEi <--- %throw ---  PEj   (6)
-%		:
-%  PEi  --- %throw ---> PEj   (N-1)
-%  PEi <--- %throw ---  PEj   (N)
-
-:- module main. 
-
-main:- unix:argv(ISL), rlib:isltoi(ISL,N), 
-	current_node(Current,Number), Dest:=(Current+1) mod Number, 
-	resident(Done,ReadyC), resident(Done,ReadyD,Dest), 
-	throw(ReadyC,ReadyD,~(N-1),Dest,Current,Done). 
-
-throw(ready,ready,N,Dest,Current,Done):- throw(N,Dest,Current,Done). 
-throw(N,Dest,Current,Done):- N > 0, wait(Dest), wait(Current) | 
-	throw(~(N-1),Current,Dest,Done)@node(Dest). 
-throw(N,_,_,Done):- N=:=0 | Done=done. 
-
-resident(Done,Ready,Node):- wait(Node) | resident(Done,Ready)@node(Node). 
-resident(Done,Ready):- resident(Done), Ready=ready. 
-resident(done). 
diff -ruN klic-3.003-2002-03-16/shmtest/unify.kl1 klic-3.003-2002-03-19/shmtest/unify.kl1
--- klic-3.003-2002-03-16/shmtest/unify.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/unify.kl1	Thu Jan  1 09:00:00 1970
@@ -1,23 +0,0 @@
-% % unify -dp2 N<CR>
-
-%  PEi  --- %unify ---> PEj   (1)
-%  PEi <--- %unify ---  PEj   (2)
-%  PEi  --- %unify ---> PEj   (3)
-%  PEi <--- %unify ---  PEj   (4)
-%  PEi  --- %unify ---> PEj   (5)
-%  PEi <--- %unify ---  PEj   (6)
-%		:
-%  PEi  --- %unify ---> PEj   (M*2-1)
-%  PEi <--- %unify ---  PEj   (M*2)     (M = N/2)
-
-:- module main. 
-
-main:- unix:argv(ISL), rlib:isltoi(ISL,N), 
-	current_node(Current,Number), Node:=(Current+1) mod Number, 
-	master(~(N/2-1),X), slave(f(X))@node(Node). 
-
-master(N,f(EX)):- N > 0 | EX=f(Var), master(~(N-1),Var). 
-master(N,f(EX)):- N=:=0 | EX=eof. 
-
-slave(f(EX)):- EX=f(Var), slave(Var). 
-slave(eof). 
diff -ruN klic-3.003-2002-03-16/shmtest/unify_exrefs.kl1 klic-3.003-2002-03-19/shmtest/unify_exrefs.kl1
--- klic-3.003-2002-03-16/shmtest/unify_exrefs.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/unify_exrefs.kl1	Thu Jan  1 09:00:00 1970
@@ -1,99 +0,0 @@
-% Test for unification between exrefs
-
-:- module main.
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [Unification between EXREFs ] Begin ###',_), 
-	gen_gen_test(Os2,Os3), 
-	con_con_test(Os3,Os4), 
-	gen_con_test(Os4,Os5), 
-	lib:prsl(Os5,[],'### InterNode Test [Unification between EXREFs ] End ###',_). 
-
-gen_gen_test(Os,OsE):- 
-	lib:prs(Os,Os2,'gen-exref & gen-exref (a-j) : ',_),
-	test(Os2,OsE,Cs), 
-	Cs=[ufy([genv(1),gens(2)],out(a)),
-	    ufy([gens(1),gens(2),genv(3)],out(b)),
-	    ufy([gens(1),gens(1),gens(2),gens(2),gens(3),genv(1)],out(c)),
-	    ufy([genv(2),genv(3)],out(d)),
-	    ufy([genv(3),genv(2),genv(1),genv(3),genv(3)],out(e)),
-	    ufy([gens(3),genv(2),gens(1),genv(3),gens(2),genv(1)],out(f)),
-	    ufy([gens(1),value],out(g)),
-	    ufy([gens(2),gens(2),gens(2),gens(2),gens(2),value],out(h)),
-	    ufy([genv(3),value],out(i)),
-	    ufy([genv(4),genv(4),genv(4),genv(4),genv(4),value],out(j))]. 
-
-con_con_test(Os,OsE):- 
-	lib:prs(Os,Os2,'con-exref & con-exref (a-c) : ',_),
-	test(Os2,OsE,Cs), 
-	Cs=[ufy([con(1),value],out(a)),
-	    ufy([con(1),con(2),value],out(b)),
-	    ufy([con(1),con(2),con(1),con(2),con(1),con(2),value],out(c))]. 
-
-gen_con_test(Os,OsE):- 
-	lib:prs(Os,Os2,'gen-exref & con-exref (a-m) : ',_),
-	test(Os2,OsE,Cs), 
-	Cs=[ufy([genv(1),con(2)],out(a)),
-	    ufy([con(1),genv(2)],out(b)),
-	    ufy([gens(1),con(2),value],out(c)),
-	    ufy([con(1),gens(2),value],out(d)),
-	    ufy([gens(1),genv(2),con(3)],out(e)),
-	    ufy([gens(1),con(3),genv(2)],out(f)),
-	    ufy([con(3),gens(2),genv(1)],out(g)),
-	    ufy([gens(1),genv(2),con(3),value],out(h)),
-	    ufy([con(1),con(2),con(1),con(2),con(1),con(2),genv(3)],out(i)),
-	    ufy([con(1),gens(2),con(1),gens(2),con(1),gens(2),genv(3)],out(j)),
-	    ufy([gens(1),gens(2),gens(3),gens(4),con(1),value],out(k)),
-	    ufy([gens(1),gens(2),gens(3),gens(4),con(5),genv(6)],out(l)),
-	    ufy([con(1),con(2),con(1),con(2),con(1),gens(2),genv(3)],out(m))]. 
-
-test(Os,OsE,[ufy(Vs,out(Out))|Cs]):- 
-	genEXs(Vs,EXs,Gen,gen,Done,done), ufy(Gen,EXs), 
-	pr(Os,Os2,Done,Out), test(Os2,OsE,Cs). 
-test(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-ufy(Wait,[EX|EXs]):- wait(Wait) | ufy_exe(EX,EXs). 
-ufy_exe(EXa,[EXb|EXs]):- EXa=EXb, ufy_exe(EXb,EXs). 
-ufy_exe(_,[]). 
-
-pr(Os,Os2,done,Out):- lib:prs(Os,Os2,Out,_). 
-otherwise. 
-pr(Os,Os2,_,Out):- lib:prs_err(Os,Os2,Out,_). 
-
-genEXs([con(Add)|Vs],EXs,Ga,Gc,Ua,Ud):- 
-	nextNode(Add,Node), genExr(Ex,Ga,Gb,Ua,Ub,Node), EXs=[Ex|EXs2], 
-	susp(Ex,Ub,Uc), 
-	genEXs(Vs,EXs2,Gb,Gc,Uc,Ud)@lower_priority. 
-genEXs([genv(Add)|Vs],EXs,Ga,Gc,Ua,Ub):- 
-	nextNode(Add,Node), genExv(Ex,Ga,Gb,Node), EXs=[Ex|EXs2], 
-	genEXs(Vs,EXs2,Gb,Gc,Ua,Ub). 
-genEXs([gens(Add)|Vs],EXs,Ga,Gc,Ua,Uc):- 
-	nextNode(Add,Node), genExr(Ex,Ga,Gb,Ua,Ub,Node), EXs=[Ex|EXs2], 
-	genEXs(Vs,EXs2,Gb,Gc,Ub,Uc). 
-genEXs([value|Vs],EXs,Ga,Gb,Ua,Ub):- 
-	EXs=[value|EXs2], 
-	genEXs(Vs,EXs2,Ga,Gb,Ua,Ub). 
-genEXs([],EXs,Ga,Gb,Ua,Ub):- EXs=[], Ga=Gb, Ua=Ub. 
-
-genExv(Ex,Ga,Gb,Node):- wait(Node) | 
-	genExv_exe(ExF,Ack)@node(Node), wait_exref(ExF,Ex,Ga,Gb,Ack). 
-wait_exref(ex(Ref),Ex,Ga,Gb,Ack):- Ref=Ex, Ga=Gb, Ack=ack. 
-genExv_exe(ExF,Ack):- ExF=ex(Var), bindV(Ack,Var). 
-bindV(ack,Var):- Var=value. 
-
-genExr(Ex,Ga,Gb,Ua,Ub,Node):- wait(Node) | 
-	genExr_exe(ExF,Ua,Ub)@node(Node), wait_exref(ExF,Ex,Ga,Gb). 
-wait_exref(ex(Ref),Ex,Ga,Gb):- Ref=Ex, Ga=Gb. 
-genExr_exe(ExF,Ua,Ub):- ExF=ex(Var), susp(Var,Ua,Ub). 
-susp(value,Ua,Ub):- Ua=Ub. 
-
-%===========================================================================
-nextNode(Add,Node):- 
-	current_node(CurrentNode,NumberOfNodes), 
-	modNode(~(CurrentNode+Add),NumberOfNodes,Node).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
diff -ruN klic-3.003-2002-03-16/shmtest/vector_built.kl1 klic-3.003-2002-03-19/shmtest/vector_built.kl1
--- klic-3.003-2002-03-16/shmtest/vector_built.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/vector_built.kl1	Thu Jan  1 09:00:00 1970
@@ -1,250 +0,0 @@
-:- module main. 
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [EXREF -> Vector] Begin ###',_), 
-	test_vector(Os2,Os3), 
-	test_guard_element(Os3,Os4), 
-	test_body_element(Os4,Os5), 
-	test_set_element_4(Os5,Os6), 
-	test_set_element_5(Os6,Os7), 
-	lib:prsl(Os7,[],'### InterNode Test [EXREF -> Vector] End ###',_). 
-
-%---------------------------------------------------------------------
-test_vector(Os,OsE):- 
-	lib:prs(Os,Os2,'vector: (a-u) : ',_), 
-	test_vector(Os2,OsE,Cs), 
-	Cs=[t({a},1,out(a)),
-	    t({b,a},2,out(b)),
-	    t({c,b,a},3,out(c)),
-	    t({d,c,b,a},4,out(d)),
-	    t({e,d,c,b,a},5,out(e)),
-	    t({1,{2},{3,4}},3,out(f)),
-	    t({1,[2],[3,4],[5,6,7]},4,out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},5,out(h)),
-	    t({{a}},1,out(i)),
-	    t({{{a}}},1,out(j)),
-	    t({{{{a}}}},1,out(k)),
-	    t({{{{a}}},{b}},2,out(l)),
-	    t({{{{a}}},{{b}}},2,out(m)),
-	    t({{{{a}}},{{{b}}}},2,out(n)),
-	    t({{a},[b,c]},2,out(o)),
-	    t({{[a]},[b,{c}]},2,out(p)),
-	    t({_},1,out(q)),
-	    t({a,_},2,out(r)),
-	    t({_,b,_},3,out(s)),
-	    t({_,_,c,_},4,out(t)),
-	    t({_,_,_,d,_},5,out(u))]. 
-
-test_vector(Os,OsE,[t(Vec,Len,out(Out))|Cs]):- 
-	lib:nextNodes(3,[Node1,Node2,Node3]), 
-	fetch_and_vector(ExV,Len,Res1,Ack1,Node1), 
-	fetch_and_vector(ExV,Len,Res2,Ack2,Node2), 
-	fetch_and_vector(ExV,Len,Res3,Ack3,Node3), 
-	lib:waitallAndUnify([Ack1,Ack2,Ack3],ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res1,Res2,Res3],Out,_), 
-	test_vector(Os2,OsE,Cs). 
-test_vector(Os,OsE,[]):- lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_vector(ExV,PLen,Res,Ack,Node):- wait(Node) | 
-	fetch_and_vector(ExV,PLen,Res,Ack)@node(Node). 
-
-fetch_and_vector(ExV,PLen,Res,Ack):- 
-	Ack=ack, fetch_and_vector(ExV,PLen,Res). 
-
-fetch_and_vector(ExV,PLen,Res):- vector(ExV,Len) | 
-	lib:eq(PLen,Len,Res).  
-
-%---------------------------------------------------------------------
-test_guard_element(Os,OsE):- 
-	lib:prs(Os,Os2,'(guard) vector_element : (a-p) : ',_), 
-	test_guard_element(Os2,OsE,Cs), 
-	Cs=[t({a},[a],out(a)),
-	    t({b,a},[b,a],out(b)),
-	    t({c,b,a},[c,b,a],out(c)),
-	    t({d,c,b,a},[d,c,b,a],out(d)),
-	    t({e,d,c,b,a},[e,d,c,b,a],out(e)),
-	    t({1,{2},{3,4}},[1,{2},{3,4}],out(f)),
-	    t({1,[2],[3,4],[5,6,7]},[1,[2],[3,4],[5,6,7]],out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},
-			[1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)],out(h)),
-	    t({{a}},[{a}],out(i)),
-	    t({{{a}}},[{{a}}],out(j)),
-	    t({{{{a}}}},[{{{a}}}],out(k)),
-	    t({{{{a}}},{b}},[{{{a}}},{b}],out(l)),
-	    t({{{{a}}},{{b}}},[{{{a}}},{{b}}],out(m)),
-	    t({{{{a}}},{{{b}}}},[{{{a}}},{{{b}}}],out(n)),
-	    t({{a},[b,c]},[{a},[b,c]],out(o)),
-	    t({{[a]},[b,{c}]},[{[a]},[b,{c}]],out(p))]. 
-
-test_guard_element(Os,OsE,[t(Vec,ELs,out(Out))|Cs]):- 
-	lib:nextNodes(3,[Node1,Node2,Node3]), 
-	fetch_and_guard_element(ExV,ELs,Res1,Ack1,Node1), 
-	fetch_and_guard_element(ExV,ELs,Res2,Ack2,Node2), 
-	fetch_and_guard_element(ExV,ELs,Res3,Ack3,Node3), 
-	lib:waitallAndUnify([Ack1,Ack2,Ack3],ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res1,Res2,Res3],Out,_), 
-	test_guard_element(Os2,OsE,Cs). 
-test_guard_element(Os,OsE,[]):- lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_guard_element(ExV,ELs,Res,Ack,Node):- wait(Node) | 
-	fetch_and_guard_element(ExV,ELs,Res,Ack)@node(Node). 
-
-fetch_and_guard_element(ExV,ELs,Res,Ack):- 
-	Ack=ack, 
-	fetch_and_guard_element_2(ExV,0,ELs,Rs), lib:check(Rs,Res). 
-
-fetch_and_guard_element_2(ExV,Index,[PEle|ELs],Rs):- 
-    vector_element(ExV,Index,Ele) | 
-	lib:eq(PEle,Ele,Done), Rs=[Done|Rs2], 
-	fetch_and_guard_element_2(ExV,~(Index+1),ELs,Rs2). 
-fetch_and_guard_element_2(_,_,[],Rs):- Rs=[]. 
-
-%---------------------------------------------------------------------
-test_body_element(Os,OsE):- 
-	lib:prs(Os,Os2,'(body) vector_element : (a-p) : ',_), 
-	test_body_element(Os2,OsE,Cs), 
-	Cs=[t({a},[a],out(a)),
-	    t({b,a},[b,a],out(b)),
-	    t({c,b,a},[c,b,a],out(c)),
-	    t({d,c,b,a},[d,c,b,a],out(d)),
-	    t({e,d,c,b,a},[e,d,c,b,a],out(e)),
-	    t({1,{2},{3,4}},[1,{2},{3,4}],out(f)),
-	    t({1,[2],[3,4],[5,6,7]},[1,[2],[3,4],[5,6,7]],out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},
-			[1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)],out(h)),
-	    t({{a}},[{a}],out(i)),
-	    t({{{a}}},[{{a}}],out(j)),
-	    t({{{{a}}}},[{{{a}}}],out(k)),
-	    t({{{{a}}},{b}},[{{{a}}},{b}],out(l)),
-	    t({{{{a}}},{{b}}},[{{{a}}},{{b}}],out(m)),
-	    t({{{{a}}},{{{b}}}},[{{{a}}},{{{b}}}],out(n)),
-	    t({{a},[b,c]},[{a},[b,c]],out(o)),
-	    t({{[a]},[b,{c}]},[{[a]},[b,{c}]],out(p))]. 
-
-test_body_element(Os,OsE,[t(Vec,ELs,out(Out))|Cs]):- 
-	lib:nextNodes(3,[Node1,Node2,Node3]), 
-	fetch_and_body_element(ExV,ELs,Res1,Ack1,Node1), 
-	fetch_and_body_element(ExV,ELs,Res2,Ack2,Node2), 
-	fetch_and_body_element(ExV,ELs,Res3,Ack3,Node3), 
-	lib:waitallAndUnify([Ack1,Ack2,Ack3],ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res1,Res2,Res3],Out,_), 
-	test_body_element(Os2,OsE,Cs). 
-test_body_element(Os,OsE,[]):- lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_body_element(ExV,ELs,Res,Ack,Node):- wait(Node) | 
-	fetch_and_body_element(ExV,ELs,Res,Ack)@node(Node). 
-
-fetch_and_body_element(ExV,ELs,Res,Ack):- 
-	Ack=ack, 
-	fetch_and_body_element_2(ExV,0,ELs,Rs), lib:check(Rs,Res). 
-
-fetch_and_body_element_2(ExV,Index,[PEle|ELs],Rs):- 
-	vector_element(ExV,Index,Ele), 
-	lib:eq(PEle,Ele,Done), Rs=[Done|Rs2], 
-	fetch_and_body_element_2(ExV,~(Index+1),ELs,Rs2). 
-fetch_and_body_element_2(_,_,[],Rs):- Rs=[]. 
-
-%---------------------------------------------------------------------
-test_set_element_4(Os,OsE):- 
-	lib:prs(Os,Os2,'set_vector_element/4 : (a-w) : ',_), 
-	test_set_element_4(Os2,OsE,Cs), 
-	Cs=[t({a},1,out(a)),
-	    t({b,a},2,out(b)),
-	    t({c,b,a},3,out(c)),
-	    t({d,c,b,a},4,out(d)),
-	    t({e,d,c,b,a},5,out(e)),
-	    t({f,e,d,c,b,a},6,out(f)),
-	    t({g,f,e,d,c,b,a},7,out(g)),
-	    t({h,g,f,e,d,c,b,a},8,out(h)),
-	    t({_},1,out(i)),
-	    t({_,_},2,out(j)),
-	    t({_,_,_},3,out(k)),
-	    t({_,_,_,_},4,out(l)),
-	    t({_,_,_,_,_},5,out(m)), 
-	    t({_,_,_,_,_,_},6,out(n)), 
-	    t({_,_,_,_,_,_,_},7,out(o)), 
-	    t({_,_,_,_,_,_,_,_},8,out(p)), 
-	    t({_,a},2,out(q)),
-	    t({_,a,_},3,out(r)),
-	    t({_,_,a,_},4,out(s)),
-	    t({a,_,_,_,a},5,out(t)), 
-	    t({_,a,_,_,a,_},6,out(u)), 
-	    t({_,_,a,_,a,_,_},7,out(v)), 
-	    t({_,a,_,a,_,a,_,_},8,out(w))]. 
-
-test_set_element_4(Os,OsE,[t(Vec,Len,out(Out))|Cs]):- 
-	lib:nextNodes(3,[Node1,Node2,Node3]), 
-	fetch_and_set_element_4(ExV,Len,Res1,Ack1,Node1), 
-	fetch_and_set_element_4(ExV,Len,Res2,Ack2,Node2), 
-	fetch_and_set_element_4(ExV,Len,Res3,Ack3,Node3), 
-	lib:waitallAndUnify([Ack1,Ack2,Ack3],ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res1,Res2,Res3],Out,_), 
-	test_set_element_4(Os2,OsE,Cs). 
-test_set_element_4(Os,OsE,[]):- 
-	lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_set_element_4(ExV,Len,Res,Ack,Node):- wait(Node) | 
-	fetch_and_set_element_4(ExV,Len,Res,Ack)@node(Node). 
-
-fetch_and_set_element_4(ExV,Len,Res,Ack):- 
-	Ack=ack, fetch_and_set_element_4_2(0,ExV,Len,Res). 
-
-fetch_and_set_element_4_2(Index,ExV,Len,Res):- Index < Len | 
-	set_vector_element(ExV,Index,Index,NewExV), 
-	fetch_and_set_element_4_2(~(Index+1),NewExV,Len,Res). 
-fetch_and_set_element_4_2(Index,ExV,Len,Res):- Index =:= Len | 
-	check_ivector(0,ExV,Len,Res). 
-
-%---------------------------------------------------------------------
-test_set_element_5(Os,OsE):- 
-	lib:prs(Os,Os2,'set_vector_element/5 : (a-p) : ',_), 
-	test_set_element_5(Os2,OsE,Cs), 
-	Cs=[t({a},[a],out(a)),
-	    t({b,a},[b,a],out(b)),
-	    t({c,b,a},[c,b,a],out(c)),
-	    t({d,c,b,a},[d,c,b,a],out(d)),
-	    t({e,d,c,b,a},[e,d,c,b,a],out(e)),
-	    t({1,{2},{3,4}},[1,{2},{3,4}],out(f)),
-	    t({1,[2],[3,4],[5,6,7]},[1,[2],[3,4],[5,6,7]],out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},
-			[1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)],out(h)),
-	    t({{a}},[{a}],out(i)),
-	    t({{{a}}},[{{a}}],out(j)),
-	    t({{{{a}}}},[{{{a}}}],out(k)),
-	    t({{{{a}}},{b}},[{{{a}}},{b}],out(l)),
-	    t({{{{a}}},{{b}}},[{{{a}}},{{b}}],out(m)),
-	    t({{{{a}}},{{{b}}}},[{{{a}}},{{{b}}}],out(n)),
-	    t({{a},[b,c]},[{a},[b,c]],out(o)),
-	    t({{[a]},[b,{c}]},[{[a]},[b,{c}]],out(p))]. 
-
-test_set_element_5(Os,OsE,[t(Vec,ELs,out(Out))|Cs]):- 
-	lib:nextNodes(3,[Node1,Node2,Node3]), 
-	fetch_and_set_element_5(ExV,ELs,Res1,Ack1,Node1), 
-	fetch_and_set_element_5(ExV,ELs,Res2,Ack2,Node2), 
-	fetch_and_set_element_5(ExV,ELs,Res3,Ack3,Node3), 
-	lib:waitallAndUnify([Ack1,Ack2,Ack3],ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res1,Res2,Res3],Out,_), 
-	test_set_element_5(Os2,OsE,Cs). 
-test_set_element_5(Os,OsE,[]):- 
-	lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_set_element_5(ExV,ELs,Res,Ack,Node):- wait(Node) | 
-	fetch_and_set_element_5(ExV,ELs,Res,Ack)@node(Node). 
-
-fetch_and_set_element_5(ExV,ELs,Res,Ack):- 
-	Ack=ack, 
-	fetch_and_set_element_5_2(ExV,0,ELs,Rs), lib:check(Rs,Res). 
-
-fetch_and_set_element_5_2(ExV,Index,[PEle|ELs],Rs):- 
-	set_vector_element(ExV,Index,Ele,Index,NewExV), 
-	lib:eq(PEle,Ele,Done), Rs=[Done|Rs2], 
-	fetch_and_set_element_5_2(NewExV,~(Index+1),ELs,Rs2). 
-fetch_and_set_element_5_2(ExV,Index,[],Rs):- 
-	check_ivector(0,ExV,Index,Res), Rs=[Res]. 
-
-%=====================================================================
-check_ivector(Index,Vec,Len,Res):- 
-    Index < Len, vector_element(Vec,Index,Ele), Index =:= Ele | 
-	check_ivector(~(Index+1),Vec,Len,Res). 
-check_ivector(Index,_,Len,Res):- Index =:= Len | Res = done. 
-
diff -ruN klic-3.003-2002-03-16/shmtest/vector_built_2.kl1 klic-3.003-2002-03-19/shmtest/vector_built_2.kl1
--- klic-3.003-2002-03-16/shmtest/vector_built_2.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/vector_built_2.kl1	Thu Jan  1 09:00:00 1970
@@ -1,260 +0,0 @@
-:- module main. 
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [EXREF -> EXREF -> Vector] Begin ###',_), 
-	test_vector(Os2,Os3), 
-	test_guard_element(Os3,Os4), 
-	test_body_element(Os4,Os5), 
-	test_set_element_4(Os5,Os6), 
-	test_set_element_5(Os6,Os7), 
-	lib:prsl(Os7,[],'### InterNode Test [EXREF -> EXREF -> Vector] End ###',_). 
-
-%---------------------------------------------------------------------
-test_vector(Os,OsE):- 
-	lib:prs(Os,Os2,'vector: (a-u) : ',_), 
-	test_vector(Os2,OsE,Cs), 
-	Cs=[t({a},1,out(a)),
-	    t({b,a},2,out(b)),
-	    t({c,b,a},3,out(c)),
-	    t({d,c,b,a},4,out(d)),
-	    t({e,d,c,b,a},5,out(e)),
-	    t({1,{2},{3,4}},3,out(f)),
-	    t({1,[2],[3,4],[5,6,7]},4,out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},5,out(h)),
-	    t({{a}},1,out(i)),
-	    t({{{a}}},1,out(j)),
-	    t({{{{a}}}},1,out(k)),
-	    t({{{{a}}},{b}},2,out(l)),
-	    t({{{{a}}},{{b}}},2,out(m)),
-	    t({{{{a}}},{{{b}}}},2,out(n)),
-	    t({{a},[b,c]},2,out(o)),
-	    t({{[a]},[b,{c}]},2,out(p)),
-	    t({_},1,out(q)),
-	    t({a,_},2,out(r)),
-	    t({_,b,_},3,out(s)),
-	    t({_,_,c,_},4,out(t)),
-	    t({_,_,_,d,_},5,out(u))]. 
-
-test_vector(Os,OsE,[t(Vec,Len,out(Out))|Cs]):- 
-	lib:nextNodes(3,Ns), 
-	fetch_and_vector(ExV,Len,Res,Ack,Ns), 
-	lib:waitAndUnify(Ack,ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res],Out,_), 
-	test_vector(Os2,OsE,Cs). 
-test_vector(Os,OsE,[]):- lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_vector(ExV,PLen,Res,Ack,[Node|Ns]):- wait(Node) | 
-	fetch_and_vector(Var,PLen,Res,NextAck,Ns)@node(Node), 
-	lib:waitAndUnify(NextAck,Var,ExV), 
-	lib:waitAndUnify(NextAck,Ack,ack). 
-fetch_and_vector(ExV,PLen,Res,Ack,[]):- 
-	fetch_and_vector(ExV,PLen,Res,Ack). 
-
-fetch_and_vector(ExV,PLen,Res,Ack):- 
-	Ack=ack, fetch_and_vector(ExV,PLen,Res). 
-
-fetch_and_vector(ExV,PLen,Res):- vector(ExV,Len) | 
-	lib:eq(PLen,Len,Res).  
-
-%---------------------------------------------------------------------
-test_guard_element(Os,OsE):- 
-	lib:prs(Os,Os2,'(guard) vector_element : (a-p) : ',_), 
-	test_guard_element(Os2,OsE,Cs), 
-	Cs=[t({a},[a],out(a)),
-	    t({b,a},[b,a],out(b)),
-	    t({c,b,a},[c,b,a],out(c)),
-	    t({d,c,b,a},[d,c,b,a],out(d)),
-	    t({e,d,c,b,a},[e,d,c,b,a],out(e)),
-	    t({1,{2},{3,4}},[1,{2},{3,4}],out(f)),
-	    t({1,[2],[3,4],[5,6,7]},[1,[2],[3,4],[5,6,7]],out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},
-			[1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)],out(h)),
-	    t({{a}},[{a}],out(i)),
-	    t({{{a}}},[{{a}}],out(j)),
-	    t({{{{a}}}},[{{{a}}}],out(k)),
-	    t({{{{a}}},{b}},[{{{a}}},{b}],out(l)),
-	    t({{{{a}}},{{b}}},[{{{a}}},{{b}}],out(m)),
-	    t({{{{a}}},{{{b}}}},[{{{a}}},{{{b}}}],out(n)),
-	    t({{a},[b,c]},[{a},[b,c]],out(o)),
-	    t({{[a]},[b,{c}]},[{[a]},[b,{c}]],out(p))]. 
-
-test_guard_element(Os,OsE,[t(Vec,ELs,out(Out))|Cs]):- 
-	lib:nextNodes(3,Ns), 
-	fetch_and_guard_element(ExV,ELs,Res,Ack,Ns), 
-	lib:waitAndUnify(Ack,ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res],Out,_), 
-	test_guard_element(Os2,OsE,Cs). 
-test_guard_element(Os,OsE,[]):- lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_guard_element(ExV,ELs,Res,Ack,[Node|Ns]):- wait(Node) | 
-	fetch_and_guard_element(Var,ELs,Res,NextAck,Ns)@node(Node), 
-	lib:waitAndUnify(NextAck,Var,ExV), 
-	lib:waitAndUnify(NextAck,Ack,ack). 
-fetch_and_guard_element(ExV,ELs,Res,Ack,[]):- 
-	fetch_and_guard_element(ExV,ELs,Res,Ack). 
-
-fetch_and_guard_element(ExV,ELs,Res,Ack):- 
-	Ack=ack, 
-	fetch_and_guard_element_2(ExV,0,ELs,Rs), lib:check(Rs,Res). 
-
-fetch_and_guard_element_2(ExV,Index,[PEle|ELs],Rs):- 
-    vector_element(ExV,Index,Ele) | 
-	lib:eq(PEle,Ele,Done), Rs=[Done|Rs2], 
-	fetch_and_guard_element_2(ExV,~(Index+1),ELs,Rs2). 
-fetch_and_guard_element_2(_,_,[],Rs):- Rs=[]. 
-
-%---------------------------------------------------------------------
-test_body_element(Os,OsE):- 
-	lib:prs(Os,Os2,'(body) vector_element : (a-p) : ',_), 
-	test_body_element(Os2,OsE,Cs), 
-	Cs=[t({a},[a],out(a)),
-	    t({b,a},[b,a],out(b)),
-	    t({c,b,a},[c,b,a],out(c)),
-	    t({d,c,b,a},[d,c,b,a],out(d)),
-	    t({e,d,c,b,a},[e,d,c,b,a],out(e)),
-	    t({1,{2},{3,4}},[1,{2},{3,4}],out(f)),
-	    t({1,[2],[3,4],[5,6,7]},[1,[2],[3,4],[5,6,7]],out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},
-			[1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)],out(h)),
-	    t({{a}},[{a}],out(i)),
-	    t({{{a}}},[{{a}}],out(j)),
-	    t({{{{a}}}},[{{{a}}}],out(k)),
-	    t({{{{a}}},{b}},[{{{a}}},{b}],out(l)),
-	    t({{{{a}}},{{b}}},[{{{a}}},{{b}}],out(m)),
-	    t({{{{a}}},{{{b}}}},[{{{a}}},{{{b}}}],out(n)),
-	    t({{a},[b,c]},[{a},[b,c]],out(o)),
-	    t({{[a]},[b,{c}]},[{[a]},[b,{c}]],out(p))]. 
-
-test_body_element(Os,OsE,[t(Vec,ELs,out(Out))|Cs]):- 
-	lib:nextNodes(3,Ns), 
-	fetch_and_body_element(ExV,ELs,Res,Ack,Ns), 
-	lib:waitAndUnify(Ack,ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res],Out,_), 
-	test_body_element(Os2,OsE,Cs). 
-test_body_element(Os,OsE,[]):- lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_body_element(ExV,ELs,Res,Ack,[Node|Ns]):- wait(Node) | 
-	fetch_and_body_element(Var,ELs,Res,NextAck,Ns)@node(Node), 
-	lib:waitAndUnify(NextAck,Var,ExV), 
-	lib:waitAndUnify(NextAck,Ack,ack). 
-fetch_and_body_element(ExV,ELs,Res,Ack,[]):- 
-	fetch_and_body_element(ExV,ELs,Res,Ack). 
-
-fetch_and_body_element(ExV,ELs,Res,Ack):- 
-	Ack=ack, 
-	fetch_and_body_element_2(ExV,0,ELs,Rs), lib:check(Rs,Res). 
-
-fetch_and_body_element_2(ExV,Index,[PEle|ELs],Rs):- 
-	vector_element(ExV,Index,Ele), 
-	lib:eq(PEle,Ele,Done), Rs=[Done|Rs2], 
-	fetch_and_body_element_2(ExV,~(Index+1),ELs,Rs2). 
-fetch_and_body_element_2(_,_,[],Rs):- Rs=[]. 
-
-%---------------------------------------------------------------------
-test_set_element_4(Os,OsE):- 
-	lib:prs(Os,Os2,'set_vector_element/4 : (a-w) : ',_), 
-	test_set_element_4(Os2,OsE,Cs), 
-	Cs=[t({a},1,out(a)),
-	    t({b,a},2,out(b)),
-	    t({c,b,a},3,out(c)),
-	    t({d,c,b,a},4,out(d)),
-	    t({e,d,c,b,a},5,out(e)),
-	    t({f,e,d,c,b,a},6,out(f)),
-	    t({g,f,e,d,c,b,a},7,out(g)),
-	    t({h,g,f,e,d,c,b,a},8,out(h)),
-	    t({_},1,out(i)),
-	    t({_,_},2,out(j)),
-	    t({_,_,_},3,out(k)),
-	    t({_,_,_,_},4,out(l)),
-	    t({_,_,_,_,_},5,out(m)), 
-	    t({_,_,_,_,_,_},6,out(n)), 
-	    t({_,_,_,_,_,_,_},7,out(o)), 
-	    t({_,_,_,_,_,_,_,_},8,out(p)), 
-	    t({_,a},2,out(q)),
-	    t({_,a,_},3,out(r)),
-	    t({_,_,a,_},4,out(s)),
-	    t({a,_,_,_,a},5,out(t)), 
-	    t({_,a,_,_,a,_},6,out(u)), 
-	    t({_,_,a,_,a,_,_},7,out(v)), 
-	    t({_,a,_,a,_,a,_,_},8,out(w))]. 
-
-test_set_element_4(Os,OsE,[t(Vec,Len,out(Out))|Cs]):- 
-	lib:nextNodes(3,Ns), 
-	fetch_and_set_element_4(ExV,Len,Res,Ack,Ns), 
-	lib:waitAndUnify(Ack,ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res],Out,_), 
-	test_set_element_4(Os2,OsE,Cs). 
-test_set_element_4(Os,OsE,[]):- 
-	lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_set_element_4(ExV,Len,Res,Ack,[Node|Ns]):- wait(Node) | 
-	fetch_and_set_element_4(Var,Len,Res,NextAck,Ns)@node(Node), 
-	lib:waitAndUnify(NextAck,Var,ExV), 
-	lib:waitAndUnify(NextAck,Ack,ack). 
-fetch_and_set_element_4(ExV,Len,Res,Ack,[]):- 
-	fetch_and_set_element_4(ExV,Len,Res,Ack). 
-
-fetch_and_set_element_4(ExV,Len,Res,Ack):- 
-	Ack=ack, fetch_and_set_element_4_2(0,ExV,Len,Res). 
-
-fetch_and_set_element_4_2(Index,ExV,Len,Res):- Index < Len | 
-	set_vector_element(ExV,Index,Index,NewExV), 
-	fetch_and_set_element_4_2(~(Index+1),NewExV,Len,Res). 
-fetch_and_set_element_4_2(Index,ExV,Len,Res):- Index =:= Len | 
-	check_ivector(0,ExV,Len,Res). 
-
-%---------------------------------------------------------------------
-test_set_element_5(Os,OsE):- 
-	lib:prs(Os,Os2,'set_vector_element/5 : (a-p) : ',_), 
-	test_set_element_5(Os2,OsE,Cs), 
-	Cs=[t({a},[a],out(a)),
-	    t({b,a},[b,a],out(b)),
-	    t({c,b,a},[c,b,a],out(c)),
-	    t({d,c,b,a},[d,c,b,a],out(d)),
-	    t({e,d,c,b,a},[e,d,c,b,a],out(e)),
-	    t({1,{2},{3,4}},[1,{2},{3,4}],out(f)),
-	    t({1,[2],[3,4],[5,6,7]},[1,[2],[3,4],[5,6,7]],out(g)),
-	    t({1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)},
-			[1,f(2),g(3,4),h(5,6,7),i(8,9,10,11)],out(h)),
-	    t({{a}},[{a}],out(i)),
-	    t({{{a}}},[{{a}}],out(j)),
-	    t({{{{a}}}},[{{{a}}}],out(k)),
-	    t({{{{a}}},{b}},[{{{a}}},{b}],out(l)),
-	    t({{{{a}}},{{b}}},[{{{a}}},{{b}}],out(m)),
-	    t({{{{a}}},{{{b}}}},[{{{a}}},{{{b}}}],out(n)),
-	    t({{a},[b,c]},[{a},[b,c]],out(o)),
-	    t({{[a]},[b,{c}]},[{[a]},[b,{c}]],out(p))]. 
-
-test_set_element_5(Os,OsE,[t(Vec,ELs,out(Out))|Cs]):- 
-	lib:nextNodes(3,Ns), 
-	fetch_and_set_element_5(ExV,ELs,Res,Ack,Ns), 
-	lib:waitAndUnify(Ack,ExV,Vec), 
-	lib:checkAndPr(Os,Os2,[Res],Out,_), 
-	test_set_element_5(Os2,OsE,Cs). 
-test_set_element_5(Os,OsE,[]):- 
-	lib:prsl(Os,Os2,'...done',_), Os2 = OsE. 
-
-fetch_and_set_element_5(ExV,ELs,Res,Ack,[Node|Ns]):- wait(Node) | 
-	fetch_and_set_element_5(Var,ELs,Res,NextAck,Ns)@node(Node), 
-	lib:waitAndUnify(NextAck,Var,ExV), 
-	lib:waitAndUnify(NextAck,Ack,ack). 
-fetch_and_set_element_5(ExV,ELs,Res,Ack,[]):- 
-	fetch_and_set_element_5(ExV,ELs,Res,Ack). 
-
-fetch_and_set_element_5(ExV,ELs,Res,Ack):- 
-	Ack=ack, 
-	fetch_and_set_element_5_2(ExV,0,ELs,Rs), lib:check(Rs,Res). 
-
-fetch_and_set_element_5_2(ExV,Index,[PEle|ELs],Rs):- 
-	set_vector_element(ExV,Index,Ele,Index,NewExV), 
-	lib:eq(PEle,Ele,Done), Rs=[Done|Rs2], 
-	fetch_and_set_element_5_2(NewExV,~(Index+1),ELs,Rs2). 
-fetch_and_set_element_5_2(ExV,Index,[],Rs):- 
-	check_ivector(0,ExV,Index,Res), Rs=[Res]. 
-
-%=====================================================================
-check_ivector(Index,Vec,Len,Res):- 
-    Index < Len, vector_element(Vec,Index,Ele), Index =:= Ele | 
-	check_ivector(~(Index+1),Vec,Len,Res). 
-check_ivector(Index,_,Len,Res):- Index =:= Len | Res = done. 
-
diff -ruN klic-3.003-2002-03-16/shmtest/wec_exhaust_1.kl1 klic-3.003-2002-03-19/shmtest/wec_exhaust_1.kl1
--- klic-3.003-2002-03-16/shmtest/wec_exhaust_1.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/wec_exhaust_1.kl1	Thu Jan  1 09:00:00 1970
@@ -1,92 +0,0 @@
-% Test for "WEC exhausted" (1)
-
-% Unificatin and fetching when WEC is exhausted.  
-
-:- module main.
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [WEC exhausted (1)] Begin ###',_), 
-	test_ufy(Os2,Os3), 
-	test_fetch(Os3,Os4), 
-	lib:prsl(Os4,[],'### InterNode Test [WEC exhausted (1)] End ###',_). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%	import Node   			   export Node
-%	            <---(WEC=2**24)---
-%		     ------(WEC)------>  ---
-%		     ------(WEC)------>   |
-%		     ------(WEC)------>   |  N times
-%			     :            |
-%		     ------(WEC)------>  ---
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-test_ufy(Os,OsE):- 
-	lib:prs(Os,Os2,'unification (a-h) : ',_), 
-	test_ufy(Os2,OsE,Cs), 
-	Cs=[c(23,1,a),c(24,2,b),c(25,3,c),c(26,4,d),
-	    c(27,5,e),c(28,6,f),c(29,7,g),c(30,8,h)]. 
-
-test_ufy(Os,OsE,[c(N,Add,Out)|Cs]):- 
-	destnode(Add,Current,Dest), 
-	throw_consume_and_unify(X,N,Current,Dest), 
-	check_value(X,Check), pr(Os,Os2,Check,Out), 
-	test_ufy(Os2,OsE,Cs). 
-test_ufy(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-throw_consume_and_unify(X,N,Current,Dest):- wait(Dest) | 
-	consume_and_unify(X,N,Current)@node(Dest). 
-
-consume_and_unify(X,N,Parent):- wait(Parent) |
-	consume_and_unify(ack,X,N,Parent). 
-consume_and_unify(ack,X,N,Parent):- N > 0 | 
-	sendback_wec(X,Ack)@node(Parent), 
-	consume_and_unify(Ack,X,~(N-1),Parent). 
-consume_and_unify(ack,X,N,_):- N =:= 0 | X = value. 
-
-%---------------------------------------------------------------------------
-test_fetch(Os,OsE):- 
-	lib:prs(Os,Os2,'fetching (a-h) : ',_), 
-	test_fetch(Os2,OsE,Cs), 
-	Cs=[c(23,1,a),c(24,2,b),c(25,3,c),c(26,4,d),
-	    c(27,5,e),c(28,6,f),c(29,7,g),c(30,8,h)]. 
-
-test_fetch(Os,OsE,[c(N,Add,Out)|Cs]):- 
-	destnode(Add,Current,Dest), 
-	throw_consume_and_fetch(X,N,Current,Dest,Consumed,Check), 
-	unify_value(Consumed,X), pr(Os,Os2,Check,Out), 
-	test_fetch(Os2,OsE,Cs). 
-test_fetch(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-throw_consume_and_fetch(X,N,Current,Dest,Consumed,Check):- wait(Dest) | 
-	consume_and_fetch(X,N,Current,Consumed,Check)@node(Dest). 
-
-consume_and_fetch(X,N,Parent,Consumed,Check):- wait(Parent) |
-	consume_and_fetch(ack,X,N,Parent,Consumed,Check). 
-consume_and_fetch(ack,X,N,Parent,Consumed,Check):- N > 0 | 
-	sendback_wec(X,Ack)@node(Parent), 
-	consume_and_fetch(Ack,X,~(N-1),Parent,Consumed,Check). 
-consume_and_fetch(ack,X,N,_,Consumed,Check):- N =:= 0 | 
-	Consumed = done, check_value(X,Check). 
-
-%---------------------------------------------------------------------------
-sendback_wec(_,Ack) :- true | Ack = ack. 
-unify_value(done,X):- X = value. 
-check_value(value,Check):- Check = done. 
-
-%===========================================================================
-destnode(Add,Current,Dest):- 
-	current_node(Current,NumberOfNodes), 
-	modNode(~(Current+Add),NumberOfNodes,Dest).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-pr(Os,OsE,done,Out):- lib:prs(Os,OsE,Out,_). 
-otherwise. 
-pr(Os,OsE,_,Out):- lib:prs_err(Os,OsE,Out,_). 
-
diff -ruN klic-3.003-2002-03-16/shmtest/wec_exhaust_2.kl1 klic-3.003-2002-03-19/shmtest/wec_exhaust_2.kl1
--- klic-3.003-2002-03-16/shmtest/wec_exhaust_2.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/wec_exhaust_2.kl1	Thu Jan  1 09:00:00 1970
@@ -1,140 +0,0 @@
-% Test for "WEC exhausted" (2)
-
-% Unificatin and fetching when WEC is exhausted.  (2)
-% When exrefs form a chain of references.  
-
-:- module main.
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [WEC exhausted (2)] Begin ###',_), 
-	test_unify(Os2,Os3), 
-	test_fetch(Os3,Os4), 
-	lib:prsl(Os4,[],'### InterNode Test [WEC exhausted (2)] End ###',_). 
-
-%============================================================================
-%
-%	    %unify ------------------------------------>
-%	+---------+       +---------+                      +---------+       
-%	|EXREFx  -------->|EXREFx  --------> ...  -------->|         |
-%	+---------+       +---------+                      +---------+
-%
-%============================================================================
-
-test_unify(Os,OsE):- 
-	lib:prs(Os,Os2,'chain of exrefs : unification (a-f) : ',_), 
-	test_unify(Os2,OsE,Cs), 
-	Cs=[dd(dest([1,1,1,1]),data(term),out(a)),
-	    dd(dest([-1,-1,-1,-1]),data({a,b,c}),out(b)),
-	    dd(dest([1,2,3,4,5,6,7,8]),data([a,b,c,d,e,f,g]),out(c)),
-	    dd(dest([-1,-2,-3,-4,-5,-6,-7,-8]),data([a,[b,c],[d,e,f],g]),out(d)),
-	    dd(dest([1,-1,1,-1,1,-1,1,-1]),data([[[]]]),out(e)),
-	    dd(dest([-1,1,-2,2,-3,3,-4,4]),data([[a],[b],[c]]),out(f))]. 
-
-test_unify(Os,OsE,[dd(dest(Ds),data(Data),out(Out))|Cs]):- 
-	testEXREFs_unify(Ds,Data,Test), pr(Os,Os2,Test,Out), 
-	test_unify(Os2,OsE,Cs). 
-test_unify(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-%---------------------------------------------------------------------------
-testEXREFs_unify([D|Ds],TermData,Test) :- true | 
-	nextnode(D,NextNode), 
-	exportUnbound_unify(done,NextNode,EUNDF,Ds,TermData), 
-	termDetect_unify(EUNDF,TermData,Test).
-
-exportUnbound_unify(done,NextNode,Unbound,Ds,TermData) :- wait(NextNode) | 
-	testEXREF_unify(Unbound,Ds,TermData)@node(NextNode).
-
-termDetect_unify(EUNDF,TermData,Test) :- EUNDF = TermData | Test = done.
-otherwise.
-termDetect_unify(_,_,Test) :- true | Test = fail.
-
-testEXREF_unify(EXREF,[D|Ds],TermData) :- true |
-	sendWEC(EXREF,Send), nextnode(D,NextNode), 
-	exportUnbound_unify(Send,NextNode,EXREF,Ds,TermData).
-
-testEXREF_unify(EXREF,[],TermData) :- true | 
-	sendWEC(EXREF,Send), bindTermData(Send,EXREF,TermData).
-
-%============================================================================
-%
-%	    %read ------------------------------------->
-%	                    %read --------------------->
-%	+---------+       +---------+                      +---------+       
-%	|EXREF   -------->|EXREF   --------> ...  -------->|         |
-%	+---------+       +---------+                      +---------+
-%
-%============================================================================
-
-test_fetch(Os,OsE):- 
-	lib:prs(Os,Os2,'chain of exrefs : fetching (a-f) : ',_), 
-	test_fetch(Os2,OsE,Cs), 
-	Cs=[dd(dest([1,1,1,1]),data(term),out(a)),
-	    dd(dest([-1,-1,-1,-1]),data({a,b,c}),out(b)),
-	    dd(dest([1,2,3,4,5,6,7,8]),data([a,b,c,d,e,f,g]),out(c)),
-	    dd(dest([-1,-2,-3,-4,-5,-6,-7,-8]),data([a,[b,c],[d,e,f],g]),out(d)),
-	    dd(dest([1,-1,1,-1,1,-1,1,-1]),data([[[]]]),out(e)),
-	    dd(dest([-1,1,-2,2,-3,3,-4,4]),data([[a],[b],[c]]),out(f))]. 
-
-test_fetch(Os,OsE,[dd(dest(Ds),data(Data),out(Out))|Cs]):- 
-	testEXREFs_fetch(Ds,Data,Test), pr(Os,Os2,Test,Out), 
-	test_fetch(Os2,OsE,Cs). 
-test_fetch(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-%---------------------------------------------------------------------------
-testEXREFs_fetch([D|Ds],TermData,Test) :- true |
-	nextnode(D,NextNode), 
-	exportUnbound_fetch(done,NextNode,EUNDF,Ds,TermData,Gen,ParRead), 
-	bindTermData(Gen,EUNDF,TermData), 
-	termDetect_fetch(ParRead,Test).
-
-exportUnbound_fetch(done,NextNode,Unbound,Ds,TermData,Gen,Read) :- 
-    wait(NextNode) | 
-	testEXREF_fetch(Unbound,Ds,TermData,Gen,Read)@node(NextNode).
-
-termDetect_fetch(done,Test) :- true | Test = done.
-otherwise.
-termDetect_fetch(_,Test) :- true | Test = fail.
-
-testEXREF_fetch(EXREF,[D|Ds],TermData,Gen,MyRead) :- true |
-	sendWEC(EXREF,Send), nextnode(D,NextNode), 
-	exportUnbound_fetch(Send,NextNode,EXREF,Ds,TermData,Gen,ParRead), 
-	readTest(ParRead,EXREF,TermData,MyRead).
-
-testEXREF_fetch(EXREF,[],TermData,Gen,MyRead) :- true | 
-	sendWEC(EXREF,Send), 
-	endEXREFs(Send,EXREF,TermData,Gen,MyRead).
-
-endEXREFs(done,EXREF,TermData,Gen,MyRead) :- true | 
-	Gen = done, 
-	readTest(done,EXREF,TermData,MyRead).
-	
-readTest(done,EXREF,TermData,Read) :- EXREF = TermData | Read = done.
-otherwise.
-readTest(_,_,_,Read) :- true | Read = fail.
-
-%----------------------------------------------------------------------------
-bindTermData(done,EUNDF,TermData) :- true | EUNDF = TermData.
-sendWEC(EXREF,Send) :- true | 
-	nextnode(OtherNode), sendWEC(done,30,OtherNode,EXREF,Send).
-sendWEC(done,N,DestNode,EXREF,Send) :- N > 0, wait(DestNode) | 
-	consumeWEC(EXREF,Consume)@node(DestNode), 
-	NM1 := N - 1, sendWEC(Consume,NM1,DestNode,EXREF,Send).
-sendWEC(done,N,_,_,Send) :- N = 0 | Send = done. 
-consumeWEC(_,Consume) :- true | Consume = done. 
-
-%============================================================================
-nextnode(Next) :- true | nextnode(1,Next).
-
-nextnode(Add,Next):- 
-	current_node(Current,NumberOfNodes), 
-	modNode(~(Current+Add),NumberOfNodes,Next).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-pr(Os,OsE,done,Out):- lib:prs(Os,OsE,Out,_). 
-otherwise. 
-pr(Os,OsE,_,Out):- lib:prs_err(Os,OsE,Out,_). 
diff -ruN klic-3.003-2002-03-16/shmtest/wec_exhaust_3.kl1 klic-3.003-2002-03-19/shmtest/wec_exhaust_3.kl1
--- klic-3.003-2002-03-16/shmtest/wec_exhaust_3.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/wec_exhaust_3.kl1	Thu Jan  1 09:00:00 1970
@@ -1,99 +0,0 @@
-% Test for "WEC exhausted" (3)
-
-% Unificatin between chains of exrefs when WEC is exhausted.  
-
-:- module main.
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [WEC exhausted (3)] Begin ###',_), 
-	test_ufy(Os2,Os3), 
-	lib:prsl(Os3,[],'### InterNode Test [WEC exhausted (3)] End ###',_). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%   unify(X = Y)
-%
-%	+---------+       +---------+                      +---------+       
-%     X	|EXREFx  -------->|EXREFx  --------> ...  -------->|         |
-%	+---------+       +---------+                      +---------+
-%
-%	+---------+       +---------+                      +---------+       
-%     Y	|EXREFx  -------->|EXREFx  --------> ...  -------->|         |
-%	+---------+       +---------+                      +---------+
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-test_ufy(Os,OsE):- 
-	lib:prs(Os,Os2,'unification of chains of exrefs (a-g) : ',_), 
-	test_ufy(Os2,OsE,Cs), 
-	Cs=[dd(dests([4,-1,-1,-1],[4,-1,-1,-1]),data(term),out(a)),
-	    dd(dests([4,-1,-1,-1],[-4,1,1,1]),data({a,b,c}),out(b)),
-	    dd(dests([36,-8,-7,-6,-5,-4,-3,-2],[44,-9,-8,-7,-6,-5,-4,-3]),
-		data([a,b,c,d,e,f,g]),out(c)),
-	    dd(dests([-8,2,2,2],[-8,1,1,1,1,1,1,1]),
-		data([a,[b,c],[d,e,f],g]),out(d)),
-	    dd(dests([24,-3,-3,-3,-3,-3,-3,-3],
-		     [24,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2]),
-		data([a,[b,c],[d,e,f],g]),out(e)),
-	    dd(dests([0,1,-1,1,-1,1,-1,1],[0,-1,1,-1,1,-1,1,-1]),
-		data([[[]]]),out(f)),
-	    dd(dests([0,1,-1,1,-1,1,-1,1],[-1,1,-1,1,-1,1,-1,1,-1]),
-		data([[a],[b],[c]]),out(g))]. 
-
-test_ufy(Os,OsE,[dd(dests(Ds1,Ds2),data(Data),out(Out))|Cs]):- 
-	testUnifyEXREFs(Ds1,Ds2,Data,Test), pr(Os,Os2,Test,Out), 
-	test_ufy(Os2,OsE,Cs). 
-test_ufy(Os,OsE,[]):- lib:prsl(Os,OsE,'...done',_). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-testUnifyEXREFs(DXs,DYs,TermData,Test) :- 
-	genWEConeEXREFs(DXs,VX), genWEConeEXREFs(DYs,VY), 
-	unifyXY(VX,VY,Unify), bindTerm(Unify,VX,TermData,Bind), 
-	testUnify(Bind,VY,TermData,Test).
-unifyXY({X},{Y},Unify) :- X = Y, Unify = done.
-bindTerm(done,{X},TermData,Bind) :- X = TermData, Bind = done.
-testUnify(done,{Y},TermData,Test) :- Y = TermData | Test = done.
-otherwise.
-testUnify(_,_,_,Test) :- Test = fail.
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-genWEConeEXREFs([D|Ds],VX) :- 
-	nextnode(D,RootNode), startGenEXREFs(RootNode,Ds,VX).
-genWEConeEXREFs([],VX) :- VX = {_}.
-startGenEXREFs(RootNode,Ds,VX) :- wait(RootNode) | 
-	rootEXREFs(Ds,VX)@node(RootNode). 
-rootEXREFs([D|Ds],VX) :- 
-	nextnode(D,NextNode), exportUnbound(done,NextNode,EUNDF,Ds,VX). 
-rootEXREFs([],VX) :- VX = {_}, Gen = done.
-exportUnbound(done,NextNode,Unbound,Ds,VX) :- wait(NextNode) | 
-	genEXREF(Unbound,Ds,VX)@node(NextNode).
-genEXREF(EXREF,[D|Ds],VX) :- 
-	sendWEC(EXREF,Send), nextnode(D,NextNode), 
-	exportUnbound(Send,NextNode,EXREF,Ds,VX).
-genEXREF(EXREF,[],VX) :- 
-	sendWEC(EXREF,Send), bindEXREFs(Send,VX,EXREF).
-bindEXREFs(done,VX,EXREF) :- VX = {EXREF}.
-sendWEC(EXREF,Send) :- 
-	nextnode(OtherNode), sendWEC(done,30,OtherNode,EXREF,Send).
-sendWEC(done,N,DestNode,EXREF,Send) :- N > 0, wait(DestNode) | 
-	consumeWEC(EXREF,Consume)@node(DestNode), 
-	NM1 := N - 1, sendWEC(Consume,NM1,DestNode,EXREF,Send).
-sendWEC(done,N,_,_,Send) :- N = 0 | Send = done. 
-consumeWEC(_,Consume) :- Consume = done. 
-
-%============================================================================
-nextnode(Next) :- nextnode(1,Next).
-
-nextnode(Add,Next):- 
-	current_node(Current,NumberOfNodes), 
-	modNode(~(Current+Add),NumberOfNodes,Next).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-pr(Os,OsE,done,Out):- lib:prs(Os,OsE,Out,_). 
-otherwise. 
-pr(Os,OsE,_,Out):- lib:prs_err(Os,OsE,Out,_). 
diff -ruN klic-3.003-2002-03-16/shmtest/wec_indirect.kl1 klic-3.003-2002-03-19/shmtest/wec_indirect.kl1
--- klic-3.003-2002-03-16/shmtest/wec_indirect.kl1	Thu Dec 27 19:15:56 2001
+++ klic-3.003-2002-03-19/shmtest/wec_indirect.kl1	Thu Jan  1 09:00:00 1970
@@ -1,229 +0,0 @@
-% Test for "WEC: indirect export"
-
-:- module main.
-
-main :- lib:io(Os), 
-	lib:prsl(Os,Os2,'### InterNode Test [WEC Indirect Exportation] Begin ###',_), 
-	lib:prs(Os2,Os3,'indirect export (a-f) : ',_), 
-	tr00(Os3,Os4), 
-	lib:prsl(Os4,[],'### InterNode Test [WEC Indirect Exportation] End ###',_). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%	import Node		import Node		export Node
-%          (L)                     (M)                     (R)
-%	+-------+		+-------+		+-------+
-%       |       |-------------->| WEC=1 |-------------->| EUNDF |
-%	+-------+   %read->	+-------+		+-------+
-%        ^Read                                           ^Unify
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr00(Os,OsE):- cn_node(CP,NP), tr00(Os,OsE,CP,NP).
-tr00(Os,OsE,CP,NP):- wait(NP) | tr00M(X,F,CP)@node(NP), tr00R(Os,OsE,X,F).
-tr00R(Os,OsE,X,ack(F)):- X=term, tr00Rw(Os,OsE,F).
-tr00Rw(Os,OsE,ack):- lib:prs(Os,Os2,a,_), tr00next(Os2,OsE).
-otherwise.
-tr00Rw(Os,OsE,_):- lib:prs_err(Os,Os2,a,_), tr00next(Os2,OsE).
-
-tr00M(X,F,CP):- consumeWEC(X,CP,W), n_node(NP), tr00M(X,F,NP,W).
-tr00M(X,F,NP,ack):- wait(NP) | tr00L(X,F)@node(NP).
-
-tr00L(X,F):- F=ack(F2), tr00Lw(X,F2).
-tr00Lw(term,F):- F=ack.
-otherwise.
-tr00Lw(_,F):- F=nak.
-
-tr00next(Os,OsE):- n_node(Node), tr00next(Os,OsE,Node).
-tr00next(Os,OsE,Node):- wait(Node) | tr01(Os,OsE)@node(Node).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%	import Node		import Node		export Node
-%          (L)                     (M)                     (R)
-%	+-------+		+-------+		+-------+
-%       |       |-------------->| WEC=1 |-------------->| EUNDF |
-%	+-------+   %unify->	+-------+		+-------+
-%        ^Unify                                          ^Read
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr01(Os,OsE):- cn_node(CP,NP), tr01(Os,OsE,CP,NP).
-tr01(Os,OsE,CP,NP):- wait(NP) | tr01M(X,CP)@node(NP), tr01Rw(Os,OsE,X).
-
-tr01Rw(Os,OsE,term):- lib:prs(Os,Os2,b,_), tr01next(Os2,OsE).
-otherwise.
-tr01Rw(Os,OsE,_):- lib:prs_err(Os,Os2,b,_), tr01next(Os2,OsE).
-
-tr01M(X,CP):- consumeWEC(X,CP,W), n_node(NP), tr01M(X,NP,W).
-tr01M(X,NP,ack):- wait(NP) | tr01L(X)@node(NP).
-
-tr01L(X):- X=term.
-
-tr01next(Os,OsE):- n_node(Node), tr01next(Os,OsE,Node).
-tr01next(Os,OsE,Node):- wait(Node) | tr02(Os,OsE)@node(Node).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%	import Node		import Node		export Node
-%          (L1)                    (M)                     (R)
-%	+-------+   %unify->	+-------+		+-------+
-%       |       |-------------->| WEC=1 |-------------->| EUNDF |
-%	+-------+	    +-->+-------+		+-------+
-%          (L2)             |
-%	+-------+           |
-%       |       |-----------+
-%	+-------+   %read->
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr02(Os,OsE):- cn_node(CP,NP), tr02(Os,OsE,CP,NP).
-tr02(Os,OsE,CP,NP):- wait(NP) | tr02M(X,F,CP)@node(NP), tr02Rw(Os,OsE,F).
-
-tr02Rw(Os,OsE,ack):- lib:prs(Os,Os2,c,_), tr02next(Os2,OsE).
-otherwise.
-tr02Rw(Os,OsE,_):- lib:prs_err(Os,Os2,c,_), tr02next(Os2,OsE).
-
-tr02M(X,F,CP):- consumeWEC(X,CP,W), n_node2(N1,N2), tr02M(X,F,N1,N2,W).
-tr02M(X,F,N1,N2,ack):- wait(N1), wait(N2) |
-	tr02L1(X,G)@node(N1), tr02L2(X,G,F)@node(N2).
-
-tr02L1(X,ack):- X=term.
-
-tr02L2(X,G,F):- G=ack, tr02Lw(X,F).
-tr02Lw(term,F):- F=ack.
-otherwise.
-tr02Lw(_,F):- F=nak.
-
-tr02next(Os,OsE):- n_node(Node), tr02next(Os,OsE,Node).
-tr02next(Os,OsE,Node):- wait(Node) | tr03(Os,OsE)@node(Node).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%	import Node		import Node		export Node
-%          (L1)
-%	+-------+
-%       |       |-----------+
-%	+-------+  %read->  |
-%          (L2)             |      (M)                     (R)
-%	+-------+  %read->  +-->+-------+		+-------+
-%       |       |-------------->| WEC=1 |-------------->| EUNDF |
-%	+-------+	    +-->+-------+		+-------+
-%          (L3)             |                            ^Unify
-%	+-------+           |
-%       |       |-----------+
-%	+-------+  %read->
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr03(Os,OsE):- cn_node(CP,NP), tr03(Os,OsE,CP,NP).
-tr03(Os,OsE,CP,NP):- wait(NP) | 
-	tr03M(X,F1,F2,F3,CP)@node(NP), tr03R(Os,OsE,X,F1,F2,F3).
-tr03R(Os,OsE,X,ack(F1),ack(F2),ack(F3)):- X=term, tr03Rw(Os,OsE,F1,F2,F3).
-tr03Rw(Os,OsE,ack,ack,ack):- lib:prs(Os,Os2,d,_), tr03next(Os2,OsE).
-otherwise.
-tr03Rw(Os,OsE,_,_,_):- lib:prs_err(Os,Os2,d,_), tr03next(Os2,OsE).
-
-tr03M(X,F1,F2,F3,CP):- true |
-	consumeWEC(X,CP,W), n_node3(N1,N2,N3), tr03M(X,F1,F2,F3,N1,N2,N3,W).
-tr03M(X,F1,F2,F3,N1,N2,N3,ack):- wait(N1),wait(N2),wait(N3) |
-	tr03L(X,F1)@node(N1), tr03L(X,F2)@node(N2),
-	tr03L(X,F3)@node(N3).
-
-tr03L(X,F):- F=ack(F2), tr03Lw(X,F2).
-tr03Lw(term,F):- F=ack.
-otherwise.
-tr03Lw(_,F):- F=nak.
-
-tr03next(Os,OsE):- n_node(Node), tr03next(Os,OsE,Node).
-tr03next(Os,OsE,Node):- wait(Node) | tr04(Os,OsE)@node(Node).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%	import Node		import Node		export Node
-%          (L)                     (M)                     (R)
-%	+-------+		+-------+		+-------+
-%       |       |-------------->| WEC=1 |-------------->| EUNDF |
-%	+-------+   %read->	+-------+		+-------+
-%        ^Read-2                 ^Read-1                 ^Unify
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr04(Os,OsE):- cn_node(CP,NP), tr04(Os,OsE,CP,NP).
-tr04(Os,OsE,CP,NP):- wait(NP) | tr04M(X,F,CP)@node(NP), tr04R(Os,OsE,X,F).
-tr04R(Os,OsE,X,ack(F1,F2)):- X=term, tr04Rw(Os,OsE,F1,F2).
-tr04Rw(Os,OsE,ack,ack):- lib:prs(Os,Os2,e,_), tr04next(Os2,OsE).
-otherwise.
-tr04Rw(Os,OsE,_,_):- lib:prs_err(Os,Os2,e,_), tr04next(Os2,OsE).
-
-tr04M(X,F,CP):- consumeWEC(X,CP,W), n_node(NP), tr04M(X,F,NP,W).
-tr04M(X,F,NP,ack):- wait(NP) | tr04L(X,F2)@node(NP), tr04Mw(X,F,F2).
-tr04Mw(X,F,ack(F0,F1)):- F=ack(F0,F2), tr04Mw(X,F1,F2).
-tr04Mw(term,F1,F2):- F1=ack, F2=ack.
-otherwise.
-tr04Mw(_,F1,F2):- F1=ack, F2=nak.
-
-tr04L(X,F):- F=ack(F0,F1), tr04Lw(X,F0,F1).
-tr04Lw(X,F,ack):- tr04Lw(X,F).
-tr04Lw(term,F):- F=ack.
-otherwise.
-tr04Lw(_,F):- F=nak.
-
-tr04next(Os,OsE):- n_node(Node), tr04next(Os,OsE,Node).
-tr04next(Os,OsE,Node):- wait(Node) | tr05(Os,OsE)@node(Node).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%	import Node		import Node		export Node
-%          (L1)
-%	+-------+   {term}
-%       |       |-----------+
-%	+-------+ %unify->  |
-%          (L2)             |      (M)                     (R)
-%	+-------+   {A}     +-->+-------+		+-------+
-%       |       |-------------->| WEC=1 |-------------->| EUNDF |
-%	+-------+ %unify->  +-->+-------+		+-------+
-%          (L3)             |                            ^Unify
-%	+-------+   {A}     |
-%       |       |-----------+
-%	+-------+ %unify->
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr05(Os,OsE):- cn_node(CP,NP), tr05(Os,OsE,CP,NP).
-tr05(Os,OsE,CP,NP):- wait(NP) | 
-	tr05M(X,F2,F3,CP)@node(NP), tr05Rw(Os,OsE,F2,F3).
-tr05Rw(Os,OsE,ack,ack):- lib:prs(Os,Os2,f,_), tr05next(Os2,OsE).
-otherwise.
-tr05Rw(Os,OsE,_,_):- lib:prs_err(Os,Os2,f,_), tr05next(Os2,OsE).
-
-tr05M(X,F2,F3,CP):- true |
-	consumeWEC(X,CP,W), n_node3(N1,N2,N3), tr05M(X,F2,F3,N1,N2,N3,W).
-tr05M(X,F2,F3,N1,N2,N3,ack):- wait(N1),wait(N2),wait(N3) |
-	tr05L1(X,S1)@node(N1), tr05L2(X,F2,S2)@node(N2),
-	tr05L2(X,F3,S3)@node(N3), tr05Ms(S1,S2,S3).
-tr05Ms(ack(F1),ack(F2),ack(F3)):- F1=ack, F2=ack, F3=ack.
-
-tr05L1(X,S):- S=ack(W), tr05L1u(X,W).
-tr05L1u(X,ack):- X={term}.
-
-tr05L2(X,F,S):- S=ack(W), tr05L2u(X,F,W).
-tr05L2u(X,F,ack):- X={A}, tr05L2w(A,F).
-tr05L2w(term,F):- F=ack.
-otherwise.
-tr05L2w(_,F):- F=nak.
-
-tr05next(Os,OsE):- n_node(Node), tr05next(Os,OsE,Node).
-tr05next(Os,OsE,Node):- wait(Node) | tr06(Os,OsE)@node(Node).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-tr06(Os,OsE):- lib:prsl(Os,OsE,' ...done',_). 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-nextnode(Add,Next):- 
-	current_node(Current,NumberOfNodes), 
-	modNode(~(Current+Add),NumberOfNodes,Next).  
-nextnode(Add,Current,Next):- 
-	current_node(Current,NumberOfNodes), 
-	modNode(~(Current+Add),NumberOfNodes,Next).  
-
-modNode(CalNode,NumberOfNodes,Node) :- CalNode >= 0 | 
-	Node := CalNode mod NumberOfNodes.
-modNode(CalNode,NumberOfNodes,Node) :- CalNode <  0 | 
-	CalNode2 := CalNode + NumberOfNodes, 
-	modNode(CalNode2,NumberOfNodes,Node).
-
-n_node(Next) :- nextnode(1,Next).
-cn_node(Current,Next):- nextnode(1,Current,Next). 
-n_node2(Next1,Next2):- nextnode(1,Next1), nextnode(2,Next2). 
-n_node3(Next1,Next2,Next3):- 
-	nextnode(1,Next1), nextnode(2,Next2), nextnode(3,Next3). 
-
-consumeWEC(X,PP,F):- wait(PP) | consumeWEC(X,PP,F,ack,30).
-consumeWEC(X,PP,F,ack,N):- N>0, NN:=N-1 |
-	sendBackWEC(X,A)@node(PP), consumeWEC(X,PP,F,A,NN).
-consumeWEC(_,_,F,ack,0):- F=ack.
-
-sendBackWEC(_,F):- F=ack.
