Infimum entfernen #111

Open
opened 2023-06-26 15:32:44 +00:00 by pl · 4 comments
Owner

public class EliminateInfimum {
/*
<A, B extends C, C extends D, E extends D, D, E extends F, F extends A> A m3(B x) {
C y = x;
D z = y;
E a = null;
z = a;
F b = a;
return b;
}
*/
<C extends D, D, E extends D> E m3(C x) {
C y = x;
D z = y;
E a = null;
z = a;
E b = a;
String s = new EliminateInfimum().<Integer, Object, String>m3(3);
return b;
}

/*
<A extends B, C extends B, B, C extends D, D, E extends D, E extends F, F> F m4(A x) {
B y = x;
C z = null;
y = z;
D a = z;
E b = null;
a = b;
F c = b;
return c;
}
*/
<A extends B, B, C extends B, F extends B> F m4(A x) {
B y = x;
C z = null;
y = z;
B a = z;
F b = null;
a = b;
F c = b;
String s = new EliminateInfimum().<Integer, Object, Float, String>m4(3);
return c;
}

}

public class EliminateInfimum { /* <A, B extends C, C extends D, E extends D, D, E extends F, F extends A> A m3(B x) { C y = x; D z = y; E a = null; z = a; F b = a; return b; } */ <C extends D, D, E extends D> E m3(C x) { C y = x; D z = y; E a = null; z = a; E b = a; String s = new EliminateInfimum().<Integer, Object, String>m3(3); return b; } /* <A extends B, C extends B, B, C extends D, D, E extends D, E extends F, F> F m4(A x) { B y = x; C z = null; y = z; D a = z; E b = null; a = b; F c = b; return c; } */ <A extends B, B, C extends B, F extends B> F m4(A x) { B y = x; C z = null; y = z; B a = z; F b = null; a = b; F c = b; String s = new EliminateInfimum().<Integer, Object, Float, String>m4(3); return c; } }
Author
Owner

Created attachment 27
grafische Darstellung

Created attachment 27 grafische Darstellung
Author
Owner

Infimum vom drei Typen
/*
<B extends C, C extends D, E extends D, D, E extends F, F, E extends FF, FF> Pair<F, FF> m3a(B x) {
C y = x;
D z = y;
E a = null;
z = a;
F b = a;
FF c = a;
return new Pair<FF, F>(c,b);
}
/*

<B extends C, C extends D, E extends D, D> Pair<E,E> m3a(B x) {
C y = x;
D z = y;
E a = null;
z = a;
E b = a;
E c = a;
return new Pair<E, E>(c,b);
}
Infimum vom drei Typen /* <B extends C, C extends D, E extends D, D, E extends F, F, E extends FF, FF> Pair<F, FF> m3a(B x) { C y = x; D z = y; E a = null; z = a; F b = a; FF c = a; return new Pair<FF, F>(c,b); } /* <B extends C, C extends D, E extends D, D> Pair<E,E> m3a(B x) { C y = x; D z = y; E a = null; z = a; E b = a; E c = a; return new Pair<E, E>(c,b); }
Author
Owner

Infimumsauflösung durch Gleichsetzen der Supertypen und Gleichsetzen eine Asts

/*
<B extends C, C extends D, E extends D, D, E extends F, F, E extends FF, FF, G extends FF, G extends H, H> Pair<F, H> m4a(B x) {
C y = x;
D z = y;
E a = null;
z = a;
F b = a;
FF c = a;
G d = null;
c = d;
H e = d;
return new Pair<F, H>(b,e);
}
*/

<B extends C, C extends D, E extends D, D, G extends D> Pair<E,G> m4a(B x) {
 	C y = x;
 	D z = y;
 	E a = null;
 	z = a;
 	E b = a;
 	D c = a;
G d = null;
c = d;
G e = d;
 	return new Pair<E, G>(b,e);
 }

}

class Pair<T, U> {
public T x;
public U y;

public Pair() {
}

public Pair(T var1, U var2) {
    x = var1;
    y = var2;
}

public T fst() {
    return x;
}

public U snd() {
    return y;
}

}

Infimumsauflösung durch Gleichsetzen der Supertypen und Gleichsetzen eine Asts /* <B extends C, C extends D, E extends D, D, E extends F, F, E extends FF, FF, G extends FF, G extends H, H> Pair<F, H> m4a(B x) { C y = x; D z = y; E a = null; z = a; F b = a; FF c = a; G d = null; c = d; H e = d; return new Pair<F, H>(b,e); } */ <B extends C, C extends D, E extends D, D, G extends D> Pair<E,G> m4a(B x) { C y = x; D z = y; E a = null; z = a; E b = a; D c = a; G d = null; c = d; G e = d; return new Pair<E, G>(b,e); } } class Pair<T, U> { public T x; public U y; public Pair() { } public Pair(T var1, U var2) { x = var1; y = var2; } public T fst() { return x; } public U snd() { return y; } }
Author
Owner

Created attachment 28
Zweite Seite

Created attachment 28 Zweite Seite
dholle added the
generics
label 2024-03-04 11:22:30 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JavaTX/JavaCompilerCore#111
No description provided.