--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Thu Aug 12 01:38:22 1993
--* Received: from yktvmv2.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA19174; Thu, 12 Aug 1993 01:38:22 -0400
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 6615; Thu, 12 Aug 93 01:39:44 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.EDWARDS.NOTE.YKTVMV.8419.Aug.12.01:39:43.-0400>
--*           for asbugs@watson; Thu, 12 Aug 93 01:39:44 -0400
--* Received: from ibm4.scri.fsu.edu by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Thu, 12 Aug 93 01:39:42 EDT
--* Received: by ibm4.scri.fsu.edu id AA24059
--*   (5.65c/IDA-1.4.4 for asbugs@watson.ibm.com); Thu, 12 Aug 1993 01:39:36 -0400
--* Date: Thu, 12 Aug 1993 01:39:36 -0400
--* From: Robert Edwards <edwards@ibm4.scri.fsu.edu>
--* Message-Id: <199308120539.AA24059@ibm4.scri.fsu.edu>
--* To: asbugs@watson.ibm.com
--* Subject: compiler fails assertion [bug13.as][v29.5 AIX RS/6000 (debug version)]

--@ Fixed  by:  SSD   Mon Oct 18 15:53:02 1993 
--@ Tested by:  none 
--@ Summary:    removed the incorrect assertion 

--+ % asharp -rv bug13.as
--+ A# version 29.5 for AIX RS/6000 (debug version)
--+ Assertion failed, file "../src/tform.c" line 1747: id && abSyme(id)
#include "aslib.as"

-- Note, domain doesn't implement every function in Ring signature


macro
  SI == SingleInteger


RAW1 ==>
-- compiler complains about different things if no imports here
    import
      Integer
      SI
      Segment SI

    size(x:%):SI == ndim
    trace(x:%):R == 1$Integer pretend R
    (x:% + y:%):% == 1$Integer pretend %
    (x:% - y:%):% == 1$Integer pretend %
    (x:% * y:%):% == 1$Integer pretend %
    apply(p:Outport, m:%):Outport ==
      import String
      p("SquareMatrix")()

    matrix(m:Array Array R):% == 1$Integer pretend %


SquareMatrixCategory(ndim:SI,R:Ring): Category == Ring
 with
    trace: % -> R
    elt: (%,SI,SI) -> R
    setelt: (%,SI,SI,R) -> R
    new: (R) -> %
    matrix: Array Array R -> %
    size: % -> SI

    default RAW1



SquareMatrix(ndim:SI,R:Ring): SquareMatrixCategory(ndim,R) ==
  add
    Rep ==> Array R

    import
      Rep
      SI

--    RAW1

    (x:%  = y:%):Bit == rep(x)  = rep(y)
    (x:% ~= y:%):Bit == rep(x) ~= rep(y)

    new(a:R):% == 1$Integer pretend %

    elt(m:%,i:SI,j:SI):R == 1$Integer pretend %

    setelt(m:%,i:SI,j:SI,r:R):R == 1$Integer pretend %
 
