% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[11pt]{report}
\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}
\definecolor{FuncColor}{rgb}{1.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,1.0}

\usepackage{fancyvrb}

\usepackage{pslatex}

\usepackage[
        a4paper=true,bookmarks=false,pdftitle={Written with GAPDoc},
        pdfcreator={LaTeX with hyperref package / GAPDoc},
        colorlinks=true,backref=page,breaklinks=true,linkcolor=RoyalBlue,
        citecolor=RoyalGreen,filecolor=RoyalRed,
        urlcolor=RoyalRed,pagecolor=RoyalBlue]{hyperref}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}

\newcommand{\GAP}{\textsf{GAP}}

\newsavebox{\backslashbox}
\sbox{\backslashbox}{\texttt{\symbol{92}}}
\newcommand{\bs}{\usebox{\backslashbox}}

\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\begin{center}{\Huge \textbf{ \textsf{IF} }}\\[1cm]
\hypersetup{pdftitle= \textsf{IF} }
\markright{\scriptsize \mbox{}\hfill  \textsf{IF}  \hfill\mbox{}}
{Version 06.01.03}\\[1cm]
\mbox{}\\[2cm]
{\large \textbf{ Marco Costantini   }}\\
\hypersetup{pdfauthor= Marco Costantini   }
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Marco Costantini   } --- Email: \href{mailto:// costanti@science.unitn.it }{\texttt{ costanti@science.unitn.it }}\\
 --- Homepage: \href{http://www-math.science.unitn.it/~costanti/}{\texttt{http://www-math.science.unitn.it/\~{}costanti/}}}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 1 ]}
{\copyright} 2004, 2005, 2006 Marco Costantini 

 }\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 2 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{The GAP InterFace to other Computer Algebra Systems (CAS)}}\logpage{[ 1, 0, 0 ]}
{
  Warning: this file is under contruction! You can find the documentation in the
../README file. 
\section{\textcolor{Chapter }{User's manual}}\logpage{[ 1, 1, 0 ]}
{
 

\subsection{\textcolor{Chapter }{IF{\_}Interface}}
\logpage{[ 1, 1, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{IF{\_}Interface( conventional{\_}CAS{\_}name, CAS{\_}function{\_}name, List{\_}of{\_}Gap{\_}objects )\index{IFInterface@\texttt{IF{\_}Interface}}
\label{IFInterface}
}\hfill{\scriptsize (function)}}\\


 See the ../README file for the list of interfaced CASes and the \mbox{\texttt{conventional{\textunderscore}CAS{\textunderscore}name}}'s. \mbox{\texttt{CAS{\textunderscore}function{\textunderscore}name}} is the name of the function in the interfaced CAS, and is given as a string. \mbox{\texttt{List{\textunderscore}of{\textunderscore}Gap{\textunderscore}objects}} is a list of Gap objects, $O_1, O_2, ..., O_n$, that will be used as arguments of \mbox{\texttt{CAS{\textunderscore}function{\textunderscore}name}} (it may be empty). 

 \mbox{\texttt{IF{\textunderscore}Interface}} does the following:\\
 a. converts each object $O_1, O_2, ..., O_n$ in \mbox{\texttt{List{\textunderscore}of{\textunderscore}Gap{\textunderscore}objects}} into the corresponding object $P_1, P_2, ..., P_n$, of the interfaced CAS;\\
 b. sends the command $CAS{\textunderscore}function{\textunderscore}name ( P_1, P_2, ..., P_n )$ to the interfaced CAS;\\
 c. gets the output from the interfaced CAS;\\
 d. converts it to the corresponding Gap object, and returns it to the user.\\
 

 With the code already implemented, the interface can perform, for instance,
calculation like the following from within Gap, using the function primes,
omega, and nextprime, of Pari/Gp. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  IF_Interface( IF_pari_gp, "primes", [10] );
  IF_Interface( IF_pari_gp, "omega", [360] );
  IF_Interface( IF_pari_gp, "nextprime", [119] );
\end{Verbatim}
 

 In the following example the greatest common divisor of 1000 and 360 is
calculated using each CAS. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  IF_Interface(IF_asir, "igcd", [1000, 360] );
  IF_Interface(IF_cocoa, "GCD", [1000, 360] );
  IF_Interface(IF_kash, "IntGcd", [1000,360] );
  IF_Interface(IF_singular, "gcd", [1000, 360] );
  IF_Interface(IF_plural, "gcd", [1000, 360] );
  IF_Interface(IF_pari_gp, "gcd", [1000, 360] );
  IF_Interface(IF_gap, "GcdInt", [1000, 360] );
  IF_Interface(IF_aribas, "gcd", [1000, 360] );
  IF_Interface(IF_mupad, "gcd", [1000, 360] );
  IF_Interface(IF_maple, "gcd", [1000, 360] );
  IF_Interface(IF_macaulay, "gcd", [1000, 360] );
  IF_Interface(IF_mathematica, "GCD", [1000, 360] );
  IF_Interface(IF_yacas, "Gcd", [1000, 360] );
\end{Verbatim}
 This second example shows that it is possible to interface many CASes in the
same Gap session. 

 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> IF_Interface(IF_mupad, "combinat::partitions::list", [4]);
   [ [ 4 ], [ 3, 1 ], [ 2, 2 ], [ 2, 1, 1 ], [ 1, 1, 1, 1 ] ]
  
  gap> IF_Interface(IF_mupad, "combinat::tableaux::list", [[4,2]]);
   [ [ [ 5, 6 ], [ 1, 2, 3, 4 ] ], [ [ 4, 6 ], [ 1, 2, 3, 5 ] ],
     [ [ 3, 6 ], [ 1, 2, 4, 5 ] ], [ [ 2, 6 ], [ 1, 3, 4, 5 ] ],
     [ [ 4, 5 ], [ 1, 2, 3, 6 ] ], [ [ 3, 5 ], [ 1, 2, 4, 6 ] ],
     [ [ 2, 5 ], [ 1, 3, 4, 6 ] ], [ [ 3, 4 ], [ 1, 2, 5, 6 ] ],
     [ [ 2, 4 ], [ 1, 3, 5, 6 ] ] ]
  
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{InfoInterfaces}}
\logpage{[ 1, 1, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{InfoInterfaces\index{InfoInterfaces@\texttt{InfoInterfaces}}
\label{InfoInterfaces}
}\hfill{\scriptsize (info class)}}\\


 The following command 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SetInfoLevel( InfoInterfaces, 1 );
\end{Verbatim}
 tells to Gap to print the input and the output of the interfaced CAS; it may
be useful for debugging purposes. This debugging information is suppressed by 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SetInfoLevel( InfoInterfaces, 0 );
\end{Verbatim}
 }

 }

 }

 \def\indexname{Index\logpage{[ "Ind", 0, 0 ]}}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
