--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Thu Jul 28 11:08:05 1994
--* Received: from yktvmv-ob.watson.ibm.com by asharp.watson.ibm.com (AIX 3.2/UCB 5.64/930311)
--*           id AB15200; Thu, 28 Jul 1994 11:08:05 -0400
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 5027; Thu, 28 Jul 94 11:08:08 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.ROOT.NOTE.VAGENT2.8289.Jul.28.11:08:07.-0400>
--*           for asbugs@watson; Thu, 28 Jul 94 11:08:08 -0400
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id 8283; Thu, 28 Jul 1994 11:08:07 EDT
--* Received: from daly.watson.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with TCP; Thu, 28 Jul 94 11:08:06 EDT
--* Received: by daly.watson.ibm.com (AIX 3.2/UCB 5.64/4.03)
--*           id AA21170; Thu, 28 Jul 1994 11:06:25 -0500
--* Date: Thu, 28 Jul 1994 11:06:25 -0500
--* From: root@daly.watson.ibm.com
--* Message-Id: <9407281606.AA21170@daly.watson.ibm.com>
--* To: asbugs@watson.ibm.com
--* Subject: [1] DOS 36.0 compiler crashes on this file [bug1.as][DOS 36.0]

--@ Fixed  by:  SSD   Thu Aug 4 14:05:50 EDT 1994 
--@ Tested by:  none 
--@ Summary:    Extended tfSat to support a way of computing the sublist for K(%) without checking (again) that % is an L. 

#if BugHeaders
LastSeenBy: PI
LastUpdate: 01/Aug/94
BugKeywords: tinfer
Priority: 4
Comments: Look for a complete report.
Comments:
SeenBy:
Updates:
#endif
#assert modified
#if modified


-- PI: The problem is in the last line (crash also on linux)

Type: with == add;

Category: with == add;

Tuple(T: Type): with == add;

((A: Tuple Type) -> (R: Tuple Type)): with == add;

Join(T: Tuple Category): Category == with;

A: Category == with;

B: Category == with;

C(T: Type): Category == with;

D: Category == Join(A,C(B)) with;

E: Category == D with;

F: Category == E with;

J: Category == D with;

L: Category == Join(J,E) with;

K(R:L):Category == J with;

M: Category == Join(L,F,K(%)) with;  -- PI: The problem is here

#if 0
--------------------------------------------------------------------------

- PI 08/01/94:

The problem is in the category definition involving %. When the definition:

	M: Category == Join(L,F,K(%)) with;

is analysed, the compiler goes in an infinite recursion. Follows the repeated
fragment of stack frame and the values of S and T in tfsat.

#4  0x43497 in tfSat (mask=65425, S=0x148500, T=0x143680) at ../src/tfsat.c:730
#5  0x42db8 in tfSatArg (mask=65425, ab=0x119480, T=0x143680)
    at ../src/tfsat.c:556
#6  0x42a9b in tfSatAsMulti (mask=65457, sigma=0x238d00, S=0x143a00, 
    TScope=0x11f600, ab=0x1194c0, argc=1, argf=0x9711c <abApplyArgf>)
    at ../src/tfsat.c:489
#7  0x42805 in tfSatMapArgs (mask=65457, sigma=0x238d00, S=0x11f600, 
    ab=0x1194c0, argc=1, argf=0x9711c <abApplyArgf>) at ../src/tfsat.c:424
#8  0x42643 in tfSatSubList (ab=0x1194c0) at ../src/tfsat.c:369
#9  0x25860 in abGetCatSelfSelf (sefo=0x1194c0) at ../src/tform.c:2295
#10 0x25a91 in tfGetCatSelfSelf (cat=0x148480) at ../src/tform.c:2337
#11 0x25eef in tfGetCatParents (cat=0x148480, top=0) at ../src/tform.c:2418
#12 0x265da in tfGetCatParentsFrJoin (cat=0x146f00) at ../src/tform.c:2567
#13 0x25e11 in tfGetCatParents (cat=0x146f00, top=0) at ../src/tform.c:2406
#14 0x26098 in tfGetCatParentsFrWith (cat=0x148500) at ../src/tform.c:2454
#15 0x25db1 in tfGetCatParents (cat=0x148500, top=1) at ../src/tform.c:2400
#16 0x4426f in tfSatCatExports (mask=65425, S=0x148500, T=0x143680)
    at ../src/tfsat.c:1050

#17 0x43497 in tfSat (mask=65425, S=0x148500, T=0x143680) at ../src/tfsat.c:730
(again...)

in tfsat:
--------

S is
(struct tform *) 0x148500
<* With <* Join <* General (* L *) *> <* General (* F *) *> <* General (* (* K *) (* % *) *) *> *> <* Multiple *> *>

T is 
(struct tform *) 0x143680
<* General (* L *) *>

(the address of S and T is the same in each subsequent tfsat call)


!!!!!! PROBABLY bug765.as COME FROM THE SAME PROBLEM. Once you fix this, check
bug765.as !!!!!!!!!

#endif

#else   -- original


Type: with == add;

Category: with == add;

Tuple(T: Type): with == add;

((A: Tuple Type) -> (R: Tuple Type)): with == add;

Join(T: Tuple Category): Category == with;

A: Category == with;

B: Category == with;

C(T: Type): Category == with;

D: Category == Join(A,C(B)) with;

E: Category == D with;

F: Category == E with;

J: Category == D with;

L: Category == Join(J,E) with;

K(R:L):Category == J with;

M: Category == Join(L,F,K(%)) with;


#endif

 
