egglog 3.0.0

egglog is a language that combines the benefits of equality saturation and datalog. It can be used for analysis, optimization, and synthesis of programs. It is the successor to the popular rust library egg.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
;; created by `python python/tests/test_array_api.py`
(push 1)
(sort egglog.exp.array_api.DType)
(constructor egglog_exp_array_api_DType_float64 () egglog.exp.array_api.DType)
(let $__expr_1 (egglog_exp_array_api_DType_float64 ))
(sort egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_DType___eq__ (egglog.exp.array_api.DType egglog.exp.array_api.DType) egglog.exp.array_api.Boolean)
(sort egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_NDArray_dtype (egglog.exp.array_api.NDArray) egglog.exp.array_api.DType)
(constructor egglog_exp_array_api_assume_isfinite (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_assume_shape (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_assume_dtype (egglog.exp.array_api.NDArray egglog.exp.array_api.DType) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_NDArray_var (String) egglog.exp.array_api.NDArray :cost 200)
(sort egglog.exp.array_api.Int)
(sort egglog.builtins.Vec[egglog.exp.array_api.Int] (Vec egglog.exp.array_api.Int))
(constructor egglog_exp_array_api_TupleInt___init__ (egglog.builtins.Vec[egglog.exp.array_api.Int]) egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_Int___init__ (i64) egglog.exp.array_api.Int)
(let $__expr_0 (egglog_exp_array_api_DType___eq__ $__expr_1 (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))))))
(ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.Value)
(sort egglog.exp.array_api.TupleValue)
(constructor _lambda_0 (egglog.exp.array_api.TupleValue egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_TupleValue___getitem__ (egglog.exp.array_api.TupleValue egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_TupleInt___getitem__ (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_0 _tv _idx) (egglog_exp_array_api_TupleValue___getitem__ _tv (egglog_exp_array_api_TupleInt___getitem__ _idx (egglog_exp_array_api_Int___init__ 0))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray_from_tuple_value (egglog.exp.array_api.TupleValue) egglog.exp.array_api.NDArray :unextractable)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt] (UnstableFn (egglog.exp.array_api.TupleInt ) egglog.exp.array_api.Value))
(constructor egglog_exp_array_api_NDArray_fn (egglog.exp.array_api.TupleInt egglog.exp.array_api.DType egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt]) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_TupleValue_length (egglog.exp.array_api.TupleValue) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Value_dtype (egglog.exp.array_api.Value) egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_NDArray_from_tuple_value _tv) (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_TupleValue_length _tv))) (egglog_exp_array_api_Value_dtype (egglog_exp_array_api_TupleValue___getitem__ _tv (egglog_exp_array_api_Int___init__ 0))) (unstable-fn "_lambda_0" _tv)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_1 (egglog.exp.array_api.NDArray egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_NDArray_index (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(rewrite (_lambda_1 _self _i) (egglog_exp_array_api_NDArray_index _self (egglog_exp_array_api_TupleInt___init__ (vec-of _i))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray_to_tuple_values (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleValue :unextractable)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int ) egglog.exp.array_api.Value))
(constructor egglog_exp_array_api_TupleValue_fn (egglog.exp.array_api.Int egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleValue)
(constructor egglog_exp_array_api_NDArray_shape (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_NDArray_to_tuple_values _self) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_1" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray_ndim (egglog.exp.array_api.NDArray) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_TupleInt_length (egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_NDArray_ndim _self) (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_2 (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(rewrite (_lambda_2 _self _idx) (egglog_exp_array_api_NDArray_index _self (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_TupleInt___getitem__ _idx (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_TupleInt___getitem__ _idx (egglog_exp_array_api_Int___init__ 0))))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray_T (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_NDArray_T _self) (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape _self) (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape _self) (egglog_exp_array_api_Int___init__ 0)))) (egglog_exp_array_api_NDArray_dtype _self) (unstable-fn "_lambda_2" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_3 (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Value_diff (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value :cost 100000000)
(constructor egglog_exp_array_api_TupleInt_drop (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt :unextractable)
(constructor egglog_exp_array_api_TupleInt_take (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (_lambda_3 _v _self _idx) (egglog_exp_array_api_Value_diff (egglog_exp_array_api_NDArray_index _self (egglog_exp_array_api_TupleInt_drop _idx (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape _v)))) (egglog_exp_array_api_NDArray_index _v (egglog_exp_array_api_TupleInt_take _idx (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape _v))))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray_diff (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray :unextractable)
(constructor egglog_exp_array_api_TupleInt___add__ (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_NDArray_diff _self _v) (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_TupleInt___add__ (egglog_exp_array_api_NDArray_shape _v) (egglog_exp_array_api_NDArray_shape _self)) (egglog_exp_array_api_NDArray_dtype _self) (unstable-fn "_lambda_3" _v _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_4 (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (_lambda_4 _i) _i :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.TupleNDArray)
(constructor _lambda_5 (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_TupleNDArray___getitem__ (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(rewrite (_lambda_5 _self _j) (egglog_exp_array_api_TupleNDArray___getitem__ _self _j) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_6 (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.NDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray] (UnstableFn () egglog.exp.array_api.NDArray))
(constructor egglog_exp_array_api_NDArray_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray] egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray]) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Int___eq__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_TupleNDArray_length (egglog.exp.array_api.TupleNDArray) egglog.exp.array_api.Int)
(rewrite (_lambda_6 _self _i _j) (egglog_exp_array_api_NDArray_if_ (egglog_exp_array_api_Int___eq__ _j (egglog_exp_array_api_TupleNDArray_length _self)) (unstable-fn "_lambda_4" _i) (unstable-fn "_lambda_5" _self _j)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleNDArray_append (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleNDArray :unextractable)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int ) egglog.exp.array_api.NDArray))
(constructor egglog_exp_array_api_TupleNDArray_fn (egglog.exp.array_api.Int egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleNDArray)
(constructor egglog_exp_array_api_Int___add__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_TupleNDArray_append _self _i) (egglog_exp_array_api_TupleNDArray_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleNDArray_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "_lambda_6" _self _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_7 (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(rewrite (_lambda_7 _self _i) (egglog_exp_array_api_TupleNDArray___getitem__ _self _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_8 (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.TupleValue egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.RecursiveValue)
(constructor egglog_exp_array_api_NDArray___init__ (egglog.exp.array_api.RecursiveValue) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_RecursiveValue___init__ (egglog.exp.array_api.Value) egglog.exp.array_api.RecursiveValue)
(constructor egglog_exp_array_api_Int___sub__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_8 _self _other _i) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_TupleValue___getitem__ _other (egglog_exp_array_api_Int___sub__ _i (egglog_exp_array_api_TupleNDArray_length _self))))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_9 (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.TupleValue egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Int___lt__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (_lambda_9 _self _other _i) (egglog_exp_array_api_NDArray_if_ (egglog_exp_array_api_Int___lt__ _i (egglog_exp_array_api_TupleNDArray_length _self)) (unstable-fn "_lambda_7" _self _i) (unstable-fn "_lambda_8" _self _other _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleNDArray___add__ (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.TupleValue) egglog.exp.array_api.TupleNDArray :unextractable)
(rewrite (egglog_exp_array_api_TupleNDArray___add__ _self _other) (egglog_exp_array_api_TupleNDArray_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleNDArray_length _self) (egglog_exp_array_api_TupleValue_length _other)) (unstable-fn "_lambda_9" _self _other)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleNDArray_drop_last (egglog.exp.array_api.TupleNDArray) egglog.exp.array_api.TupleNDArray :unextractable)
(rewrite (egglog_exp_array_api_TupleNDArray_drop_last _self) (egglog_exp_array_api_TupleNDArray_fn (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleNDArray_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "egglog_exp_array_api_TupleNDArray___getitem__" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleNDArray_last (egglog.exp.array_api.TupleNDArray) egglog.exp.array_api.NDArray :unextractable)
(rewrite (egglog_exp_array_api_TupleNDArray_last _self) (egglog_exp_array_api_TupleNDArray___getitem__ _self (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleNDArray_length _self) (egglog_exp_array_api_Int___init__ 1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_10 (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (_lambda_10 _i) _i :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_11 (egglog.exp.array_api.Int egglog.exp.array_api.TupleValue) egglog.exp.array_api.Value)
(rewrite (_lambda_11 _j _self) (egglog_exp_array_api_TupleValue___getitem__ _self _j) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_12 (egglog.exp.array_api.TupleValue egglog.exp.array_api.Value egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value] (UnstableFn () egglog.exp.array_api.Value))
(constructor egglog_exp_array_api_Value_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.Value] egglog.builtins.UnstableFn[egglog.exp.array_api.Value]) egglog.exp.array_api.Value)
(rewrite (_lambda_12 _self _i _j) (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Int___eq__ _j (egglog_exp_array_api_TupleValue_length _self)) (unstable-fn "_lambda_10" _i) (unstable-fn "_lambda_11" _j _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue_append (egglog.exp.array_api.TupleValue egglog.exp.array_api.Value) egglog.exp.array_api.TupleValue :unextractable)
(rewrite (egglog_exp_array_api_TupleValue_append _self _i) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleValue_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "_lambda_12" _self _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_13 (egglog.exp.array_api.Int egglog.exp.array_api.TupleValue) egglog.exp.array_api.Value)
(rewrite (_lambda_13 _i _self) (egglog_exp_array_api_TupleValue___getitem__ _self _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_14 (egglog.exp.array_api.TupleValue egglog.exp.array_api.Int egglog.exp.array_api.TupleValue) egglog.exp.array_api.Value)
(rewrite (_lambda_14 _other _i _self) (egglog_exp_array_api_TupleValue___getitem__ _other (egglog_exp_array_api_Int___sub__ _i (egglog_exp_array_api_TupleValue_length _self))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_15 (egglog.exp.array_api.TupleValue egglog.exp.array_api.TupleValue egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(rewrite (_lambda_15 _other _self _i) (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Int___lt__ _i (egglog_exp_array_api_TupleValue_length _self)) (unstable-fn "_lambda_13" _i _self) (unstable-fn "_lambda_14" _other _i _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue___add__ (egglog.exp.array_api.TupleValue egglog.exp.array_api.TupleValue) egglog.exp.array_api.TupleValue :unextractable)
(rewrite (egglog_exp_array_api_TupleValue___add__ _self _other) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleValue_length _self) (egglog_exp_array_api_TupleValue_length _other)) (unstable-fn "_lambda_15" _other _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue_last (egglog.exp.array_api.TupleValue) egglog.exp.array_api.Value :unextractable)
(rewrite (egglog_exp_array_api_TupleValue_last _self) (egglog_exp_array_api_TupleValue___getitem__ _self (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleValue_length _self) (egglog_exp_array_api_Int___init__ 1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue_drop_last (egglog.exp.array_api.TupleValue) egglog.exp.array_api.TupleValue :unextractable)
(rewrite (egglog_exp_array_api_TupleValue_drop_last _self) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleValue_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "egglog_exp_array_api_TupleValue___getitem__" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_16 (egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean)
(rewrite (_lambda_16 _init) _init :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Boolean,egglog.exp.array_api.Value] (UnstableFn (egglog.exp.array_api.Boolean egglog.exp.array_api.Value) egglog.exp.array_api.Boolean))
(constructor _lambda_17 (egglog.exp.array_api.Boolean egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Boolean,egglog.exp.array_api.Value]) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_TupleValue_foldl_boolean (egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Boolean,egglog.exp.array_api.Value] egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean :unextractable)
(rewrite (_lambda_17 _init _self _f) (unstable-app _f (egglog_exp_array_api_TupleValue_foldl_boolean (egglog_exp_array_api_TupleValue_drop_last _self) _f _init) (egglog_exp_array_api_TupleValue_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean] (UnstableFn () egglog.exp.array_api.Boolean))
(constructor egglog_exp_array_api_Boolean_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean] egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean]) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_TupleValue_foldl_boolean _self _f _init) (egglog_exp_array_api_Boolean_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleValue_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_16" _init) (unstable-fn "_lambda_17" _init _self _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_18 (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (_lambda_18 _init) _init :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.Value] (UnstableFn (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value))
(constructor _lambda_19 (egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.Value] egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_TupleValue_foldl_value (egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.Value] egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (_lambda_19 _self _f _init) (unstable-app _f (egglog_exp_array_api_TupleValue_foldl_value (egglog_exp_array_api_TupleValue_drop_last _self) _f _init) (egglog_exp_array_api_TupleValue_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleValue_foldl_value _self _f _init) (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleValue_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_18" _init) (unstable-fn "_lambda_19" _self _f _init)) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value] (UnstableFn (egglog.exp.array_api.Value ) egglog.exp.array_api.Value))
(constructor _lambda_20 (egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value] egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(rewrite (_lambda_20 _self _f _i) (unstable-app _f (egglog_exp_array_api_TupleValue___getitem__ _self _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue_map_value (egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value]) egglog.exp.array_api.TupleValue :unextractable)
(rewrite (egglog_exp_array_api_TupleValue_map_value _self _f) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_TupleValue_length _self) (unstable-fn "_lambda_20" _self _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_21 (egglog.exp.array_api.Value egglog.exp.array_api.Boolean egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_Boolean___or__ (egglog.exp.array_api.Boolean egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_Value___eq__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (_lambda_21 _value _acc _j) (egglog_exp_array_api_Boolean___or__ _acc (egglog_exp_array_api_Value___eq__ _value _j)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue_contains (egglog.exp.array_api.TupleValue egglog.exp.array_api.Value) egglog.exp.array_api.Boolean :unextractable)
(constructor egglog_exp_array_api_Boolean___init__ (bool) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_TupleValue_contains _self _value) (egglog_exp_array_api_TupleValue_foldl_boolean _self (unstable-fn "_lambda_21" _value) (egglog_exp_array_api_Boolean___init__ false)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_22 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Value_from_int (egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(rewrite (_lambda_22 _ti _i) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ _ti _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleValue_from_tuple_int (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleValue :unextractable)
(rewrite (egglog_exp_array_api_TupleValue_from_tuple_int _ti) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_TupleInt_length _ti) (unstable-fn "_lambda_22" _ti)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_23 (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_23 _i) _i :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.TupleTupleInt)
(constructor _lambda_24 (egglog.exp.array_api.Int egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_TupleTupleInt___getitem__ (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_24 _j _self) (egglog_exp_array_api_TupleTupleInt___getitem__ _self _j) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_25 (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt] (UnstableFn () egglog.exp.array_api.TupleInt))
(constructor egglog_exp_array_api_TupleInt_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt] egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt]) egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_TupleTupleInt_length (egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_25 _self _i _j) (egglog_exp_array_api_TupleInt_if_ (egglog_exp_array_api_Int___eq__ _j (egglog_exp_array_api_TupleTupleInt_length _self)) (unstable-fn "_lambda_23" _i) (unstable-fn "_lambda_24" _j _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleTupleInt_append (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleTupleInt :unextractable)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int ) egglog.exp.array_api.TupleInt))
(constructor egglog_exp_array_api_TupleTupleInt_fn (egglog.exp.array_api.Int egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleTupleInt)
(rewrite (egglog_exp_array_api_TupleTupleInt_append _self _i) (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleTupleInt_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "_lambda_25" _self _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_26 (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_26 _self _i) (egglog_exp_array_api_TupleTupleInt___getitem__ _self _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_27 (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_27 _other _i _self) (egglog_exp_array_api_TupleTupleInt___getitem__ _other (egglog_exp_array_api_Int___sub__ _i (egglog_exp_array_api_TupleTupleInt_length _self))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_28 (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_28 _other _self _i) (egglog_exp_array_api_TupleInt_if_ (egglog_exp_array_api_Int___lt__ _i (egglog_exp_array_api_TupleTupleInt_length _self)) (unstable-fn "_lambda_26" _self _i) (unstable-fn "_lambda_27" _other _i _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleTupleInt___add__ (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.TupleTupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleTupleInt___add__ _self _other) (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleTupleInt_length _self) (egglog_exp_array_api_TupleTupleInt_length _other)) (unstable-fn "_lambda_28" _other _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_29 (egglog.exp.array_api.Int egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_29 _n _self _i) (egglog_exp_array_api_TupleTupleInt___getitem__ _self (egglog_exp_array_api_Int___add__ _i _n)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleTupleInt_drop (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleTupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleTupleInt_drop _self _n) (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleTupleInt_length _self) _n) (unstable-fn "_lambda_29" _n _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.TupleInt] (UnstableFn (egglog.exp.array_api.TupleInt ) egglog.exp.array_api.Int))
(constructor _lambda_30 (egglog.exp.array_api.TupleTupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.TupleInt] egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_30 _self _f _i) (unstable-app _f (egglog_exp_array_api_TupleTupleInt___getitem__ _self _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleTupleInt_map_int (egglog.exp.array_api.TupleTupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.TupleInt]) egglog.exp.array_api.TupleInt :unextractable)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int ) egglog.exp.array_api.Int))
(constructor egglog_exp_array_api_TupleInt_fn (egglog.exp.array_api.Int egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_TupleTupleInt_map_int _self _f) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_TupleTupleInt_length _self) (unstable-fn "_lambda_30" _self _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt] (UnstableFn (egglog.exp.array_api.Value egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value))
(constructor _lambda_31 (egglog.exp.array_api.TupleTupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt] egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_TupleTupleInt_foldl_value (egglog.exp.array_api.TupleTupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt] egglog.exp.array_api.Value) egglog.exp.array_api.Value :unextractable)
(constructor egglog_exp_array_api_TupleTupleInt_drop_last (egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.TupleTupleInt :unextractable)
(constructor egglog_exp_array_api_TupleTupleInt_last (egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (_lambda_31 _self _f _init) (unstable-app _f (egglog_exp_array_api_TupleTupleInt_foldl_value (egglog_exp_array_api_TupleTupleInt_drop_last _self) _f _init) (egglog_exp_array_api_TupleTupleInt_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt_foldl_value _self _f _init) (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleTupleInt_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_18" _init) (unstable-fn "_lambda_31" _self _f _init)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt_last _self) (egglog_exp_array_api_TupleTupleInt___getitem__ _self (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleTupleInt_length _self) (egglog_exp_array_api_Int___init__ 1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt_drop_last _self) (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleTupleInt_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "egglog_exp_array_api_TupleTupleInt___getitem__" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_32 (egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_32 _x) (egglog_exp_array_api_TupleInt_length _x) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_33 (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Int___mod__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Int___floordiv__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_TupleInt_product (egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int :unextractable)
(rewrite (_lambda_33 _self _i _j) (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_TupleTupleInt___getitem__ _self _j) (egglog_exp_array_api_Int___mod__ (egglog_exp_array_api_Int___floordiv__ _i (egglog_exp_array_api_TupleInt_product (egglog_exp_array_api_TupleTupleInt_map_int (egglog_exp_array_api_TupleTupleInt_drop _self (egglog_exp_array_api_Int___add__ _j (egglog_exp_array_api_Int___init__ 1))) (unstable-fn "_lambda_32")))) (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_TupleTupleInt___getitem__ _self _j)))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_34 (egglog.exp.array_api.TupleTupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_34 _self _i) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_TupleTupleInt_length _self) (unstable-fn "_lambda_33" _self _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleTupleInt_product (egglog.exp.array_api.TupleTupleInt) egglog.exp.array_api.TupleTupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleTupleInt_product _self) (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_TupleInt_product (egglog_exp_array_api_TupleTupleInt_map_int _self (unstable-fn "_lambda_32"))) (unstable-fn "_lambda_34" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_35 (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt egglog.exp.array_api.Boolean egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_Boolean___and__ (egglog.exp.array_api.Boolean egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean)
(rewrite (_lambda_35 _other _self _acc _i) (egglog_exp_array_api_Boolean___and__ _acc (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt___getitem__ _self _i) (egglog_exp_array_api_TupleInt___getitem__ _other _i))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_36 (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.Boolean)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Boolean,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Boolean egglog.exp.array_api.Int) egglog.exp.array_api.Boolean))
(constructor egglog_exp_array_api_TupleInt_foldl_boolean (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Boolean,egglog.exp.array_api.Int] egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean :unextractable)
(constructor egglog_exp_array_api_TupleInt_range (egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (_lambda_36 _other _self) (egglog_exp_array_api_TupleInt_foldl_boolean (egglog_exp_array_api_TupleInt_range (egglog_exp_array_api_TupleInt_length _self)) (unstable-fn "_lambda_35" _other _self) (egglog_exp_array_api_Boolean___init__ true)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_37 () egglog.exp.array_api.Boolean)
(rewrite (_lambda_37 ) (egglog_exp_array_api_Boolean___init__ false) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt___eq__ (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_TupleInt___eq__ _self _other) (egglog_exp_array_api_Boolean_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_TupleInt_length _other)) (unstable-fn "_lambda_36" _other _self) (unstable-fn "_lambda_37")) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_38 (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_38 _i) _i :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_39 (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_39 _j _self) (egglog_exp_array_api_TupleInt___getitem__ _self _j) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_40 (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Int] (UnstableFn () egglog.exp.array_api.Int))
(constructor egglog_exp_array_api_Int_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.Int] egglog.builtins.UnstableFn[egglog.exp.array_api.Int]) egglog.exp.array_api.Int)
(rewrite (_lambda_40 _i _self _j) (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Int___eq__ _j (egglog_exp_array_api_TupleInt_length _self)) (unstable-fn "_lambda_38" _i) (unstable-fn "_lambda_39" _j _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_append (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_append _self _i) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "_lambda_40" _i _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_41 (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_41 _j _self) (egglog_exp_array_api_TupleInt___getitem__ _self (egglog_exp_array_api_Int___sub__ _j (egglog_exp_array_api_Int___init__ 1))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_42 (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_42 _i _self _j) (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Int___eq__ _j (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_38" _i) (unstable-fn "_lambda_41" _j _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_append_start (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_append_start _self _i) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "_lambda_42" _i _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_43 (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_43 _i _self) (egglog_exp_array_api_TupleInt___getitem__ _self _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_44 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_44 _other _i _self) (egglog_exp_array_api_TupleInt___getitem__ _other (egglog_exp_array_api_Int___sub__ _i (egglog_exp_array_api_TupleInt_length _self))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_45 (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_45 _other _self _i) (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Int___lt__ _i (egglog_exp_array_api_TupleInt_length _self)) (unstable-fn "_lambda_43" _i _self) (unstable-fn "_lambda_44" _other _i _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt___add__ _self _other) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_TupleInt_length _other)) (unstable-fn "_lambda_45" _other _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_46 (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_46 _n _self _i) (egglog_exp_array_api_TupleInt___getitem__ _self (egglog_exp_array_api_Int___add__ _i _n)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_drop _self _n) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt_length _self) _n) (unstable-fn "_lambda_46" _n _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_take _self _n) (egglog_exp_array_api_TupleInt_fn _n (unstable-fn "egglog_exp_array_api_TupleInt___getitem__" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_rest (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_rest _self) (egglog_exp_array_api_TupleInt_drop _self (egglog_exp_array_api_Int___init__ 1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_last (egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_last _self) (egglog_exp_array_api_TupleInt___getitem__ _self (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_drop_last (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_drop_last _self) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 1)) (unstable-fn "egglog_exp_array_api_TupleInt___getitem__" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_range _stop) (egglog_exp_array_api_TupleInt_fn _stop (unstable-fn "_lambda_38")) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_47 (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_47 _init) _init :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int))
(constructor _lambda_48 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int,egglog.exp.array_api.Int]) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_TupleInt_foldl (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int,egglog.exp.array_api.Int] egglog.exp.array_api.Int) egglog.exp.array_api.Int :unextractable)
(rewrite (_lambda_48 _self _init _f) (unstable-app _f (egglog_exp_array_api_TupleInt_foldl (egglog_exp_array_api_TupleInt_drop_last _self) _f _init) (egglog_exp_array_api_TupleInt_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_foldl _self _f _init) (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_47" _init) (unstable-fn "_lambda_48" _self _init _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_49 (egglog.exp.array_api.Boolean egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Boolean,egglog.exp.array_api.Int]) egglog.exp.array_api.Boolean)
(rewrite (_lambda_49 _init _self _f) (unstable-app _f (egglog_exp_array_api_TupleInt_foldl_boolean (egglog_exp_array_api_TupleInt_drop_last _self) _f _init) (egglog_exp_array_api_TupleInt_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_foldl_boolean _self _f _init) (egglog_exp_array_api_Boolean_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_16" _init) (unstable-fn "_lambda_49" _init _self _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_50 (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_50 _init) _init :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt))
(constructor _lambda_51 (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_TupleInt_foldl_tuple_int (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (_lambda_51 _self _f _init) (unstable-app _f (egglog_exp_array_api_TupleInt_foldl_tuple_int (egglog_exp_array_api_TupleInt_drop_last _self) _f _init) (egglog_exp_array_api_TupleInt_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_foldl_tuple_int _self _f _init) (egglog_exp_array_api_TupleInt_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_50" _init) (unstable-fn "_lambda_51" _self _f _init)) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Value egglog.exp.array_api.Int) egglog.exp.array_api.Value))
(constructor _lambda_52 (egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_TupleInt_foldl_value (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Value,egglog.exp.array_api.Int] egglog.exp.array_api.Value) egglog.exp.array_api.Value :unextractable)
(rewrite (_lambda_52 _f _self _init) (unstable-app _f (egglog_exp_array_api_TupleInt_foldl_value (egglog_exp_array_api_TupleInt_drop_last _self) _f _init) (egglog_exp_array_api_TupleInt_last _self)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_foldl_value _self _f _init) (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt_length _self) (egglog_exp_array_api_Int___init__ 0)) (unstable-fn "_lambda_18" _init) (unstable-fn "_lambda_52" _f _self _init)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_53 (egglog.exp.array_api.Int egglog.exp.array_api.Boolean egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (_lambda_53 _i _acc _j) (egglog_exp_array_api_Boolean___or__ _acc (egglog_exp_array_api_Int___eq__ _i _j)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_contains (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Boolean :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_contains _self _i) (egglog_exp_array_api_TupleInt_foldl_boolean _self (unstable-fn "_lambda_53" _i) (egglog_exp_array_api_Boolean___init__ false)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_54 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_54 _acc _v) (egglog_exp_array_api_TupleInt_append _acc _v) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_55 (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_55 _acc) _acc :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int ) egglog.exp.array_api.Boolean))
(constructor _lambda_56 (egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_56 _f _acc _v) (egglog_exp_array_api_TupleInt_if_ (unstable-app _f _v) (unstable-fn "_lambda_54" _acc _v) (unstable-fn "_lambda_55" _acc)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_filter (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Boolean,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_filter _self _f) (egglog_exp_array_api_TupleInt_foldl_tuple_int _self (unstable-fn "_lambda_56" _f) (egglog_exp_array_api_TupleInt___init__ (vec-empty ))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_57 (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Int___mul__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_57 _acc _i) (egglog_exp_array_api_Int___mul__ _acc _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_product _self) (egglog_exp_array_api_TupleInt_foldl _self (unstable-fn "_lambda_57") (egglog_exp_array_api_Int___init__ 1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_58 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_58 _self _i) (egglog_exp_array_api_TupleInt___getitem__ _self _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_select (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(constructor egglog_exp_array_api_TupleInt_map (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_select _self _indices) (egglog_exp_array_api_TupleInt_map _indices (unstable-fn "_lambda_58" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_59 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_Boolean___invert__ (egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean)
(rewrite (_lambda_59 _indices _i) (egglog_exp_array_api_Boolean___invert__ (egglog_exp_array_api_TupleInt_contains _indices _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_deselect (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_deselect _self _indices) (egglog_exp_array_api_TupleInt_map (egglog_exp_array_api_TupleInt_filter (egglog_exp_array_api_TupleInt_range (egglog_exp_array_api_TupleInt_length _self)) (unstable-fn "_lambda_59" _indices)) (unstable-fn "_lambda_58" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_60 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_60 _self _i) (egglog_exp_array_api_TupleInt___getitem__ _self (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt_length _self) _i) (egglog_exp_array_api_Int___init__ 1))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_reverse (egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_reverse _self) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_TupleInt_length _self) (unstable-fn "_lambda_60" _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_61 (egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_61 _f _self _i) (unstable-app _f (egglog_exp_array_api_TupleInt___getitem__ _self _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_map _self _f) (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_TupleInt_length _self) (unstable-fn "_lambda_61" _f _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_62 (egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_62 _f _self _i) (unstable-app _f (egglog_exp_array_api_TupleInt___getitem__ _self _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_map_tuple_int (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleTupleInt :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_map_tuple_int _self _f) (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_TupleInt_length _self) (unstable-fn "_lambda_62" _f _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_63 (egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Int] egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(rewrite (_lambda_63 _f _self _i) (unstable-app _f (egglog_exp_array_api_TupleInt___getitem__ _self _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_TupleInt_map_value (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Int]) egglog.exp.array_api.TupleValue :unextractable)
(rewrite (egglog_exp_array_api_TupleInt_map_value _self _f) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_TupleInt_length _self) (unstable-fn "_lambda_63" _f _self)) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api_loopnest.LoopNestAPI)
(constructor egglog_exp_array_api_loopnest_LoopNestAPI_indices (egglog.exp.array_api_loopnest.LoopNestAPI) egglog.exp.array_api.TupleTupleInt)
(constructor egglog_exp_array_api_loopnest_LoopNestAPI_get_dims (egglog.exp.array_api_loopnest.LoopNestAPI) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_loopnest_LoopNestAPI_indices _self) (egglog_exp_array_api_TupleTupleInt_product (egglog_exp_array_api_TupleInt_map_tuple_int (egglog_exp_array_api_loopnest_LoopNestAPI_get_dims _self) (unstable-fn "egglog_exp_array_api_TupleInt_range"))) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api_loopnest.OptionalLoopNestAPI)
(constructor egglog_exp_array_api_loopnest_LoopNestAPI_from_tuple (egglog.exp.array_api.TupleInt) egglog.exp.array_api_loopnest.OptionalLoopNestAPI)
(constructor egglog_exp_array_api_loopnest_OptionalLoopNestAPI_NONE () egglog.exp.array_api_loopnest.OptionalLoopNestAPI)
(rewrite (egglog_exp_array_api_loopnest_LoopNestAPI_from_tuple (egglog_exp_array_api_TupleInt___init__ (vec-empty ))) (egglog_exp_array_api_loopnest_OptionalLoopNestAPI_NONE ) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_loopnest_OptionalLoopNestAPI___init__ (egglog.exp.array_api_loopnest.LoopNestAPI) egglog.exp.array_api_loopnest.OptionalLoopNestAPI)
(constructor egglog_exp_array_api_loopnest_LoopNestAPI___init__ (egglog.exp.array_api.Int egglog.exp.array_api_loopnest.OptionalLoopNestAPI) egglog.exp.array_api_loopnest.LoopNestAPI)
(rewrite (egglog_exp_array_api_loopnest_LoopNestAPI_from_tuple (egglog_exp_array_api_TupleInt___init__ _vs)) (egglog_exp_array_api_loopnest_OptionalLoopNestAPI___init__ (egglog_exp_array_api_loopnest_LoopNestAPI___init__ (vec-get _vs (- (vec-length _vs) 1)) (egglog_exp_array_api_loopnest_LoopNestAPI_from_tuple (egglog_exp_array_api_TupleInt___init__ (vec-pop _vs))))) :subsume :when ((> (vec-length _vs) 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_loopnest_LoopNestAPI_get_dims (egglog_exp_array_api_loopnest_LoopNestAPI___init__ _dim (egglog_exp_array_api_loopnest_OptionalLoopNestAPI_NONE ))) (egglog_exp_array_api_TupleInt___init__ (vec-of _dim)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_loopnest_LoopNestAPI_get_dims (egglog_exp_array_api_loopnest_LoopNestAPI___init__ _dim (egglog_exp_array_api_loopnest_OptionalLoopNestAPI___init__ _lna))) (egglog_exp_array_api_TupleInt_append (egglog_exp_array_api_loopnest_LoopNestAPI_get_dims _lna) _dim) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_loopnest_OptionalLoopNestAPI_unwrap (egglog.exp.array_api_loopnest.OptionalLoopNestAPI) egglog.exp.array_api_loopnest.LoopNestAPI)
(rewrite (egglog_exp_array_api_loopnest_OptionalLoopNestAPI_unwrap (egglog_exp_array_api_loopnest_OptionalLoopNestAPI___init__ _lna)) _lna :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_64 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (_lambda_64 _axis _i) (egglog_exp_array_api_Boolean___invert__ (egglog_exp_array_api_TupleInt_contains _axis _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_65 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_65 _dims _i) (egglog_exp_array_api_TupleInt___getitem__ _dims _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_66 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (_lambda_66 _axis _i) (egglog_exp_array_api_TupleInt_contains _axis _i) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api_loopnest.ShapeAPI)
(constructor egglog_exp_array_api_loopnest_ShapeAPI_deselect (egglog.exp.array_api_loopnest.ShapeAPI egglog.exp.array_api.TupleInt) egglog.exp.array_api_loopnest.ShapeAPI)
(constructor egglog_exp_array_api_loopnest_ShapeAPI___init__ (egglog.exp.array_api.TupleInt) egglog.exp.array_api_loopnest.ShapeAPI)
(rewrite (egglog_exp_array_api_loopnest_ShapeAPI_deselect (egglog_exp_array_api_loopnest_ShapeAPI___init__ _dims) _axis) (egglog_exp_array_api_loopnest_ShapeAPI___init__ (egglog_exp_array_api_TupleInt_map (egglog_exp_array_api_TupleInt_filter (egglog_exp_array_api_TupleInt_range (egglog_exp_array_api_TupleInt_length _dims)) (unstable-fn "_lambda_64" _axis)) (unstable-fn "_lambda_65" _dims))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_loopnest_ShapeAPI_select (egglog.exp.array_api_loopnest.ShapeAPI egglog.exp.array_api.TupleInt) egglog.exp.array_api_loopnest.ShapeAPI)
(rewrite (egglog_exp_array_api_loopnest_ShapeAPI_select (egglog_exp_array_api_loopnest_ShapeAPI___init__ _dims) _axis) (egglog_exp_array_api_loopnest_ShapeAPI___init__ (egglog_exp_array_api_TupleInt_map (egglog_exp_array_api_TupleInt_filter (egglog_exp_array_api_TupleInt_range (egglog_exp_array_api_TupleInt_length _dims)) (unstable-fn "_lambda_66" _axis)) (unstable-fn "_lambda_65" _dims))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_loopnest_ShapeAPI_to_tuple (egglog.exp.array_api_loopnest.ShapeAPI) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_loopnest_ShapeAPI_to_tuple (egglog_exp_array_api_loopnest_ShapeAPI___init__ _dims)) _dims :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray_size (egglog.exp.array_api.NDArray) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_NDArray_size _x) (egglog_exp_array_api_TupleInt_foldl (egglog_exp_array_api_NDArray_shape _x) (unstable-fn "egglog_exp_array_api_Int___mul__") (egglog_exp_array_api_Int___init__ 1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_unique_values (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_possible_values (egglog.exp.array_api.Value) egglog.exp.array_api.TupleValue)
(constructor %egglog_thunk_ALL_INDICES () egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_unique_values _a) (egglog_exp_array_api_NDArray_from_tuple_value (egglog_exp_array_api_possible_values (egglog_exp_array_api_NDArray_index _a (%egglog_thunk_ALL_INDICES )))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_isfinite (egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value_isfinite (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_from_bool (egglog.exp.array_api.Boolean) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_Value_isfinite (egglog_exp_array_api_Value_from_bool _b)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.Float)
(constructor egglog_exp_array_api_Value_from_float (egglog.exp.array_api.Float) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Float___init__ (f64) egglog.exp.array_api.Float :cost 3)
(rewrite (egglog_exp_array_api_Value_isfinite (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ _f))) (egglog_exp_array_api_Boolean___init__ true) :when ((!= _f NaN)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_isfinite (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.OptionalIntOrTuple)
(constructor egglog_exp_array_api_sum (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalIntOrTuple) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_OptionalIntOrTuple_none () egglog.exp.array_api.OptionalIntOrTuple)
(rewrite (egglog_exp_array_api_isfinite (egglog_exp_array_api_sum _arr (egglog_exp_array_api_OptionalIntOrTuple_none ))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Value_isfinite (egglog_exp_array_api_NDArray_index _arr (%egglog_thunk_ALL_INDICES )))))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_assume_value_one_of (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleValue) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_assume_value_one_of _x _vs)) (egglog_exp_array_api_NDArray_shape _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_assume_value_one_of _x _vs)) (egglog_exp_array_api_NDArray_dtype _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _v (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_assume_value_one_of _x _vs) _idx)))
      ((union _v (egglog_exp_array_api_NDArray_index _x _idx))
       (union (egglog_exp_array_api_possible_values _v) _vs))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_assume_isfinite _x)) (egglog_exp_array_api_NDArray_shape _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_assume_isfinite _x)) (egglog_exp_array_api_NDArray_dtype _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_assume_isfinite _x) _ti) (egglog_exp_array_api_NDArray_index _x _ti) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_isfinite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_assume_isfinite _x) _ti)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_assume_shape _x _shape)) _shape :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_assume_shape _x _shape)) (egglog_exp_array_api_NDArray_dtype _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_assume_shape _x _shape) _idx) (egglog_exp_array_api_NDArray_index _x _idx) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_assume_dtype _x _dtype)) _dtype :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_assume_dtype _x _dtype)) (egglog_exp_array_api_NDArray_shape _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_assume_dtype _x _dtype) _idx) (egglog_exp_array_api_NDArray_index _x _idx) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.IndexKey)
(constructor egglog_exp_array_api_NDArray___getitem__ (egglog.exp.array_api.NDArray egglog.exp.array_api.IndexKey) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_IndexKey_int (egglog.exp.array_api.Int) egglog.exp.array_api.IndexKey)
(rewrite (egglog_exp_array_api_NDArray___getitem__ _x (egglog_exp_array_api_IndexKey_int _i)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_NDArray_index _x (egglog_exp_array_api_TupleInt___init__ (vec-of _i))))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_any (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value_to_truthy_value (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_any _x) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_TupleValue_contains (egglog_exp_array_api_possible_values (egglog_exp_array_api_Value_to_truthy_value (egglog_exp_array_api_NDArray_index _x (%egglog_thunk_ALL_INDICES )))) (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Boolean___init__ true)))))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___lt__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___lt__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_broadcast_index (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_broadcast_shapes (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_NDArray___lt__ _x _y) _idx) (egglog_exp_array_api_Value___lt__ (egglog_exp_array_api_NDArray_index _x (egglog_exp_array_api_broadcast_index (egglog_exp_array_api_NDArray_shape _x) (egglog_exp_array_api_broadcast_shapes (egglog_exp_array_api_NDArray_shape _x) (egglog_exp_array_api_NDArray_shape _y)) _idx)) (egglog_exp_array_api_NDArray_index _y (egglog_exp_array_api_broadcast_index (egglog_exp_array_api_NDArray_shape _y) (egglog_exp_array_api_broadcast_shapes (egglog_exp_array_api_NDArray_shape _x) (egglog_exp_array_api_NDArray_shape _y)) _idx))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___truediv__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___truediv__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_NDArray___truediv__ _x _y) _idx) (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_NDArray_index _x (egglog_exp_array_api_broadcast_index (egglog_exp_array_api_NDArray_shape _x) (egglog_exp_array_api_broadcast_shapes (egglog_exp_array_api_NDArray_shape _x) (egglog_exp_array_api_NDArray_shape _y)) _idx)) (egglog_exp_array_api_NDArray_index _y (egglog_exp_array_api_broadcast_index (egglog_exp_array_api_NDArray_shape _y) (egglog_exp_array_api_broadcast_shapes (egglog_exp_array_api_NDArray_shape _x) (egglog_exp_array_api_NDArray_shape _y)) _idx))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) _idx) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_astype (egglog.exp.array_api.NDArray egglog.exp.array_api.DType) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value_astype (egglog.exp.array_api.Value egglog.exp.array_api.DType) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_astype _x _dtype) _idx) (egglog_exp_array_api_Value_astype (egglog_exp_array_api_NDArray_index _x _idx) _dtype) :ruleset egglog.exp.array_api.array_api_ruleset)
(relation egglog_exp_array_api_greater_zero (egglog.exp.array_api.Value))
(constructor egglog_exp_array_api_unique_counts_counts (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rule ((= _v (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_unique_counts_counts _x) _idx)))
      ((egglog_exp_array_api_greater_zero _v))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((egglog_exp_array_api_greater_zero _v)
       (= _v1 (egglog_exp_array_api_Value_astype _v _dtype)))
      ((egglog_exp_array_api_greater_zero _v1))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= _v (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ _f)))
       (> _f 0.0))
      ((egglog_exp_array_api_greater_zero _v))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ _i)))
       (> _i 0))
      ((egglog_exp_array_api_greater_zero _v))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((egglog_exp_array_api_greater_zero _v)
       (egglog_exp_array_api_greater_zero _v1)
       (= _v2 (egglog_exp_array_api_Value___truediv__ _v _v1)))
      ((egglog_exp_array_api_greater_zero _v2))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((egglog_exp_array_api_greater_zero _v)
       (= _v1 (egglog_exp_array_api_Value___lt__ _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)))))
      ((union _v1 (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Boolean___init__ false))))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(sort egglog.builtins.Vec[egglog.exp.array_api.Value] (Vec egglog.exp.array_api.Value))
(constructor egglog_exp_array_api_TupleValue___init__ (egglog.builtins.Vec[egglog.exp.array_api.Value]) egglog.exp.array_api.TupleValue)
(rewrite (egglog_exp_array_api_possible_values (egglog_exp_array_api_Value_from_bool _b)) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_bool _b))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _v1 (egglog_exp_array_api_Value_astype _v _dtype))
       (egglog_exp_array_api_greater_zero _v))
      ((egglog_exp_array_api_greater_zero _v1))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_unique_values _x) (egglog_exp_array_api_IndexKey_int (egglog_exp_array_api_Int___init__ 0))) (egglog_exp_array_api_unique_values _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor ndarray-abs (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Float_abs (egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (ndarray-abs (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float _f)))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_abs _f)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_sum (egglog_exp_array_api_unique_counts_counts _x) (egglog_exp_array_api_OptionalIntOrTuple_none )) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_NDArray_size _x)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_sum (egglog_exp_array_api_astype (egglog_exp_array_api_unique_counts_counts _x) _dtype) (egglog_exp_array_api_OptionalIntOrTuple_none )) (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_NDArray_size _x)))) _dtype) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_astype _x _dtype)) _dtype :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ _i)))) $__expr_1) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ (to-f64 _i))))) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.OptionalInt)
(constructor egglog_exp_array_api_concat (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.OptionalInt) egglog.exp.array_api.NDArray)
(sort egglog.builtins.Vec[egglog.exp.array_api.NDArray] (Vec egglog.exp.array_api.NDArray))
(constructor egglog_exp_array_api_TupleNDArray___init__ (egglog.builtins.Vec[egglog.exp.array_api.NDArray]) egglog.exp.array_api.TupleNDArray)
(constructor egglog_exp_array_api_OptionalInt_none () egglog.exp.array_api.OptionalInt)
(rewrite (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ _vs) (egglog_exp_array_api_OptionalInt_none )) (vec-get _vs 0) :when ((= (vec-length _vs) 1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_unique_values (egglog_exp_array_api_unique_values _x)) (egglog_exp_array_api_unique_values _x) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_sum (egglog_exp_array_api_NDArray___truediv__ _x (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v))) (egglog_exp_array_api_OptionalIntOrTuple_none )) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum _x (egglog_exp_array_api_OptionalIntOrTuple_none )) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v))) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.OptionalDType)
(sort egglog.exp.array_api.OptionalBool)
(sort egglog.exp.array_api.OptionalDevice)
(constructor egglog_exp_array_api_asarray (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalDType egglog.exp.array_api.OptionalBool egglog.exp.array_api.OptionalDevice) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_OptionalDevice_none () egglog.exp.array_api.OptionalDevice)
(rewrite (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray _a _d _ob (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_NDArray_ndim _a) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_OptionalDType_none () egglog.exp.array_api.OptionalDType)
(constructor egglog_exp_array_api_OptionalBool_none () egglog.exp.array_api.OptionalBool)
(rewrite (egglog_exp_array_api_asarray _a (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )) _a :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_67 (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_67 _idx) _idx :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_68 () egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Int_NEVER () egglog.exp.array_api.Int)
(rewrite (_lambda_68 ) (egglog_exp_array_api_Int_NEVER ) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_check_index (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Int___ge__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_check_index _length _idx) (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Boolean___and__ (egglog_exp_array_api_Int___ge__ _idx (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Int___lt__ _idx _length)) (unstable-fn "_lambda_67" _idx) (unstable-fn "_lambda_68")) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_69 (egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray,egglog.exp.array_api.Int] i64) egglog.exp.array_api.NDArray)
(rewrite (_lambda_69 _idx_fn _i) (unstable-app _idx_fn (egglog_exp_array_api_Int___init__ _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _ti (egglog_exp_array_api_TupleNDArray___init__ _vs))
       (= _ti (egglog_exp_array_api_TupleNDArray___init__ _vs2))
       (!= _vs _vs2))
      ((vec-union _vs _vs2))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_TupleNDArray_length (egglog_exp_array_api_TupleNDArray_fn _i2 _idx_fn)) _i2 :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_TupleNDArray_fn _i2 _idx_fn) _i) (unstable-app _idx_fn (egglog_exp_array_api_check_index _i2 _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleNDArray_length (egglog_exp_array_api_TupleNDArray___init__ _vs)) (egglog_exp_array_api_Int___init__ (vec-length _vs)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_TupleNDArray___init__ _vs) (egglog_exp_array_api_Int___init__ _k)) (vec-get _vs _k) :when ((>= _k 0) (< _k (vec-length _vs))) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.NDArray,egglog.builtins.i64] (UnstableFn (i64 ) egglog.exp.array_api.NDArray))
