%%
%% $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,11pt]{article}

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

\title{PIPS}
\author{Fabien Coelho \\
CRI, M\&S, MINES-ParisTech}

\begin{document}
\maketitle

\section{Private data structures for FREIA -SPOC}
\label{sec:freia-spoc}

WORK IN PROGRESS\ldots

A special DAG for FREIA (SPOC) code generation.

The \emph{Generic Oriented Graph} provided by PIPS is both too minimal
and too generic for my purpose.

Lists are used instead of sets (for preds, succs, vertices) to help
determinism.

\domain{Import entity from "ri.newgen"}
{}

\domain{Import statement from "ri.newgen"}
{}

\domain{pstatement = persistant statement + empty:unit}
{}

\domain{vtxcontent = optype:int x opid:int x source:pstatement x inputs:entity* x out:entity}
{}

The operation (\emph{optype}, \emph{opid}) may not be commutative,
thus the order of input images (\emph{inputs}) is significant, and some
adjustement may be necessary when mapping onto the hardware.

There is a lot of information kept here, possibly redundant (?), because
it is/may be needed for regenerating the code.

Somehow I need in/out effects from within the sequence, or possibly
use-def chains?

\domain{dagvtx = content:vtxcontent x succs:dagvtx*}
{}

What about the first and last vertices? They can be deduced because
they do not have predecessors or successors?

\domain{dag = inputs:dagvtx* x outputs:dagvtx* x vertices:dagvtx*}
{}

The order of \emph{vertices} in the list is the inverse of their
occurence in the sequence, so that the first to produce an image is
indeed to one that produced it if a variable is reused.

List \emph{inputs} stores \emph{external} inputs to the DAG.
List \emph{outputs} is for the nodes of the DAG which produce
an image expected outside.

\end{document}
