Received: from nldi16.nag.co.uk by nags2.nag.co.uk (4.1/UK-2.1)
	id AA19653; Sun, 17 Sep 95 18:29:34 BST
From: Peter Broadbery <peterb@uk.co.nag>
Date: Sun, 17 Sep 95 18:26:10 +0100
Message-Id: <3015.9509171726@nldi16.nag.co.uk>
Received: by nldi16.nag.co.uk (920330.SGI/NAg-1.0)
	id AA03015; Sun, 17 Sep 95 18:26:10 +0100
Subject: fixbug
By: PAB+SSD
Fixed: bug972.as
Apparently-To: ax-bugs@nag.co.uk

From asbugs@com.ibm.watson Thu May 25 20:58:15 1995
Date: Thu, 25 May 1995 15:32:57 -0400
From: asbugs@com.ibm.watson (S Watt)
To: bronstei@ch.ethz.inf, dooley@com.ibm.watson, iglio@it.unipi.dm.posso,
        peterb@uk.co.nag, smwatt@com.ibm.watson
Subject: Received A# bug972
Sender: asbugs@com.ibm.watson


  Reporter:    bronstei@inf.ethz.ch
  Number:      bug972
  Description: [2] optimizer problem with integers [int.as][1.1.0]

Thank you for your bug report.  It has been assigned bug number bug972.

If you wish to discuss this bug via E-mail, please direct your messages
to specific people and include the bug number.

------------------------------ bug972.as ---------------------------------
--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Thu May 25 15:32:53 1995
--* Received: from yktvmv-ob.watson.ibm.com by asharp.watson.ibm.com (AIX 3.2/UCB 5.64/930311)
--*           id AA17463; Thu, 25 May 1995 15:32:53 -0400
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 6789; Thu, 25 May 95 15:32:53 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.BRONSTEI.NOTE.YKTVMV.5537.May.25.15:32:52.-0400>
--*           for asbugs@watson; Thu, 25 May 95 15:32:53 -0400
--* Received: from inf.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Thu, 25 May 95 15:32:52 EDT
--* Received: from mendel.inf.ethz.ch (bronstei@mendel.inf.ethz.ch [129.132.12.20]) by inf.ethz.ch (8.6.10/8.6.10) with ESMTP id VAA04456 for <asbugs@watson.ibm.com>; Thu, 25 May 1995 21:32:22 +0200
--* From: Manuel Bronstein <bronstei@inf.ethz.ch>
--* Received: (bronstei@localhost) by mendel.inf.ethz.ch (8.6.10/8.6.10) id VAA02895 for asbugs@watson.ibm.com; Thu, 25 May 1995 21:27:30 +0200
--* Date: Thu, 25 May 1995 21:27:30 +0200
--* Message-Id: <199505251927.VAA02895@mendel.inf.ethz.ch>
--* To: asbugs@watson.ibm.com
--* Subject: [2] optimizer problem with integers [int.as][1.1.0]

--@ Bug Number:  bug972.as 
--@ Fixed  by:  PAB+SSD   
--@ Tested by:  opt2.as 
--@ Summary:    default tracking improved 

------------------------------- int.as ----------------------------
--
-- Optimizing changes the value of 6/3:
--
-- % axiomxl -Q1 -Fx int.as
-- % int
-- 6 / 3 = 2
--
-- % axiomxl -Q2 -Fx int.as
-- % int
-- 6 / 3 = 6
--

#include "axllib.as"

IntegerCategory: Category == IntegerNumberSystem with {
	exactQuotient: (%, %) -> Partial %;
	default {
		exactQuotient(x:%, y:%):Partial(%) == {
			(q, r) := divide(x, y);
			zero? r => [q];
			failed
		}
	}
};

extend Integer: IntegerCategory == add {};

import from Integer, Partial Integer;

print << "6 / 3 = " << retract exactQuotient(6, 3) << newline;




