egraphs-good / egg

egg is a flexible, high-performance e-graph library
https://egraphs-good.github.io
MIT License
1.37k stars 138 forks source link

Bug(?)/Extreme performance issue when using `explain_equivalence` #153

Closed derekelkins closed 2 years ago

derekelkins commented 2 years ago

Running the below with egg 0.7.1 pegs a CPU core to 100%, takes a long time to complete, and consumes gigabytes of memory. This has 1117 nodes and the rule fires around ~60 times. This is a version of a real expression. I thought the problem might be the depth of the expression (it's probably around a couple hundred layers deep), but my attempts to make an artificial expression didn't seem to cause the problem. I do think the depth is a factor, but something more is going on. If I comment out the explain_equivalence, the code executes instantaneously.

It's hard to see from the serialized, all the rule applications are independent, i.e. there are no expressions of the form (Foo (Foo (Constant ?n) ...) ...). This could be further reinforced by having the rule produce (Konstant ?n).

I think this code is reasonable, but if I'm misusing the library in some way or doing something unsupported, let me know.

use egg::{rewrite, AstSize, EGraph, Extractor, Language, Rewrite, Runner, SymbolLang};

fn main() {
    test_case(false);
}

fn test_case(do_print: bool) {
    let mut egraph: EGraph<SymbolLang, ()> = Default::default();
    egraph = egraph.with_explanations_enabled();

    let n0 = egraph.add(SymbolLang::leaf("x.0"));
    let n1 = egraph.add(SymbolLang::leaf("x.1"));
    let n2 = egraph.add(SymbolLang::new("F2", vec![n1]));
    let n3 = egraph.add(SymbolLang::leaf("x.3"));
    let n4 = egraph.add(SymbolLang::new("Constant", vec![n3]));
    let n5 = egraph.add(SymbolLang::leaf("x.5"));
    let n6 = egraph.add(SymbolLang::new("Constant", vec![n5]));
    let n7 = egraph.add(SymbolLang::leaf("x.7"));
    let n8 = egraph.add(SymbolLang::new("Constant", vec![n7]));
    let n9 = egraph.add(SymbolLang::leaf("x.9"));
    let n10 = egraph.add(SymbolLang::new("Constant", vec![n9]));
    let n11 = egraph.add(SymbolLang::leaf("x.11"));
    let n12 = egraph.add(SymbolLang::new("Constant", vec![n11]));
    let n13 = egraph.add(SymbolLang::leaf("x.13"));
    let n14 = egraph.add(SymbolLang::new("Constant", vec![n13]));
    let n15 = egraph.add(SymbolLang::leaf("x.15"));
    let n16 = egraph.add(SymbolLang::new("Constant", vec![n15]));
    let n17 = egraph.add(SymbolLang::leaf("x.17"));
    let n18 = egraph.add(SymbolLang::new("Constant", vec![n17]));
    let n19 = egraph.add(SymbolLang::leaf("x.19"));
    let n20 = egraph.add(SymbolLang::new("Constant", vec![n19]));
    let n21 = egraph.add(SymbolLang::leaf("x.21"));
    let n22 = egraph.add(SymbolLang::new("Constant", vec![n21]));
    let n23 = egraph.add(SymbolLang::leaf("x.23"));
    let n24 = egraph.add(SymbolLang::new("Constant", vec![n23]));
    let n25 = egraph.add(SymbolLang::leaf("x.25"));
    let n26 = egraph.add(SymbolLang::new("Constant", vec![n25]));
    let n27 = egraph.add(SymbolLang::leaf("x.27"));
    let n28 = egraph.add(SymbolLang::new("Constant", vec![n27]));
    let n29 = egraph.add(SymbolLang::leaf("x.29"));
    let n30 = egraph.add(SymbolLang::new("Constant", vec![n29]));
    let n31 = egraph.add(SymbolLang::leaf("x.31"));
    let n32 = egraph.add(SymbolLang::new("Constant", vec![n31]));
    let n33 = egraph.add(SymbolLang::leaf("x.33"));
    let n34 = egraph.add(SymbolLang::new("Constant", vec![n33]));
    let n35 = egraph.add(SymbolLang::leaf("x.35"));
    let n36 = egraph.add(SymbolLang::new("Constant", vec![n35]));
    let n37 = egraph.add(SymbolLang::leaf("x.37"));
    let n38 = egraph.add(SymbolLang::new("Constant", vec![n37]));
    let n39 = egraph.add(SymbolLang::leaf("x.39"));
    let n40 = egraph.add(SymbolLang::new("Constant", vec![n39]));
    let n41 = egraph.add(SymbolLang::leaf("x.41"));
    let n42 = egraph.add(SymbolLang::new("Constant", vec![n41]));
    let n43 = egraph.add(SymbolLang::leaf("x.43"));
    let n44 = egraph.add(SymbolLang::new("Constant", vec![n43]));
    let n45 = egraph.add(SymbolLang::leaf("x.45"));
    let n46 = egraph.add(SymbolLang::new("Constant", vec![n45]));
    let n47 = egraph.add(SymbolLang::leaf("x.47"));
    let n48 = egraph.add(SymbolLang::new("Constant", vec![n47]));
    let n49 = egraph.add(SymbolLang::leaf("x.49"));
    let n50 = egraph.add(SymbolLang::new("Constant", vec![n49]));
    let n51 = egraph.add(SymbolLang::leaf("x.51"));
    let n52 = egraph.add(SymbolLang::new("Constant", vec![n51]));
    let n53 = egraph.add(SymbolLang::leaf("x.53"));
    let n54 = egraph.add(SymbolLang::new("Constant", vec![n53]));
    let n55 = egraph.add(SymbolLang::leaf("x.55"));
    let n56 = egraph.add(SymbolLang::new("Constant", vec![n55]));
    let n57 = egraph.add(SymbolLang::leaf("x.57"));
    let n58 = egraph.add(SymbolLang::new("Constant", vec![n57]));
    let n59 = egraph.add(SymbolLang::leaf("x.59"));
    let n60 = egraph.add(SymbolLang::new("Constant", vec![n59]));
    let n61 = egraph.add(SymbolLang::leaf("x.61"));
    let n62 = egraph.add(SymbolLang::new("Constant", vec![n61]));
    let n63 = egraph.add(SymbolLang::leaf("x.63"));
    let n64 = egraph.add(SymbolLang::new("Constant", vec![n63]));
    let n65 = egraph.add(SymbolLang::leaf("x.65"));
    let n66 = egraph.add(SymbolLang::new("Constant", vec![n65]));
    let n67 = egraph.add(SymbolLang::leaf("x.67"));
    let n68 = egraph.add(SymbolLang::new("Constant", vec![n67]));
    let n69 = egraph.add(SymbolLang::leaf("x.69"));
    let n70 = egraph.add(SymbolLang::new("Constant", vec![n69]));
    let n71 = egraph.add(SymbolLang::leaf("x.71"));
    let n72 = egraph.add(SymbolLang::new("Constant", vec![n71]));
    let n73 = egraph.add(SymbolLang::leaf("x.73"));
    let n74 = egraph.add(SymbolLang::new("Constant", vec![n73]));
    let n75 = egraph.add(SymbolLang::leaf("x.75"));
    let n76 = egraph.add(SymbolLang::new("Constant", vec![n75]));
    let n77 = egraph.add(SymbolLang::leaf("x.77"));
    let n78 = egraph.add(SymbolLang::new("Constant", vec![n77]));
    let n79 = egraph.add(SymbolLang::leaf("x.79"));
    let n80 = egraph.add(SymbolLang::new("Constant", vec![n79]));
    let n81 = egraph.add(SymbolLang::leaf("x.81"));
    let n82 = egraph.add(SymbolLang::new("Constant", vec![n81]));
    let n83 = egraph.add(SymbolLang::leaf("x.83"));
    let n84 = egraph.add(SymbolLang::new("Constant", vec![n83]));
    let n85 = egraph.add(SymbolLang::leaf("x.85"));
    let n86 = egraph.add(SymbolLang::new("Constant", vec![n85]));
    let n87 = egraph.add(SymbolLang::leaf("x.87"));
    let n88 = egraph.add(SymbolLang::new("Constant", vec![n87]));
    let n89 = egraph.add(SymbolLang::leaf("x.89"));
    let n90 = egraph.add(SymbolLang::new("Constant", vec![n89]));
    let n91 = egraph.add(SymbolLang::leaf("x.91"));
    let n92 = egraph.add(SymbolLang::new("Constant", vec![n91]));
    let n93 = egraph.add(SymbolLang::leaf("x.93"));
    let n94 = egraph.add(SymbolLang::new("Constant", vec![n93]));
    let n95 = egraph.add(SymbolLang::leaf("x.95"));
    let n96 = egraph.add(SymbolLang::new("Constant", vec![n95]));
    let n97 = egraph.add(SymbolLang::leaf("x.97"));
    let n98 = egraph.add(SymbolLang::new("Constant", vec![n97]));
    let n99 = egraph.add(SymbolLang::leaf("x.99"));
    let n100 = egraph.add(SymbolLang::new("Constant", vec![n99]));
    let n101 = egraph.add(SymbolLang::leaf("x.101"));
    let n102 = egraph.add(SymbolLang::new("Constant", vec![n101]));
    let n103 = egraph.add(SymbolLang::leaf("x.103"));
    let n104 = egraph.add(SymbolLang::new("Constant", vec![n103]));
    let n105 = egraph.add(SymbolLang::leaf("x.105"));
    let n106 = egraph.add(SymbolLang::new("Constant", vec![n105]));
    let n107 = egraph.add(SymbolLang::leaf("x.107"));
    let n108 = egraph.add(SymbolLang::new("Constant", vec![n107]));
    let n109 = egraph.add(SymbolLang::leaf("x.109"));
    let n110 = egraph.add(SymbolLang::new("Constant", vec![n109]));
    let n111 = egraph.add(SymbolLang::leaf("x.111"));
    let n112 = egraph.add(SymbolLang::new("Constant", vec![n111]));
    let n113 = egraph.add(SymbolLang::leaf("x.113"));
    let n114 = egraph.add(SymbolLang::new("Constant", vec![n113]));
    let n115 = egraph.add(SymbolLang::leaf("x.115"));
    let n116 = egraph.add(SymbolLang::new("Constant", vec![n115]));
    let n117 = egraph.add(SymbolLang::leaf("x.117"));
    let n118 = egraph.add(SymbolLang::new("Constant", vec![n117]));
    let n119 = egraph.add(SymbolLang::leaf("x.119"));
    let n120 = egraph.add(SymbolLang::new("Constant", vec![n119]));
    let n121 = egraph.add(SymbolLang::leaf("x.121"));
    let n122 = egraph.add(SymbolLang::new("Constant", vec![n121]));
    let n123 = egraph.add(SymbolLang::leaf("x.123"));
    let n124 = egraph.add(SymbolLang::new("Constant", vec![n123]));
    let n125 = egraph.add(SymbolLang::leaf("x.125"));
    let n126 = egraph.add(SymbolLang::new("Constant", vec![n125]));
    let n127 = egraph.add(SymbolLang::leaf("x.127"));
    let n128 = egraph.add(SymbolLang::new("Constant", vec![n127]));
    let n129 = egraph.add(SymbolLang::leaf("x.129"));
    let n130 = egraph.add(SymbolLang::new("Constant", vec![n129]));
    let n131 = egraph.add(SymbolLang::leaf("x.131"));
    let n132 = egraph.add(SymbolLang::new("Constant", vec![n131]));
    let n133 = egraph.add(SymbolLang::leaf("x.133"));
    let n134 = egraph.add(SymbolLang::new("Constant", vec![n133]));
    let n135 = egraph.add(SymbolLang::leaf("x.135"));
    let n136 = egraph.add(SymbolLang::new("Constant", vec![n135]));
    let n137 = egraph.add(SymbolLang::leaf("x.137"));
    let n138 = egraph.add(SymbolLang::new("Constant", vec![n137]));
    let n139 = egraph.add(SymbolLang::leaf("x.139"));
    let n140 = egraph.add(SymbolLang::new("Constant", vec![n139]));
    let n141 = egraph.add(SymbolLang::leaf("x.141"));
    let n142 = egraph.add(SymbolLang::new("Constant", vec![n141]));
    let n143 = egraph.add(SymbolLang::leaf("x.143"));
    let n144 = egraph.add(SymbolLang::new("Constant", vec![n143]));
    let n145 = egraph.add(SymbolLang::leaf("x.145"));
    let n146 = egraph.add(SymbolLang::new("Constant", vec![n145]));
    let n147 = egraph.add(SymbolLang::leaf("x.147"));
    let n148 = egraph.add(SymbolLang::new("Constant", vec![n147]));
    let n149 = egraph.add(SymbolLang::leaf("x.149"));
    let n150 = egraph.add(SymbolLang::new("Constant", vec![n149]));
    let n151 = egraph.add(SymbolLang::leaf("x.151"));
    let n152 = egraph.add(SymbolLang::new("Constant", vec![n151]));
    let n153 = egraph.add(SymbolLang::leaf("x.153"));
    let n154 = egraph.add(SymbolLang::new("Constant", vec![n153]));
    let n155 = egraph.add(SymbolLang::leaf("x.155"));
    let n156 = egraph.add(SymbolLang::new("Constant", vec![n155]));
    let n157 = egraph.add(SymbolLang::leaf("x.157"));
    let n158 = egraph.add(SymbolLang::new("Constant", vec![n157]));
    let n159 = egraph.add(SymbolLang::leaf("x.159"));
    let n160 = egraph.add(SymbolLang::new("Constant", vec![n159]));
    let n161 = egraph.add(SymbolLang::leaf("x.161"));
    let n162 = egraph.add(SymbolLang::new("Constant", vec![n161]));
    let n163 = egraph.add(SymbolLang::leaf("x.163"));
    let n164 = egraph.add(SymbolLang::new("Constant", vec![n163]));
    let n165 = egraph.add(SymbolLang::leaf("x.165"));
    let n166 = egraph.add(SymbolLang::new("Constant", vec![n165]));
    let n167 = egraph.add(SymbolLang::leaf("x.167"));
    let n168 = egraph.add(SymbolLang::new("Constant", vec![n167]));
    let n169 = egraph.add(SymbolLang::leaf("x.169"));
    let n170 = egraph.add(SymbolLang::new("Constant", vec![n169]));
    let n171 = egraph.add(SymbolLang::leaf("x.171"));
    let n172 = egraph.add(SymbolLang::new("Constant", vec![n171]));
    let n173 = egraph.add(SymbolLang::leaf("x.173"));
    let n174 = egraph.add(SymbolLang::new("Constant", vec![n173]));
    let n175 = egraph.add(SymbolLang::leaf("x.175"));
    let n176 = egraph.add(SymbolLang::new("Constant", vec![n175]));
    let n177 = egraph.add(SymbolLang::leaf("x.177"));
    let n178 = egraph.add(SymbolLang::new("Constant", vec![n177]));
    let n179 = egraph.add(SymbolLang::leaf("x.179"));
    let n180 = egraph.add(SymbolLang::new("Constant", vec![n179]));
    let n181 = egraph.add(SymbolLang::leaf("x.181"));
    let n182 = egraph.add(SymbolLang::new("Constant", vec![n181]));
    let n183 = egraph.add(SymbolLang::leaf("x.183"));
    let n184 = egraph.add(SymbolLang::new("Constant", vec![n183]));
    let n185 = egraph.add(SymbolLang::leaf("x.185"));
    let n186 = egraph.add(SymbolLang::new("Constant", vec![n185]));
    let n187 = egraph.add(SymbolLang::leaf("x.187"));
    let n188 = egraph.add(SymbolLang::new("Constant", vec![n187]));
    let n189 = egraph.add(SymbolLang::leaf("x.189"));
    let n190 = egraph.add(SymbolLang::new("Constant", vec![n189]));
    let n191 = egraph.add(SymbolLang::leaf("x.191"));
    let n192 = egraph.add(SymbolLang::new("Constant", vec![n191]));
    let n193 = egraph.add(SymbolLang::leaf("x.193"));
    let n194 = egraph.add(SymbolLang::new("Constant", vec![n193]));
    let n195 = egraph.add(SymbolLang::leaf("x.195"));
    let n196 = egraph.add(SymbolLang::new("Constant", vec![n195]));
    let n197 = egraph.add(SymbolLang::leaf("x.197"));
    let n198 = egraph.add(SymbolLang::new("Constant", vec![n197]));
    let n199 = egraph.add(SymbolLang::leaf("x.199"));
    let n200 = egraph.add(SymbolLang::new("Constant", vec![n199]));
    let n201 = egraph.add(SymbolLang::leaf("x.201"));
    let n202 = egraph.add(SymbolLang::new("Constant", vec![n201]));
    let n203 = egraph.add(SymbolLang::leaf("x.203"));
    let n204 = egraph.add(SymbolLang::new("Constant", vec![n203]));
    let n205 = egraph.add(SymbolLang::leaf("x.205"));
    let n206 = egraph.add(SymbolLang::new("Constant", vec![n205]));
    let n207 = egraph.add(SymbolLang::leaf("x.207"));
    let n208 = egraph.add(SymbolLang::new("Constant", vec![n207]));
    let n209 = egraph.add(SymbolLang::leaf("x.209"));
    let n210 = egraph.add(SymbolLang::new("Constant", vec![n209]));
    let n211 = egraph.add(SymbolLang::leaf("x.211"));
    let n212 = egraph.add(SymbolLang::new("Constant", vec![n211]));
    let n213 = egraph.add(SymbolLang::leaf("x.213"));
    let n214 = egraph.add(SymbolLang::new("Constant", vec![n213]));
    let n215 = egraph.add(SymbolLang::leaf("x.215"));
    let n216 = egraph.add(SymbolLang::new("Constant", vec![n215]));
    let n217 = egraph.add(SymbolLang::leaf("x.217"));
    let n218 = egraph.add(SymbolLang::new("Constant", vec![n217]));
    let n219 = egraph.add(SymbolLang::leaf("x.219"));
    let n220 = egraph.add(SymbolLang::new("Constant", vec![n219]));
    let n221 = egraph.add(SymbolLang::leaf("x.221"));
    let n222 = egraph.add(SymbolLang::new("Constant", vec![n221]));
    let n223 = egraph.add(SymbolLang::leaf("x.223"));
    let n224 = egraph.add(SymbolLang::new("Constant", vec![n223]));
    let n225 = egraph.add(SymbolLang::leaf("x.225"));
    let n226 = egraph.add(SymbolLang::new("Constant", vec![n225]));
    let n227 = egraph.add(SymbolLang::leaf("x.227"));
    let n228 = egraph.add(SymbolLang::new("Constant", vec![n227]));
    let n229 = egraph.add(SymbolLang::leaf("x.229"));
    let n230 = egraph.add(SymbolLang::new("Constant", vec![n229]));
    let n231 = egraph.add(SymbolLang::leaf("x.231"));
    let n232 = egraph.add(SymbolLang::new("Constant", vec![n231]));
    let n233 = egraph.add(SymbolLang::leaf("x.233"));
    let n234 = egraph.add(SymbolLang::new("Constant", vec![n233]));
    let n235 = egraph.add(SymbolLang::leaf("x.235"));
    let n236 = egraph.add(SymbolLang::new("Constant", vec![n235]));
    let n237 = egraph.add(SymbolLang::leaf("x.237"));
    let n238 = egraph.add(SymbolLang::new("Constant", vec![n237]));
    let n239 = egraph.add(SymbolLang::leaf("x.239"));
    let n240 = egraph.add(SymbolLang::new("Constant", vec![n239]));
    let n241 = egraph.add(SymbolLang::leaf("x.241"));
    let n242 = egraph.add(SymbolLang::new("Constant", vec![n241]));
    let n243 = egraph.add(SymbolLang::leaf("x.243"));
    let n244 = egraph.add(SymbolLang::new("Constant", vec![n243]));
    let n245 = egraph.add(SymbolLang::leaf("x.245"));
    let n246 = egraph.add(SymbolLang::new("Constant", vec![n245]));
    let n247 = egraph.add(SymbolLang::leaf("x.247"));
    let n248 = egraph.add(SymbolLang::new("Constant", vec![n247]));
    let n249 = egraph.add(SymbolLang::leaf("x.249"));
    let n250 = egraph.add(SymbolLang::new("Constant", vec![n249]));
    let n251 = egraph.add(SymbolLang::leaf("x.251"));
    let n252 = egraph.add(SymbolLang::new("Constant", vec![n251]));
    let n253 = egraph.add(SymbolLang::leaf("x.253"));
    let n254 = egraph.add(SymbolLang::new("Constant", vec![n253]));
    let n255 = egraph.add(SymbolLang::leaf("x.255"));
    let n256 = egraph.add(SymbolLang::new("Constant", vec![n255]));
    let n257 = egraph.add(SymbolLang::leaf("x.257"));
    let n258 = egraph.add(SymbolLang::new("Constant", vec![n257]));
    let n259 = egraph.add(SymbolLang::leaf("x.259"));
    let n260 = egraph.add(SymbolLang::new("Constant", vec![n259]));
    let n261 = egraph.add(SymbolLang::leaf("x.261"));
    let n262 = egraph.add(SymbolLang::new("Constant", vec![n261]));
    let n263 = egraph.add(SymbolLang::leaf("x.263"));
    let n264 = egraph.add(SymbolLang::new("Constant", vec![n263]));
    let n265 = egraph.add(SymbolLang::leaf("x.265"));
    let n266 = egraph.add(SymbolLang::new("Constant", vec![n265]));
    let n267 = egraph.add(SymbolLang::leaf("x.267"));
    let n268 = egraph.add(SymbolLang::new("Constant", vec![n267]));
    let n269 = egraph.add(SymbolLang::leaf("x.269"));
    let n270 = egraph.add(SymbolLang::new("Constant", vec![n269]));
    let n271 = egraph.add(SymbolLang::leaf("x.271"));
    let n272 = egraph.add(SymbolLang::new("Constant", vec![n271]));
    let n273 = egraph.add(SymbolLang::leaf("x.273"));
    let n274 = egraph.add(SymbolLang::new("Constant", vec![n273]));
    let n275 = egraph.add(SymbolLang::leaf("x.275"));
    let n276 = egraph.add(SymbolLang::new("Constant", vec![n275]));
    let n277 = egraph.add(SymbolLang::leaf("x.277"));
    let n278 = egraph.add(SymbolLang::new("Constant", vec![n277]));
    let n279 = egraph.add(SymbolLang::leaf("x.279"));
    let n280 = egraph.add(SymbolLang::new("Constant", vec![n279]));
    let n281 = egraph.add(SymbolLang::leaf("x.281"));
    let n282 = egraph.add(SymbolLang::new("Constant", vec![n281]));
    let n283 = egraph.add(SymbolLang::leaf("x.283"));
    let n284 = egraph.add(SymbolLang::new("Constant", vec![n283]));
    let n285 = egraph.add(SymbolLang::leaf("x.285"));
    let n286 = egraph.add(SymbolLang::new("Constant", vec![n285]));
    let n287 = egraph.add(SymbolLang::leaf("x.287"));
    let n288 = egraph.add(SymbolLang::new("Constant", vec![n287]));
    let n289 = egraph.add(SymbolLang::leaf("x.289"));
    let n290 = egraph.add(SymbolLang::new("Constant", vec![n289]));
    let n291 = egraph.add(SymbolLang::leaf("x.291"));
    let n292 = egraph.add(SymbolLang::new("Constant", vec![n291]));
    let n293 = egraph.add(SymbolLang::leaf("x.293"));
    let n294 = egraph.add(SymbolLang::new("Constant", vec![n293]));
    let n295 = egraph.add(SymbolLang::leaf("x.295"));
    let n296 = egraph.add(SymbolLang::new("Constant", vec![n295]));
    let n297 = egraph.add(SymbolLang::leaf("x.297"));
    let n298 = egraph.add(SymbolLang::new("Constant", vec![n297]));
    let n299 = egraph.add(SymbolLang::leaf("x.299"));
    let n300 = egraph.add(SymbolLang::new("Constant", vec![n299]));
    let n301 = egraph.add(SymbolLang::leaf("x.301"));
    let n302 = egraph.add(SymbolLang::new("Constant", vec![n301]));
    let n303 = egraph.add(SymbolLang::leaf("x.303"));
    let n304 = egraph.add(SymbolLang::new("Constant", vec![n303]));
    let n305 = egraph.add(SymbolLang::leaf("x.305"));
    let n306 = egraph.add(SymbolLang::new("Constant", vec![n305]));
    let n307 = egraph.add(SymbolLang::leaf("x.307"));
    let n308 = egraph.add(SymbolLang::new("Constant", vec![n307]));
    let n309 = egraph.add(SymbolLang::leaf("x.309"));
    let n310 = egraph.add(SymbolLang::new("Constant", vec![n309]));
    let n311 = egraph.add(SymbolLang::leaf("x.311"));
    let n312 = egraph.add(SymbolLang::new("Constant", vec![n311]));
    let n313 = egraph.add(SymbolLang::leaf("x.313"));
    let n314 = egraph.add(SymbolLang::new("Constant", vec![n313]));
    let n315 = egraph.add(SymbolLang::leaf("x.315"));
    let n316 = egraph.add(SymbolLang::new("Constant", vec![n315]));
    let n317 = egraph.add(SymbolLang::leaf("x.317"));
    let n318 = egraph.add(SymbolLang::new("Constant", vec![n317]));
    let n319 = egraph.add(SymbolLang::leaf("x.319"));
    let n320 = egraph.add(SymbolLang::new("Constant", vec![n319]));
    let n321 = egraph.add(SymbolLang::leaf("x.321"));
    let n322 = egraph.add(SymbolLang::new("Constant", vec![n321]));
    let n323 = egraph.add(SymbolLang::leaf("x.323"));
    let n324 = egraph.add(SymbolLang::new("Constant", vec![n323]));
    let n325 = egraph.add(SymbolLang::leaf("x.325"));
    let n326 = egraph.add(SymbolLang::new("Constant", vec![n325]));
    let n327 = egraph.add(SymbolLang::leaf("x.327"));
    let n328 = egraph.add(SymbolLang::new("Constant", vec![n327]));
    let n329 = egraph.add(SymbolLang::leaf("x.329"));
    let n330 = egraph.add(SymbolLang::new("Constant", vec![n329]));
    let n331 = egraph.add(SymbolLang::leaf("x.331"));
    let n332 = egraph.add(SymbolLang::new("Constant", vec![n331]));
    let n333 = egraph.add(SymbolLang::leaf("x.333"));
    let n334 = egraph.add(SymbolLang::new("Constant", vec![n333]));
    let n335 = egraph.add(SymbolLang::leaf("x.335"));
    let n336 = egraph.add(SymbolLang::new("Constant", vec![n335]));
    let n337 = egraph.add(SymbolLang::leaf("x.337"));
    let n338 = egraph.add(SymbolLang::new("Constant", vec![n337]));
    let n339 = egraph.add(SymbolLang::leaf("x.339"));
    let n340 = egraph.add(SymbolLang::new("Constant", vec![n339]));
    let n341 = egraph.add(SymbolLang::leaf("x.341"));
    let n342 = egraph.add(SymbolLang::new("Constant", vec![n341]));
    let n343 = egraph.add(SymbolLang::leaf("x.343"));
    let n344 = egraph.add(SymbolLang::new("Constant", vec![n343]));
    let n345 = egraph.add(SymbolLang::leaf("x.345"));
    let n346 = egraph.add(SymbolLang::new("Constant", vec![n345]));
    let n347 = egraph.add(SymbolLang::leaf("x.347"));
    let n348 = egraph.add(SymbolLang::new("Constant", vec![n347]));
    let n349 = egraph.add(SymbolLang::leaf("x.349"));
    let n350 = egraph.add(SymbolLang::new("Constant", vec![n349]));
    let n351 = egraph.add(SymbolLang::leaf("x.351"));
    let n352 = egraph.add(SymbolLang::new("Constant", vec![n351]));
    let n353 = egraph.add(SymbolLang::leaf("x.353"));
    let n354 = egraph.add(SymbolLang::new("Constant", vec![n353]));
    let n355 = egraph.add(SymbolLang::leaf("x.355"));
    let n356 = egraph.add(SymbolLang::new("Constant", vec![n355]));
    let n357 = egraph.add(SymbolLang::leaf("x.357"));
    let n358 = egraph.add(SymbolLang::new("Constant", vec![n357]));
    let n359 = egraph.add(SymbolLang::leaf("x.359"));
    let n360 = egraph.add(SymbolLang::new("Constant", vec![n359]));
    let n361 = egraph.add(SymbolLang::leaf("x.361"));
    let n362 = egraph.add(SymbolLang::new("Constant", vec![n361]));
    let n363 = egraph.add(SymbolLang::leaf("x.363"));
    let n364 = egraph.add(SymbolLang::new("Constant", vec![n363]));
    let n365 = egraph.add(SymbolLang::leaf("x.365"));
    let n366 = egraph.add(SymbolLang::new("Constant", vec![n365]));
    let n367 = egraph.add(SymbolLang::leaf("x.367"));
    let n368 = egraph.add(SymbolLang::new("Constant", vec![n367]));
    let n369 = egraph.add(SymbolLang::leaf("x.369"));
    let n370 = egraph.add(SymbolLang::new("Constant", vec![n369]));
    let n371 = egraph.add(SymbolLang::leaf("x.371"));
    let n372 = egraph.add(SymbolLang::new("Constant", vec![n371]));
    let n373 = egraph.add(SymbolLang::leaf("x.373"));
    let n374 = egraph.add(SymbolLang::new("Constant", vec![n373]));
    let n375 = egraph.add(SymbolLang::leaf("x.375"));
    let n376 = egraph.add(SymbolLang::new("Constant", vec![n375]));
    let n377 = egraph.add(SymbolLang::leaf("x.377"));
    let n378 = egraph.add(SymbolLang::new("Constant", vec![n377]));
    let n379 = egraph.add(SymbolLang::leaf("x.379"));
    let n380 = egraph.add(SymbolLang::new("Constant", vec![n379]));
    let n381 = egraph.add(SymbolLang::leaf("x.381"));
    let n382 = egraph.add(SymbolLang::new("Constant", vec![n381]));
    let n383 = egraph.add(SymbolLang::leaf("x.383"));
    let n384 = egraph.add(SymbolLang::new("Constant", vec![n383]));
    let n385 = egraph.add(SymbolLang::leaf("x.385"));
    let n386 = egraph.add(SymbolLang::new("Constant", vec![n385]));
    let n387 = egraph.add(SymbolLang::leaf("x.387"));
    let n388 = egraph.add(SymbolLang::new("Constant", vec![n387]));
    let n389 = egraph.add(SymbolLang::leaf("x.389"));
    let n390 = egraph.add(SymbolLang::new("Constant", vec![n389]));
    let n391 = egraph.add(SymbolLang::leaf("x.391"));
    let n392 = egraph.add(SymbolLang::new("Constant", vec![n391]));
    let n393 = egraph.add(SymbolLang::leaf("x.393"));
    let n394 = egraph.add(SymbolLang::new("Constant", vec![n393]));
    let n395 = egraph.add(SymbolLang::leaf("x.395"));
    let n396 = egraph.add(SymbolLang::new("Constant", vec![n395]));
    let n397 = egraph.add(SymbolLang::leaf("x.397"));
    let n398 = egraph.add(SymbolLang::new("Constant", vec![n397]));
    let n399 = egraph.add(SymbolLang::leaf("x.399"));
    let n400 = egraph.add(SymbolLang::new("Constant", vec![n399]));
    let n401 = egraph.add(SymbolLang::leaf("x.401"));
    let n402 = egraph.add(SymbolLang::new("Constant", vec![n401]));
    let n403 = egraph.add(SymbolLang::leaf("x.403"));
    let n404 = egraph.add(SymbolLang::new("Constant", vec![n403]));
    let n405 = egraph.add(SymbolLang::leaf("x.405"));
    let n406 = egraph.add(SymbolLang::new("Constant", vec![n405]));
    let n407 = egraph.add(SymbolLang::leaf("x.407"));
    let n408 = egraph.add(SymbolLang::new("Constant", vec![n407]));
    let n409 = egraph.add(SymbolLang::leaf("x.409"));
    let n410 = egraph.add(SymbolLang::new("Constant", vec![n409]));
    let n411 = egraph.add(SymbolLang::leaf("x.411"));
    let n412 = egraph.add(SymbolLang::new("Constant", vec![n411]));
    let n413 = egraph.add(SymbolLang::leaf("x.413"));
    let n414 = egraph.add(SymbolLang::new("Constant", vec![n413]));
    let n415 = egraph.add(SymbolLang::leaf("x.415"));
    let n416 = egraph.add(SymbolLang::new("Constant", vec![n415]));
    let n417 = egraph.add(SymbolLang::leaf("x.417"));
    let n418 = egraph.add(SymbolLang::new("Constant", vec![n417]));
    let n419 = egraph.add(SymbolLang::leaf("x.419"));
    let n420 = egraph.add(SymbolLang::new("Constant", vec![n419]));
    let n421 = egraph.add(SymbolLang::leaf("x.421"));
    let n422 = egraph.add(SymbolLang::new("Constant", vec![n421]));
    let n423 = egraph.add(SymbolLang::leaf("x.423"));
    let n424 = egraph.add(SymbolLang::new("Constant", vec![n423]));
    let n425 = egraph.add(SymbolLang::leaf("x.425"));
    let n426 = egraph.add(SymbolLang::new("Constant", vec![n425]));
    let n427 = egraph.add(SymbolLang::leaf("x.427"));
    let n428 = egraph.add(SymbolLang::new("Constant", vec![n427]));
    let n429 = egraph.add(SymbolLang::leaf("x.429"));
    let n430 = egraph.add(SymbolLang::new("Constant", vec![n429]));
    let n431 = egraph.add(SymbolLang::leaf("x.431"));
    let n432 = egraph.add(SymbolLang::new("Constant", vec![n431]));
    let n433 = egraph.add(SymbolLang::leaf("x.433"));
    let n434 = egraph.add(SymbolLang::new("Constant", vec![n433]));
    let n435 = egraph.add(SymbolLang::leaf("x.435"));
    let n436 = egraph.add(SymbolLang::new("Constant", vec![n435]));
    let n437 = egraph.add(SymbolLang::leaf("x.437"));
    let n438 = egraph.add(SymbolLang::new("Constant", vec![n437]));
    let n439 = egraph.add(SymbolLang::leaf("x.439"));
    let n440 = egraph.add(SymbolLang::new("Constant", vec![n439]));
    let n441 = egraph.add(SymbolLang::leaf("x.441"));
    let n442 = egraph.add(SymbolLang::new("Constant", vec![n441]));
    let n443 = egraph.add(SymbolLang::leaf("x.443"));
    let n444 = egraph.add(SymbolLang::new("Constant", vec![n443]));
    let n445 = egraph.add(SymbolLang::leaf("x.445"));
    let n446 = egraph.add(SymbolLang::new("Constant", vec![n445]));
    let n447 = egraph.add(SymbolLang::leaf("x.447"));
    let n448 = egraph.add(SymbolLang::new("Constant", vec![n447]));
    let n449 = egraph.add(SymbolLang::leaf("x.449"));
    let n450 = egraph.add(SymbolLang::new("Constant", vec![n449]));
    let n451 = egraph.add(SymbolLang::leaf("x.451"));
    let n452 = egraph.add(SymbolLang::new("Constant", vec![n451]));
    let n453 = egraph.add(SymbolLang::leaf("x.453"));
    let n454 = egraph.add(SymbolLang::new("Constant", vec![n453]));
    let n455 = egraph.add(SymbolLang::leaf("x.455"));
    let n456 = egraph.add(SymbolLang::new("Constant", vec![n455]));
    let n457 = egraph.add(SymbolLang::leaf("x.457"));
    let n458 = egraph.add(SymbolLang::new("Constant", vec![n457]));
    let n459 = egraph.add(SymbolLang::leaf("x.459"));
    let n460 = egraph.add(SymbolLang::new("Constant", vec![n459]));
    let n461 = egraph.add(SymbolLang::leaf("x.461"));
    let n462 = egraph.add(SymbolLang::new("Constant", vec![n461]));
    let n463 = egraph.add(SymbolLang::leaf("x.463"));
    let n464 = egraph.add(SymbolLang::new("Constant", vec![n463]));
    let n465 = egraph.add(SymbolLang::leaf("x.465"));
    let n466 = egraph.add(SymbolLang::new("Constant", vec![n465]));
    let n467 = egraph.add(SymbolLang::leaf("x.467"));
    let n468 = egraph.add(SymbolLang::new("Constant", vec![n467]));
    let n469 = egraph.add(SymbolLang::leaf("x.469"));
    let n470 = egraph.add(SymbolLang::new("Constant", vec![n469]));
    let n471 = egraph.add(SymbolLang::leaf("x.471"));
    let n472 = egraph.add(SymbolLang::new("Constant", vec![n471]));
    let n473 = egraph.add(SymbolLang::leaf("x.473"));
    let n474 = egraph.add(SymbolLang::new("Constant", vec![n473]));
    let n475 = egraph.add(SymbolLang::leaf("x.475"));
    let n476 = egraph.add(SymbolLang::new("Constant", vec![n475]));
    let n477 = egraph.add(SymbolLang::leaf("x.477"));
    let n478 = egraph.add(SymbolLang::new("Constant", vec![n477]));
    let n479 = egraph.add(SymbolLang::leaf("x.479"));
    let n480 = egraph.add(SymbolLang::new("Constant", vec![n479]));
    let n481 = egraph.add(SymbolLang::leaf("x.481"));
    let n482 = egraph.add(SymbolLang::new("Constant", vec![n481]));
    let n483 = egraph.add(SymbolLang::leaf("x.483"));
    let n484 = egraph.add(SymbolLang::new("Constant", vec![n483]));
    let n485 = egraph.add(SymbolLang::leaf("x.485"));
    let n486 = egraph.add(SymbolLang::new("Constant", vec![n485]));
    let n487 = egraph.add(SymbolLang::leaf("x.487"));
    let n488 = egraph.add(SymbolLang::new("Constant", vec![n487]));
    let n489 = egraph.add(SymbolLang::leaf("x.489"));
    let n490 = egraph.add(SymbolLang::new("Constant", vec![n489]));
    let n491 = egraph.add(SymbolLang::leaf("x.491"));
    let n492 = egraph.add(SymbolLang::new("Constant", vec![n491]));
    let n493 = egraph.add(SymbolLang::leaf("x.493"));
    let n494 = egraph.add(SymbolLang::new("Constant", vec![n493]));
    let n495 = egraph.add(SymbolLang::leaf("x.495"));
    let n496 = egraph.add(SymbolLang::new("Constant", vec![n495]));
    let n497 = egraph.add(SymbolLang::leaf("x.497"));
    let n498 = egraph.add(SymbolLang::new("Constant", vec![n497]));
    let n499 = egraph.add(SymbolLang::leaf("x.499"));
    let n500 = egraph.add(SymbolLang::new("Constant", vec![n499]));
    let n501 = egraph.add(SymbolLang::leaf("x.501"));
    let n502 = egraph.add(SymbolLang::new("Constant", vec![n501]));
    let n503 = egraph.add(SymbolLang::leaf("x.503"));
    let n504 = egraph.add(SymbolLang::new("Constant", vec![n503]));
    let n505 = egraph.add(SymbolLang::leaf("x.505"));
    let n506 = egraph.add(SymbolLang::new("Constant", vec![n505]));
    let n507 = egraph.add(SymbolLang::leaf("x.507"));
    let n508 = egraph.add(SymbolLang::new("Constant", vec![n507]));
    let n509 = egraph.add(SymbolLang::leaf("x.509"));
    let n510 = egraph.add(SymbolLang::new("Constant", vec![n509]));
    let n511 = egraph.add(SymbolLang::leaf("x.511"));
    let n512 = egraph.add(SymbolLang::new("Constant", vec![n511]));
    let n513 = egraph.add(SymbolLang::leaf("x.513"));
    let n514 = egraph.add(SymbolLang::new("Constant", vec![n513]));
    let n515 = egraph.add(SymbolLang::leaf("x.515"));
    let n516 = egraph.add(SymbolLang::new("Constant", vec![n515]));
    let n517 = egraph.add(SymbolLang::leaf("x.517"));
    let n518 = egraph.add(SymbolLang::new("Constant", vec![n517]));
    let n519 = egraph.add(SymbolLang::leaf("x.519"));
    let n520 = egraph.add(SymbolLang::new("Constant", vec![n519]));
    let n521 = egraph.add(SymbolLang::leaf("x.521"));
    let n522 = egraph.add(SymbolLang::new("Constant", vec![n521]));
    let n523 = egraph.add(SymbolLang::leaf("x.523"));
    let n524 = egraph.add(SymbolLang::new("Constant", vec![n523]));
    let n525 = egraph.add(SymbolLang::leaf("x.525"));
    let n526 = egraph.add(SymbolLang::new("Constant", vec![n525]));
    let n527 = egraph.add(SymbolLang::leaf("x.527"));
    let n528 = egraph.add(SymbolLang::new("Constant", vec![n527]));
    let n529 = egraph.add(SymbolLang::leaf("x.529"));
    let n530 = egraph.add(SymbolLang::new("Constant", vec![n529]));
    let n531 = egraph.add(SymbolLang::leaf("x.531"));
    let n532 = egraph.add(SymbolLang::new("Constant", vec![n531]));
    let n533 = egraph.add(SymbolLang::leaf("x.533"));
    let n534 = egraph.add(SymbolLang::new("Constant", vec![n533]));
    let n535 = egraph.add(SymbolLang::leaf("x.535"));
    let n536 = egraph.add(SymbolLang::new("Constant", vec![n535]));
    let n537 = egraph.add(SymbolLang::leaf("0.018723406"));
    let n538 = egraph.add(SymbolLang::leaf("114"));
    let n539 = egraph.add(SymbolLang::new("Foo", vec![n2, n537, n538]));
    let n540 = egraph.add(SymbolLang::new("F540", vec![n539, n537, n538]));
    let n541 = egraph.add(SymbolLang::leaf("0.0061552823"));
    let n542 = egraph.add(SymbolLang::leaf("0"));
    let n543 = egraph.add(SymbolLang::new("Foo", vec![n4, n541, n542]));
    let n544 = egraph.add(SymbolLang::new("F540", vec![n543, n541, n542]));
    let n545 = egraph.add(SymbolLang::new("IntsLiteral", vec![n1, n1]));
    let n546 = egraph.add(SymbolLang::leaf("1"));
    let n547 = egraph.add(SymbolLang::new("IntsLiteral", vec![n7, n7]));
    let n548 = egraph.add(SymbolLang::new("IntsLiteral", vec![n0, n0, n0, n0]));
    let n549 = egraph.add(SymbolLang::new("IntsLiteral", vec![n2, n2]));
    let n550 = egraph.add(SymbolLang::new("F550", vec![n540, n544, n0, n545, n546, n547, n548, n549]));
    let n551 = egraph.add(SymbolLang::leaf("0.00001"));
    let n552 = egraph.add(SymbolLang::leaf("0.9"));
    let n553 = egraph.add(SymbolLang::new("F553", vec![n550, n6, n8, n10, n12, n551, n552]));
    let n554 = egraph.add(SymbolLang::new("F554", vec![n553]));
    let n555 = egraph.add(SymbolLang::leaf("0.025471387"));
    let n556 = egraph.add(SymbolLang::new("Foo", vec![n554, n555, n542]));
    let n557 = egraph.add(SymbolLang::new("F540", vec![n556, n555, n542]));
    let n558 = egraph.add(SymbolLang::new("IntsLiteral", vec![n3, n3]));
    let n559 = egraph.add(SymbolLang::new("F559", vec![n557, n546, n558, n548, n549, n0]));
    let n560 = egraph.add(SymbolLang::leaf("0.005721481"));
    let n561 = egraph.add(SymbolLang::new("Foo", vec![n14, n560, n542]));
    let n562 = egraph.add(SymbolLang::new("F540", vec![n561, n560, n542]));
    let n563 = egraph.add(SymbolLang::new("F550", vec![n559, n562, n0, n545, n546, n545, n548, n545]));
    let n564 = egraph.add(SymbolLang::new("F553", vec![n563, n16, n18, n20, n22, n551, n552]));
    let n565 = egraph.add(SymbolLang::new("F554", vec![n564]));
    let n566 = egraph.add(SymbolLang::leaf("0.008144856"));
    let n567 = egraph.add(SymbolLang::new("Foo", vec![n565, n566, n542]));
    let n568 = egraph.add(SymbolLang::new("F540", vec![n567, n566, n542]));
    let n569 = egraph.add(SymbolLang::leaf("0.0036839712"));
    let n570 = egraph.add(SymbolLang::new("Foo", vec![n24, n569, n542]));
    let n571 = egraph.add(SymbolLang::new("F540", vec![n570, n569, n542]));
    let n572 = egraph.add(SymbolLang::new("IntsLiteral", vec![n1, n1, n1, n1]));
    let n573 = egraph.add(SymbolLang::new("F550", vec![n568, n571, n0, n545, n546, n558, n572, n545]));
    let n574 = egraph.add(SymbolLang::new("F553", vec![n573, n26, n28, n30, n32, n551, n552]));
    let n575 = egraph.add(SymbolLang::new("F554", vec![n574]));
    let n576 = egraph.add(SymbolLang::leaf("0.008997557"));
    let n577 = egraph.add(SymbolLang::new("Foo", vec![n575, n576, n542]));
    let n578 = egraph.add(SymbolLang::new("F540", vec![n577, n576, n542]));
    let n579 = egraph.add(SymbolLang::leaf("0.0030994876"));
    let n580 = egraph.add(SymbolLang::new("Foo", vec![n34, n579, n542]));
    let n581 = egraph.add(SymbolLang::new("F540", vec![n580, n579, n542]));
    let n582 = egraph.add(SymbolLang::new("F550", vec![n578, n581, n0, n545, n546, n545, n548, n545]));
    let n583 = egraph.add(SymbolLang::new("F553", vec![n582, n36, n38, n40, n42, n551, n552]));
    let n584 = egraph.add(SymbolLang::leaf("0.01813473"));
    let n585 = egraph.add(SymbolLang::leaf("115"));
    let n586 = egraph.add(SymbolLang::new("Foo", vec![n583, n584, n585]));
    let n587 = egraph.add(SymbolLang::new("F540", vec![n586, n584, n585]));
    let n588 = egraph.add(SymbolLang::leaf("0.0077785915"));
    let n589 = egraph.add(SymbolLang::new("Foo", vec![n44, n588, n542]));
    let n590 = egraph.add(SymbolLang::new("F540", vec![n589, n588, n542]));
    let n591 = egraph.add(SymbolLang::new("F550", vec![n559, n590, n0, n545, n546, n545, n548, n545]));
    let n592 = egraph.add(SymbolLang::new("F553", vec![n591, n46, n48, n50, n52, n551, n552]));
    let n593 = egraph.add(SymbolLang::leaf("0.037283998"));
    let n594 = egraph.add(SymbolLang::leaf("159"));
    let n595 = egraph.add(SymbolLang::new("Foo", vec![n592, n593, n594]));
    let n596 = egraph.add(SymbolLang::new("F540", vec![n595, n593, n594]));
    let n597 = egraph.add(SymbolLang::new("F597", vec![n587, n596]));
    let n598 = egraph.add(SymbolLang::new("F554", vec![n597]));
    let n599 = egraph.add(SymbolLang::leaf("0.014282514"));
    let n600 = egraph.add(SymbolLang::new("Foo", vec![n598, n599, n542]));
    let n601 = egraph.add(SymbolLang::new("F540", vec![n600, n599, n542]));
    let n602 = egraph.add(SymbolLang::leaf("0.0020611002"));
    let n603 = egraph.add(SymbolLang::new("Foo", vec![n54, n602, n542]));
    let n604 = egraph.add(SymbolLang::new("F540", vec![n603, n602, n542]));
    let n605 = egraph.add(SymbolLang::new("F550", vec![n601, n604, n0, n545, n546, n545, n548, n545]));
    let n606 = egraph.add(SymbolLang::new("F553", vec![n605, n56, n58, n60, n62, n551, n552]));
    let n607 = egraph.add(SymbolLang::new("F554", vec![n606]));
    let n608 = egraph.add(SymbolLang::leaf("0.009481663"));
    let n609 = egraph.add(SymbolLang::new("Foo", vec![n607, n608, n542]));
    let n610 = egraph.add(SymbolLang::new("F540", vec![n609, n608, n542]));
    let n611 = egraph.add(SymbolLang::leaf("0.0040953117"));
    let n612 = egraph.add(SymbolLang::new("Foo", vec![n64, n611, n542]));
    let n613 = egraph.add(SymbolLang::new("F540", vec![n612, n611, n542]));
    let n614 = egraph.add(SymbolLang::new("F550", vec![n610, n613, n0, n545, n546, n558, n572, n545]));
    let n615 = egraph.add(SymbolLang::new("F553", vec![n614, n66, n68, n70, n72, n551, n552]));
    let n616 = egraph.add(SymbolLang::new("F554", vec![n615]));
    let n617 = egraph.add(SymbolLang::leaf("0.010826744"));
    let n618 = egraph.add(SymbolLang::new("Foo", vec![n616, n617, n542]));
    let n619 = egraph.add(SymbolLang::new("F540", vec![n618, n617, n542]));
    let n620 = egraph.add(SymbolLang::leaf("0.0023198978"));
    let n621 = egraph.add(SymbolLang::new("Foo", vec![n74, n620, n542]));
    let n622 = egraph.add(SymbolLang::new("F540", vec![n621, n620, n542]));
    let n623 = egraph.add(SymbolLang::new("F550", vec![n619, n622, n0, n545, n546, n545, n548, n545]));
    let n624 = egraph.add(SymbolLang::new("F553", vec![n623, n76, n78, n80, n82, n551, n552]));
    let n625 = egraph.add(SymbolLang::leaf("0.0138166"));
    let n626 = egraph.add(SymbolLang::leaf("129"));
    let n627 = egraph.add(SymbolLang::new("Foo", vec![n624, n625, n626]));
    let n628 = egraph.add(SymbolLang::new("F540", vec![n627, n625, n626]));
    let n629 = egraph.add(SymbolLang::new("F597", vec![n628, n601]));
    let n630 = egraph.add(SymbolLang::new("F554", vec![n629]));
    let n631 = egraph.add(SymbolLang::leaf("0.016374968"));
    let n632 = egraph.add(SymbolLang::new("Foo", vec![n630, n631, n542]));
    let n633 = egraph.add(SymbolLang::new("F540", vec![n632, n631, n542]));
    let n634 = egraph.add(SymbolLang::leaf("0.0015123389"));
    let n635 = egraph.add(SymbolLang::new("Foo", vec![n84, n634, n542]));
    let n636 = egraph.add(SymbolLang::new("F540", vec![n635, n634, n542]));
    let n637 = egraph.add(SymbolLang::new("F550", vec![n633, n636, n0, n545, n546, n545, n548, n545]));
    let n638 = egraph.add(SymbolLang::new("F553", vec![n637, n86, n88, n90, n92, n551, n552]));
    let n639 = egraph.add(SymbolLang::new("F554", vec![n638]));
    let n640 = egraph.add(SymbolLang::leaf("0.0078049027"));
    let n641 = egraph.add(SymbolLang::new("Foo", vec![n639, n640, n542]));
    let n642 = egraph.add(SymbolLang::new("F540", vec![n641, n640, n542]));
    let n643 = egraph.add(SymbolLang::leaf("0.0022485557"));
    let n644 = egraph.add(SymbolLang::new("Foo", vec![n94, n643, n542]));
    let n645 = egraph.add(SymbolLang::new("F540", vec![n644, n643, n542]));
    let n646 = egraph.add(SymbolLang::new("F550", vec![n642, n645, n0, n545, n546, n558, n572, n545]));
    let n647 = egraph.add(SymbolLang::new("F553", vec![n646, n96, n98, n100, n102, n551, n552]));
    let n648 = egraph.add(SymbolLang::new("F554", vec![n647]));
    let n649 = egraph.add(SymbolLang::leaf("0.012676864"));
    let n650 = egraph.add(SymbolLang::new("Foo", vec![n648, n649, n542]));
    let n651 = egraph.add(SymbolLang::new("F540", vec![n650, n649, n542]));
    let n652 = egraph.add(SymbolLang::leaf("0.002166576"));
    let n653 = egraph.add(SymbolLang::new("Foo", vec![n104, n652, n542]));
    let n654 = egraph.add(SymbolLang::new("F540", vec![n653, n652, n542]));
    let n655 = egraph.add(SymbolLang::new("F550", vec![n651, n654, n0, n545, n546, n545, n548, n545]));
    let n656 = egraph.add(SymbolLang::new("F553", vec![n655, n106, n108, n110, n112, n551, n552]));
    let n657 = egraph.add(SymbolLang::leaf("0.027891092"));
    let n658 = egraph.add(SymbolLang::leaf("138"));
    let n659 = egraph.add(SymbolLang::new("Foo", vec![n656, n657, n658]));
    let n660 = egraph.add(SymbolLang::new("F540", vec![n659, n657, n658]));
    let n661 = egraph.add(SymbolLang::new("F597", vec![n660, n633]));
    let n662 = egraph.add(SymbolLang::new("F554", vec![n661]));
    let n663 = egraph.add(SymbolLang::leaf("0.015663793"));
    let n664 = egraph.add(SymbolLang::new("Foo", vec![n662, n663, n542]));
    let n665 = egraph.add(SymbolLang::new("F540", vec![n664, n663, n542]));
    let n666 = egraph.add(SymbolLang::leaf("0.002780738"));
    let n667 = egraph.add(SymbolLang::new("Foo", vec![n114, n666, n542]));
    let n668 = egraph.add(SymbolLang::new("F540", vec![n667, n666, n542]));
    let n669 = egraph.add(SymbolLang::new("F550", vec![n665, n668, n0, n545, n546, n545, n548, n545]));
    let n670 = egraph.add(SymbolLang::new("F553", vec![n669, n116, n118, n120, n122, n551, n552]));
    let n671 = egraph.add(SymbolLang::new("F554", vec![n670]));
    let n672 = egraph.add(SymbolLang::leaf("0.014913055"));
    let n673 = egraph.add(SymbolLang::new("Foo", vec![n671, n672, n542]));
    let n674 = egraph.add(SymbolLang::new("F540", vec![n673, n672, n542]));
    let n675 = egraph.add(SymbolLang::leaf("0.0023564969"));
    let n676 = egraph.add(SymbolLang::new("Foo", vec![n124, n675, n542]));
    let n677 = egraph.add(SymbolLang::new("F540", vec![n676, n675, n542]));
    let n678 = egraph.add(SymbolLang::new("F550", vec![n674, n677, n0, n545, n546, n558, n572, n549]));
    let n679 = egraph.add(SymbolLang::new("F553", vec![n678, n126, n128, n130, n132, n551, n552]));
    let n680 = egraph.add(SymbolLang::new("F554", vec![n679]));
    let n681 = egraph.add(SymbolLang::leaf("0.010381476"));
    let n682 = egraph.add(SymbolLang::new("Foo", vec![n680, n681, n542]));
    let n683 = egraph.add(SymbolLang::new("F540", vec![n682, n681, n542]));
    let n684 = egraph.add(SymbolLang::leaf("0.0030840412"));
    let n685 = egraph.add(SymbolLang::new("Foo", vec![n134, n684, n542]));
    let n686 = egraph.add(SymbolLang::new("F540", vec![n685, n684, n542]));
    let n687 = egraph.add(SymbolLang::new("F550", vec![n683, n686, n0, n545, n546, n545, n548, n545]));
    let n688 = egraph.add(SymbolLang::new("F553", vec![n687, n136, n138, n140, n142, n551, n552]));
    let n689 = egraph.add(SymbolLang::leaf("0.02581817"));
    let n690 = egraph.add(SymbolLang::leaf("124"));
    let n691 = egraph.add(SymbolLang::new("Foo", vec![n688, n689, n690]));
    let n692 = egraph.add(SymbolLang::new("F540", vec![n691, n689, n690]));
    let n693 = egraph.add(SymbolLang::leaf("0.0044586184"));
    let n694 = egraph.add(SymbolLang::new("Foo", vec![n144, n693, n542]));
    let n695 = egraph.add(SymbolLang::new("F540", vec![n694, n693, n542]));
    let n696 = egraph.add(SymbolLang::new("F550", vec![n665, n695, n0, n545, n546, n545, n548, n549]));
    let n697 = egraph.add(SymbolLang::new("F553", vec![n696, n146, n148, n150, n152, n551, n552]));
    let n698 = egraph.add(SymbolLang::leaf("0.021560019"));
    let n699 = egraph.add(SymbolLang::leaf("106"));
    let n700 = egraph.add(SymbolLang::new("Foo", vec![n697, n698, n699]));
    let n701 = egraph.add(SymbolLang::new("F540", vec![n700, n698, n699]));
    let n702 = egraph.add(SymbolLang::new("F597", vec![n692, n701]));
    let n703 = egraph.add(SymbolLang::new("F554", vec![n702]));
    let n704 = egraph.add(SymbolLang::leaf("0.014416133"));
    let n705 = egraph.add(SymbolLang::new("Foo", vec![n703, n704, n542]));
    let n706 = egraph.add(SymbolLang::new("F540", vec![n705, n704, n542]));
    let n707 = egraph.add(SymbolLang::leaf("0.0019855262"));
    let n708 = egraph.add(SymbolLang::new("Foo", vec![n154, n707, n542]));
    let n709 = egraph.add(SymbolLang::new("F540", vec![n708, n707, n542]));
    let n710 = egraph.add(SymbolLang::new("F550", vec![n706, n709, n0, n545, n546, n545, n548, n545]));
    let n711 = egraph.add(SymbolLang::new("F553", vec![n710, n156, n158, n160, n162, n551, n552]));
    let n712 = egraph.add(SymbolLang::new("F554", vec![n711]));
    let n713 = egraph.add(SymbolLang::leaf("0.0053234566"));
    let n714 = egraph.add(SymbolLang::new("Foo", vec![n712, n713, n542]));
    let n715 = egraph.add(SymbolLang::new("F540", vec![n714, n713, n542]));
    let n716 = egraph.add(SymbolLang::leaf("0.0023605104"));
    let n717 = egraph.add(SymbolLang::new("Foo", vec![n164, n716, n542]));
    let n718 = egraph.add(SymbolLang::new("F540", vec![n717, n716, n542]));
    let n719 = egraph.add(SymbolLang::new("F550", vec![n715, n718, n0, n545, n546, n558, n572, n545]));
    let n720 = egraph.add(SymbolLang::new("F553", vec![n719, n166, n168, n170, n172, n551, n552]));
    let n721 = egraph.add(SymbolLang::new("F554", vec![n720]));
    let n722 = egraph.add(SymbolLang::leaf("0.008160095"));
    let n723 = egraph.add(SymbolLang::new("Foo", vec![n721, n722, n542]));
    let n724 = egraph.add(SymbolLang::new("F540", vec![n723, n722, n542]));
    let n725 = egraph.add(SymbolLang::leaf("0.0023920513"));
    let n726 = egraph.add(SymbolLang::new("Foo", vec![n174, n725, n542]));
    let n727 = egraph.add(SymbolLang::new("F540", vec![n726, n725, n542]));
    let n728 = egraph.add(SymbolLang::new("F550", vec![n724, n727, n0, n545, n546, n545, n548, n545]));
    let n729 = egraph.add(SymbolLang::new("F553", vec![n728, n176, n178, n180, n182, n551, n552]));
    let n730 = egraph.add(SymbolLang::leaf("0.030728264"));
    let n731 = egraph.add(SymbolLang::leaf("162"));
    let n732 = egraph.add(SymbolLang::new("Foo", vec![n729, n730, n731]));
    let n733 = egraph.add(SymbolLang::new("F540", vec![n732, n730, n731]));
    let n734 = egraph.add(SymbolLang::new("F597", vec![n733, n706]));
    let n735 = egraph.add(SymbolLang::new("F554", vec![n734]));
    let n736 = egraph.add(SymbolLang::leaf("0.01525923"));
    let n737 = egraph.add(SymbolLang::new("Foo", vec![n735, n736, n542]));
    let n738 = egraph.add(SymbolLang::new("F540", vec![n737, n736, n542]));
    let n739 = egraph.add(SymbolLang::leaf("0.0018764542"));
    let n740 = egraph.add(SymbolLang::new("Foo", vec![n184, n739, n542]));
    let n741 = egraph.add(SymbolLang::new("F540", vec![n740, n739, n542]));
    let n742 = egraph.add(SymbolLang::new("F550", vec![n738, n741, n0, n545, n546, n545, n548, n545]));
    let n743 = egraph.add(SymbolLang::new("F553", vec![n742, n186, n188, n190, n192, n551, n552]));
    let n744 = egraph.add(SymbolLang::new("F554", vec![n743]));
    let n745 = egraph.add(SymbolLang::leaf("0.008805299"));
    let n746 = egraph.add(SymbolLang::new("Foo", vec![n744, n745, n542]));
    let n747 = egraph.add(SymbolLang::new("F540", vec![n746, n745, n542]));
    let n748 = egraph.add(SymbolLang::leaf("0.0020125674"));
    let n749 = egraph.add(SymbolLang::new("Foo", vec![n194, n748, n542]));
    let n750 = egraph.add(SymbolLang::new("F540", vec![n749, n748, n542]));
    let n751 = egraph.add(SymbolLang::new("F550", vec![n747, n750, n0, n545, n546, n558, n572, n545]));
    let n752 = egraph.add(SymbolLang::new("F553", vec![n751, n196, n198, n200, n202, n551, n552]));
    let n753 = egraph.add(SymbolLang::new("F554", vec![n752]));
    let n754 = egraph.add(SymbolLang::leaf("0.0072553125"));
    let n755 = egraph.add(SymbolLang::new("Foo", vec![n753, n754, n542]));
    let n756 = egraph.add(SymbolLang::new("F540", vec![n755, n754, n542]));
    let n757 = egraph.add(SymbolLang::leaf("0.0027729012"));
    let n758 = egraph.add(SymbolLang::new("Foo", vec![n204, n757, n542]));
    let n759 = egraph.add(SymbolLang::new("F540", vec![n758, n757, n542]));
    let n760 = egraph.add(SymbolLang::new("F550", vec![n756, n759, n0, n545, n546, n545, n548, n545]));
    let n761 = egraph.add(SymbolLang::new("F553", vec![n760, n206, n208, n210, n212, n551, n552]));
    let n762 = egraph.add(SymbolLang::leaf("0.0178168"));
    let n763 = egraph.add(SymbolLang::leaf("137"));
    let n764 = egraph.add(SymbolLang::new("Foo", vec![n761, n762, n763]));
    let n765 = egraph.add(SymbolLang::new("F540", vec![n764, n762, n763]));
    let n766 = egraph.add(SymbolLang::new("F597", vec![n765, n738]));
    let n767 = egraph.add(SymbolLang::new("F554", vec![n766]));
    let n768 = egraph.add(SymbolLang::leaf("0.017244903"));
    let n769 = egraph.add(SymbolLang::new("Foo", vec![n767, n768, n542]));
    let n770 = egraph.add(SymbolLang::new("F540", vec![n769, n768, n542]));
    let n771 = egraph.add(SymbolLang::leaf("0.002216002"));
    let n772 = egraph.add(SymbolLang::new("Foo", vec![n214, n771, n542]));
    let n773 = egraph.add(SymbolLang::new("F540", vec![n772, n771, n542]));
    let n774 = egraph.add(SymbolLang::new("F550", vec![n770, n773, n0, n545, n546, n545, n548, n545]));
    let n775 = egraph.add(SymbolLang::new("F553", vec![n774, n216, n218, n220, n222, n551, n552]));
    let n776 = egraph.add(SymbolLang::new("F554", vec![n775]));
    let n777 = egraph.add(SymbolLang::leaf("0.009107606"));
    let n778 = egraph.add(SymbolLang::new("Foo", vec![n776, n777, n542]));
    let n779 = egraph.add(SymbolLang::new("F540", vec![n778, n777, n542]));
    let n780 = egraph.add(SymbolLang::leaf("0.0017398852"));
    let n781 = egraph.add(SymbolLang::new("Foo", vec![n224, n780, n542]));
    let n782 = egraph.add(SymbolLang::new("F540", vec![n781, n780, n542]));
    let n783 = egraph.add(SymbolLang::new("F550", vec![n779, n782, n0, n545, n546, n558, n572, n545]));
    let n784 = egraph.add(SymbolLang::new("F553", vec![n783, n226, n228, n230, n232, n551, n552]));
    let n785 = egraph.add(SymbolLang::new("F554", vec![n784]));
    let n786 = egraph.add(SymbolLang::leaf("0.009474749"));
    let n787 = egraph.add(SymbolLang::new("Foo", vec![n785, n786, n542]));
    let n788 = egraph.add(SymbolLang::new("F540", vec![n787, n786, n542]));
    let n789 = egraph.add(SymbolLang::leaf("0.002327718"));
    let n790 = egraph.add(SymbolLang::new("Foo", vec![n234, n789, n542]));
    let n791 = egraph.add(SymbolLang::new("F540", vec![n790, n789, n542]));
    let n792 = egraph.add(SymbolLang::new("F550", vec![n788, n791, n0, n545, n546, n545, n548, n545]));
    let n793 = egraph.add(SymbolLang::new("F553", vec![n792, n236, n238, n240, n242, n551, n552]));
    let n794 = egraph.add(SymbolLang::leaf("0.017862126"));
    let n795 = egraph.add(SymbolLang::leaf("116"));
    let n796 = egraph.add(SymbolLang::new("Foo", vec![n793, n794, n795]));
    let n797 = egraph.add(SymbolLang::new("F540", vec![n796, n794, n795]));
    let n798 = egraph.add(SymbolLang::new("F597", vec![n797, n770]));
    let n799 = egraph.add(SymbolLang::new("F554", vec![n798]));
    let n800 = egraph.add(SymbolLang::leaf("0.01773554"));
    let n801 = egraph.add(SymbolLang::new("Foo", vec![n799, n800, n542]));
    let n802 = egraph.add(SymbolLang::new("F540", vec![n801, n800, n542]));
    let n803 = egraph.add(SymbolLang::leaf("0.0026971495"));
    let n804 = egraph.add(SymbolLang::new("Foo", vec![n244, n803, n542]));
    let n805 = egraph.add(SymbolLang::new("F540", vec![n804, n803, n542]));
    let n806 = egraph.add(SymbolLang::new("F550", vec![n802, n805, n0, n545, n546, n545, n548, n545]));
    let n807 = egraph.add(SymbolLang::new("F553", vec![n806, n246, n248, n250, n252, n551, n552]));
    let n808 = egraph.add(SymbolLang::new("F554", vec![n807]));
    let n809 = egraph.add(SymbolLang::leaf("0.015318613"));
    let n810 = egraph.add(SymbolLang::new("Foo", vec![n808, n809, n542]));
    let n811 = egraph.add(SymbolLang::new("F540", vec![n810, n809, n542]));
    let n812 = egraph.add(SymbolLang::leaf("0.0015808397"));
    let n813 = egraph.add(SymbolLang::new("Foo", vec![n254, n812, n542]));
    let n814 = egraph.add(SymbolLang::new("F540", vec![n813, n812, n542]));
    let n815 = egraph.add(SymbolLang::new("F550", vec![n811, n814, n0, n545, n546, n558, n572, n549]));
    let n816 = egraph.add(SymbolLang::new("F553", vec![n815, n256, n258, n260, n262, n551, n552]));
    let n817 = egraph.add(SymbolLang::new("F554", vec![n816]));
    let n818 = egraph.add(SymbolLang::leaf("0.009161512"));
    let n819 = egraph.add(SymbolLang::new("Foo", vec![n817, n818, n542]));
    let n820 = egraph.add(SymbolLang::new("F540", vec![n819, n818, n542]));
    let n821 = egraph.add(SymbolLang::leaf("0.002529462"));
    let n822 = egraph.add(SymbolLang::new("Foo", vec![n264, n821, n542]));
    let n823 = egraph.add(SymbolLang::new("F540", vec![n822, n821, n542]));
    let n824 = egraph.add(SymbolLang::new("F550", vec![n820, n823, n0, n545, n546, n545, n548, n545]));
    let n825 = egraph.add(SymbolLang::new("F553", vec![n824, n266, n268, n270, n272, n551, n552]));
    let n826 = egraph.add(SymbolLang::leaf("0.022613615"));
    let n827 = egraph.add(SymbolLang::new("Foo", vec![n825, n826, n538]));
    let n828 = egraph.add(SymbolLang::new("F540", vec![n827, n826, n538]));
    let n829 = egraph.add(SymbolLang::leaf("0.0027245332"));
    let n830 = egraph.add(SymbolLang::new("Foo", vec![n274, n829, n542]));
    let n831 = egraph.add(SymbolLang::new("F540", vec![n830, n829, n542]));
    let n832 = egraph.add(SymbolLang::new("F550", vec![n802, n831, n0, n545, n546, n545, n548, n549]));
    let n833 = egraph.add(SymbolLang::new("F553", vec![n832, n276, n278, n280, n282, n551, n552]));
    let n834 = egraph.add(SymbolLang::leaf("0.016625794"));
    let n835 = egraph.add(SymbolLang::leaf("131"));
    let n836 = egraph.add(SymbolLang::new("Foo", vec![n833, n834, n835]));
    let n837 = egraph.add(SymbolLang::new("F540", vec![n836, n834, n835]));
    let n838 = egraph.add(SymbolLang::new("F597", vec![n828, n837]));
    let n839 = egraph.add(SymbolLang::new("F554", vec![n838]));
    let n840 = egraph.add(SymbolLang::leaf("0.013478882"));
    let n841 = egraph.add(SymbolLang::new("Foo", vec![n839, n840, n542]));
    let n842 = egraph.add(SymbolLang::new("F540", vec![n841, n840, n542]));
    let n843 = egraph.add(SymbolLang::leaf("0.0023163182"));
    let n844 = egraph.add(SymbolLang::new("Foo", vec![n284, n843, n542]));
    let n845 = egraph.add(SymbolLang::new("F540", vec![n844, n843, n542]));
    let n846 = egraph.add(SymbolLang::new("F550", vec![n842, n845, n0, n545, n546, n545, n548, n545]));
    let n847 = egraph.add(SymbolLang::new("F553", vec![n846, n286, n288, n290, n292, n551, n552]));
    let n848 = egraph.add(SymbolLang::new("F554", vec![n847]));
    let n849 = egraph.add(SymbolLang::leaf("0.013280921"));
    let n850 = egraph.add(SymbolLang::new("Foo", vec![n848, n849, n542]));
    let n851 = egraph.add(SymbolLang::new("F540", vec![n850, n849, n542]));
    let n852 = egraph.add(SymbolLang::leaf("0.0020742188"));
    let n853 = egraph.add(SymbolLang::new("Foo", vec![n294, n852, n542]));
    let n854 = egraph.add(SymbolLang::new("F540", vec![n853, n852, n542]));
    let n855 = egraph.add(SymbolLang::new("F550", vec![n851, n854, n0, n545, n546, n558, n572, n545]));
    let n856 = egraph.add(SymbolLang::new("F553", vec![n855, n296, n298, n300, n302, n551, n552]));
    let n857 = egraph.add(SymbolLang::new("F554", vec![n856]));
    let n858 = egraph.add(SymbolLang::leaf("0.007806268"));
    let n859 = egraph.add(SymbolLang::new("Foo", vec![n857, n858, n542]));
    let n860 = egraph.add(SymbolLang::new("F540", vec![n859, n858, n542]));
    let n861 = egraph.add(SymbolLang::leaf("0.0039125034"));
    let n862 = egraph.add(SymbolLang::new("Foo", vec![n304, n861, n542]));
    let n863 = egraph.add(SymbolLang::new("F540", vec![n862, n861, n542]));
    let n864 = egraph.add(SymbolLang::new("F550", vec![n860, n863, n0, n545, n546, n545, n548, n545]));
    let n865 = egraph.add(SymbolLang::new("F553", vec![n864, n306, n308, n310, n312, n551, n552]));
    let n866 = egraph.add(SymbolLang::leaf("0.026667478"));
    let n867 = egraph.add(SymbolLang::leaf("118"));
    let n868 = egraph.add(SymbolLang::new("Foo", vec![n865, n866, n867]));
    let n869 = egraph.add(SymbolLang::new("F540", vec![n868, n866, n867]));
    let n870 = egraph.add(SymbolLang::new("F597", vec![n869, n842]));
    let n871 = egraph.add(SymbolLang::new("F554", vec![n870]));
    let n872 = egraph.add(SymbolLang::leaf("0.018271558"));
    let n873 = egraph.add(SymbolLang::new("Foo", vec![n871, n872, n542]));
    let n874 = egraph.add(SymbolLang::new("F540", vec![n873, n872, n542]));
    let n875 = egraph.add(SymbolLang::leaf("0.0021375522"));
    let n876 = egraph.add(SymbolLang::new("Foo", vec![n314, n875, n542]));
    let n877 = egraph.add(SymbolLang::new("F540", vec![n876, n875, n542]));
    let n878 = egraph.add(SymbolLang::new("F550", vec![n874, n877, n0, n545, n546, n545, n548, n545]));
    let n879 = egraph.add(SymbolLang::new("F553", vec![n878, n316, n318, n320, n322, n551, n552]));
    let n880 = egraph.add(SymbolLang::new("F554", vec![n879]));
    let n881 = egraph.add(SymbolLang::leaf("0.0074740965"));
    let n882 = egraph.add(SymbolLang::new("Foo", vec![n880, n881, n542]));
    let n883 = egraph.add(SymbolLang::new("F540", vec![n882, n881, n542]));
    let n884 = egraph.add(SymbolLang::leaf("0.0016537367"));
    let n885 = egraph.add(SymbolLang::new("Foo", vec![n324, n884, n542]));
    let n886 = egraph.add(SymbolLang::new("F540", vec![n885, n884, n542]));
    let n887 = egraph.add(SymbolLang::new("F550", vec![n883, n886, n0, n545, n546, n558, n572, n545]));
    let n888 = egraph.add(SymbolLang::new("F553", vec![n887, n326, n328, n330, n332, n551, n552]));
    let n889 = egraph.add(SymbolLang::new("F554", vec![n888]));
    let n890 = egraph.add(SymbolLang::leaf("0.006540169"));
    let n891 = egraph.add(SymbolLang::new("Foo", vec![n889, n890, n542]));
    let n892 = egraph.add(SymbolLang::new("F540", vec![n891, n890, n542]));
    let n893 = egraph.add(SymbolLang::leaf("0.0027855246"));
    let n894 = egraph.add(SymbolLang::new("Foo", vec![n334, n893, n542]));
    let n895 = egraph.add(SymbolLang::new("F540", vec![n894, n893, n542]));
    let n896 = egraph.add(SymbolLang::new("F550", vec![n892, n895, n0, n545, n546, n545, n548, n545]));
    let n897 = egraph.add(SymbolLang::new("F553", vec![n896, n336, n338, n340, n342, n551, n552]));
    let n898 = egraph.add(SymbolLang::leaf("0.012581111"));
    let n899 = egraph.add(SymbolLang::leaf("128"));
    let n900 = egraph.add(SymbolLang::new("Foo", vec![n897, n898, n899]));
    let n901 = egraph.add(SymbolLang::new("F540", vec![n900, n898, n899]));
    let n902 = egraph.add(SymbolLang::new("F597", vec![n901, n874]));
    let n903 = egraph.add(SymbolLang::new("F554", vec![n902]));
    let n904 = egraph.add(SymbolLang::leaf("0.016950214"));
    let n905 = egraph.add(SymbolLang::new("Foo", vec![n903, n904, n542]));
    let n906 = egraph.add(SymbolLang::new("F540", vec![n905, n904, n542]));
    let n907 = egraph.add(SymbolLang::leaf("0.0018819192"));
    let n908 = egraph.add(SymbolLang::new("Foo", vec![n344, n907, n542]));
    let n909 = egraph.add(SymbolLang::new("F540", vec![n908, n907, n542]));
    let n910 = egraph.add(SymbolLang::new("F550", vec![n906, n909, n0, n545, n546, n545, n548, n545]));
    let n911 = egraph.add(SymbolLang::new("F553", vec![n910, n346, n348, n350, n352, n551, n552]));
    let n912 = egraph.add(SymbolLang::new("F554", vec![n911]));
    let n913 = egraph.add(SymbolLang::leaf("0.0126314005"));
    let n914 = egraph.add(SymbolLang::new("Foo", vec![n912, n913, n542]));
    let n915 = egraph.add(SymbolLang::new("F540", vec![n914, n913, n542]));
    let n916 = egraph.add(SymbolLang::leaf("0.002198527"));
    let n917 = egraph.add(SymbolLang::new("Foo", vec![n354, n916, n542]));
    let n918 = egraph.add(SymbolLang::new("F540", vec![n917, n916, n542]));
    let n919 = egraph.add(SymbolLang::new("F550", vec![n915, n918, n0, n545, n546, n558, n572, n545]));
    let n920 = egraph.add(SymbolLang::new("F553", vec![n919, n356, n358, n360, n362, n551, n552]));
    let n921 = egraph.add(SymbolLang::new("F554", vec![n920]));
    let n922 = egraph.add(SymbolLang::leaf("0.007870837"));
    let n923 = egraph.add(SymbolLang::new("Foo", vec![n921, n922, n542]));
    let n924 = egraph.add(SymbolLang::new("F540", vec![n923, n922, n542]));
    let n925 = egraph.add(SymbolLang::leaf("0.0024617526"));
    let n926 = egraph.add(SymbolLang::new("Foo", vec![n364, n925, n542]));
    let n927 = egraph.add(SymbolLang::new("F540", vec![n926, n925, n542]));
    let n928 = egraph.add(SymbolLang::new("F550", vec![n924, n927, n0, n545, n546, n545, n548, n545]));
    let n929 = egraph.add(SymbolLang::new("F553", vec![n928, n366, n368, n370, n372, n551, n552]));
    let n930 = egraph.add(SymbolLang::leaf("0.023214022"));
    let n931 = egraph.add(SymbolLang::leaf("123"));
    let n932 = egraph.add(SymbolLang::new("Foo", vec![n929, n930, n931]));
    let n933 = egraph.add(SymbolLang::new("F540", vec![n932, n930, n931]));
    let n934 = egraph.add(SymbolLang::new("F597", vec![n933, n906]));
    let n935 = egraph.add(SymbolLang::new("F554", vec![n934]));
    let n936 = egraph.add(SymbolLang::leaf("0.020886121"));
    let n937 = egraph.add(SymbolLang::new("Foo", vec![n935, n936, n542]));
    let n938 = egraph.add(SymbolLang::new("F540", vec![n937, n936, n542]));
    let n939 = egraph.add(SymbolLang::leaf("0.0021432927"));
    let n940 = egraph.add(SymbolLang::new("Foo", vec![n374, n939, n542]));
    let n941 = egraph.add(SymbolLang::new("F540", vec![n940, n939, n542]));
    let n942 = egraph.add(SymbolLang::new("F550", vec![n938, n941, n0, n545, n546, n545, n548, n545]));
    let n943 = egraph.add(SymbolLang::new("F553", vec![n942, n376, n378, n380, n382, n551, n552]));
    let n944 = egraph.add(SymbolLang::new("F554", vec![n943]));
    let n945 = egraph.add(SymbolLang::leaf("0.01276982"));
    let n946 = egraph.add(SymbolLang::new("Foo", vec![n944, n945, n542]));
    let n947 = egraph.add(SymbolLang::new("F540", vec![n946, n945, n542]));
    let n948 = egraph.add(SymbolLang::leaf("0.0015109346"));
    let n949 = egraph.add(SymbolLang::new("Foo", vec![n384, n948, n542]));
    let n950 = egraph.add(SymbolLang::new("F540", vec![n949, n948, n542]));
    let n951 = egraph.add(SymbolLang::new("F550", vec![n947, n950, n0, n545, n546, n558, n572, n545]));
    let n952 = egraph.add(SymbolLang::new("F553", vec![n951, n386, n388, n390, n392, n551, n552]));
    let n953 = egraph.add(SymbolLang::new("F554", vec![n952]));
    let n954 = egraph.add(SymbolLang::leaf("0.009295406"));
    let n955 = egraph.add(SymbolLang::new("Foo", vec![n953, n954, n542]));
    let n956 = egraph.add(SymbolLang::new("F540", vec![n955, n954, n542]));
    let n957 = egraph.add(SymbolLang::leaf("0.0024892366"));
    let n958 = egraph.add(SymbolLang::new("Foo", vec![n394, n957, n542]));
    let n959 = egraph.add(SymbolLang::new("F540", vec![n958, n957, n542]));
    let n960 = egraph.add(SymbolLang::new("F550", vec![n956, n959, n0, n545, n546, n545, n548, n545]));
    let n961 = egraph.add(SymbolLang::new("F553", vec![n960, n396, n398, n400, n402, n551, n552]));
    let n962 = egraph.add(SymbolLang::leaf("0.019488193"));
    let n963 = egraph.add(SymbolLang::leaf("141"));
    let n964 = egraph.add(SymbolLang::new("Foo", vec![n961, n962, n963]));
    let n965 = egraph.add(SymbolLang::new("F540", vec![n964, n962, n963]));
    let n966 = egraph.add(SymbolLang::new("F597", vec![n965, n938]));
    let n967 = egraph.add(SymbolLang::new("F554", vec![n966]));
    let n968 = egraph.add(SymbolLang::leaf("0.021265456"));
    let n969 = egraph.add(SymbolLang::new("Foo", vec![n967, n968, n542]));
    let n970 = egraph.add(SymbolLang::new("F540", vec![n969, n968, n542]));
    let n971 = egraph.add(SymbolLang::leaf("0.0031456517"));
    let n972 = egraph.add(SymbolLang::new("Foo", vec![n404, n971, n542]));
    let n973 = egraph.add(SymbolLang::new("F540", vec![n972, n971, n542]));
    let n974 = egraph.add(SymbolLang::new("F550", vec![n970, n973, n0, n545, n546, n545, n548, n545]));
    let n975 = egraph.add(SymbolLang::new("F553", vec![n974, n406, n408, n410, n412, n551, n552]));
    let n976 = egraph.add(SymbolLang::new("F554", vec![n975]));
    let n977 = egraph.add(SymbolLang::leaf("0.011488613"));
    let n978 = egraph.add(SymbolLang::new("Foo", vec![n976, n977, n542]));
    let n979 = egraph.add(SymbolLang::new("F540", vec![n978, n977, n542]));
    let n980 = egraph.add(SymbolLang::leaf("0.0017603391"));
    let n981 = egraph.add(SymbolLang::new("Foo", vec![n414, n980, n542]));
    let n982 = egraph.add(SymbolLang::new("F540", vec![n981, n980, n542]));
    let n983 = egraph.add(SymbolLang::new("F550", vec![n979, n982, n0, n545, n546, n558, n572, n545]));
    let n984 = egraph.add(SymbolLang::new("F553", vec![n983, n416, n418, n420, n422, n551, n552]));
    let n985 = egraph.add(SymbolLang::new("F554", vec![n984]));
    let n986 = egraph.add(SymbolLang::leaf("0.013220295"));
    let n987 = egraph.add(SymbolLang::new("Foo", vec![n985, n986, n542]));
    let n988 = egraph.add(SymbolLang::new("F540", vec![n987, n986, n542]));
    let n989 = egraph.add(SymbolLang::leaf("0.0025892595"));
    let n990 = egraph.add(SymbolLang::new("Foo", vec![n424, n989, n542]));
    let n991 = egraph.add(SymbolLang::new("F540", vec![n990, n989, n542]));
    let n992 = egraph.add(SymbolLang::new("F550", vec![n988, n991, n0, n545, n546, n545, n548, n545]));
    let n993 = egraph.add(SymbolLang::new("F553", vec![n992, n426, n428, n430, n432, n551, n552]));
    let n994 = egraph.add(SymbolLang::leaf("0.032053974"));
    let n995 = egraph.add(SymbolLang::new("Foo", vec![n993, n994, n731]));
    let n996 = egraph.add(SymbolLang::new("F540", vec![n995, n994, n731]));
    let n997 = egraph.add(SymbolLang::new("F597", vec![n996, n970]));
    let n998 = egraph.add(SymbolLang::new("F554", vec![n997]));
    let n999 = egraph.add(SymbolLang::leaf("0.01929628"));
    let n1000 = egraph.add(SymbolLang::new("Foo", vec![n998, n999, n542]));
    let n1001 = egraph.add(SymbolLang::new("F540", vec![n1000, n999, n542]));
    let n1002 = egraph.add(SymbolLang::leaf("0.0026890966"));
    let n1003 = egraph.add(SymbolLang::new("Foo", vec![n434, n1002, n542]));
    let n1004 = egraph.add(SymbolLang::new("F540", vec![n1003, n1002, n542]));
    let n1005 = egraph.add(SymbolLang::new("F550", vec![n1001, n1004, n0, n545, n546, n545, n548, n545]));
    let n1006 = egraph.add(SymbolLang::new("F553", vec![n1005, n436, n438, n440, n442, n551, n552]));
    let n1007 = egraph.add(SymbolLang::new("F554", vec![n1006]));
    let n1008 = egraph.add(SymbolLang::leaf("0.015247329"));
    let n1009 = egraph.add(SymbolLang::new("Foo", vec![n1007, n1008, n542]));
    let n1010 = egraph.add(SymbolLang::new("F540", vec![n1009, n1008, n542]));
    let n1011 = egraph.add(SymbolLang::leaf("0.0031438766"));
    let n1012 = egraph.add(SymbolLang::new("Foo", vec![n444, n1011, n542]));
    let n1013 = egraph.add(SymbolLang::new("F540", vec![n1012, n1011, n542]));
    let n1014 = egraph.add(SymbolLang::new("F550", vec![n1010, n1013, n0, n545, n546, n558, n572, n549]));
    let n1015 = egraph.add(SymbolLang::new("F553", vec![n1014, n446, n448, n450, n452, n551, n552]));
    let n1016 = egraph.add(SymbolLang::new("F554", vec![n1015]));
    let n1017 = egraph.add(SymbolLang::leaf("0.010966975"));
    let n1018 = egraph.add(SymbolLang::new("Foo", vec![n1016, n1017, n542]));
    let n1019 = egraph.add(SymbolLang::new("F540", vec![n1018, n1017, n542]));
    let n1020 = egraph.add(SymbolLang::leaf("0.0027925"));
    let n1021 = egraph.add(SymbolLang::new("Foo", vec![n454, n1020, n542]));
    let n1022 = egraph.add(SymbolLang::new("F540", vec![n1021, n1020, n542]));
    let n1023 = egraph.add(SymbolLang::new("F550", vec![n1019, n1022, n0, n545, n546, n545, n548, n545]));
    let n1024 = egraph.add(SymbolLang::new("F553", vec![n1023, n456, n458, n460, n462, n551, n552]));
    let n1025 = egraph.add(SymbolLang::leaf("0.05819646"));
    let n1026 = egraph.add(SymbolLang::leaf("92"));
    let n1027 = egraph.add(SymbolLang::new("Foo", vec![n1024, n1025, n1026]));
    let n1028 = egraph.add(SymbolLang::new("F540", vec![n1027, n1025, n1026]));
    let n1029 = egraph.add(SymbolLang::leaf("0.0050494745"));
    let n1030 = egraph.add(SymbolLang::new("Foo", vec![n464, n1029, n542]));
    let n1031 = egraph.add(SymbolLang::new("F540", vec![n1030, n1029, n542]));
    let n1032 = egraph.add(SymbolLang::new("F550", vec![n1001, n1031, n0, n545, n546, n545, n548, n549]));
    let n1033 = egraph.add(SymbolLang::new("F553", vec![n1032, n466, n468, n470, n472, n551, n552]));
    let n1034 = egraph.add(SymbolLang::leaf("0.054622747"));
    let n1035 = egraph.add(SymbolLang::leaf("99"));
    let n1036 = egraph.add(SymbolLang::new("Foo", vec![n1033, n1034, n1035]));
    let n1037 = egraph.add(SymbolLang::new("F540", vec![n1036, n1034, n1035]));
    let n1038 = egraph.add(SymbolLang::new("F597", vec![n1028, n1037]));
    let n1039 = egraph.add(SymbolLang::new("F554", vec![n1038]));
    let n1040 = egraph.add(SymbolLang::leaf("0.04934459"));
    let n1041 = egraph.add(SymbolLang::new("Foo", vec![n1039, n1040, n542]));
    let n1042 = egraph.add(SymbolLang::new("F540", vec![n1041, n1040, n542]));
    let n1043 = egraph.add(SymbolLang::leaf("0.005514439"));
    let n1044 = egraph.add(SymbolLang::new("Foo", vec![n474, n1043, n542]));
    let n1045 = egraph.add(SymbolLang::new("F540", vec![n1044, n1043, n542]));
    let n1046 = egraph.add(SymbolLang::new("F550", vec![n1042, n1045, n0, n545, n546, n545, n548, n545]));
    let n1047 = egraph.add(SymbolLang::new("F553", vec![n1046, n476, n478, n480, n482, n551, n552]));
    let n1048 = egraph.add(SymbolLang::new("F554", vec![n1047]));
    let n1049 = egraph.add(SymbolLang::leaf("0.013978533"));
    let n1050 = egraph.add(SymbolLang::new("Foo", vec![n1048, n1049, n542]));
    let n1051 = egraph.add(SymbolLang::new("F540", vec![n1050, n1049, n542]));
    let n1052 = egraph.add(SymbolLang::leaf("0.0017775404"));
    let n1053 = egraph.add(SymbolLang::new("Foo", vec![n484, n1052, n542]));
    let n1054 = egraph.add(SymbolLang::new("F540", vec![n1053, n1052, n542]));
    let n1055 = egraph.add(SymbolLang::new("F550", vec![n1051, n1054, n0, n545, n546, n558, n572, n545]));
    let n1056 = egraph.add(SymbolLang::new("F553", vec![n1055, n486, n488, n490, n492, n551, n552]));
    let n1057 = egraph.add(SymbolLang::new("F554", vec![n1056]));
    let n1058 = egraph.add(SymbolLang::leaf("0.010363854"));
    let n1059 = egraph.add(SymbolLang::new("Foo", vec![n1057, n1058, n542]));
    let n1060 = egraph.add(SymbolLang::new("F540", vec![n1059, n1058, n542]));
    let n1061 = egraph.add(SymbolLang::leaf("0.0019108925"));
    let n1062 = egraph.add(SymbolLang::new("Foo", vec![n494, n1061, n542]));
    let n1063 = egraph.add(SymbolLang::new("F540", vec![n1062, n1061, n542]));
    let n1064 = egraph.add(SymbolLang::new("F550", vec![n1060, n1063, n0, n545, n546, n545, n548, n545]));
    let n1065 = egraph.add(SymbolLang::new("F553", vec![n1064, n496, n498, n500, n502, n551, n552]));
    let n1066 = egraph.add(SymbolLang::leaf("0.048815656"));
    let n1067 = egraph.add(SymbolLang::leaf("87"));
    let n1068 = egraph.add(SymbolLang::new("Foo", vec![n1065, n1066, n1067]));
    let n1069 = egraph.add(SymbolLang::new("F540", vec![n1068, n1066, n1067]));
    let n1070 = egraph.add(SymbolLang::new("F597", vec![n1069, n1042]));
    let n1071 = egraph.add(SymbolLang::new("F554", vec![n1070]));
    let n1072 = egraph.add(SymbolLang::leaf("0.057522"));
    let n1073 = egraph.add(SymbolLang::new("Foo", vec![n1071, n1072, n542]));
    let n1074 = egraph.add(SymbolLang::new("F540", vec![n1073, n1072, n542]));
    let n1075 = egraph.add(SymbolLang::leaf("0.0035754633"));
    let n1076 = egraph.add(SymbolLang::new("Foo", vec![n504, n1075, n542]));
    let n1077 = egraph.add(SymbolLang::new("F540", vec![n1076, n1075, n542]));
    let n1078 = egraph.add(SymbolLang::new("F550", vec![n1074, n1077, n0, n545, n546, n545, n548, n545]));
    let n1079 = egraph.add(SymbolLang::new("F553", vec![n1078, n506, n508, n510, n512, n551, n552]));
    let n1080 = egraph.add(SymbolLang::new("F554", vec![n1079]));
    let n1081 = egraph.add(SymbolLang::leaf("0.012224366"));
    let n1082 = egraph.add(SymbolLang::new("Foo", vec![n1080, n1081, n542]));
    let n1083 = egraph.add(SymbolLang::new("F540", vec![n1082, n1081, n542]));
    let n1084 = egraph.add(SymbolLang::leaf("0.0011146383"));
    let n1085 = egraph.add(SymbolLang::new("Foo", vec![n514, n1084, n542]));
    let n1086 = egraph.add(SymbolLang::new("F540", vec![n1085, n1084, n542]));
    let n1087 = egraph.add(SymbolLang::new("F550", vec![n1083, n1086, n0, n545, n546, n558, n572, n545]));
    let n1088 = egraph.add(SymbolLang::new("F553", vec![n1087, n516, n518, n520, n522, n551, n552]));
    let n1089 = egraph.add(SymbolLang::new("F554", vec![n1088]));
    let n1090 = egraph.add(SymbolLang::leaf("0.008358536"));
    let n1091 = egraph.add(SymbolLang::new("Foo", vec![n1089, n1090, n542]));
    let n1092 = egraph.add(SymbolLang::new("F540", vec![n1091, n1090, n542]));
    let n1093 = egraph.add(SymbolLang::leaf("0.002202952"));
    let n1094 = egraph.add(SymbolLang::new("Foo", vec![n524, n1093, n542]));
    let n1095 = egraph.add(SymbolLang::new("F540", vec![n1094, n1093, n542]));
    let n1096 = egraph.add(SymbolLang::new("F550", vec![n1092, n1095, n0, n545, n546, n545, n548, n545]));
    let n1097 = egraph.add(SymbolLang::new("F553", vec![n1096, n526, n528, n530, n532, n551, n552]));
    let n1098 = egraph.add(SymbolLang::leaf("0.11656689"));
    let n1099 = egraph.add(SymbolLang::leaf("59"));
    let n1100 = egraph.add(SymbolLang::new("Foo", vec![n1097, n1098, n1099]));
    let n1101 = egraph.add(SymbolLang::new("F540", vec![n1100, n1098, n1099]));
    let n1102 = egraph.add(SymbolLang::new("F597", vec![n1101, n1074]));
    let n1103 = egraph.add(SymbolLang::new("F554", vec![n1102]));
    let n1104 = egraph.add(SymbolLang::leaf("0.10561859"));
    let n1105 = egraph.add(SymbolLang::new("Foo", vec![n1103, n1104, n542]));
    let n1106 = egraph.add(SymbolLang::new("F540", vec![n1105, n1104, n542]));
    let n1107 = egraph.add(SymbolLang::new("F1107", vec![n1106]));
    let n1108 = egraph.add(SymbolLang::leaf("0.03568802"));
    let n1109 = egraph.add(SymbolLang::new("Foo", vec![n1107, n1108, n542]));
    let n1110 = egraph.add(SymbolLang::new("F540", vec![n1109, n1108, n542]));
    let n1111 = egraph.add(SymbolLang::new("F1111", vec![n1110, n546]));
    let n1112 = egraph.add(SymbolLang::leaf("0.00580423"));
    let n1113 = egraph.add(SymbolLang::new("Foo", vec![n534, n1112, n542]));
    let n1114 = egraph.add(SymbolLang::new("F540", vec![n1113, n1112, n542]));
    let n1115 = egraph.add(SymbolLang::leaf("1.0"));
    let n1116 = egraph.add(SymbolLang::new("F1116", vec![n1111, n1114, n536, n1115, n1115, n0, n546]));
    let root_id = egraph.add(SymbolLang::new("Root", vec![n1116]));

    let rules: &[Rewrite<SymbolLang, ()>] = &[
        rewrite!("simplify"; "(Foo (Constant ?n) ?b ?c)" => "(Constant ?n)"),
    ];

    let get_first_enode = |id| egraph[id].nodes[0].clone();
    let root_start = get_first_enode(root_id).build_recexpr(get_first_enode);

    let mut runner = Runner::default().with_egraph(egraph).run(rules);

    let extractor = Extractor::new(&runner.egraph, AstSize);

    let root_end = extractor.find_best(root_id).1;

    let explanation = runner.explain_equivalence(&root_start, &root_end);
    if do_print {
        println!("{:#?}", explanation.explanation_trees);
    }
}
oflatt commented 2 years ago

Hi @derekelkins, thanks for the report! This is indeed very weird, I'm investigating it now.

oflatt commented 2 years ago

This is a great bug find! The problem is that in the explanation generation code, the initial expression is used to populate the beginning of the explanation. While the rest of the explanations code properly caches shared sub-expressions in the same way that RecExpr does, this initial population does not.

I'll fix it with the next release! Along with the fix will be an algorithm for reducing proof sizes as well.

oflatt commented 2 years ago

Fixed by https://github.com/egraphs-good/egg/pull/155

derekelkins commented 2 years ago

Thanks for the quick response. Using the pull request branch for the egg dependency does perform well for me. I can also verify that the PR didn't change the behavior for my use-case.