Received: from derwent.co.uk by nags2.nag.co.uk (4.1/UK-2.1)
	id AA14292; Tue, 23 Jan 96 15:16:57 GMT
Received: by derwent.co.uk (4.1/SMI-4.1)
	id AA26586; Tue, 23 Jan 96 15:09:48 GMT
Date: Tue, 23 Jan 96 15:09:48 GMT
From: peterb@derwent (Peter Broadbery)
Message-Id: <9601231509.AA26586@derwent.co.uk>
To: ax-bugs@uk.co.nag

Subject: fixbug
By: PAB
Fixed: bug1033.as
--* Received: from uk.ac.nsfnet-relay by nags2.nag.co.uk (4.1/UK-2.1)
--* 	id AA23530; Thu, 19 Oct 95 14:42:41 BST
--* Received: from neptune.ethz.ch by sun2.nsfnet-relay.ac.uk with Internet SMTP 
--*           id <g.20254-0@sun2.nsfnet-relay.ac.uk>;
--*           Thu, 19 Oct 1995 14:38:30 +0100
--* Received: from ru7.inf.ethz.ch (bronstei@ru7.inf.ethz.ch [129.132.12.16]) 
--*           by inf.ethz.ch (8.6.10/8.6.10) with ESMTP id OAA24167 
--*           for <ax-bugs@nag.co.uk>; Thu, 19 Oct 1995 14:37:04 +0100
--* From: Manuel Bronstein <bronstei@ch.ethz.inf>
--* Received: (bronstei@localhost) by ru7.inf.ethz.ch (8.6.8/8.6.6) id OAA29823 
--*           for ax-bugs@nag.co.uk; Thu, 19 Oct 1995 14:37:03 +0100
--* Date: Thu, 19 Oct 1995 14:37:03 +0100
--* Message-Id: <199510191337.OAA29823@ru7.inf.ethz.ch>
--* To: ax-bugs@uk.co.nag
--* Subject: [5] compile time bomb at -Q3 only

--@ Bug Number:  bug1033.as 
--@ Fixed  by:  PAB   
--@ Tested by:  optbug.as 
--@ Summary:    Unsure, but it seems fixed now. 

-- Command line: axiomxl -Q3 optbug.as
-- Version: 1.1.4
-- Original bug file name: optbug.as

----------------------------- optbug.as ----------------------------------
--
-- This file needs minisumit
--
-- % axiomxl -Q2 optbug.as
--
-- % axiomxl -Q3 optbug.as
-- Illegal instruction
--

#include "sumit.as"

macro {
	I	== SingleInteger;
	Z	== Integer;
}

Foo(R:CommutativeRing, Px:UnivariatePolynomialCategory R, m:Px):Ring with {
	if R has FiniteCharacteristic then FiniteCharacteristic;
} == {
	import from I, Z;
	N:I == retract(degree(m)$Px);

	add {
	macro Rep == DenseUnivariatePolynomial R;

	import from Z, Rep, R;

	finiteChar?:Boolean		:= R has FiniteCharacteristic;

	0				== per(0$Rep);
	1				== per(1$Rep);
	(p:%) + (q:%):%			== per(rep p + rep q);
	(p:%) * (q:%):%			== p;
	(p:%) = (q:%):Boolean		== rep p = rep q;
	-(p:%):%			== per(- rep p);
	coerce(n:Z):%			== per(n::Rep);
	coerce(n:I):%			== per(n::Rep);

	(p:%)^(n:Z):% == {
		finiteChar? => charppow(p, n);
		import from BinaryPowering(%, times!, Z);
		power(1, p, n);
	}

	if R has FiniteCharacteristic then {
		charppow(p:%, n:Z):%	== power(p, n)$PthPowering(%);
		pthPower(p:%):%		== p;
	}
	}
}

