2023-07-18 09:45:17 +00:00
|
|
|
/*
|
2023-06-05 11:14:00 +00:00
|
|
|
class Pair<T, U> {
|
|
|
|
T x;
|
|
|
|
U y;
|
|
|
|
|
|
|
|
public Pair() { }
|
|
|
|
public Pair(T x, U y) {
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
public T fst () {
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
public U snd () {
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
}
|
2023-07-18 09:45:17 +00:00
|
|
|
*/
|
2023-06-05 11:14:00 +00:00
|
|
|
|
|
|
|
public class Iteration {
|
2023-06-13 14:33:54 +00:00
|
|
|
id(x) {
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
2023-06-05 11:14:00 +00:00
|
|
|
m1(x, y) {
|
|
|
|
var help;
|
|
|
|
help = m2(x, y);
|
|
|
|
var y2 = help.snd();
|
2023-06-13 14:33:54 +00:00
|
|
|
var x2 = id(x);
|
|
|
|
return new Pair<>(x2,y2);
|
|
|
|
|
2023-06-05 11:14:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
m2(x,y) {
|
|
|
|
var help = m1(x, y);
|
|
|
|
var x2 = help.fst();
|
2023-06-13 14:33:54 +00:00
|
|
|
var y2 = id(y);
|
|
|
|
return new Pair<>(x2, y2);
|
2023-06-05 11:14:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|