\documentclass{article}

% Package declarations
\usepackage[latin1]{inputenc}  % Support for the latin character set
\usepackage{amsmath}           % Improved math formula packages from AMS
\usepackage{amssymb}           % (see http://www.ams.org/tex/amslatex.html)
\usepackage{array}             % Improved array and tabular environments
\usepackage{cite}              % Improved citation management
\usepackage{color}             % Color in text and background 
\usepackage{graphicx}          % Image support
\usepackage{multirow}         % Rows spanning multiple rows       

\newcommand{\papercopy}{}
\newcommand{\pdflink}[1]{}
\newcommand{\eclipse}[0]{\textsf{ECL$^\mathsf{i}$PS$^\mathsf{e}$}}

% OCL definitions
\input{OCLdefs}

\begin{document}

%\title{OCL Examples}
%\maketitle

\begin{figure*}[t]
\centering \includegraphics[keepaspectratio=true,width=0.9\linewidth]{OCLExample.png}
\rule{0.9\linewidth}{1pt}
\vspace{-0.2truecm}
\small
\begin{ocl}[0.85\linewidth]

\vspace{0.3truecm}\OCLcontext~Product \OCLinv ~minStock: \OCLself.stock $\geq$ 5  

\vspace{0.3truecm}\OCLcontext~GoldCustomer \OCLinv ~salesAmount:  

\hspace{0.5cm} \OCLself.sale \OCLarrow select(s $\vert$ s.paid).cost \OCLarrow sum() $\geq$ 100000

\vspace{0.3truecm} \OCLcontext~Customer::newCustomer(name:String, p: Portal): Customer

\OCLpost~result.oclIsNew() and result.name=name and result.portal=p

\vspace{0.3truecm} \OCLcontext~Sale::addSaleLine(p: Product, quantity: Integer): SaleLine

\OCLpre~p.stock $>$ 0

\OCLpost~result.oclIsNew() and result.sale=self and result.product=p and \\ \verb+     + result.quantity=quantity and p.stock=p.stock@pre-quantity and \\ \verb+     + self.amount=self.amount@pre + quantity*p.price

\vspace{0.3truecm} \OCLcontext~Portal::removeGoldCategory(c: Customer)

\OCLpre~c.oclIsTypeOf(GoldCustomer) and c.sale\OCLarrow isEmpty()

\OCLpost~not c.oclIsTypeOf(GoldCustomer)

\end{ocl}

\vspace{0.4truecm}
\rule{0.9\linewidth}{1pt}
\vspace{-0.2truecm}

\caption{Running example: class diagram, OCL constraints and operations.}
\label{fig:example}
\vspace{-0.6truecm}
\end{figure*}

%\begin{thebibliography}{5}
%\end{thebibliography}

\end{document}