forked from JavaTX/JavaCompilerCore
25 lines
874 B
Plaintext
25 lines
874 B
Plaintext
newType(P, A) :- smallerGen(P, A).
|
|
newType(P, A) :- greaterGen(P, A).
|
|
newType(P, A) :- greaterArgGen(P, A).
|
|
newType(P, A) :- smallerArgGen(P, A).
|
|
|
|
typeVar(P) :- newType(P, A), typeVar(A).
|
|
type(P, AN, ANum) :- newType(P, A), type(A, AN, ANum).
|
|
param(P, AN, ANum) :- newType(P, A), param(A, AN, ANum).
|
|
|
|
wildcard(A) :- extendsWildcard(A).
|
|
wildcard(A) :- superWildcard(A).
|
|
|
|
%Mapping:
|
|
mapFC(smaller(A,B), Num, Num2) :- smaller(A,B), param(A, P, Num), typeVar(P), param(B, P, Num2).
|
|
|
|
hasTypeInParameterList(A) :- type(A, _, _), param(A, P, _), type(P, _, _).
|
|
mapRootFC(smaller(A,B), Num, Num2) :- smaller(A, B), not hasTypeInParameterList(A), param(A, P, Num), typeVar(P), param(B, P, Num2).
|
|
|
|
%%%
|
|
% Grundlegende Regeln
|
|
%%%
|
|
%smaller(A, A) :- smaller(A, _).
|
|
%smaller(B, B) :- smaller(_, B).
|
|
%smaller(A, A) :- type(A). %Alle Typen erben von sich selber. Hätte komische Nebeneffekte
|