(sort egglog.builtins.Vec[egglog.builtins.i64] (Vec i64))
(rewrite (egglog_exp_array_api_TupleNDArray_fn (egglog_exp_array_api_Int___init__ _k) _idx_fn) (egglog_exp_array_api_TupleNDArray___init__ (unstable-vec-map (unstable-fn "_lambda_69" _idx_fn) (vec-range _k))) :subsume :when ((>= _k 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_NDArray_fn _shape _dtype _idx_fn)) _shape :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_NDArray_fn _shape _dtype _idx_fn)) _dtype :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_NDArray_fn _shape _dtype _idx_fn) _idx) (unstable-app _idx_fn _idx) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_RecursiveValue_shape (egglog.exp.array_api.RecursiveValue) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_NDArray___init__ _rv)) (egglog_exp_array_api_RecursiveValue_shape _rv) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_RecursiveValue___getitem__ (egglog.exp.array_api.RecursiveValue egglog.builtins.Vec[egglog.exp.array_api.Int]) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_NDArray___init__ _rv) (egglog_exp_array_api_TupleInt___init__ _vi)) (egglog_exp_array_api_RecursiveValue___getitem__ _rv _vi) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___truediv__ _v _v1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___add__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___add__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray___add__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___add__ _v _v1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___mul__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___mul__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___mul__ _v _v1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___pow__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___pow__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray___pow__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___pow__ _v _v1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___sub__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___sub__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___sub__ _v _v1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray___lt__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___lt__ _v _v1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___le__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___le__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_NDArray___le__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Value___le__ _v _v1)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___eq__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Value___eq__ _v _v1)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___gt__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___gt__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_NDArray___gt__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Value___gt__ _v _v1)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_NDArray___ge__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Value___ge__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_NDArray___ge__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ _v1))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Value___ge__ _v _v1)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray_T _x)) _x :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_if_ (egglog_exp_array_api_Boolean___init__ true) _xt _x1t) (unstable-app _xt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_NDArray_if_ (egglog_exp_array_api_Boolean___init__ false) _xt _x1t) (unstable-app _x1t) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _x (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_TupleInt___init__ _vi) _dtype _idx_fn)))
      ((egglog_exp_array_api_TupleInt_product (egglog_exp_array_api_TupleInt___init__ _vi)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(constructor egglog_exp_array_api_RecursiveValue_from_index_and_shape (egglog.builtins.Vec[egglog.exp.array_api.Int] egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt]) egglog.exp.array_api.RecursiveValue)
(rule ((= _x (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_TupleInt___init__ _vi) _dtype _idx_fn))
       (= (egglog_exp_array_api_TupleInt_product (egglog_exp_array_api_TupleInt___init__ _vi)) (egglog_exp_array_api_Int___init__ _i))
       (<= _i 20))
      ((union _x (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue_from_index_and_shape _vi _idx_fn)))
       (subsume (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_TupleInt___init__ _vi) _dtype _idx_fn)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(constructor _lambda_70 (egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt] i64 egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(rewrite (_lambda_70 _idx_fn _i _rest_indices) (unstable-app _idx_fn (egglog_exp_array_api_TupleInt_append_start _rest_indices (egglog_exp_array_api_Int___init__ _i))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_71 (egglog.builtins.Vec[egglog.exp.array_api.Int] egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.TupleInt] i64) egglog.exp.array_api.RecursiveValue)
(rewrite (_lambda_71 _vi1 _idx_fn _i) (egglog_exp_array_api_RecursiveValue_from_index_and_shape _vi1 (unstable-fn "_lambda_70" _idx_fn _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_RecursiveValue_shape (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_TupleInt___init__ (vec-empty )) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.Vec[egglog.exp.array_api.RecursiveValue] (Vec egglog.exp.array_api.RecursiveValue))
(constructor egglog_exp_array_api_RecursiveValue_vec (egglog.builtins.Vec[egglog.exp.array_api.RecursiveValue]) egglog.exp.array_api.RecursiveValue)
(rewrite (egglog_exp_array_api_RecursiveValue_shape (egglog_exp_array_api_RecursiveValue_vec _vs)) (egglog_exp_array_api_TupleInt___add__ (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ (vec-length _vs)))) (egglog_exp_array_api_RecursiveValue_shape (vec-get _vs 0))) :when ((> (vec-length _vs) 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_RecursiveValue_shape (egglog_exp_array_api_RecursiveValue_vec _vs)) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 0))) :when ((= (vec-length _vs) 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_RecursiveValue___getitem__ (egglog_exp_array_api_RecursiveValue___init__ _v) _vi) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _rv (egglog_exp_array_api_RecursiveValue_vec _vs))
       (= _v (egglog_exp_array_api_RecursiveValue___getitem__ _rv _vi))
       (> (vec-length _vi) 0)
       (= (vec-get _vi 0) (egglog_exp_array_api_Int___init__ _k))
       (= _rv1 (vec-get _vs _k))
       (= _vi1 (vec-remove _vi 0)))
      ((union _v (egglog_exp_array_api_RecursiveValue___getitem__ _rv1 _vi1))
       (subsume (egglog_exp_array_api_RecursiveValue___getitem__ _rv _vi)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.RecursiveValue,egglog.builtins.i64] (UnstableFn (i64 ) egglog.exp.array_api.RecursiveValue))
