% File 'import_impl.pl'
%----
% example for building a body from several parts
% (comment at the end of the file)
%

:- tap_interface.                        %_______begin_interface______

:- import(prolog_meta).
					  % interface of module import_impl
:- pred impl1(nat,nat,int).

:- tap_interface_end.			 %_______end_interface______



:- tap_body(import_impl, [import_impl]). %_______begin_body_section_part______
					   % nonvariant body section part
:- pred impl2(nat,nat,nat,nat).   	   
impl1(A,B,C) :- impl2(A, B, A_new, B_new), C is A_new - B_new.


:- tap_body_end(import_impl). 		 %_______end_body_section_part_______


%-----------------------------------------------------------------------------

% comment:
%
% If you want to realize different variants of your implementation,
% then it is useful to put variant code in different files and
% nonvariant code in a central file, which could be the corresponding interface
% file of the module too. In order to build an implementation variant you 
% consult all files with nonvariant code and a implementation specific file 
% with variant code.
%
%
%                  import_impl
%                   ____|____ 
%                  |         | 
% import_several_bodies     import_impl2 
%
% This file is such a central file in the example.
% In the example files import_several_bodies, import_impl2 there are
% body section parts with different implementations of predicate impl2/4.
%
% In order to give the type checker the information, which files contain
% a nonvariant section part, this files are enumerated in the list of the
% tap_body/2 directive. In the example this is only the file import_impl.
%
% If you call TYPICAL for the central file import_impl, only the clauses
% in the nonvariant body section part will be checked. If you give the file 
% import_several_bodies or the file import_impl2 in the call, all clauses 
% of an implementation variant will be examined.
%

