Skip to content

Instantly share code, notes, and snippets.

@ice1000
Last active December 17, 2024 22:52
Show Gist options
  • Save ice1000/70fd92ce92bd744c663e4f7e81d61192 to your computer and use it in GitHub Desktop.
Save ice1000/70fd92ce92bd744c663e4f7e81d61192 to your computer and use it in GitHub Desktop.
Aya "JJH" precompiled module of a red-black tree sort algorithm on natural numbers
package AYA;
import kala.collection.Seq;
import kala.collection.immutable.ImmutableSeq;
import kala.collection.immutable.ImmutableTreeSeq;
import kala.collection.mutable.MutableSeq;
import kala.control.Result;
import org.aya.generic.term.DTKind;
import org.aya.syntax.compile.CompiledAya;
import org.aya.syntax.compile.JitCon;
import org.aya.syntax.compile.JitData;
import org.aya.syntax.compile.JitFn;
import org.aya.syntax.compile.JitMatchy;
import org.aya.syntax.compile.JitUnit;
import org.aya.syntax.core.Closure;
import org.aya.syntax.core.repr.CodeShape;
import org.aya.syntax.core.term.AppTerm;
import org.aya.syntax.core.term.DepTypeTerm;
import org.aya.syntax.core.term.LamTerm;
import org.aya.syntax.core.term.SortTerm;
import org.aya.syntax.core.term.Term;
import org.aya.syntax.core.term.call.ConCall;
import org.aya.syntax.core.term.call.ConCallLike;
import org.aya.syntax.core.term.call.DataCall;
import org.aya.syntax.core.term.call.FnCall;
import org.aya.syntax.core.term.call.MatchCall;
import org.aya.syntax.core.term.call.RuleReducer;
import org.aya.syntax.core.term.repr.IntegerOps;
import org.aya.syntax.core.term.repr.IntegerTerm;
import org.aya.syntax.core.term.repr.ListOps;
import org.aya.syntax.core.term.repr.ListTerm;
import org.aya.util.error.Panic;
import org.jetbrains.annotations.NotNull;
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "", assoc = -1, shape = -1, recognition = { })
@SuppressWarnings(value = {"unchecked", "rawtypes", "LoopStatementThatDoesntLoop"})
public final class _baka extends JitUnit {
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "Nat", assoc = -1, shape = 0, recognition = {CodeShape.GlobalId.ZERO, CodeShape.GlobalId.SUC})
public static final class _baka_Nat extends JitData {
public /* constructor */ _baka_Nat() {
super(0, new boolean[]{ }, new String[]{ }, 2);
}
public static final _baka._baka_Nat INSTANCE = new _baka._baka_Nat();
public static final DataCall ourCall = new DataCall(_baka._baka_Nat.INSTANCE);
public @NotNull Term telescope(int _0, Seq _1) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _2) {
return SortTerm.Type0;
}
public JitCon @NotNull [] constructors() {
if (this.constructors[0] == null) {
this.constructors[0] = _baka._baka_Nat_O.INSTANCE;
this.constructors[1] = _baka._baka_Nat_S.INSTANCE;
}
return this.constructors;
}
}
@CompiledAya(module = {"baka", "Nat"}, fileModuleSize = 1, name = "O", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Nat_O extends JitCon {
public /* constructor */ _baka_Nat_O() {
super(0, new boolean[]{ }, new String[]{ }, _baka._baka_Nat.INSTANCE, 0, false);
}
public static final _baka._baka_Nat_O INSTANCE = new _baka._baka_Nat_O();
public static final ConCall ourCall = new ConCall(_baka._baka_Nat_O.INSTANCE);
public @NotNull Term telescope(int _3, Seq _4) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _5) {
return _baka._baka_Nat.ourCall;
}
public @NotNull Result isAvailable(Seq _6) {
return Result.ok(_6.toImmutableSeq());
}
}
@CompiledAya(module = {"baka", "Nat"}, fileModuleSize = 1, name = "S", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Nat_S extends JitCon {
public /* constructor */ _baka_Nat_S() {
super(1, new boolean[]{true}, new String[]{"_5"}, _baka._baka_Nat.INSTANCE, 1, false);
}
public static final _baka._baka_Nat_S INSTANCE = new _baka._baka_Nat_S();
public @NotNull Term telescope(int _7, Seq _8) {
if (_7 == 0) {
return _baka_Nat.ourCall;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _9) {
return _baka._baka_Nat.ourCall;
}
public @NotNull Result isAvailable(Seq _10) {
return Result.ok(_10.toImmutableSeq());
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "Bool", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Bool extends JitData {
public /* constructor */ _baka_Bool() {
super(0, new boolean[]{ }, new String[]{ }, 2);
}
public static final _baka._baka_Bool INSTANCE = new _baka._baka_Bool();
public static final DataCall ourCall = new DataCall(_baka._baka_Bool.INSTANCE);
public @NotNull Term telescope(int _11, Seq _12) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _13) {
return SortTerm.Type0;
}
public JitCon @NotNull [] constructors() {
if (this.constructors[0] == null) {
this.constructors[0] = _baka._baka_Bool_True.INSTANCE;
this.constructors[1] = _baka._baka_Bool_False.INSTANCE;
}
return this.constructors;
}
}
@CompiledAya(module = {"baka", "Bool"}, fileModuleSize = 1, name = "True", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Bool_True extends JitCon {
public /* constructor */ _baka_Bool_True() {
super(0, new boolean[]{ }, new String[]{ }, _baka._baka_Bool.INSTANCE, 0, false);
}
public static final _baka._baka_Bool_True INSTANCE = new _baka._baka_Bool_True();
public static final ConCall ourCall = new ConCall(_baka._baka_Bool_True.INSTANCE);
public @NotNull Term telescope(int _14, Seq _15) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _16) {
return _baka._baka_Bool.ourCall;
}
public @NotNull Result isAvailable(Seq _17) {
return Result.ok(_17.toImmutableSeq());
}
}
@CompiledAya(module = {"baka", "Bool"}, fileModuleSize = 1, name = "False", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Bool_False extends JitCon {
public /* constructor */ _baka_Bool_False() {
super(0, new boolean[]{ }, new String[]{ }, _baka._baka_Bool.INSTANCE, 0, false);
}
public static final _baka._baka_Bool_False INSTANCE = new _baka._baka_Bool_False();
public static final ConCall ourCall = new ConCall(_baka._baka_Bool_False.INSTANCE);
public @NotNull Term telescope(int _18, Seq _19) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _20) {
return _baka._baka_Bool.ourCall;
}
public @NotNull Result isAvailable(Seq _21) {
return Result.ok(_21.toImmutableSeq());
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "List", assoc = -1, shape = 1, recognition = {CodeShape.GlobalId.NIL, CodeShape.GlobalId.CONS})
public static final class _baka_List extends JitData {
public /* constructor */ _baka_List() {
super(1, new boolean[]{true}, new String[]{"_1"}, 2);
}
public static final _baka._baka_List INSTANCE = new _baka._baka_List();
public @NotNull Term telescope(int _22, Seq _23) {
if (_22 == 0) {
return SortTerm.Type0;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _24) {
return SortTerm.Type0;
}
public JitCon @NotNull [] constructors() {
if (this.constructors[0] == null) {
this.constructors[0] = _baka._baka_List__91_93.INSTANCE;
this.constructors[1] = _baka._baka_List__58_62.INSTANCE;
}
return this.constructors;
}
}
@CompiledAya(module = {"baka", "List"}, fileModuleSize = 1, name = "[]", assoc = -1, shape = -1, recognition = { })
public static final class _baka_List__91_93 extends JitCon {
public /* constructor */ _baka_List__91_93() {
super(1, new boolean[]{false}, new String[]{"_1"}, _baka._baka_List.INSTANCE, 0, false);
}
public static final _baka._baka_List__91_93 INSTANCE = new _baka._baka_List__91_93();
public @NotNull Term telescope(int _25, Seq _26) {
if (_25 == 0) {
return SortTerm.Type0;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _27) {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _27.get(0))}));
}
public @NotNull Result isAvailable(Seq _28) {
return Result.ok(_28.toImmutableSeq());
}
}
@CompiledAya(module = {"baka", "List"}, fileModuleSize = 1, name = ":>", assoc = 2, shape = -1, recognition = { })
public static final class _baka_List__58_62 extends JitCon {
public /* constructor */ _baka_List__58_62() {
super(3, new boolean[]{false, true, true}, new String[]{"A", "_5", "_7"}, _baka._baka_List.INSTANCE, 2, false);
}
public static final _baka._baka_List__58_62 INSTANCE = new _baka._baka_List__58_62();
public @NotNull Term telescope(int _29, Seq _30) {
switch (_29) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return ((Term) _30.get(0));
}
case 2 -> {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _30.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _31) {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _31.get(0))}));
}
public @NotNull Result isAvailable(Seq _32) {
return Result.ok(_32.toImmutableSeq());
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "isZero", assoc = -1, shape = -1, recognition = { })
public static final class _baka_isZero extends JitFn {
public /* constructor */ _baka_isZero() {
super(1, new boolean[]{true}, new String[]{"a"}, 0);
}
public static final _baka._baka_isZero INSTANCE = new _baka._baka_isZero();
public @NotNull Term telescope(int _33, Seq _34) {
if (_33 == 0) {
return _baka_Nat.ourCall;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _35) {
return _baka._baka_Bool.ourCall;
}
public Term invoke(Term _36) {
MutableSeq _37 = MutableSeq.fill(1, ((Term) null));
int _38 = 0;
boolean _39;
do {
_39 = false;
if (_36 instanceof IntegerTerm _41) {
if (_41.repr() == 0) {
_39 = true;
}
}
if (!(_39)) {
if (_36 instanceof ConCallLike _42) {
if (_42.ref() == _baka._baka_Nat_O.INSTANCE) {
_39 = true;
}
} else {
break;
}
}
if (_39) {
_38 = 1;
break;
}
_37.set(0, _36);
_38 = 2;
break;
} while (false);
switch (_38) {
case 0 -> {
return new FnCall(_baka._baka_isZero.INSTANCE, 0, ImmutableSeq.from(new Term[]{_36}));
}
case 1 -> {
return _baka._baka_Bool_True.ourCall;
}
case 2 -> {
return _baka._baka_Bool_False.ourCall;
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _43) {
return this.invoke(((Term) _43.get(0)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "Color", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Color extends JitData {
public /* constructor */ _baka_Color() {
super(0, new boolean[]{ }, new String[]{ }, 2);
}
public static final _baka._baka_Color INSTANCE = new _baka._baka_Color();
public static final DataCall ourCall = new DataCall(_baka._baka_Color.INSTANCE);
public @NotNull Term telescope(int _44, Seq _45) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _46) {
return SortTerm.Type0;
}
public JitCon @NotNull [] constructors() {
if (this.constructors[0] == null) {
this.constructors[0] = _baka._baka_Color_red.INSTANCE;
this.constructors[1] = _baka._baka_Color_black.INSTANCE;
}
return this.constructors;
}
}
@CompiledAya(module = {"baka", "Color"}, fileModuleSize = 1, name = "red", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Color_red extends JitCon {
public /* constructor */ _baka_Color_red() {
super(0, new boolean[]{ }, new String[]{ }, _baka._baka_Color.INSTANCE, 0, false);
}
public static final _baka._baka_Color_red INSTANCE = new _baka._baka_Color_red();
public static final ConCall ourCall = new ConCall(_baka._baka_Color_red.INSTANCE);
public @NotNull Term telescope(int _47, Seq _48) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _49) {
return _baka._baka_Color.ourCall;
}
public @NotNull Result isAvailable(Seq _50) {
return Result.ok(_50.toImmutableSeq());
}
}
@CompiledAya(module = {"baka", "Color"}, fileModuleSize = 1, name = "black", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Color_black extends JitCon {
public /* constructor */ _baka_Color_black() {
super(0, new boolean[]{ }, new String[]{ }, _baka._baka_Color.INSTANCE, 0, false);
}
public static final _baka._baka_Color_black INSTANCE = new _baka._baka_Color_black();
public static final ConCall ourCall = new ConCall(_baka._baka_Color_black.INSTANCE);
public @NotNull Term telescope(int _51, Seq _52) {
return Panic.unreachable();
}
public @NotNull Term result(Seq _53) {
return _baka._baka_Color.ourCall;
}
public @NotNull Result isAvailable(Seq _54) {
return Result.ok(_54.toImmutableSeq());
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "Decider", assoc = -1, shape = -1, recognition = { })
public static final class _baka_Decider extends JitFn {
public /* constructor */ _baka_Decider() {
super(1, new boolean[]{true}, new String[]{"A"}, 0);
}
public static final _baka._baka_Decider INSTANCE = new _baka._baka_Decider();
public @NotNull Term telescope(int _55, Seq _56) {
if (_55 == 0) {
return SortTerm.Type0;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _57) {
return SortTerm.Type0;
}
public Term invoke(Term _58) {
return new DepTypeTerm(DTKind.Pi, _58, Closure.mkConst(new DepTypeTerm(DTKind.Pi, _58, Closure.mkConst(_baka._baka_Bool.ourCall))));
}
public @NotNull Term invoke(Seq _59) {
return this.invoke(((Term) _59.get(0)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "RBTree", assoc = -1, shape = -1, recognition = { })
public static final class _baka_RBTree extends JitData {
public /* constructor */ _baka_RBTree() {
super(1, new boolean[]{true}, new String[]{"A"}, 2);
}
public static final _baka._baka_RBTree INSTANCE = new _baka._baka_RBTree();
public @NotNull Term telescope(int _60, Seq _61) {
if (_60 == 0) {
return SortTerm.Type0;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _62) {
return SortTerm.Type0;
}
public JitCon @NotNull [] constructors() {
if (this.constructors[0] == null) {
this.constructors[0] = _baka._baka_RBTree_rbLeaf.INSTANCE;
this.constructors[1] = _baka._baka_RBTree_rbNode.INSTANCE;
}
return this.constructors;
}
}
@CompiledAya(module = {"baka", "RBTree"}, fileModuleSize = 1, name = "rbLeaf", assoc = -1, shape = -1, recognition = { })
public static final class _baka_RBTree_rbLeaf extends JitCon {
public /* constructor */ _baka_RBTree_rbLeaf() {
super(1, new boolean[]{false}, new String[]{"A"}, _baka._baka_RBTree.INSTANCE, 0, false);
}
public static final _baka._baka_RBTree_rbLeaf INSTANCE = new _baka._baka_RBTree_rbLeaf();
public @NotNull Term telescope(int _63, Seq _64) {
if (_63 == 0) {
return SortTerm.Type0;
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _65) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _65.get(0))}));
}
public @NotNull Result isAvailable(Seq _66) {
return Result.ok(_66.toImmutableSeq());
}
}
@CompiledAya(module = {"baka", "RBTree"}, fileModuleSize = 1, name = "rbNode", assoc = -1, shape = -1, recognition = { })
public static final class _baka_RBTree_rbNode extends JitCon {
public /* constructor */ _baka_RBTree_rbNode() {
super(5, new boolean[]{false, true, true, true, true}, new String[]{"A", "_7", "_3", "_7", "_1"}, _baka._baka_RBTree.INSTANCE, 4, false);
}
public static final _baka._baka_RBTree_rbNode INSTANCE = new _baka._baka_RBTree_rbNode();
public @NotNull Term telescope(int _67, Seq _68) {
switch (_67) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return _baka._baka_Color.ourCall;
}
case 2 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _68.get(0))}));
}
case 3 -> {
return ((Term) _68.get(0));
}
case 4 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _68.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _69) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _69.get(0))}));
}
public @NotNull Result isAvailable(Seq _70) {
return Result.ok(_70.toImmutableSeq());
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "rbTreeToList", assoc = -1, shape = -1, recognition = { })
public static final class _baka_rbTreeToList extends JitFn {
public /* constructor */ _baka_rbTreeToList() {
super(3, new boolean[]{false, true, true}, new String[]{"A", "rb", "r"}, 0);
}
public static final _baka._baka_rbTreeToList INSTANCE = new _baka._baka_rbTreeToList();
public @NotNull Term telescope(int _71, Seq _72) {
switch (_71) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _72.get(0))}));
}
case 2 -> {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _72.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _73) {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _73.get(0))}));
}
public Term invoke(Term _74, Term _75, Term _76) {
MutableSeq _77 = MutableSeq.fill(6, ((Term) null));
int _78 = 0;
do {
_77.set(0, _74);
if (_75 instanceof ConCallLike _80) {
if (_80.ref() == _baka._baka_RBTree_rbLeaf.INSTANCE) {
_77.set(1, _76);
_78 = 1;
break;
}
} else {
break;
}
_77.set(0, _74);
if (_80.ref() == _baka_RBTree_rbNode.INSTANCE) {
_77.set(1, _80.conArgs().get(0));
_77.set(2, _80.conArgs().get(1));
_77.set(3, _80.conArgs().get(2));
_77.set(4, _80.conArgs().get(3));
_77.set(5, _76);
_78 = 2;
break;
}
} while (false);
switch (_78) {
case 0 -> {
return new FnCall(_baka._baka_rbTreeToList.INSTANCE, 0, ImmutableSeq.from(new Term[]{_74, _75, _76}));
}
case 1 -> {
return ((Term) _77.get(1));
}
case 2 -> {
return _baka._baka_rbTreeToList.INSTANCE.invoke(((Term) _77.get(0)), ((Term) _77.get(2)), new RuleReducer.Con(new ListOps.ConRule(_baka._baka_List__58_62.INSTANCE, new ListTerm(ImmutableTreeSeq.from(new Term[]{ }), _baka._baka_List__91_93.INSTANCE, _baka._baka_List__58_62.INSTANCE, new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _77.get(0))})))), 0, ImmutableSeq.from(new Term[]{((Term) _77.get(0))}), ImmutableSeq.from(new Term[]{((Term) _77.get(3)), _baka._baka_rbTreeToList.INSTANCE.invoke(((Term) _77.get(0)), ((Term) _77.get(4)), ((Term) _77.get(5)))})).make());
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _82) {
return this.invoke(((Term) _82.get(0)), ((Term) _82.get(1)), ((Term) _82.get(2)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "repaint", assoc = -1, shape = -1, recognition = { })
public static final class _baka_repaint extends JitFn {
public /* constructor */ _baka_repaint() {
super(2, new boolean[]{false, true}, new String[]{"A", "_7"}, 0);
}
public static final _baka._baka_repaint INSTANCE = new _baka._baka_repaint();
public @NotNull Term telescope(int _83, Seq _84) {
switch (_83) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _84.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _85) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _85.get(0))}));
}
public Term invoke(Term _86, Term _87) {
MutableSeq _88 = MutableSeq.fill(5, ((Term) null));
int _89 = 0;
do {
_88.set(0, _86);
if (_87 instanceof ConCallLike _91) {
if (_91.ref() == _baka._baka_RBTree_rbNode.INSTANCE) {
_88.set(1, _91.conArgs().get(0));
_88.set(2, _91.conArgs().get(1));
_88.set(3, _91.conArgs().get(2));
_88.set(4, _91.conArgs().get(3));
_89 = 1;
break;
}
} else {
break;
}
_88.set(0, _86);
if (_91.ref() == _baka_RBTree_rbLeaf.INSTANCE) {
_89 = 2;
break;
}
} while (false);
switch (_89) {
case 0 -> {
return new FnCall(_baka._baka_repaint.INSTANCE, 0, ImmutableSeq.from(new Term[]{_86, _87}));
}
case 1 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _88.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _88.get(2)), ((Term) _88.get(3)), ((Term) _88.get(4))}));
}
case 2 -> {
return new ConCall(_baka._baka_RBTree_rbLeaf.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _88.get(0))}), 0, ImmutableSeq.from(new Term[]{ }));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _93) {
return this.invoke(((Term) _93.get(0)), ((Term) _93.get(1)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "sub", assoc = -1, shape = 4, recognition = { })
public static final class _baka_sub extends JitFn {
public /* constructor */ _baka_sub() {
super(2, new boolean[]{true, true}, new String[]{"x", "y"}, 0);
}
public static final _baka._baka_sub INSTANCE = new _baka._baka_sub();
public @NotNull Term telescope(int _94, Seq _95) {
switch (_94) {
case 0 -> {
return _baka._baka_Nat.ourCall;
}
case 1 -> {
return _baka._baka_Nat.ourCall;
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _96) {
return _baka._baka_Nat.ourCall;
}
public Term invoke(Term _97, Term _98) {
MutableSeq _99 = MutableSeq.fill(2, ((Term) null));
int _100 = 0;
boolean _101;
do {
_99.set(0, _97);
_101 = false;
if (_98 instanceof IntegerTerm _103) {
if (_103.repr() == 0) {
_101 = true;
}
}
if (!(_101)) {
if (_98 instanceof ConCallLike _104) {
if (_104.ref() == _baka._baka_Nat_O.INSTANCE) {
_101 = true;
}
} else {
break;
}
}
if (_101) {
_100 = 1;
break;
}
if (_97 instanceof IntegerTerm _106) {
if (_106.repr() == 0) {
_101 = true;
}
}
if (!(_101)) {
if (_97 instanceof ConCallLike _107) {
if (_107.ref() == _baka._baka_Nat_O.INSTANCE) {
_101 = true;
}
} else {
break;
}
}
if (_101) {
ConCallLike _108 = (ConCallLike) _98;
if (_108.ref() == _baka_Nat_S.INSTANCE) {
_99.set(0, _108.conArgs().get(0));
_100 = 2;
break;
}
}
ConCallLike _109 = (ConCallLike) _97;
if (_109.ref() == _baka_Nat_S.INSTANCE) {
_99.set(0, _109.conArgs().get(0));
ConCallLike _110 = (ConCallLike) _98;
if (_110.ref() == _baka_Nat_S.INSTANCE) {
_99.set(1, _110.conArgs().get(0));
_100 = 3;
break;
}
}
} while (false);
switch (_100) {
case 0 -> {
return new FnCall(_baka._baka_sub.INSTANCE, 0, ImmutableSeq.from(new Term[]{_97, _98}));
}
case 1 -> {
return ((Term) _99.get(0));
}
case 2 -> {
return new IntegerTerm(0, _baka._baka_Nat_O.INSTANCE, _baka._baka_Nat_S.INSTANCE, _baka._baka_Nat.ourCall);
}
case 3 -> {
return _baka._baka_sub.INSTANCE.invoke(((Term) _99.get(0)), ((Term) _99.get(1)));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _111) {
return this.invoke(((Term) _111.get(0)), ((Term) _111.get(1)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "le", assoc = -1, shape = -1, recognition = { })
public static final class _baka_le extends JitFn {
public /* constructor */ _baka_le() {
super(2, new boolean[]{true, true}, new String[]{"x", "y"}, 0);
}
public static final _baka._baka_le INSTANCE = new _baka._baka_le();
public @NotNull Term telescope(int _112, Seq _113) {
switch (_112) {
case 0 -> {
return _baka._baka_Nat.ourCall;
}
case 1 -> {
return _baka._baka_Nat.ourCall;
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _114) {
return _baka._baka_Bool.ourCall;
}
public Term invoke(Term _115, Term _116) {
return _baka._baka_isZero.INSTANCE.invoke(new RuleReducer.Fn(new IntegerOps.FnRule(_baka._baka_sub.INSTANCE, IntegerOps.FnRule.Kind.SubTrunc), 0, ImmutableSeq.from(new Term[]{_115, _116})).make());
}
public @NotNull Term invoke(Seq _117) {
return this.invoke(((Term) _117.get(0)), ((Term) _117.get(1)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "balanceLeft", assoc = -1, shape = -1, recognition = { })
public static final class _baka_balanceLeft extends JitFn {
public /* constructor */ _baka_balanceLeft() {
super(5, new boolean[]{false, true, true, true, true}, new String[]{"A", "_1", "_5", "_1", "_7"}, 0);
}
public static final _baka._baka_balanceLeft INSTANCE = new _baka._baka_balanceLeft();
public @NotNull Term telescope(int _118, Seq _119) {
switch (_118) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return _baka._baka_Color.ourCall;
}
case 2 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _119.get(0))}));
}
case 3 -> {
return ((Term) _119.get(0));
}
case 4 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _119.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _120) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _120.get(0))}));
}
public Term invoke(Term _121, Term _122, Term _123, Term _124, Term _125) {
MutableSeq _126 = MutableSeq.fill(8, ((Term) null));
int _127 = 0;
do {
_126.set(0, _121);
if (_122 instanceof ConCallLike _129) {
if (_129.ref() == _baka._baka_Color_black.INSTANCE) {
if (_123 instanceof ConCallLike _130) {
if (_130.ref() == _baka._baka_RBTree_rbNode.INSTANCE) {
if (((Term) _130.conArgs().get(0)) instanceof ConCallLike _131) {
if (_131.ref() == _baka._baka_Color_red.INSTANCE) {
if (((Term) _130.conArgs().get(1)) instanceof ConCallLike _132) {
if (_132.ref() == _baka._baka_RBTree_rbNode.INSTANCE) {
if (((Term) _132.conArgs().get(0)) instanceof ConCallLike _133) {
if (_133.ref() == _baka._baka_Color_red.INSTANCE) {
_126.set(1, _132.conArgs().get(1));
_126.set(2, _132.conArgs().get(2));
_126.set(3, _132.conArgs().get(3));
_126.set(4, _130.conArgs().get(2));
_126.set(5, _130.conArgs().get(3));
_126.set(6, _124);
_126.set(7, _125);
_127 = 1;
break;
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
_126.set(0, _121);
if (_129.ref() == _baka_Color_black.INSTANCE) {
if (_123 instanceof ConCallLike _135) {
if (_135.ref() == _baka_RBTree_rbNode.INSTANCE) {
if (((Term) _135.conArgs().get(0)) instanceof ConCallLike _136) {
if (_136.ref() == _baka_Color_red.INSTANCE) {
_126.set(1, _135.conArgs().get(1));
_126.set(2, _135.conArgs().get(2));
if (((Term) _135.conArgs().get(3)) instanceof ConCallLike _137) {
if (_137.ref() == _baka_RBTree_rbNode.INSTANCE) {
if (((Term) _137.conArgs().get(0)) instanceof ConCallLike _138) {
if (_138.ref() == _baka_Color_red.INSTANCE) {
_126.set(3, _137.conArgs().get(1));
_126.set(4, _137.conArgs().get(2));
_126.set(5, _137.conArgs().get(3));
_126.set(6, _124);
_126.set(7, _125);
_127 = 2;
break;
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
_126.set(0, _121);
_126.set(1, _122);
_126.set(2, _123);
_126.set(3, _124);
_126.set(4, _125);
_127 = 3;
break;
} while (false);
switch (_127) {
case 0 -> {
return new FnCall(_baka._baka_balanceLeft.INSTANCE, 0, ImmutableSeq.from(new Term[]{_121, _122, _123, _124, _125}));
}
case 1 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_red.ourCall, new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _126.get(1)), ((Term) _126.get(2)), ((Term) _126.get(3))})), ((Term) _126.get(4)), new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _126.get(5)), ((Term) _126.get(6)), ((Term) _126.get(7))}))}));
}
case 2 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_red.ourCall, new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _126.get(1)), ((Term) _126.get(2)), ((Term) _126.get(3))})), ((Term) _126.get(4)), new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _126.get(5)), ((Term) _126.get(6)), ((Term) _126.get(7))}))}));
}
case 3 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _126.get(0))}), 0, ImmutableSeq.from(new Term[]{((Term) _126.get(1)), ((Term) _126.get(2)), ((Term) _126.get(3)), ((Term) _126.get(4))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _139) {
return this.invoke(((Term) _139.get(0)), ((Term) _139.get(1)), ((Term) _139.get(2)), ((Term) _139.get(3)), ((Term) _139.get(4)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "balanceRight", assoc = -1, shape = -1, recognition = { })
public static final class _baka_balanceRight extends JitFn {
public /* constructor */ _baka_balanceRight() {
super(5, new boolean[]{false, true, true, true, true}, new String[]{"A", "_9", "_3", "_7", "_1"}, 0);
}
public static final _baka._baka_balanceRight INSTANCE = new _baka._baka_balanceRight();
public @NotNull Term telescope(int _140, Seq _141) {
switch (_140) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return _baka._baka_Color.ourCall;
}
case 2 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _141.get(0))}));
}
case 3 -> {
return ((Term) _141.get(0));
}
case 4 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _141.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _142) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _142.get(0))}));
}
public Term invoke(Term _143, Term _144, Term _145, Term _146, Term _147) {
MutableSeq _148 = MutableSeq.fill(8, ((Term) null));
int _149 = 0;
do {
_148.set(0, _143);
if (_144 instanceof ConCallLike _151) {
if (_151.ref() == _baka._baka_Color_black.INSTANCE) {
_148.set(1, _145);
_148.set(2, _146);
if (_147 instanceof ConCallLike _152) {
if (_152.ref() == _baka._baka_RBTree_rbNode.INSTANCE) {
if (((Term) _152.conArgs().get(0)) instanceof ConCallLike _153) {
if (_153.ref() == _baka._baka_Color_red.INSTANCE) {
if (((Term) _152.conArgs().get(1)) instanceof ConCallLike _154) {
if (_154.ref() == _baka._baka_RBTree_rbNode.INSTANCE) {
if (((Term) _154.conArgs().get(0)) instanceof ConCallLike _155) {
if (_155.ref() == _baka._baka_Color_red.INSTANCE) {
_148.set(3, _154.conArgs().get(1));
_148.set(4, _154.conArgs().get(2));
_148.set(5, _154.conArgs().get(3));
_148.set(6, _152.conArgs().get(2));
_148.set(7, _152.conArgs().get(3));
_149 = 1;
break;
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
_148.set(0, _143);
if (_151.ref() == _baka_Color_black.INSTANCE) {
_148.set(1, _145);
_148.set(2, _146);
if (_147 instanceof ConCallLike _157) {
if (_157.ref() == _baka_RBTree_rbNode.INSTANCE) {
if (((Term) _157.conArgs().get(0)) instanceof ConCallLike _158) {
if (_158.ref() == _baka_Color_red.INSTANCE) {
_148.set(3, _157.conArgs().get(1));
_148.set(4, _157.conArgs().get(2));
if (((Term) _157.conArgs().get(3)) instanceof ConCallLike _159) {
if (_159.ref() == _baka_RBTree_rbNode.INSTANCE) {
if (((Term) _159.conArgs().get(0)) instanceof ConCallLike _160) {
if (_160.ref() == _baka_Color_red.INSTANCE) {
_148.set(5, _159.conArgs().get(1));
_148.set(6, _159.conArgs().get(2));
_148.set(7, _159.conArgs().get(3));
_149 = 2;
break;
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
} else {
break;
}
}
_148.set(0, _143);
_148.set(1, _144);
_148.set(2, _145);
_148.set(3, _146);
_148.set(4, _147);
_149 = 3;
break;
} while (false);
switch (_149) {
case 0 -> {
return new FnCall(_baka._baka_balanceRight.INSTANCE, 0, ImmutableSeq.from(new Term[]{_143, _144, _145, _146, _147}));
}
case 1 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_red.ourCall, new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _148.get(1)), ((Term) _148.get(2)), ((Term) _148.get(3))})), ((Term) _148.get(4)), new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _148.get(5)), ((Term) _148.get(6)), ((Term) _148.get(7))}))}));
}
case 2 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_red.ourCall, new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _148.get(1)), ((Term) _148.get(2)), ((Term) _148.get(3))})), ((Term) _148.get(4)), new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_black.ourCall, ((Term) _148.get(5)), ((Term) _148.get(6)), ((Term) _148.get(7))}))}));
}
case 3 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _148.get(0))}), 0, ImmutableSeq.from(new Term[]{((Term) _148.get(1)), ((Term) _148.get(2)), ((Term) _148.get(3)), ((Term) _148.get(4))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _161) {
return this.invoke(((Term) _161.get(0)), ((Term) _161.get(1)), ((Term) _161.get(2)), ((Term) _161.get(3)), ((Term) _161.get(4)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "insert", assoc = -1, shape = -1, recognition = { })
public static final class _baka_insert extends JitFn {
public /* constructor */ _baka_insert() {
super(4, new boolean[]{false, true, true, true}, new String[]{"A", "a", "node", "dec_le"}, 0);
}
public static final _baka._baka_insert INSTANCE = new _baka._baka_insert();
public @NotNull Term telescope(int _162, Seq _163) {
switch (_162) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return ((Term) _163.get(0));
}
case 2 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _163.get(0))}));
}
case 3 -> {
return _baka._baka_Decider.INSTANCE.invoke(((Term) _163.get(0)));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _164) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _164.get(0))}));
}
public Term invoke(Term _165, Term _166, Term _167, Term _168) {
MutableSeq _169 = MutableSeq.fill(7, ((Term) null));
int _170 = 0;
do {
_169.set(0, _165);
_169.set(1, _166);
if (_167 instanceof ConCallLike _172) {
if (_172.ref() == _baka._baka_RBTree_rbLeaf.INSTANCE) {
_169.set(2, _168);
_170 = 1;
break;
}
} else {
break;
}
_169.set(0, _165);
_169.set(1, _166);
if (_172.ref() == _baka_RBTree_rbNode.INSTANCE) {
_169.set(2, _172.conArgs().get(0));
_169.set(3, _172.conArgs().get(1));
_169.set(4, _172.conArgs().get(2));
_169.set(5, _172.conArgs().get(3));
_169.set(6, _168);
_170 = 2;
break;
}
} while (false);
switch (_170) {
case 0 -> {
return new FnCall(_baka._baka_insert.INSTANCE, 0, ImmutableSeq.from(new Term[]{_165, _166, _167, _168}));
}
case 1 -> {
return new ConCall(_baka._baka_RBTree_rbNode.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _169.get(0))}), 0, ImmutableSeq.from(new Term[]{_baka._baka_Color_red.ourCall, new ConCall(_baka._baka_RBTree_rbLeaf.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _169.get(0))}), 0, ImmutableSeq.from(new Term[]{ })), ((Term) _169.get(1)), new ConCall(_baka._baka_RBTree_rbLeaf.INSTANCE, ImmutableSeq.from(new Term[]{((Term) _169.get(0))}), 0, ImmutableSeq.from(new Term[]{ }))}));
}
case 2 -> {
return _baka._baka_match_4551_5823_4554_582.INSTANCE.invoke(((Term) _169.get(0)), ((Term) _169.get(5)), ((Term) _169.get(6)), ((Term) _169.get(4)), ((Term) _169.get(1)), ((Term) _169.get(3)), ((Term) _169.get(2)), new AppTerm(new AppTerm(((Term) _169.get(6)), ((Term) _169.get(4))).make(), ((Term) _169.get(1))).make());
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _174) {
return this.invoke(((Term) _174.get(0)), ((Term) _174.get(1)), ((Term) _174.get(2)), ((Term) _174.get(3)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "aux", assoc = -1, shape = -1, recognition = { })
public static final class _baka_aux extends JitFn {
public /* constructor */ _baka_aux() {
super(4, new boolean[]{false, true, true, true}, new String[]{"A", "ls", "r", "dec_le"}, 0);
}
public static final _baka._baka_aux INSTANCE = new _baka._baka_aux();
public @NotNull Term telescope(int _175, Seq _176) {
switch (_175) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _176.get(0))}));
}
case 2 -> {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _176.get(0))}));
}
case 3 -> {
return _baka._baka_Decider.INSTANCE.invoke(((Term) _176.get(0)));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _177) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _177.get(0))}));
}
public Term invoke(Term _178, Term _179, Term _180, Term _181) {
MutableSeq _182 = MutableSeq.fill(5, ((Term) null));
int _183 = 0;
do {
_182.set(0, _178);
if (_179 instanceof ConCallLike _185) {
if (_185.ref() == _baka._baka_List__91_93.INSTANCE) {
_182.set(1, _180);
_182.set(2, _181);
_183 = 1;
break;
}
} else {
break;
}
_182.set(0, _178);
if (_185.ref() == _baka_List__58_62.INSTANCE) {
_182.set(1, _185.conArgs().get(0));
_182.set(2, _185.conArgs().get(1));
_182.set(3, _180);
_182.set(4, _181);
_183 = 2;
break;
}
} while (false);
switch (_183) {
case 0 -> {
return new FnCall(_baka._baka_aux.INSTANCE, 0, ImmutableSeq.from(new Term[]{_178, _179, _180, _181}));
}
case 1 -> {
return ((Term) _182.get(1));
}
case 2 -> {
return _baka._baka_aux.INSTANCE.invoke(((Term) _182.get(0)), ((Term) _182.get(2)), _baka._baka_repaint.INSTANCE.invoke(((Term) _182.get(0)), _baka._baka_insert.INSTANCE.invoke(((Term) _182.get(0)), ((Term) _182.get(1)), ((Term) _182.get(3)), ((Term) _182.get(4)))), ((Term) _182.get(4)));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _187) {
return this.invoke(((Term) _187.get(0)), ((Term) _187.get(1)), ((Term) _187.get(2)), ((Term) _187.get(3)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "tree_sort", assoc = -1, shape = -1, recognition = { })
public static final class _baka_tree__sort extends JitFn {
public /* constructor */ _baka_tree__sort() {
super(3, new boolean[]{false, true, true}, new String[]{"A", "dec_le", "l"}, 0);
}
public static final _baka._baka_tree__sort INSTANCE = new _baka._baka_tree__sort();
public @NotNull Term telescope(int _188, Seq _189) {
switch (_188) {
case 0 -> {
return SortTerm.Type0;
}
case 1 -> {
return _baka._baka_Decider.INSTANCE.invoke(((Term) _189.get(0)));
}
case 2 -> {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _189.get(0))}));
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term result(Seq _190) {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _190.get(0))}));
}
public Term invoke(Term _191, Term _192, Term _193) {
return _baka._baka_rbTreeToList.INSTANCE.invoke(_191, _baka._baka_aux.INSTANCE.invoke(_191, _193, new ConCall(_baka._baka_RBTree_rbLeaf.INSTANCE, ImmutableSeq.from(new Term[]{_191}), 0, ImmutableSeq.from(new Term[]{ })), _192), new RuleReducer.Con(new ListOps.ConRule(_baka._baka_List__91_93.INSTANCE, new ListTerm(ImmutableTreeSeq.from(new Term[]{ }), _baka._baka_List__91_93.INSTANCE, _baka._baka_List__58_62.INSTANCE, new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{_191})))), 0, ImmutableSeq.from(new Term[]{_191}), ImmutableSeq.from(new Term[]{ })).make());
}
public @NotNull Term invoke(Seq _194) {
return this.invoke(((Term) _194.get(0)), ((Term) _194.get(1)), ((Term) _194.get(2)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "tree_sortNat", assoc = -1, shape = -1, recognition = { })
public static final class _baka_tree__sortNat extends JitFn {
public /* constructor */ _baka_tree__sortNat() {
super(1, new boolean[]{true}, new String[]{"l"}, 0);
}
public static final _baka._baka_tree__sortNat INSTANCE = new _baka._baka_tree__sortNat();
public @NotNull Term telescope(int _195, Seq _196) {
if (_195 == 0) {
return new DataCall(_baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{_baka_Nat.ourCall}));
}
return Panic.unreachable();
}
public @NotNull Term result(Seq _197) {
return new DataCall(_baka._baka_List.INSTANCE, 0, ImmutableSeq.from(new Term[]{_baka._baka_Nat.ourCall}));
}
public Term invoke(Term _198) {
return _baka._baka_tree__sort.INSTANCE.invoke(_baka._baka_Nat.ourCall, new LamTerm(new Closure.Jit((_199) -> new LamTerm(new Closure.Jit((_200) -> _baka_le.INSTANCE.invoke(_199, _200))))), _198);
}
public @NotNull Term invoke(Seq _201) {
return this.invoke(((Term) _201.get(0)));
}
}
@CompiledAya(module = {"baka"}, fileModuleSize = 1, name = "match-51:23-54:2", assoc = -1, shape = -1, recognition = { })
public static final class _baka_match_4551_5823_4554_582 extends JitMatchy {
public /* constructor */ _baka_match_4551_5823_4554_582() {
super();
}
public static final _baka._baka_match_4551_5823_4554_582 INSTANCE = new _baka._baka_match_4551_5823_4554_582();
public Term invoke(Term _202, Term _203, Term _204, Term _205, Term _206, Term _207, Term _208, Term _209) {
int _211 = 0;
do {
if (_209 instanceof ConCallLike _213) {
if (_213.ref() == _baka._baka_Bool_True.INSTANCE) {
_211 = 1;
break;
}
} else {
break;
}
if (_213.ref() == _baka_Bool_False.INSTANCE) {
_211 = 2;
break;
}
} while (false);
switch (_211) {
case 0 -> {
return new MatchCall(_baka._baka_match_4551_5823_4554_582.INSTANCE, ImmutableSeq.from(new Term[]{_202, _203, _204, _205, _206, _207, _208}), ImmutableSeq.from(new Term[]{_209}));
}
case 1 -> {
return _baka._baka_balanceRight.INSTANCE.invoke(_202, _208, _207, _205, _baka._baka_insert.INSTANCE.invoke(_202, _206, _203, _204));
}
case 2 -> {
return _baka._baka_balanceLeft.INSTANCE.invoke(_202, _208, _baka._baka_insert.INSTANCE.invoke(_202, _206, _207, _204), _205, _203);
}
default -> {
return Panic.unreachable();
}
}
}
public @NotNull Term invoke(Seq _215, Seq _216) {
return this.invoke(((Term) _215.get(0)), ((Term) _215.get(1)), ((Term) _215.get(2)), ((Term) _215.get(3)), ((Term) _215.get(4)), ((Term) _215.get(5)), ((Term) _215.get(6)), ((Term) _216.get(0)));
}
public @NotNull Term type(Seq _217, @NotNull Seq _218) {
return new DataCall(_baka._baka_RBTree.INSTANCE, 0, ImmutableSeq.from(new Term[]{((Term) _217.get(0))}));
}
}
}
@HoshinoTented
Copy link

This is so cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment