25a26,27
> int global_unify_attr(ptr_node,ptr_node);   /*  RM: Feb  9 1993  */
> int global_unify(ptr_psi_term,ptr_psi_term);        /*  RM: Feb 11 1993  */
45,46d46
< void x_hide_subwindow(Display *,long);
< void x_show_subwindow(Display *,long);
68a69,70
> void assert_attributes(ptr_psi_term);
>      
242,243c244,245
< 	  /* p->aaaa_3=exact_copy(head2,HEAP); 24.8 25.8 */
< 	  /* p->bbbb_3=exact_copy(body,HEAP); 24.8 25.8 */
---
> 	  /* p->aaaa_2=exact_copy(head2,HEAP); 24.8 25.8 */
> 	  /* p->bbbb_2=exact_copy(body,HEAP); 24.8 25.8 */
323c325
<   /*  RM: Feb 22 1993  defined c_alias in modules.c
---
>   /*  RM: Feb 22 1993  defined c_alias in modules.c 
749c751
<     x_destroy_window((unsigned long)u->aaaa_3,(unsigned long)u->bbbb_3);
---
>     x_destroy_window((unsigned long)u->aaaa,(unsigned long)u->bbbb);
752c754
<     x_show_window((unsigned long)u->aaaa_3,(unsigned long)u->bbbb_3);
---
>     x_show_window((unsigned long)u->aaaa,(unsigned long)u->bbbb);
755c757
<     x_hide_window((unsigned long)u->aaaa_3,(unsigned long)u->bbbb_3);
---
>     x_hide_window((unsigned long)u->aaaa,(unsigned long)u->bbbb);
894c896
<       cmp=featcmp((*u)->key,v->key);
---
>       cmp=featcmp((*u)->key,v->key,FEATURECMP);
899c901
< 	push_goal(unify,(*u)->data,v->data,NULL);
---
> 	push_goal(unify,(ptr_psi_term)(*u)->data,(ptr_psi_term)v->data,NULL);
946c948
<       cmp=featcmp((*u)->key,v->key);
---
>       cmp=featcmp((*u)->key,v->key,FEATURECMP);
989c991
<       push_ptr_value(int_ptr,u);
---
>       push_ptr_value(int_ptr,(GENERIC *)u);
997c999
<       cmp=featcmp((*u)->key,v->key);
---
>       cmp=featcmp((*u)->key,v->key,FEATURECMP);
1070c1072
<       cmp=featcmp((*u)->key,v->key);
---
>       cmp=featcmp((*u)->key,v->key,FEATURECMP);
1184c1186
<   push2_ptr_value(int_ptr,&(u->status),(u->status & SMASK));
---
>   push2_ptr_value(int_ptr,(GENERIC *)&(u->status),(GENERIC)(u->status & SMASK));
1194c1196
<       if (allflag || prop->cccc_1==utype) {
---
>       if (allflag || prop->cccc_4==utype) {
1196,1197c1198,1199
<         v=eval_copy(prop->aaaa_3,STACK);
<         w=eval_copy(prop->bbbb_3,STACK);
---
>         v=eval_copy(prop->aaaa_4,STACK);
>         w=eval_copy(prop->bbbb_4,STACK);
1199c1201
<         if (w) push_goal(prove,w,DEFRULES,NULL);
---
>         if (w) push_goal(prove,w,(ptr_psi_term)DEFRULES,NULL);
1204c1206
<         i_eval_args(v->aaaa_3ttr_list);
---
>         i_eval_args(v->attr_list);
1248c1250
<   push_ptr_value(int_ptr,&(u->status));
---
>   push_ptr_value(int_ptr,(GENERIC *)&(u->status));
1263,1265c1265,1267
<       /* In matches, mi is TRUE iff oldi <| prop->cccc_1.            */
<       if (!checked1) m1=FALSE; else matches(old1,prop->cccc_1,&m1);
<       if (!checked2) m2=FALSE; else matches(old2,prop->cccc_1,&m2);
---
>       /* In matches, mi is TRUE iff oldi <| prop->cccc_4.            */
>       if (!checked1) m1=FALSE; else matches(old1,prop->cccc_4,&m1);
>       if (!checked2) m2=FALSE; else matches(old2,prop->cccc_4,&m2);
1267c1269
< 	/* At this point, prop->cccc_1 is an attribute that has not yet */
---
> 	/* At this point, prop->cccc_4 is an attribute that has not yet */
1270,1271c1272,1273
< 	v=eval_copy(prop->aaaa_3,STACK);
< 	w=eval_copy(prop->bbbb_3,STACK);
---
> 	v=eval_copy(prop->aaaa_4,STACK);
> 	w=eval_copy(prop->bbbb_4,STACK);
1273c1275
< 	if (w) push_goal(prove,w,DEFRULES,NULL);
---
> 	if (w) push_goal(prove,w,(ptr_psi_term)DEFRULES,NULL);
1306c1308
< long unify_body();
---
> long unify_body(long);
1460c1462
<               success=(strcmp((char *)u->value,(char *)v->value)==0);
---
>               success=(lf_strcmp((char *)u->value,(char *)v->value)==0);
1487c1489
< 	push_psi_ptr_value(v,&(v->coref));
---
> 	push_psi_ptr_value(v,(GENERIC *)&(v->coref));
1491c1493
< 	  push_ptr_value(def_ptr,&(u->type));
---
> 	  push_ptr_value(def_ptr,(GENERIC *)&(u->type));
1493c1495
<           /* push_def_ptr_value(u,&(u->type)); */ /* 14.8 */
---
>           /* push_def_ptr_value(u,(GENERIC *)&(u->type)); */ /* 14.8 */
1498c1500
< 	  push_ptr_value(int_ptr,&(u->status));
---
> 	  push_ptr_value(int_ptr,(GENERIC *)&(u->status));
1521c1523
< 	      push_ptr_value(int_ptr,&(u->status));
---
> 	      push_ptr_value(int_ptr,(GENERIC *)&(u->status));
1530c1532
< 	  push_ptr_value(int_ptr,&(u->flags));
---
> 	  push_ptr_value(int_ptr,(GENERIC *)&(u->flags));
1544c1546
<           push_choice_point(type_disj,u,d,NULL);
---
>           push_choice_point(type_disj,u,(ptr_psi_term)d,NULL);
1621,1622c1623,1624
< 	      if (thegoal->type->type==predicate) {
< 		if (!rule) /* This can happen when RETRACT is used */
---
> 	      if (thegoal->type->type==predicate) {	
> 	if (!rule) /* This can happen when RETRACT is used */
1629a1632
> 
1645c1648
< 		  push_goal(prove,bool_pred,DEFRULES,NULL);
---
> 		  push_goal(prove,bool_pred,(ptr_psi_term)DEFRULES,NULL);
1649c1652
< 	      else if (!thegoal->type->protected && thegoal->type->type==undef) {
---
>    	      else if (!thegoal->type->protected && thegoal->type->type==undef) {
1671c1674
< 		push_goal(prove,call_handler,DEFRULES,NULL);
---
> 		push_goal(prove,call_handler,(ptr_psi_term)DEFRULES,NULL);
1711c1714
< 		while (rule && (rule->aaaa_1==NULL || rule->bbbb_1==NULL)) {
---
> 		while (rule && (rule->aaaa_2==NULL || rule->bbbb_2==NULL)) {
1720c1723
< 		    head=eval_copy(rule->aaaa_3,STACK);
---
> 		    head=eval_copy(rule->aaaa_2,STACK);
1722c1725
< 		    head=quote_copy(rule->aaaa_3,STACK);
---
> 		    head=quote_copy(rule->aaaa_2,STACK);
1724c1727
< 		  body=eval_copy(rule->bbbb_3,STACK);
---
> 		  body=eval_copy(rule->bbbb_2,STACK);
1731c1734
< 		    push_choice_point(prove,thegoal,rule->next,NULL);
---
> 		    push_choice_point(prove,thegoal,(ptr_psi_term)rule->next,NULL);
1734c1737
< 		    push_goal(prove,body,DEFRULES,NULL);
---
> 		    push_goal(prove,body,(ptr_psi_term) DEFRULES,NULL);
1736,1737c1739,1740
< 		  /* push_ptr_value(psi_term_ptr,&(head->coref)); 9.6 */
< 		  push_psi_ptr_value(head,&(head->coref));
---
> 		  /* push_ptr_value(psi_term_ptr,(GENERIC *)&(head->coref)); 9.6 */
> 		  push_psi_ptr_value(head,(GENERIC *)&(head->coref));
1756,1757c1759,1760
< 	  push_choice_point(prove,arg2,DEFRULES,NULL);
< 	  push_goal(prove,arg1,DEFRULES,NULL);
---
> 	  push_choice_point(prove,arg2,(ptr_psi_term)DEFRULES,NULL);
> 	  push_goal(prove,arg1,(ptr_psi_term)DEFRULES,NULL);
1774,1775c1777,1778
<       push_goal(prove,arg2,DEFRULES,NULL);
<       push_goal(prove,arg1,DEFRULES,NULL);
---
>       push_goal(prove,arg2,(ptr_psi_term)DEFRULES,NULL);
>       push_goal(prove,arg1,(ptr_psi_term)DEFRULES,NULL);
1803c1806
<     push_choice_point(type_disj,t,d->next,NULL);
---
>     push_choice_point(type_disj,t,(ptr_psi_term)d->next,NULL);
1806c1809
<   push_ptr_value(def_ptr,&(t->type));
---
>   push_ptr_value(def_ptr,(GENERIC *)&(t->type));
1808c1811
<   /* push_def_ptr_value(t,&(t->type)); */ /* 14.8 */
---
>   /* push_def_ptr_value(t,(GENERIC *)&(t->type)); */ /* 14.8 */
1842c1845
< 	push_choice_point(del_clause,head,body,&((*p)->next));
---
> 	push_choice_point(del_clause,head,body,(GENERIC)&((*p)->next));
1847c1850
< 	push_choice_point(clause,head,body,&((*p)->next));
---
> 	push_choice_point(clause,head,body,(GENERIC)&((*p)->next));
1852,1853c1855,1856
<       push_goal(retract,p,NULL,NULL);
<     if ((*p)->aaaa_3) {
---
>       push_goal(retract,(ptr_psi_term)p,NULL,NULL);
>     if ((*p)->aaaa_2) {
1855,1856c1858,1859
<       rule_head=quote_copy((*p)->aaaa_3,STACK);
<       rule_body=quote_copy((*p)->bbbb_3,STACK);
---
>       rule_head=quote_copy((*p)->aaaa_2,STACK);
>       rule_body=quote_copy((*p)->bbbb_2,STACK);
1991c1994
< long what_next_aim()
---
> long what_next_aim(long level)
1992a1996
>   static long last_lev = 0;
1998c2002
<   long level,i;
---
>   long i;
2001c2005
<   
---
> 
2003,2004c2007,2008
<   
<   level=((unsigned long)aim->cccc_1);
---
> 
>   //   level=((unsigned long)aim->cccc_1);
2036a2041,2045
>     //    if (lev <= level + 2 && lev >= level - 2 && level < MAX_LEVEL && level > 0)
>     //    lev = level;
>     // else 
>       //   lev = 0;
> 
2045,2047c2054,2061
<     for(i=1;i<=lev;i++) { *pr='-'; pr++; *pr='-'; pr++; }
<     if (level>0)
<       sprintf(pr,"%ld",level);
---
> 
>     // added if for abort test DJD 2.06
>     if (aborthooksym->type != function )
>       {
> 	for(i=1;i<=lev;i++) { *pr='-'; pr++; *pr='-'; pr++; }
> 	if (lev>0)
> 	  sprintf(pr,"%ld",level);
>       }
2061c2075
<     push_goal(what_next,TRUE,FALSE+2*TRUE,level /* +1 RM: Jun 22 1993 */);
---
>     push_goal(what_next,(ptr_psi_term)TRUE,(ptr_psi_term)FALSE+2*TRUE,(GENERIC)(level + 1) /* +1 RM: Jun 22 1993 */);
2089c2103
<       if (level>0) push_choice_point(what_next,FALSE,FALSE,level);
---
>       if (level>0) push_choice_point(what_next,FALSE,FALSE,(GENERIC)(level) );
2100,2101c2114,2115
<         push_goal(what_next,TRUE,var_occurred,level+1);
<         push_goal(prove,s,DEFRULES,NULL);
---
>         push_goal(what_next,(ptr_psi_term)TRUE,(ptr_psi_term)var_occurred,(GENERIC)level+1);
>         push_goal(prove,s,(ptr_psi_term)DEFRULES,NULL);
2106c2120
<         push_goal(what_next,TRUE,FALSE,level+1); /* 18.5 */
---
>         push_goal(what_next,(ptr_psi_term)TRUE,FALSE,(GENERIC)(level+1)); /* 18.5 */
2117c2131
<         push_goal(what_next,TRUE,FALSE,level+1); /* 20.8 */
---
>         push_goal(what_next,(ptr_psi_term)TRUE,FALSE,(GENERIC)(level+1)); /* 20.8 */
2148c2162
<   char *fn;
---
>   GENERIC fn;
2163c2177
<   fn=(char*)aim->cccc_1;
---
>   fn=(GENERIC)aim->cccc_1;
2181c2195,2198
<       if (input_stream!=stdin) fclose(input_stream);
---
>       if (input_stream != NULL && input_stream!=stdin) {
> 	fclose(input_stream);
> 	input_stream = NULL;
>       }
2191a2209
> 
2194,2197c2212,2215
<       push_choice_point(load,input_state,file_date,fn);
<       push_goal(load,input_state,file_date,fn);
<       push_goal(general_cut,cutpt,NULL,NULL);
<       push_goal(prove,s,DEFRULES,NULL);
---
>       push_choice_point(load,input_state,(ptr_psi_term)file_date,fn);
>       push_goal(load,input_state,(ptr_psi_term)file_date,fn);
>       push_goal(general_cut,(ptr_psi_term)cutpt,NULL,NULL);
>       push_goal(prove,s,(ptr_psi_term)DEFRULES,NULL);
2204,2205c2222,2227
<       if (input_stream!=stdin) fclose(input_stream);
<       abort_life(TRUE);
---
>       if (input_stream != NULL && input_stream!=stdin) {
> 	fclose(input_stream);
> 	input_stream = NULL;
> 	abort_life(TRUE);
>       }
> 
2221c2243
< 	   
---
>     // restored next 3 lines DJD 2.07 - did not affect test suite
2223,2224c2245,2248
<        find_module(((ptr_psi_term)get_attr(input_state,
<        CURRENT_MODULE))->value));
---
> 		       find_module(((ptr_psi_term)get_attr(input_state,
> 							   CURRENT_MODULE))->value));
>     set_current_module(find_module(((ptr_psi_term)get_attr(input_state, CURRENT_MODULE))->value));
>     
2249c2273
<     
---
>   long level = 0;
2254c2278
<   
---
> 
2417a2442
> 
2419c2444
<       success=what_next_aim();
---
>       success=what_next_aim(level+1);
2445,2447c2470,2472
<                 (*p)->aaaa_1,((*p)->aaaa_1->type->type==function?"->":":-"),(*p)->bbbb_1);
<       (*p)->aaaa_1=NULL;
<       (*p)->bbbb_1=NULL;
---
>                 (*p)->aaaa_2,((*p)->aaaa_2->type->type==function?"->":":-"),(*p)->bbbb_2);
>       (*p)->aaaa_2=NULL;
>       (*p)->bbbb_2=NULL;
2492a2518
> 
2514c2540
<         }
---
> 	}
