/*
 * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED 
 * All rights reserved.
 * 
 * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
 * non-exclusive and royalty-free license to use, copy, modify and
 * redistribute, solely for non-commercial and non-profit purposes, the
 * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
 * conditions of this Agreement. For the avoidance of doubt, you acquire
 * only a limited right to use the SOFTWARE hereunder, and FLL or any
 * third party developer retains all rights, including but not limited to
 * copyrights, in and to the SOFTWARE.
 * 
 * (1) FLL does not grant you a license in any way for commercial
 * purposes. You may use the SOFTWARE only for non-commercial and
 * non-profit purposes only, such as academic, research and internal
 * business use.
 * (2) The SOFTWARE is protected by the Copyright Law of Japan and
 * international copyright treaties. If you make copies of the SOFTWARE,
 * with or without modification, as permitted hereunder, you shall affix
 * to all such copies of the SOFTWARE the above copyright notice.
 * (3) An explicit reference to this SOFTWARE and its copyright owner
 * shall be made on your publication or presentation in any form of the
 * results obtained by use of the SOFTWARE.
 * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
 * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
 * for such modification or the source code of the modified part of the
 * SOFTWARE.
 * 
 * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
 * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
 * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
 * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
 * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
 * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
 * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
 * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
 * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
 * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
 * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
 * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
 * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
 * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
 * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
 *
 * $OpenXM: OpenXM_contrib2/asir2000/lib/alpi,v 1.3 2000/08/22 05:04:20 noro Exp $ 
*/
A4 = [
x+y+z+t,
x*y+y*z+z*t+t*x,
x*y*z+y*z*t+z*t*x+t*x*y,
x*y*z*t-1
]$

A5 = [
x+y+z+t+u,
x*y+y*z+z*t+t*u+u*x,
x*y*z+y*z*t+z*t*u+t*u*x+u*x*y,
x*y*z*t+y*z*t*u+z*t*u*x+t*u*x*y+u*x*y*z,
x*y*z*t*u-1
]$

MA = [
a+b+c+d+e,
a*b+b*c+c*d+d*e+e*a,
a*b*c+b*c*d+c*d*e+d*e*a+e*a*b,
b*c*d+b*c*d*e+c*d*e*a+d*e*a*b+e*a*b*c,
a*b*c*d*e-1
]$

La = [
a^2*b*c+a*b^2*c+a*b*c^2+a*b*c+a*b+a*c+b*c,
a^2*b^2*c+a*b^2*c^2+a^2*b*c+a*b*c+b*c+a+c,
a^2*b^2*c^2+a^2*b^2*c+a*b^2*c+a*b*c+a*c+c+1
]$

Mo = [x*b-y*a,(x-1)*d-y*(c-1),b^2+a^2-r^2,(c-1)^2+d^2-s^2,(a-c)^2+(b-d)^2-t^2]$

Ca = [
y^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a+aA^3,
-z*t*u+y*t*v+y*z*w-x*v*w-y^2*b+x*u*b+bB^3,
-t^2*u+2*y*t*w-x*w^2-y^2*c+x*u*c+cC^3,
-z*t*v+z^2*w+y*t*a-x*w*a-y*z*b+x*v*b+dD^3,
-t^2*v+z*t*w+y*t*b-x*w*b-y*z*c+x*v*c+eE^3,
-t*v^2+z*v*w+t*u*a-y*w*a-z*u*b+y*v*b+fF^3,
-t*v*w+z*w^2+t*u*b-y*w*b-z*u*c+y*v*c+gG^3,
-t^2*a+2*z*t*b-x*b^2-z^2*c+x*a*c+hH^3,
-t*w*a+t*v*b+z*w*b-y*b^2-z*v*c+y*a*c+iI^3,
-w^2*a+2*v*w*b-u*b^2-v^2*c+u*a*c+jJ^3
]$

C2=[
x^3*y^2+4*x^2*y^2*z-x^2*y*z^2+288*x^2*y^2+207*x^2*y*z+1152*x*y^2*z+156*
    x*y*z^2+x*z^3-3456*x^2*y+20736*x*y^2+19008*x*y*z+82944*y^2*z+432*x*z^2-
    497664*x*y+62208*x*z+2985984*x,
y^3*t^3+4*y^3*t^2-y^2*z*t^2+4*y^2*t^3-48*y^2*t^2-5*y*z*t^2+108*y*z*t+
    z^2*t+144*z*t-1728*z,
x^2*z^2*t-4*x*z^2*t^2-z^3*t^2-x^3*z-156*x^2*z*t-207*x*z^2*t-1152*x*z*
    t^2-288*z^2*t^2-432*x^2*z-19008*x*z*t+3456*z^2*t-82944*x*t^2-20736*z*t^2-
    62208*x*z+497664*z*t-2985984*z,
y^3*t^3-x*y^2*t^2+4*y^3*t^2+4*y^2*t^3-5*x*y^2*t-48*y^2*t^2+x^2*y+108*x*
    y*t+144*x*y-1728*x
]$	

A=nm(z^3+(432+156*y-x*y)*z^2+(4*x*y^2+207*x*y+1152*y^2+19008*y+62208+82944*y^2/x)*z
+(x*y+144*y-1728)^2)$
B=nm(red(t^3-(x-4*y+48)*t^2/(y+4)+(-5*y+108)*x*t/(y*(y+4))+x*(x*y+144*y-1728)/(y^2*(y+4))))$
C=subst(A,x,xx,y,yy,z,zz,xx,z,yy,t,zz,x)$
D=subst(B,x,xx,y,yy,t,tt,xx,z,yy,t,tt,y)$ Co=[A,B,C,D]$
OCo=[x,y,z,t]$

IP1=[x^2*y*z^4-t,x^5*y^7-z^2*u,-x^3*z*v+y^2,-z^5*w+x*y^3]$
IP2=[-y^82*a+x^32*z^23,x^45-y^13*z^21*b,y^33*z^12-x^41*c,
-y^33*z^12*d+x^22,x^5*y^17*z^22*e-1,x*y*z*tT-1]$
OIP2=[tT,x,y,z,a,b,c,d,e]$
end$