(rule ((= _rv (egglog_exp_array_api_RecursiveValue_from_index_and_shape _vi _idx_fn))
       (> (vec-length _vi) 0)
       (= (vec-get _vi 0) (egglog_exp_array_api_Int___init__ _k))
       (= _vi1 (vec-remove _vi 0)))
      ((union _rv (egglog_exp_array_api_RecursiveValue_vec (unstable-vec-map (unstable-fn "_lambda_71" _vi1 _idx_fn) (vec-range _k))))
       (subsume (egglog_exp_array_api_RecursiveValue_from_index_and_shape _vi _idx_fn)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= _rv (egglog_exp_array_api_RecursiveValue_from_index_and_shape _vi _idx_fn))
       (= (vec-length _vi) 0))
      ((union _rv (egglog_exp_array_api_RecursiveValue___init__ (unstable-app _idx_fn (egglog_exp_array_api_TupleInt___init__ (vec-empty )))))
       (subsume (egglog_exp_array_api_RecursiveValue_from_index_and_shape _vi _idx_fn)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(constructor _lambda_72 (egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.exp.array_api.Int] i64) egglog.exp.array_api.Value)
(rewrite (_lambda_72 _idx_fn _i) (unstable-app _idx_fn (egglog_exp_array_api_Int___init__ _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _ti (egglog_exp_array_api_TupleValue___init__ _vs))
       (= _ti (egglog_exp_array_api_TupleValue___init__ _vs2))
       (!= _vs _vs2))
      ((vec-union _vs _vs2))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_TupleValue_length (egglog_exp_array_api_TupleValue_fn _i2 _idx_fn)) _i2 :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleValue___getitem__ (egglog_exp_array_api_TupleValue_fn _i2 _idx_fn) _i) (unstable-app _idx_fn (egglog_exp_array_api_check_index _i2 _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleValue_length (egglog_exp_array_api_TupleValue___init__ _vs)) (egglog_exp_array_api_Int___init__ (vec-length _vs)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleValue___getitem__ (egglog_exp_array_api_TupleValue___init__ _vs) (egglog_exp_array_api_Int___init__ _k)) (vec-get _vs _k) :when ((>= _k 0) (< _k (vec-length _vs))) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Value,egglog.builtins.i64] (UnstableFn (i64 ) egglog.exp.array_api.Value))
(rewrite (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_Int___init__ _k) _idx_fn) (egglog_exp_array_api_TupleValue___init__ (unstable-vec-map (unstable-fn "_lambda_72" _idx_fn) (vec-range _k))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.TupleValue] (UnstableFn () egglog.exp.array_api.TupleValue))
(constructor egglog_exp_array_api_TupleValue_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.TupleValue] egglog.builtins.UnstableFn[egglog.exp.array_api.TupleValue]) egglog.exp.array_api.TupleValue)
(rewrite (egglog_exp_array_api_TupleValue_if_ (egglog_exp_array_api_Boolean___init__ true) _lt _lf) (unstable-app _lt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleValue_if_ (egglog_exp_array_api_Boolean___init__ false) _lt _lf) (unstable-app _lf) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_DType_int64 () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_Value_dtype (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_DType_int64 ) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_dtype (egglog_exp_array_api_Value_from_float _f)) $__expr_1 :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_DType_bool () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_Value_dtype (egglog_exp_array_api_Value_from_bool _b)) (egglog_exp_array_api_DType_bool ) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_to_int (egglog.exp.array_api.Value) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Value_to_int (egglog_exp_array_api_Value_from_int _i)) _i :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_to_bool (egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value_to_bool (egglog_exp_array_api_Value_from_bool _b)) _b :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_to_truthy_value (egglog_exp_array_api_Value_from_bool _b)) (egglog_exp_array_api_Value_from_bool _b) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_conj (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_Value_conj (egglog_exp_array_api_Value_from_float _f)) (egglog_exp_array_api_Value_from_float _f) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_real (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_Value_real (egglog_exp_array_api_Value_from_float _f)) (egglog_exp_array_api_Value_from_float _f) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_real (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_Value_from_int _i) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_conj (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_Value_from_int _i) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_sqrt (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Float___pow__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value_sqrt (egglog_exp_array_api_Value_from_float _f)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___pow__ _f (egglog_exp_array_api_Float___init__ 0.5))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float_rational (BigRat) egglog.exp.array_api.Float :cost 2)
(rewrite (egglog_exp_array_api_Value___add__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat (bigint 0) (bigint 1)))) _v) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Boolean___init__ true) _vt _v1t) (unstable-app _vt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_if_ (egglog_exp_array_api_Boolean___init__ false) _vt _v1t) (unstable-app _v1t) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___eq__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Int___eq__ _i _i1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___eq__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___eq__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Float___eq__ _f _f1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Boolean___eq__ (egglog.exp.array_api.Boolean egglog.exp.array_api.Boolean) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___eq__ (egglog_exp_array_api_Value_from_bool _b) (egglog_exp_array_api_Value_from_bool _b1)) (egglog_exp_array_api_Boolean___eq__ _b _b1) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___ge__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Int___ge__ _i _i1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___ge__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___ge__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Float___ge__ _f _f1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___le__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___le__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Int___le__ _i _i1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___le__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___le__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Float___le__ _f _f1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___gt__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___gt__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Int___gt__ _i _i1) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___gt__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___gt__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Float___gt__ _f _f1) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___lt__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Int___lt__ _i _i1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___lt__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Value___lt__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_bool (egglog_exp_array_api_Float___lt__ _f _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___truediv__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___truediv__ _f _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___mul__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___mul__ _f _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___mul__ _i _i1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___add__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value___add__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___add__ _f _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___add__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___add__ _i _i1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___sub__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value___sub__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___sub__ _f _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___sub__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___sub__ _i _i1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___pow__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___pow__ _f _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___pow__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Value___pow__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_int _i1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___pow__ _i _i1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float_from_int (egglog.exp.array_api.Int) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value___pow__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_float _f1)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___pow__ (egglog_exp_array_api_Float_from_int _i) _f1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value___abs__ (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Int___abs__ (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Value___abs__ (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___abs__ _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___abs__ (egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Value___abs__ (egglog_exp_array_api_Value_from_float _f)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___abs__ _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___pow__ (egglog_exp_array_api_Value___abs__ _v) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat (bigint 2) (bigint 1))))) (egglog_exp_array_api_Value___pow__ _v (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___init__ 2)))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___pow__ (egglog_exp_array_api_Value___truediv__ _v1 _v) _v2) (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_Value___pow__ _v1 _v2) (egglog_exp_array_api_Value___pow__ _v _v2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___pow__ (egglog_exp_array_api_Value___pow__ _v _v1) _v2) (egglog_exp_array_api_Value___pow__ _v (egglog_exp_array_api_Value___mul__ _v1 _v2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_float _f) (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___mul__ _f (egglog_exp_array_api_Float_from_int _i))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___pow__ _v (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat (bigint 1) (bigint 1))))) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_from_int _i)) (egglog_exp_array_api_Value_from_int _i) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_int _i) (egglog_exp_array_api_Value_from_float _f)) (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_from_int _i)) (egglog_exp_array_api_Value_from_float _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___add__ _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0))) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___add__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) _v) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1))) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) _v) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0))) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) _v) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___sub__ _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0))) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value___pow__ _v (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1))) _v :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff _v _v) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value___add__ _v1 _v2) _v3) (egglog_exp_array_api_Value___add__ (egglog_exp_array_api_Value_diff _v1 _v3) (egglog_exp_array_api_Value_diff _v2 _v3)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value___sub__ _v1 _v2) _v3) (egglog_exp_array_api_Value___sub__ (egglog_exp_array_api_Value_diff _v1 _v3) (egglog_exp_array_api_Value_diff _v2 _v3)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value___mul__ _v1 _v2) _v3) (egglog_exp_array_api_Value___add__ (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_diff _v1 _v3) _v2) (egglog_exp_array_api_Value___mul__ _v1 (egglog_exp_array_api_Value_diff _v2 _v3))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value___truediv__ _v1 _v2) _v3) (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_Value___sub__ (egglog_exp_array_api_Value___mul__ (egglog_exp_array_api_Value_diff _v1 _v3) _v2) (egglog_exp_array_api_Value___mul__ _v1 (egglog_exp_array_api_Value_diff _v2 _v3))) (egglog_exp_array_api_Value___mul__ _v2 _v2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value___pow__ _v1 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ _i_))) _v3) (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value___mul__ _v1 (egglog_exp_array_api_Value___pow__ _v1 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ (- _i_ 1))))) _v3) :when ((> _i_ 1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Value_var (String) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value_var _s) (egglog_exp_array_api_Value_var _s1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) :when ((!= _s _s1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Value_diff (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ _i_)) (egglog_exp_array_api_Value_var _s)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.exp.array_api.IsDtypeKind)
(constructor egglog_exp_array_api_isdtype (egglog.exp.array_api.DType egglog.exp.array_api.IsDtypeKind) egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_DType_float32 () egglog.exp.array_api.DType)
(constructor egglog_exp_array_api_IsDtypeKind_string (String) egglog.exp.array_api.IsDtypeKind)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_IsDtypeKind_string "integral")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype $__expr_1 (egglog_exp_array_api_IsDtypeKind_string "integral")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_DType_object () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_IsDtypeKind_string "integral")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_IsDtypeKind_string "integral")) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_DType_int32 () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_IsDtypeKind_string "integral")) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_IsDtypeKind_string "real floating")) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype $__expr_1 (egglog_exp_array_api_IsDtypeKind_string "real floating")) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_IsDtypeKind_string "real floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_IsDtypeKind_string "real floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_IsDtypeKind_string "real floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_IsDtypeKind_string "complex floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype $__expr_1 (egglog_exp_array_api_IsDtypeKind_string "complex floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_IsDtypeKind_string "complex floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_IsDtypeKind_string "complex floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_isdtype (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_IsDtypeKind_string "complex floating")) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_IsDtypeKind_NULL () egglog.exp.array_api.IsDtypeKind)
(rewrite (egglog_exp_array_api_isdtype _d (egglog_exp_array_api_IsDtypeKind_NULL )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_IsDtypeKind_dtype (egglog.exp.array_api.DType) egglog.exp.array_api.IsDtypeKind)
(rewrite (egglog_exp_array_api_isdtype _d (egglog_exp_array_api_IsDtypeKind_dtype _d)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_IsDtypeKind___or__ (egglog.exp.array_api.IsDtypeKind egglog.exp.array_api.IsDtypeKind) egglog.exp.array_api.IsDtypeKind :cost 10)
(rewrite (egglog_exp_array_api_isdtype _d (egglog_exp_array_api_IsDtypeKind___or__ _k1 _k2)) (egglog_exp_array_api_Boolean___or__ (egglog_exp_array_api_isdtype _d _k1) (egglog_exp_array_api_isdtype _d _k2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_IsDtypeKind___or__ _k1 (egglog_exp_array_api_IsDtypeKind_NULL )) _k1 :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ $__expr_1 $__expr_1) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ $__expr_1 (egglog_exp_array_api_DType_float32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ $__expr_1 (egglog_exp_array_api_DType_int32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ $__expr_1 (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ $__expr_1 (egglog_exp_array_api_DType_object )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_float32 ) $__expr_1) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_DType_float32 )) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_DType_int32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_float32 ) (egglog_exp_array_api_DType_object )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int32 ) $__expr_1) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_DType_float32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_DType_int32 )) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int32 ) (egglog_exp_array_api_DType_object )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int64 ) $__expr_1) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_DType_float32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_DType_int32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_int64 ) (egglog_exp_array_api_DType_object )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_object ) $__expr_1) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_DType_float32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_DType_int32 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_DType_object ) (egglog_exp_array_api_DType_object )) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_73 (egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.exp.array_api.Int] i64) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_73 _idx_fn _i) (unstable-app _idx_fn (egglog_exp_array_api_Int___init__ _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.Vec[egglog.exp.array_api.TupleInt] (Vec egglog.exp.array_api.TupleInt))
(constructor egglog_exp_array_api_TupleTupleInt___init__ (egglog.builtins.Vec[egglog.exp.array_api.TupleInt]) egglog.exp.array_api.TupleTupleInt)
(rule ((= _ti (egglog_exp_array_api_TupleTupleInt___init__ _vs))
       (= _ti (egglog_exp_array_api_TupleTupleInt___init__ _vs2))
       (!= _vs _vs2))
      ((vec-union _vs _vs2))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_TupleTupleInt_length (egglog_exp_array_api_TupleTupleInt_fn _i2 _idx_fn)) _i2 :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt___getitem__ (egglog_exp_array_api_TupleTupleInt_fn _i2 _idx_fn) _i) (unstable-app _idx_fn (egglog_exp_array_api_check_index _i2 _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt_length (egglog_exp_array_api_TupleTupleInt___init__ _vs)) (egglog_exp_array_api_Int___init__ (vec-length _vs)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt___getitem__ (egglog_exp_array_api_TupleTupleInt___init__ _vs) (egglog_exp_array_api_Int___init__ _k)) (vec-get _vs _k) :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.TupleInt,egglog.builtins.i64] (UnstableFn (i64 ) egglog.exp.array_api.TupleInt))
