% File 'typeops'
%----
%-------
% changed by: rk
%
%   Define Prolog syntax for type declarations. 
%   A program file with type-annotated Prolog usually starts with 
%       :- ensure_loaded(<ThisFile>). 
%   to make it a syntactically correct standard Prolog program. 
%-------

% :- multifile (subtype)/1, (suptype)/1, (type)/1, (pred)/1, (predl)/1, 
%	(pred_neg)/1, (type_import)/1, (module)/1, (module)/2, 
%	(end_module)/0, (end_module)/1, (import)/1, (import)/2, (import_type)/2,
%	(export)/1, (export_type)/2, (public)/1, (transfer)/2, 
%	(export_module)/1, (module_interface)/1, (end_interface)/1, 
%	(module_body)/1, (type_pragma)/1, (local)/1, (abstract)/1.

:- multifile (subtype)/1.
:- multifile (suptype)/1.
:- multifile (type)/1.
:- multifile (pred)/1.
:- multifile (predl)/1.
:- multifile (pred_neg)/1.
:- multifile (type_import)/1.

:- multifile (import)/1.        %%%
:- multifile (import_type)/1.   %%%
:- multifile (import_type)/2.   %%%
:- multifile (import_pred)/1.   %%%
:- multifile (import_pred)/2.   %%%
% :- multifile (transfer)/2.    %%%
:- multifile (tap_interface)/0. %%%
:- multifile (tap_interface_end)/0. %%%
:- multifile (tap_body)/0.      %%%
:- multifile (tap_body)/1.      %%%
:- multifile (tap_body)/2.      %%%
:- multifile (tap_body_end)/0.  %%%
:- multifile (tap_body_end)/1.  %%%

:- multifile (type_pragma)/1.
:- multifile (local)/1.
:- multifile (abstract)/1.
:- multifile (typical_intern)/1.  %%%

% otherwise warnings for 'redefined predicates' will appear in Prolog
% (must appear before op-defs in Quintus)
% Syntax: ":- multifile p/1, q/1." not understood 
% in some systems, e.g. BinProlog V.5

% :- op(1199, fx, [(local), (abstract)]).  % module keywords
% :- op(1198, fx, [(subtype), (suptype), (type), (pred), (pred_neg), (predl), (rule)]).
% :- op(1197, fx, [(-->), (--->), (with)]).
% some Prolog systems have trouble with _lists_ of symbols in 3rd arg. of op/3
% e.g. BinProlog

:- op(40, xfx, \).	        % for difference lists
:- op(1195, xfy, (of)).         % for meta-types

:- op(1199, fx, (local)).     % module keywords
:- op(1199, fx, (abstract)).  % module keywords
:- op(1198, fx, (subtype)).
:- op(1198, fx, (suptype)).
:- op(1198, fx, (type)).
:- op(1198, fx, (pred)).
:- op(1198, fx, (pred_neg)).
:- op(1198, fx, (predl)).
:- op(1198, fx, (rule)).
:- op(1198, fx, (typical_intern)). %%%
:- op(1197, xfy, (-->)).
:- op(1197, xfy, (--->)).    % as in Mercury
:- op(1196, xfy, (with)).

% error :- op(1000,xfx, (|>)).  % pred decl. with constraints
:- op(600, fx, (@)).    % least type param.
% :- op(600, fx, (=)).  % problematic, use '@' instead

% Look up op-definitions with current_op/3

% compatibility with O'Keefe lib. and Mercury
% :- type something
% :- pred something
% these goals should not fail while loading the program
type(_).
pred(_).
predl(_).
pred_neg(_).
subtype(_).
suptype(_).
local(_).
abstract(_).
rule(_).
typical_intern(_). %%% rk

type_import(_).
type_impex(_).
type_pragma(_).  % every subgoal 'type_pragma(Anykey)' shall succeed.

%%% rk +
import(_).
import_pred(_).
import_pred(_,_).
import_type(_).
import_type(_,_).
tap_interface.
tap_interface_end.
tap_body.
tap_body_end.
tap_body(_).
tap_body_end(_).
tap_body(_,_).
%%% rk -
