%%
%% $Id$
%%
%% Copyright 1989-2016 MINES ParisTech
%%
%% This file is part of PIPS.
%%
%% PIPS is free software: you can redistribute it and/or modify it
%% under the terms of the GNU General Public License as published by
%% the Free Software Foundation, either version 3 of the License, or
%% any later version.
%%
%% PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
%% WARRANTY; without even the implied warranty of MERCHANTABILITY or
%% FITNESS FOR A PARTICULAR PURPOSE.
%%
%% See the GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with PIPS.  If not, see <http://www.gnu.org/licenses/>.
%%
\documentclass[a4paper]{article}

\usepackage[latin1]{inputenc}
\usepackage{newgen_domain}
\usepackage{listings}
\usepackage[backref,pagebackref]{hyperref}

\title{Cloning statement}
\author{Serge Guelton}


\begin{document}
\maketitle
\sloppy

\section*{New type used for cloning}

This document defines and describes the data structure used to pass parameters to the \lstinline|clone_statement| function.
It consist of three fields given by the user:
\begin{itemize}
\item \lstinline|previous_module| is the entity of the module from which the cloned statement comes
\item \lstinline|new_module| is the entity of the module to which the cloned statement will be added. It can be the same as \lstinline|previous_module|
\item \lstinline|labels| is the label mapping between old labels and new labels. If the old statement has two entities with the same label (like the statement and a loop inside the statement), then the new entity must also have those two entities with the same label.
\item \lstinline|new_module_statement| is the root statement of \lstinline|new_module|
\end{itemize}

\domain{import entity from "ri.newgen"}
{}
\domain{import statement from "ri.newgen"}
{}

\domain{clone_context = previous_module:entity x new_module:entity x labels:entity* x persistent new_module_statement:statement}
{}
\end{document}