(rewrite (egglog_exp_array_api_TupleTupleInt_fn (egglog_exp_array_api_Int___init__ _k) _idx_fn) (egglog_exp_array_api_TupleTupleInt___init__ (unstable-vec-map (unstable-fn "_lambda_73" _idx_fn) (vec-range _k))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.TupleTupleInt] (UnstableFn () egglog.exp.array_api.TupleTupleInt))
(constructor egglog_exp_array_api_TupleTupleInt_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.TupleTupleInt] egglog.builtins.UnstableFn[egglog.exp.array_api.TupleTupleInt]) egglog.exp.array_api.TupleTupleInt)
(rewrite (egglog_exp_array_api_TupleTupleInt_if_ (egglog_exp_array_api_Boolean___init__ true) _lt _lf) (unstable-app _lt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleTupleInt_if_ (egglog_exp_array_api_Boolean___init__ false) _lt _lf) (unstable-app _lf) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_74 (egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.exp.array_api.Int] i64) egglog.exp.array_api.Int)
(rewrite (_lambda_74 _idx_fn _i) (unstable-app _idx_fn (egglog_exp_array_api_Int___init__ _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _ti (egglog_exp_array_api_TupleInt___init__ _vs))
       (= _ti (egglog_exp_array_api_TupleInt___init__ _vs2))
       (!= _vs _vs2))
      ((vec-union _vs _vs2))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_TupleInt_fn _i2 _idx_fn)) _i2 :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_TupleInt_fn _i2 _idx_fn) _i) (unstable-app _idx_fn (egglog_exp_array_api_check_index _i2 _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_TupleInt___init__ _vs)) (egglog_exp_array_api_Int___init__ (vec-length _vs)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_TupleInt___init__ _vs) (egglog_exp_array_api_Int___init__ _k)) (vec-get _vs _k) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_if_ (egglog_exp_array_api_Boolean___init__ true) _lt _lf) (unstable-app _lt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_TupleInt_if_ (egglog_exp_array_api_Boolean___init__ false) _lt _lf) (unstable-app _lf) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Int,egglog.builtins.i64] (UnstableFn (i64 ) egglog.exp.array_api.Int))
