
%   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, (type_import)/1, (local)/1.
% otherwise warnings for 'redefined predicates' will appear in Prolog
% (must appear before op-defs in Quintus)


:- op(1199, fx, [(local), (abstract)]).  % module keywords
:- op(1198, fx, [(subtype), (suptype), (type), (pred), (pred_neg), (predl), (rule)]).
:- 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

% op-definitions can be queried 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(_).
%mode(_).

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