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

IF_SUBPACKAGE_VERSION[IF_yacas] := "dev";


IF_CAS_DESCRIPTION[IF_yacas] :=
[ "yacas",
"YACAS is an easy to use, general purpose Computer Algebra System, a program for symbolic \
manipulation of mathematical expressions.",
"http://yacas.sourceforge.net/" ];


IF_EXEC_NAME[IF_yacas] := "yacas";
IF_EXEC_FULL_PATH[IF_yacas] := "/mnt/hda8/costanti/CASes/yacas_inst/bin/yacas";
IF_EXEC_OPTIONS[IF_yacas] := [ "-p" ];

IF_QUIT_COMMAND[IF_yacas] := "quit";
IF_DISPLAY_VERSION[IF_yacas] := "Version()";


# Use 'true' with Yacas version '1.0.61' or earlier, 'false' with '1.0.62' or newer.
# Use 'true' with Yacas of year 2005 or earlier, 'false' with Yacas of year 2006 or newer.

if true  then 

 ## see http://sourceforge.net/mailarchive/forum.php?thread_id=9250223&forum_id=2216

 IF_FIRST_COMMAND[IF_yacas] := "\
  OMDef( \"/\" , \"arith1\", \"divide\");\n\
  OMDef( \"/\" , \"nums1\", \"rational\", \
    {$, _1, _2}_(IsRational(_1/_2)) | {OMS(\"arith1\", \"divide\"), _1, _2}, {/, _1, _2});\n\
  OMDef( {},     \"set1\", \"emptyset\" );\n\
  OMDef( \"List\", \"set1\", \"set\"      );\n\
  OMDef( \"List\", \"linalg2\",\"matrix\"    );\n\
  OMDef( \"List\", \"linalg2\",\"matrixrow\" );\n\
  OMDef( \"List\", \"linalg2\",\"vector\"    );\n\
  OMDef( \"List\", \"list1\", \"list\");\n\
  OMDef( \"..\", \"interval1\", \"integer_interval\" );\n\
  PrettyPrinter(\"OMForm\");";

else 

 IF_FIRST_COMMAND[IF_yacas] := "PrettyPrinter(\"OMForm\");";

fi;



IF_FIRST_PROMPT[IF_yacas] := "\nIn> ";
# IF_PROMPT_NR[IF_yacas] := ;
IF_PROMPTS[IF_yacas] := [ "\nIn> " ];
IF_FUNC_REMOVE_PROMPT[IF_yacas] := OUT -> OUT{[ 1 .. Length( OUT ) - Length( IF_PROMPTS[IF_yacas][1] ) ]};

# IF_BRACKETS[IF_yacas] := [ "", "" ];
IF_ASSIGN[IF_yacas] := ":=";
IF_END_COMMAND[IF_yacas] := ";";
IF_IS_THERE_PROMPT[IF_yacas] := true;
IF_FUNC_TYPE[IF_yacas] := function( arg ) return "openmath"; end; # "Type"
IF_TYPE_IS_QUOTED[IF_yacas] := true;

IF_STRING_ARE_QUOTED[IF_yacas] := true;
IF_FUNC_STRING[IF_yacas] := "";
IF_FUNC_DISPLAY[IF_yacas] := "";
IF_PROHIBITED_CHARS[IF_yacas] := [  ];


IF_DATA_TYPES[IF_yacas] := rec(


openmath := [
"openmath",
IF_IsSupportedByGapOpenmath,
function( obj )
    obj := IF_ConvertGapObjectToOpenmathString( obj );
    obj := NormalizedWhitespace( obj );
    # the following 'Add' is required by a bug, probably in the XML parser of Yacas, see
    # http://sourceforge.net/mailarchive/forum.php?thread_id=9245235&forum_id=2216
    Add( obj, ' ' ); 
    obj := IF_ParseGapString( obj );
    return Concatenation( "FromString( ", obj, " )OMRead()" );
end,
IF_ConvertOpenmathStringToGapObject ]


);