(rewrite (egglog_exp_array_api_TupleInt_fn (egglog_exp_array_api_Int___init__ _k) _idx_fn) (egglog_exp_array_api_TupleInt___init__ (unstable-vec-map (unstable-fn "_lambda_74" _idx_fn) (vec-range _k))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Float___init__ (to-f64 _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float_abs (egglog_exp_array_api_Float___init__ _f)) (egglog_exp_array_api_Float___init__ _f) :when ((>= _f 0.0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float_abs (egglog_exp_array_api_Float___init__ _f)) (egglog_exp_array_api_Float___init__ (neg _f)) :when ((< _f 0.0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float_rational (bigrat (bigint (to-i64 _f)) (bigint 1))) :when ((= (to-f64 (to-i64 _f)) _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Float_rational (bigrat (bigint _i) (bigint 1))) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float___init__ (to-f64 _r)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___add__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Float___init__ (+ _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___sub__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Float___init__ (- _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___mul__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Float___init__ (* _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___truediv__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float_rational _r1)) (egglog_exp_array_api_Float_rational (/ _r _r1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___add__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float_rational _r1)) (egglog_exp_array_api_Float_rational (+ _r _r1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___sub__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float_rational _r1)) (egglog_exp_array_api_Float_rational (- _r _r1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___mul__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float_rational _r1)) (egglog_exp_array_api_Float_rational (* _r _r1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___pow__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Float___init__ (^ _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___eq__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___eq__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ false) :when ((!= _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___ne__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_Float___ne__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ true) :when ((!= _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___ne__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f)) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___ge__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ true) :when ((>= _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___ge__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ false) :when ((< _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___le__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ true) :when ((<= _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___le__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ false) :when ((> _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___gt__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ true) :when ((> _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___gt__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ false) :when ((<= _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___lt__ (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2)) (egglog_exp_array_api_Boolean___init__ true) :when ((< _f _f2)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___eq__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float_rational _r)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___eq__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_Float_rational _r1)) (egglog_exp_array_api_Boolean___init__ false) :when ((!= _r _r1)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Float___round__ (egglog.exp.array_api.Float egglog.exp.array_api.OptionalInt) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_Float___round__ (egglog_exp_array_api_Float_rational _r) (egglog_exp_array_api_OptionalInt_none )) (egglog_exp_array_api_Float_rational (round _r)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Float___abs__ (egglog_exp_array_api_Float___init__ _f)) (egglog_exp_array_api_Float___init__ (abs _f)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= (egglog_exp_array_api_Float___init__ _f) (egglog_exp_array_api_Float___init__ _f2))
       (!= _f _f2))
      ((panic "Different floats cannot be equal"))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _r (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (!= _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ false)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Int___ge__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _r (egglog_exp_array_api_Int___ge__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (> _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ true)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= _r (egglog_exp_array_api_Int___ge__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (< _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ false)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _r (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (< _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ true)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= _r (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (> _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ false)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Int___gt__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= _r (egglog_exp_array_api_Int___gt__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (> _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ true)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= _r (egglog_exp_array_api_Int___gt__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)))
       (< _i _j))
      ((union _r (egglog_exp_array_api_Boolean___init__ false)))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j))
       (!= _i _j))
      ((panic "Real ints cannot be equal to different ints"))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (+ _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (- _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int___mul__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (* _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int___floordiv__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (/ _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int___mod__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (% _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___and__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___and__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (& _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___or__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___or__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (| _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___xor__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___xor__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (^ _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___lshift__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___lshift__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (<< _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___rshift__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___rshift__ (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j)) (egglog_exp_array_api_Int___init__ (>> _i _j)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___invert__ (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___invert__ (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Int___init__ (not-i64 _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int___abs__ (egglog_exp_array_api_Int___init__ _i)) (egglog_exp_array_api_Int___init__ (abs _i)) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Boolean___init__ true) _ot _bt) (unstable-app _ot) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Boolean___init__ false) _ot _bt) (unstable-app _bt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_Int___round__ (egglog.exp.array_api.Int egglog.exp.array_api.OptionalInt) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_Int___round__ _o (egglog_exp_array_api_OptionalInt_none )) _o :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= (egglog_exp_array_api_Int_NEVER ) (egglog_exp_array_api_Int___init__ _i)))
      ((panic "Int.NEVER cannot be equal to any real int"))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rule ((= (egglog_exp_array_api_Int___init__ _i) (egglog_exp_array_api_Int___init__ _j))
       (!= _i _j))
      ((panic "Different ints cannot be equal"))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Boolean___or__ (egglog_exp_array_api_Boolean___init__ true) _x) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___or__ (egglog_exp_array_api_Boolean___init__ false) _x) _x :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___and__ (egglog_exp_array_api_Boolean___init__ true) _x) _x :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___and__ (egglog_exp_array_api_Boolean___init__ false) _x) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___invert__ (egglog_exp_array_api_Boolean___init__ true)) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___invert__ (egglog_exp_array_api_Boolean___init__ false)) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= (egglog_exp_array_api_Boolean___init__ false) (egglog_exp_array_api_Boolean___init__ true)))
      ((panic "False cannot equal True"))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(rewrite (egglog_exp_array_api_Boolean___eq__ _x _x) (egglog_exp_array_api_Boolean___init__ true) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___eq__ (egglog_exp_array_api_Boolean___init__ false) (egglog_exp_array_api_Boolean___init__ true)) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean___eq__ (egglog_exp_array_api_Boolean___init__ true) (egglog_exp_array_api_Boolean___init__ false)) (egglog_exp_array_api_Boolean___init__ false) :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean_if_ (egglog_exp_array_api_Boolean___init__ true) _bt _bf) (unstable-app _bt) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_Boolean_if_ (egglog_exp_array_api_Boolean___init__ false) _bt _bf) (unstable-app _bf) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rule ((= (egglog_exp_array_api_Boolean___init__ _b) (egglog_exp_array_api_Boolean___init__ _b1))
       (!= _b _b1))
      ((panic "Different booleans cannot be equal"))
        :ruleset egglog.exp.array_api.array_api_ruleset )
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_0 0)
(let $__expr_2 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_Int___init__ 0)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_2 0)
(let $__expr_3 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_Int___init__ 1)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_3 0)
(let $__expr_4 (egglog_exp_array_api_Int___ge__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_Int___init__ 3)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_4 0)
(let $__expr_6 (egglog_exp_array_api_OptionalDevice_none ))
(let $__expr_5 (egglog_exp_array_api_isdtype (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) $__expr_6)) (egglog_exp_array_api_IsDtypeKind___or__ (egglog_exp_array_api_IsDtypeKind_string "real floating") (egglog_exp_array_api_IsDtypeKind___or__ (egglog_exp_array_api_IsDtypeKind_string "complex floating") (egglog_exp_array_api_IsDtypeKind_NULL )))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_5 0)
(let $__expr_8 (egglog_exp_array_api_OptionalDType_none ))
(let $__expr_7 (egglog_exp_array_api_Value_to_bool (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_isfinite (egglog_exp_array_api_sum (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_OptionalIntOrTuple_none ))) (egglog_exp_array_api_TupleInt___init__ (vec-empty )))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_7 0)
(let $__expr_9 (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_9 0)
(let $__expr_10 (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Int___init__ 2)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_10 0)
(let $__expr_11 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_Int___init__ 2)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_11 0)
(let $__expr_13 (egglog_exp_array_api_Int___init__ 1))
(let $__expr_12 (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) $__expr_13) $__expr_13))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_12 0)
(let $__expr_14 (egglog_exp_array_api_Int___ge__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6)) (egglog_exp_array_api_Int___init__ 3)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_14 0)
(let $__expr_16 (egglog_exp_array_api_Int___init__ 2))
(let $__expr_15 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6)) $__expr_16))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_15 0)
(let $__expr_17 (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_17 0)
(let $__expr_19 (egglog_exp_array_api_OptionalBool_none ))
(constructor egglog_exp_array_api_reshape (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt egglog.exp.array_api.OptionalBool) egglog.exp.array_api.NDArray)
(let $__expr_18 (egglog_exp_array_api_isdtype (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6)) (egglog_exp_array_api_IsDtypeKind___or__ (egglog_exp_array_api_IsDtypeKind_string "real floating") (egglog_exp_array_api_IsDtypeKind___or__ (egglog_exp_array_api_IsDtypeKind_string "complex floating") (egglog_exp_array_api_IsDtypeKind_NULL )))))
(constructor _lambda_75 (egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (_lambda_75 _d) (egglog_exp_array_api_Boolean___invert__ (egglog_exp_array_api_Int___eq__ _d (egglog_exp_array_api_Int___init__ -1))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_76 (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (_lambda_76 _original_shape _shape) (egglog_exp_array_api_Int___floordiv__ (egglog_exp_array_api_TupleInt_product _original_shape) (egglog_exp_array_api_TupleInt_product (egglog_exp_array_api_TupleInt_filter _shape (unstable-fn "_lambda_75")))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_77 (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_77 _d) _d :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_78 (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_78 _original_shape _shape _d) (egglog_exp_array_api_Int_if_ (egglog_exp_array_api_Int___eq__ _d (egglog_exp_array_api_Int___init__ -1)) (unstable-fn "_lambda_76" _original_shape _shape) (unstable-fn "_lambda_77" _d)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_normalize_reshape_shape (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_normalize_reshape_shape _original_shape _shape) (egglog_exp_array_api_TupleInt_map _shape (unstable-fn "_lambda_78" _original_shape _shape)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_79 (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (_lambda_79 _x) _x :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_80 (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_80 _shape _index _res _i) (egglog_exp_array_api_Int___add__ (egglog_exp_array_api_Int___mul__ _res (egglog_exp_array_api_TupleInt___getitem__ _shape _i)) (egglog_exp_array_api_TupleInt___getitem__ _index _i)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_ravel_index (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_ravel_index _index _shape) (egglog_exp_array_api_TupleInt_foldl (egglog_exp_array_api_TupleInt_range (egglog_exp_array_api_TupleInt_length _shape)) (unstable-fn "_lambda_80" _shape _index) (egglog_exp_array_api_Int___init__ 0)) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_81 (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.TupleInt)
(rewrite (_lambda_81 _acc _dim) (egglog_exp_array_api_TupleInt_append (egglog_exp_array_api_TupleInt_append (egglog_exp_array_api_TupleInt_drop_last _acc) (egglog_exp_array_api_Int___mod__ (egglog_exp_array_api_TupleInt_last _acc) _dim)) (egglog_exp_array_api_Int___floordiv__ (egglog_exp_array_api_TupleInt_last _acc) _dim)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor egglog_exp_array_api_unravel_index (egglog.exp.array_api.Int egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt)
(rewrite (egglog_exp_array_api_unravel_index _flat_index _shape) (egglog_exp_array_api_TupleInt_reverse (egglog_exp_array_api_TupleInt_drop_last (egglog_exp_array_api_TupleInt_foldl_tuple_int (egglog_exp_array_api_TupleInt_reverse _shape) (unstable-fn "_lambda_81") (egglog_exp_array_api_TupleInt___init__ (vec-of _flat_index))))) :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_82 (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(rewrite (_lambda_82 _x _shape _idx) (egglog_exp_array_api_NDArray_index _x (egglog_exp_array_api_unravel_index (egglog_exp_array_api_ravel_index _idx (egglog_exp_array_api_normalize_reshape_shape (egglog_exp_array_api_NDArray_shape _x) _shape)) (egglog_exp_array_api_NDArray_shape _x))) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(constructor _lambda_83 (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.NDArray)
(rewrite (_lambda_83 _x _shape) (egglog_exp_array_api_NDArray_fn (egglog_exp_array_api_normalize_reshape_shape (egglog_exp_array_api_NDArray_shape _x) _shape) (egglog_exp_array_api_NDArray_dtype _x) (unstable-fn "_lambda_82" _x _shape)) :subsume :ruleset egglog.exp.array_api.array_api_ruleset)
(rewrite (egglog_exp_array_api_reshape _x _shape _copy) (egglog_exp_array_api_NDArray_if_ (egglog_exp_array_api_TupleInt___eq__ (egglog_exp_array_api_normalize_reshape_shape (egglog_exp_array_api_NDArray_shape _x) _shape) (egglog_exp_array_api_NDArray_shape _x)) (unstable-fn "_lambda_79" _x) (unstable-fn "_lambda_83" _x _shape)) :ruleset egglog.exp.array_api.array_api_ruleset)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_18 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_9 0)
(let $__expr_20 (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_20 0)
(let $__expr_21 (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) (egglog_exp_array_api_Int___init__ 0)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_21 0)
(let $__expr_23 (egglog_exp_array_api_Int___init__ 0))
(let $__expr_22 (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6)) $__expr_23))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_22 0)
(let $__expr_25 (egglog_exp_array_api_Int___init__ 150))
(let $__expr_24 (egglog_exp_array_api_Int___eq__ $__expr_21 $__expr_22))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_24 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_9 0)
(let $__expr_26 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6)) $__expr_16))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_26 0)
(let $__expr_27 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_NDArray_ndim (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6)) $__expr_13))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_27 0)
(let $__expr_28 (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_28 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_25 0)
(let $__expr_29 (egglog_exp_array_api_DType___eq__ (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6)) (egglog_exp_array_api_DType_object )))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_29 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_26 0)
(let $__expr_30 (egglog_exp_array_api_isdtype (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6)) (egglog_exp_array_api_IsDtypeKind_string "real floating")))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_30 0)
(let $__expr_31 (egglog_exp_array_api_Int___gt__ (egglog_exp_array_api_TupleInt___getitem__ $__expr_28 $__expr_23) (egglog_exp_array_api_Int___init__ 20)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_31 0)
(let $__expr_33 (egglog_exp_array_api_asarray (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6) $__expr_8 $__expr_19 $__expr_6))
(let $__expr_32 (egglog_exp_array_api_Int___gt__ (egglog_exp_array_api_TupleInt___getitem__ $__expr_28 $__expr_23) (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values $__expr_33)) $__expr_23)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_32 0)
(let $__expr_34 (egglog_exp_array_api_Float___gt__ (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values $__expr_33)) $__expr_23)) (egglog_exp_array_api_Float___round__ (egglog_exp_array_api_Float___mul__ (egglog_exp_array_api_Float___init__ 0.5) (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_TupleInt___getitem__ $__expr_28 $__expr_23))) (egglog_exp_array_api_OptionalInt_none ))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_34 0)
(let $__expr_35 (egglog_exp_array_api_Int___gt__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values $__expr_33)) $__expr_23) $__expr_16))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_35 0)
(let $__expr_36 (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_36 0)
(let $__expr_37 (egglog_exp_array_api_Int___eq__ $__expr_25 (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_37 0)
(constructor egglog_exp_array_api_unique_counts (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleNDArray :unextractable)
(let $__expr_38 (egglog_exp_array_api_unique_counts (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6)))
(constructor egglog_exp_array_api_unique_counts_elements (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_unique_counts _x) (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_counts_elements _x) (egglog_exp_array_api_unique_counts_counts _x))) :ruleset egglog.exp.array_api.array_api_ruleset)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_38 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_22 0)
(let $__expr_40 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)))
(let $__expr_39 (egglog_exp_array_api_Value_to_bool (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_any (egglog_exp_array_api_NDArray___lt__ (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_astype (egglog_exp_array_api_unique_counts_counts (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))))) (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 150.0))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ $__expr_40)))) (egglog_exp_array_api_TupleInt___init__ (vec-empty )))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_39 0)
(let $__expr_41 (egglog_exp_array_api_Value_to_bool (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_NDArray___gt__ (ndarray-abs (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_sum (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_astype (egglog_exp_array_api_unique_counts_counts (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))))) (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 150.0))))) (egglog_exp_array_api_OptionalIntOrTuple_none )) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 1.0)))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 0.00001))))) (egglog_exp_array_api_TupleInt___init__ (vec-empty )))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_41 0)
(let $__expr_42 (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) $__expr_13) (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23) $__expr_13)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_42 0)
(let $__expr_43 (egglog_exp_array_api_Int___lt__ (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23) $__expr_13) $__expr_16))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_43 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_36 0)
(constructor egglog_exp_array_api_unique_inverse (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleNDArray :unextractable)
(let $__expr_44 (egglog_exp_array_api_unique_inverse (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6)))
(constructor egglog_exp_array_api_unique_inverse_inverse_indices (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_unique_inverse _x) (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values _x) (egglog_exp_array_api_unique_inverse_inverse_indices _x))) :ruleset egglog.exp.array_api.array_api_ruleset)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_44 0)
(let $__expr_45 (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue_vec (vec-of (egglog_exp_array_api_RecursiveValue___init__ $__expr_40) (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1))) (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))))) $__expr_23))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_45 0)
(let $__expr_46 (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none ))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_46 0)
(let $__expr_47 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23) $__expr_13))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_47 0)
(let $__expr_48 (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_48 0)
(let $__expr_49 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_Int___mul__ $__expr_13 (egglog_exp_array_api_Int___init__ 3)) $__expr_16))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_49 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_2 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_3 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_4 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_5 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_7 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_9 0)
(let $__expr_50 (egglog_exp_array_api_Int___lt__ $__expr_21 $__expr_13))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_50 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_11 0)
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_12 0)
(let $__expr_51 (egglog_exp_array_api_TupleInt_length (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))))))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_51 0)
(let $__expr_53 (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))))
(let $__expr_52 (egglog_exp_array_api_Int___eq__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4)))))) $__expr_13) (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) $__expr_13)))
(run-schedule (saturate (seq (run egglog.exp.array_api.array_api_ruleset) (run))))
(extract $__expr_52 0)
(let $__expr_55 (egglog_exp_array_api_asarray (egglog_exp_array_api_reshape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) $__expr_8 (egglog_exp_array_api_OptionalBool_none ) $__expr_6) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ -1))) $__expr_19) $__expr_8 $__expr_19 $__expr_6))
(let $__expr_56 (egglog_exp_array_api_OptionalInt_none ))
(let $__expr_57 (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23))
(let $__expr_58 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))))
(let $__expr_59 (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))))
(let $__expr_60 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)))))
(let $__expr_61 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ $__expr_40)))
(let $__expr_62 (egglog_exp_array_api_Float___init__ 1.0))
(let $__expr_63 (egglog_exp_array_api_RecursiveValue___init__ $__expr_40))
(let $__expr_64 (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))
(let $__expr_65 (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))
(let $__expr_66 (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1))))
(sort egglog.exp.array_api.MultiAxisIndexKey)
(constructor egglog_exp_array_api_IndexKey_multi_axis (egglog.exp.array_api.MultiAxisIndexKey) egglog.exp.array_api.IndexKey)
(sort egglog.exp.array_api.MultiAxisIndexKeyItem)
(sort egglog.builtins.Vec[egglog.exp.array_api.MultiAxisIndexKeyItem] (Vec egglog.exp.array_api.MultiAxisIndexKeyItem))
(constructor egglog_exp_array_api_MultiAxisIndexKey_from_vec (egglog.builtins.Vec[egglog.exp.array_api.MultiAxisIndexKeyItem]) egglog.exp.array_api.MultiAxisIndexKey)
(constructor egglog_exp_array_api_MultiAxisIndexKeyItem_int (egglog.exp.array_api.Int) egglog.exp.array_api.MultiAxisIndexKeyItem)
(sort egglog.exp.array_api.Slice)
(constructor egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog.exp.array_api.Slice) egglog.exp.array_api.MultiAxisIndexKeyItem)
(constructor egglog_exp_array_api_Slice___init__ (egglog.exp.array_api.OptionalInt egglog.exp.array_api.OptionalInt egglog.exp.array_api.OptionalInt) egglog.exp.array_api.Slice)
(let $__expr_67 (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_23) (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_56 $__expr_56 $__expr_56))))))
(let $__expr_69 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)))
(let $__expr_70 (egglog_exp_array_api_unique_inverse_inverse_indices $__expr_59))
(let $__expr_71 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_56 $__expr_56 $__expr_56)))
(let $__expr_72 (egglog_exp_array_api_Boolean___init__ false))
(constructor egglog_exp_array_api_NDArray___setitem__ (egglog.exp.array_api.NDArray egglog.exp.array_api.IndexKey egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_zeros (egglog.exp.array_api.TupleInt egglog.exp.array_api.OptionalDType egglog.exp.array_api.OptionalDevice) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_OptionalDType_some (egglog.exp.array_api.DType) egglog.exp.array_api.OptionalDType)
(sort egglog.exp.array_api.Device)
(constructor egglog_exp_array_api_OptionalDevice_some (egglog.exp.array_api.Device) egglog.exp.array_api.OptionalDevice)
(constructor egglog_exp_array_api_NDArray_device (egglog.exp.array_api.NDArray) egglog.exp.array_api.Device)
(constructor egglog_exp_array_api_mean (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalIntOrTuple egglog.exp.array_api.Boolean) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_IndexKey_ndarray (egglog.exp.array_api.NDArray) egglog.exp.array_api.IndexKey)
(constructor egglog_exp_array_api_OptionalIntOrTuple_int (egglog.exp.array_api.Int) egglog.exp.array_api.OptionalIntOrTuple)
(let $__expr_68 (egglog_exp_array_api_NDArray___setitem__ (egglog_exp_array_api_NDArray___setitem__ (egglog_exp_array_api_NDArray___setitem__ (egglog_exp_array_api_zeros (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_45 (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))) $__expr_13))) (egglog_exp_array_api_OptionalDType_some (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))) (egglog_exp_array_api_OptionalDevice_some (egglog_exp_array_api_NDArray_device $__expr_64))) $__expr_67 (egglog_exp_array_api_mean (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_70 $__expr_61))) (egglog_exp_array_api_OptionalIntOrTuple_int $__expr_23) $__expr_72)) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_13) $__expr_71))) (egglog_exp_array_api_mean (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_70 $__expr_60))) (egglog_exp_array_api_OptionalIntOrTuple_int $__expr_23) $__expr_72)) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_16) $__expr_71))) (egglog_exp_array_api_mean (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_70 $__expr_58))) (egglog_exp_array_api_OptionalIntOrTuple_int $__expr_23) $__expr_72)))
(let $__expr_73 (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_16) $__expr_71))))
(let $__expr_74 (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_13) $__expr_71))))
(let $__expr_76 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))
(let $__expr_77 (egglog_exp_array_api_OptionalDevice_some (egglog_exp_array_api_NDArray_device $__expr_64)))
(let $__expr_78 (egglog_exp_array_api_OptionalIntOrTuple_int $__expr_23))
(let $__expr_79 (egglog_exp_array_api_OptionalDType_some (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))))
(constructor egglog_exp_array_api_std (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalIntOrTuple) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_OptionalInt_some (egglog.exp.array_api.Int) egglog.exp.array_api.OptionalInt)
(let $__expr_80 (egglog_exp_array_api_std (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_61))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_67)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_60))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_74)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_58))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_73)))) (egglog_exp_array_api_OptionalInt_some $__expr_23)) $__expr_78))
(constructor egglog_exp_array_api_svd_ (egglog.exp.array_api.NDArray egglog.exp.array_api.Boolean) egglog.exp.array_api.TupleNDArray)
(constructor ndarray-sqrt (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(let $__expr_75 (egglog_exp_array_api_Slice___init__ $__expr_56 (egglog_exp_array_api_OptionalInt_some (egglog_exp_array_api_Value_to_int (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___gt__ (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_asarray (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___truediv__ $__expr_62 (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___sub__ $__expr_25 $__expr_57)))))) $__expr_79 $__expr_19 $__expr_77)) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_61))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_67)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_60))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_74)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_58))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_73)))) (egglog_exp_array_api_OptionalInt_some $__expr_23)) (egglog_exp_array_api_NDArray___setitem__ $__expr_80 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_80 $__expr_61)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 1.0))))))) $__expr_72) $__expr_13) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 0.0001))))) (egglog_exp_array_api_DType_int32 )) (egglog_exp_array_api_OptionalIntOrTuple_none )) (egglog_exp_array_api_TupleInt___init__ (vec-empty ))))) $__expr_56))
(let $__expr_82 (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none ))))
(constructor egglog_exp_array_api_NDArray___matmul__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(let $__expr_81 (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_astype (egglog_exp_array_api_unique_counts_counts (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))))) (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 150.0))))) $__expr_68))
(let $__expr_84 (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_asarray (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___truediv__ $__expr_62 (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___sub__ $__expr_25 $__expr_57)))))) $__expr_79 $__expr_19 $__expr_77)) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_61))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_67)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_60))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_74)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_58))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_73)))) (egglog_exp_array_api_OptionalInt_some $__expr_23)) (egglog_exp_array_api_NDArray___setitem__ $__expr_80 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_80 $__expr_61)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 1.0))))))) $__expr_72) $__expr_13))
(let $__expr_85 (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_61))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_67)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_60))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_74)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_58))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_73)))) (egglog_exp_array_api_OptionalInt_some $__expr_23)))
(let $__expr_86 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_astype (egglog_exp_array_api_unique_counts_counts (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150)))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)) (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))))) (egglog_exp_array_api_NDArray_dtype (egglog_exp_array_api_asarray (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") $__expr_1) (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 150) (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_OptionalDType_none ) (egglog_exp_array_api_OptionalBool_none ) (egglog_exp_array_api_OptionalDevice_none )))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 150.0))))))
(let $__expr_87 (egglog_exp_array_api_NDArray___setitem__ $__expr_80 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_80 $__expr_61)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 1.0))))))
(let $__expr_88 (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_asarray (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___truediv__ $__expr_62 (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___sub__ $__expr_25 $__expr_57)))))) $__expr_79 $__expr_19 $__expr_77)) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_61))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_67)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_60))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_74)) (egglog_exp_array_api_NDArray___sub__ (egglog_exp_array_api_NDArray___getitem__ $__expr_64 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_55 $__expr_58))) (egglog_exp_array_api_NDArray___getitem__ $__expr_68 $__expr_73)))) (egglog_exp_array_api_OptionalInt_some $__expr_23)) (egglog_exp_array_api_NDArray___setitem__ $__expr_80 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_80 $__expr_61)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 1.0))))))) $__expr_72))
(constructor egglog_exp_array_api_IndexKey_slice (egglog.exp.array_api.Slice) egglog.exp.array_api.IndexKey)
(let $__expr_83 (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int $__expr_25))) $__expr_86) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___truediv__ $__expr_62 (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23) $__expr_13)))))))) (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___sub__ $__expr_68 $__expr_81)))) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_88 $__expr_16) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_slice $__expr_75) $__expr_71)))) $__expr_87)) (egglog_exp_array_api_NDArray___getitem__ $__expr_84 (egglog_exp_array_api_IndexKey_slice $__expr_75)))) $__expr_72) $__expr_13))
(let $__expr_89 (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int $__expr_25))) $__expr_86) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___truediv__ $__expr_62 (egglog_exp_array_api_Float_from_int (egglog_exp_array_api_Int___sub__ (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape (egglog_exp_array_api_unique_values (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_unique_values $__expr_33))) (egglog_exp_array_api_OptionalInt_none )))) $__expr_23) $__expr_13)))))))) (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___sub__ $__expr_68 $__expr_81)))) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_88 $__expr_16) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_slice $__expr_75) $__expr_71)))) $__expr_87)) (egglog_exp_array_api_NDArray___getitem__ $__expr_84 (egglog_exp_array_api_IndexKey_slice $__expr_75)))) $__expr_72))
(let $__expr_90 (egglog_exp_array_api_OptionalIntOrTuple_none ))
(let $__expr_91 (egglog_exp_array_api_TupleInt___init__ (vec-empty )))
(let $__expr_92 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_88 $__expr_16) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_slice $__expr_75) $__expr_71)))) $__expr_87)) (egglog_exp_array_api_NDArray___getitem__ $__expr_84 (egglog_exp_array_api_IndexKey_slice $__expr_75))))
(let $__expr_54 (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray___sub__ $__expr_64 $__expr_81) (egglog_exp_array_api_NDArray___matmul__ $__expr_92 (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_89 $__expr_16)) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of $__expr_71 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_56 (egglog_exp_array_api_OptionalInt_some (egglog_exp_array_api_Value_to_int (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___gt__ $__expr_83 (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 0.0001)))) (egglog_exp_array_api_NDArray___getitem__ $__expr_83 (egglog_exp_array_api_IndexKey_int (egglog_exp_array_api_Int___init__ 0))))) (egglog_exp_array_api_DType_int32 )) $__expr_90) $__expr_91))) $__expr_56)))))))) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of $__expr_71 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_56 (egglog_exp_array_api_OptionalInt_some $__expr_16) $__expr_56)))))))
(ruleset ruleset_4764606512)
(rewrite (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_unique_inverse_inverse_indices _x) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int _i)))) (egglog_exp_array_api_NDArray___eq__ _x (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_unique_values _x) (egglog_exp_array_api_TupleInt___init__ (vec-of _i)))))) :subsume :ruleset ruleset_4764606512)
(constructor _lambda_84 (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleValue egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(rewrite (_lambda_84 _x _values _i) (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum (egglog_exp_array_api_NDArray___eq__ _x (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_TupleValue___getitem__ _values _i)))) $__expr_90) $__expr_91) :subsume :ruleset ruleset_4764606512)
(constructor egglog_exp_array_api_numba_count_values (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleValue) egglog.exp.array_api.TupleValue)
(rewrite (egglog_exp_array_api_numba_count_values _x _values) (egglog_exp_array_api_TupleValue_fn (egglog_exp_array_api_TupleValue_length _values) (unstable-fn "_lambda_84" _x _values)) :subsume :ruleset ruleset_4764606512)
(rewrite (egglog_exp_array_api_unique_counts_counts _x) (egglog_exp_array_api_NDArray_from_tuple_value (egglog_exp_array_api_numba_count_values _x (egglog_exp_array_api_NDArray_to_tuple_values (egglog_exp_array_api_unique_values _x)))) :subsume :ruleset ruleset_4764606512)
(constructor egglog_exp_array_api_square (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_std _x (egglog_exp_array_api_OptionalIntOrTuple_int _axis)) (ndarray-sqrt (egglog_exp_array_api_mean (egglog_exp_array_api_square (egglog_exp_array_api_NDArray___sub__ _x (egglog_exp_array_api_mean _x (egglog_exp_array_api_OptionalIntOrTuple_int _axis) (egglog_exp_array_api_Boolean___init__ true)))) (egglog_exp_array_api_OptionalIntOrTuple_int _axis) $__expr_72)) :subsume :ruleset ruleset_4764606512)
(rewrite (egglog_exp_array_api_mean _x (egglog_exp_array_api_OptionalIntOrTuple_int _axis) $__expr_72) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum _x (egglog_exp_array_api_OptionalIntOrTuple_int _axis)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape _x) _axis))))) :subsume :ruleset ruleset_4764606512)
(constructor egglog_exp_array_api_expand_dims (egglog.exp.array_api.NDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_mean _x (egglog_exp_array_api_OptionalIntOrTuple_int _axis) (egglog_exp_array_api_Boolean___init__ true)) (egglog_exp_array_api_expand_dims (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum _x (egglog_exp_array_api_OptionalIntOrTuple_int _axis)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape _x) _axis))))) _axis) :subsume :ruleset ruleset_4764606512)
(unstable-combined-ruleset combined_ruleset_4764339232 egglog.exp.array_api.array_api_ruleset ruleset_4764606512)
(run-schedule (saturate (run combined_ruleset_4764339232)))
(pop 1)
(sort egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_Int___init__ (i64) egglog.exp.array_api.Int)
(let $__expr_3 (egglog_exp_array_api_Int___init__ 150))
(sort egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Value_from_int (egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(let $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 1)))
(sort egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.IndexKey)
(constructor egglog_exp_array_api_NDArray___getitem__ (egglog.exp.array_api.NDArray egglog.exp.array_api.IndexKey) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_assume_isfinite (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_assume_shape (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.DType)
(constructor egglog_exp_array_api_assume_dtype (egglog.exp.array_api.NDArray egglog.exp.array_api.DType) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_NDArray_var (String) egglog.exp.array_api.NDArray :cost 200)
(constructor egglog_exp_array_api_DType_float64 () egglog.exp.array_api.DType)
(sort egglog.builtins.Vec[egglog.exp.array_api.Int] (Vec egglog.exp.array_api.Int))
(constructor egglog_exp_array_api_TupleInt___init__ (egglog.builtins.Vec[egglog.exp.array_api.Int]) egglog.exp.array_api.TupleInt)
(constructor egglog_exp_array_api_IndexKey_ndarray (egglog.exp.array_api.NDArray) egglog.exp.array_api.IndexKey)
(constructor egglog_exp_array_api_NDArray___eq__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.TupleValue)
(constructor egglog_exp_array_api_assume_value_one_of (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleValue) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_DType_int64 () egglog.exp.array_api.DType)
(sort egglog.builtins.Vec[egglog.exp.array_api.Value] (Vec egglog.exp.array_api.Value))
(constructor egglog_exp_array_api_TupleValue___init__ (egglog.builtins.Vec[egglog.exp.array_api.Value]) egglog.exp.array_api.TupleValue)
(sort egglog.exp.array_api.RecursiveValue)
(constructor egglog_exp_array_api_NDArray___init__ (egglog.exp.array_api.RecursiveValue) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_RecursiveValue___init__ (egglog.exp.array_api.Value) egglog.exp.array_api.RecursiveValue)
(let $__expr_2 (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") (egglog_exp_array_api_DType_float64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3 (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ $__expr_4))))))
(let $__expr_5 (egglog_exp_array_api_Int___init__ 4))
(let $__expr_6 (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") (egglog_exp_array_api_DType_float64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3 (egglog_exp_array_api_Int___init__ 4))))) (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0))))))))
(let $__expr_7 (egglog_exp_array_api_assume_isfinite (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "X") (egglog_exp_array_api_DType_float64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3 (egglog_exp_array_api_Int___init__ 4))))))
(let $__expr_8 (egglog_exp_array_api_Int___init__ 0))
(let $__expr_9 (egglog_exp_array_api_Int___init__ 1))
(let $__expr_11 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2)))
(let $__expr_10 (egglog_exp_array_api_NDArray___getitem__ $__expr_7 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ $__expr_11))))))
(let $__expr_12 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)))
(sort egglog.exp.array_api.MultiAxisIndexKeyItem)
(sort egglog.exp.array_api.Slice)
(constructor egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog.exp.array_api.Slice) egglog.exp.array_api.MultiAxisIndexKeyItem)
(sort egglog.exp.array_api.OptionalInt)
(constructor egglog_exp_array_api_Slice___init__ (egglog.exp.array_api.OptionalInt egglog.exp.array_api.OptionalInt egglog.exp.array_api.OptionalInt) egglog.exp.array_api.Slice)
(constructor egglog_exp_array_api_OptionalInt_none () egglog.exp.array_api.OptionalInt)
(let $__expr_13 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ (egglog_exp_array_api_OptionalInt_none ) (egglog_exp_array_api_OptionalInt_none ) (egglog_exp_array_api_OptionalInt_none ))))
(sort egglog.exp.array_api.MultiAxisIndexKey)
(constructor egglog_exp_array_api_IndexKey_multi_axis (egglog.exp.array_api.MultiAxisIndexKey) egglog.exp.array_api.IndexKey)
(sort egglog.builtins.Vec[egglog.exp.array_api.MultiAxisIndexKeyItem] (Vec egglog.exp.array_api.MultiAxisIndexKeyItem))
(constructor egglog_exp_array_api_MultiAxisIndexKey_from_vec (egglog.builtins.Vec[egglog.exp.array_api.MultiAxisIndexKeyItem]) egglog.exp.array_api.MultiAxisIndexKey)
(constructor egglog_exp_array_api_MultiAxisIndexKeyItem_int (egglog.exp.array_api.Int) egglog.exp.array_api.MultiAxisIndexKeyItem)
(let $__expr_14 (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_8) $__expr_13))))
(sort egglog.exp.array_api.OptionalIntOrTuple)
(constructor egglog_exp_array_api_OptionalIntOrTuple_int (egglog.exp.array_api.Int) egglog.exp.array_api.OptionalIntOrTuple)
(let $__expr_15 (egglog_exp_array_api_OptionalIntOrTuple_int $__expr_8))
(let $__expr_16 (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int $__expr_9) $__expr_13))))
(let $__expr_17 (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_int (egglog_exp_array_api_Int___init__ 2)) $__expr_13))))
(let $__expr_19 (egglog_exp_array_api_Int___init__ 2))
(let $__expr_20 (egglog_exp_array_api_DType_float64 ))
(let $__expr_21 (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))))
(constructor egglog_exp_array_api_NDArray___setitem__ (egglog.exp.array_api.NDArray egglog.exp.array_api.IndexKey egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.OptionalDType)
(sort egglog.exp.array_api.OptionalDevice)
(constructor egglog_exp_array_api_zeros (egglog.exp.array_api.TupleInt egglog.exp.array_api.OptionalDType egglog.exp.array_api.OptionalDevice) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_OptionalDType_some (egglog.exp.array_api.DType) egglog.exp.array_api.OptionalDType)
(sort egglog.exp.array_api.Device)
(constructor egglog_exp_array_api_OptionalDevice_some (egglog.exp.array_api.Device) egglog.exp.array_api.OptionalDevice)
(constructor egglog_exp_array_api_NDArray_device (egglog.exp.array_api.NDArray) egglog.exp.array_api.Device)
(constructor egglog_exp_array_api_NDArray___truediv__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_sum (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalIntOrTuple) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_TupleInt___getitem__ (egglog.exp.array_api.TupleInt egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_NDArray_shape (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleInt)
(let $__expr_18 (egglog_exp_array_api_NDArray___setitem__ (egglog_exp_array_api_NDArray___setitem__ (egglog_exp_array_api_NDArray___setitem__ (egglog_exp_array_api_zeros (egglog_exp_array_api_TupleInt___init__ (vec-of (egglog_exp_array_api_Int___init__ 3) $__expr_5)) (egglog_exp_array_api_OptionalDType_some $__expr_20) (egglog_exp_array_api_OptionalDevice_some (egglog_exp_array_api_NDArray_device $__expr_7))) $__expr_14 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum $__expr_6 $__expr_15) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape $__expr_6) $__expr_8)))))) $__expr_16 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum $__expr_2 $__expr_15) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape $__expr_2) $__expr_8)))))) $__expr_17 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum $__expr_10 $__expr_15) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape $__expr_10) $__expr_8)))))))
(sort egglog.exp.array_api.TupleNDArray)
(constructor egglog_exp_array_api_concat (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.OptionalInt) egglog.exp.array_api.NDArray)
(sort egglog.builtins.Vec[egglog.exp.array_api.NDArray] (Vec egglog.exp.array_api.NDArray))
(constructor egglog_exp_array_api_TupleNDArray___init__ (egglog.builtins.Vec[egglog.exp.array_api.NDArray]) egglog.exp.array_api.TupleNDArray)
(constructor egglog_exp_array_api_NDArray___sub__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_OptionalInt_some (egglog.exp.array_api.Int) egglog.exp.array_api.OptionalInt)
(let $__expr_1 (egglog_exp_array_api_concat (egglog_exp_array_api_TupleNDArray___init__ (vec-of (egglog_exp_array_api_NDArray___sub__ $__expr_6 (egglog_exp_array_api_NDArray___getitem__ $__expr_18 $__expr_14)) (egglog_exp_array_api_NDArray___sub__ $__expr_2 (egglog_exp_array_api_NDArray___getitem__ $__expr_18 $__expr_16)) (egglog_exp_array_api_NDArray___sub__ $__expr_10 (egglog_exp_array_api_NDArray___getitem__ $__expr_18 $__expr_17)))) (egglog_exp_array_api_OptionalInt_some $__expr_8)))
(constructor egglog_exp_array_api_OptionalIntOrTuple_none () egglog.exp.array_api.OptionalIntOrTuple)
(let $__expr_23 (egglog_exp_array_api_OptionalIntOrTuple_none ))
(let $__expr_24 (from-string "1"))
(let $__expr_25 (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0))))))
(let $__expr_26 (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ $__expr_11))))
(let $__expr_27 (egglog_exp_array_api_NDArray___eq__ (egglog_exp_array_api_assume_value_one_of (egglog_exp_array_api_assume_shape (egglog_exp_array_api_assume_dtype (egglog_exp_array_api_NDArray_var "y") (egglog_exp_array_api_DType_int64 )) (egglog_exp_array_api_TupleInt___init__ (vec-of $__expr_3))) (egglog_exp_array_api_TupleValue___init__ (vec-of (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)) $__expr_4 (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 2))))) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ $__expr_4))))
(constructor egglog_exp_array_api_square (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_expand_dims (egglog.exp.array_api.NDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(let $__expr_28 (egglog_exp_array_api_square (egglog_exp_array_api_NDArray___sub__ $__expr_1 (egglog_exp_array_api_expand_dims (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum $__expr_1 $__expr_15) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape $__expr_1) $__expr_8))))) $__expr_8))))
(let $__expr_29 (egglog_exp_array_api_TupleInt___init__ (vec-empty )))
(let $__expr_31 (egglog_exp_array_api_OptionalDType_some $__expr_20))
(let $__expr_32 (egglog_exp_array_api_OptionalDevice_some (egglog_exp_array_api_NDArray_device $__expr_7)))
(let $__expr_33 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_Int___init__ 0)))))
(constructor ndarray-sqrt (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(let $__expr_34 (ndarray-sqrt (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_sum $__expr_28 $__expr_15) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int (egglog_exp_array_api_TupleInt___getitem__ (egglog_exp_array_api_NDArray_shape $__expr_28) $__expr_8)))))))
(constructor egglog_exp_array_api_TupleNDArray___getitem__ (egglog.exp.array_api.TupleNDArray egglog.exp.array_api.Int) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.Boolean)
(constructor egglog_exp_array_api_svd_ (egglog.exp.array_api.NDArray egglog.exp.array_api.Boolean) egglog.exp.array_api.TupleNDArray)
(constructor egglog_exp_array_api_NDArray___mul__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.OptionalBool)
(constructor egglog_exp_array_api_asarray (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalDType egglog.exp.array_api.OptionalBool egglog.exp.array_api.OptionalDevice) egglog.exp.array_api.NDArray)
(sort egglog.exp.array_api.Float)
(constructor egglog_exp_array_api_Value_from_float (egglog.exp.array_api.Float) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Float_rational (BigRat) egglog.exp.array_api.Float :cost 2)
(constructor egglog_exp_array_api_OptionalBool_none () egglog.exp.array_api.OptionalBool)
(constructor egglog_exp_array_api_Value___truediv__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_Boolean___init__ (bool) egglog.exp.array_api.Boolean)
(let $__expr_30 (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_asarray (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat $__expr_24 (from-string "147")))))) $__expr_31 (egglog_exp_array_api_OptionalBool_none ) $__expr_32)) (egglog_exp_array_api_NDArray___truediv__ $__expr_1 (egglog_exp_array_api_NDArray___setitem__ $__expr_34 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_34 $__expr_33)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_Value_from_int $__expr_3) (egglog_exp_array_api_Value_from_int $__expr_3))))))) (egglog_exp_array_api_Boolean___init__ false)) $__expr_9))
(let $__expr_36 (egglog_exp_array_api_OptionalInt_none ))
(constructor egglog_exp_array_api_Value_to_int (egglog.exp.array_api.Value) egglog.exp.array_api.Int)
(constructor egglog_exp_array_api_NDArray_index (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_astype (egglog.exp.array_api.NDArray egglog.exp.array_api.DType) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_NDArray___gt__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_Float___init__ (f64) egglog.exp.array_api.Float :cost 3)
(constructor egglog_exp_array_api_DType_int32 () egglog.exp.array_api.DType)
(let $__expr_35 (egglog_exp_array_api_Slice___init__ $__expr_36 (egglog_exp_array_api_OptionalInt_some (egglog_exp_array_api_Value_to_int (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___gt__ $__expr_30 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 0.0001))))) (egglog_exp_array_api_DType_int32 )) $__expr_23) $__expr_29))) $__expr_36))
(sort egglog.builtins.Vec[egglog.exp.array_api.RecursiveValue] (Vec egglog.exp.array_api.RecursiveValue))
(constructor egglog_exp_array_api_RecursiveValue_vec (egglog.builtins.Vec[egglog.exp.array_api.RecursiveValue]) egglog.exp.array_api.RecursiveValue)
(let $__expr_37 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue_vec (vec-of (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum $__expr_25 $__expr_23) $__expr_29)) (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum $__expr_27 $__expr_23) $__expr_29)) (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum $__expr_26 $__expr_23) $__expr_29))))) $__expr_20) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int $__expr_3)))))
(let $__expr_38 (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_asarray (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat $__expr_24 (from-string "147")))))) $__expr_31 (egglog_exp_array_api_OptionalBool_none ) $__expr_32)) (egglog_exp_array_api_NDArray___truediv__ $__expr_1 (egglog_exp_array_api_NDArray___setitem__ $__expr_34 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_34 $__expr_33)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_Value_from_int $__expr_3) (egglog_exp_array_api_Value_from_int $__expr_3))))))) (egglog_exp_array_api_Boolean___init__ false)))
(let $__expr_39 (egglog_exp_array_api_Boolean___init__ false))
(let $__expr_40 (egglog_exp_array_api_NDArray___setitem__ $__expr_34 (egglog_exp_array_api_IndexKey_ndarray (egglog_exp_array_api_NDArray___eq__ $__expr_34 $__expr_33)) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value___truediv__ (egglog_exp_array_api_Value_from_int $__expr_3) (egglog_exp_array_api_Value_from_int $__expr_3))))))
(constructor egglog_exp_array_api_NDArray___matmul__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_NDArray_T (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(constructor egglog_exp_array_api_IndexKey_slice (egglog.exp.array_api.Slice) egglog.exp.array_api.IndexKey)
(let $__expr_22 (egglog_exp_array_api_TupleNDArray___getitem__ (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int $__expr_3))) $__expr_37) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat $__expr_24 (from-string "2")))))))) (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___sub__ $__expr_18 (egglog_exp_array_api_NDArray___matmul__ $__expr_37 $__expr_18))))) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_38 $__expr_19) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_slice $__expr_35) $__expr_13)))) $__expr_40)) (egglog_exp_array_api_NDArray___getitem__ $__expr_30 (egglog_exp_array_api_IndexKey_slice $__expr_35)))) $__expr_39) $__expr_9))
(let $__expr_41 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float___init__ 0.0001)))))
(let $__expr_42 (egglog_exp_array_api_svd_ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___mul__ (ndarray-sqrt (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___mul__ (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int $__expr_3))) $__expr_37) (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_float (egglog_exp_array_api_Float_rational (bigrat $__expr_24 (from-string "2")))))))) (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___sub__ $__expr_18 (egglog_exp_array_api_NDArray___matmul__ $__expr_37 $__expr_18))))) (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_38 $__expr_19) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_slice $__expr_35) $__expr_13)))) $__expr_40)) (egglog_exp_array_api_NDArray___getitem__ $__expr_30 (egglog_exp_array_api_IndexKey_slice $__expr_35)))) $__expr_39))
(let $__expr_43 (egglog_exp_array_api_DType_int32 ))
(let $__expr_44 (egglog_exp_array_api_NDArray___matmul__ $__expr_37 $__expr_18))
(let $__expr_45 (egglog_exp_array_api_NDArray_var "y"))
(let $__expr_46 (egglog_exp_array_api_Value_from_int $__expr_3))
(let $__expr_47 (egglog_exp_array_api_NDArray___init__ (egglog_exp_array_api_RecursiveValue___init__ (egglog_exp_array_api_Value_from_int $__expr_3))))
(let $__expr_48 0)
(let $__expr_49 (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_NDArray___truediv__ (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_38 $__expr_19) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of (egglog_exp_array_api_MultiAxisIndexKeyItem_slice $__expr_35) $__expr_13)))) $__expr_40)) (egglog_exp_array_api_NDArray___getitem__ $__expr_30 (egglog_exp_array_api_IndexKey_slice $__expr_35))))
(let $__expr_50 (egglog_exp_array_api_NDArray_var "X"))
(sort egglog.exp.program_gen.Program)
(relation egglog_exp_program_gen_Program_compile (egglog.exp.program_gen.Program i64))
(constructor egglog_exp_array_api_program_gen_ndarray_function_two_program (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.program_gen.Program)
(constructor egglog_exp_array_api_IndexKey_int (egglog.exp.array_api.Int) egglog.exp.array_api.IndexKey)
(let $__expr_0 (egglog_exp_program_gen_Program_compile (egglog_exp_array_api_program_gen_ndarray_function_two_program (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray___sub__ $__expr_7 $__expr_44) (egglog_exp_array_api_NDArray___matmul__ $__expr_49 (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_42 $__expr_19)) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of $__expr_13 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_36 (egglog_exp_array_api_OptionalInt_some (egglog_exp_array_api_Value_to_int (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___gt__ $__expr_22 (egglog_exp_array_api_NDArray___mul__ $__expr_41 (egglog_exp_array_api_NDArray___getitem__ $__expr_22 (egglog_exp_array_api_IndexKey_int $__expr_8)))) $__expr_43) $__expr_23) $__expr_29))) $__expr_36)))))))) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of $__expr_13 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_36 (egglog_exp_array_api_OptionalInt_some $__expr_19) $__expr_36)))))) $__expr_50 $__expr_45) $__expr_48))
(ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_program_gen_Program_function_two (egglog.exp.program_gen.Program egglog.exp.program_gen.Program egglog.exp.program_gen.Program String) egglog.exp.program_gen.Program)
(constructor egglog_exp_array_api_program_gen_ndarray_program (egglog.exp.array_api.NDArray) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_function_two_program _res _l _r) (egglog_exp_program_gen_Program_function_two (egglog_exp_array_api_program_gen_ndarray_program _res) (egglog_exp_array_api_program_gen_ndarray_program _l) (egglog_exp_array_api_program_gen_ndarray_program _r) "__fn") :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_vec_recursive_value_program (egglog.builtins.Vec[egglog.exp.array_api.RecursiveValue]) egglog.exp.program_gen.Program)
(constructor egglog_exp_program_gen_Program___init__ (String bool) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_vec_recursive_value_program (vec-empty )) (egglog_exp_program_gen_Program___init__ "" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_program_gen_Program___add__ (egglog.exp.program_gen.Program egglog.exp.program_gen.Program) egglog.exp.program_gen.Program)
(constructor egglog_exp_array_api_program_gen_recursive_value_program (egglog.exp.array_api.RecursiveValue) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_vec_recursive_value_program _vv) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_recursive_value_program (vec-get _vv $__expr_48)) (egglog_exp_program_gen_Program___init__ ", " false)) (egglog_exp_array_api_program_gen_vec_recursive_value_program (vec-remove _vv $__expr_48))) :when ((> (vec-length _vv) $__expr_48)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_value_program (egglog.exp.array_api.Value) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_recursive_value_program (egglog_exp_array_api_RecursiveValue___init__ _v)) (egglog_exp_array_api_program_gen_value_program _v) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_recursive_value_program (egglog_exp_array_api_RecursiveValue_vec _vv)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_vec_recursive_value_program _vv)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor _lambda_0 (egglog.exp.program_gen.Program egglog.exp.array_api.NDArray) egglog.exp.program_gen.Program)
(rewrite (_lambda_0 _acc _i) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ _acc (egglog_exp_array_api_program_gen_ndarray_program _i)) (egglog_exp_program_gen_Program___init__ ", " false)) :subsume :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_tuple_ndarray_program (egglog.exp.array_api.TupleNDArray) egglog.exp.program_gen.Program)
(sort egglog.builtins.UnstableFn[egglog.exp.program_gen.Program,egglog.exp.program_gen.Program,egglog.exp.array_api.NDArray] (UnstableFn (egglog.exp.program_gen.Program egglog.exp.array_api.NDArray) egglog.exp.program_gen.Program))
(constructor egglog_exp_array_api_program_gen_tuple_ndarray_foldl_program (egglog.exp.array_api.TupleNDArray egglog.builtins.UnstableFn[egglog.exp.program_gen.Program,egglog.exp.program_gen.Program,egglog.exp.array_api.NDArray] egglog.exp.program_gen.Program) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_program _x) (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_ndarray_foldl_program _x (unstable-fn "_lambda_0") (egglog_exp_program_gen_Program___init__ "(" false)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray_var _s)) (egglog_exp_program_gen_Program___init__ _s true) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_program_gen_Program_statement (egglog.exp.program_gen.Program egglog.exp.program_gen.Program) egglog.exp.program_gen.Program :unextractable)
(constructor egglog_exp_array_api_program_gen_dtype_program (egglog.exp.array_api.DType) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_assume_dtype _z _dtype)) (egglog_exp_program_gen_Program_statement (egglog_exp_array_api_program_gen_ndarray_program _z) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "assert " false) (egglog_exp_array_api_program_gen_ndarray_program _z)) (egglog_exp_program_gen_Program___init__ ".dtype == " false)) (egglog_exp_array_api_program_gen_dtype_program _dtype))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_tuple_int_program (egglog.exp.array_api.TupleInt) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_assume_shape _z _ti)) (egglog_exp_program_gen_Program_statement (egglog_exp_array_api_program_gen_ndarray_program _z) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "assert " false) (egglog_exp_array_api_program_gen_ndarray_program _z)) (egglog_exp_program_gen_Program___init__ ".shape == " false)) (egglog_exp_array_api_program_gen_tuple_int_program _ti))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_assume_isfinite _z)) (egglog_exp_program_gen_Program_statement (egglog_exp_array_api_program_gen_ndarray_program _z) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "assert np.all(np.isfinite(" false) (egglog_exp_array_api_program_gen_ndarray_program _z)) (egglog_exp_program_gen_Program___init__ "))" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_tuple_value_program (egglog.exp.array_api.TupleValue) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_assume_value_one_of _z _tv)) (egglog_exp_program_gen_Program_statement (egglog_exp_array_api_program_gen_ndarray_program _z) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "assert set(np.unique(" false) (egglog_exp_array_api_program_gen_ndarray_program _z)) (egglog_exp_program_gen_Program___init__ ")) == set(" false)) (egglog_exp_array_api_program_gen_tuple_value_program _tv)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_reshape (egglog.exp.array_api.NDArray egglog.exp.array_api.TupleInt egglog.exp.array_api.OptionalBool) egglog.exp.array_api.NDArray)
(constructor egglog_exp_program_gen_Program_assign (egglog.exp.program_gen.Program) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_reshape _y _ti _ob)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _y) (egglog_exp_program_gen_Program___init__ ".reshape(" false)) (egglog_exp_array_api_program_gen_tuple_int_program _ti)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_astype _y _dtype)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _y) (egglog_exp_program_gen_Program___init__ ".astype(" false)) (egglog_exp_array_api_program_gen_dtype_program _dtype)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_unique_counts (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleNDArray :unextractable)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_program (egglog_exp_array_api_unique_counts _x)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.unique(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", return_counts=True)" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_unique_inverse (egglog.exp.array_api.NDArray) egglog.exp.array_api.TupleNDArray :unextractable)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_program (egglog_exp_array_api_unique_inverse _x)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.unique(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", return_inverse=True)" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_int_program (egglog.exp.array_api.Int) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_TupleNDArray___getitem__ _tnd _i)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_ndarray_program _tnd) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ "]" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___init__ _rv)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.array(" false) (egglog_exp_array_api_program_gen_recursive_value_program _rv)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_OptionalDType_none () egglog.exp.array_api.OptionalDType)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_zeros _ti (egglog_exp_array_api_OptionalDType_none ) _optional_device_)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.zeros(" false) (egglog_exp_array_api_program_gen_tuple_int_program _ti)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_zeros _ti (egglog_exp_array_api_OptionalDType_some _dtype) _optional_device_)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.zeros(" false) (egglog_exp_array_api_program_gen_tuple_int_program _ti)) (egglog_exp_program_gen_Program___init__ ", dtype=" false)) (egglog_exp_array_api_program_gen_dtype_program _dtype)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_unique_values (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_unique_values _x)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.unique(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___add__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___add__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " + " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___sub__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " - " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___mul__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " * " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___truediv__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " / " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___lt__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___lt__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " < " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___le__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___le__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " <= " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___gt__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " > " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___ge__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___ge__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " >= " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___eq__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " == " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___matmul__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " @ " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___mod__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___mod__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " % " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___and__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___and__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " & " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___or__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___or__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " | " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___xor__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___xor__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " ^ " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___lshift__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___lshift__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " << " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___rshift__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___rshift__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " >> " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___floordiv__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___floordiv__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " // " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_NDArray___pow__ (egglog.exp.array_api.NDArray egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___pow__ _x _y)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ " ** " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_index_key_program (egglog.exp.array_api.IndexKey) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___setitem__ _x _idx _y)) (egglog_exp_program_gen_Program_statement (egglog_exp_program_gen_Program_assign (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program_assign (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_index_key_program _idx)) (egglog_exp_program_gen_Program___init__ "] = " false)) (egglog_exp_array_api_program_gen_ndarray_program _y))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray___getitem__ _x _idx)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_index_key_program _idx)) (egglog_exp_program_gen_Program___init__ "]" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_square _x)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.square(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_expand_dims _x _i)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.expand_dims(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", " false)) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_mean (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalIntOrTuple egglog.exp.array_api.Boolean) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_mean _x $__expr_23 $__expr_39)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.mean(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_optional_int_or_tuple_program (egglog.exp.array_api.OptionalIntOrTuple) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_mean _x _optional_int_or_tuple_ $__expr_39)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.mean(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", axis=" false)) (egglog_exp_array_api_program_gen_optional_int_or_tuple_program _optional_int_or_tuple_)) (egglog_exp_program_gen_Program___init__ ")" false))) :when ((!= _optional_int_or_tuple_ $__expr_23)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_mean _x _optional_int_or_tuple_ (egglog_exp_array_api_Boolean___init__ true))) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.mean(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", axis=" false)) (egglog_exp_array_api_program_gen_optional_int_or_tuple_program _optional_int_or_tuple_)) (egglog_exp_program_gen_Program___init__ ", keepdims=True)" false))) :when ((!= _optional_int_or_tuple_ $__expr_23)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_concat _tnd $__expr_36)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.concatenate(" false) (egglog_exp_array_api_program_gen_tuple_ndarray_program _tnd)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_concat _tnd (egglog_exp_array_api_OptionalInt_some _i))) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.concatenate(" false) (egglog_exp_array_api_program_gen_tuple_ndarray_program _tnd)) (egglog_exp_program_gen_Program___init__ ", axis=" false)) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_std (egglog.exp.array_api.NDArray egglog.exp.array_api.OptionalIntOrTuple) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_std _x $__expr_23)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.std(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_std _x _optional_int_or_tuple_)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.std(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", axis=" false)) (egglog_exp_array_api_program_gen_optional_int_or_tuple_program _optional_int_or_tuple_)) (egglog_exp_program_gen_Program___init__ ")" false))) :when ((!= _optional_int_or_tuple_ $__expr_23)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_program (egglog_exp_array_api_svd_ _x (egglog_exp_array_api_Boolean___init__ true))) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.linalg.svd(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_program (egglog_exp_array_api_svd_ _x $__expr_39)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.linalg.svd(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", full_matrices=False)" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (ndarray-sqrt _x)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.sqrt(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_NDArray_T _x)) (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ ".T" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_sum _x $__expr_23)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.sum(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_sum _x _optional_int_or_tuple_)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.sum(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", axis=" false)) (egglog_exp_array_api_program_gen_optional_int_or_tuple_program _optional_int_or_tuple_)) (egglog_exp_program_gen_Program___init__ ")" false))) :when ((!= _optional_int_or_tuple_ $__expr_23)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_int_program (egglog_exp_array_api_NDArray_shape _x)) (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _x) (egglog_exp_program_gen_Program___init__ ".shape" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor ndarray-abs (egglog.exp.array_api.NDArray) egglog.exp.array_api.NDArray)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (ndarray-abs _x)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.abs(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ")" false))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_optional_dtype_program (egglog.exp.array_api.OptionalDType) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_asarray _x _odtype (egglog_exp_array_api_OptionalBool_none ) _optional_device_)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.asarray(" false) (egglog_exp_array_api_program_gen_ndarray_program _x)) (egglog_exp_program_gen_Program___init__ ", " false)) (egglog_exp_array_api_program_gen_optional_dtype_program _odtype)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_int_or_tuple_program (egglog_exp_array_api_OptionalIntOrTuple_int _i)) (egglog_exp_array_api_program_gen_int_program _i) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_OptionalIntOrTuple_tuple (egglog.exp.array_api.TupleInt) egglog.exp.array_api.OptionalIntOrTuple)
(rewrite (egglog_exp_array_api_program_gen_optional_int_or_tuple_program (egglog_exp_array_api_OptionalIntOrTuple_tuple _ti)) (egglog_exp_array_api_program_gen_tuple_int_program _ti) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_int_or_tuple_program $__expr_23) (egglog_exp_program_gen_Program___init__ "None" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_IndexKey_ELLIPSIS () egglog.exp.array_api.IndexKey)
(rewrite (egglog_exp_array_api_program_gen_index_key_program (egglog_exp_array_api_IndexKey_ELLIPSIS )) (egglog_exp_program_gen_Program___init__ "..." false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_index_key_program (egglog_exp_array_api_IndexKey_int _i)) (egglog_exp_array_api_program_gen_int_program _i) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_slice_program (egglog.exp.array_api.Slice) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_index_key_program (egglog_exp_array_api_IndexKey_slice _s)) (egglog_exp_array_api_program_gen_slice_program _s) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog.exp.array_api.MultiAxisIndexKey) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_index_key_program (egglog_exp_array_api_IndexKey_multi_axis _key)) (egglog_exp_array_api_program_gen_multi_axis_index_key_program _key) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_index_key_program (egglog_exp_array_api_IndexKey_ndarray _a)) (egglog_exp_array_api_program_gen_ndarray_program _a) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.MultiAxisIndexKeyItem,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.array_api.Int ) egglog.exp.array_api.MultiAxisIndexKeyItem))
(constructor _lambda_1 (egglog.builtins.UnstableFn[egglog.exp.array_api.MultiAxisIndexKeyItem,egglog.exp.array_api.Int] egglog.exp.array_api.Int) egglog.exp.array_api.MultiAxisIndexKeyItem)
(constructor egglog_exp_array_api_Int___add__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (_lambda_1 _idx_fn _i) (unstable-app _idx_fn (egglog_exp_array_api_Int___add__ _i $__expr_9)) :subsume :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_MultiAxisIndexKey___init__ (egglog.exp.array_api.Int egglog.builtins.UnstableFn[egglog.exp.array_api.MultiAxisIndexKeyItem,egglog.exp.array_api.Int]) egglog.exp.array_api.MultiAxisIndexKey)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey___init__ $__expr_8 _idx_fn)) (egglog_exp_program_gen_Program___init__ "" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (egglog.exp.array_api.MultiAxisIndexKeyItem) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey___init__ (egglog_exp_array_api_Int___init__ _k) _idx_fn)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (unstable-app _idx_fn $__expr_8)) (egglog_exp_program_gen_Program___init__ ", " false)) (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey___init__ (egglog_exp_array_api_Int___init__ (- _k 1)) (unstable-fn "_lambda_1" _idx_fn)))) :when ((!= _k $__expr_48)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of ))) (egglog_exp_program_gen_Program___init__ "" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey_from_vec _vec)) (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (vec-get _vec $__expr_48)) (egglog_exp_program_gen_Program___init__ "," false)) :when ((= (vec-length _vec) 1)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey_from_vec _vec)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (vec-get _vec $__expr_48)) (egglog_exp_program_gen_Program___init__ ", " false)) (egglog_exp_array_api_program_gen_multi_axis_index_key_program (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-remove _vec $__expr_48)))) :when ((> (vec-length _vec) 1)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (egglog_exp_array_api_MultiAxisIndexKeyItem_int _i)) (egglog_exp_array_api_program_gen_int_program _i) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (egglog_exp_array_api_MultiAxisIndexKeyItem_slice _s)) (egglog_exp_array_api_program_gen_slice_program _s) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_MultiAxisIndexKeyItem_ELLIPSIS () egglog.exp.array_api.MultiAxisIndexKeyItem)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (egglog_exp_array_api_MultiAxisIndexKeyItem_ELLIPSIS )) (egglog_exp_program_gen_Program___init__ "..." false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_MultiAxisIndexKeyItem_NONE () egglog.exp.array_api.MultiAxisIndexKeyItem)
(rewrite (egglog_exp_array_api_program_gen_multi_axis_index_key_item_program (egglog_exp_array_api_MultiAxisIndexKeyItem_NONE )) (egglog_exp_program_gen_Program___init__ "None" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_optional_int_slice_program (egglog.exp.array_api.OptionalInt) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_slice_program (egglog_exp_array_api_Slice___init__ _start _stop $__expr_36)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_optional_int_slice_program _start) (egglog_exp_program_gen_Program___init__ ":" false)) (egglog_exp_array_api_program_gen_optional_int_slice_program _stop)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_slice_program (egglog_exp_array_api_Slice___init__ _start _stop (egglog_exp_array_api_OptionalInt_some _i))) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_optional_int_slice_program _start) (egglog_exp_program_gen_Program___init__ ":" false)) (egglog_exp_array_api_program_gen_optional_int_slice_program _stop)) (egglog_exp_program_gen_Program___init__ ":" false)) (egglog_exp_array_api_program_gen_int_program _i)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_int_slice_program $__expr_36) (egglog_exp_program_gen_Program___init__ "" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_int_slice_program (egglog_exp_array_api_OptionalInt_some _x)) (egglog_exp_array_api_program_gen_int_program _x) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_optional_int_program (egglog.exp.array_api.OptionalInt) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_optional_int_program $__expr_36) (egglog_exp_program_gen_Program___init__ "None" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_int_program (egglog_exp_array_api_OptionalInt_some _x)) (egglog_exp_array_api_program_gen_int_program _x) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_dtype_program (egglog_exp_array_api_OptionalDType_none )) (egglog_exp_program_gen_Program___init__ "None" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_optional_dtype_program (egglog_exp_array_api_OptionalDType_some _dtype)) (egglog_exp_array_api_program_gen_dtype_program _dtype) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_ndarray_program (egglog_exp_array_api_TupleNDArray___getitem__ _ti _i)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_ndarray_program _ti) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ "]" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_TupleNDArray_length (egglog.exp.array_api.TupleNDArray) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_TupleNDArray_length _ti)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "len(" false) (egglog_exp_array_api_program_gen_tuple_ndarray_program _ti)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_foldl_program (egglog_exp_array_api_TupleNDArray___init__ (vec-empty )) _f _init) _init :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_ndarray_foldl_program (egglog_exp_array_api_TupleNDArray___init__ _vn) _f _init) (unstable-app _f (egglog_exp_array_api_program_gen_tuple_ndarray_foldl_program (egglog_exp_array_api_TupleNDArray___init__ (vec-pop _vn)) _f _init) (vec-get _vn (- (vec-length _vn) 1))) :when ((> (vec-length _vn) $__expr_48)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor _lambda_2 (egglog.exp.program_gen.Program egglog.exp.array_api.Value) egglog.exp.program_gen.Program)
(rewrite (_lambda_2 _acc _i) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ _acc (egglog_exp_array_api_program_gen_value_program _i)) (egglog_exp_program_gen_Program___init__ ", " false)) :subsume :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_TupleValue___getitem__ (egglog.exp.array_api.TupleValue egglog.exp.array_api.Int) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_TupleValue___getitem__ _ti _i)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_value_program _ti) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ "]" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_TupleValue_length (egglog.exp.array_api.TupleValue) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_TupleValue_length _ti)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "len(" false) (egglog_exp_array_api_program_gen_tuple_value_program _ti)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.program_gen.Program,egglog.exp.program_gen.Program,egglog.exp.array_api.Value] (UnstableFn (egglog.exp.program_gen.Program egglog.exp.array_api.Value) egglog.exp.program_gen.Program))
(constructor egglog_exp_array_api_program_gen_tuple_value_foldl_program (egglog.exp.array_api.TupleValue egglog.builtins.UnstableFn[egglog.exp.program_gen.Program,egglog.exp.program_gen.Program,egglog.exp.array_api.Value] egglog.exp.program_gen.Program) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_tuple_value_program _ti) (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_value_foldl_program _ti (unstable-fn "_lambda_2") (egglog_exp_program_gen_Program___init__ "(" false)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_value_foldl_program (egglog_exp_array_api_TupleValue___init__ (vec-empty )) _f _init) _init :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_value_foldl_program (egglog_exp_array_api_TupleValue___init__ _vv) _f _init) (unstable-app _f (egglog_exp_array_api_program_gen_tuple_value_foldl_program (egglog_exp_array_api_TupleValue___init__ (vec-pop _vv)) _f _init) (vec-get _vv (- (vec-length _vv) 1))) :when ((> (vec-length _vv) $__expr_48)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value_from_int _i)) (egglog_exp_array_api_program_gen_int_program _i) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value_from_bool (egglog.exp.array_api.Boolean) egglog.exp.array_api.Value)
(constructor egglog_exp_array_api_program_gen_bool_program (egglog.exp.array_api.Boolean) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value_from_bool _b)) (egglog_exp_array_api_program_gen_bool_program _b) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_program_gen_float_program (egglog.exp.array_api.Float) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value_from_float _f)) (egglog_exp_array_api_program_gen_float_program _f) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value___lt__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value___lt__ _v1 _v2)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ " < " false)) (egglog_exp_array_api_program_gen_value_program _v2)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value___truediv__ _v1 _v2)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ " / " false)) (egglog_exp_array_api_program_gen_value_program _v2)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value___add__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value___add__ _v1 _v2)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ " + " false)) (egglog_exp_array_api_program_gen_value_program _v2)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value___mul__ (egglog.exp.array_api.Value egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value___mul__ _v1 _v2)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ " * " false)) (egglog_exp_array_api_program_gen_value_program _v2)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value_to_bool (egglog.exp.array_api.Value) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Value_to_bool _v1)) (egglog_exp_array_api_program_gen_value_program _v1) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Value_to_int _v1)) (egglog_exp_array_api_program_gen_value_program _v1) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_NDArray_index _xs _ti)) (egglog_exp_program_gen_Program_assign (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_ndarray_program _xs) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_tuple_int_program _ti)) (egglog_exp_program_gen_Program___init__ "]" false))) :when ((!= _ti $__expr_29)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_NDArray_index _xs $__expr_29)) (egglog_exp_array_api_program_gen_ndarray_program _xs) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value_sqrt (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value_sqrt _v1)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.sqrt(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value_real (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value_real _v1)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.real(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Value_conj (egglog.exp.array_api.Value) egglog.exp.array_api.Value)
(rewrite (egglog_exp_array_api_program_gen_value_program (egglog_exp_array_api_Value_conj _v1)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.conj(" false) (egglog_exp_array_api_program_gen_value_program _v1)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float___init__ _f64_)) (egglog_exp_program_gen_Program___init__ (to-string _f64_) false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Float_abs (egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float_abs _f)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "np.abs(" false) (egglog_exp_array_api_program_gen_float_program _f)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Float_from_int (egglog.exp.array_api.Int) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float_from_int _i)) (egglog_exp_array_api_program_gen_int_program _i) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Float___add__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float___add__ _f _g)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_float_program _f)) (egglog_exp_program_gen_Program___init__ " + " false)) (egglog_exp_array_api_program_gen_float_program _g)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Float___sub__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float___sub__ _f _g)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_float_program _f)) (egglog_exp_program_gen_Program___init__ " - " false)) (egglog_exp_array_api_program_gen_float_program _g)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Float___mul__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float___mul__ _f _g)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_float_program _f)) (egglog_exp_program_gen_Program___init__ " * " false)) (egglog_exp_array_api_program_gen_float_program _g)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Float___truediv__ (egglog.exp.array_api.Float egglog.exp.array_api.Float) egglog.exp.array_api.Float)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float___truediv__ _f _g)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_float_program _f)) (egglog_exp_program_gen_Program___init__ " / " false)) (egglog_exp_array_api_program_gen_float_program _g)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float_rational _r)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "float(" false) (egglog_exp_program_gen_Program___init__ (to-string (numer _r)) false)) (egglog_exp_program_gen_Program___init__ " / " false)) (egglog_exp_program_gen_Program___init__ (to-string (denom _r)) false)) (egglog_exp_program_gen_Program___init__ ")" false)) :when ((!= (denom _r) (bigint 1))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_float_program (egglog_exp_array_api_Float_rational _r)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "float(" false) (egglog_exp_program_gen_Program___init__ (to-string (numer _r)) false)) (egglog_exp_program_gen_Program___init__ ")" false)) :when ((= (denom _r) (bigint 1))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_dtype_program $__expr_20) (egglog_exp_program_gen_Program___init__ "np.dtype(np.float64)" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_DType_float32 () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_program_gen_dtype_program (egglog_exp_array_api_DType_float32 )) (egglog_exp_program_gen_Program___init__ "np.dtype(np.float32)" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_dtype_program (egglog_exp_array_api_DType_int64 )) (egglog_exp_program_gen_Program___init__ "np.dtype(np.int64)" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_dtype_program $__expr_43) (egglog_exp_program_gen_Program___init__ "np.dtype(np.int32)" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_DType_bool () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_program_gen_dtype_program (egglog_exp_array_api_DType_bool )) (egglog_exp_program_gen_Program___init__ "np.dtype(np.bool)" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_DType_object () egglog.exp.array_api.DType)
(rewrite (egglog_exp_array_api_program_gen_dtype_program (egglog_exp_array_api_DType_object )) (egglog_exp_program_gen_Program___init__ "np.dtype(np.object_)" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor _lambda_3 (egglog.exp.program_gen.Program egglog.exp.array_api.Int) egglog.exp.program_gen.Program)
(rewrite (_lambda_3 _acc _i) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ _acc (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ ", " false)) :subsume :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_TupleInt___getitem__ _ti _i)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_int_program _ti) (egglog_exp_program_gen_Program___init__ "[" false)) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ "]" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_TupleInt_length (egglog.exp.array_api.TupleInt) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_TupleInt_length _ti)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "len(" false) (egglog_exp_array_api_program_gen_tuple_int_program _ti)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.program_gen.Program] (UnstableFn () egglog.exp.program_gen.Program))
(constructor egglog_exp_array_api_program_gen_program_if (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.program_gen.Program] egglog.builtins.UnstableFn[egglog.exp.program_gen.Program]) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_program_if (egglog_exp_array_api_Boolean___init__ true) _tt _ft) (unstable-app _tt) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_program_if $__expr_39 _tt _ft) (unstable-app _ft) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_TupleInt___add__ (egglog.exp.array_api.TupleInt egglog.exp.array_api.TupleInt) egglog.exp.array_api.TupleInt :unextractable)
(rewrite (egglog_exp_array_api_program_gen_tuple_int_program (egglog_exp_array_api_TupleInt___add__ _ti _ti2)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_tuple_int_program _ti)) (egglog_exp_program_gen_Program___init__ " + " false)) (egglog_exp_array_api_program_gen_tuple_int_program _ti2)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.program_gen.Program,egglog.exp.program_gen.Program,egglog.exp.array_api.Int] (UnstableFn (egglog.exp.program_gen.Program egglog.exp.array_api.Int) egglog.exp.program_gen.Program))
(constructor egglog_exp_array_api_program_gen_tuple_int_foldl_program (egglog.exp.array_api.TupleInt egglog.builtins.UnstableFn[egglog.exp.program_gen.Program,egglog.exp.program_gen.Program,egglog.exp.array_api.Int] egglog.exp.program_gen.Program) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_array_api_program_gen_tuple_int_program _ti) (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_tuple_int_foldl_program _ti (unstable-fn "_lambda_3") (egglog_exp_program_gen_Program___init__ "(" false)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_int_foldl_program $__expr_29 _f _init) _init :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_tuple_int_foldl_program (egglog_exp_array_api_TupleInt___init__ _vi) _f _init) (unstable-app _f (egglog_exp_array_api_program_gen_tuple_int_foldl_program (egglog_exp_array_api_TupleInt___init__ (vec-pop _vi)) _f _init) (vec-get _vi (- (vec-length _vi) 1))) :when ((> (vec-length _vi) $__expr_48)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int_var (String) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int_var _s)) (egglog_exp_program_gen_Program___init__ _s true) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___init__ _i64_)) (egglog_exp_program_gen_Program___init__ (to-string _i64_) false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___invert__ (egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___invert__ _i)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "~" false) (egglog_exp_array_api_program_gen_int_program _i)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___lt__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Int___lt__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " < " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___le__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Int___le__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " <= " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___gt__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Int___gt__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " > " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___ge__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Int___ge__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " >= " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___eq__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Boolean)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Int___eq__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " == " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___add__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " + " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___sub__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___sub__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " - " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___mul__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___mul__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " * " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___truediv__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___truediv__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " / " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___mod__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___mod__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " % " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___pow__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___pow__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " ** " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___and__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___and__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " & " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___or__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___or__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " | " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___xor__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___xor__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " ^ " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___lshift__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___lshift__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " << " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___rshift__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___rshift__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " >> " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_Int___floordiv__ (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int___floordiv__ _i _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "(" false) (egglog_exp_array_api_program_gen_int_program _i)) (egglog_exp_program_gen_Program___init__ " // " false)) (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___init__ ")" false)) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(constructor egglog_exp_array_api_check_index (egglog.exp.array_api.Int egglog.exp.array_api.Int) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_check_index _i _j)) (egglog_exp_program_gen_Program_statement (egglog_exp_program_gen_Program_assign (egglog_exp_array_api_program_gen_int_program _j)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___init__ "assert " false) (egglog_exp_program_gen_Program_assign (egglog_exp_array_api_program_gen_int_program _j))) (egglog_exp_program_gen_Program___init__ " < " false)) (egglog_exp_array_api_program_gen_int_program _i))) :subsume :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(sort egglog.builtins.UnstableFn[egglog.exp.array_api.Int] (UnstableFn () egglog.exp.array_api.Int))
(constructor egglog_exp_array_api_Int_if_ (egglog.exp.array_api.Boolean egglog.builtins.UnstableFn[egglog.exp.array_api.Int] egglog.builtins.UnstableFn[egglog.exp.array_api.Int]) egglog.exp.array_api.Int)
(rewrite (egglog_exp_array_api_program_gen_int_program (egglog_exp_array_api_Int_if_ _b _ti _ti1)) (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_program_gen_Program___add__ (egglog_exp_array_api_program_gen_int_program (unstable-app _ti)) (egglog_exp_program_gen_Program___init__ " if " false)) (egglog_exp_array_api_program_gen_bool_program _b)) (egglog_exp_program_gen_Program___init__ " else " false)) (egglog_exp_array_api_program_gen_int_program (unstable-app _ti1))) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_bool_program (egglog_exp_array_api_Boolean___init__ true)) (egglog_exp_program_gen_Program___init__ "True" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(rewrite (egglog_exp_array_api_program_gen_bool_program $__expr_39) (egglog_exp_program_gen_Program___init__ "False" false) :ruleset egglog.exp.array_api_program_gen.array_api_program_gen_ruleset)
(ruleset egglog.exp.program_gen.program_gen_ruleset)
(function egglog_exp_program_gen_Program_expr (egglog.exp.program_gen.Program) String :no-merge)
(function egglog_exp_program_gen_Program_statements (egglog.exp.program_gen.Program) String :no-merge)
(function egglog_exp_program_gen_Program_next_sym (egglog.exp.program_gen.Program) i64 :no-merge)
(function egglog_exp_program_gen_Program_is_identifier (egglog.exp.program_gen.Program) bool :no-merge)
(rule ((= _p (egglog_exp_program_gen_Program___init__ _s _b))
       (egglog_exp_program_gen_Program_compile _p _i))
      ((set (egglog_exp_program_gen_Program_expr _p) _s)
       (set (egglog_exp_program_gen_Program_statements _p) "")
       (set (egglog_exp_program_gen_Program_next_sym _p) _i)
       (set (egglog_exp_program_gen_Program_is_identifier _p) _b))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(constructor egglog_exp_program_gen_Program_expr_to_statement (egglog.exp.program_gen.Program) egglog.exp.program_gen.Program)
(rewrite (egglog_exp_program_gen_Program_statement _p1 _p2) (egglog_exp_program_gen_Program___add__ _p1 (egglog_exp_program_gen_Program_expr_to_statement _p2)) :ruleset egglog.exp.program_gen.program_gen_ruleset)
(function egglog_exp_program_gen_Program_parent (egglog.exp.program_gen.Program) egglog.exp.program_gen.Program :merge old)
(rule ((= _p (egglog_exp_program_gen_Program_expr_to_statement _p1))
       (egglog_exp_program_gen_Program_compile _p _i))
      ((set (egglog_exp_program_gen_Program_parent _p1) _p)
       (set (egglog_exp_program_gen_Program_is_identifier _p) false))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_expr_to_statement _p1))
       (egglog_exp_program_gen_Program_compile _p _i)
       (= (egglog_exp_program_gen_Program_parent _p1) _p))
      ((egglog_exp_program_gen_Program_compile _p1 _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_expr_to_statement _p1))
       (egglog_exp_program_gen_Program_compile _p _i)
       (!= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= _s1 (egglog_exp_program_gen_Program_expr _p1)))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ _s1 "
