:- module(extraSyntax,[]).  % converted djd
:- style_check(-singleton). % added djd
%% :- module('extraSyntax', []).

:- op(500, yfx, and).
:- op(400, yfx, or).

%------------------------------------------------------------------------------
% Prolog support for Syntax system module
%------------------------------------------------------------------------------
 
% %Z%%M% %I% last updated %E% %U% by %Q%

%------------------------------------------------------------------------------
% Bindings in variable typings
%------------------------------------------------------------------------------
 
% Avoid unnecessary choicepoints

'extraSyntax.eBindingInVarTyping.p3'(Subst, Param, Type) :-
   ( var(Param) ->
     user:'lists.member.p2'('metaDefs.@.f2'(Param,Type), Subst)
   ; user:'lists.memberCheck.p2'('metaDefs.@.f2'(Param,Type),Subst)
   ).

'~extraSyntax.eBindingInVarTyping.p3'(Subst, Param, Type) :-
   'extraSyntax.eBindingInVarTyping.p3'(Subst, Param, Type).


'extraSyntax.eDelBindingInVarTyping.p4'(Typing, Var, Type, NewTyping) :-
   ( var(Var) ->
     user:'lists.delete.p3'('metaDefs.@.f2'(Var, Type), Typing, NewTyping)
   ; user:'lists.deleteFirst.p3'('metaDefs.@.f2'(Var, Type), Typing, NewTyping)
   ).

'~extraSyntax.eDelBindingInVarTyping.p4'(Typing, Var, Type, NewTyping) :-
   'extraSyntax.delBindingInVarTyping.p4'(Typing, Var, Type, NewTyping).

%------------------------------------------------------------------------------
% Pseudo-set maniplation predicates
%------------------------------------------------------------------------------

'extraSyntax.order.p2'(X, Y) :-
   sort(X, Y).

'~extraSyntax.order.p2'(X, Y) :-
   sort(X, Y).
 
'extraSyntax.union.p3'(X, Y, Z) :-
   user:union(X, Y, Z).

'~extraSyntax.union.p3'(X, Y, Z) :-
   user:union(X, Y, Z).

'extraSyntax.difference.p3'(X, Y, Z) :-
   user:difference(X, Y, Z).

'~extraSyntax.difference.p3'(X, Y, Z) :-
   user:difference(X, Y, Z).

