2018-07-17 17:51:50 +00:00
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% 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)
|
2019-01-20 13:04:27 +00:00
|
|
|
, pi(CFC, DFC, N, N2)
|
2018-07-17 17:51:50 +00:00
|
|
|
, 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)
|
2019-01-20 13:04:27 +00:00
|
|
|
%, pi(CFC, DFC, N, N2)
|
2018-07-17 17:51:50 +00:00
|
|
|
%, 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).
|