"))
       (set (egglog_exp_program_gen_Program_next_sym _p) _i)
       (set (egglog_exp_program_gen_Program_expr _p) ""))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_expr_to_statement _p1))
       (= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= _s1 (egglog_exp_program_gen_Program_expr _p1))
       (= _s2 (egglog_exp_program_gen_Program_statements _p1))
       (= _i (egglog_exp_program_gen_Program_next_sym _p1)))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ _s2 _s1 "
"))
       (set (egglog_exp_program_gen_Program_next_sym _p) _i)
       (set (egglog_exp_program_gen_Program_expr _p) ""))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (= (egglog_exp_program_gen_Program_expr _p) (egglog_exp_program_gen_Program_expr _p1))
       (= _b (egglog_exp_program_gen_Program_is_identifier _p1)))
      ((set (egglog_exp_program_gen_Program_is_identifier _p) _b))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (= (egglog_exp_program_gen_Program_expr _p) (egglog_exp_program_gen_Program_expr _p2))
       (= _b (egglog_exp_program_gen_Program_is_identifier _p2)))
      ((set (egglog_exp_program_gen_Program_is_identifier _p) _b))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (!= (egglog_exp_program_gen_Program_expr _p) (egglog_exp_program_gen_Program_expr _p1))
       (!= (egglog_exp_program_gen_Program_expr _p) (egglog_exp_program_gen_Program_expr _p2)))
      ((set (egglog_exp_program_gen_Program_is_identifier _p) false))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (egglog_exp_program_gen_Program_compile _p _i))
      ((set (egglog_exp_program_gen_Program_parent _p1) _p))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (egglog_exp_program_gen_Program_compile _p _i)
       (= (egglog_exp_program_gen_Program_parent _p1) _p))
      ((egglog_exp_program_gen_Program_compile _p1 _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (egglog_exp_program_gen_Program_compile _p _i)
       (egglog_exp_program_gen_Program_next_sym _p1))
      ((set (egglog_exp_program_gen_Program_parent _p2) _p))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (egglog_exp_program_gen_Program_compile _p _i)
       (!= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= (egglog_exp_program_gen_Program_parent _p2) _p))
      ((egglog_exp_program_gen_Program_compile _p2 _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (egglog_exp_program_gen_Program_compile _p _i2)
       (= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= _i (egglog_exp_program_gen_Program_next_sym _p1))
       (= (egglog_exp_program_gen_Program_parent _p2) _p))
      ((egglog_exp_program_gen_Program_compile _p2 _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (= _s1 (egglog_exp_program_gen_Program_expr _p1))
       (= _s2 (egglog_exp_program_gen_Program_expr _p2)))
      ((set (egglog_exp_program_gen_Program_expr _p) (+ _s1 _s2)))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= (egglog_exp_program_gen_Program_parent _p2) _p)
       (= _s1 (egglog_exp_program_gen_Program_statements _p1))
       (= _s2 (egglog_exp_program_gen_Program_statements _p2))
       (= _i (egglog_exp_program_gen_Program_next_sym _p2)))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ _s1 _s2))
       (set (egglog_exp_program_gen_Program_next_sym _p) _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (egglog_exp_program_gen_Program_compile _p _i)
       (!= (egglog_exp_program_gen_Program_parent _p1) _p)
       (!= (egglog_exp_program_gen_Program_parent _p2) _p))
      ((set (egglog_exp_program_gen_Program_statements _p) "")
       (set (egglog_exp_program_gen_Program_next_sym _p) _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (= (egglog_exp_program_gen_Program_parent _p1) _p)
       (!= (egglog_exp_program_gen_Program_parent _p2) _p)
       (= _s1 (egglog_exp_program_gen_Program_statements _p1))
       (= _i (egglog_exp_program_gen_Program_next_sym _p1)))
      ((set (egglog_exp_program_gen_Program_statements _p) _s1)
       (set (egglog_exp_program_gen_Program_next_sym _p) _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program___add__ _p1 _p2))
       (= (egglog_exp_program_gen_Program_parent _p2) _p)
       (!= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= _s2 (egglog_exp_program_gen_Program_statements _p2))
       (= _i (egglog_exp_program_gen_Program_next_sym _p2)))
      ((set (egglog_exp_program_gen_Program_statements _p) _s2)
       (set (egglog_exp_program_gen_Program_next_sym _p) _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_assign _p1))
       (egglog_exp_program_gen_Program_compile _p _i))
      ((set (egglog_exp_program_gen_Program_parent _p1) _p)
       (set (egglog_exp_program_gen_Program_is_identifier _p) true))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_assign _p1))
       (egglog_exp_program_gen_Program_compile _p _i)
       (= (egglog_exp_program_gen_Program_parent _p1) _p))
      ((egglog_exp_program_gen_Program_compile _p1 _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_assign _p1))
       (= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= _s1 (egglog_exp_program_gen_Program_statements _p1))
       (= _i (egglog_exp_program_gen_Program_next_sym _p1))
       (= _s2 (egglog_exp_program_gen_Program_expr _p1))
       (= (egglog_exp_program_gen_Program_is_identifier _p1) false))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ _s1 (+ "_" (to-string _i)) " = " _s2 "
