# The variables are explained in the file gap/data.g
# name := number;
IF_pari_gp := 60;

IF_SUBPACKAGE_VERSION[IF_pari_gp] := "dev";


IF_CAS_DESCRIPTION[IF_pari_gp] :=
[ "PARI/GP",
"PARI/GP is a computer algebra system designed for fast computations in number theory",
"http://pari.math.u-bordeaux.fr/", "http://www.math.u-psud.fr/~belabas/pari/"];


IF_EXEC_NAME[IF_pari_gp] := "gp";
IF_EXEC_FULL_PATH[IF_pari_gp] := "/home/costanti/marco/CASes/pari-2.2.7.alpha/gp";
IF_EXEC_OPTIONS[IF_pari_gp] := [ "-q", "-f" ]; 
# change it to [ "-q" ] if you want to use your .gprc, and if there are in it no command that disturb
# the interface if you change your prompt, you will need to change IF_PROMPTS[IF_pari_gp] accordingly.

IF_QUIT_COMMAND[IF_pari_gp] := ";quit;";
IF_DISPLAY_VERSION[IF_pari_gp] := "";


IF_FIRST_COMMAND[IF_pari_gp] := "\\o0";

IF_FIRST_PROMPT[IF_pari_gp] := "? ";
IF_PROMPTS[IF_pari_gp] :=[ "\n? " ]; # also "? "
IF_FUNC_REMOVE_PROMPT[IF_pari_gp] := OUT -> OUT{[ 1 .. Length( OUT ) - Length( IF_PROMPTS[IF_pari_gp][1] ) ]};


IF_ASSIGN[IF_pari_gp] := "=";
IF_END_COMMAND[IF_pari_gp] := "";
IF_IS_THERE_PROMPT[IF_pari_gp] := true;
IF_FUNC_TYPE[IF_pari_gp] := "type";
IF_TYPE_IS_QUOTED[IF_pari_gp] := true;

IF_STRING_ARE_QUOTED[IF_pari_gp] := true;
# IF_FUNC_STRING[IF_pari_gp] := "string";
IF_FUNC_DISPLAY[IF_pari_gp] := "";
IF_PROHIBITED_CHARS[IF_pari_gp] := [ 127, 255 ];


IF_DATA_TYPES[IF_pari_gp] := rec(

# See user manual, paragraphs "1.2 The PARI types.", "2.3 Input formats for the PARI types.", 
# and "4.5 Implementation of the PARI types.".

#    Let us now describe the types. As explained above, they are built recursively from basic types
# which are as follows. We use the letter T to designate any type; the symbolic names correspond to
# the internal representations of the types.


t_INT := [         # Z
"Integers (with arbitrary precision)",
IsInt,
String,
Int ],

t_REAL := [        # R
"Real numbers (with arbitrary precision)",
ReturnFalse,
,
IdFunc ],

t_INTMOD := [      # Z/nZ
"Integermods (integers modulo n)",
IsZmodnZObj,
obj -> Concatenation( "Mod( ", String( obj![1] ), ", ", String( DataType( TypeObj( obj ) ) ), " )" ),
function ( obj )
    local  p;
    p := Position( obj, ',' );
    return ZmodnZObj( Int( obj{[ 5 .. p - 1 ]} ), Int( obj{[ p + 2 .. Length( obj ) - 1 ]} ) );
end ],

t_FRAC := [        # Q
"Rational numbers (in irreducible form)",
IsRat,
String,
Rat ],

t_FRACN := [       # Q
"Rational numbers (not necessarily in irreducible form)",
ReturnFalse,
,
Rat ],

t_COMPLEX := [     # T [i]
"Complex numbers", ],

t_PADIC := [       # Qp
"p-adic numbers", ],

t_QUAD := [        # Q[w]
"Quadratic Numbers (where [Z[w] : Z] = 2)", ],

t_POLMOD := [      # T [X]/P (X)T [X]
"Polmods (polynomials modulo P )", ],

t_POL := [         # T [X]
"Polynomials", ],

t_SER := [         # T ((X))
"Power series (finite Laurent series)", ],

t_RFRAC := [       # T (X)
"Rational functions (in irreducible form)", ],

t_RFRACN := [      # T (X)
"Rational functions (not necessarily in irreducible form)", ],

t_VEC := [         # T n
"Row (i.e. horizontal) vectors", ],

t_COL := [         # T n
"Column (i.e. vertical) vectors", ],

t_MAT := [         # Mm,n(T )
"Matrices",
,
,
obj -> IF_EvalString( Concatenation( "[", ReplacedString( obj, ";", "], [" ), "]" ) ) ],

t_LIST := [        # T n
"Lists", ],

t_STR := [         #
"Character strings",
IsString and IsStringRep,
IF_ParseGapString, # it doesn't work for ASCII codes 0..31, 127, 255
obj -> obj{[ 2 .. Length( obj ) - 1 ]} ] # it doesn't work for ASCII codes 0..31


);

