# utils, chapter 10
#
# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!
#
# This file has been generated by AutoDoc. It contains examples extracted from
# the package documentation. Each example is preceded by a comment which gives
# the name of a GAPDoc XML file and a line range from which the example were
# taken. Note that the XML file in turn may have been generated by AutoDoc
# from some other input.
#
gap> START_TEST("utils10.tst");

# doc/../lib/gslp.gd:34-46
gap> gslp:= GeneralizedStraightLineProgram( "union",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> IsGeneralizedStraightLineProgram( gslp );
true
gap> slp:= StraightLineProgram( [[[1,2]]], 1 );
<straight line program>
gap> IsGeneralizedStraightLineProgram( slp );
true
gap> IsGeneralizedStraightLineProgram( [ slp, slp ] );
false

# doc/../lib/gslp.gd:194-203
gap> GeneralizedStraightLineProgram( [[[1,2]]], 1 );
<straight line program>
gap> GeneralizedStraightLineProgram( "union",
> [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> GeneralizedStraightLineProgram( "compose",
> [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>

# doc/../lib/gslp.gd:77-83
gap> gslp:= GeneralizedStraightLineProgram( "union",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> DataOfGeneralizedStraightLineProgram( gslp );
[ "union", [ <straight line program>, <straight line program> ] ]

# doc/../lib/gslp.gd:111-116
gap> NrInputsOfGeneralizedStraightLineProgram(
>        GeneralizedStraightLineProgram( "union",
>            [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] ) );
1

# doc/../lib/gslp.gd:146-155
gap> NrOutputsOfGeneralizedStraightLineProgram(
>        GeneralizedStraightLineProgram( "union",
>            [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] ) );
2
gap> NrOutputsOfGeneralizedStraightLineProgram(
>        GeneralizedStraightLineProgram( "compose",
>            [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] ) );
1

# doc/../lib/gslp.gd:248-260
gap> gens:= [ (1,2,3,4,5,6) ];;
gap> gslp:= GeneralizedStraightLineProgram( "union",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> ResultOfGeneralizedStraightLineProgram( gslp, gens );
[ (1,3,5)(2,4,6), (1,4)(2,5)(3,6) ]
gap> gslp:= GeneralizedStraightLineProgram( "compose",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> ResultOfGeneralizedStraightLineProgram( gslp, gens );
[ () ]

# doc/../lib/gslp.gd:292-317
gap> gslp:= GeneralizedStraightLineProgram( "union",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> slp:= EquivalentStraightLineProgram( gslp );
<straight line program>
gap> Display( slp );
# input:
r:= [ g1 ];
# program:
# return values:
[ r[1]^2, r[1]^3 ]
gap> gslp:= GeneralizedStraightLineProgram( "compose",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );
<generalized straight line program>
gap> slp:= EquivalentStraightLineProgram( gslp );
<straight line program>
gap> Display( slp );
# input:
r:= [ g1 ];
# program:
r[2]:= r[1]^2;
r[1]:= r[2];
# return values:
[ r[1]^3 ]

# doc/../lib/gslp.gi:220-229
gap> gslp:= GeneralizedStraightLineProgram( "union",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );;
gap> IsInternallyConsistent( gslp );
true
gap> gslp:= GeneralizedStraightLineProgram( "compose",
>               [ [ [[[1,2]]], 1 ], [ [[[1,3]]], 1 ] ] );;
gap> IsInternallyConsistent( gslp );
true

#
gap> STOP_TEST("utils10.tst", 1);