"))
       (set (egglog_exp_program_gen_Program_expr _p) (+ "_" (to-string _i)))
       (set (egglog_exp_program_gen_Program_next_sym _p) (+ _i 1)))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_assign _p1))
       (!= (egglog_exp_program_gen_Program_parent _p1) _p)
       (egglog_exp_program_gen_Program_compile _p _i)
       (= _s2 (egglog_exp_program_gen_Program_expr _p1))
       (= (egglog_exp_program_gen_Program_is_identifier _p1) false))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ (+ "_" (to-string _i)) " = " _s2 "
"))
       (set (egglog_exp_program_gen_Program_expr _p) (+ "_" (to-string _i)))
       (set (egglog_exp_program_gen_Program_next_sym _p) (+ _i 1)))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_assign _p1))
       (= (egglog_exp_program_gen_Program_parent _p1) _p)
       (= _s1 (egglog_exp_program_gen_Program_statements _p1))
       (= _i (egglog_exp_program_gen_Program_next_sym _p1))
       (= _s2 (egglog_exp_program_gen_Program_expr _p1))
       (= (egglog_exp_program_gen_Program_is_identifier _p1) true))
      ((set (egglog_exp_program_gen_Program_statements _p) _s1)
       (set (egglog_exp_program_gen_Program_expr _p) _s2)
       (set (egglog_exp_program_gen_Program_next_sym _p) _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_assign _p1))
       (!= (egglog_exp_program_gen_Program_parent _p1) _p)
       (egglog_exp_program_gen_Program_compile _p _i)
       (= _s2 (egglog_exp_program_gen_Program_expr _p1))
       (= (egglog_exp_program_gen_Program_is_identifier _p1) true))
      ((set (egglog_exp_program_gen_Program_statements _p) "")
       (set (egglog_exp_program_gen_Program_expr _p) _s2)
       (set (egglog_exp_program_gen_Program_next_sym _p) _i))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_function_two _p1 _p2 _p3 _s1))
       (egglog_exp_program_gen_Program_compile _p _i))
      ((set (egglog_exp_program_gen_Program_parent _p2) _p)
       (set (egglog_exp_program_gen_Program_parent _p3) _p)
       (set (egglog_exp_program_gen_Program_parent _p1) _p)
       (egglog_exp_program_gen_Program_compile _p2 _i)
       (egglog_exp_program_gen_Program_compile _p3 _i)
       (egglog_exp_program_gen_Program_compile _p1 _i)
       (set (egglog_exp_program_gen_Program_is_identifier _p) true))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_function_two _p1 _p2 _p3 _s1))
       (egglog_exp_program_gen_Program_compile _p _i)
       (= _s2 (egglog_exp_program_gen_Program_expr _p1))
       (= _s3 (egglog_exp_program_gen_Program_statements _p1))
       (= _s4 (egglog_exp_program_gen_Program_expr _p2))
       (= _s5 (egglog_exp_program_gen_Program_expr _p3)))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ "def " _s1 "(" _s4 ", " _s5 "):
    " (replace _s3 "
