gap> 
gap> 
gap> # Start
gap> 
gap> START_TEST( "Test of the 'if' package" );
gap> SizeScreen([80]);;
gap> 
gap> 
gap> IF_Interface(IF_maple, "gcd", [1000, 360] );
40
gap> 
gap> 
gap> # `..`
gap> 
gap> IF_Type(IF_maple, [-5..3]);
"`..`"
gap> IF_ConvertFromGap(IF_maple, [-5..3]);
"-5 .. 3"
gap> IF_Interface(IF_maple, "", [[-5..3]]);
[ -5 .. 3 ]
gap> 
gap> 
gap> # integer
gap> 
gap> l := [-11^120, -1, 0, 1, 10^120];;
gap> List(l, x->IF_Type(IF_maple, x));
[ "integer", "integer", "integer", "integer", "integer" ]
gap> l=List(l, x-> IF_Interface(IF_maple, "", [x]));
true
gap> 
gap> 
gap> # string
gap> 
gap> l := Difference([0..255], IF_PROHIBITED_CHARS[IF_maple]);;
gap> l1:= List( l{[1..110]}, CHAR_INT);;
gap> l2:= List( l{[110..Length(l)]}, CHAR_INT);;
gap> for i in [l1,l2] do
>     ConvertToStringRep( i );
>     if not i=IF_Interface(IF_maple, "", [i]) then
>         Print( "different strings!\n" );
>     fi;
> od;
gap> 
gap> 
gap> # list
gap> 
gap> l:=[ [ 2 .. 5 ], 53, "ciao", [ 1, 2, 4 ], 33/4 ];;
gap> l=IF_Interface(IF_maple, "", [l] );
true
gap> []=IF_Interface(IF_maple, "", [[]]); # empty list
true
gap> 
gap> 
gap> # exprseq
gap> 
gap> IF_Interface(IF_maple, "whattype", "1,2,3");
"exprseq"
gap> IF_Interface(IF_maple, "", "1,2,3");
[ 1, 2, 3 ]
gap> 
gap> 
gap> # boolean
gap> 
gap> IF_Interface(IF_maple, "not", [true] );
false
gap> IF_Interface(IF_maple, "not", [false] );
true
gap> IF_Interface(IF_maple, "FAIL or", [false] );
fail
gap> 
gap> 
gap> # rational
gap> 
gap> c:=Enumerator(Rationals);
<enumerator of Rationals>
gap> for i in [1..20] do
>   if not c[i]=IF_Interface(IF_maple, "", [c[i]] ) then
>     Print( c[i], " ", fail, "\n");
>   fi;
> od;
gap> 
gap> 
gap> # complex
gap> 
gap> Print( "imaginary unit ", IF_Interface(IF_maple, "", [E(4)] ), "\n" );
imaginary unit E(4)
gap> c:=Enumerator(GaussianRationals);
<enumerator of GaussianRationals>
gap> for i in [1..50] do
>   if not c[i]=IF_Interface(IF_maple, "", [c[i]] ) then
>     Print( i, " ", c[i], " ", fail, "\n");
>   fi;
> od;
gap> root_10_2 := IF_Interface(IF_maple, "root", [10,2]);
-E(40)^7+E(40)^13-E(40)^21-E(40)^23-E(40)^29+E(40)^31+E(40)^37+E(40)^39
gap> root_10_2^2=10;
true
gap> 
gap> 
gap> # extended_numeric
gap> 
gap> infinity = IF_Interface(IF_maple, "", [infinity]);
true
gap> 
gap> 
gap> # polynom
gap> 
gap> R:=PolynomialRing(Rationals, 4);;
gap> g:=GeneratorsOfLeftOperatorRingWithOne(R);;
gap> p1:=g[1]*g[3]^3-12*g[2]*g[4]*g[1]^4;;
gap> p1=IF_Interface(IF_maple, "", [p1] );
true
gap> 
gap> x:=Indeterminate(Rationals);;
gap> y:=Indeterminate(Rationals,[x]);;
gap> IF_Interface(IF_maple, "PolynomialTools[MinimalPolynomial]", [4+E(4),6]) =
> IF_MAPLE__X^2-8*IF_MAPLE__X+17;
true
gap> IF_Interface(IF_maple, "solve", [x^2+4*x+1]);
[ 2*E(12)^4-E(12)^7+2*E(12)^8+E(12)^11, 2*E(12)^4+E(12)^7+2*E(12)^8-E(12)^11 ]
gap> IF_Interface(IF_maple, "solve", [x^2+4*x+y,x-y]);
#I  Warning in Maple: Warning, solving for expressions other than names or fun\
ctions is not recommended.
[  ]
gap> 
gap> 
gap> # ratpoly
gap> 
gap> q:= g[2]^3*g[3]^2+4*g[1]+g[4]^6-8;;
gap> r1 :=p1/q;;
gap> r1=IF_Interface(IF_maple, "", [r1] );
true
gap> 
gap> 
gap> # SDMPolynom
gap> 
gap> IF_Interface(IF_maple, "", "x_1^3+5*x_1^2+11*x_1+15")= 
> IF_Interface(IF_maple, "", "SDMPolynom(x_1^3+5*x_1^2+11*x_1+15,x_1)");
true
gap> 
gap> 
gap> # float
gap> 
gap> IF_Interface(IF_maple, "fsolve", [x^2+4*x+1]);
[ "-3.732050808", "-.2679491924" ]
gap> 
gap> 
gap> # Matrix
gap> 
gap> m:=[[11,12,13],[21,22,23]];
[ [ 11, 12, 13 ], [ 21, 22, 23 ] ]
gap> IF_ConvertFromGap( IF_maple,m);
"Matrix( 2, 3, [\n[11,12,13],\n[21,22,23]] )"
gap> m=IF_Interface( IF_maple,"",[m]);
true
gap> 
gap> m:=[[11/5]];
[ [ 11/5 ] ]
gap> IF_ConvertFromGap( IF_maple,m);
"Matrix( 1, 1, [\n[11/5]] )"
gap> m=IF_Interface( IF_maple,"",[m]);
true
gap> 
gap> m:=[[11/5,12/5,13/5],[21/5,22/5,23/5]];
[ [ 11/5, 12/5, 13/5 ], [ 21/5, 22/5, 23/5 ] ]
gap> IF_ConvertFromGap( IF_maple,m);
"Matrix( 2, 3, [\n[11/5,12/5,13/5],\n[21/5,22/5,23/5]] )"
gap> m=IF_Interface( IF_maple,"",[m]);
true
gap> 
gap> m:=[[ 4*g[1]*g[3]^2, -g[2]-g[4]],
>  [ E(4)*g[1]+g[1]^2*g[2]^3, (-1-E(4))*g[3]-2*(1+E(4))*g[4]]];;
gap> m=IF_Interface( IF_maple,"",[m]);
true
gap> 
gap> IF_Interface( IF_maple, "", [EmptyMatrix(0)] )=EmptyMatrix(0);
true
gap> 
gap> # Vector[row]
gap> 
gap> m:=[11,12,13,21,22,23];
[ 11, 12, 13, 21, 22, 23 ]
gap> IF_ConvertFromGap( IF_maple,m);
"Vector[row]( 6, [11,12,13,21,22,23] )"
gap> m=IF_Interface( IF_maple,"",[m]);
true
gap> 
gap> m:= [p1,q,r1];;
gap> m=IF_Interface( IF_maple,"",[m]);
true
gap> 
gap> 
gap> 
gap> # end of test file
gap> 
gap> STOP_TEST( "test", 10000 );
Test of the 'if' package
GAP4stones: 1
