JavaTXCompilerInJavaTX/asp/reduceRules.lp
2019-01-20 14:04:27 +01:00

45 lines
985 B
Plaintext

%%%%%%%%%%%%%%%%%%%%
% reduce1
%%%%%%%%%%%%%%%%%%%%
smallerDotWC(CP, DP)
:- smallerDot(C, D), type(C, CN, NP), type(D, DN, NP)
, type(CFC, CN, NP), type(DFC, DN, NP), smaller(CFC, DFC)
, pi(CFC, DFC, N, N2)
, param(C, CP, N), param(D, DP, N2), N = 1 .. NP
.
%%%%%%%%%%%%%%%%%%%%
% reduceExt
%%%%%%%%%%%%%%%%%%%%
%TODO
%smallerDotWC(CP, DP)
%:- smallerDotWC(C, D), type(C, CN, NP), type(D, DN, NP)
%, type(CFC, CN, NP), type(DFC, DN, NP), smaller(CFC, DFC)
%, pi(CFC, DFC, N, N2)
%, param(C, CP, N), param(D, DP, N2), N = 1 .. NP
%.
%%%%%%%%%%%%%%%%%%%%
% reduceEq
%%%%%%%%%%%%%%%%%%%%
equals(CP, DP)
:- smallerDot(C, D), type(C, CN, NP), type(D, CN, NP)
, param(C, CP, N), param(D, DP, N), N = 1 .. NP
.
%%%%%%%%%%%%%%%%%%%%
% reduce2
%%%%%%%%%%%%%%%%%%%%
equals(P1, P2) :- equals(C, D), type(C, CN, NP), type(D, CN, NP)
, param(C, P1, N), param(D, P2, N)
.
%%%%%%%%%%%%%%%%%%%%
% swap
%%%%%%%%%%%%%%%%%%%%
equals(A, B) :- equals(B, A), typeVar(A), not typeVar(B).