" "
    ") "return " _s2 "
"))
       (set (egglog_exp_program_gen_Program_next_sym _p) _i)
       (set (egglog_exp_program_gen_Program_expr _p) _s1))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(constructor egglog_exp_program_gen_Program_function_three (egglog.exp.program_gen.Program egglog.exp.program_gen.Program egglog.exp.program_gen.Program egglog.exp.program_gen.Program String) egglog.exp.program_gen.Program)
(rule ((= _p (egglog_exp_program_gen_Program_function_three _p1 _p2 _p3 _p4 _s1))
       (egglog_exp_program_gen_Program_compile _p _i))
      ((set (egglog_exp_program_gen_Program_parent _p2) _p)
       (set (egglog_exp_program_gen_Program_parent _p3) _p)
       (set (egglog_exp_program_gen_Program_parent _p1) _p)
       (set (egglog_exp_program_gen_Program_parent _p4) _p)
       (egglog_exp_program_gen_Program_compile _p2 _i)
       (egglog_exp_program_gen_Program_compile _p3 _i)
       (egglog_exp_program_gen_Program_compile _p1 _i)
       (egglog_exp_program_gen_Program_compile _p4 _i)
       (set (egglog_exp_program_gen_Program_is_identifier _p) true))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(rule ((= _p (egglog_exp_program_gen_Program_function_three _p1 _p2 _p3 _p4 _s1))
       (egglog_exp_program_gen_Program_compile _p _i)
       (= _s2 (egglog_exp_program_gen_Program_expr _p1))
       (= _s3 (egglog_exp_program_gen_Program_statements _p1))
       (= _s4 (egglog_exp_program_gen_Program_expr _p2))
       (= _s5 (egglog_exp_program_gen_Program_expr _p3))
       (= _s6 (egglog_exp_program_gen_Program_expr _p4)))
      ((set (egglog_exp_program_gen_Program_statements _p) (+ "def " _s1 "(" _s4 ", " _s5 ", " _s6 "):
    " (replace _s3 "
" "
    ") "return " _s2 "
"))
       (set (egglog_exp_program_gen_Program_next_sym _p) _i)
       (set (egglog_exp_program_gen_Program_expr _p) _s1))
        :ruleset egglog.exp.program_gen.program_gen_ruleset )
(unstable-combined-ruleset combined_ruleset_4764447312 egglog.exp.array_api_program_gen.array_api_program_gen_ruleset egglog.exp.program_gen.program_gen_ruleset)
(ruleset egglog.exp.array_api_program_gen.array_api_program_gen_eval_ruleset)
(unstable-combined-ruleset combined_ruleset_4764447632 combined_ruleset_4764447312 egglog.exp.array_api_program_gen.array_api_program_gen_eval_ruleset)
(run-schedule (saturate (run combined_ruleset_4764447632)))
(extract (egglog_exp_program_gen_Program_statements (egglog_exp_array_api_program_gen_ndarray_function_two_program (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_NDArray___matmul__ (egglog_exp_array_api_NDArray___sub__ $__expr_7 $__expr_44) (egglog_exp_array_api_NDArray___matmul__ $__expr_49 (egglog_exp_array_api_NDArray___getitem__ (egglog_exp_array_api_NDArray_T (egglog_exp_array_api_TupleNDArray___getitem__ $__expr_42 $__expr_19)) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of $__expr_13 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_36 (egglog_exp_array_api_OptionalInt_some (egglog_exp_array_api_Value_to_int (egglog_exp_array_api_NDArray_index (egglog_exp_array_api_sum (egglog_exp_array_api_astype (egglog_exp_array_api_NDArray___gt__ $__expr_22 (egglog_exp_array_api_NDArray___mul__ $__expr_41 (egglog_exp_array_api_NDArray___getitem__ $__expr_22 (egglog_exp_array_api_IndexKey_int $__expr_8)))) $__expr_43) $__expr_23) $__expr_29))) $__expr_36)))))))) (egglog_exp_array_api_IndexKey_multi_axis (egglog_exp_array_api_MultiAxisIndexKey_from_vec (vec-of $__expr_13 (egglog_exp_array_api_MultiAxisIndexKeyItem_slice (egglog_exp_array_api_Slice___init__ $__expr_36 (egglog_exp_array_api_OptionalInt_some $__expr_19) $__expr_36)))))) $__expr_50 $__expr_45)) 0)