% Copyright (C) 2003 Fred Mesnard <fred@univ-reunion.fr>
%
% This file is part of cTI.
%
% cTI 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 2 of the License, or (at your
% option) any later version.
%
% cTI 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 this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
% USA.
%
% For the most up-to-date information see the cTI's web site:
% http://www.cs.unipr.it/cTI/

:- module(num_prolog_clpn,[prologs_clpns/2]).

:- use_module(prolog_flatprolog,[prolog_flatprologs/2]).	
:- use_module(prolog_clph,[flatprolog_clph/2]).
:- use_module(num_clph_clpn,[clph_clpn/2]).
:- use_module(library(lists),[append/3]).

prologs_clpns([],[]).
prologs_clpns([Cl|Cls],ClpNCls3) :-
	%write(Cl),nl,
	prolog_flatprologs(Cl,FPCls),
	fps_clpns(FPCls,ClpNCls1),
	append(ClpNCls1,ClpNCls2,ClpNCls3),
	prologs_clpns(Cls,ClpNCls2).


fps_clpns([],[]).
fps_clpns([Cl|Cls],[Cln|Clns]) :-
	flatprolog_clph(Cl,Clh),
	clph_clpn(Clh,Cln),
	fps_clpns(Cls,Clns).
