From 0b8d300b13e195086029de31147ed2264ba519ba Mon Sep 17 00:00:00 2001 From: T6 Date: Sat, 4 Jan 2025 07:56:58 -0500 Subject: [PATCH] vine: object structs (#158) --- dprint.json | 2 +- ivy/src/optimize.rs | 19 +- ivy/src/optimize/eta_reduce.rs | 7 +- ivy/src/optimize/inline_globals.rs | 7 +- tests/programs/aoc_2024/day_01.vi | 4 +- tests/programs/aoc_2024/day_02.vi | 2 +- tests/programs/aoc_2024/day_04.vi | 2 +- tests/programs/aoc_2024/day_07.vi | 10 +- tests/programs/aoc_2024/day_10.vi | 2 +- tests/programs/aoc_2024/day_12.vi | 20 +- tests/programs/aoc_2024/day_17.vi | 2 +- tests/programs/aoc_2024/day_18.vi | 4 +- tests/programs/aoc_2024/day_23.vi | 6 +- tests/programs/cyclist.vi | 2 +- tests/programs/fmt/objects.vi | 11 + tests/programs/inverse.vi | 2 +- tests/programs/option_party.vi | 16 +- tests/programs/repl/misc.vi | 4 +- tests/programs/repl/objects.vi | 14 + tests/snaps/vine/aoc_2024/day_01/compiled.iv | 62 ++- tests/snaps/vine/aoc_2024/day_01/stats.txt | 12 +- tests/snaps/vine/aoc_2024/day_02/compiled.iv | 62 +-- tests/snaps/vine/aoc_2024/day_02/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_03/compiled.iv | 40 +- tests/snaps/vine/aoc_2024/day_04/compiled.iv | 154 +++---- tests/snaps/vine/aoc_2024/day_04/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_05/compiled.iv | 58 ++- tests/snaps/vine/aoc_2024/day_05/stats.txt | 4 +- tests/snaps/vine/aoc_2024/day_06/compiled.iv | 116 ++--- tests/snaps/vine/aoc_2024/day_06/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_07/compiled.iv | 58 +-- tests/snaps/vine/aoc_2024/day_08/compiled.iv | 98 ++--- tests/snaps/vine/aoc_2024/day_08/stats.txt | 12 +- tests/snaps/vine/aoc_2024/day_09/compiled.iv | 48 +-- tests/snaps/vine/aoc_2024/day_10/compiled.iv | 68 +-- tests/snaps/vine/aoc_2024/day_10/stats.txt | 16 +- tests/snaps/vine/aoc_2024/day_11/compiled.iv | 90 ++-- tests/snaps/vine/aoc_2024/day_12/compiled.iv | 88 ++-- tests/snaps/vine/aoc_2024/day_12/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_13/compiled.iv | 64 +-- tests/snaps/vine/aoc_2024/day_13/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_14/compiled.iv | 182 ++++---- tests/snaps/vine/aoc_2024/day_14/stats.txt | 4 +- tests/snaps/vine/aoc_2024/day_15/compiled.iv | 400 +++++++++--------- tests/snaps/vine/aoc_2024/day_15/stats.txt | 4 +- tests/snaps/vine/aoc_2024/day_16/compiled.iv | 272 ++++++------ tests/snaps/vine/aoc_2024/day_16/stats.txt | 12 +- tests/snaps/vine/aoc_2024/day_17/compiled.iv | 166 ++++---- tests/snaps/vine/aoc_2024/day_17/stats.txt | 4 +- tests/snaps/vine/aoc_2024/day_18/compiled.iv | 228 +++++----- tests/snaps/vine/aoc_2024/day_18/stats.txt | 12 +- tests/snaps/vine/aoc_2024/day_19/compiled.iv | 106 ++--- tests/snaps/vine/aoc_2024/day_20/compiled.iv | 170 ++++---- tests/snaps/vine/aoc_2024/day_20/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_21/compiled.iv | 176 ++++---- tests/snaps/vine/aoc_2024/day_21/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_22/compiled.iv | 62 +-- tests/snaps/vine/aoc_2024/day_23/compiled.iv | 180 ++++---- tests/snaps/vine/aoc_2024/day_23/stats.txt | 8 +- tests/snaps/vine/aoc_2024/day_24/compiled.iv | 104 +++-- tests/snaps/vine/aoc_2024/day_24/stats.txt | 4 +- tests/snaps/vine/aoc_2024/day_25/compiled.iv | 40 +- tests/snaps/vine/aoc_2024/day_25/stats.txt | 4 +- tests/snaps/vine/array_from_list/compiled.iv | 52 +-- tests/snaps/vine/array_order/compiled.iv | 52 +-- tests/snaps/vine/array_to_list/compiled.iv | 48 +-- tests/snaps/vine/basic_diverge/compiled.iv | 8 +- tests/snaps/vine/break_result/compiled.iv | 2 +- tests/snaps/vine/cat/compiled.iv | 8 +- tests/snaps/vine/classify_primes/compiled.iv | 8 +- tests/snaps/vine/cond_diverge/compiled.iv | 4 +- tests/snaps/vine/cyclist/compiled.iv | 24 +- tests/snaps/vine/fail/atypical.txt | 4 +- tests/snaps/vine/fail/is_not.txt | 2 +- tests/snaps/vine/fib/compiled.iv | 8 +- tests/snaps/vine/fib_repl/compiled.iv | 20 +- tests/snaps/vine/final_countdown/compiled.iv | 8 +- tests/snaps/vine/find_primes/compiled.iv | 8 +- tests/snaps/vine/fizzbuzz/compiled.iv | 8 +- tests/snaps/vine/fmt/objects.fmt.vi | 11 + tests/snaps/vine/guessing_game/compiled.iv | 52 +-- tests/snaps/vine/hello_world/compiled.iv | 2 +- tests/snaps/vine/inverse/compiled.iv | 40 +- tests/snaps/vine/logic/compiled.iv | 2 +- .../vine/loop_break_continue/compiled.iv | 10 +- tests/snaps/vine/loop_vi_loop/compiled.iv | 8 +- tests/snaps/vine/mandelbrot_sixel/compiled.iv | 12 +- tests/snaps/vine/mandelbrot_sixel/stats.txt | 12 +- tests/snaps/vine/mandelbrot_tga/compiled.iv | 4 +- tests/snaps/vine/mandelbrot_tga/stats.txt | 12 +- tests/snaps/vine/map_test/compiled.iv | 84 ++-- tests/snaps/vine/maybe_set/compiled.iv | 2 +- tests/snaps/vine/no_return/compiled.iv | 2 +- tests/snaps/vine/option_party/compiled.iv | 8 +- tests/snaps/vine/pretty_div/compiled.iv | 8 +- tests/snaps/vine/primeness/compiled.iv | 16 +- tests/snaps/vine/repl/misc.repl.vi | 4 +- tests/snaps/vine/repl/objects.repl.vi | 112 +++++ tests/snaps/vine/segmented_sieve/compiled.iv | 78 ++-- tests/snaps/vine/sieve/compiled.iv | 54 +-- tests/snaps/vine/so_random/compiled.iv | 12 +- tests/snaps/vine/stream_primes/compiled.iv | 8 +- tests/snaps/vine/sub_min/compiled.iv | 22 +- tests/snaps/vine/sum_divisors/compiled.iv | 24 +- tests/snaps/vine/verbose_add/compiled.iv | 8 +- tests/tests.rs | 18 + vine/examples/fib_repl.vi | 4 +- vine/examples/primeness.vi | 14 +- vine/src/ast.rs | 36 +- vine/src/checker.rs | 88 ++-- vine/src/checker/check_expr.rs | 134 ++++-- vine/src/checker/check_expr/check_method.rs | 9 +- vine/src/checker/check_pat.rs | 14 +- vine/src/checker/display_type.rs | 22 +- vine/src/checker/typeof_def.rs | 6 +- vine/src/checker/unify.rs | 21 +- vine/src/diag.rs | 6 +- vine/src/distiller.rs | 67 ++- vine/src/distiller/control_flow.rs | 51 ++- vine/src/distiller/pattern_matching.rs | 32 ++ vine/src/fmt.rs | 83 +++- vine/src/fmt/doc.rs | 31 +- vine/src/parser.rs | 111 +++-- vine/src/repl.rs | 35 +- vine/src/resolver.rs | 7 +- vine/src/resolver/build_graph.rs | 8 +- vine/src/resolver/resolve_defs.rs | 16 +- vine/src/visit.rs | 40 +- vine/std/array.vi | 4 +- vine/std/list.vi | 18 +- vine/std/map.vi | 62 +-- vine/std/option.vi | 22 +- vine/std/result.vi | 24 +- vine/std/tuple.vi | 8 +- 134 files changed, 2889 insertions(+), 2353 deletions(-) create mode 100644 tests/programs/fmt/objects.vi create mode 100644 tests/programs/repl/objects.vi create mode 100644 tests/snaps/vine/fmt/objects.fmt.vi create mode 100644 tests/snaps/vine/repl/objects.repl.vi diff --git a/dprint.json b/dprint.json index 8b7a3c14..3d5e29cf 100644 --- a/dprint.json +++ b/dprint.json @@ -10,7 +10,7 @@ "exts": ["vi"] }] }, - "excludes": ["tests/programs/fail", "tests/programs/repl", "tests/snaps"], + "excludes": ["tests/programs/fail", "tests/programs/repl", "tests/programs/fmt", "tests/snaps"], "plugins": [ "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm", "https://plugins.dprint.dev/json-0.19.3.wasm", diff --git a/ivy/src/optimize.rs b/ivy/src/optimize.rs index d932a7e1..bcb31548 100644 --- a/ivy/src/optimize.rs +++ b/ivy/src/optimize.rs @@ -17,12 +17,21 @@ pub struct Optimizer { impl Optimizer { pub fn optimize(&mut self, nets: &mut Nets) { prune(nets); - for (_, net) in nets.iter_mut() { - self.inline_vars.apply(net); - net.eta_reduce(); - self.inline_vars.apply(net); + loop { + for (_, net) in nets.iter_mut() { + loop { + self.inline_vars.apply(net); + let reduced = net.eta_reduce(); + if !reduced { + break; + } + } + } + let inlined = inline_globals(nets); + if !inlined { + break; + } } - inline_globals(nets); prune(nets); } } diff --git a/ivy/src/optimize/eta_reduce.rs b/ivy/src/optimize/eta_reduce.rs index eb3a9963..3fe5da1d 100644 --- a/ivy/src/optimize/eta_reduce.rs +++ b/ivy/src/optimize/eta_reduce.rs @@ -8,16 +8,17 @@ use crate::ast::{Net, Tree}; impl Net { /// Apply eta-reduction rules to every net; replacing `(_ _)` with `_` and /// `(a b) ... (a b)` with `x ... x`. - pub fn eta_reduce(&mut self) { + pub fn eta_reduce(&mut self) -> bool { let mut walker = WalkTrees::default(); for tree in self.trees() { walker.walk_tree(tree); } let nodes = { walker }.nodes; - let mut reducer = ReduceTrees { nodes: &nodes, index: 0 }; + let mut reducer = ReduceTrees { nodes: &nodes, index: 0, reduced: false }; for tree in self.trees_mut() { reducer.reduce_tree(tree); } + reducer.reduced } } @@ -70,6 +71,7 @@ impl<'a> WalkTrees<'a> { struct ReduceTrees<'a> { nodes: &'a [NodeKind], index: usize, + reduced: bool, } impl<'a> ReduceTrees<'a> { @@ -87,6 +89,7 @@ impl<'a> ReduceTrees<'a> { _ => false, }; if reducible { + self.reduced = true; *tree = take(a); return ak; } diff --git a/ivy/src/optimize/inline_globals.rs b/ivy/src/optimize/inline_globals.rs index 8cc7e2c6..a8f43450 100644 --- a/ivy/src/optimize/inline_globals.rs +++ b/ivy/src/optimize/inline_globals.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use crate::ast::{Net, Nets, Tree}; /// Inline any globals defined to be single-node nets. -pub fn inline_globals(nets: &mut Nets) { +pub fn inline_globals(nets: &mut Nets) -> bool { let mut inliner = Inliner::default(); inliner.populate_candidates(nets); for (_, net) in nets.iter_mut() { @@ -11,11 +11,13 @@ pub fn inline_globals(nets: &mut Nets) { inliner.process(tree); } } + inliner.inlined } #[derive(Debug, Default)] struct Inliner { candidates: HashMap, + inlined: bool, } impl Inliner { @@ -35,10 +37,11 @@ impl Inliner { } } - fn process(&self, tree: &mut Tree) { + fn process(&mut self, tree: &mut Tree) { if let Tree::Global(name) = tree { if let Some(inlined) = self.candidates.get(name) { *tree = inlined.clone(); + self.inlined = true; } } else { for t in tree.children_mut() { diff --git a/tests/programs/aoc_2024/day_01.vi b/tests/programs/aoc_2024/day_01.vi index 093d3458..fcf12ade 100644 --- a/tests/programs/aoc_2024/day_01.vi +++ b/tests/programs/aoc_2024/day_01.vi @@ -11,8 +11,8 @@ pub fn main(&io: &IO) { (left, right) }); - let left = lines.map(fn((left, _)) left); - let right = lines.map(fn((_, right)) right); + let left = lines.map(fn((left, _)) { left }); + let right = lines.map(fn((_, right)) { right }); left.sort_by(N32::ascending); right.sort_by(N32::ascending); diff --git a/tests/programs/aoc_2024/day_02.vi b/tests/programs/aoc_2024/day_02.vi index d8732d4d..3405ec01 100644 --- a/tests/programs/aoc_2024/day_02.vi +++ b/tests/programs/aoc_2024/day_02.vi @@ -11,7 +11,7 @@ pub fn main(&io: &IO) { let iter = lines.into_iter(); while iter.next() is Some(line) { - let report = line.split(" ").map(fn(x) N32::parse(x).unwrap()); + let report = line.split(" ").map(fn(x) { N32::parse(x).unwrap() }); if is_safe(report) { safe_count += 1; dampened_safe_count += 1; diff --git a/tests/programs/aoc_2024/day_04.vi b/tests/programs/aoc_2024/day_04.vi index 96941a53..c9ac55e5 100644 --- a/tests/programs/aoc_2024/day_04.vi +++ b/tests/programs/aoc_2024/day_04.vi @@ -121,7 +121,7 @@ fn diamond[T, M, X](grid: List[List[T]], f: fn(T, Neighbors[M], &X), d: M, state let north_east = List::new(width, neglect_channel(d)); while grid.pop_front() is Some(row) { let west = neglect_channel(d); - { + do { let north = north.iter(); let north_west = north_west.iter(); let ~north_east = north_east.iter(); diff --git a/tests/programs/aoc_2024/day_07.vi b/tests/programs/aoc_2024/day_07.vi index e00afaaf..8d61f411 100644 --- a/tests/programs/aoc_2024/day_07.vi +++ b/tests/programs/aoc_2024/day_07.vi @@ -13,16 +13,16 @@ pub fn main(&io: &IO) { while nums.pop_front() is Some(num) { let len = num.len(); let num = N64::from_n32(N32::parse(num).unwrap()); - let add = results.map(fn(x: N64) x.add(num)); - let mul = results.map(fn(x: N64) x.mul(num)); + let add = results.map(fn(x: N64) { x.add(num) }); + let mul = results.map(fn(x: N64) { x.mul(num) }); let pow = 1; while len > 0 { pow *= 10; len -= 1; } - let add2 = results2.map(fn(x: N64) x.add(num)); - let mul2 = results2.map(fn(x: N64) x.mul(num)); - let concat = (results ++ results2).map(fn(x: N64) x.mul(N64::from_n32(pow)).add(num)); + let add2 = results2.map(fn(x: N64) { x.add(num) }); + let mul2 = results2.map(fn(x: N64) { x.mul(num) }); + let concat = (results ++ results2).map(fn(x: N64) { x.mul(N64::from_n32(pow)).add(num) }); results = add ++ mul; results2 = add2 ++ mul2 ++ concat; } diff --git a/tests/programs/aoc_2024/day_10.vi b/tests/programs/aoc_2024/day_10.vi index 7a8c0b51..8ac04700 100644 --- a/tests/programs/aoc_2024/day_10.vi +++ b/tests/programs/aoc_2024/day_10.vi @@ -140,7 +140,7 @@ fn cross[T, M, X](grid: List[List[T]], f: fn(T, Neighbors[M], &X), d: M, &state: let north = List::new(width, neglect_channel(d)); while grid.pop_front() is Some(row) { let west = neglect_channel(d); - { + do { let north = north.iter(); while row.pop_front() is Some(cell) { let (w, e) = foo_channel(&west); diff --git a/tests/programs/aoc_2024/day_12.vi b/tests/programs/aoc_2024/day_12.vi index 0e139107..f5bb248e 100644 --- a/tests/programs/aoc_2024/day_12.vi +++ b/tests/programs/aoc_2024/day_12.vi @@ -33,10 +33,10 @@ pub fn main(&io: &IO) { let &Regions(array) = ®ions; while i < array.len() { match *array.get(i) { - Region::Root(a, p) => { + Region::Root(a, p) { price += a * (a * 4 - p * 2); - }, - _ => {}, + } + _ {} } i += 1; } @@ -89,8 +89,8 @@ enum Region { mod Region { pub fn to_string(self: Region) -> String { match self { - Region::Root(a, p) => "Root(" ++ a.to_string() ++ ", " ++ p.to_string() ++ ")", - Region::Child(n) => "Child(" ++ n.to_string() ++ ")", + Region::Root(a, p) { "Root(" ++ a.to_string() ++ ", " ++ p.to_string() ++ ")" } + Region::Child(n) { "Child(" ++ n.to_string() ++ ")" } } } } @@ -120,23 +120,23 @@ mod Regions { let i = self.find(i); let &Regions(array) = &self; match *array.get(i) { - Region::Root(a, _) => a, + Region::Root(a, _) { a } } } pub fn union_found(&Regions(array), i: N32, j: N32) -> N32 { if i == j { match array.get(i) { - &Region::Root(_, p) => { + &Region::Root(_, p) { p += 1; - }, + } } i } else { let &r = array.get(i); let &s = array.get(j); match (r, s) { - (Region::Root(ra, rp), Region::Root(sa, sp)) => { + (Region::Root(ra, rp), Region::Root(sa, sp)) { let a = ra + sa; let p = rp + sp + 1; if ra < sa { @@ -148,7 +148,7 @@ mod Regions { s = Region::Child(i); i } - }, + } } } } diff --git a/tests/programs/aoc_2024/day_17.vi b/tests/programs/aoc_2024/day_17.vi index d18f439a..54d05027 100644 --- a/tests/programs/aoc_2024/day_17.vi +++ b/tests/programs/aoc_2024/day_17.vi @@ -15,7 +15,7 @@ pub fn main(&io: &IO) { let b = N32::parse(read_value()).unwrap(); let c = N32::parse(read_value()).unwrap(); - let program = read_value().split(",").map(fn(x) N32::parse(x).unwrap()); + let program = read_value().split(",").map(fn(x) { N32::parse(x).unwrap() }); let program = Array::from_list(program); let output = []; diff --git a/tests/programs/aoc_2024/day_18.vi b/tests/programs/aoc_2024/day_18.vi index 0dd1d0a5..45418c5e 100644 --- a/tests/programs/aoc_2024/day_18.vi +++ b/tests/programs/aoc_2024/day_18.vi @@ -127,7 +127,7 @@ mod DisjointSet { let &a_node = array.get(a); let &b_node = array.get(b); match (&a_node, &b_node) { - (&Node::Root(a_size), &Node::Root(b_size)) => { + (&Node::Root(a_size), &Node::Root(b_size)) { if a_size < b_size { a_node = Node::Child(b); b_size += a_size; @@ -137,7 +137,7 @@ mod DisjointSet { a_size += b_size; a } - }, + } } } } diff --git a/tests/programs/aoc_2024/day_23.vi b/tests/programs/aoc_2024/day_23.vi index b14b8518..b39d0af5 100644 --- a/tests/programs/aoc_2024/day_23.vi +++ b/tests/programs/aoc_2024/day_23.vi @@ -14,7 +14,7 @@ pub fn main(&io: &IO) { (*graph.get_or_insert(a, Map::new(N32::cmp))).insert(b, ()); } - { + do { let graph = graph; let triangles = 0; let t_triangles = 0; @@ -65,8 +65,8 @@ pub fn main(&io: &IO) { let best = []; while graph.remove_min() is Some((a, tips)) { - extend_clique(&graph, &best, [a], tips.to_list().map(fn((x, _)) x)); + extend_clique(&graph, &best, [a], tips.to_list().map(fn((x, _)) { x })); } - io.println("Part 2: " ++ best.map(fn(x: N32) ['a' + x / 26, 'a' + x % 26]).join(",")); + io.println("Part 2: " ++ best.map(fn(x: N32) { ['a' + x / 26, 'a' + x % 26] }).join(",")); } diff --git a/tests/programs/cyclist.vi b/tests/programs/cyclist.vi index 1e7e7d80..adf5d3fc 100644 --- a/tests/programs/cyclist.vi +++ b/tests/programs/cyclist.vi @@ -4,7 +4,7 @@ use std::option::Option::Some; pub fn main(&io: &IO) { let list = [0]; while list.len() < 32 { - list ++= list.map(fn(x: N32) list.len() + x); + list ++= list.map(fn(x: N32) { list.len() + x }); } while list.pop_front() is Some(val) { diff --git a/tests/programs/fmt/objects.vi b/tests/programs/fmt/objects.vi new file mode 100644 index 00000000..7ce18550 --- /dev/null +++ b/tests/programs/fmt/objects.vi @@ -0,0 +1,11 @@ + +struct Foo{a:N32,b:String,c:F32,d:{p:List[N32],q:&Char}} + +fn foo(Foo({a:a:N32,b:x:String,c::F32,d})) +{ Foo({ a:a, + b:x, + c, + d: {p:d.p,q:d.q} +}) } + + diff --git a/tests/programs/inverse.vi b/tests/programs/inverse.vi index 30a020f1..7d57c249 100644 --- a/tests/programs/inverse.vi +++ b/tests/programs/inverse.vi @@ -24,7 +24,7 @@ mod refs { } fn fns(&io: &IO) { - let f = { + let f = do { let n: N32; (move ~n, n * n) }; diff --git a/tests/programs/option_party.vi b/tests/programs/option_party.vi index 4c1d0834..b670ec3b 100644 --- a/tests/programs/option_party.vi +++ b/tests/programs/option_party.vi @@ -4,8 +4,8 @@ use std::option::Option::{Option, Some, None}; pub fn main(&io: &IO) { dyn fn print_option_n32(option: Option[N32]) { io.println(" " ++ match option { - Some(val) => "Some(" ++ val.to_string() ++ ")", - None => "None", + Some(val) { "Some(" ++ val.to_string() ++ ")" } + None { "None" } }) } @@ -22,9 +22,9 @@ pub fn main(&io: &IO) { } io.println("map:"); - print_option_n32(None.map(fn(x: N32) x + 1)); - print_option_n32(Some(0).map(fn(x: N32) x + 1)); - print_option_n32(Some(100).map(fn(x: N32) x + 1)); + print_option_n32(None.map(fn(x: N32) { x + 1 })); + print_option_n32(Some(0).map(fn(x: N32) { x + 1 })); + print_option_n32(Some(100).map(fn(x: N32) { x + 1 })); io.println("increment_option:"); let option = None; @@ -83,11 +83,11 @@ pub fn main(&io: &IO) { fn increment_option(&option: &Option[N32]) { match option.as_ref() { - Some(&x) => x += 1, - None => {}, + Some(&x) { x += 1 } + None {} } } fn add_options(a: Option[N32], b: Option[N32]) -> Option[N32] { - a.and_then(fn(a: N32) b.map(fn(b: N32) a + b)) + a.and_then(fn(a: N32) { b.map(fn(b: N32) { a + b }) }) } diff --git a/tests/programs/repl/misc.vi b/tests/programs/repl/misc.vi index c9e0f8ce..61c9eb2d 100644 --- a/tests/programs/repl/misc.vi +++ b/tests/programs/repl/misc.vi @@ -13,8 +13,8 @@ fn _foo() {} [1,2,3,4].reversed() let a = Array::from_fn(5, &(0; _), fn(&x: &N32) { let n = x; x += 1; n }); a.for_each(&io, fn(&io: &IO, v: N32) { io.println(v.to_string() )}) --a.fold_front(0, fn(a: N32, b: N32) a - b) --a.fold_back(5, fn(a: N32, b: N32) a - b) +-a.fold_front(0, fn(a: N32, b: N32) { a - b }) +-a.fold_back(5, fn(a: N32, b: N32) { a - b }) move a Array::from_list([1,2,3,4,5,6,7,8,9]).reversed().to_list() List::new(100, "") diff --git a/tests/programs/repl/objects.vi b/tests/programs/repl/objects.vi new file mode 100644 index 00000000..07355106 --- /dev/null +++ b/tests/programs/repl/objects.vi @@ -0,0 +1,14 @@ +let x = { a: 1, c: 3, b: 2 } +(x.a, x.b, x.c) +(x.c, x.b, x.a) +let y = { x } +let z = { y } +z.y.x.a +z.y.x.a += y.x.b +let { y: { x: o } } = z +let { c, b, a } = o +a + b + c +x.p +do { let { p } = x } +z = { Y: y } +z = { y: 1 } diff --git a/tests/snaps/vine/aoc_2024/day_01/compiled.iv b/tests/snaps/vine/aoc_2024/day_01/compiled.iv index cbb04a7e..c0c00f2a 100644 --- a/tests/snaps/vine/aoc_2024/day_01/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_01/compiled.iv @@ -42,20 +42,14 @@ ::std::list::List::IntoIter::next = fn(ref(w2 w7) enum(::day_01::main::12 enum(::day_01::main::13 x(w5 x(w3 x(w7 w0)))))) } -::day_01::main::9 { - x(x(w3 w3) _) - _ = _ -} +::day_01::main::9 { x(x(w3 w3) _) } ::day_01::main::12 { enum(dup55(w11 w14) x(x(@add(w13 w9) w19) x(w4 x(w3 dup54(@lt$(w11 ?(::day_01::main::17 ::day_01::main::16 x(w15 x(w14 w13)))) w15))))) ::day_01::main::5 = x(x(w9 w19) x(w4 w3)) } -::day_01::main::13 { - x(x(w4 w4) _) - _ = _ -} +::day_01::main::13 { x(x(w4 w4) _) } ::day_01::main::16 { x(@sub(w4 w2) x(w4 w2)) } @@ -102,7 +96,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup570(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup561(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -121,7 +115,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup664(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup655(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -134,23 +128,23 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup676(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup667(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup743(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup734(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup754(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup745(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup763(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup754(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup773(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup764(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -182,7 +176,7 @@ } ::std::list::List::sort_by::5 { - enum(w0 x(w5 x(dup884(w22 w26) x(w3 w25)))) + enum(w0 x(w5 x(dup875(w22 w26) x(w3 w25)))) ::std::list::List::sort_by::7 = x(w22 x(x(w3 w21) x(x(w0 w19) x(tup(0 tup(w15 w15)) w17)))) ::std::list::List::concat = fn(w17 fn(tup(1 tup(tup(w19 w23) w23)) w11)) ::std::list::List::concat = fn(w11 fn(w21 w13)) @@ -196,7 +190,7 @@ ::std::list::List::pop_front = fn(ref(w10 w1) enum(::std::list::List::sort_by::10 enum(::std::list::List::sort_by::11 x(w11 x(x(w1 w17) w8))))) } -::std::list::List::sort_by::10 { enum(w0 x(dup904(fn(ref(w5 w12) fn(ref(w0 w15) ?(::std::list::List::sort_by::14 ::std::list::List::sort_by::13 x(w25 x(w7 x(x(w12 w22) x(w3 w15))))))) w25) x(w7 x(x(w5 w22) w3)))) } +::std::list::List::sort_by::10 { enum(w0 x(dup895(fn(ref(w5 w12) fn(ref(w0 w15) ?(::std::list::List::sort_by::14 ::std::list::List::sort_by::13 x(w25 x(w7 x(x(w12 w22) x(w3 w15))))))) w25) x(w7 x(x(w5 w22) w3)))) } ::std::list::List::sort_by::11 { x(_ x(x(w5 w5) x(x(w3 w3) x(w1 w1)))) } @@ -211,9 +205,9 @@ ::std::list::List::sort_by::7 = x(w12 x(w11 x(w9 x(w1 w15)))) } -::std::list::List::iter { fn(ref(tup(dup933(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup924(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup940(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup931(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -226,7 +220,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup969(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup960(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -241,7 +235,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1016(w1 w20) x(w12 w18))) + x(w14 x(dup1007(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -259,20 +253,20 @@ } ::std::list::List::split_trim::2 { - x(w24 x(dup1041(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup1032(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::list::List::split_once = fn(w24 fn(w1 tup(w3 enum(::std::list::List::split_trim::24 enum(::std::list::List::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1052(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1045(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1047(w20 w31)))))) + ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1043(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1036(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1038(w20 w31)))))) } ::std::list::List::split_trim::4 { x(?(0 1 w3) w3) } ::std::list::List::split_trim::5 { x(_ 0) } -::std::list::List::split_trim::10 { x(x(w4 w4) x(_ x(_ _))) } +::std::list::List::split_trim::10 { x(x(w4 w4) _) } ::std::list::List::split_trim::11 { x(w5 x(?(::std::list::List::split_trim::13 ::std::list::List::split_trim::12 x(w5 w2)) w2)) } -::std::list::List::split_trim::12 { x(x(w3 w3) x(_ _)) } +::std::list::List::split_trim::12 { x(x(w3 w3) _) } ::std::list::List::split_trim::13 { x(x(w7 w3) x(w5 _)) @@ -316,7 +310,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1135(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1123(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -325,7 +319,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1149(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1137(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -357,7 +351,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2263(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2241(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -366,10 +360,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2273(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2251(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2276(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2254(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -377,7 +371,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2283(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2261(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -389,10 +383,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2294(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2272(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2303(dup2298(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2281(dup2276(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -411,7 +405,7 @@ ::std::n32::N32::parse::11 { x(w8 w8) } -::std::n32::N32::ascending { fn(ref(dup2321(w2 @lt(w11 w12)) w2) fn(ref(dup2322(w5 w11) w5) w12)) } +::std::n32::N32::ascending { fn(ref(dup2298(w2 @lt(w11 w12)) w2) fn(ref(dup2299(w5 w11) w5) w12)) } ::std::option::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } diff --git a/tests/snaps/vine/aoc_2024/day_01/stats.txt b/tests/snaps/vine/aoc_2024/day_01/stats.txt index 570610f2..1afe778f 100644 --- a/tests/snaps/vine/aoc_2024/day_01/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_01/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 18_298 - Annihilate 10_352 + Total 18_297 + Annihilate 10_351 Commute 572 - Copy 1_611 - Erase 1_668 + Copy 1_612 + Erase 1_667 Expand 2_516 Call 929 Branch 650 Memory Heap 7_568 B - Allocated 402_832 B - Freed 402_832 B + Allocated 402_816 B + Freed 402_816 B diff --git a/tests/snaps/vine/aoc_2024/day_02/compiled.iv b/tests/snaps/vine/aoc_2024/day_02/compiled.iv index 0fb16b25..7a5f676a 100644 --- a/tests/snaps/vine/aoc_2024/day_02/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_02/compiled.iv @@ -35,13 +35,13 @@ ::day_02::main::9 { x(x(@add(1 w1) w1) x(x(@add(1 w3) w3) _)) } ::day_02::main::10 { - x(x(w6 w6) x(w4 x(w2 w9))) - ::day_02::problem_dampener = fn(w2 ?(::day_02::main::13 ::day_02::main::12 x(w4 w9))) + x(x(w7 w7) x(w5 x(w3 w8))) + ::day_02::problem_dampener = fn(w3 ?(::day_02::main::12 ::day_02::main::11 x(w5 w8))) } -::day_02::main::12 { x(x(@add(1 w1) w1) _) } +::day_02::main::11 { x(x(@add(1 w1) w1) _) } -::day_02::main::13 { x(x(w2 w2) _) } +::day_02::main::12 { x(x(w2 w2) _) } ::day_02::is_safe { fn(w2 w10) @@ -59,7 +59,7 @@ ::day_02::is_safe::6 { x(_ x(_ x(_ 1))) } ::day_02::is_safe::10 { - enum(dup79(@lt$(w16 ?(::day_02::is_safe::14 ::day_02::is_safe::13 x(w20 x(w19 dup75(w22 @le(3 w25)))))) dup79(w19 w28)) x(w5 x(w4 x(dup78(w16 dup78(w20 w29)) w27)))) + enum(dup77(@lt$(w16 ?(::day_02::is_safe::14 ::day_02::is_safe::13 x(w20 x(w19 dup73(w22 @le(3 w25)))))) dup77(w19 w28)) x(w5 x(w4 x(dup76(w16 dup76(w20 w29)) w27)))) 1 = @le(w22 @n32_and(w25 ?(::day_02::is_safe::17 ::day_02::is_safe::16 x(w5 x(w4 x(w29 x(w28 w27))))))) } @@ -76,12 +76,12 @@ ::day_02::is_safe::17 { x(_ x(_ x(_ x(_ 0)))) } -::day_02::is_safe::21 { enum(@ne(w9 ?(::day_02::is_safe::25 ::day_02::is_safe::23 x(w5 x(w13 x(w12 w11))))) x(w5 x(dup104(w8 w13) x(dup105(@lt$(w8 w9) w12) w11)))) } +::day_02::is_safe::21 { enum(@ne(w9 ?(::day_02::is_safe::25 ::day_02::is_safe::23 x(w5 x(w13 x(w12 w11))))) x(w5 x(dup100(w8 w13) x(dup101(@lt$(w8 w9) w12) w11)))) } ::day_02::is_safe::23 { x(_ x(_ x(_ 0))) } ::day_02::is_safe::25 { - x(w3 x(dup120(w9 w15) x(@lt$(w9 w10) w14))) + x(w3 x(dup116(w9 w15) x(@lt$(w9 w10) w14))) ::std::option::Option::Some = fn(w10 w11) ::day_02::is_safe::27 = x(w11 x(w3 x(w15 x(w14 _)))) } @@ -103,7 +103,7 @@ } ::day_02::problem_dampener::5 { - enum(w0 x(dup142(w10 w17) x(dup143(w11 w16) w14))) + enum(w0 x(dup137(w10 w17) x(dup138(w11 w16) w14))) ::std::list::List::concat = fn(w10 fn(w11 w12)) ::day_02::is_safe = fn(w12 ?(::day_02::problem_dampener::9 ::day_02::problem_dampener::8 x(w17 x(w16 x(w0 w14))))) } @@ -129,7 +129,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup623(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup609(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -148,7 +148,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup717(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup703(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -161,23 +161,23 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup729(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup715(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup796(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup782(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup807(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup793(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup816(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup802(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup826(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup812(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -188,9 +188,9 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::list::List::iter { fn(ref(tup(dup986(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup972(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup993(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup979(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -203,7 +203,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1022(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1008(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -218,7 +218,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1069(w1 w20) x(w12 w18))) + x(w14 x(dup1055(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -236,20 +236,20 @@ } ::std::list::List::split_trim::2 { - x(w24 x(dup1094(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup1080(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::list::List::split_once = fn(w24 fn(w1 tup(w3 enum(::std::list::List::split_trim::24 enum(::std::list::List::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1105(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1098(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1100(w20 w31)))))) + ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1091(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1084(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1086(w20 w31)))))) } ::std::list::List::split_trim::4 { x(?(0 1 w3) w3) } ::std::list::List::split_trim::5 { x(_ 0) } -::std::list::List::split_trim::10 { x(x(w4 w4) x(_ x(_ _))) } +::std::list::List::split_trim::10 { x(x(w4 w4) _) } ::std::list::List::split_trim::11 { x(w5 x(?(::std::list::List::split_trim::13 ::std::list::List::split_trim::12 x(w5 w2)) w2)) } -::std::list::List::split_trim::12 { x(x(w3 w3) x(_ _)) } +::std::list::List::split_trim::12 { x(x(w3 w3) _) } ::std::list::List::split_trim::13 { x(x(w7 w3) x(w5 _)) @@ -293,7 +293,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1188(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1171(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -302,7 +302,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1202(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1185(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -334,7 +334,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2316(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2289(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -343,10 +343,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2326(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2299(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2329(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2302(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -354,7 +354,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2336(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2309(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -366,10 +366,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2347(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2320(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2356(dup2351(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2329(dup2324(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/aoc_2024/day_02/stats.txt b/tests/snaps/vine/aoc_2024/day_02/stats.txt index 8776eaeb..182e0ab3 100644 --- a/tests/snaps/vine/aoc_2024/day_02/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_02/stats.txt @@ -1,9 +1,9 @@ Interactions Total 31_820 - Annihilate 18_292 + Annihilate 18_291 Commute 573 - Copy 2_655 + Copy 2_656 Erase 2_964 Expand 4_552 Call 1_680 @@ -11,5 +11,5 @@ Interactions Memory Heap 4_992 B - Allocated 696_016 B - Freed 696_016 B + Allocated 696_000 B + Freed 696_000 B diff --git a/tests/snaps/vine/aoc_2024/day_03/compiled.iv b/tests/snaps/vine/aoc_2024/day_03/compiled.iv index c7690e0c..4b28d816 100644 --- a/tests/snaps/vine/aoc_2024/day_03/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_03/compiled.iv @@ -74,7 +74,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup548(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup536(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -93,7 +93,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup642(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup630(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -106,23 +106,23 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup654(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup642(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup721(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup709(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup732(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup720(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup741(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup729(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup751(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup739(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -152,7 +152,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup834(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup822(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -160,9 +160,9 @@ ::std::list::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::list::List::iter { fn(ref(tup(dup911(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup899(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup918(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup906(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -175,7 +175,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup947(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup935(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -190,7 +190,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup994(w1 w20) x(w12 w18))) + x(w14 x(dup982(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -228,7 +228,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1113(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1098(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -237,7 +237,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1127(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1112(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -269,7 +269,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2241(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2216(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -278,10 +278,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2251(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2226(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2254(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2229(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -289,7 +289,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2261(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2236(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -301,10 +301,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2272(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2247(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2281(dup2276(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2256(dup2251(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/aoc_2024/day_04/compiled.iv b/tests/snaps/vine/aoc_2024/day_04/compiled.iv index 8526ed7b..e6f4d7a8 100644 --- a/tests/snaps/vine/aoc_2024/day_04/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_04/compiled.iv @@ -8,7 +8,7 @@ ::std::n32::N32::to_string = fn(w11 w18) ::std::list::List::concat = fn(tup(6 tup(tup(88 tup(77 tup(65 tup(83 tup(58 tup(32 w68)))))) w68)) fn(w18 w19)) ::std::io::IO::println = fn(ref(w37 w14) fn(w19 _)) - ::day_04::diamond = fn(w21 fn(fn(dup19(@eq(65 ?(::day_04::main::26 ::day_04::main::25 x(w90 x(w70 x(w71 x(w72 x(w73 x(x(w76 w85) w83)))))))) w90) fn(tup(w70 tup(_ tup(w71 tup(_ tup(_ tup(w72 tup(_ w73))))))) fn(ref(w76 w85) w83))) fn(46 fn(0 w23)))) + ::day_04::diamond = fn(w21 fn(fn(dup19(@eq(65 ?(::day_04::main::24 ::day_04::main::23 x(w90 x(w70 x(w71 x(w72 x(w73 x(x(w76 w85) w83)))))))) w90) fn(tup(w70 tup(_ tup(w71 tup(_ tup(_ tup(w72 tup(_ w73))))))) fn(ref(w76 w85) w83))) fn(46 fn(0 w23)))) ::std::n32::N32::to_string = fn(w23 w30) ::std::list::List::concat = fn(tup(7 tup(tup(88 tup(45 tup(77 tup(65 tup(83 tup(58 tup(32 w91))))))) w91)) fn(w30 w31)) ::std::io::IO::println = fn(ref(w14 w26) fn(w31 _)) @@ -39,31 +39,31 @@ ::day_04::Channel::send = fn(w19 fn(88 _)) } -::day_04::main::10 { x(dup61(@eq(77 ?(::day_04::main::13 ::day_04::main::12 x(w26 w11))) w26) w11) } +::day_04::main::10 { x(dup61(@eq(77 ?(::day_04::main::12 ::day_04::main::11 x(w25 w12))) w25) w12) } -::day_04::main::12 { +::day_04::main::11 { x(w11 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 x(x(w2 w2) w12)))))))))) - ::day_04::main::16 = x(w11 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 w12))))))))) + ::day_04::main::15 = x(w11 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 w12))))))))) } -::day_04::main::13 { x(dup85(@eq(65 ?(::day_04::main::15 ::day_04::main::14 x(w25 w12))) w25) w12) } +::day_04::main::12 { x(dup84(@eq(65 ?(::day_04::main::14 ::day_04::main::13 x(w25 w12))) w25) w12) } -::day_04::main::14 { +::day_04::main::13 { x(w11 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 x(x(w2 w2) w12)))))))))) - ::day_04::main::16 = x(w11 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 w12))))))))) + ::day_04::main::15 = x(w11 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 w12))))))))) } -::day_04::main::15 { x(@eq(83 ?(::day_04::main::22 ::day_04::main::21 w11)) w11) } +::day_04::main::14 { x(@eq(83 ?(::day_04::main::20 ::day_04::main::19 w12)) w12) } -::day_04::main::16 { - x(dup121(@eq(77 ?(77 88 dup130(w4 dup130(w9 dup130(w14 w19))))) dup121(w5 dup121(w10 dup121(w15 w20)))) x(w30 x(w29 x(w28 x(w27 x(w26 x(w25 x(w24 x(w23 _))))))))) +::day_04::main::15 { + x(dup119(@eq(77 ?(77 88 dup128(w4 dup128(w9 dup128(w14 w19))))) dup119(w5 dup119(w10 dup119(w15 w20)))) x(w30 x(w29 x(w28 x(w27 x(w26 x(w25 x(w24 x(w23 _))))))))) ::day_04::relay = fn(w30 fn(w23 fn(w4 fn(w5 _)))) ::day_04::relay = fn(w29 fn(w24 fn(w9 fn(w10 _)))) ::day_04::relay = fn(w28 fn(w25 fn(w14 fn(w15 _)))) ::day_04::relay = fn(w27 fn(w26 fn(w19 fn(w20 _)))) } -::day_04::main::21 { +::day_04::main::19 { x(w38 x(w37 x(w36 x(w35 x(w34 x(w33 x(w32 x(w31 x(x(@add(w10 @add(w23 w27)) w27) _))))))))) ::day_04::check = fn(w38 fn(65 @add(w3 @add(w6 @add(w9 w10))))) ::day_04::check = fn(w36 fn(65 w3)) @@ -75,61 +75,61 @@ ::day_04::check = fn(w34 fn(65 w22)) } -::day_04::main::22 { x(_ x(_ x(_ x(_ x(_ x(_ x(_ x(_ x(x(w2 w2) _))))))))) } +::day_04::main::20 { x(_ x(_ x(_ x(_ x(_ x(_ x(_ x(_ x(x(w2 w2) _))))))))) } -::day_04::main::25 { +::day_04::main::23 { x(_ x(w19 x(w18 x(w17 x(w16 x(w15 w23)))))) - ::day_04::Channel::send = fn(w19 fn(65 dup156(@eq(77 ?(::day_04::main::32 ::day_04::main::28 x(w15 x(w27 x(w4 x(w7 x(w10 w23))))))) w27))) + ::day_04::Channel::send = fn(w19 fn(65 dup153(@eq(77 ?(::day_04::main::30 ::day_04::main::26 x(w15 x(w27 x(w4 x(w7 x(w10 w23))))))) w27))) ::day_04::Channel::send = fn(w18 fn(65 w4)) ::day_04::Channel::send = fn(w17 fn(65 w7)) ::day_04::Channel::send = fn(w16 fn(65 w10)) } -::day_04::main::26 { - x(dup162(w1 dup162(w4 dup162(w7 w10))) x(w18 x(w17 x(w16 x(w15 x(x(w14 w14) _)))))) +::day_04::main::24 { + x(dup159(w1 dup159(w4 dup159(w7 w10))) x(w18 x(w17 x(w16 x(w15 x(x(w14 w14) _)))))) ::day_04::Channel::send = fn(w18 fn(w1 _)) ::day_04::Channel::send = fn(w17 fn(w4 _)) ::day_04::Channel::send = fn(w16 fn(w7 _)) ::day_04::Channel::send = fn(w15 fn(w10 _)) } -::day_04::main::28 { x(w8 x(w6 x(w5 x(w4 x(dup174(@eq(83 ?(::day_04::main::32 ::day_04::main::30 x(w8 x(w6 x(w5 x(w4 x(w10 w9))))))) w10) w9))))) } +::day_04::main::26 { x(w8 x(w6 x(w5 x(w4 x(dup171(@eq(83 ?(::day_04::main::30 ::day_04::main::28 x(w8 x(w6 x(w5 x(w4 x(w10 w9))))))) w10) w9))))) } -::day_04::main::30 { +::day_04::main::28 { x(w6 x(_ x(w3 x(w2 x(_ w7))))) - ::day_04::main::38 = x(w6 x(w3 x(w2 w7))) + ::day_04::main::36 = x(w6 x(w3 x(w2 w7))) } -::day_04::main::32 { x(w8 x(@eq(83 ?(::day_04::main::34 ::day_04::main::33 x(w8 w5))) w5)) } +::day_04::main::30 { x(w8 x(@eq(83 ?(::day_04::main::32 ::day_04::main::31 x(w8 w5))) w5)) } -::day_04::main::33 { x(w7 x(w5 x(w4 x(@eq(77 ?(::day_04::main::36 ::day_04::main::38 x(w7 x(w5 x(w4 w8))))) w8)))) } +::day_04::main::31 { x(w7 x(w5 x(w4 x(@eq(77 ?(::day_04::main::34 ::day_04::main::36 x(w7 x(w5 x(w4 w8))))) w8)))) } -::day_04::main::34 { x(x(w5 w5) x(_ x(_ x(_ _)))) } +::day_04::main::32 { x(x(w5 w5) _) } -::day_04::main::36 { x(x(w4 w4) x(_ x(_ _))) } +::day_04::main::34 { x(x(w4 w4) _) } -::day_04::main::38 { x(w6 x(w4 x(dup221(@eq(77 ?(::day_04::main::43 ::day_04::main::39 x(w6 x(w4 x(w8 w7))))) w8) w7))) } +::day_04::main::36 { x(w6 x(w4 x(dup215(@eq(77 ?(::day_04::main::41 ::day_04::main::37 x(w6 x(w4 x(w8 w7))))) w8) w7))) } -::day_04::main::39 { x(w6 x(dup225(@eq(83 ?(::day_04::main::43 ::day_04::main::41 x(w6 x(w9 w3)))) w9) w3)) } +::day_04::main::37 { x(w6 x(dup219(@eq(83 ?(::day_04::main::41 ::day_04::main::39 x(w6 x(w9 w3)))) w9) w3)) } -::day_04::main::41 { +::day_04::main::39 { x(w4 x(_ x(_ w5))) - ::day_04::main::49 = x(w4 w5) + ::day_04::main::47 = x(w4 w5) } -::day_04::main::43 { x(w6 x(w4 x(@eq(83 ?(::day_04::main::45 ::day_04::main::44 x(w6 x(w4 w7)))) w7))) } +::day_04::main::41 { x(w6 x(w4 x(@eq(83 ?(::day_04::main::43 ::day_04::main::42 x(w6 x(w4 w7)))) w7))) } -::day_04::main::44 { x(w5 x(@eq(77 ?(::day_04::main::47 ::day_04::main::49 x(w5 w6))) w6)) } +::day_04::main::42 { x(w5 x(@eq(77 ?(::day_04::main::45 ::day_04::main::47 x(w5 w6))) w6)) } -::day_04::main::45 { x(x(w3 w3) x(_ _)) } +::day_04::main::43 { x(x(w3 w3) _) } -::day_04::main::47 { x(x(w2 w2) _) } +::day_04::main::45 { x(x(w2 w2) _) } -::day_04::main::49 { x(x(@add(1 w1) w1) _) } +::day_04::main::47 { x(x(@add(1 w1) w1) _) } ::day_04::Channel::send { fn(tup(w2 w5) fn(w5 w2)) } -::day_04::relay { fn(tup(@eq(w17 ?(::day_04::relay::4 ::day_04::relay::3 x(w20 w19))) w24) fn(tup(@eq(w22 ?(::day_04::relay::7 ::day_04::relay::6 x(w25 w24))) w19) fn(dup276(w17 w22) fn(dup277(w20 w25) _)))) } +::day_04::relay { fn(tup(@eq(w17 ?(::day_04::relay::4 ::day_04::relay::3 x(w20 w19))) w24) fn(tup(@eq(w22 ?(::day_04::relay::7 ::day_04::relay::6 x(w25 w24))) w19) fn(dup266(w17 w22) fn(dup267(w20 w25) _)))) } ::day_04::relay::3 { x(w2 w2) } @@ -142,9 +142,9 @@ ::day_04::check { fn(tup(@eq(w5 ?(0 1 w13)) 95) fn(w5 w13)) } ::day_04::diamond { - fn(w2 fn(w3 fn(dup301(w18 dup301(w23 dup301(w28 dup301(w50 dup301(w33 dup301(w36 w39)))))) fn(w5 w49)))) + fn(w2 fn(w3 fn(dup291(w18 dup291(w23 dup291(w28 dup291(w50 dup291(w33 dup291(w36 w39)))))) fn(w5 w49)))) ::std::list::List::get = fn(ref(w2 w9) fn(0 w12)) - ::std::list::List::len = fn(w12 dup304(w17 dup304(w22 w27))) + ::std::list::List::len = fn(w12 dup294(w17 dup294(w22 w27))) ::day_04::neglect_channel = fn(w18 w19) ::std::list::List::new = fn(w17 fn(w19 w20)) ::day_04::neglect_channel = fn(w23 w24) @@ -163,38 +163,38 @@ } ::day_04::diamond::5 { - enum(w0 x(w12 x(dup328(w81 w93) x(dup329(w13 dup329(w44 dup329(w51 dup329(w53 dup329(w63 dup329(w65 w92)))))) x(x(w9 w91) x(x(w7 w89) x(x(w5 w87) x(w3 w85)))))))) + enum(w0 x(w12 x(dup318(w82 w94) x(dup319(w13 dup319(w18 dup319(w25 dup319(w27 dup319(w37 dup319(w39 w93)))))) x(x(w9 w92) x(x(w7 w90) x(x(w5 w88) x(w3 w86)))))))) ::day_04::neglect_channel = fn(w13 w14) - ::std::list::List::iter = fn(ref(w7 w17) w19) - ::std::list::List::iter = fn(ref(w5 w22) w24) - ::std::list::List::iter = fn(ref(w3 w27) w71) - ::std::list::List::Iter::drop = fn(ref(w32 _) _) - ::day_04::diamond::7 = x(w81 x(x(w9 w80) x(w0 x(x(w14 w77) x(x(w19 w75) x(x(w24 w73) x(w32 w71))))))) - ::std::list::List::Iter::drop = fn(ref(w75 _) _) - ::std::list::List::Iter::drop = fn(ref(w73 _) _) - ::day_04::Channel::send = fn(w77 fn(w44 _)) - ::std::list::List::pop_front = fn(ref(w22 w47) w49) - ::std::option::Option::unwrap = fn(w49 w50) - ::day_04::Channel::send = fn(w50 fn(w51 _)) - ::day_04::neglect_channel = fn(w53 w54) - ::std::list::List::concat = fn(w47 fn(tup(1 tup(tup(w54 w82) w82)) w57)) - ::std::list::List::pop_front = fn(ref(w27 w59) w61) - ::std::option::Option::unwrap = fn(w61 w62) - ::day_04::Channel::send = fn(w62 fn(w63 _)) - ::day_04::neglect_channel = fn(w65 w66) - ::std::list::List::concat = fn(w59 fn(tup(1 tup(tup(w66 w83) w83)) w69)) - ::day_04::diamond::2 = x(w12 x(w93 x(w92 x(x(w80 w91) x(x(w17 w89) x(x(w57 w87) x(w69 w85))))))) + ::std::list::List::iter = fn(ref(w7 w45) w47) + ::std::list::List::iter = fn(ref(w5 w50) w52) + ::std::list::List::iter = fn(ref(w3 w55) w72) + ::std::list::List::Iter::drop = fn(ref(w60 _) _) + ::day_04::diamond::8 = x(w82 x(x(w9 w81) x(w0 x(x(w14 w78) x(x(w47 w76) x(x(w52 w74) x(w60 w72))))))) + ::std::list::List::Iter::drop = fn(ref(w76 _) _) + ::std::list::List::Iter::drop = fn(ref(w74 _) _) + ::day_04::Channel::send = fn(w78 fn(w18 _)) + ::std::list::List::pop_front = fn(ref(w50 w21) w23) + ::std::option::Option::unwrap = fn(w23 w24) + ::day_04::Channel::send = fn(w24 fn(w25 _)) + ::day_04::neglect_channel = fn(w27 w28) + ::std::list::List::concat = fn(w21 fn(tup(1 tup(tup(w28 w83) w83)) w31)) + ::std::list::List::pop_front = fn(ref(w55 w33) w35) + ::std::option::Option::unwrap = fn(w35 w36) + ::day_04::Channel::send = fn(w36 fn(w37 _)) + ::day_04::neglect_channel = fn(w39 w40) + ::std::list::List::concat = fn(w33 fn(tup(1 tup(tup(w40 w84) w84)) w43)) + ::day_04::diamond::2 = x(w12 x(w94 x(w93 x(x(w81 w92) x(x(w45 w90) x(x(w31 w88) x(w43 w86))))))) } ::day_04::diamond::6 { x(_ x(_ x(_ x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) x(w1 w1))))))) } -::day_04::diamond::7 { +::day_04::diamond::8 { x(w16 x(w15 x(w13 w12))) - ::std::list::List::pop_front = fn(ref(w13 w1) enum(::day_04::diamond::10 enum(::day_04::diamond::11 x(w16 x(w15 x(w1 w12)))))) + ::std::list::List::pop_front = fn(ref(w13 w1) enum(::day_04::diamond::11 enum(::day_04::diamond::12 x(w16 x(w15 x(w1 w12)))))) } -::day_04::diamond::10 { - enum(w0 x(dup374(fn(w0 fn(tup(w36 tup(w27 tup(w45 tup(w18 tup(w19 tup(w46 tup(w28 w37))))))) fn(ref(w12 w60) _))) w74) x(x(w12 w73) x(w10 x(x(w9 w70) x(x(w7 w68) x(x(w5 w66) x(w3 w64)))))))) +::day_04::diamond::11 { + enum(w0 x(dup365(fn(w0 fn(tup(w36 tup(w27 tup(w45 tup(w18 tup(w19 tup(w46 tup(w28 w37))))))) fn(ref(w12 w60) _))) w74) x(x(w12 w73) x(w10 x(x(w9 w70) x(x(w7 w68) x(x(w5 w66) x(w3 w64)))))))) ::day_04::foo_channel = fn(ref(w9 w15) tup(w18 w19)) ::std::list::List::Iter::next = fn(ref(w7 w22) w24) ::std::option::Option::unwrap = fn(w24 w25) @@ -205,10 +205,10 @@ ::std::list::List::Iter::next = fn(ref(w40 w3) w42) ::std::option::Option::unwrap = fn(w42 w43) ::day_04::foo_channel = fn(w43 tup(w45 w46)) - ::day_04::diamond::7 = x(w74 x(x(w60 w73) x(w10 x(x(w15 w70) x(x(w22 w68) x(x(w31 w66) x(w40 w64))))))) + ::day_04::diamond::8 = x(w74 x(x(w60 w73) x(w10 x(x(w15 w70) x(x(w22 w68) x(x(w31 w66) x(w40 w64))))))) } -::day_04::diamond::11 { x(_ x(x(w10 w10) x(_ x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) x(w1 w1))))))) } +::day_04::diamond::12 { x(_ x(x(w10 w10) x(_ x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) x(w1 w1))))))) } ::day_04::drop_all { fn(w2 fn(w3 _)) @@ -221,7 +221,7 @@ } ::day_04::drop_all::5 { - enum(w0 x(w3 dup416(w5 w7))) + enum(w0 x(w3 dup407(w5 w7))) ::day_04::Channel::send = fn(w0 fn(w5 _)) ::day_04::drop_all::2 = x(w3 w7) } @@ -231,7 +231,7 @@ ::day_04::new_channel = tup(w10 w11) } -::day_04::new_channel { tup(tup(dup427(_ w6) w8) tup(dup428(_ w8) w6)) } +::day_04::new_channel { tup(tup(dup418(_ w6) w8) tup(dup419(_ w8) w6)) } ::day_04::neglect_channel { fn(w2 tup(w2 _)) } @@ -246,7 +246,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup906(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup889(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -260,11 +260,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup951(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup934(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup958(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup941(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -279,7 +279,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup975(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup958(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -292,17 +292,17 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup1012(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup995(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::new { fn(w2 fn(w3 w11)) ::std::list::List::new::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::list::List::new::2 { x(dup1025(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } +::std::list::List::new::2 { x(dup1008(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } ::std::list::List::new::3 { - x(@sub(1 w6) x(dup1031(w3 w13) x(w8 w12))) + x(@sub(1 w6) x(dup1014(w3 w13) x(w8 w12))) ::std::list::List::push_back = fn(ref(w8 w1) fn(w3 _)) ::std::list::List::new::2 = x(w6 x(w13 x(w1 w12))) } @@ -314,7 +314,7 @@ ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup1046(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup1029(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -323,7 +323,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup1109(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup1092(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -339,9 +339,9 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::list::List::iter { fn(ref(tup(dup1269(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1252(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1276(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1259(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -352,7 +352,7 @@ ::std::list::List::Iter::drop { fn(ref(tup(_ ref(w9 w9)) _) _) } -::std::n32::N32::to_string { fn(dup2599(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2569(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -361,10 +361,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2609(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2579(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2612(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2582(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/aoc_2024/day_04/stats.txt b/tests/snaps/vine/aoc_2024/day_04/stats.txt index dcfe73df..4158b705 100644 --- a/tests/snaps/vine/aoc_2024/day_04/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_04/stats.txt @@ -1,9 +1,9 @@ Interactions Total 97_168 - Annihilate 37_482 + Annihilate 37_447 Commute 11_988 - Copy 19_265 + Copy 19_300 Erase 13_714 Expand 9_465 Call 2_945 @@ -11,5 +11,5 @@ Interactions Memory Heap 37_968 B - Allocated 1_986_880 B - Freed 1_986_880 B + Allocated 1_986_320 B + Freed 1_986_320 B diff --git a/tests/snaps/vine/aoc_2024/day_05/compiled.iv b/tests/snaps/vine/aoc_2024/day_05/compiled.iv index 653018ca..4330acd6 100644 --- a/tests/snaps/vine/aoc_2024/day_05/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_05/compiled.iv @@ -24,10 +24,7 @@ ::std::list::List::len = fn(ref(w0 w7) ?(::day_05::main::8 ::day_05::main::7 x(w5 x(w3 w7)))) } -::day_05::main::6 { - x(x(w3 w3) x(w1 w1)) - _ = _ -} +::day_05::main::6 { x(x(w3 w3) x(w1 w1)) } ::day_05::main::7 { x(w26 x(x(w24 w29) w22)) @@ -42,10 +39,7 @@ ::day_05::main::2 = x(w26 x(w16 w29)) } -::day_05::main::8 { - x(x(w4 w4) x(x(w2 w2) _)) - _ = _ -} +::day_05::main::8 { x(x(w4 w4) x(x(w2 w2) _)) } ::day_05::main::10 { x(x(w11 w18) w9) @@ -210,7 +204,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup778(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup770(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -224,11 +218,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup823(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup815(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup830(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup822(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -243,7 +237,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup847(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup839(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -256,17 +250,17 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup884(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup876(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::new { fn(w2 fn(w3 w11)) ::std::list::List::new::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::list::List::new::2 { x(dup897(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } +::std::list::List::new::2 { x(dup889(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } ::std::list::List::new::3 { - x(@sub(1 w6) x(dup903(w3 w13) x(w8 w12))) + x(@sub(1 w6) x(dup895(w3 w13) x(w8 w12))) ::std::list::List::push_back = fn(ref(w8 w1) fn(w3 _)) ::std::list::List::new::2 = x(w6 x(w13 x(w1 w12))) } @@ -278,7 +272,7 @@ ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup918(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup910(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -288,20 +282,20 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } ::std::list::List::map { - fn(tup(dup951(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup943(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup962(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup954(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup971(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup963(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup981(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup973(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -317,9 +311,9 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::list::List::iter { fn(ref(tup(dup1141(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1133(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1148(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1140(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -332,7 +326,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1177(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1169(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -347,7 +341,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1224(w1 w20) x(w12 w18))) + x(w14 x(dup1216(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -385,7 +379,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1343(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1332(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -394,7 +388,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1357(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1346(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -426,7 +420,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2471(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2450(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -435,10 +429,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2481(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2460(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2484(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2463(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -446,7 +440,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2491(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2470(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -458,10 +452,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2502(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2481(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2511(dup2506(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2490(dup2485(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/aoc_2024/day_05/stats.txt b/tests/snaps/vine/aoc_2024/day_05/stats.txt index c75a4730..498dbf53 100644 --- a/tests/snaps/vine/aoc_2024/day_05/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_05/stats.txt @@ -1,10 +1,10 @@ Interactions - Total 82_519 + Total 82_518 Annihilate 43_819 Commute 675 Copy 7_182 - Erase 7_240 + Erase 7_239 Expand 12_384 Call 6_488 Branch 4_731 diff --git a/tests/snaps/vine/aoc_2024/day_06/compiled.iv b/tests/snaps/vine/aoc_2024/day_06/compiled.iv index 49b71f9b..77004df5 100644 --- a/tests/snaps/vine/aoc_2024/day_06/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_06/compiled.iv @@ -56,10 +56,10 @@ } ::day_06::main::18 { - enum(tup(w2 w3) x(x(w13 w61) x(dup83(w31 w59) x(dup84(w14 w58) x(w9 x(@add(1 dup87(w41 w56)) x(w7 w55))))))) + enum(tup(w2 w3) x(x(w13 w61) x(dup82(w31 w59) x(dup83(w14 w58) x(w9 x(@add(1 dup86(w41 w56)) x(w7 w55))))))) ::std::array::Array::get = fn(ref(w14 w17) fn(w3 w21)) ::std::array::Array::get = fn(w21 fn(w2 ref(_ 35))) - ::day_06::walk = fn(ref(w17 _) fn(w31 tup(?(::day_06::main::22 ::day_06::main::21 x(x(w7 dup90(w45 w54)) _)) _))) + ::day_06::walk = fn(ref(w17 _) fn(w31 tup(?(::day_06::main::22 ::day_06::main::21 x(x(w7 dup89(w45 w54)) _)) _))) ::std::n32::N32::to_string = fn(w41 w42) ::std::list::List::concat = fn(w42 fn(tup(1 tup(tup(32 w53) w53)) w44)) ::std::n32::N32::to_string = fn(w45 w46) @@ -82,10 +82,10 @@ ::day_06::clear::2 = x(x(w16 w31) x(x(w6 w29) x(w13 x(w22 0)))) } -::day_06::clear::2 { x(w9 x(w7 x(dup123(w1 w12) x(w4 dup125(@lt(w1 ?(::day_06::clear::4 ::day_06::clear::3 x(w9 x(w7 x(w12 x(w4 w10)))))) w10))))) } +::day_06::clear::2 { x(w9 x(w7 x(dup121(w1 w12) x(w4 dup123(@lt(w1 ?(::day_06::clear::4 ::day_06::clear::3 x(w9 x(w7 x(w12 x(w4 w10)))))) w10))))) } ::day_06::clear::3 { - x(x(w17 w31) x(x(w15 w29) x(w13 x(dup133(w22 w26) dup134(w3 dup134(w21 @add(1 w10))))))) + x(x(w17 w31) x(x(w15 w29) x(w13 x(dup131(w22 w26) dup132(w3 dup132(w21 @add(1 w10))))))) ::std::array::Array::get = fn(ref(w17 w1) fn(w3 ref(w6 w20))) ::day_06::clear::5 = x(x(w15 w24) x(w22 x(w21 x(x(w6 w20) 0)))) ::day_06::clear::2 = x(x(w1 w31) x(x(w24 w29) x(w13 x(w26 w10)))) @@ -93,11 +93,11 @@ ::day_06::clear::4 { x(x(w6 w6) x(x(w4 w4) _)) } -::day_06::clear::5 { x(w9 x(dup143(w1 w14) x(w6 x(w5 dup147(@lt(w1 ?(::day_06::clear::7 ::day_06::clear::6 x(w9 x(w14 x(w6 x(w5 w10)))))) w10))))) } +::day_06::clear::5 { x(w9 x(dup141(w1 w14) x(w6 x(w5 dup145(@lt(w1 ?(::day_06::clear::7 ::day_06::clear::6 x(w9 x(w14 x(w6 x(w5 w10)))))) w10))))) } ::day_06::clear::6 { - x(x(w17 w33) x(w15 x(dup152(w24 w30) x(x(w13 w29) dup156(w3 dup156(w23 @add(1 w10))))))) - ::std::array::Array::get = fn(ref(w13 w1) fn(w3 ref(dup159(@eq(88 ?(::day_06::clear::10 ::day_06::clear::9 x(x(w17 w26) x(w24 x(w23 x(x(w21 w22) _)))))) w21) w22))) + x(x(w17 w33) x(w15 x(dup150(w24 w30) x(x(w13 w29) dup154(w3 dup154(w23 @add(1 w10))))))) + ::std::array::Array::get = fn(ref(w13 w1) fn(w3 ref(dup157(@eq(88 ?(::day_06::clear::10 ::day_06::clear::9 x(x(w17 w26) x(w24 x(w23 x(x(w21 w22) _)))))) w21) w22))) ::day_06::clear::5 = x(x(w26 w33) x(w15 x(w30 x(x(w1 w29) w10)))) } @@ -120,11 +120,11 @@ } ::day_06::walk::2 { - x(w12 x(w10 x(w9 x(w8 x(w7 x(dup191(w1 w15) x(dup192(@lt(w2 ?(::day_06::walk::4 ::day_06::walk::3 x(w12 x(w10 x(w9 x(w8 x(w7 x(w15 x(w14 w13))))))))) w14) w13))))))) + x(w12 x(w10 x(w9 x(w8 x(w7 x(dup188(w1 w15) x(dup189(@lt(w2 ?(::day_06::walk::4 ::day_06::walk::3 x(w12 x(w10 x(w9 x(w8 x(w7 x(w15 x(w14 w13))))))))) w14) w13))))))) 3 = @mul(w1 w2) } -::day_06::walk::3 { x(w35 x(dup196(@add(w1 dup202(tup(dup203(@le$(w37 ?(::day_06::walk::7 ::day_06::walk::6 x(w35 x(w48 x(w32 x(w46 x(w45 x(w29 x(w28 x(w42 x(w41 x(w6 w39)))))))))))) w41) w6) w42)) w48) x(w32 x(dup198(w37 w46) x(dup199(w1 w45) x(w29 x(w28 w39))))))) } +::day_06::walk::3 { x(w35 x(dup193(@add(w1 dup199(tup(dup200(@le$(w37 ?(::day_06::walk::7 ::day_06::walk::6 x(w35 x(w48 x(w32 x(w46 x(w45 x(w29 x(w28 x(w42 x(w41 x(w6 w39)))))))))))) w41) w6) w42)) w48) x(w32 x(dup195(w37 w46) x(dup196(w1 w45) x(w29 x(w28 w39))))))) } ::day_06::walk::4 { x(x(w8 w8) x(_ x(_ x(_ x(_ x(w2 x(_ tup(1 w2)))))))) } @@ -133,7 +133,7 @@ ::day_06::walk::10 = x(w5 w12) } -::day_06::walk::7 { x(w14 x(w12 x(dup215(w1 w23) x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(dup222(@le$(w1 ?(::day_06::walk::9 ::day_06::walk::8 x(w14 x(w12 x(w23 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w16 w15)))))))))))) w16) w15)))))))))) } +::day_06::walk::7 { x(w14 x(w12 x(dup212(w1 w23) x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(dup219(@le$(w1 ?(::day_06::walk::9 ::day_06::walk::8 x(w14 x(w12 x(w23 x(w10 x(w9 x(w8 x(w7 x(w6 x(w5 x(w16 w15)))))))))))) w16) w15)))))))))) } ::day_06::walk::8 { x(x(w11 w11) x(_ x(_ x(_ x(_ x(w5 x(_ x(_ x(_ x(_ w12)))))))))) @@ -143,7 +143,7 @@ ::day_06::walk::9 { x(x(w11 w52) x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 x(w2 x(w1 w41)))))))))) ::std::array::Array::get = fn(ref(w11 w22) fn(w1 w26)) - ::std::array::Array::get = fn(w26 fn(w2 ref(dup240(@eq(35 ?(::day_06::walk::13 ::day_06::walk::12 x(x(w22 w52) x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 x(x(w42 w43) w41))))))))))) w42) w43))) + ::std::array::Array::get = fn(w26 fn(w2 ref(dup237(@eq(35 ?(::day_06::walk::13 ::day_06::walk::12 x(x(w22 w52) x(w9 x(w8 x(w7 x(w6 x(w5 x(w4 x(w3 x(x(w42 w43) w41))))))))))) w42) w43))) } ::day_06::walk::10 { x(w3 tup(0 w3)) } @@ -169,10 +169,10 @@ ::std::array::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::array::Array::from_fn { fn(dup314(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup315(w3 w13) w3) fn(w6 w11))) } +::std::array::Array::from_fn { fn(dup309(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup310(w3 w13) w3) fn(w6 w11))) } ::std::array::Array::from_fn::3 { - x(dup321(w1 dup321(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup316(w1 dup316(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::array::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::option::Option::unwrap = fn(w16 _) @@ -181,25 +181,25 @@ ::std::array::Array::from_fn::4 { x(_ x(_ x(_ ::std::array::Array::empty))) } -::std::array::Array::len { fn(ref(tup(dup391(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup386(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup397(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup392(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup408(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup403(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup412(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup407(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_front { fn(ref(tup(dup447(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup447(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_front { fn(ref(tup(dup442(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup442(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -212,7 +212,7 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_front::5 { x(w4 dup468(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } +::std::array::Array::push_front::5 { x(w4 dup463(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } ::std::array::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -222,48 +222,48 @@ ::std::array::Array::push_front::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup481(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup476(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup487(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup482(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup499(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup493(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup505(@sub(1 @rem(2 dup507(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup506(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup499(@sub(1 @rem(2 dup501(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup500(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -277,7 +277,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::unzip_with { fn(dup691(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup679(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -287,7 +287,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup703(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup705(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup691(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup693(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -303,7 +303,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup750(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup737(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -322,7 +322,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup844(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup831(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -335,23 +335,23 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup856(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup843(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup923(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup910(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup934(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup921(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup943(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup930(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup953(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup940(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -362,9 +362,9 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::list::List::iter { fn(ref(tup(dup1113(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1100(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1120(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1107(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -381,20 +381,20 @@ } ::std::list::List::split_trim::2 { - x(w24 x(dup1221(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup1208(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::list::List::split_once = fn(w24 fn(w1 tup(w3 enum(::std::list::List::split_trim::24 enum(::std::list::List::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1232(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1225(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1227(w20 w31)))))) + ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1219(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1212(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1214(w20 w31)))))) } ::std::list::List::split_trim::4 { x(?(0 1 w3) w3) } ::std::list::List::split_trim::5 { x(_ 0) } -::std::list::List::split_trim::10 { x(x(w4 w4) x(_ x(_ _))) } +::std::list::List::split_trim::10 { x(x(w4 w4) _) } ::std::list::List::split_trim::11 { x(w5 x(?(::std::list::List::split_trim::13 ::std::list::List::split_trim::12 x(w5 w2)) w2)) } -::std::list::List::split_trim::12 { x(x(w3 w3) x(_ _)) } +::std::list::List::split_trim::12 { x(x(w3 w3) _) } ::std::list::List::split_trim::13 { x(x(w7 w3) x(w5 _)) @@ -438,7 +438,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1315(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1299(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -447,7 +447,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1329(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1313(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -479,7 +479,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2443(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2417(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -488,10 +488,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2453(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2427(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2456(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2430(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/aoc_2024/day_06/stats.txt b/tests/snaps/vine/aoc_2024/day_06/stats.txt index 525cf645..0fc52654 100644 --- a/tests/snaps/vine/aoc_2024/day_06/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_06/stats.txt @@ -1,9 +1,9 @@ Interactions Total 860_434 - Annihilate 456_854 + Annihilate 456_853 Commute 13_652 - Copy 86_259 + Copy 86_260 Erase 68_826 Expand 95_809 Call 93_026 @@ -11,5 +11,5 @@ Interactions Memory Heap 10_448 B - Allocated 18_803_184 B - Freed 18_803_184 B + Allocated 18_803_168 B + Freed 18_803_168 B diff --git a/tests/snaps/vine/aoc_2024/day_07/compiled.iv b/tests/snaps/vine/aoc_2024/day_07/compiled.iv index f3d28beb..0f00aa0e 100644 --- a/tests/snaps/vine/aoc_2024/day_07/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_07/compiled.iv @@ -107,7 +107,7 @@ } ::day_07::main::32 { - enum(w0 x(w6 x(dup145(w9 w13) w3))) + enum(w0 x(w6 x(dup144(w9 w13) w3))) ::std::n64::N64::eq = fn(w0 fn(w9 ?(::day_07::main::29 ::day_07::main::35 x(w6 x(w13 w3))))) } @@ -129,7 +129,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup630(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup620(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -143,11 +143,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup675(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup665(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup682(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup672(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -162,7 +162,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup699(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup689(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -175,23 +175,23 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup736(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup726(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup803(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup793(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup814(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup804(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup823(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup813(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup833(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup823(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -202,9 +202,9 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::list::List::iter { fn(ref(tup(dup993(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup983(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1000(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup990(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -221,7 +221,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1076(w1 w20) x(w12 w18))) + x(w14 x(dup1066(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -259,7 +259,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1195(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1182(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -268,7 +268,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1209(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1196(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -300,7 +300,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::parse { fn(tup(dup2343(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2320(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -312,10 +312,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2354(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2331(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2363(dup2358(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2340(dup2335(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -345,19 +345,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2569(@div(w9 w10) @rem(w12 dup2570(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2572(w9 dup2572(w12 dup2572(w31 dup2572(w36 dup2572(w41 dup2572(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2568(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2540(@div(w9 w10) @rem(w12 dup2541(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2543(w9 dup2543(w12 dup2543(w31 dup2543(w36 dup2543(w41 dup2543(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2539(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2583(@div(w1 w2) @rem(w4 w6)) w6) x(dup2584(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2554(@div(w1 w2) @rem(w4 w6)) w6) x(dup2555(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2592(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2562(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2599(w2 w9) x(dup2601(w0 dup2601(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2605(w5 w11))) + x(x(w27 w33) x(dup2569(w2 w9) x(dup2571(w0 dup2571(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2575(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -371,7 +371,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } -::std::n64::N64::parse { fn(tup(dup2812(?(::std::n64::N64::parse::4 ::std::n64::N64::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n64::N64::parse { fn(tup(dup2781(?(::std::n64::N64::parse::4 ::std::n64::N64::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n64::N64::parse::3 { x(w6 x(w5 w7)) @@ -384,10 +384,10 @@ ::std::n64::N64::parse::11 = x(w4 ::std::option::Option::None) } -::std::n64::N64::parse::5 { x(dup2823(?(::std::n64::N64::parse::7 ::std::n64::N64::parse::6 x(w8 w3)) w8) w3) } +::std::n64::N64::parse::5 { x(dup2792(?(::std::n64::N64::parse::7 ::std::n64::N64::parse::6 x(w8 w3)) w8) w3) } ::std::n64::N64::parse::6 { - x(w22 x(tup(dup2832(dup2827(w24 @le(57 w27)) w30) w2) x(w20 w29))) + x(w22 x(tup(dup2801(dup2796(w24 @le(57 w27)) w30) w2) x(w20 w29))) 48 = @le(w24 @n32_and(w27 ?(::std::n64::N64::parse::10 ::std::n64::N64::parse::9 x(w22 x(w2 x(w20 x(w30 w29))))))) } @@ -411,7 +411,7 @@ ::std::n64::N64::parse::11 { x(w8 w8) } ::std::n64::N64::to_string { - fn(dup2850(w6 w9) w8) + fn(dup2818(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -423,7 +423,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2860(w0 w7) w3) + x(dup2828(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } diff --git a/tests/snaps/vine/aoc_2024/day_08/compiled.iv b/tests/snaps/vine/aoc_2024/day_08/compiled.iv index 6e5d6d48..c9771c95 100644 --- a/tests/snaps/vine/aoc_2024/day_08/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_08/compiled.iv @@ -28,40 +28,34 @@ ::day_08::main::4 { x(w8 x(w6 x(w5 x(dup33(@lt(w6 ?(::day_08::main::7 ::day_08::main::6 x(w8 x(w5 x(w10 w9))))) w10) w9)))) } -::day_08::main::5 { x(x(w5 w5) x(_ x(_ x(_ _)))) } +::day_08::main::5 { x(x(w5 w5) _) } ::day_08::main::6 { x(x(w12 w1) x(w10 x(w9 _))) ::std::map::Map::insert = fn(ref(w12 w1) fn(tup(w10 w9) _)) } -::day_08::main::7 { x(x(w4 w4) x(_ x(_ _))) } +::day_08::main::7 { x(x(w4 w4) _) } ::day_08::main::9 { x(w10 x(w8 x(w7 fn(tup(w0 w1) fn(w3 _))))) ::day_08::main::10 = x(w10 x(w8 x(w7 x(w0 x(w1 w3))))) } -::day_08::main::10 { x(w9 x(dup56(w1 w14) x(w6 x(dup58(@lt(w1 ?(::day_08::main::12 ::day_08::main::11 x(w9 x(w14 x(w6 x(w12 w4)))))) w12) w4)))) } +::day_08::main::10 { x(w9 x(dup53(w1 w14) x(w6 x(dup55(@lt(w1 ?(::day_08::main::12 ::day_08::main::11 x(w9 x(w14 x(w6 x(w12 w4)))))) w12) w4)))) } -::day_08::main::11 { x(w9 x(w7 x(dup64(w1 w13) x(w5 x(dup66(@lt(w1 ?(::day_08::main::14 ::day_08::main::13 x(w9 x(w7 x(w13 x(w5 x(w11 w3))))))) w11) w3))))) } +::day_08::main::11 { x(w9 x(w7 x(dup61(w1 w13) x(w5 x(dup63(@lt(w1 ?(::day_08::main::14 ::day_08::main::13 x(w9 x(w7 x(w13 x(w5 x(w11 w3))))))) w11) w3))))) } -::day_08::main::12 { - x(x(w6 w6) _) - _ = _ -} +::day_08::main::12 { x(x(w6 w6) _) } ::day_08::main::13 { - x(x(w21 w28) x(w19 x(w18 x(dup74(w3 w9) x(dup76(w4 w11) dup78(w8 w22)))))) + x(x(w21 w28) x(w19 x(w18 x(dup71(w3 w9) x(dup73(w4 w11) dup75(w8 w22)))))) ::std::map::Map::insert = fn(ref(w21 w1) fn(tup(w3 w4) _)) tup(w9 w11) = @add(w8 tup(w10 w12)) ::day_08::main::10 = x(x(w1 w28) x(w19 x(w18 x(w10 x(w12 w22))))) } -::day_08::main::14 { - x(x(w6 w6) _) - _ = _ -} +::day_08::main::14 { x(x(w6 w6) _) } ::day_08::main::16 { x(w13 x(w12 x(w10 x(w8 w7)))) @@ -69,7 +63,7 @@ } ::day_08::main::19 { - enum(w0 x(w10 x(x(w9 w32) x(x(w7 w30) x(w5 x(dup100(w18 w27) x(dup101(w17 w26) dup102(w16 @add(1 w13))))))))) + enum(w0 x(w10 x(x(w9 w32) x(x(w7 w30) x(w5 x(dup97(w18 w27) x(dup98(w17 w26) dup99(w16 @add(1 w13))))))))) ::day_08::main::21 = x(x(w10 w24) x(x(w9 w22) x(x(w7 w20) x(w18 x(w17 x(w16 x(w0 0))))))) ::day_08::main::16 = x(w24 x(x(w22 w32) x(x(w20 w30) x(w5 x(w27 x(w26 w13)))))) } @@ -82,19 +76,19 @@ } ::day_08::main::24 { - enum(dup137(@ne(46 ?(::day_08::main::28 ::day_08::main::27 x(x(w12 w29) x(x(w10 w27) x(x(w8 w25) x(w23 x(w22 x(w21 x(w20 x(w19 _)))))))))) w19) x(x(w12 w40) x(x(w10 w38) x(x(w8 w36) x(dup131(w23 w34) x(dup132(w22 w33) x(dup133(w21 w32) x(w3 dup135(w20 @add(1 w15)))))))))) + enum(dup134(@ne(46 ?(::day_08::main::28 ::day_08::main::27 x(x(w12 w29) x(x(w10 w27) x(x(w8 w25) x(w23 x(w22 x(w21 x(w20 x(w19 _)))))))))) w19) x(x(w12 w40) x(x(w10 w38) x(x(w8 w36) x(dup128(w23 w34) x(dup129(w22 w33) x(dup130(w21 w32) x(w3 dup132(w20 @add(1 w15)))))))))) ::day_08::main::21 = x(x(w29 w40) x(x(w27 w38) x(x(w25 w36) x(w34 x(w33 x(w32 x(w3 w15))))))) } ::day_08::main::25 { x(x(w10 w10) x(x(w8 w8) x(x(w6 w6) _))) } ::day_08::main::27 { - x(x(w32 w1) x(w30 x(w28 x(w26 x(w25 x(dup151(w10 w37) x(dup152(w9 w36) x(w22 _)))))))) - ::std::map::Map::get_or_insert = fn(ref(w32 w1) fn(w22 fn(tup(0 tup(w33 w33)) ref(dup155(w13 w16) w17)))) + x(x(w32 w1) x(w30 x(w28 x(w26 x(w25 x(dup148(w10 w37) x(dup149(w9 w36) x(w22 _)))))))) + ::std::map::Map::get_or_insert = fn(ref(w32 w1) fn(w22 fn(tup(0 tup(w33 w33)) ref(dup152(w13 w16) w17)))) ::std::list::List::into_iter = fn(w13 w14) ::day_08::main::29 = x(w30 x(w28 x(w26 x(w25 x(w37 x(w36 x(w35 w14))))))) ::std::list::List::push_back = fn(ref(w16 w17) fn(w19 _)) - tup(w9 w10) = dup156(w35 w19) + tup(w9 w10) = dup153(w35 w19) } ::day_08::main::28 { x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) _))) } @@ -105,7 +99,7 @@ } ::day_08::main::32 { - enum(dup189(w16 dup189(@add(w21 @sub(w23 w24)) dup189(w21 dup189(tup(w27 w28) w31)))) x(x(w11 w82) x(x(w9 w80) x(dup183(w55 dup183(w60 dup183(w65 dup183(w70 w78)))) x(dup184(w54 dup184(w59 dup184(w64 dup184(w69 w77)))) x(dup185(w36 w76) x(dup186(w33 w75) x(dup187(@add(w14 @sub(w16 w17)) dup187(w14 dup187(w23 dup187(@sub(w31 @div(w39 dup192(w44 dup192(w48 @sub$(0 w51))))) dup187(w43 dup187(@sub(w48 w49) w74)))))) w2)))))))) + enum(dup185(w16 dup185(@add(w21 @sub(w23 w24)) dup185(w21 dup185(tup(w27 w28) w31)))) x(x(w11 w82) x(x(w9 w80) x(dup179(w55 dup179(w60 dup179(w65 dup179(w70 w78)))) x(dup180(w54 dup180(w59 dup180(w64 dup180(w69 w77)))) x(dup181(w36 w76) x(dup182(w33 w75) x(dup183(@add(w14 @sub(w16 w17)) dup183(w14 dup183(w23 dup183(@sub(w31 @div(w39 dup188(w44 dup188(w48 @sub$(0 w51))))) dup183(w43 dup183(@sub(w48 w49) w74)))))) w2)))))))) ::day_08::main::2 = x(x(w11 w57) x(w55 x(w54 fn(w17 _)))) ::day_08::main::2 = x(x(w57 w62) x(w60 x(w59 fn(w24 _)))) ::std::n32::N32::diff = fn(w33 fn(w27 w35)) @@ -118,11 +112,11 @@ ::day_08::main::33 { x(x(w9 w9) x(x(w7 w7) _)) } -::std::char::Char::cmp { fn(ref(dup638(w2 dup638(@lt(w12 ?(::std::char::Char::cmp::4 ::std::char::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup639(w5 dup639(w12 w15)) w5) w14)) } +::std::char::Char::cmp { fn(ref(dup627(w2 dup627(@lt(w12 ?(::std::char::Char::cmp::4 ::std::char::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup628(w5 dup628(w12 w15)) w5) w14)) } ::std::char::Char::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::char::Char::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::char::Char::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } ::std::io::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -135,7 +129,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup668(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup656(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -154,7 +148,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup762(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup750(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -167,14 +161,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup774(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup762(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup808(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup796(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -183,7 +177,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup871(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup859(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -199,9 +193,9 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::list::List::iter { fn(ref(tup(dup1031(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1019(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1038(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1026(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -214,7 +208,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1067(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1055(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -229,20 +223,20 @@ } ::std::list::List::split_trim::2 { - x(w24 x(dup1139(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup1127(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::list::List::split_once = fn(w24 fn(w1 tup(w3 enum(::std::list::List::split_trim::24 enum(::std::list::List::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1150(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1143(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1145(w20 w31)))))) + ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1138(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1131(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1133(w20 w31)))))) } ::std::list::List::split_trim::4 { x(?(0 1 w3) w3) } ::std::list::List::split_trim::5 { x(_ 0) } -::std::list::List::split_trim::10 { x(x(w4 w4) x(_ x(_ _))) } +::std::list::List::split_trim::10 { x(x(w4 w4) _) } ::std::list::List::split_trim::11 { x(w5 x(?(::std::list::List::split_trim::13 ::std::list::List::split_trim::12 x(w5 w2)) w2)) } -::std::list::List::split_trim::12 { x(x(w3 w3) x(_ _)) } +::std::list::List::split_trim::12 { x(x(w3 w3) _) } ::std::list::List::split_trim::13 { x(x(w7 w3) x(w5 _)) @@ -286,7 +280,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1233(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1218(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -295,7 +289,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1247(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1232(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -335,22 +329,22 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } -::std::map::Map::len { fn(ref(tup(w2 tup(dup1488(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } +::std::map::Map::len { fn(ref(tup(w2 tup(dup1468(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } ::std::map::Map::insert { - fn(ref(tup(dup1492(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1472(w2 w16) w5) tup(w2 w14)) w9) ::std::map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::map::Map::get_or_insert { - fn(ref(tup(dup1500(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1480(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::option::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1741(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1718(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -358,10 +352,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1754(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1731(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1769(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1746(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -433,18 +427,18 @@ } ::std::map::is_balanced { - fn(ref(tup(dup2345(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2346(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2320(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2321(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2350(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2351(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2325(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2326(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2355(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2356(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2330(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2331(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } -::std::n32::N32::to_string { fn(dup2361(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2336(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -453,10 +447,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2371(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2346(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2374(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2349(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -464,13 +458,13 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::cmp { fn(ref(dup2429(w2 dup2429(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2430(w5 dup2430(w12 w15)) w5) w14)) } +::std::n32::N32::cmp { fn(ref(dup2403(w2 dup2403(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2404(w5 dup2404(w12 w15)) w5) w14)) } ::std::n32::N32::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::n32::N32::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::n32::N32::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } -::std::n32::N32::diff { fn(dup2462(@lt$(w8 ?(::std::n32::N32::diff::4 ::std::n32::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2463(w8 w11) w10)) } +::std::n32::N32::diff { fn(dup2435(@lt$(w8 ?(::std::n32::N32::diff::4 ::std::n32::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2436(w8 w11) w10)) } ::std::n32::N32::diff::3 { x(@sub(w4 w2) x(w4 w2)) } @@ -481,10 +475,10 @@ ::std::n32::N32::gcd::2 = x(w2 x(w3 w8)) } -::std::n32::N32::gcd::2 { x(dup2480(?(::std::n32::N32::gcd::4 ::std::n32::N32::gcd::3 x(w6 w2)) w6) w2) } +::std::n32::N32::gcd::2 { x(dup2453(?(::std::n32::N32::gcd::4 ::std::n32::N32::gcd::3 x(w6 w2)) w6) w2) } ::std::n32::N32::gcd::3 { - x(dup2483(w1 w3) x(@rem(w1 w2) w12)) + x(dup2456(w1 w3) x(@rem(w1 w2) w12)) tup(w2 w3) = tup(w5 w6) ::std::n32::N32::gcd::2 = x(w5 x(w6 w12)) } diff --git a/tests/snaps/vine/aoc_2024/day_08/stats.txt b/tests/snaps/vine/aoc_2024/day_08/stats.txt index b48b16b0..32ed52d4 100644 --- a/tests/snaps/vine/aoc_2024/day_08/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_08/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 89_901 - Annihilate 47_768 + Total 89_883 + Annihilate 47_759 Commute 7_304 - Copy 10_802 - Erase 8_806 + Copy 10_811 + Erase 8_788 Expand 8_678 Call 4_053 Branch 2_490 Memory Heap 25_072 B - Allocated 2_055_712 B - Freed 2_055_712 B + Allocated 2_055_568 B + Freed 2_055_568 B diff --git a/tests/snaps/vine/aoc_2024/day_09/compiled.iv b/tests/snaps/vine/aoc_2024/day_09/compiled.iv index 423eae08..f7ae9d85 100644 --- a/tests/snaps/vine/aoc_2024/day_09/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_09/compiled.iv @@ -89,9 +89,9 @@ } ::day_09::part2::5 { - enum(@sub(48 dup157(w23 w28)) x(w8 x(x(w7 w49) x(x(w5 w47) x(dup152(w24 @add(w28 dup159(w34 @add(w39 w40)))) dup154(w22 @add(1 w43))))))) + enum(@sub(48 dup156(w23 w28)) x(w8 x(x(w7 w49) x(x(w5 w47) x(dup151(w24 @add(w28 dup158(w34 @add(w39 w40)))) dup153(w22 @add(1 w43))))))) ::std::list::List::pop_front = fn(ref(w8 w13) w15) - ::std::option::Option::unwrap_or = fn(w15 fn(48 @sub(48 dup158(w35 w39)))) + ::std::option::Option::unwrap_or = fn(w15 fn(48 @sub(48 dup157(w35 w39)))) ::std::list::List::push_front = fn(ref(w5 w20) fn(tup(w22 tup(w23 w24)) _)) ::std::list::List::push_back = fn(ref(w7 w32) fn(tup(w34 w35) _)) ::day_09::part2::2 = x(w13 x(x(w32 w49) x(x(w20 w47) x(w40 w43)))) @@ -105,9 +105,9 @@ } ::day_09::part2::10 { - enum(tup(w2 tup(dup176(w47 w24) dup177(w17 w46))) x(w11 x(w10 x(w9 w49)))) + enum(tup(w2 tup(dup175(w47 w24) dup176(w17 w46))) x(w11 x(w10 x(w9 w49)))) ::std::list::List::iter = fn(ref(w11 w13) w15) - ::day_09::part2::12 = x(w47 x(w46 x(x(w15 w45) x(w17 dup180(@add(w24 dup182(@sub(1 @mul(w31 @sub(w36 @div(2 w38)))) w31)) dup180(@sub(1 @mul(w35 w36)) w35)))))) + ::day_09::part2::12 = x(w47 x(w46 x(x(w15 w45) x(w17 dup179(@add(w24 dup181(@sub(1 @mul(w31 @sub(w36 @div(2 w38)))) w31)) dup179(@sub(1 @mul(w35 w36)) w35)))))) ::std::list::List::Iter::drop = fn(ref(w45 _) _) ::std::n64::N64::mul_n32_n32 = fn(w2 fn(w38 w39)) ::std::n64::N64::add = fn(w9 fn(w39 w40)) @@ -121,15 +121,15 @@ ::std::list::List::Iter::next = fn(ref(w8 w1) enum(::day_09::part2::15 enum(::day_09::part2::16 x(w10 x(w9 x(x(w1 w14) w6)))))) } -::day_09::part2::15 { enum(ref(tup(dup203(@lt$(w23 ?(::day_09::part2::19 ::day_09::part2::18 x(w19 x(w33 x(w17 x(w15 x(x(w27 w28) x(w9 w26)))))))) w27) w9) tup(w28 w26)) x(w19 x(dup197(w23 w33) x(w17 w15)))) } +::day_09::part2::15 { enum(ref(tup(dup202(@lt$(w23 ?(::day_09::part2::19 ::day_09::part2::18 x(w19 x(w33 x(w17 x(w15 x(x(w27 w28) x(w9 w26)))))))) w27) w9) tup(w28 w26)) x(w19 x(dup196(w23 w33) x(w17 w15)))) } ::day_09::part2::16 { x(_ x(_ x(x(w3 w3) x(w1 w1)))) } ::day_09::part2::18 { x(_ x(_ x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) x(w1 w1)))))) } -::day_09::part2::19 { x(dup219(@le(w13 ?(::day_09::part2::22 ::day_09::part2::21 x(w24 x(w8 x(w7 x(w5 x(w3 x(w15 w16)))))))) w24) x(w8 x(w7 x(w5 x(w3 x(dup228(w13 w15) w16)))))) } +::day_09::part2::19 { x(dup218(@le(w13 ?(::day_09::part2::22 ::day_09::part2::21 x(w24 x(w8 x(w7 x(w5 x(w3 x(w15 w16)))))))) w24) x(w8 x(w7 x(w5 x(w3 x(dup227(w13 w15) w16)))))) } -::day_09::part2::21 { x(dup230(w2 w5) x(_ x(x(w15 w15) x(x(_ w0) x(x(dup234(w0 @add(w5 w7)) w7) x(@sub(w2 w4) w4)))))) } +::day_09::part2::21 { x(dup228(w2 w5) x(_ x(x(w15 w15) x(x(_ w0) x(x(dup232(w0 @add(w5 w7)) w7) x(@sub(w2 w4) w4)))))) } ::day_09::part2::22 { x(w9 x(w8 x(w7 x(w5 x(x(w3 w3) x(w1 w1)))))) @@ -147,7 +147,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup714(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup703(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -161,11 +161,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup759(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup748(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup766(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup755(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -180,7 +180,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup783(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup772(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -198,7 +198,7 @@ ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup854(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup843(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -207,7 +207,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup917(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup906(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -228,9 +228,9 @@ ::std::list::List::concat = fn(tup(1 tup(tup(w5 w13) w13)) fn(w3 w11)) } -::std::list::List::iter { fn(ref(tup(dup1077(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1066(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1084(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1073(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -241,7 +241,7 @@ ::std::list::List::Iter::drop { fn(ref(tup(_ ref(w9 w9)) _) _) } -::std::n32::N32::min { fn(dup2488(@lt(w8 ?(::std::n32::N32::min::4 ::std::n32::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2489(w8 w11) w10)) } +::std::n32::N32::min { fn(dup2462(@lt(w8 ?(::std::n32::N32::min::4 ::std::n32::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2463(w8 w11) w10)) } ::std::n32::N32::min::3 { x(w3 x(_ w3)) } @@ -254,19 +254,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2653(@div(w9 w10) @rem(w12 dup2654(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2656(w9 dup2656(w12 dup2656(w31 dup2656(w36 dup2656(w41 dup2656(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2652(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2623(@div(w9 w10) @rem(w12 dup2624(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2626(w9 dup2626(w12 dup2626(w31 dup2626(w36 dup2626(w41 dup2626(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2622(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2667(@div(w1 w2) @rem(w4 w6)) w6) x(dup2668(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2637(@div(w1 w2) @rem(w4 w6)) w6) x(dup2638(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2676(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2645(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2683(w2 w9) x(dup2685(w0 dup2685(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2689(w5 w11))) + x(x(w27 w33) x(dup2652(w2 w9) x(dup2654(w0 dup2654(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2658(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -281,7 +281,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } ::std::n64::N64::to_string { - fn(dup2934(w6 w9) w8) + fn(dup2901(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -293,7 +293,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2944(w0 w7) w3) + x(dup2911(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } diff --git a/tests/snaps/vine/aoc_2024/day_10/compiled.iv b/tests/snaps/vine/aoc_2024/day_10/compiled.iv index 328abd2f..df749fec 100644 --- a/tests/snaps/vine/aoc_2024/day_10/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_10/compiled.iv @@ -5,7 +5,7 @@ fn(ref(w3 w42) _) ::std::io::IO::full_input = fn(ref(w3 w8) w10) ::std::list::List::split_trim = fn(w10 fn(tup(1 tup(tup(10 w49) w49)) w17)) - ::day_10::cross = fn(w17 fn(fn(dup12(w101 dup12(w103 dup12(w105 dup12(w107 dup12(@eq(48 ?(::day_10::main::5 ::day_10::main::4 x(w136 x(x(w59 w135) x(x(w61 w133) x(x(w63 w131) x(w70 x(w71 x(w78 x(w79 x(w86 x(w87 x(w94 x(w95 dup40(w111 dup40(w113 dup40(w115 w117))))))))))))))))) w136))))) fn(tup(tup(tup(w70 w71) tup(w101 w111)) tup(tup(tup(w78 w79) tup(w103 w113)) tup(tup(tup(w86 w87) tup(w105 w115)) tup(tup(w94 w95) tup(w107 w117))))) fn(ref(tup(w57 tup(w59 tup(w61 w63))) tup(w57 tup(w135 tup(w133 w131)))) _))) fn(tup(46 tup(0 0)) fn(ref(tup(w8 0) tup(w22 tup(_ tup(w26 w28)))) _)))) + ::day_10::cross = fn(w17 fn(fn(dup12(w101 dup12(w103 dup12(w105 dup12(w107 dup12(@eq(48 ?(::day_10::main::5 ::day_10::main::4 x(w136 x(x(w59 w135) x(x(w61 w133) x(x(w63 w131) x(w70 x(w71 x(w78 x(w79 x(w86 x(w87 x(w94 x(w95 dup40(w111 dup40(w113 dup40(w115 w117))))))))))))))))) w136))))) fn(tup(tup(tup(w70 w71) tup(w101 w111)) tup(tup(tup(w78 w79) tup(w103 w113)) tup(tup(tup(w86 w87) tup(w105 w115)) tup(tup(w94 w95) tup(w107 w117))))) fn(ref(tup(w57 tup(w59 tup(w61 w63))) tup(w57 tup(w135 tup(w133 w131)))) _))) fn(tup(46 0) fn(ref(tup(w8 0) tup(w22 tup(_ tup(w26 w28)))) _)))) ::std::n32::N32::to_string = fn(w26 w38) ::std::list::List::concat = fn(tup(8 tup(tup(83 tup(99 tup(111 tup(114 tup(101 tup(115 tup(58 tup(32 w137)))))))) w137)) fn(w38 w39)) ::std::io::IO::println = fn(ref(w22 w34) fn(w39 _)) @@ -41,7 +41,7 @@ ::day_10::main::12 { x(x(w9 w9) x(x(w7 w7) x(w5 x(w4 tup(w5 w4))))) } ::day_10::set { - fn(dup118(w5 dup118(@n32_and(32 w9) dup118(@n32_and(64 w14) @n32_and(128 w20)))) w25) + fn(dup117(w5 dup117(@n32_and(32 w9) dup117(@n32_and(64 w14) @n32_and(128 w20)))) w25) 1 = @n32_shl(w5 w6) ::day_10::set::f = fn(w9 fn(w6 fn(0 w11))) ::day_10::set::f = fn(w14 fn(w11 fn(0 w17))) @@ -65,10 +65,10 @@ ::day_10::count::3 = x(w0 x(0 w7)) } -::day_10::count::3 { x(dup152(?(::day_10::count::5 ::day_10::count::4 x(w6 w2)) w6) w2) } +::day_10::count::3 { x(dup151(?(::day_10::count::5 ::day_10::count::4 x(w6 w2)) w6) w2) } ::day_10::count::4 { - x(dup155(@n32_and(1 w1) @n32_shr(1 w5)) x(@add(w1 w3) w10)) + x(dup154(@n32_and(1 w1) @n32_shr(1 w5)) x(@add(w1 w3) w10)) ::day_10::count::3 = x(w5 x(w3 w10)) } @@ -89,7 +89,7 @@ ::day_10::Channel::send { fn(tup(w2 w5) fn(w5 w2)) } ::day_10::cross { - fn(w2 fn(w3 fn(dup212(w20 dup212(w31 w25)) fn(ref(w6 w30) _)))) + fn(w2 fn(w3 fn(dup211(w20 dup211(w31 w25)) fn(ref(w6 w30) _)))) ::std::list::List::get = fn(ref(w2 w11) fn(0 w14)) ::std::list::List::len = fn(w14 w17) ::day_10::neglect_channel = fn(w20 w21) @@ -104,32 +104,32 @@ } ::day_10::cross::5 { - enum(w0 x(w8 x(dup231(w31 w37) x(dup232(w9 dup232(w22 w36)) x(x(w5 w35) x(w3 w33)))))) + enum(w0 x(w8 x(dup230(w32 w38) x(dup231(w9 dup231(w14 w37)) x(x(w5 w36) x(w3 w34)))))) ::day_10::neglect_channel = fn(w9 w10) - ::std::list::List::iter = fn(ref(w3 w13) w15) - ::day_10::cross::7 = x(w31 x(x(w5 w30) x(w0 x(x(w10 w27) x(w15 w25))))) - ::std::list::List::Iter::drop = fn(ref(w25 _) _) - ::day_10::Channel::send = fn(w27 fn(w22 _)) - ::day_10::cross::2 = x(w8 x(w37 x(w36 x(x(w30 w35) x(w13 w33))))) + ::std::list::List::iter = fn(ref(w3 w17) w19) + ::day_10::cross::8 = x(w32 x(x(w5 w31) x(w0 x(x(w10 w28) x(w19 w26))))) + ::std::list::List::Iter::drop = fn(ref(w26 _) _) + ::day_10::Channel::send = fn(w28 fn(w14 _)) + ::day_10::cross::2 = x(w8 x(w38 x(w37 x(x(w31 w36) x(w17 w34))))) } ::day_10::cross::6 { x(_ x(_ x(_ x(x(w3 w3) x(w1 w1))))) } -::day_10::cross::7 { +::day_10::cross::8 { x(w12 x(w11 x(w9 w8))) - ::std::list::List::pop_front = fn(ref(w9 w1) enum(::day_10::cross::10 enum(::day_10::cross::11 x(w12 x(w11 x(w1 w8)))))) + ::std::list::List::pop_front = fn(ref(w9 w1) enum(::day_10::cross::11 enum(::day_10::cross::12 x(w12 x(w11 x(w1 w8)))))) } -::day_10::cross::10 { +::day_10::cross::11 { enum(w0 x(dup257(fn(w0 fn(tup(w23 tup(w24 tup(w15 w14))) fn(ref(w8 w34) _))) w44) x(x(w8 w43) x(w6 x(x(w5 w40) x(w3 w38)))))) ::day_10::foo_channel = fn(ref(w5 w11) tup(w14 w15)) ::std::list::List::Iter::next = fn(ref(w3 w18) w20) ::std::option::Option::unwrap = fn(w20 w21) ::day_10::foo_channel = fn(w21 tup(w23 w24)) - ::day_10::cross::7 = x(w44 x(x(w34 w43) x(w6 x(x(w11 w40) x(w18 w38))))) + ::day_10::cross::8 = x(w44 x(x(w34 w43) x(w6 x(x(w11 w40) x(w18 w38))))) } -::day_10::cross::11 { x(_ x(x(w6 w6) x(_ x(x(w3 w3) x(w1 w1))))) } +::day_10::cross::12 { x(_ x(x(w6 w6) x(_ x(x(w3 w3) x(w1 w1))))) } ::day_10::drop_all { fn(w2 fn(w3 _)) @@ -167,7 +167,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup777(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup769(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -186,7 +186,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup871(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup863(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -199,17 +199,17 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup883(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup875(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::new { fn(w2 fn(w3 w11)) ::std::list::List::new::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::list::List::new::2 { x(dup896(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } +::std::list::List::new::2 { x(dup888(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } ::std::list::List::new::3 { - x(@sub(1 w6) x(dup902(w3 w13) x(w8 w12))) + x(@sub(1 w6) x(dup894(w3 w13) x(w8 w12))) ::std::list::List::push_back = fn(ref(w8 w1) fn(w3 _)) ::std::list::List::new::2 = x(w6 x(w13 x(w1 w12))) } @@ -221,7 +221,7 @@ ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup917(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup909(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -230,7 +230,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup980(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup972(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -246,9 +246,9 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::list::List::iter { fn(ref(tup(dup1140(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1132(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1147(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1139(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -265,20 +265,20 @@ } ::std::list::List::split_trim::2 { - x(w24 x(dup1248(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup1240(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::list::List::split_once = fn(w24 fn(w1 tup(w3 enum(::std::list::List::split_trim::24 enum(::std::list::List::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1259(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1252(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1254(w20 w31)))))) + ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1251(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1244(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1246(w20 w31)))))) } ::std::list::List::split_trim::4 { x(?(0 1 w3) w3) } ::std::list::List::split_trim::5 { x(_ 0) } -::std::list::List::split_trim::10 { x(x(w4 w4) x(_ x(_ _))) } +::std::list::List::split_trim::10 { x(x(w4 w4) _) } ::std::list::List::split_trim::11 { x(w5 x(?(::std::list::List::split_trim::13 ::std::list::List::split_trim::12 x(w5 w2)) w2)) } -::std::list::List::split_trim::12 { x(x(w3 w3) x(_ _)) } +::std::list::List::split_trim::12 { x(x(w3 w3) _) } ::std::list::List::split_trim::13 { x(x(w7 w3) x(w5 _)) @@ -322,7 +322,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1342(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1331(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -331,7 +331,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1356(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1345(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -363,7 +363,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2470(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2449(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -372,10 +372,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2480(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2459(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2483(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2462(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/aoc_2024/day_10/stats.txt b/tests/snaps/vine/aoc_2024/day_10/stats.txt index 11008869..13270035 100644 --- a/tests/snaps/vine/aoc_2024/day_10/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_10/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 84_637 - Annihilate 22_829 - Commute 16_738 - Copy 24_216 - Erase 13_528 + Total 84_555 + Annihilate 22_800 + Commute 16_704 + Copy 24_204 + Erase 13_521 Expand 4_187 Call 1_992 Branch 1_147 Memory - Heap 55_344 B - Allocated 1_718_400 B - Freed 1_718_400 B + Heap 55_232 B + Allocated 1_716_192 B + Freed 1_716_192 B diff --git a/tests/snaps/vine/aoc_2024/day_11/compiled.iv b/tests/snaps/vine/aoc_2024/day_11/compiled.iv index 07269914..65fe7c13 100644 --- a/tests/snaps/vine/aoc_2024/day_11/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_11/compiled.iv @@ -125,7 +125,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup596(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup588(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -139,11 +139,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup641(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup633(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup648(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup640(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -158,7 +158,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup665(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup657(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -171,9 +171,9 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup702(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup694(w13 w9) w10) tup(w9 w10)) w13) } -::std::list::List::pop_front { fn(ref(tup(dup799(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup791(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -189,9 +189,9 @@ ::std::list::List::concat = fn(tup(1 tup(tup(w5 w13) w13)) fn(w3 w11)) } -::std::list::List::iter { fn(ref(tup(dup959(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup951(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup966(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup958(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -208,7 +208,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1042(w1 w20) x(w12 w18))) + x(w14 x(dup1034(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -246,7 +246,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1161(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1150(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -255,7 +255,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1175(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1164(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -296,12 +296,12 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } ::std::map::Map::insert { - fn(ref(tup(dup1420(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1404(w2 w16) w5) tup(w2 w14)) w9) ::std::map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::map::Map::get_or_insert { - fn(ref(tup(dup1428(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1412(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::option::Option::unwrap_or = fn(w20 fn(w10 w24)) } @@ -314,7 +314,7 @@ ::std::list::List::pop_front = fn(ref(w15 w19) enum(::std::map::Map::Iter::next::9 enum(::std::map::Map::Iter::next::10 x(x(w17 w25) w23)))) } -::std::map::Map::Iter::next::2 { x(x(ref(tup(dup1523(w2 ?(::std::map::Map::Iter::next::5 ::std::map::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } +::std::map::Map::Iter::next::2 { x(x(ref(tup(dup1507(w2 ?(::std::map::Map::Iter::next::5 ::std::map::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } ::std::map::Map::Iter::next::4 { x(x(_ w48) x(x(w4 w46) x(x(w2 w18) w44))) @@ -359,7 +359,7 @@ ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1669(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1650(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -367,10 +367,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1682(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1663(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1697(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1678(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -442,18 +442,18 @@ } ::std::map::is_balanced { - fn(ref(tup(dup2273(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2274(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2252(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2253(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2278(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2279(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2257(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2258(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2283(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2284(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2262(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2263(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } -::std::n32::N32::to_string { fn(dup2289(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2268(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -462,10 +462,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2299(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2278(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2302(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2281(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -473,7 +473,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2309(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2288(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -485,10 +485,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2320(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2299(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2329(dup2324(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2308(dup2303(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -507,21 +507,21 @@ ::std::n32::N32::parse::11 { x(w8 w8) } -::std::n32::N32::cmp { fn(ref(dup2357(w2 dup2357(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2358(w5 dup2358(w12 w15)) w5) w14)) } +::std::n32::N32::cmp { fn(ref(dup2335(w2 dup2335(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2336(w5 dup2336(w12 w15)) w5) w14)) } ::std::n32::N32::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::n32::N32::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::n32::N32::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } ::std::n32::N32::pow { fn(w2 fn(w3 w9)) ::std::n32::N32::pow::2 = x(w2 x(w3 x(1 w9))) } -::std::n32::N32::pow::2 { x(w4 x(dup2450(?(::std::n32::N32::pow::4 ::std::n32::N32::pow::3 x(w4 x(w7 w2))) w7) w2)) } +::std::n32::N32::pow::2 { x(w4 x(dup2426(?(::std::n32::N32::pow::4 ::std::n32::N32::pow::3 x(w4 x(w7 w2))) w7) w2)) } ::std::n32::N32::pow::3 { - x(dup2453(w15 dup2453(w1 @mul(w1 w3))) x(dup2455(@rem(2 ?(::std::n32::N32::pow::7 ::std::n32::N32::pow::6 x(w15 x(x(w7 w14) _)))) @div(2 w5)) x(w7 w17))) + x(dup2429(w15 dup2429(w1 @mul(w1 w3))) x(dup2431(@rem(2 ?(::std::n32::N32::pow::7 ::std::n32::N32::pow::6 x(w15 x(x(w7 w14) _)))) @div(2 w5)) x(w7 w17))) ::std::n32::N32::pow::2 = x(w3 x(w5 x(w14 w17))) } @@ -544,19 +544,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2535(@div(w9 w10) @rem(w12 dup2536(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2538(w9 dup2538(w12 dup2538(w31 dup2538(w36 dup2538(w41 dup2538(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2534(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2508(@div(w9 w10) @rem(w12 dup2509(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2511(w9 dup2511(w12 dup2511(w31 dup2511(w36 dup2511(w41 dup2511(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2507(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2549(@div(w1 w2) @rem(w4 w6)) w6) x(dup2550(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2522(@div(w1 w2) @rem(w4 w6)) w6) x(dup2523(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2558(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2530(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2565(w2 w9) x(dup2567(w0 dup2567(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2571(w5 w11))) + x(x(w27 w33) x(dup2537(w2 w9) x(dup2539(w0 dup2539(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2543(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -570,7 +570,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } -::std::n64::N64::le { fn(tup(w2 dup2663(@lt(w12 ?(::std::n64::N64::le::4 ::std::n64::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2665(w12 w15)) w14)) } +::std::n64::N64::le { fn(tup(w2 dup2635(@lt(w12 ?(::std::n64::N64::le::4 ::std::n64::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2637(w12 w15)) w14)) } ::std::n64::N64::le::3 { x(_ x(_ x(_ x(_ 1)))) } @@ -580,21 +580,21 @@ ::std::n64::N64::le::6 { x(_ x(_ 0)) } -::std::n64::N64::cmp { fn(ref(tup(w3 dup2750(w4 dup2750(@lt(w20 ?(::std::n64::N64::cmp::4 ::std::n64::N64::cmp::3 x(x(w3 w28) x(w26 x(x(w10 w25) x(w23 w22)))))) w26))) tup(w28 w4)) fn(ref(tup(w10 dup2753(w11 dup2753(w20 w23))) tup(w25 w11)) w22)) } +::std::n64::N64::cmp { fn(ref(tup(w3 dup2722(w4 dup2722(@lt(w20 ?(::std::n64::N64::cmp::4 ::std::n64::N64::cmp::3 x(x(w3 w28) x(w26 x(x(w10 w25) x(w23 w22)))))) w26))) tup(w28 w4)) fn(ref(tup(w10 dup2725(w11 dup2725(w20 w23))) tup(w25 w11)) w22)) } ::std::n64::N64::cmp::3 { x(x(w6 w6) x(_ x(x(w3 w3) x(_ ::std::map::Ord::Lt)))) } -::std::n64::N64::cmp::4 { x(w7 x(@lt$(w2 ?(::std::n64::N64::cmp::7 ::std::n64::N64::cmp::6 x(w7 x(w4 w11)))) x(w4 x(w2 w11)))) } +::std::n64::N64::cmp::4 { x(w9 x(@lt$(w4 ?(::std::n64::N64::cmp::6 ::std::n64::N64::cmp::5 x(w9 x(w6 w10)))) x(w6 x(w4 w10)))) } -::std::n64::N64::cmp::6 { x(x(w4 w4) x(x(w2 w2) ::std::map::Ord::Gt)) } +::std::n64::N64::cmp::5 { x(x(w4 w4) x(x(w2 w2) ::std::map::Ord::Gt)) } -::std::n64::N64::cmp::7 { +::std::n64::N64::cmp::6 { x(x(w11 w1) x(x(w9 w4) w6)) ::std::n32::N32::cmp = fn(ref(w11 w1) fn(ref(w9 w4) w6)) } ::std::n64::N64::to_string { - fn(dup2816(w6 w9) w8) + fn(dup2786(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -606,7 +606,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2826(w0 w7) w3) + x(dup2796(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } @@ -626,13 +626,13 @@ } ::std::n64::N64::log_n32::2 { - x(dup2870(w2 w11) x(dup2871(w0 w10) w5)) + x(dup2839(w2 w11) x(dup2840(w0 w10) w5)) ::std::n64::N64::from_n32 = fn(w0 w1) ::std::n64::N64::le = fn(w1 fn(w2 ?(::std::n64::N64::log_n32::4 ::std::n64::N64::log_n32::3 x(w11 x(w10 w5))))) } ::std::n64::N64::log_n32::3 { - x(w12 x(dup2876(w3 w15) x(@add(1 w1) w14))) + x(w12 x(dup2845(w3 w15) x(@add(1 w1) w14))) ::std::n64::N64::div_rem_n32 = fn(w12 fn(w3 tup(w5 _))) ::std::n64::N64::log_n32::2 = x(w5 x(w15 x(w1 w14))) } diff --git a/tests/snaps/vine/aoc_2024/day_12/compiled.iv b/tests/snaps/vine/aoc_2024/day_12/compiled.iv index d55ceb06..ec2ddf5a 100644 --- a/tests/snaps/vine/aoc_2024/day_12/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_12/compiled.iv @@ -63,45 +63,45 @@ ::day_12::Regions::union_found = fn(ref(w1 w7) fn(w16 fn(w4 w11))) } -::day_12::main::24 { x(x(w5 w5) x(x(w3 w3) x(_ _))) } +::day_12::main::24 { x(x(w5 w5) x(x(w3 w3) _)) } ::day_12::main::26 { - x(w10 x(dup136(@lt(w4 ?(::day_12::main::28 ::day_12::main::27 x(w10 x(w13 x(w2 w12))))) w13) x(w7 w12))) + x(w10 x(dup132(@lt(w4 ?(::day_12::main::28 ::day_12::main::27 x(w10 x(w13 x(w2 w12))))) w13) x(w7 w12))) ::std::array::Array::len = fn(ref(w7 w2) w4) } ::day_12::main::27 { - x(x(w7 w24) x(dup144(w11 @add(1 w2)) x(w4 w21))) - ::std::array::Array::get = fn(ref(w4 w9) fn(w11 ref(dup140(enum(::day_12::main::32 enum(::day_12::main::33 x(x(w7 w19) _))) w14) w14))) + x(x(w7 w24) x(dup140(w11 @add(1 w2)) x(w4 w21))) + ::std::array::Array::get = fn(ref(w4 w9) fn(w11 ref(dup136(enum(::day_12::main::32 enum(::day_12::main::33 x(x(w7 w19) _))) w14) w14))) ::day_12::main::26 = x(x(w19 w24) x(w2 x(w9 w21))) } ::day_12::main::28 { x(x(w4 w4) x(_ x(w1 w1))) } -::day_12::main::32 { enum(dup155(@mul(w12 w13) @mul(4 @sub(w11 w12))) enum(@mul(2 w11) x(x(@add(w13 w15) w15) _))) } +::day_12::main::32 { enum(dup151(@mul(w12 w13) @mul(4 @sub(w11 w12))) enum(@mul(2 w11) x(x(@add(w13 w15) w15) _))) } ::day_12::main::33 { enum(_ x(x(w3 w3) _)) } -::day_12::main::34 { x(w10 x(w9 x(dup164(w1 w16) x(w7 x(w6 x(dup168(@le(w1 ?(::day_12::main::36 ::day_12::main::35 x(w10 x(w9 x(w16 x(w7 x(w6 x(w12 w3)))))))) w12) w3)))))) } +::day_12::main::34 { x(w10 x(w9 x(dup160(w1 w16) x(w7 x(w6 x(dup164(@le(w1 ?(::day_12::main::36 ::day_12::main::35 x(w10 x(w9 x(w16 x(w7 x(w6 x(w12 w3)))))))) w12) w3)))))) } ::day_12::main::35 { - x(w23 x(w22 x(w21 x(dup175(w33 w40) x(x(w19 w39) x(dup179(w30 @add(1 w15)) w16)))))) + x(w23 x(w22 x(w21 x(dup171(w33 w40) x(x(w19 w39) x(dup175(w30 @add(1 w15)) w16)))))) ::std::list::List::pop_front = fn(ref(w22 w1) w3) - ::std::option::Option::unwrap_or = fn(w3 fn(tup(0 tup(w24 w24)) dup183(w7 w12))) + ::std::option::Option::unwrap_or = fn(w3 fn(tup(0 tup(w24 w24)) dup179(w7 w12))) ::day_12::main::37 = x(x(w23 w35) x(w33 x(x(w19 w32) x(w30 x(w16 x(w7 x(0 35))))))) ::day_12::main::34 = x(w35 x(w1 x(w21 x(w40 x(x(w32 w39) x(w15 w12)))))) } ::day_12::main::36 { x(_ x(_ x(_ x(_ x(x(w3 w3) _))))) } -::day_12::main::37 { x(w13 x(dup191(w1 w22) x(w10 x(w8 x(w7 x(w6 x(dup197(@le(w1 ?(::day_12::main::39 ::day_12::main::38 x(w13 x(w22 x(w10 x(w8 x(w7 x(w6 x(w16 w4))))))))) w16) w4))))))) } +::day_12::main::37 { x(w13 x(dup187(w1 w22) x(w10 x(w8 x(w7 x(w6 x(dup193(@le(w1 ?(::day_12::main::39 ::day_12::main::38 x(w13 x(w22 x(w10 x(w8 x(w7 x(w6 x(w16 w4))))))))) w16) w4))))))) } ::day_12::main::38 { - x(x(w64 w99) x(dup206(w68 dup206(w74 dup206(w80 dup206(w86 w97)))) x(x(w61 w96) x(dup213(@sub(1 w16) dup213(@sub(1 w25) dup213(w33 dup213(w42 w94)))) x(w58 x(w57 x(dup218(@sub(1 w14) dup218(w23 dup218(w32 dup218(@sub(1 w41) @add(1 w53))))) x(dup220(w17 dup220(w29 dup220(w36 w44))) dup222(w20 dup222(w28 dup222(w35 w43))))))))))) + x(x(w64 w99) x(dup202(w68 dup202(w74 dup202(w80 dup202(w86 w97)))) x(x(w61 w96) x(dup209(@sub(1 w16) dup209(@sub(1 w25) dup209(w33 dup209(w42 w94)))) x(w58 x(w57 x(dup214(@sub(1 w14) dup214(w23 dup214(w32 dup214(@sub(1 w41) @add(1 w53))))) x(dup216(w17 dup216(w29 dup216(w36 w44))) dup218(w20 dup218(w28 dup218(w35 w43))))))))))) ::std::list::List::pop_front = fn(ref(w58 w1) w3) - ::std::option::Option::unwrap_or = fn(w3 fn(35 dup224(w18 dup224(w26 dup224(w37 dup224(w45 w48)))))) + ::std::option::Option::unwrap_or = fn(w3 fn(35 dup220(w18 dup220(w26 dup220(w37 dup220(w45 w48)))))) ::std::list::List::pop_front = fn(ref(w57 w7) w9) - ::std::option::Option::unwrap_or = fn(w9 fn(35 dup225(w19 dup225(w27 dup225(w34 dup225(w46 w50)))))) + ::std::option::Option::unwrap_or = fn(w9 fn(35 dup221(w19 dup221(w27 dup221(w34 dup221(w46 w50)))))) ::day_12::main::40 = x(x(w64 w70) x(w68 x(x(w61 w67) fn(w14 fn(w16 fn(w17 fn(w18 fn(w19 fn(w20 _))))))))) ::day_12::main::40 = x(x(w70 w76) x(w74 x(x(w67 w73) fn(w23 fn(w25 fn(w26 fn(w27 fn(w28 fn(w29 _))))))))) ::day_12::main::40 = x(x(w76 w82) x(w80 x(x(w73 w79) fn(w32 fn(w33 fn(w34 fn(w35 fn(w36 fn(w37 _))))))))) @@ -111,20 +111,20 @@ ::day_12::main::39 { x(x(w10 w10) x(_ x(x(w7 w7) _))) } -::day_12::main::40 { x(w14 x(w12 x(w11 fn(w0 fn(w1 fn(dup239(@ne(35 ?(::day_12::main::43 ::day_12::main::42 x(w14 x(w12 x(w11 x(w0 x(w1 x(w21 x(w3 x(w4 x(w5 w17))))))))))) w21) fn(w3 fn(w4 fn(w5 w17))))))))) } +::day_12::main::40 { x(w14 x(w12 x(w11 fn(w0 fn(w1 fn(dup235(@ne(35 ?(::day_12::main::43 ::day_12::main::42 x(w14 x(w12 x(w11 x(w0 x(w1 x(w21 x(w3 x(w4 x(w5 w17))))))))))) w21) fn(w3 fn(w4 fn(w5 w17))))))))) } -::day_12::main::42 { x(w19 x(w17 x(w16 x(w14 x(w13 x(dup254(dup246(w2 @ne(w5 w6)) w24) x(dup255(@ne(w2 @n32_and(w6 ?(::day_12::main::45 ::day_12::main::44 x(w19 x(w17 x(w16 x(w14 x(w13 x(w24 x(w23 x(w10 x(w21 w20)))))))))))) w23) x(w10 x(dup257(w5 w21) w20))))))))) } +::day_12::main::42 { x(w19 x(w17 x(w16 x(w14 x(w13 x(dup250(dup242(w2 @ne(w5 w6)) w24) x(dup251(@ne(w2 @n32_and(w6 ?(::day_12::main::45 ::day_12::main::44 x(w19 x(w17 x(w16 x(w14 x(w13 x(w24 x(w23 x(w10 x(w21 w20)))))))))))) w23) x(w10 x(dup253(w5 w21) w20))))))))) } -::day_12::main::43 { x(x(w11 w11) x(_ x(x(w8 w8) x(_ x(_ x(_ x(_ x(_ x(_ _))))))))) } +::day_12::main::43 { x(x(w11 w11) x(_ x(x(w8 w8) _))) } ::day_12::main::44 { x(w11 x(w9 x(w8 x(w6 x(w5 x(_ x(_ x(_ x(_ w12))))))))) ::day_12::main::48 = x(w11 x(w9 x(w8 x(w6 x(w5 w12))))) } -::day_12::main::45 { x(w24 x(w22 x(w21 x(w19 x(w18 x(@eq(w2 @n32_and(w8 @n32_and(w11 ?(::day_12::main::47 ::day_12::main::48 x(w24 x(w22 x(w21 x(w19 x(w18 w25))))))))) x(dup270(w2 @eq(w6 w8)) x(w15 x(dup271(w6 @ne(w15 w11)) w25))))))))) } +::day_12::main::45 { x(w24 x(w22 x(w21 x(w19 x(w18 x(@eq(w2 @n32_and(w8 @n32_and(w11 ?(::day_12::main::47 ::day_12::main::48 x(w24 x(w22 x(w21 x(w19 x(w18 w25))))))))) x(dup265(w2 @eq(w6 w8)) x(w15 x(dup266(w6 @ne(w15 w11)) w25))))))))) } -::day_12::main::47 { x(x(w7 w7) x(_ x(x(w4 w4) x(_ x(_ _))))) } +::day_12::main::47 { x(x(w7 w7) x(_ x(x(w4 w4) _))) } ::day_12::main::48 { x(x(w22 w7) x(w20 x(x(@add(w10 w14) w14) x(@add(w3 w4) x(@mul(w20 w3) _))))) @@ -144,40 +144,40 @@ ::day_12::Regions::find { fn(ref(w3 w18) fn(w7 w13)) - ::day_12::Regions::find::2 = x(x(w3 w18) x(x(w7 dup333(w14 w13)) w14)) + ::day_12::Regions::find::2 = x(x(w3 w18) x(x(w7 dup326(w14 w13)) w14)) } ::day_12::Regions::find::2 { - x(x(w13 w19) x(x(dup343(w3 w16) w17) w15)) + x(x(w13 w19) x(x(dup336(w3 w16) w17) w15)) ::std::array::Array::get = fn(ref(w13 w1) fn(w3 ref(enum(::day_12::Regions::find::5 enum(::day_12::Regions::find::6 x(x(w1 w19) x(x(w16 w17) x(w15 w14))))) w14))) } ::day_12::Regions::find::5 { enum(w1 enum(w3 x(x(w10 w10) x(x(w8 w8) x(_ enum(enum(w1 enum(w3 w11)) enum(_ w11))))))) } ::day_12::Regions::find::6 { - enum(w1 x(w10 x(x(_ w18) x(dup357(w14 w16) enum(_ enum(enum(w14 w11) w11)))))) + enum(w1 x(w10 x(x(_ w18) x(dup350(w14 w16) enum(_ enum(enum(w14 w11) w11)))))) ::day_12::Regions::find::2 = x(w10 x(x(w1 w18) w16)) } ::day_12::Regions::get_area { fn(ref(w3 w15) fn(w5 w32)) ::day_12::Regions::find = fn(ref(w3 w9) fn(w5 w12)) - ::std::array::Array::get = fn(ref(w9 w15) fn(w12 ref(dup363(enum(::day_12::Regions::get_area::4 enum(_ w32)) w29) w29))) + ::std::array::Array::get = fn(ref(w9 w15) fn(w12 ref(dup356(enum(::day_12::Regions::get_area::4 enum(_ w32)) w29) w29))) } ::day_12::Regions::get_area::4 { enum(w0 enum(_ w0)) } -::day_12::Regions::union_found { fn(ref(w3 w19) fn(dup382(@eq(w13 ?(::day_12::Regions::union_found::4 ::day_12::Regions::union_found::3 x(x(w3 w19) x(w17 x(w16 w15))))) w17) fn(dup383(w13 w16) w15))) } +::day_12::Regions::union_found { fn(ref(w3 w19) fn(dup375(@eq(w13 ?(::day_12::Regions::union_found::4 ::day_12::Regions::union_found::3 x(x(w3 w19) x(w17 x(w16 w15))))) w17) fn(dup376(w13 w16) w15))) } ::day_12::Regions::union_found::3 { - x(x(w6 w8) x(dup390(w10 w1) x(_ w1))) + x(x(w6 w8) x(dup383(w10 w1) x(_ w1))) ::std::array::Array::get = fn(ref(w6 w8) fn(w10 ref(enum(::day_12::Regions::union_found::7 enum(::day_12::Regions::union_found::8 x(_ w16))) w16))) } ::day_12::Regions::union_found::4 { - x(x(w21 w9) x(dup399(w3 w36) x(dup400(w11 w35) w30))) - ::std::array::Array::get = fn(ref(w21 w1) fn(w3 ref(dup402(w22 w33) w34))) - ::std::array::Array::get = fn(ref(w1 w9) fn(w11 ref(dup404(w23 w31) w32))) + x(x(w21 w9) x(dup392(w3 w36) x(dup393(w11 w35) w30))) + ::std::array::Array::get = fn(ref(w21 w1) fn(w3 ref(dup395(w22 w33) w34))) + ::std::array::Array::get = fn(ref(w1 w9) fn(w11 ref(dup397(w23 w31) w32))) tup(w22 w23) = tup(w26 enum(::day_12::Regions::union_found::14 enum(::day_12::Regions::union_found::17 x(w36 x(w35 x(x(w33 w34) x(x(w31 w32) x(w30 w26)))))))) } @@ -186,20 +186,20 @@ ::day_12::Regions::union_found::8 { enum(w1 x(_ enum(_ enum(enum(w1 w5) w5)))) } ::day_12::Regions::union_found::12 { - x(_ x(dup420(w4 w7) x(w5 x(w2 x(w10 x(w9 w7)))))) + x(_ x(dup413(w4 w7) x(w5 x(w2 x(w10 x(w9 w7)))))) ::day_12::Region::Root = fn(w10 fn(w9 w2)) ::day_12::Region::Child = fn(w4 w5) } ::day_12::Regions::union_found::13 { - x(dup426(w4 w7) x(_ x(w2 x(w5 x(w10 x(w9 w7)))))) + x(dup419(w4 w7) x(_ x(w2 x(w5 x(w10 x(w9 w7)))))) ::day_12::Region::Root = fn(w10 fn(w9 w2)) ::day_12::Region::Child = fn(w4 w5) } ::day_12::Regions::union_found::14 { enum(w0 enum(w1 x(w10 x(w9 x(w8 x(w6 x(w13 enum(::day_12::Regions::union_found::15 enum(::day_12::Regions::union_found::16 x(w10 x(w9 x(w8 x(w6 x(w13 x(w0 w1))))))))))))))) } -::day_12::Regions::union_found::15 { enum(dup446(@add(w16 w17) @lt(w26 ?(::day_12::Regions::union_found::13 ::day_12::Regions::union_found::12 x(w14 x(w13 x(w32 x(w31 x(w17 x(w22 w28))))))))) enum(@add(w6 @add(1 w22)) x(w14 x(w13 x(x(_ w32) x(x(_ w31) x(w28 x(dup448(w16 w26) w6)))))))) } +::day_12::Regions::union_found::15 { enum(dup439(@add(w16 w17) @lt(w26 ?(::day_12::Regions::union_found::13 ::day_12::Regions::union_found::12 x(w14 x(w13 x(w32 x(w31 x(w17 x(w22 w28))))))))) enum(@add(w6 @add(1 w22)) x(w14 x(w13 x(x(_ w32) x(x(_ w31) x(w28 x(dup441(w16 w26) w6)))))))) } ::day_12::Regions::union_found::16 { enum(_ x(_ x(_ x(x(w7 w7) x(x(w5 w5) _))))) } @@ -207,25 +207,25 @@ ::std::array::Array::empty { tup(0 _) } -::std::array::Array::len { fn(ref(tup(dup571(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup564(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup577(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup570(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup588(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup581(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup592(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup585(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_back { fn(ref(tup(dup598(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup598(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_back { fn(ref(tup(dup591(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup591(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -238,10 +238,10 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_back::5 { x(w4 dup619(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } +::std::array::Array::push_back::5 { x(w4 dup612(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } ::std::array::Array::push_back::6 { - x(x(w10 w13) dup623(w1 @rem(2 w3))) + x(x(w10 w13) dup616(w1 @rem(2 w3))) ::std::array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::array::Array::push_back::5 = x(x(w5 w13) w6) } @@ -269,7 +269,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup930(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup915(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -283,11 +283,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup975(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup960(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup982(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup967(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -302,7 +302,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup999(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup984(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -315,7 +315,7 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::pop_front { fn(ref(tup(dup1133(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup1118(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -326,7 +326,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2623(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2595(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -335,10 +335,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2633(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2605(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2636(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2608(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/aoc_2024/day_12/stats.txt b/tests/snaps/vine/aoc_2024/day_12/stats.txt index 0db27b1b..b8bdf0bb 100644 --- a/tests/snaps/vine/aoc_2024/day_12/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_12/stats.txt @@ -1,9 +1,9 @@ Interactions Total 265_697 - Annihilate 143_587 + Annihilate 142_474 Commute 1_705 - Copy 24_565 + Copy 25_678 Erase 21_356 Expand 31_414 Call 29_526 @@ -11,5 +11,5 @@ Interactions Memory Heap 25_264 B - Allocated 5_752_928 B - Freed 5_752_928 B + Allocated 5_735_120 B + Freed 5_735_120 B diff --git a/tests/snaps/vine/aoc_2024/day_13/compiled.iv b/tests/snaps/vine/aoc_2024/day_13/compiled.iv index 4c900265..1a5c855d 100644 --- a/tests/snaps/vine/aoc_2024/day_13/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_13/compiled.iv @@ -85,18 +85,18 @@ ::day_13::main::8 { x(w9 x(w7 x(w6 x(w5 x(@eq(w7 ?(::day_13::main::11 ::day_13::main::10 x(w9 x(w6 x(w5 w10))))) w10))))) } -::day_13::main::9 { x(x(w6 w6) x(_ x(_ x(_ x(_ _))))) } +::day_13::main::9 { x(x(w6 w6) _) } ::day_13::main::10 { x(x(@add(w3 w5) w5) x(@mul(3 @add(w7 w3)) x(w7 _))) } -::day_13::main::11 { x(x(w4 w4) x(_ x(_ _))) } +::day_13::main::11 { x(x(w4 w4) _) } ::day_13::main::14 { x(w9 x(w7 x(w6 x(w5 x(w4 w10))))) ::std::n64::N64::eq = fn(w4 fn(w7 ?(::day_13::main::17 ::day_13::main::16 x(w9 x(w6 x(w5 w10)))))) } -::day_13::main::15 { x(x(w6 w6) x(_ x(_ x(_ x(_ _))))) } +::day_13::main::15 { x(x(w6 w6) _) } ::day_13::main::16 { x(x(w12 w6) x(w10 x(w9 _))) @@ -106,7 +106,7 @@ ::std::n64::N64::add = fn(w12 fn(w5 w6)) } -::day_13::main::17 { x(x(w4 w4) x(_ x(_ _))) } +::day_13::main::17 { x(x(w4 w4) _) } ::std::io::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -119,7 +119,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup569(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup555(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -138,7 +138,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup663(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup649(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -151,9 +151,9 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup675(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup661(w13 w9) w10) tup(w9 w10)) w13) } -::std::list::List::pop_front { fn(ref(tup(dup772(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup758(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -164,9 +164,9 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::list::List::iter { fn(ref(tup(dup932(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup918(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup939(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup925(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -183,7 +183,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1015(w1 w20) x(w12 w18))) + x(w14 x(dup1001(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -221,7 +221,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1134(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1117(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -230,7 +230,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1148(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1131(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -262,7 +262,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2262(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2235(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -271,10 +271,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2272(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2245(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2275(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2248(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -282,7 +282,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2282(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2255(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -294,10 +294,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2293(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2266(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2302(dup2297(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2275(dup2270(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -316,7 +316,7 @@ ::std::n32::N32::parse::11 { x(w8 w8) } -::std::n32::N32::diff { fn(dup2363(@lt$(w8 ?(::std::n32::N32::diff::4 ::std::n32::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2364(w8 w11) w10)) } +::std::n32::N32::diff { fn(dup2334(@lt$(w8 ?(::std::n32::N32::diff::4 ::std::n32::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2335(w8 w11) w10)) } ::std::n32::N32::diff::3 { x(@sub(w4 w2) x(w4 w2)) } @@ -335,19 +335,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2508(@div(w9 w10) @rem(w12 dup2509(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2511(w9 dup2511(w12 dup2511(w31 dup2511(w36 dup2511(w41 dup2511(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2507(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2475(@div(w9 w10) @rem(w12 dup2476(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2478(w9 dup2478(w12 dup2478(w31 dup2478(w36 dup2478(w41 dup2478(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2474(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2522(@div(w1 w2) @rem(w4 w6)) w6) x(dup2523(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2489(@div(w1 w2) @rem(w4 w6)) w6) x(dup2490(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2531(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2497(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2538(w2 w9) x(dup2540(w0 dup2540(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2544(w5 w11))) + x(x(w27 w33) x(dup2504(w2 w9) x(dup2506(w0 dup2506(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2510(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -361,7 +361,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } -::std::n64::N64::ge { fn(tup(w2 dup2680(@lt$(w12 ?(::std::n64::N64::ge::4 ::std::n64::N64::ge::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2682(w12 w15)) w14)) } +::std::n64::N64::ge { fn(tup(w2 dup2646(@lt$(w12 ?(::std::n64::N64::ge::4 ::std::n64::N64::ge::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2648(w12 w15)) w14)) } ::std::n64::N64::ge::3 { x(_ x(_ x(_ x(_ 1)))) } @@ -372,7 +372,7 @@ ::std::n64::N64::ge::6 { x(_ x(_ 0)) } ::std::n64::N64::to_string { - fn(dup2789(w6 w9) w8) + fn(dup2753(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -384,7 +384,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2799(w0 w7) w3) + x(dup2763(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } @@ -403,10 +403,10 @@ ::std::n64::N64::pow_n32::2 = x(w2 x(w3 x(::std::n64::N64::one w9))) } -::std::n64::N64::pow_n32::2 { x(w4 x(dup2818(?(::std::n64::N64::pow_n32::4 ::std::n64::N64::pow_n32::3 x(w4 x(w7 w2))) w7) w2)) } +::std::n64::N64::pow_n32::2 { x(w4 x(dup2782(?(::std::n64::N64::pow_n32::4 ::std::n64::N64::pow_n32::3 x(w4 x(w7 w2))) w7) w2)) } ::std::n64::N64::pow_n32::3 { - x(dup2821(w16 dup2821(w1 w2)) x(dup2823(@rem(2 ?(::std::n64::N64::pow_n32::7 ::std::n64::N64::pow_n32::6 x(w16 x(x(w8 w15) _)))) @div(2 w6)) x(w8 w18))) + x(dup2785(w16 dup2785(w1 w2)) x(dup2787(@rem(2 ?(::std::n64::N64::pow_n32::7 ::std::n64::N64::pow_n32::6 x(w16 x(x(w8 w15) _)))) @div(2 w6)) x(w8 w18))) ::std::n64::N64::mul = fn(w1 fn(w2 w3)) ::std::n64::N64::pow_n32::2 = x(w3 x(w6 x(w15 w18))) } @@ -421,7 +421,7 @@ ::std::n64::N64::pow_n32::7 { x(_ x(x(w2 w2) _)) } ::std::n64::N64::diff { - fn(dup2855(w7 w12) fn(dup2856(w8 w11) w10)) + fn(dup2818(w7 w12) fn(dup2819(w8 w11) w10)) ::std::n64::N64::ge = fn(w7 fn(w8 ?(::std::n64::N64::diff::4 ::std::n64::N64::diff::3 x(w12 x(w11 w10))))) } diff --git a/tests/snaps/vine/aoc_2024/day_13/stats.txt b/tests/snaps/vine/aoc_2024/day_13/stats.txt index f82bad38..eee6095b 100644 --- a/tests/snaps/vine/aoc_2024/day_13/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_13/stats.txt @@ -1,9 +1,9 @@ Interactions Total 88_392 - Annihilate 53_772 + Annihilate 53_756 Commute 94 - Copy 6_522 + Copy 6_538 Erase 7_553 Expand 12_374 Call 5_067 @@ -11,5 +11,5 @@ Interactions Memory Heap 9_248 B - Allocated 1_975_744 B - Freed 1_975_744 B + Allocated 1_975_488 B + Freed 1_975_488 B diff --git a/tests/snaps/vine/aoc_2024/day_14/compiled.iv b/tests/snaps/vine/aoc_2024/day_14/compiled.iv index 995f5a93..b27ad6b1 100644 --- a/tests/snaps/vine/aoc_2024/day_14/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_14/compiled.iv @@ -9,7 +9,7 @@ ::std::n32::N32::to_string = fn(w22 w29) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w56)))))))) w56)) fn(w29 w30)) ::std::io::IO::println = fn(ref(w46 w25) fn(w30 _)) - ::day_14::main::37 = x(x(w25 w60) x(w58 0)) + ::day_14::main::34 = x(x(w25 w60) x(w58 0)) ::std::n32::N32::to_string = fn(0 w39) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(50 tup(58 tup(32 w61)))))))) w61)) fn(w39 w40)) ::std::io::IO::println = fn(ref(w60 w35) fn(w40 _)) @@ -25,10 +25,7 @@ ::std::list::List::len = fn(ref(w0 w7) ?(::day_14::main::8 ::day_14::main::7 x(w5 x(w3 w7)))) } -::day_14::main::6 { - x(x(w3 w3) x(w1 w1)) - _ = _ -} +::day_14::main::6 { x(x(w3 w3) x(w1 w1)) } ::day_14::main::7 { x(w58 x(x(w56 w66) w54)) @@ -50,10 +47,7 @@ ::day_14::main::10 = fn(w27 fn(7 w43)) } -::day_14::main::8 { - x(x(w4 w4) x(x(w2 w2) _)) - _ = _ -} +::day_14::main::8 { x(x(w4 w4) x(x(w2 w2) _)) } ::day_14::main::10 { fn(w0 fn(w1 w14)) @@ -92,47 +86,47 @@ } ::day_14::main::21 { - x(x(w11 w11) x(x(w9 w9) x(w7 x(w5 x(@lt$(w13 ?(::day_14::main::30 ::day_14::main::29 x(w7 x(w5 w2)))) w2))))) - 11 = @div(2 w13) + x(x(w13 w13) x(x(w11 w11) x(w9 x(w7 x(@lt$(w1 ?(::day_14::main::28 ::day_14::main::27 x(w9 x(w7 w4)))) w4))))) + 11 = @div(2 w1) } ::day_14::main::23 { x(x(@add(1 w1) w1) x(x(w5 w5) _)) } ::day_14::main::24 { - x(x(w6 w6) x(w4 x(@lt$(w8 ?(::day_14::main::27 ::day_14::main::26 x(w4 w10))) w10))) - 7 = @div(2 w8) + x(x(w8 w8) x(w6 x(@lt$(w1 ?(::day_14::main::26 ::day_14::main::25 x(w6 w9))) w9))) + 7 = @div(2 w1) } -::day_14::main::26 { x(x(@add(1 w1) w1) _) } +::day_14::main::25 { x(x(@add(1 w1) w1) _) } -::day_14::main::27 { x(x(w2 w2) _) } +::day_14::main::26 { x(x(w2 w2) _) } -::day_14::main::29 { - x(w6 x(w4 x(dup153(@lt(w8 ?(::day_14::main::33 ::day_14::main::32 x(w6 x(w4 x(w11 w10))))) w11) w10))) +::day_14::main::27 { + x(w6 x(w4 x(dup150(@lt(w8 ?(::day_14::main::31 ::day_14::main::30 x(w6 x(w4 x(w11 w10))))) w11) w10))) 7 = @div(2 w8) } -::day_14::main::30 { x(x(w5 w5) x(x(w3 w3) _)) } +::day_14::main::28 { x(x(w5 w5) x(x(w3 w3) _)) } -::day_14::main::32 { x(x(@add(1 w1) w1) x(x(w5 w5) _)) } +::day_14::main::30 { x(x(@add(1 w1) w1) x(x(w5 w5) _)) } -::day_14::main::33 { - x(x(w6 w6) x(w4 x(@lt$(w8 ?(::day_14::main::36 ::day_14::main::35 x(w4 w10))) w10))) - 7 = @div(2 w8) +::day_14::main::31 { + x(x(w8 w8) x(w6 x(@lt$(w1 ?(::day_14::main::33 ::day_14::main::32 x(w6 w9))) w9))) + 7 = @div(2 w1) } -::day_14::main::35 { x(x(@add(1 w1) w1) _) } +::day_14::main::32 { x(x(@add(1 w1) w1) _) } -::day_14::main::36 { x(x(w2 w2) _) } +::day_14::main::33 { x(x(w2 w2) _) } -::day_14::main::37 { +::day_14::main::34 { x(x(w8 w12) w6) - ::std::io::IO::read_line = fn(ref(w8 w1) enum(::day_14::main::40 enum(::day_14::main::41 x(x(w1 w12) w6)))) + ::std::io::IO::read_line = fn(ref(w8 w1) enum(::day_14::main::37 enum(::day_14::main::38 x(x(w1 w12) w6)))) } -::day_14::main::40 { - enum(w0 x(x(w5 w57) x(dup185(w24 w55) w2))) - ::std::n32::N32::parse = fn(w0 enum(::day_14::main::45 enum(::day_14::main::46 x(x(w2 dup187(w50 dup187(w33 @add(1 w37)))) _)))) +::day_14::main::37 { + enum(w0 x(x(w5 w57) x(dup179(w24 w55) w2))) + ::std::n32::N32::parse = fn(w0 enum(::day_14::main::42 enum(::day_14::main::43 x(x(w2 dup181(w50 dup181(w33 @add(1 w37)))) _)))) ::std::char::Char::from_n32 = fn(27 w7) ::std::list::List::concat = fn(w13 fn(tup(3 tup(tup(91 tup(50 tup(74 w45))) w45)) w15)) ::std::list::List::concat = fn(w15 fn(w16 w17)) @@ -141,51 +135,51 @@ ::std::array::Array::new = fn(11 fn(46 w21)) ::std::array::Array::new = fn(7 fn(w21 w22)) ::std::list::List::into_iter = fn(w24 w25) - ::day_14::main::47 = x(w50 x(x(w22 w49) w25)) + ::day_14::main::44 = x(w50 x(x(w22 w49) w25)) ::std::array::Array::to_list = fn(w49 w28) - ::day_14::main::52 = x(x(w11 w53) w28) + ::day_14::main::49 = x(x(w11 w53) w28) ::std::n32::N32::to_string = fn(w33 w34) ::std::io::IO::println = fn(ref(w53 w31) fn(w34 _)) - ::day_14::main::37 = x(x(w31 w57) x(w55 w37)) - tup(1 tup(tup(w7 w44) w44)) = dup190(w13 w16) + ::day_14::main::34 = x(x(w31 w57) x(w55 w37)) + tup(1 tup(tup(w7 w44) w44)) = dup184(w13 w16) } -::day_14::main::41 { x(x(w3 w3) _) } +::day_14::main::38 { x(x(w3 w3) _) } -::day_14::main::45 { enum(w0 x(x(_ w0) _)) } +::day_14::main::42 { enum(w0 x(x(_ w0) _)) } -::day_14::main::46 { x(x(w2 w2) _) } +::day_14::main::43 { x(x(w2 w2) _) } -::day_14::main::47 { +::day_14::main::44 { x(w8 x(w7 w5)) - ::std::list::List::IntoIter::next = fn(ref(w5 w1) enum(::day_14::main::50 enum(::day_14::main::51 x(w8 x(w7 w1))))) + ::std::list::List::IntoIter::next = fn(ref(w5 w1) enum(::day_14::main::47 enum(::day_14::main::48 x(w8 x(w7 w1))))) } -::day_14::main::50 { - enum(tup(@add(w17 @rem(11 w19)) tup(@add(w24 @rem(7 w26)) tup(@mul(w16 w17) @mul(w23 w24)))) x(dup211(w16 dup211(w23 w43)) x(x(w12 w42) w10))) +::day_14::main::47 { + enum(tup(@add(w17 @rem(11 w19)) tup(@add(w24 @rem(7 w26)) tup(@mul(w16 w17) @mul(w23 w24)))) x(dup204(w16 dup204(w23 w43)) x(x(w12 w42) w10))) ::std::array::Array::get = fn(ref(w12 w29) fn(w26 w33)) ::std::array::Array::get = fn(w33 fn(w19 ref(_ 35))) - ::day_14::main::47 = x(w43 x(x(w29 w42) w10)) + ::day_14::main::44 = x(w43 x(x(w29 w42) w10)) } -::day_14::main::51 { x(_ x(x(w2 w2) _)) } +::day_14::main::48 { x(_ x(x(w2 w2) _)) } -::day_14::main::52 { +::day_14::main::49 { x(w7 w5) - ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_14::main::55 enum(::day_14::main::56 x(w7 w1)))) + ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_14::main::52 enum(::day_14::main::53 x(w7 w1)))) } -::day_14::main::55 { +::day_14::main::52 { enum(w0 x(x(w4 w13) w2)) ::std::array::Array::to_list = fn(w0 w9) ::std::io::IO::println = fn(ref(w4 w6) fn(w9 _)) - ::day_14::main::52 = x(x(w6 w13) w2) + ::day_14::main::49 = x(x(w6 w13) w2) } -::day_14::main::56 { x(x(w2 w2) _) } +::day_14::main::53 { x(x(w2 w2) _) } ::std::array::Array::new { - fn(dup245(w6 w7) fn(w3 tup(w6 w9))) + fn(dup238(w6 w7) fn(w3 tup(w6 w9))) ::std::array::Node::new = fn(w7 fn(w3 w9)) } @@ -195,10 +189,10 @@ ::std::array::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::array::Array::fold_back { fn(tup(dup328(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::array::Array::fold_back { fn(tup(dup321(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::array::Array::fold_back::3 { - x(dup336(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup329(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::array::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::option::Option::unwrap = fn(w13 w14) @@ -207,25 +201,25 @@ ::std::array::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::array::Array::len { fn(ref(tup(dup349(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup342(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup355(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup348(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup366(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup359(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup370(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup363(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_back { fn(ref(tup(dup376(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup376(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_back { fn(ref(tup(dup369(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup369(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -238,55 +232,55 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_back::5 { x(w4 dup397(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } +::std::array::Array::push_back::5 { x(w4 dup390(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } ::std::array::Array::push_back::6 { - x(x(w10 w13) dup401(w1 @rem(2 w3))) + x(x(w10 w13) dup394(w1 @rem(2 w3))) ::std::array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::array::Array::push_back::5 = x(x(w5 w13) w6) } ::std::array::Array::push_back::7 { x(x(w2 w2) _) } -::std::array::Array::pop_front { fn(ref(tup(dup491(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup482(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup497(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup488(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup509(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup499(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup516(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup506(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -294,7 +288,7 @@ ::std::array::Node::leaf { fn(x x) } -::std::array::Node::new { fn(dup552(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::array::Node::new { fn(dup541(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::array::Node::new::3 { x(_ x(w3 w1)) @@ -302,7 +296,7 @@ } ::std::array::Node::new::4 { - x(dup560(@add(1 @div(2 w2)) @div(2 w6)) x(dup561(w3 w7) tup(w4 w8))) + x(dup549(@add(1 @div(2 w2)) @div(2 w6)) x(dup550(w3 w7) tup(w4 w8))) ::std::array::Node::new = fn(w2 fn(w3 w4)) ::std::array::Node::new = fn(w6 fn(w7 w8)) } @@ -313,7 +307,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::zip_with { fn(dup628(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::array::Node::zip_with { fn(dup614(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -323,7 +317,7 @@ } ::std::array::Node::zip_with::4 { - x(dup640(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup643(w13 w19) tup(w14 w20))))) + x(dup626(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup629(w13 w19) tup(w14 w20))))) ::std::array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } @@ -341,7 +335,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup708(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup693(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -355,11 +349,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup753(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup738(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup760(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup745(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -374,7 +368,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup777(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup762(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -387,14 +381,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup814(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup799(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup848(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup833(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -403,7 +397,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup911(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup896(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -419,9 +413,9 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::list::List::iter { fn(ref(tup(dup1071(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1056(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1078(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1063(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -434,7 +428,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1107(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1092(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -469,7 +463,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1273(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1255(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -478,7 +472,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1287(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1269(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -510,7 +504,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2401(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2373(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -519,10 +513,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2411(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2383(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2414(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2386(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -530,7 +524,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2421(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2393(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -542,10 +536,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2432(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2404(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2441(dup2436(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2413(dup2408(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/aoc_2024/day_14/stats.txt b/tests/snaps/vine/aoc_2024/day_14/stats.txt index fb91af8e..0ed1402a 100644 --- a/tests/snaps/vine/aoc_2024/day_14/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_14/stats.txt @@ -1,10 +1,10 @@ Interactions - Total 28_557 + Total 28_556 Annihilate 16_493 Commute 50 Copy 2_343 - Erase 2_623 + Erase 2_622 Expand 4_140 Call 1_823 Branch 1_085 diff --git a/tests/snaps/vine/aoc_2024/day_15/compiled.iv b/tests/snaps/vine/aoc_2024/day_15/compiled.iv index 416d6d7b..4c9cc9ce 100644 --- a/tests/snaps/vine/aoc_2024/day_15/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_15/compiled.iv @@ -6,23 +6,23 @@ ::day_15::main::2 = x(x(w3 w76) x(x(::std::array::Array::empty dup9(w10 w81)) x(0 x(_ dup16(w14 @mul(tup(2 1) w39)))))) ::day_15::main::20 = x(x(w76 w84) x(x(w81 dup10(w17 w90)) x(x(tup(0 tup(w77 w77)) w80) w14))) ::std::array::Array::to_list = fn(w17 w18) - ::day_15::main::45 = x(x(0 w88) x(w18 0)) + ::day_15::main::43 = x(x(0 w88) x(w18 0)) ::day_15::main::19 = x(x(w84 w92) x(w90 _)) ::std::n32::N32::to_string = fn(w88 w28) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w93)))))))) w93)) fn(w28 w29)) ::std::io::IO::println = fn(ref(w92 w24) fn(w29 _)) ::std::array::Array::to_list = fn(w10 w32) ::std::array::Array::to_list = fn(w94 w100) - ::day_15::main::59 = x(x(tup(0 tup(w104 w104)) w107) w100) + ::day_15::main::57 = x(x(tup(0 tup(w104 w104)) w107) w100) ::std::array::Array::from_list = fn(w107 w103) ::std::list::List::map = fn(w32 fn(fn(w94 w103) w34)) ::std::array::Array::from_list = fn(w34 w35) - ::day_15::main::67 = x(x(w35 w111) x(w80 w39)) + ::day_15::main::65 = x(x(w35 w111) x(w80 w39)) ::std::array::Array::get = fn(ref(w111 w42) fn(0 w45)) ::std::array::Array::len = fn(w45 _) ::std::array::Array::len = fn(ref(w42 dup14(w56 w117)) _) ::std::array::Array::to_list = fn(w56 w57) - ::day_15::main::135 = x(x(0 w115) x(w57 0)) + ::day_15::main::132 = x(x(0 w115) x(w57 0)) ::day_15::main::19 = x(x(w24 w119) x(w117 _)) ::std::n32::N32::to_string = fn(w115 w67) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(50 tup(58 tup(32 w120)))))))) w120)) fn(w67 w68)) @@ -39,10 +39,7 @@ ::std::list::List::len = fn(ref(w0 w10) ?(::day_15::main::8 ::day_15::main::7 x(w8 x(w6 x(w4 x(w3 w10)))))) } -::day_15::main::6 { - x(x(w6 w6) x(x(w4 w4) x(_ x(w1 w1)))) - _ = _ -} +::day_15::main::6 { x(x(w6 w6) x(x(w4 w4) x(_ x(w1 w1)))) } ::day_15::main::7 { x(w25 x(x(w23 w36) x(dup69(w31 @add(1 w17)) x(x(w20 w33) w18)))) @@ -54,10 +51,7 @@ ::day_15::main::2 = x(w25 x(x(w11 w36) x(w17 x(w30 w33)))) } -::day_15::main::8 { - x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) _)))) - _ = _ -} +::day_15::main::8 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) _)))) } ::day_15::main::10 { x(w10 x(w9 x(w7 x(w6 w12)))) @@ -108,10 +102,10 @@ } ::day_15::main::28 { - enum(dup171(w9 dup171(@eq(60 ?(::day_15::main::32 ::day_15::main::31 x(w30 dup172(w16 dup172(w33 w44))))) w30)) x(x(w8 w55) x(x(w6 w53) x(x(dup168(@add(w16 w17) w45) w51) w2)))) + enum(dup170(w9 dup170(@eq(60 ?(::day_15::main::32 ::day_15::main::31 x(w30 dup171(w16 dup171(w33 w44))))) w30)) x(x(w8 w55) x(x(w6 w53) x(x(dup167(@add(w16 w17) w45) w51) w2)))) ::std::list::List::concat = fn(w6 fn(tup(1 tup(tup(w9 w26) w26)) w12)) - ::day_15::main::39 = x(x(w8 w35) x(w33 x(w17 w32))) - ::day_15::main::18 = x(x(w35 w38) fn(w32 ref(dup176(@eq(46 ?(::day_15::main::44 ::day_15::main::43 x(x(w38 w48) x(x(w45 w46) x(w44 x(x(w42 w43) _)))))) w42) w43))) + ::day_15::main::37 = x(x(w8 w35) x(w33 x(w17 w32))) + ::day_15::main::18 = x(x(w35 w38) fn(w32 ref(dup175(@eq(46 ?(::day_15::main::42 ::day_15::main::41 x(x(w38 w48) x(x(w45 w46) x(w44 x(x(w42 w43) _)))))) w42) w43))) ::day_15::main::25 = x(x(w48 w55) x(x(w12 w53) x(x(w46 w51) w2))) } @@ -122,260 +116,260 @@ 1 = @sub$(0 w0) } -::day_15::main::32 { x(dup185(@eq(62 ?(::day_15::main::35 ::day_15::main::34 x(w6 w5))) w6) w5) } +::day_15::main::32 { x(dup184(@eq(62 ?(::day_15::main::34 ::day_15::main::33 x(w5 w4))) w5) w4) } -::day_15::main::34 { x(_ tup(1 0)) } +::day_15::main::33 { x(_ tup(1 0)) } -::day_15::main::35 { x(@eq(94 ?(::day_15::main::38 ::day_15::main::37 w5)) w5) } +::day_15::main::34 { x(@eq(94 ?(::day_15::main::36 ::day_15::main::35 w4)) w4) } -::day_15::main::37 { +::day_15::main::35 { tup(0 w0) 1 = @sub$(0 w0) } -::day_15::main::38 { tup(0 1) } +::day_15::main::36 { tup(0 1) } -::day_15::main::39 { - x(x(w11 w19) x(w9 x(dup200(w1 w15) w16))) - ::day_15::main::18 = x(x(w11 w14) fn(w1 ref(dup194(@eq(79 ?(::day_15::main::41 ::day_15::main::40 x(x(w14 w19) x(w9 x(w15 w16))))) w4) w4))) +::day_15::main::37 { + x(x(w11 w19) x(w9 x(dup197(w1 w15) w16))) + ::day_15::main::18 = x(x(w11 w14) fn(w1 ref(dup191(@eq(79 ?(::day_15::main::39 ::day_15::main::38 x(x(w14 w19) x(w9 x(w15 w16))))) w4) w4))) } -::day_15::main::40 { - x(w7 x(dup204(w0 w10) x(@add(w0 w2) w9))) - ::day_15::main::39 = x(w7 x(w10 x(w2 w9))) +::day_15::main::38 { + x(w7 x(dup201(w0 w10) x(@add(w0 w2) w9))) + ::day_15::main::37 = x(w7 x(w10 x(w2 w9))) } -::day_15::main::41 { x(x(w4 w4) x(_ x(w1 w1))) } +::day_15::main::39 { x(x(w4 w4) x(_ x(w1 w1))) } -::day_15::main::43 { - x(w16 x(x(@add(w12 dup212(w13 w5)) w13) x(w12 x(x(_ 79) _)))) +::day_15::main::41 { + x(w16 x(x(@add(w12 dup209(w13 w5)) w13) x(w12 x(x(_ 79) _)))) ::day_15::main::18 = x(w16 fn(w5 ref(_ 46))) } -::day_15::main::44 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) _)))) } +::day_15::main::42 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) _)))) } -::day_15::main::45 { +::day_15::main::43 { x(w8 x(w6 w5)) - ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::48 enum(::day_15::main::49 x(w8 x(w1 w5))))) + ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::46 enum(::day_15::main::47 x(w8 x(w1 w5))))) } -::day_15::main::48 { - enum(w0 x(x(w5 w20) x(w3 dup232(w14 @add(1 w11))))) +::day_15::main::46 { + enum(w0 x(x(w5 w20) x(w3 dup228(w14 @add(1 w11))))) ::std::array::Array::to_list = fn(w0 w7) - ::day_15::main::50 = x(x(w5 w16) x(w14 x(w7 0))) - ::day_15::main::45 = x(x(w16 w20) x(w3 w11)) + ::day_15::main::48 = x(x(w5 w16) x(w14 x(w7 0))) + ::day_15::main::43 = x(x(w16 w20) x(w3 w11)) } -::day_15::main::49 { x(x(w3 w3) _) } +::day_15::main::47 { x(x(w3 w3) _) } -::day_15::main::50 { +::day_15::main::48 { x(w9 x(w7 x(w6 w5))) - ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::53 enum(::day_15::main::54 x(w9 x(w7 x(w1 w5)))))) + ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::51 enum(::day_15::main::52 x(w9 x(w7 x(w1 w5)))))) } -::day_15::main::53 { - enum(@eq(79 ?(::day_15::main::57 ::day_15::main::56 x(x(w6 w16) x(w14 x(w13 _))))) x(x(w6 w21) x(dup249(w14 w19) x(w3 dup251(w13 @add(1 w9)))))) - ::day_15::main::50 = x(x(w16 w21) x(w19 x(w3 w9))) +::day_15::main::51 { + enum(@eq(79 ?(::day_15::main::55 ::day_15::main::54 x(x(w6 w16) x(w14 x(w13 _))))) x(x(w6 w21) x(dup245(w14 w19) x(w3 dup247(w13 @add(1 w9)))))) + ::day_15::main::48 = x(x(w16 w21) x(w19 x(w3 w9))) } -::day_15::main::54 { x(x(w4 w4) _) } +::day_15::main::52 { x(x(w4 w4) _) } -::day_15::main::56 { x(x(@add(w3 w5) w5) x(@mul(100 @add(w7 w3)) x(w7 _))) } +::day_15::main::54 { x(x(@add(w3 w5) w5) x(@mul(100 @add(w7 w3)) x(w7 _))) } -::day_15::main::57 { x(x(w4 w4) _) } +::day_15::main::55 { x(x(w4 w4) _) } -::day_15::main::59 { +::day_15::main::57 { x(w7 w5) - ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_15::main::62 enum(::day_15::main::63 x(w7 w1)))) + ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_15::main::60 enum(::day_15::main::61 x(w7 w1)))) } -::day_15::main::62 { - enum(dup273(@eq(79 ?(::day_15::main::66 ::day_15::main::65 x(x(w4 w11) x(w9 _)))) w9) x(x(w4 w14) w2)) - ::day_15::main::59 = x(x(w11 w14) w2) +::day_15::main::60 { + enum(dup268(@eq(79 ?(::day_15::main::64 ::day_15::main::63 x(x(w4 w11) x(w9 _)))) w9) x(x(w4 w14) w2)) + ::day_15::main::57 = x(x(w11 w14) w2) } -::day_15::main::63 { x(x(w2 w2) _) } +::day_15::main::61 { x(x(w2 w2) _) } -::day_15::main::65 { +::day_15::main::63 { x(x(w6 w2) _) ::std::list::List::concat = fn(w6 fn(tup(2 tup(tup(91 tup(93 w7)) w7)) w2)) } -::day_15::main::66 { - x(x(w8 w4) x(dup282(w0 w1) _)) +::day_15::main::64 { + x(x(w8 w4) x(dup277(w0 w1) _)) ::std::list::List::concat = fn(w8 fn(tup(2 tup(tup(w0 tup(w1 w9)) w9)) w4)) } -::day_15::main::67 { +::day_15::main::65 { x(w8 x(w6 w5)) - ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::70 enum(::day_15::main::71 x(w8 x(w1 w5))))) + ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::68 enum(::day_15::main::69 x(w8 x(w1 w5))))) } -::day_15::main::70 { - enum(dup296(@eq(60 ?(::day_15::main::74 ::day_15::main::77 x(x(w5 w14) x(x(w2 w12) x(w10 _))))) w10) x(x(w5 w18) x(w3 w2))) - ::day_15::main::67 = x(x(w14 w18) x(w3 w12)) +::day_15::main::68 { + enum(dup291(@eq(60 ?(::day_15::main::72 ::day_15::main::75 x(x(w5 w14) x(x(w2 w12) x(w10 _))))) w10) x(x(w5 w18) x(w3 w2))) + ::day_15::main::65 = x(x(w14 w18) x(w3 w12)) } -::day_15::main::71 { x(x(w3 w3) _) } +::day_15::main::69 { x(x(w3 w3) _) } -::day_15::main::74 { x(w7 x(w5 x(dup310(@eq(62 ?(::day_15::main::76 ::day_15::main::77 x(w7 x(w5 x(w9 w8))))) w9) w8))) } +::day_15::main::72 { x(w7 x(w5 x(dup305(@eq(62 ?(::day_15::main::74 ::day_15::main::75 x(w7 x(w5 x(w9 w8))))) w9) w8))) } -::day_15::main::76 { - x(w19 x(x(dup321(tup(w3 w4) w27) w28) x(@eq(94 ?(1 ::day_15::main::95 dup323(w26 w33))) _))) - ::day_15::main::100 = x(w19 x(w33 x(tup(1 tup(tup(tup(w3 46) w23) w23)) x(w4 x(?(::day_15::main::99 ::day_15::main::98 x(x(w27 w28) x(w26 _))) 1))))) +::day_15::main::74 { + x(w19 x(x(dup316(tup(w3 w4) w27) w28) x(@eq(94 ?(1 ::day_15::main::93 dup318(w26 w33))) _))) + ::day_15::main::98 = x(w19 x(w33 x(tup(1 tup(tup(tup(w3 46) w23) w23)) x(w4 x(?(::day_15::main::97 ::day_15::main::96 x(x(w27 w28) x(w26 _))) 1))))) } -::day_15::main::77 { - x(w13 x(x(dup336(w3 w20) w21) x(@eq(60 ?(::day_15::main::80 ::day_15::main::79 dup338(w19 w26))) w22))) - ::day_15::main::84 = x(w13 x(w26 x(?(::day_15::main::83 ::day_15::main::82 x(x(w20 w21) x(w19 _))) x(w3 x(46 w22))))) +::day_15::main::75 { + x(w13 x(x(dup331(w3 w20) w21) x(@eq(60 ?(::day_15::main::78 ::day_15::main::77 dup333(w19 w26))) w22))) + ::day_15::main::82 = x(w13 x(w26 x(?(::day_15::main::81 ::day_15::main::80 x(x(w20 w21) x(w19 _))) x(w3 x(46 w22))))) } -::day_15::main::79 { +::day_15::main::77 { tup(w0 0) 1 = @sub$(0 w0) } -::day_15::main::80 { tup(1 0) } +::day_15::main::78 { tup(1 0) } -::day_15::main::82 { x(x(@add(w4 w2) w2) x(w4 _)) } +::day_15::main::80 { x(x(@add(w4 w2) w2) x(w4 _)) } -::day_15::main::83 { x(x(w3 w3) _) } +::day_15::main::81 { x(x(w3 w3) _) } -::day_15::main::84 { - x(x(w22 w36) x(dup357(w0 w34) x(w19 x(@add(w0 dup360(w4 w32)) x(w17 w28))))) - ::day_15::main::18 = x(x(w22 w25) fn(w4 ref(dup363(@eq(35 ?(::day_15::main::87 ::day_15::main::86 x(x(w25 w36) x(w34 x(w19 x(w32 x(w17 x(x(w29 w30) w28)))))))) w29) w30))) +::day_15::main::82 { + x(x(w22 w36) x(dup351(w0 w34) x(w19 x(@add(w0 dup354(w4 w32)) x(w17 w28))))) + ::day_15::main::18 = x(x(w22 w25) fn(w4 ref(dup357(@eq(35 ?(::day_15::main::85 ::day_15::main::84 x(x(w25 w36) x(w34 x(w19 x(w32 x(w17 x(x(w29 w30) w28)))))))) w29) w30))) } -::day_15::main::86 { x(x(w9 w9) x(_ x(0 x(_ x(_ x(x(w3 w3) _)))))) } +::day_15::main::84 { x(x(w9 w9) x(_ x(0 x(_ x(_ x(x(w3 w3) _)))))) } -::day_15::main::87 { x(w8 x(w6 x(w5 x(w4 x(w3 x(x(dup377(@eq(46 ?(::day_15::main::90 ::day_15::main::89 x(w8 x(w6 x(w5 x(w4 x(w3 x(x(w28 w29) w27)))))))) w28) w29) w27)))))) } +::day_15::main::85 { x(w8 x(w6 x(w5 x(w4 x(w3 x(x(dup371(@eq(46 ?(::day_15::main::88 ::day_15::main::87 x(w8 x(w6 x(w5 x(w4 x(w3 x(x(w28 w29) w27)))))))) w28) w29) w27)))))) } -::day_15::main::89 { x(x(w11 w11) x(_ x(1 x(_ x(w6 x(x(_ w6) _)))))) } +::day_15::main::87 { x(x(w11 w11) x(_ x(1 x(_ x(w6 x(x(_ w6) _)))))) } -::day_15::main::90 { - x(w8 x(w6 x(w5 x(w4 x(w3 x(x(dup393(w20 w27) w28) w30)))))) - ::day_15::main::84 = x(w8 x(w6 x(dup388(w5 ?(::day_15::main::93 ::day_15::main::92 x(w3 x(x(w27 w28) _)))) x(w4 x(w20 w30))))) +::day_15::main::88 { + x(w8 x(w6 x(w5 x(w4 x(w3 x(x(dup386(w20 w27) w28) w30)))))) + ::day_15::main::82 = x(w8 x(w6 x(dup381(w5 ?(::day_15::main::91 ::day_15::main::90 x(w3 x(x(w27 w28) _)))) x(w4 x(w20 w30))))) } -::day_15::main::92 { x(w5 x(x(_ w5) _)) } +::day_15::main::90 { x(w5 x(x(_ w5) _)) } -::day_15::main::93 { x(_ x(x(w2 w2) _)) } +::day_15::main::91 { x(_ x(x(w2 w2) _)) } -::day_15::main::95 { +::day_15::main::93 { w0 1 = @sub$(0 w0) } -::day_15::main::98 { x(x(@add(tup(0 w5) w3) w3) x(w5 _)) } +::day_15::main::96 { x(x(@add(tup(0 w5) w3) w3) x(w5 _)) } -::day_15::main::99 { x(x(w3 w3) _) } +::day_15::main::97 { x(x(w3 w3) _) } -::day_15::main::100 { +::day_15::main::98 { x(w10 x(w8 x(w7 w6))) - ::std::list::List::len = fn(ref(w7 w1) ?(::day_15::main::102 ::day_15::main::101 x(w10 x(w8 x(w1 w6))))) + ::std::list::List::len = fn(ref(w7 w1) ?(::day_15::main::100 ::day_15::main::99 x(w10 x(w8 x(w1 w6))))) } -::day_15::main::101 { - x(x(w13 w29) x(dup422(w0 w27) x(w10 x(@add(w0 dup426(w19 w25)) x(w8 w24))))) - ::day_15::main::103 = x(x(w13 w22) x(w10 x(w19 x(x(w8 w18) x(tup(0 tup(w14 w14)) w16))))) - ::day_15::main::100 = x(x(w22 w29) x(w27 x(w16 x(w25 x(w18 w24))))) +::day_15::main::99 { + x(x(w13 w29) x(dup412(w0 w27) x(w10 x(@add(w0 dup416(w19 w25)) x(w8 w24))))) + ::day_15::main::101 = x(x(w13 w22) x(w10 x(w19 x(x(w8 w18) x(tup(0 tup(w14 w14)) w16))))) + ::day_15::main::98 = x(x(w22 w29) x(w27 x(w16 x(w25 x(w18 w24))))) } -::day_15::main::102 { x(x(w6 w6) x(_ x(_ x(_ x(w1 w1))))) } +::day_15::main::100 { x(x(w6 w6) x(_ x(_ x(_ x(w1 w1))))) } -::day_15::main::103 { +::day_15::main::101 { x(w12 x(w10 w9)) - ::std::list::List::pop_front = fn(ref(w10 w1) enum(::day_15::main::106 enum(::day_15::main::107 x(w12 x(w1 w9))))) + ::std::list::List::pop_front = fn(ref(w10 w1) enum(::day_15::main::104 enum(::day_15::main::105 x(w12 x(w1 w9))))) } -::day_15::main::106 { - enum(tup(dup453(w15 w33) w3) x(x(w13 w41) x(w11 x(dup448(w16 w38) x(w9 w7))))) - ::day_15::main::18 = x(x(w13 w27) fn(tup(w15 w16) ref(dup456(@eq(35 ?(::day_15::main::110 ::day_15::main::109 x(x(w27 w41) x(w11 x(w38 x(w9 x(w7 x(w33 x(w3 x(w30 w31)))))))))) w30) w31))) +::day_15::main::104 { + enum(tup(dup443(w15 w33) w3) x(x(w13 w41) x(w11 x(dup438(w16 w38) x(w9 w7))))) + ::day_15::main::18 = x(x(w13 w27) fn(tup(w15 w16) ref(dup446(@eq(35 ?(::day_15::main::108 ::day_15::main::107 x(x(w27 w41) x(w11 x(w38 x(w9 x(w7 x(w33 x(w3 x(w30 w31)))))))))) w30) w31))) } -::day_15::main::107 { x(x(w7 w7) x(_ x(_ x(x(w3 w3) x(w1 w1))))) } +::day_15::main::105 { x(x(w7 w7) x(_ x(_ x(x(w3 w3) x(w1 w1))))) } -::day_15::main::109 { x(x(w14 w14) x(_ x(_ x(x(0 _) x(x(_ tup(0 tup(w15 w15))) x(_ x(_ x(w4 w4)))))))) } +::day_15::main::107 { x(x(w14 w14) x(_ x(_ x(x(0 _) x(x(_ tup(0 tup(w15 w15))) x(_ x(_ x(w4 w4)))))))) } -::day_15::main::110 { - x(x(w11 w48) x(w9 x(dup473(w31 w45) x(x(w7 w44) x(x(w5 w42) x(w3 x(w2 x(dup482(@eq(91 ?(::day_15::main::113 ::day_15::main::112 x(x(w11 w35) x(x(w9 w33) x(w31 x(w30 x(x(w5 w29) x(w3 x(w26 _))))))))) dup482(w26 w38)) w39)))))))) - ::day_15::main::103 = x(x(w35 w48) x(w33 x(w45 x(x(dup475(w7 dup475(w30 ?(::day_15::main::134 ::day_15::main::133 x(w2 x(x(w38 w39) _))))) w44) x(w29 w42))))) +::day_15::main::108 { + x(x(w11 w48) x(w9 x(dup463(w31 w45) x(x(w7 w44) x(x(w5 w42) x(w3 x(w2 x(dup472(@eq(91 ?(::day_15::main::111 ::day_15::main::110 x(x(w11 w35) x(x(w9 w33) x(w31 x(w30 x(x(w5 w29) x(w3 x(w26 _))))))))) dup472(w26 w38)) w39)))))))) + ::day_15::main::101 = x(x(w35 w48) x(w33 x(w45 x(x(dup465(w7 dup465(w30 ?(::day_15::main::131 ::day_15::main::130 x(w2 x(x(w38 w39) _))))) w44) x(w29 w42))))) } -::day_15::main::112 { - x(w35 x(x(w33 w45) x(w31 x(?(::day_15::main::125 ::day_15::main::124 x(w42 x(x(w22 w52) w50))) x(x(w29 w7) x(dup496(w3 dup496(@add(1 w10) dup496(w43 @add(1 w17)))) x(_ w50))))))) +::day_15::main::110 { + x(w35 x(x(w33 w45) x(w31 x(?(::day_15::main::123 ::day_15::main::122 x(w42 x(x(w22 w52) w50))) x(x(w29 w7) x(dup485(w3 dup485(@add(1 w10) dup485(w43 @add(1 w17)))) x(_ w50))))))) ::std::list::List::push_back = fn(ref(w29 w1) fn(tup(w3 91) _)) ::std::list::List::push_back = fn(ref(w1 w7) fn(tup(w10 93) _)) - ::std::list::List::len = fn(ref(w33 w37) ?(::day_15::main::116 ::day_15::main::115 x(x(w37 w45) x(w43 x(x(46 w42) _))))) + ::std::list::List::len = fn(ref(w33 w37) ?(::day_15::main::114 ::day_15::main::113 x(x(w37 w45) x(w43 x(x(46 w42) _))))) ::day_15::main::18 = x(w35 fn(tup(w17 w31) ref(w22 w52))) } -::day_15::main::113 { x(w11 x(x(w9 w9) x(w7 x(w18 x(w5 x(w3 x(@eq(93 ?(::day_15::main::128 ::day_15::main::127 x(w11 x(w7 x(w18 x(w5 x(w3 w14))))))) w14))))))) } +::day_15::main::111 { x(w12 x(x(w10 w10) x(w8 x(w17 x(w6 x(w4 x(@eq(93 ?(::day_15::main::125 ::day_15::main::124 x(w12 x(w8 x(w17 x(w6 x(w4 w13))))))) w13))))))) } -::day_15::main::115 { +::day_15::main::113 { x(x(w22 w32) x(@add(1 w25) x(w19 w27))) - ::std::list::List::get = fn(ref(w22 w1) fn(0 ref(tup(dup522(w13 @eq(w25 ?(::day_15::main::120 ::day_15::main::119 x(x(w1 w32) x(w19 x(w28 w27)))))) dup523(w15 w28)) tup(w13 w15)))) + ::std::list::List::get = fn(ref(w22 w1) fn(0 ref(tup(dup510(w13 @eq(w25 ?(::day_15::main::118 ::day_15::main::117 x(x(w1 w32) x(w19 x(w28 w27)))))) dup511(w15 w28)) tup(w13 w15)))) } -::day_15::main::116 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } +::day_15::main::114 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::day_15::main::119 { +::day_15::main::117 { x(x(w11 w1) x(x(_ w7) x(w7 _))) ::std::list::List::pop_front = fn(ref(w11 w1) _) } -::day_15::main::120 { x(x(w5 w5) x(x(w3 w3) x(_ _))) } +::day_15::main::118 { x(x(w5 w5) x(x(w3 w3) _)) } -::day_15::main::124 { x(w5 x(x(_ w5) _)) } +::day_15::main::122 { x(w5 x(x(_ w5) _)) } -::day_15::main::125 { x(_ x(x(w2 w2) _)) } +::day_15::main::123 { x(_ x(x(w2 w2) _)) } -::day_15::main::127 { - x(w30 x(w28 x(?(::day_15::main::131 ::day_15::main::130 x(x(w20 w37) w35)) x(x(w26 w8) x(dup556(@sub(1 w4) dup556(w10 @sub(1 w15))) w35))))) +::day_15::main::124 { + x(w30 x(w28 x(?(::day_15::main::128 ::day_15::main::127 x(x(w20 w37) w35)) x(x(w26 w8) x(dup540(@sub(1 w4) dup540(w10 @sub(1 w15))) w35))))) ::std::list::List::push_back = fn(ref(w26 w1) fn(tup(w4 91) _)) ::std::list::List::push_back = fn(ref(w1 w8) fn(tup(w10 93) _)) ::day_15::main::18 = x(w30 fn(tup(w15 w28) ref(w20 w37))) } -::day_15::main::128 { x(x(w7 w7) x(_ x(_ x(x(w3 w3) _)))) } +::day_15::main::125 { x(x(w7 w7) x(_ x(_ x(x(w3 w3) _)))) } -::day_15::main::130 { x(x(_ 46) _) } +::day_15::main::127 { x(x(_ 46) _) } -::day_15::main::131 { x(x(w2 w2) _) } +::day_15::main::128 { x(x(w2 w2) _) } -::day_15::main::133 { x(w5 x(x(_ w5) _)) } +::day_15::main::130 { x(w5 x(x(_ w5) _)) } -::day_15::main::134 { x(_ x(x(w2 w2) _)) } +::day_15::main::131 { x(_ x(x(w2 w2) _)) } -::day_15::main::135 { +::day_15::main::132 { x(w8 x(w6 w5)) - ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::138 enum(::day_15::main::139 x(w8 x(w1 w5))))) + ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::135 enum(::day_15::main::136 x(w8 x(w1 w5))))) } -::day_15::main::138 { - enum(w0 x(x(w5 w20) x(w3 dup584(w14 @add(1 w11))))) +::day_15::main::135 { + enum(w0 x(x(w5 w20) x(w3 dup565(w14 @add(1 w11))))) ::std::array::Array::to_list = fn(w0 w7) - ::day_15::main::140 = x(x(w5 w16) x(w14 x(w7 0))) - ::day_15::main::135 = x(x(w16 w20) x(w3 w11)) + ::day_15::main::137 = x(x(w5 w16) x(w14 x(w7 0))) + ::day_15::main::132 = x(x(w16 w20) x(w3 w11)) } -::day_15::main::139 { x(x(w3 w3) _) } +::day_15::main::136 { x(x(w3 w3) _) } -::day_15::main::140 { +::day_15::main::137 { x(w9 x(w7 x(w6 w5))) - ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::143 enum(::day_15::main::144 x(w9 x(w7 x(w1 w5)))))) + ::std::list::List::pop_front = fn(ref(w6 w1) enum(::day_15::main::140 enum(::day_15::main::141 x(w9 x(w7 x(w1 w5)))))) } -::day_15::main::143 { - enum(@eq(91 ?(::day_15::main::147 ::day_15::main::146 x(x(w6 w16) x(w14 x(w13 _))))) x(x(w6 w21) x(dup601(w14 w19) x(w3 dup603(w13 @add(1 w9)))))) - ::day_15::main::140 = x(x(w16 w21) x(w19 x(w3 w9))) +::day_15::main::140 { + enum(@eq(91 ?(::day_15::main::144 ::day_15::main::143 x(x(w6 w16) x(w14 x(w13 _))))) x(x(w6 w21) x(dup582(w14 w19) x(w3 dup584(w13 @add(1 w9)))))) + ::day_15::main::137 = x(x(w16 w21) x(w19 x(w3 w9))) } -::day_15::main::144 { x(x(w4 w4) _) } +::day_15::main::141 { x(x(w4 w4) _) } -::day_15::main::146 { x(x(@add(w3 w5) w5) x(@mul(100 @add(w7 w3)) x(w7 _))) } +::day_15::main::143 { x(x(@add(w3 w5) w5) x(@mul(100 @add(w7 w3)) x(w7 _))) } -::day_15::main::147 { x(x(w4 w4) _) } +::day_15::main::144 { x(x(w4 w4) _) } ::std::array::Array::empty { tup(0 _) } @@ -390,10 +384,10 @@ ::std::array::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::array::Array::from_fn { fn(dup648(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup649(w3 w13) w3) fn(w6 w11))) } +::std::array::Array::from_fn { fn(dup628(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup629(w3 w13) w3) fn(w6 w11))) } ::std::array::Array::from_fn::3 { - x(dup655(w1 dup655(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup635(w1 dup635(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::array::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::option::Option::unwrap = fn(w16 _) @@ -402,10 +396,10 @@ ::std::array::Array::from_fn::4 { x(_ x(_ x(_ ::std::array::Array::empty))) } -::std::array::Array::fold_back { fn(tup(dup704(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::array::Array::fold_back { fn(tup(dup684(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::array::Array::fold_back::3 { - x(dup712(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup692(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::array::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::option::Option::unwrap = fn(w13 w14) @@ -414,25 +408,25 @@ ::std::array::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::array::Array::len { fn(ref(tup(dup725(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup705(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup731(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup711(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup742(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup722(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup746(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup726(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_back { fn(ref(tup(dup752(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup752(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_back { fn(ref(tup(dup732(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup732(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -445,17 +439,17 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_back::5 { x(w4 dup773(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } +::std::array::Array::push_back::5 { x(w4 dup753(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } ::std::array::Array::push_back::6 { - x(x(w10 w13) dup777(w1 @rem(2 w3))) + x(x(w10 w13) dup757(w1 @rem(2 w3))) ::std::array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::array::Array::push_back::5 = x(x(w5 w13) w6) } ::std::array::Array::push_back::7 { x(x(w2 w2) _) } -::std::array::Array::push_front { fn(ref(tup(dup781(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup781(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_front { fn(ref(tup(dup761(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup761(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -468,7 +462,7 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_front::5 { x(w4 dup802(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } +::std::array::Array::push_front::5 { x(w4 dup782(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } ::std::array::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -478,88 +472,88 @@ ::std::array::Array::push_front::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup815(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup795(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup821(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup801(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup833(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup812(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup839(@sub(1 @rem(2 dup841(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup840(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup818(@sub(1 @rem(2 dup820(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup819(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } -::std::array::Array::pop_front { fn(ref(tup(dup867(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup845(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup873(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup851(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup885(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup862(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup892(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup869(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -573,7 +567,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::zip_with { fn(dup1004(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::array::Node::zip_with { fn(dup977(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -583,12 +577,12 @@ } ::std::array::Node::zip_with::4 { - x(dup1016(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1019(w13 w19) tup(w14 w20))))) + x(dup989(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup992(w13 w19) tup(w14 w20))))) ::std::array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } -::std::array::Node::unzip_with { fn(dup1025(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup998(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -598,7 +592,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup1037(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1039(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup1010(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1012(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -614,7 +608,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup1084(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup1056(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -628,11 +622,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup1129(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup1101(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup1136(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup1108(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -647,7 +641,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup1153(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup1125(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -660,14 +654,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup1190(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup1162(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup1224(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup1196(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -677,20 +671,20 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } ::std::list::List::map { - fn(tup(dup1257(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup1229(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup1268(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup1240(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup1277(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup1249(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup1287(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup1259(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -725,7 +719,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup1370(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup1342(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -733,9 +727,9 @@ ::std::list::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::list::List::iter { fn(ref(tup(dup1447(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1419(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1454(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1426(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -748,7 +742,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1483(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1455(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -757,7 +751,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2777(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2736(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -766,10 +760,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2787(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2746(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2790(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2749(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/aoc_2024/day_15/stats.txt b/tests/snaps/vine/aoc_2024/day_15/stats.txt index bf0d075f..7cf234d5 100644 --- a/tests/snaps/vine/aoc_2024/day_15/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_15/stats.txt @@ -1,10 +1,10 @@ Interactions - Total 1_271_661 + Total 1_271_660 Annihilate 680_656 Commute 11_203 Copy 104_600 - Erase 102_488 + Erase 102_487 Expand 164_907 Call 138_372 Branch 69_435 diff --git a/tests/snaps/vine/aoc_2024/day_16/compiled.iv b/tests/snaps/vine/aoc_2024/day_16/compiled.iv index bd2e0110..13f6e083 100644 --- a/tests/snaps/vine/aoc_2024/day_16/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_16/compiled.iv @@ -7,8 +7,8 @@ ::std::array::Array::from_list = fn(w51 w12) ::std::map::Map::new = fn(::std::n32::N32::cmp w14) ::std::map::Map::insert = fn(ref(w14 w17) fn(0 fn(tup(1 tup(tup(tup(w49 0) w54) w54)) _))) - ::day_16::main::28 = x(w47 x(x(w12 w62) x(w17 x(x(0 w59) x(x(0 w57) 0))))) - ::std::array::Array::to_list = fn(w62 ::day_16::main::59) + ::day_16::main::27 = x(w47 x(x(w12 w62) x(w17 x(x(0 w59) x(x(0 w57) 0))))) + ::std::array::Array::to_list = fn(w62 ::day_16::main::58) ::std::n32::N32::to_string = fn(w59 w34) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w65)))))))) w65)) fn(w34 w35)) ::std::io::IO::println = fn(ref(w53 w30) fn(w35 _)) @@ -55,134 +55,128 @@ ::std::list::List::len = fn(ref(w19 w5) w7) } -::day_16::main::14 { x(w10 x(x(w8 w8) x(w6 x(w4 x(@eq(69 ?(::day_16::main::17 ::day_16::main::16 x(w10 x(w6 x(w4 w13))))) w13))))) } +::day_16::main::14 { x(w11 x(x(w9 w9) x(w7 x(w5 x(@eq(69 ?(::day_16::main::16 ::day_16::main::15 x(w11 x(w7 x(w5 w12))))) w12))))) } -::day_16::main::16 { +::day_16::main::15 { x(x(w16 w5) x(x(_ tup(w3 w7)) x(x(w12 w1) _))) ::std::list::List::len = fn(ref(w12 w1) w3) ::std::list::List::len = fn(ref(w16 w5) w7) } -::day_16::main::17 { x(x(w6 w6) x(x(w4 w4) x(x(w2 w2) _))) } +::day_16::main::16 { x(x(w6 w6) x(x(w4 w4) x(x(w2 w2) _))) } -::day_16::main::18 { - x(x(w32 w10) x(w30 fn(w0 fn(dup118(tup(w6 w7) w38) fn(w2 w34))))) +::day_16::main::17 { + x(x(w32 w10) x(w30 fn(w0 fn(dup116(tup(w6 w7) w38) fn(w2 w34))))) ::std::array::Array::get = fn(ref(w32 w10) fn(w7 w14)) - ::std::array::Array::get = fn(w14 fn(w6 ref(tup(dup122(w19 ?(::day_16::main::21 ::day_16::main::20 x(w30 x(w0 x(w38 x(w2 x(x(w22 w36) w34))))))) tup(w22 w23)) tup(w19 tup(w36 w23))))) + ::std::array::Array::get = fn(w14 fn(w6 ref(tup(dup120(w19 ?(::day_16::main::20 ::day_16::main::19 x(w30 x(w0 x(w38 x(w2 x(x(w22 w36) w34))))))) tup(w22 w23)) tup(w19 tup(w36 w23))))) } -::day_16::main::20 { - x(w21 x(dup130(@lt(w23 ?(::day_16::main::24 ::day_16::main::23 x(w21 x(w32 x(w18 x(w30 x(x(w28 dup135(w5 w36)) x(x(w8 w27) _)))))))) dup130(w32 @eq(w36 ?(::day_16::main::27 ::day_16::main::26 x(w39 w38))))) x(w18 x(dup132(w3 w30) x(x(w16 w1) w38))))) - ::std::list::List::get = fn(ref(w16 w1) fn(w3 ref(tup(dup136(w23 w28) w8) tup(w5 dup137(w27 w39))))) +::day_16::main::19 { + x(w21 x(dup128(@lt(w23 ?(::day_16::main::23 ::day_16::main::22 x(w21 x(w32 x(w18 x(w30 x(x(w28 dup133(w5 w36)) x(x(w8 w27) _)))))))) dup128(w32 @eq(w36 ?(::day_16::main::26 ::day_16::main::25 x(w39 w38))))) x(w18 x(dup130(w3 w30) x(x(w16 w1) w38))))) + ::std::list::List::get = fn(ref(w16 w1) fn(w3 ref(tup(dup134(w23 w28) w8) tup(w5 dup135(w27 w39))))) } -::day_16::main::21 { x(x(w7 w7) x(_ x(_ x(_ x(x(w2 w2) 0))))) } +::day_16::main::20 { x(x(w7 w7) x(_ x(_ x(_ x(x(w2 w2) 0))))) } -::day_16::main::23 { - x(x(w25 w4) x(dup147(w1 w6) x(w22 x(w21 x(x(_ w1) x(x(0 _) w15)))))) +::day_16::main::22 { + x(x(w25 w4) x(dup145(w1 w6) x(w22 x(w21 x(x(_ w1) x(x(0 _) w15)))))) ::std::map::Map::get_or_insert = fn(ref(w25 w4) fn(w6 fn(tup(0 tup(w26 w26)) w9))) ::std::list::List::push_back = fn(w9 fn(tup(w22 w21) w15)) } -::day_16::main::24 { x(x(w9 w9) x(_ x(_ x(_ x(x(w4 w4) x(x(w2 w2) _)))))) } +::day_16::main::23 { x(x(w9 w9) x(_ x(_ x(_ x(x(w4 w4) x(x(w2 w2) _)))))) } -::day_16::main::26 { x(w0 w0) } +::day_16::main::25 { x(w0 w0) } -::day_16::main::27 { x(_ 0) } +::day_16::main::26 { x(_ 0) } -::day_16::main::28 { x(w9 x(w8 x(w6 x(w5 x(w3 dup168(?(::day_16::main::30 ::day_16::main::29 x(w9 x(w8 x(w6 x(w5 x(w3 w10)))))) w10)))))) } +::day_16::main::27 { x(w9 x(w8 x(w6 x(w5 x(w3 dup165(?(::day_16::main::29 ::day_16::main::28 x(w9 x(w8 x(w6 x(w5 x(w3 w10)))))) w10)))))) } -::day_16::main::29 { - x(_ x(x(w7 w7) x(_ x(x(w4 w4) x(x(w2 w2) _))))) - _ = _ -} +::day_16::main::28 { x(_ x(x(w7 w7) x(_ x(x(w4 w4) x(x(w2 w2) _))))) } -::day_16::main::30 { +::day_16::main::29 { x(w13 x(w12 x(w10 w9))) - ::std::map::Map::remove_min = fn(ref(w10 w1) enum(::day_16::main::33 enum(::day_16::main::34 x(w13 x(w12 x(w1 w9)))))) + ::std::map::Map::remove_min = fn(ref(w10 w1) enum(::day_16::main::32 enum(::day_16::main::33 x(w13 x(w12 x(w1 w9)))))) } -::day_16::main::33 { - enum(tup(w2 w3) x(dup183(w27 w36) x(x(w13 w35) x(w11 x(x(w10 w32) x(x(w8 w30) w6)))))) - ::day_16::main::36 = x(w27 x(x(w13 w26) x(x(w11 w24) x(x(w10 w22) x(x(w8 w20) x(x(w6 w18) x(w2 w3))))))) - ::day_16::main::28 = x(w36 x(x(w26 w35) x(w24 x(x(w22 w32) x(x(w20 w30) w18))))) +::day_16::main::32 { + enum(tup(w2 w3) x(dup180(w27 w36) x(x(w13 w35) x(w11 x(x(w10 w32) x(x(w8 w30) w6)))))) + ::day_16::main::35 = x(w27 x(x(w13 w26) x(x(w11 w24) x(x(w10 w22) x(x(w8 w20) x(x(w6 w18) x(w2 w3))))))) + ::day_16::main::27 = x(w36 x(x(w26 w35) x(w24 x(x(w22 w32) x(x(w20 w30) w18))))) } -::day_16::main::34 { - x(_ x(x(w7 w7) x(_ x(x(w4 w4) x(x(w2 w2) _))))) - _ = _ -} +::day_16::main::33 { x(_ x(x(w7 w7) x(_ x(x(w4 w4) x(x(w2 w2) _))))) } -::day_16::main::36 { +::day_16::main::35 { x(w17 x(w16 x(w14 x(w12 x(w10 x(w8 x(w6 w5))))))) - ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::39 enum(::day_16::main::40 x(w17 x(w16 x(w14 x(w12 x(w10 x(w8 x(w6 w1)))))))))) + ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::38 enum(::day_16::main::39 x(w17 x(w16 x(w14 x(w12 x(w10 x(w8 x(w6 w1)))))))))) } -::day_16::main::39 { - enum(tup(dup239(tup(dup241(w31 w65) dup242(w26 w64)) w67) dup240(w44 w66)) x(dup220(w79 w92) x(x(w17 w91) x(x(w15 w89) x(x(w13 w87) x(x(w11 w85) x(x(w9 w83) x(dup237(@le(w55 ?(::day_16::main::43 ::day_16::main::42 x(w79 x(x(w24 w78) x(x(w15 w76) x(x(w13 w74) x(x(w11 w72) x(x(w9 w70) x(w68 x(w67 x(w66 x(w65 x(w64 x(x(w37 w63) x(x(w60 w61) x(x(w49 w59) _)))))))))))))))) dup237(w68 w81)) w6)))))))) +::day_16::main::38 { + enum(tup(dup236(tup(dup238(w31 w65) dup239(w26 w64)) w67) dup237(w44 w66)) x(dup217(w79 w92) x(x(w17 w91) x(x(w15 w89) x(x(w13 w87) x(x(w11 w85) x(x(w9 w83) x(dup234(@le(w55 ?(::day_16::main::42 ::day_16::main::41 x(w79 x(x(w24 w78) x(x(w15 w76) x(x(w13 w74) x(x(w11 w72) x(x(w9 w70) x(w68 x(w67 x(w66 x(w65 x(w64 x(x(w37 w63) x(x(w60 w61) x(x(w49 w59) _)))))))))))))))) dup234(w68 w81)) w6)))))))) ::std::array::Array::get = fn(ref(w17 w24) fn(w26 w28)) ::std::array::Array::get = fn(w28 fn(w31 ref(tup(w33 tup(w35 w37)) tup(w33 tup(w42 w63))))) - ::std::list::List::get = fn(ref(w35 w42) fn(w44 ref(tup(dup248(w55 w60) w59) tup(w61 w49)))) - ::day_16::main::36 = x(w92 x(x(w78 w91) x(x(w76 w89) x(x(w74 w87) x(x(w72 w85) x(x(w70 w83) x(w81 w6))))))) + ::std::list::List::get = fn(ref(w35 w42) fn(w44 ref(tup(dup245(w55 w60) w59) tup(w61 w49)))) + ::day_16::main::35 = x(w92 x(x(w78 w91) x(x(w76 w89) x(x(w74 w87) x(x(w72 w85) x(x(w70 w83) x(w81 w6))))))) } -::day_16::main::40 { x(_ x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) _)))))) } +::day_16::main::39 { x(_ x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) _)))))) } -::day_16::main::42 { x(tup(w3 w4) x(w30 x(w28 x(w26 x(w24 x(x(w22 w21) x(dup271(w0 dup271(w40 w51)) x(w19 x(w18 x(@eq(w3 ?(::day_16::main::46 ::day_16::main::45 x(w26 x(x(w22 dup269(w21 ?(::day_16::main::52 ::day_16::main::51 x(w30 x(w28 x(w51 x(w19 x(w18 x(x(w38 dup279(w10 ?(::day_16::main::55 ::day_16::main::54 x(w24 x(w15 w57))))) _))))))))) x(w40 x(w16 x(x(w11 w38) x(w4 _)))))))) x(w16 x(w15 x(x(_ w0) x(x(w11 w10) w57)))))))))))))) } +::day_16::main::41 { x(tup(w3 w4) x(w30 x(w28 x(w26 x(w24 x(x(w22 w21) x(dup268(w0 dup268(w40 w51)) x(w19 x(w18 x(@eq(w3 ?(::day_16::main::45 ::day_16::main::44 x(w26 x(x(w22 dup266(w21 ?(::day_16::main::51 ::day_16::main::50 x(w30 x(w28 x(w51 x(w19 x(w18 x(x(w38 dup276(w10 ?(::day_16::main::54 ::day_16::main::53 x(w24 x(w15 w57))))) _))))))))) x(w40 x(w16 x(x(w11 w38) x(w4 _)))))))) x(w16 x(w15 x(x(_ w0) x(x(w11 w10) w57)))))))))))))) } -::day_16::main::43 { x(_ x(x(w21 w21) x(x(w19 w19) x(x(w17 w17) x(x(w15 w15) x(x(w13 w13) x(_ x(_ x(_ x(_ x(_ x(x(w6 w6) x(x(w4 w4) x(x(w2 w2) _)))))))))))))) } +::day_16::main::42 { x(_ x(x(w21 w21) x(x(w19 w19) x(x(w17 w17) x(x(w15 w15) x(x(w13 w13) x(_ x(_ x(_ x(_ x(_ x(x(w6 w6) x(x(w4 w4) x(x(w2 w2) _)))))))))))))) } -::day_16::main::45 { x(w12 x(w10 x(w8 x(@eq(w4 ?(::day_16::main::48 ::day_16::main::47 x(w12 x(w10 x(w8 x(w6 w13)))))) x(w6 x(w4 w13)))))) } +::day_16::main::44 { x(w12 x(w10 x(w8 x(@eq(w4 ?(::day_16::main::47 ::day_16::main::46 x(w12 x(w10 x(w8 x(w6 w13)))))) x(w6 x(w4 w13)))))) } -::day_16::main::46 { x(x(w9 w9) x(x(w7 w7) x(_ x(_ x(x(w3 w3) x(_ _)))))) } +::day_16::main::45 { x(x(w9 w9) x(x(w7 w7) x(_ x(_ x(x(w3 w3) _))))) } -::day_16::main::47 { x(x(_ w7) x(x(_ 1) x(w7 x(x(_ 1) _)))) } +::day_16::main::46 { x(x(_ w7) x(x(_ 1) x(w7 x(x(_ 1) _)))) } -::day_16::main::48 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) _)))) } +::day_16::main::47 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) _)))) } -::day_16::main::51 { x(x(w9 w9) x(x(w7 w7) x(_ x(_ x(_ x(x(w2 w2) _)))))) } +::day_16::main::50 { x(x(w9 w9) x(x(w7 w7) x(_ x(_ x(_ x(x(w2 w2) _)))))) } -::day_16::main::52 { - x(x(w44 w59) x(x(w42 w57) x(dup333(@add(1 w10) dup333(@add(1000 w21) @add(1000 w29))) x(dup334(@add(w13 w14) dup334(w22 w30)) x(dup335(@add(3 @rem(4 w2)) dup335(@add(1 @rem(4 w6)) dup335(w12 w15))) x(x(@n32_or(w16 @n32_or(w24 @n32_or(w32 w34))) w34) _)))))) - ::day_16::main::18 = x(x(w44 w49) x(x(w42 w47) fn(w10 fn(w14 fn(w15 w16))))) +::day_16::main::51 { + x(x(w44 w59) x(x(w42 w57) x(dup325(@add(1 w10) dup325(@add(1000 w21) @add(1000 w29))) x(dup326(@add(w13 w14) dup326(w22 w30)) x(dup327(@add(3 @rem(4 w2)) dup327(@add(1 @rem(4 w6)) dup327(w12 w15))) x(x(@n32_or(w16 @n32_or(w24 @n32_or(w32 w34))) w34) _)))))) + ::day_16::main::17 = x(x(w44 w49) x(x(w42 w47) fn(w10 fn(w14 fn(w15 w16))))) ::day_16::delta = fn(w12 w13) - ::day_16::main::18 = x(x(w49 w54) x(x(w47 w52) fn(w21 fn(w22 fn(w2 w24))))) - ::day_16::main::18 = x(x(w54 w59) x(x(w52 w57) fn(w29 fn(w30 fn(w6 w32))))) + ::day_16::main::17 = x(x(w49 w54) x(x(w47 w52) fn(w21 fn(w22 fn(w2 w24))))) + ::day_16::main::17 = x(x(w54 w59) x(x(w52 w57) fn(w29 fn(w30 fn(w6 w32))))) } -::day_16::main::54 { x(w5 x(x(dup349(?(::day_16::main::57 ::day_16::main::56 x(w5 x(x(w7 w8) w6))) w7) w8) w6)) } +::day_16::main::53 { x(w5 x(x(dup341(?(::day_16::main::56 ::day_16::main::55 x(w5 x(x(w7 w8) w6))) w7) w8) w6)) } -::day_16::main::55 { x(x(w4 w4) x(x(w2 w2) _)) } +::day_16::main::54 { x(x(w4 w4) x(x(w2 w2) _)) } -::day_16::main::56 { x(x(w4 w4) x(x(w2 w2) _)) } +::day_16::main::55 { x(x(w4 w4) x(x(w2 w2) _)) } -::day_16::main::57 { x(x(@add(1 w1) w1) x(x(_ 1) _)) } +::day_16::main::56 { x(x(@add(1 w1) w1) x(x(_ 1) _)) } -::day_16::main::59 { +::day_16::main::58 { w5 - ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::62 enum(_ w1))) + ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::61 enum(_ w1))) } -::day_16::main::62 { - enum(w0 ::day_16::main::59) - ::std::array::Array::to_list = fn(w0 ::day_16::main::64) +::day_16::main::61 { + enum(w0 ::day_16::main::58) + ::std::array::Array::to_list = fn(w0 ::day_16::main::63) } -::day_16::main::64 { +::day_16::main::63 { w5 - ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::67 enum(_ w1))) + ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::66 enum(_ w1))) } -::day_16::main::67 { enum(tup(_ tup(::day_16::main::69 _)) ::day_16::main::64) } +::day_16::main::66 { enum(tup(_ tup(::day_16::main::68 _)) ::day_16::main::63) } -::day_16::main::69 { +::day_16::main::68 { w5 - ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::72 enum(_ w1))) + ::std::list::List::pop_front = fn(ref(w5 w1) enum(::day_16::main::71 enum(_ w1))) } -::day_16::main::72 { enum(tup(_ 0) ::day_16::main::69) } +::day_16::main::71 { enum(tup(_ 0) ::day_16::main::68) } -::day_16::delta { fn(dup385(@n32_and(2 ?(1 ::day_16::delta::3 w10)) @n32_and(1 ?(::day_16::delta::7 ::day_16::delta::6 x(w10 w13)))) w13) } +::day_16::delta { fn(dup374(@n32_and(2 ?(1 ::day_16::delta::3 w10)) @n32_and(1 ?(::day_16::delta::7 ::day_16::delta::6 x(w10 w13)))) w13) } ::day_16::delta::3 { w0 @@ -206,10 +200,10 @@ ::std::array::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::array::Array::from_fn { fn(dup430(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup431(w3 w13) w3) fn(w6 w11))) } +::std::array::Array::from_fn { fn(dup419(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup420(w3 w13) w3) fn(w6 w11))) } ::std::array::Array::from_fn::3 { - x(dup437(w1 dup437(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup426(w1 dup426(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::array::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::option::Option::unwrap = fn(w16 _) @@ -218,10 +212,10 @@ ::std::array::Array::from_fn::4 { x(_ x(_ x(_ ::std::array::Array::empty))) } -::std::array::Array::fold_back { fn(tup(dup486(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::array::Array::fold_back { fn(tup(dup475(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::array::Array::fold_back::3 { - x(dup494(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup483(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::array::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::option::Option::unwrap = fn(w13 w14) @@ -230,25 +224,25 @@ ::std::array::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::array::Array::len { fn(ref(tup(dup507(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup496(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup513(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup502(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup524(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup513(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup528(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup517(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_back { fn(ref(tup(dup534(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup534(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_back { fn(ref(tup(dup523(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup523(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -261,17 +255,17 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_back::5 { x(w4 dup555(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } +::std::array::Array::push_back::5 { x(w4 dup544(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } ::std::array::Array::push_back::6 { - x(x(w10 w13) dup559(w1 @rem(2 w3))) + x(x(w10 w13) dup548(w1 @rem(2 w3))) ::std::array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::array::Array::push_back::5 = x(x(w5 w13) w6) } ::std::array::Array::push_back::7 { x(x(w2 w2) _) } -::std::array::Array::push_front { fn(ref(tup(dup563(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup563(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_front { fn(ref(tup(dup552(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup552(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -284,7 +278,7 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_front::5 { x(w4 dup584(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } +::std::array::Array::push_front::5 { x(w4 dup573(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } ::std::array::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -294,88 +288,88 @@ ::std::array::Array::push_front::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup597(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup586(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup603(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup592(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup615(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup603(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup621(@sub(1 @rem(2 dup623(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup622(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup609(@sub(1 @rem(2 dup611(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup610(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } -::std::array::Array::pop_front { fn(ref(tup(dup649(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup636(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup655(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup642(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup667(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup653(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup674(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup660(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -389,7 +383,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::zip_with { fn(dup786(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::array::Node::zip_with { fn(dup768(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -399,12 +393,12 @@ } ::std::array::Node::zip_with::4 { - x(dup798(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup801(w13 w19) tup(w14 w20))))) + x(dup780(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup783(w13 w19) tup(w14 w20))))) ::std::array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } -::std::array::Node::unzip_with { fn(dup807(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup789(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -414,7 +408,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup819(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup821(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup801(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup803(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -430,7 +424,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup866(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup847(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -444,11 +438,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup911(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup892(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup918(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup899(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -463,7 +457,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup935(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup916(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -476,14 +470,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup972(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup953(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup1006(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup987(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -492,7 +486,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup1069(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup1050(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -517,18 +511,18 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } ::std::map::Map::insert { - fn(ref(tup(dup1690(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1663(w2 w16) w5) tup(w2 w14)) w9) ::std::map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::map::Map::get_or_insert { - fn(ref(tup(dup1698(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1671(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::option::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::map::Map::remove_min { - fn(ref(tup(dup1743(w2 w19) w5) tup(w2 w18)) w16) + fn(ref(tup(dup1716(w2 w19) w5) tup(w2 w18)) w16) ::std::map::Node::size = fn(ref(w5 w13) ?(::std::map::Map::remove_min::4 ::std::map::Map::remove_min::3 x(w19 x(x(w13 w18) w16)))) } @@ -542,7 +536,7 @@ ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1939(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1909(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -550,10 +544,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1952(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1922(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1967(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1937(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -639,18 +633,18 @@ } ::std::map::is_balanced { - fn(ref(tup(dup2543(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2544(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2511(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2512(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2548(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2549(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2516(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2517(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2553(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2554(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2521(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2522(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } -::std::n32::N32::to_string { fn(dup2559(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2527(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -659,10 +653,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2569(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2537(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2572(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2540(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -670,11 +664,11 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::cmp { fn(ref(dup2627(w2 dup2627(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2628(w5 dup2628(w12 w15)) w5) w14)) } +::std::n32::N32::cmp { fn(ref(dup2594(w2 dup2594(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2595(w5 dup2595(w12 w15)) w5) w14)) } ::std::n32::N32::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::n32::N32::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::n32::N32::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } ::std::option::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } diff --git a/tests/snaps/vine/aoc_2024/day_16/stats.txt b/tests/snaps/vine/aoc_2024/day_16/stats.txt index 793b68f7..3040fab1 100644 --- a/tests/snaps/vine/aoc_2024/day_16/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_16/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 1_260_469 - Annihilate 692_306 + Total 1_260_468 + Annihilate 691_870 Commute 13_230 - Copy 120_605 - Erase 112_892 + Copy 121_041 + Erase 112_891 Expand 148_157 Call 111_948 Branch 61_331 Memory Heap 324_368 B - Allocated 27_375_952 B - Freed 27_375_952 B + Allocated 27_368_976 B + Freed 27_368_976 B diff --git a/tests/snaps/vine/aoc_2024/day_17/compiled.iv b/tests/snaps/vine/aoc_2024/day_17/compiled.iv index fa041f48..e3a27c2c 100644 --- a/tests/snaps/vine/aoc_2024/day_17/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_17/compiled.iv @@ -41,88 +41,82 @@ ::day_17::main::5 { x(w8 x(w7 x(w6 x(w5 x(w4 x(w2 dup50(?(::day_17::main::8 ::day_17::main::7 x(w8 x(w7 x(w6 x(w5 x(w4 x(w2 w9))))))) w9))))))) } -::day_17::main::6 { - x(_ x(_ x(_ x(_ x(x(w3 w3) _))))) - _ = _ -} +::day_17::main::6 { x(_ x(_ x(_ x(_ x(x(w3 w3) _))))) } ::day_17::main::7 { x(w31 x(w30 x(w29 x(w28 x(x(w27 w49) x(dup66(w5 dup66(@add(1 w15) w36)) @sub(1 w1))))))) - ::std::array::Array::get = fn(ref(w28 w3) fn(w5 ref(dup52(dup71(?(::day_17::main::22 ::day_17::main::21 x(x(w31 w45) x(x(w30 w43) x(x(w29 w41) x(x(w27 w39) x(x(w36 @add(2 w23)) x(w35 x(w19 _)))))))) w35) w8) w8))) + ::std::array::Array::get = fn(ref(w28 w3) fn(w5 ref(dup52(dup71(?(::day_17::main::20 ::day_17::main::19 x(x(w31 w45) x(x(w30 w43) x(x(w29 w41) x(x(w27 w39) x(x(w36 @add(2 w23)) x(w35 x(w19 _)))))))) w35) w8) w8))) ::std::array::Array::get = fn(ref(w3 w12) fn(w15 ref(dup53(w19 w18) w18))) ::day_17::main::4 = x(w45 x(w43 x(w41 x(w12 x(x(w39 w49) x(w23 w1)))))) } -::day_17::main::8 { - x(_ x(_ x(_ x(_ x(x(w3 w3) _))))) - _ = _ -} +::day_17::main::8 { x(_ x(_ x(_ x(_ x(x(w3 w3) _))))) } ::day_17::main::10 { x(w7 x(w6 x(w5 x(dup78(@eq(4 ?(::day_17::main::13 ::day_17::main::12 x(w7 x(w6 x(w5 x(w11 w10)))))) w11) w10)))) } ::day_17::main::12 { x(w5 x(_ x(_ x(_ w5)))) } -::day_17::main::13 { x(_ x(w4 x(w3 x(dup86(@eq(5 ?(::day_17::main::16 ::day_17::main::15 x(w4 x(w3 x(w9 w8))))) w9) w8)))) } +::day_17::main::13 { x(_ x(w5 x(w4 x(dup86(@eq(5 ?(::day_17::main::15 ::day_17::main::14 x(w5 x(w4 x(w8 w7))))) w8) w7)))) } -::day_17::main::15 { x(w4 x(_ x(_ w4))) } +::day_17::main::14 { x(w4 x(_ x(_ w4))) } -::day_17::main::16 { x(_ x(w3 x(dup92(@eq(6 ?(::day_17::main::19 ::day_17::main::18 x(w3 x(w8 w7)))) w8) w7))) } +::day_17::main::15 { x(_ x(w4 x(dup91(@eq(6 ?(::day_17::main::17 ::day_17::main::16 x(w4 x(w7 w6)))) w7) w6))) } -::day_17::main::18 { x(w3 x(_ w3)) } +::day_17::main::16 { x(w3 x(_ w3)) } -::day_17::main::19 { x(_ x(w2 w2)) } +::day_17::main::17 { x(_ x(w2 w2)) } -::day_17::main::21 { x(x(dup99(w12 w27) w12) x(w11 x(w9 x(w7 x(w5 x(dup108(@eq(1 ?(::day_17::main::25 ::day_17::main::24 x(w27 x(w11 x(w9 x(w7 x(w5 x(w18 w2)))))))) w18) w2)))))) } +::day_17::main::19 { x(x(dup97(w13 w26) w13) x(w12 x(w10 x(w8 x(w6 x(dup106(@eq(1 ?(::day_17::main::22 ::day_17::main::21 x(w26 x(w12 x(w10 x(w8 x(w6 x(w17 w3)))))))) w17) w3)))))) } -::day_17::main::22 { - x(x(dup113(w21 @n32_shr(w17 w3)) w3) x(x(dup114(w13 w20) w13) x(x(dup115(w11 w19) w11) x(x(w10 w10) x(x(w8 w8) x(_ x(w5 _))))))) +::day_17::main::20 { + x(x(dup110(w21 @n32_shr(w17 w3)) w3) x(x(dup111(w13 w20) w13) x(x(dup112(w11 w19) w11) x(x(w10 w10) x(x(w8 w8) x(_ x(w5 _))))))) ::day_17::main::10 = x(w21 x(w20 x(w19 x(w5 w17)))) } -::day_17::main::24 { x(_ x(x(@n32_xor(w4 w2) w2) x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) x(_ x(w4 _))))))) } +::day_17::main::21 { x(_ x(x(@n32_xor(w4 w2) w2) x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) x(_ x(w4 _))))))) } -::day_17::main::25 { x(w12 x(w11 x(w9 x(w7 x(w5 x(dup137(@eq(2 ?(::day_17::main::28 ::day_17::main::27 x(w12 x(w11 x(w9 x(w7 x(w5 x(w17 w2)))))))) w17) w2)))))) } +::day_17::main::22 { x(w13 x(w12 x(w10 x(w8 x(w6 x(dup134(@eq(2 ?(::day_17::main::24 ::day_17::main::23 x(w13 x(w12 x(w10 x(w8 x(w6 x(w16 w3)))))))) w16) w3)))))) } -::day_17::main::27 { - x(w15 x(x(w14 w2) x(x(dup144(w11 w18) w11) x(x(w10 w10) x(x(w8 w8) x(_ x(w5 _))))))) +::day_17::main::23 { + x(w15 x(x(w14 w2) x(x(dup140(w11 w18) w11) x(x(w10 w10) x(x(w8 w8) x(_ x(w5 _))))))) ::day_17::main::10 = x(w15 x(w14 x(w18 x(w5 @n32_and(7 w2))))) } -::day_17::main::28 { x(w12 x(w11 x(w9 x(w7 x(w5 x(dup159(@eq(3 ?(::day_17::main::31 ::day_17::main::30 x(w12 x(w11 x(w9 x(w7 x(w5 x(w17 w2)))))))) w17) w2)))))) } +::day_17::main::24 { x(w13 x(w12 x(w10 x(w8 x(w6 x(dup155(@eq(3 ?(::day_17::main::26 ::day_17::main::25 x(w13 x(w12 x(w10 x(w8 x(w6 x(w16 w3)))))))) w16) w3)))))) } -::day_17::main::30 { x(?(::day_17::main::34 ::day_17::main::33 x(w5 w2)) x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) x(w5 x(_ w2)))))) } +::day_17::main::25 { x(?(::day_17::main::29 ::day_17::main::28 x(w5 w2)) x(x(w11 w11) x(x(w9 w9) x(x(w7 w7) x(w5 x(_ w2)))))) } -::day_17::main::31 { x(w12 x(w11 x(w9 x(w7 x(x(w5 w5) x(dup180(@eq(4 ?(::day_17::main::37 ::day_17::main::36 x(w12 x(w11 x(w9 x(w7 x(w17 w2))))))) w17) w2)))))) } +::day_17::main::26 { x(w13 x(w12 x(w10 x(w8 x(x(w6 w6) x(dup175(@eq(4 ?(::day_17::main::31 ::day_17::main::30 x(w13 x(w12 x(w10 x(w8 x(w16 w3))))))) w16) w3)))))) } -::day_17::main::33 { x(x(_ w1) x(@sub(2 w1) _)) } +::day_17::main::28 { x(x(_ w1) x(@sub(2 w1) _)) } -::day_17::main::34 { x(x(w3 w3) _) } +::day_17::main::29 { x(x(w3 w3) _) } -::day_17::main::36 { x(_ x(x(@n32_xor(w0 w2) w2) x(x(dup191(w8 w0) w8) x(x(w7 w7) _)))) } +::day_17::main::30 { x(_ x(x(@n32_xor(w0 w2) w2) x(x(dup184(w8 w0) w8) x(x(w7 w7) _)))) } -::day_17::main::37 { x(w10 x(w9 x(w7 x(w5 x(dup201(@eq(5 ?(::day_17::main::40 ::day_17::main::39 x(w10 x(w9 x(w7 x(w5 x(w15 w2))))))) w15) w2))))) } +::day_17::main::31 { x(w11 x(w10 x(w8 x(w6 x(dup194(@eq(5 ?(::day_17::main::33 ::day_17::main::32 x(w11 x(w10 x(w8 x(w6 x(w14 w3))))))) w14) w3))))) } -::day_17::main::39 { - x(w17 x(x(dup206(w15 w21) w15) x(x(dup207(w13 w20) w13) x(x(w12 w7) x(_ x(w9 _)))))) +::day_17::main::32 { + x(w17 x(x(dup198(w15 w21) w15) x(x(dup199(w13 w20) w13) x(x(w12 w7) x(_ x(w9 _)))))) ::day_17::main::10 = x(w17 x(w21 x(w20 x(w9 @n32_and(7 w2))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w2 w23) w23)) w7)) } -::day_17::main::40 { x(w10 x(w9 x(w7 x(x(w5 w5) x(dup220(@eq(6 ?(::day_17::main::43 ::day_17::main::42 x(w10 x(w9 x(w7 x(w15 w2)))))) w15) w2))))) } +::day_17::main::33 { x(w11 x(w10 x(w8 x(x(w6 w6) x(dup212(@eq(6 ?(::day_17::main::35 ::day_17::main::34 x(w11 x(w10 x(w8 x(w14 w3)))))) w14) w3))))) } -::day_17::main::42 { - x(dup224(@n32_shr(w13 w3) w17) x(x(w11 w3) x(x(dup227(w8 w15) w8) x(_ x(w6 _))))) +::day_17::main::34 { + x(dup215(@n32_shr(w13 w3) w17) x(x(w11 w3) x(x(dup218(w8 w15) w8) x(_ x(w6 _))))) ::day_17::main::10 = x(w17 x(w11 x(w15 x(w6 w13)))) } -::day_17::main::43 { x(w8 x(x(dup232(w6 w15) w6) x(w5 x(@eq(7 ?(::day_17::main::46 ::day_17::main::45 x(w8 x(w15 x(w5 w2))))) w2)))) } +::day_17::main::35 { x(w9 x(x(dup223(w7 w14) w7) x(w6 x(@eq(7 ?(::day_17::main::37 ::day_17::main::36 x(w9 x(w14 x(w6 w3))))) w3)))) } -::day_17::main::45 { - x(dup239(@n32_shr(w11 w3) w15) x(w9 x(x(w8 w3) x(w6 _)))) +::day_17::main::36 { + x(dup229(@n32_shr(w11 w3) w15) x(w9 x(x(w8 w3) x(w6 _)))) ::day_17::main::10 = x(w15 x(w9 x(w8 x(w6 w11)))) } -::day_17::main::46 { x(_ x(_ x(x(w3 w3) _))) } +::day_17::main::37 { x(_ x(_ x(x(w3 w3) _))) } ::std::array::Array::empty { tup(0 _) } @@ -131,10 +125,10 @@ ::std::array::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::array::Array::from_fn { fn(dup280(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup281(w3 w13) w3) fn(w6 w11))) } +::std::array::Array::from_fn { fn(dup269(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup270(w3 w13) w3) fn(w6 w11))) } ::std::array::Array::from_fn::3 { - x(dup287(w1 dup287(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup276(w1 dup276(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::array::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::option::Option::unwrap = fn(w16 _) @@ -143,25 +137,25 @@ ::std::array::Array::from_fn::4 { x(_ x(_ x(_ ::std::array::Array::empty))) } -::std::array::Array::len { fn(ref(tup(dup357(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup346(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup363(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup352(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup374(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup363(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup378(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup367(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_front { fn(ref(tup(dup413(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup413(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_front { fn(ref(tup(dup402(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup402(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -174,7 +168,7 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_front::5 { x(w4 dup434(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } +::std::array::Array::push_front::5 { x(w4 dup423(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } ::std::array::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -184,48 +178,48 @@ ::std::array::Array::push_front::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup447(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup436(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup453(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup442(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup465(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup453(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup471(@sub(1 @rem(2 dup473(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup472(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup459(@sub(1 @rem(2 dup461(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup460(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -239,7 +233,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::unzip_with { fn(dup657(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup639(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -249,7 +243,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup669(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup671(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup651(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup653(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -265,7 +259,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup716(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup697(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -284,7 +278,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup810(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup791(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -297,23 +291,23 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup822(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup803(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup889(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup870(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup900(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup881(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup909(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup890(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup919(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup900(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -343,7 +337,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup1002(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup983(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -351,9 +345,9 @@ ::std::list::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::list::List::iter { fn(ref(tup(dup1079(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1060(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1086(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1067(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -366,7 +360,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1115(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1096(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -381,7 +375,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1162(w1 w20) x(w12 w18))) + x(w14 x(dup1143(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -419,7 +413,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1281(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1259(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -428,7 +422,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1295(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1273(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -460,7 +454,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2409(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2377(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -469,10 +463,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2419(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2387(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2422(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2390(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -480,7 +474,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2429(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2397(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -492,10 +486,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2440(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2408(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2449(dup2444(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2417(dup2412(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/aoc_2024/day_17/stats.txt b/tests/snaps/vine/aoc_2024/day_17/stats.txt index a4afeb7c..78604baf 100644 --- a/tests/snaps/vine/aoc_2024/day_17/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_17/stats.txt @@ -1,10 +1,10 @@ Interactions - Total 27_342 + Total 27_341 Annihilate 15_759 Commute 126 Copy 2_226 - Erase 2_350 + Erase 2_349 Expand 3_656 Call 2_029 Branch 1_196 diff --git a/tests/snaps/vine/aoc_2024/day_18/compiled.iv b/tests/snaps/vine/aoc_2024/day_18/compiled.iv index 1ea5e6d7..db5f2aea 100644 --- a/tests/snaps/vine/aoc_2024/day_18/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_18/compiled.iv @@ -80,41 +80,41 @@ ::day_18::main::17 { x(dup115(w1 w22) x(w11 x(w9 x(w7 x(w6 x(w5 x(dup123(@lt(w1 ?(::day_18::main::20 ::day_18::main::19 x(w22 x(w11 x(w9 x(w7 x(w6 x(w5 x(w14 w13))))))))) w14) w13))))))) } -::day_18::main::18 { x(_ x(x(w8 w8) x(x(w6 w6) x(_ x(_ x(_ x(_ _))))))) } +::day_18::main::18 { x(_ x(x(w8 w8) x(x(w6 w6) _))) } ::day_18::main::19 { - x(w22 x(w21 x(x(w19 w1) x(w17 x(w16 x(dup136(w8 w25) x(dup137(w3 w24) w23))))))) + x(w22 x(w21 x(x(w19 w1) x(w17 x(w16 x(dup135(w8 w25) x(dup136(w3 w24) w23))))))) ::std::array::Array::get = fn(ref(w19 w1) fn(w3 w5)) - ::std::array::Array::get = fn(w5 fn(w8 ref(dup128(?(::day_18::main::22 ::day_18::main::21 x(w22 x(w21 x(w17 x(w16 x(w25 x(w24 w23))))))) w11) w11))) + ::std::array::Array::get = fn(w5 fn(w8 ref(dup127(?(::day_18::main::22 ::day_18::main::21 x(w22 x(w21 x(w17 x(w16 x(w25 x(w24 w23))))))) w11) w11))) } -::day_18::main::20 { x(_ x(x(w8 w8) x(x(w6 w6) x(_ x(_ x(_ x(_ _))))))) } +::day_18::main::20 { x(_ x(x(w8 w8) x(x(w6 w6) _))) } -::day_18::main::21 { x(_ x(x(w6 w6) x(_ x(_ x(_ x(_ _)))))) } +::day_18::main::21 { x(_ x(x(w6 w6) _)) } ::day_18::main::22 { - x(dup144(w21 w23) x(x(w18 w1) x(w16 x(w15 x(w14 x(w13 _)))))) + x(dup141(w21 w23) x(x(w18 w1) x(w16 x(w15 x(w14 x(w13 _)))))) ::day_18::main::13 = x(w21 fn(w16 fn(w15 w6))) ::day_18::main::13 = x(w23 fn(w14 fn(w13 w10))) ::day_18::DisjointSet::union = fn(ref(w18 w1) fn(w6 fn(w10 _))) } -::day_18::main::25 { x(dup156(w1 w18) x(w9 x(w8 x(w6 x(w4 dup163(@lt(w1 ?(::day_18::main::27 ::day_18::main::26 x(w18 x(w9 x(w8 x(w6 x(w4 w11))))))) w11)))))) } +::day_18::main::25 { x(dup151(w1 w18) x(w9 x(w8 x(w6 x(w4 dup158(@lt(w1 ?(::day_18::main::27 ::day_18::main::26 x(w18 x(w9 x(w8 x(w6 x(w4 w11))))))) w11)))))) } ::day_18::main::26 { - x(dup164(w21 w29) x(w9 x(x(w8 w27) x(x(w6 w25) x(w4 dup175(w12 @add(1 w2))))))) + x(dup159(w21 w29) x(w9 x(x(w8 w27) x(x(w6 w25) x(w4 dup170(w12 @add(1 w2))))))) ::day_18::main::28 = x(w21 x(x(w9 w20) x(x(w8 w18) x(x(w6 w16) x(x(w4 w14) x(w12 0)))))) ::day_18::main::25 = x(w29 x(w20 x(x(w18 w27) x(x(w16 w25) x(w14 w2))))) } ::day_18::main::27 { x(_ x(_ x(x(w5 w5) x(x(w3 w3) _)))) } -::day_18::main::28 { x(dup180(w1 w24) x(w12 x(w10 x(w8 x(w6 x(w4 dup190(@lt(w1 ?(::day_18::main::30 ::day_18::main::29 x(w24 x(w12 x(w10 x(w8 x(w6 x(w4 w14)))))))) w14))))))) } +::day_18::main::28 { x(dup175(w1 w24) x(w12 x(w10 x(w8 x(w6 x(w4 dup185(@lt(w1 ?(::day_18::main::30 ::day_18::main::29 x(w24 x(w12 x(w10 x(w8 x(w6 x(w4 w14)))))))) w14))))))) } ::day_18::main::29 { - x(dup192(w38 w49) x(x(w12 w48) x(x(w10 w46) x(x(w8 w44) x(x(w6 w42) x(dup205(w17 dup205(w31 w40)) dup206(w22 dup206(w30 @add(1 w2))))))))) + x(dup187(w38 w49) x(x(w12 w48) x(x(w10 w46) x(x(w8 w44) x(x(w6 w42) x(dup200(w17 dup200(w31 w40)) dup201(w22 dup201(w30 @add(1 w2))))))))) ::std::array::Array::get = fn(ref(w12 w15) fn(w17 w19)) - ::std::array::Array::get = fn(w19 fn(w22 ref(dup191(@eq(w27 ?(::day_18::main::33 ::day_18::main::32 x(w38 x(x(w10 w37) x(x(w8 w35) x(x(w6 w33) x(w31 x(w30 _)))))))) w25) w25))) + ::std::array::Array::get = fn(w19 fn(w22 ref(dup186(@eq(w27 ?(::day_18::main::33 ::day_18::main::32 x(w38 x(x(w10 w37) x(x(w8 w35) x(x(w6 w33) x(w31 x(w30 _)))))))) w25) w25))) 1 = @sub$(0 w27) ::day_18::main::28 = x(w49 x(x(w15 w48) x(x(w37 w46) x(x(w35 w44) x(x(w33 w42) x(w40 w2)))))) } @@ -129,7 +129,7 @@ ::day_18::main::33 { x(_ x(x(w8 w8) x(x(w6 w6) x(x(w4 w4) _)))) } ::day_18::main::34 { - x(dup228(@mul(w8 @sub(1 w10)) dup228(w8 w24)) x(w17 w16)) + x(dup222(@mul(w8 @sub(1 w10)) dup222(w8 w24)) x(w17 w16)) ::day_18::DisjointSet::find = fn(ref(w17 w1) fn(0 @ne(w11 ?(::day_18::main::36 ::day_18::main::35 x(w24 x(w5 w16)))))) ::day_18::DisjointSet::find = fn(ref(w1 w5) fn(w10 w11)) } @@ -139,21 +139,15 @@ ::std::list::List::pop_front = fn(ref(w7 w1) enum(::day_18::main::39 enum(::day_18::main::40 x(w10 x(w9 x(w8 x(w1 w6))))))) } -::day_18::main::36 { - x(_ x(_ x(_ x(_ x(w1 w1))))) - _ = _ -} +::day_18::main::36 { x(_ x(_ x(_ x(_ x(w1 w1))))) } ::day_18::main::39 { - enum(tup(w2 w3) x(dup245(w23 w29) x(w10 x(w9 x(w8 x(@sub(1 w17) w25)))))) + enum(tup(w2 w3) x(dup239(w23 w29) x(w10 x(w9 x(w8 x(@sub(1 w17) w25)))))) ::day_18::main::14 = x(w23 x(x(w10 w22) x(x(w9 w20) fn(w2 fn(w3 _))))) ::day_18::main::34 = x(w29 x(w22 x(w20 x(w8 x(w17 w25))))) } -::day_18::main::40 { - x(_ x(_ x(_ x(_ x(w1 w1))))) - _ = _ -} +::day_18::main::40 { x(_ x(_ x(_ x(_ x(w1 w1))))) } ::day_18::Node::Root { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -167,31 +161,31 @@ ::day_18::DisjointSet::find { fn(ref(w3 w18) fn(w7 w13)) - ::day_18::DisjointSet::find::2 = x(x(w3 w18) x(x(w7 dup267(w14 w13)) w14)) + ::day_18::DisjointSet::find::2 = x(x(w3 w18) x(x(w7 dup261(w14 w13)) w14)) } ::day_18::DisjointSet::find::2 { - x(x(w13 w19) x(x(dup277(w3 w16) w17) w15)) + x(x(w13 w19) x(x(dup271(w3 w16) w17) w15)) ::std::array::Array::get = fn(ref(w13 w1) fn(w3 ref(enum(::day_18::DisjointSet::find::5 enum(::day_18::DisjointSet::find::6 x(x(w1 w19) x(x(w16 w17) x(w15 w14))))) w14))) } ::day_18::DisjointSet::find::5 { enum(w1 x(x(w8 w8) x(x(w6 w6) x(_ enum(enum(w1 w9) enum(_ w9)))))) } ::day_18::DisjointSet::find::6 { - enum(w1 x(w10 x(x(_ w18) x(dup290(w14 w16) enum(_ enum(enum(w14 w11) w11)))))) + enum(w1 x(w10 x(x(_ w18) x(dup284(w14 w16) enum(_ enum(enum(w14 w11) w11)))))) ::day_18::DisjointSet::find::2 = x(w10 x(x(w1 w18) w16)) } ::day_18::DisjointSet::union { fn(ref(w3 w54) fn(w5 fn(w6 w50))) - ::day_18::DisjointSet::find = fn(ref(w3 w10) fn(w5 dup302(@eq(w48 ?(::day_18::DisjointSet::union::4 ::day_18::DisjointSet::union::3 x(x(w16 w54) x(w52 x(w51 w50))))) w52))) - ::day_18::DisjointSet::find = fn(ref(w10 w16) fn(w6 dup303(w48 w51))) + ::day_18::DisjointSet::find = fn(ref(w3 w10) fn(w5 dup296(@eq(w48 ?(::day_18::DisjointSet::union::4 ::day_18::DisjointSet::union::3 x(x(w16 w54) x(w52 x(w51 w50))))) w52))) + ::day_18::DisjointSet::find = fn(ref(w10 w16) fn(w6 dup297(w48 w51))) } ::day_18::DisjointSet::union::3 { x(x(w5 w5) x(w3 x(_ w3))) } ::day_18::DisjointSet::union::4 { - x(x(w4 w26) x(dup312(w36 w72) x(dup313(w44 w71) w66))) + x(x(w4 w26) x(dup306(w36 w72) x(dup307(w44 w71) w66))) ref(w4 w26) = ref(w29 w42) ::std::array::Array::get = fn(ref(w29 w34) fn(w36 ref(w39 w70))) ::std::array::Array::get = fn(ref(w34 w42) fn(w44 ref(w47 w68))) @@ -199,18 +193,18 @@ } ::day_18::DisjointSet::union::8 { - x(_ x(dup331(w0 w6) x(x(_ w1) x(x(w13 w13) x(x(dup334(w10 w3) w10) x(x(@add(w3 w5) w5) w6)))))) + x(_ x(dup324(w0 w6) x(x(_ w1) x(x(w13 w13) x(x(dup327(w10 w3) w10) x(x(@add(w3 w5) w5) w6)))))) ::day_18::Node::Child = fn(w0 w1) } ::day_18::DisjointSet::union::9 { - x(dup338(w0 w6) x(_ x(x(w15 w15) x(x(_ w1) x(x(@add(w3 w5) w5) x(x(dup343(w8 w3) w8) w6)))))) + x(dup331(w0 w6) x(_ x(x(w15 w15) x(x(_ w1) x(x(@add(w3 w5) w5) x(x(dup336(w8 w3) w8) w6)))))) ::day_18::Node::Child = fn(w0 w1) } ::day_18::DisjointSet::union::10 { enum(w1 x(w15 x(w14 x(w13 x(w11 x(w20 x(ref(enum(::day_18::DisjointSet::union::11 enum(::day_18::DisjointSet::union::12 x(w15 x(w14 x(w13 x(w11 x(w20 x(x(w1 w19) w17)))))))) w17) enum(enum(w19 w16) enum(_ w16))))))))) } -::day_18::DisjointSet::union::11 { enum(dup365(@lt(w20 ?(::day_18::DisjointSet::union::9 ::day_18::DisjointSet::union::8 x(w16 x(w15 x(w14 x(w12 x(x(w25 w26) x(x(w23 w24) w22)))))))) w25) x(w16 x(w15 x(w14 x(w12 x(w22 x(x(dup367(w20 w23) w24) enum(enum(w26 w17) enum(_ w17))))))))) } +::day_18::DisjointSet::union::11 { enum(dup358(@lt(w20 ?(::day_18::DisjointSet::union::9 ::day_18::DisjointSet::union::8 x(w16 x(w15 x(w14 x(w12 x(x(w25 w26) x(x(w23 w24) w22)))))))) w25) x(w16 x(w15 x(w14 x(w12 x(w22 x(x(dup360(w20 w23) w24) enum(enum(w26 w17) enum(_ w17))))))))) } ::day_18::DisjointSet::union::12 { enum(w1 x(_ x(_ x(x(w10 w10) x(x(w8 w8) x(_ x(x(w5 w5) enum(_ enum(enum(w1 w13) w13))))))))) } @@ -227,7 +221,7 @@ } ::day_18::pathfind::3 { - x(w12 x(dup404(w21 w29) x(dup405(w20 w28) x(w9 x(x(w8 w26) dup411(w16 @add(1 w5))))))) + x(w12 x(dup397(w21 w29) x(dup398(w20 w28) x(w9 x(x(w8 w26) dup404(w16 @add(1 w5))))))) ::day_18::pathfind::5 = x(x(w12 w23) x(w21 x(w20 x(w9 x(x(w8 w18) x(w16 x(tup(0 tup(w13 w13)) w15))))))) ::day_18::pathfind::2 = x(w23 x(w29 x(w28 x(w15 x(x(w18 w26) w5))))) } @@ -239,23 +233,23 @@ ::std::list::List::pop_front = fn(ref(w10 w1) enum(::day_18::pathfind::8 enum(::day_18::pathfind::9 x(w14 x(w12 x(w11 x(w1 w9))))))) } -::day_18::pathfind::8 { enum(dup438(tup(dup439(@eq(w33 ?(::day_18::pathfind::15 ::day_18::pathfind::11 x(w11 x(w45 x(w8 x(w7 x(w6 x(w4 x(w3 x(w37 x(w36 w14))))))))))) w36) w14) w37) x(w11 x(dup430(@sub(1 w33) w45) x(w8 x(w7 x(w6 x(w4 w3))))))) } +::day_18::pathfind::8 { enum(dup431(tup(dup432(@eq(w33 ?(::day_18::pathfind::15 ::day_18::pathfind::11 x(w11 x(w45 x(w8 x(w7 x(w6 x(w4 x(w3 x(w37 x(w36 w14))))))))))) w36) w14) w37) x(w11 x(dup423(@sub(1 w33) w45) x(w8 x(w7 x(w6 x(w4 w3))))))) } ::day_18::pathfind::9 { x(x(w9 w9) x(_ x(_ x(_ x(x(w4 w4) x(_ x(w1 w1))))))) } -::day_18::pathfind::11 { x(w16 x(dup447(@sub(1 w2) w27) x(w13 x(w12 x(w11 x(w9 x(w8 x(w6 x(w5 dup457(@eq(w2 ?(::day_18::pathfind::15 ::day_18::pathfind::13 x(w16 x(w27 x(w13 x(w12 x(w11 x(w9 x(w8 x(w6 x(w5 w17))))))))))) w17)))))))))) } +::day_18::pathfind::11 { x(w16 x(dup440(@sub(1 w2) w27) x(w13 x(w12 x(w11 x(w9 x(w8 x(w6 x(w5 dup450(@eq(w2 ?(::day_18::pathfind::15 ::day_18::pathfind::13 x(w16 x(w27 x(w13 x(w12 x(w11 x(w9 x(w8 x(w6 x(w5 w17))))))))))) w17)))))))))) } ::day_18::pathfind::13 { x(x(w16 w16) x(_ x(_ x(_ x(x(_ w9) x(w9 x(x(_ tup(0 tup(w17 w17))) _))))))) } ::day_18::pathfind::15 { - x(x(w12 w54) x(dup492(w42 w52) x(dup493(w33 dup493(w41 w51)) x(w8 x(w7 x(w5 x(x(w4 w46) x(w2 x(w1 w0))))))))) + x(x(w12 w54) x(dup485(w42 w52) x(dup486(w33 dup486(w41 w51)) x(w8 x(w7 x(w5 x(x(w4 w46) x(w2 x(w1 w0))))))))) ::std::array::Array::get = fn(ref(w12 w19) fn(w0 w23)) - ::std::array::Array::get = fn(w23 fn(w1 ref(dup505(@le$(w33 ?(::day_18::pathfind::18 ::day_18::pathfind::17 x(x(w19 w44) x(w42 x(w41 x(x(w4 w40) x(w2 x(x(w36 w37) _)))))))) w36) w37))) + ::std::array::Array::get = fn(w23 fn(w1 ref(dup498(@le$(w33 ?(::day_18::pathfind::18 ::day_18::pathfind::17 x(x(w19 w44) x(w42 x(w41 x(x(w4 w40) x(w2 x(x(w36 w37) _)))))))) w36) w37))) ::day_18::pathfind::5 = x(x(w44 w54) x(w52 x(w51 x(w8 x(w7 x(w5 x(w40 w46))))))) } ::day_18::pathfind::17 { - x(x(w32 w60) x(dup513(w37 dup513(w44 dup513(w51 w58))) x(dup514(w36 dup514(w43 dup514(w50 w57))) x(x(w28 w56) x(dup520(@add(tup(1 0) w4) dup520(@add(tup(0 1) w9) dup520(@add(tup(w13 0) w15) @add(tup(0 w19) w21)))) x(x(_ 0) _)))))) + x(x(w32 w60) x(dup505(w37 dup505(w44 dup505(w51 w58))) x(dup506(w36 dup506(w43 dup506(w50 w57))) x(x(w28 w56) x(dup512(@add(tup(1 0) w4) dup512(@add(tup(0 1) w9) dup512(@add(tup(w13 0) w15) @add(tup(0 w19) w21)))) x(x(_ 0) _)))))) ::day_18::pathfind::19 = x(x(w32 w39) x(w37 x(w36 x(x(w28 w35) fn(w4 _))))) ::day_18::pathfind::19 = x(x(w39 w46) x(w44 x(w43 x(x(w35 w42) fn(w9 _))))) ::day_18::pathfind::19 = x(x(w46 w53) x(w51 x(w50 x(x(w42 w49) fn(w15 _))))) @@ -266,29 +260,29 @@ ::day_18::pathfind::18 { x(x(w9 w9) x(_ x(_ x(x(w5 w5) x(_ x(x(w2 w2) _)))))) } -::day_18::pathfind::19 { x(w12 x(dup533(w14 w22) x(w9 x(w8 fn(tup(dup537(@lt(w14 ?(::day_18::pathfind::22 ::day_18::pathfind::21 x(w12 x(w22 x(w9 x(w8 x(w18 x(w1 w16)))))))) w18) w1) w16))))) } +::day_18::pathfind::19 { x(w12 x(dup524(w14 w22) x(w9 x(w8 fn(tup(dup528(@lt(w14 ?(::day_18::pathfind::22 ::day_18::pathfind::21 x(w12 x(w22 x(w9 x(w8 x(w18 x(w1 w16)))))))) w18) w1) w16))))) } -::day_18::pathfind::21 { x(w11 x(w9 x(w8 x(w7 x(w5 x(dup549(@lt(w9 ?(::day_18::pathfind::24 ::day_18::pathfind::23 x(w11 x(w8 x(w7 x(w5 x(w13 w12))))))) w13) w12)))))) } +::day_18::pathfind::21 { x(w11 x(w9 x(w8 x(w7 x(w5 x(dup540(@lt(w9 ?(::day_18::pathfind::24 ::day_18::pathfind::23 x(w11 x(w8 x(w7 x(w5 x(w13 w12))))))) w13) w12)))))) } -::day_18::pathfind::22 { x(x(w8 w8) x(_ x(_ x(x(w4 w4) x(_ x(_ _)))))) } +::day_18::pathfind::22 { x(x(w8 w8) x(_ x(_ x(x(w4 w4) _)))) } ::day_18::pathfind::23 { - x(x(w22 w1) x(w20 x(w19 x(dup560(w8 w25) x(dup561(w3 w24) w23))))) + x(x(w22 w1) x(w20 x(w19 x(dup550(w8 w25) x(dup551(w3 w24) w23))))) ::std::array::Array::get = fn(ref(w22 w1) fn(w3 w5)) - ::std::array::Array::get = fn(w5 fn(w8 ref(dup554(@le$(w20 ?(::day_18::pathfind::26 ::day_18::pathfind::25 x(w19 x(w25 x(w24 w23))))) w11) w11))) + ::std::array::Array::get = fn(w5 fn(w8 ref(dup544(@le$(w20 ?(::day_18::pathfind::26 ::day_18::pathfind::25 x(w19 x(w25 x(w24 w23))))) w11) w11))) } -::day_18::pathfind::24 { x(x(w7 w7) x(_ x(x(w4 w4) x(_ x(_ _))))) } +::day_18::pathfind::24 { x(x(w7 w7) x(_ x(x(w4 w4) _))) } ::day_18::pathfind::25 { x(x(w10 w5) x(w8 x(w7 _))) ::std::list::List::concat = fn(w10 fn(tup(1 tup(tup(tup(w8 w7) w11) w11)) w5)) } -::day_18::pathfind::26 { x(x(w4 w4) x(_ x(_ _))) } +::day_18::pathfind::26 { x(x(w4 w4) _) } ::std::array::Array::new { - fn(dup580(w6 w7) fn(w3 tup(w6 w9))) + fn(dup566(w6 w7) fn(w3 tup(w6 w9))) ::std::array::Node::new = fn(w7 fn(w3 w9)) } @@ -298,10 +292,10 @@ ::std::array::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::array::Array::fold_front { fn(tup(dup642(?(::std::array::Array::fold_front::4 ::std::array::Array::fold_front::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::array::Array::fold_front { fn(tup(dup628(?(::std::array::Array::fold_front::4 ::std::array::Array::fold_front::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::array::Array::fold_front::3 { - x(dup650(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup636(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::array::Array::pop_back = fn(ref(tup(w1 w7) w11) w13) ::std::option::Option::unwrap = fn(w13 w14) @@ -310,10 +304,10 @@ ::std::array::Array::fold_front::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::array::Array::fold_back { fn(tup(dup663(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::array::Array::fold_back { fn(tup(dup649(?(::std::array::Array::fold_back::4 ::std::array::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::array::Array::fold_back::3 { - x(dup671(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup657(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::array::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::option::Option::unwrap = fn(w13 w14) @@ -322,25 +316,25 @@ ::std::array::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::array::Array::len { fn(ref(tup(dup684(w12 w9) w10) tup(w9 w10)) w12) } +::std::array::Array::len { fn(ref(tup(dup670(w12 w9) w10) tup(w9 w10)) w12) } ::std::array::Array::get { - fn(ref(tup(dup690(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup676(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup701(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup687(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup705(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup691(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_back { fn(ref(tup(dup711(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup711(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_back { fn(ref(tup(dup697(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup697(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -353,17 +347,17 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_back::5 { x(w4 dup732(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } +::std::array::Array::push_back::5 { x(w4 dup718(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } ::std::array::Array::push_back::6 { - x(x(w10 w13) dup736(w1 @rem(2 w3))) + x(x(w10 w13) dup722(w1 @rem(2 w3))) ::std::array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::array::Array::push_back::5 = x(x(w5 w13) w6) } ::std::array::Array::push_back::7 { x(x(w2 w2) _) } -::std::array::Array::push_front { fn(ref(tup(dup740(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup740(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_front { fn(ref(tup(dup726(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup726(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -376,7 +370,7 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_front::5 { x(w4 dup761(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } +::std::array::Array::push_front::5 { x(w4 dup747(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } ::std::array::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -386,88 +380,88 @@ ::std::array::Array::push_front::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup774(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup760(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup780(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup766(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup792(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup777(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup798(@sub(1 @rem(2 dup800(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup799(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup783(@sub(1 @rem(2 dup785(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup784(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } -::std::array::Array::pop_front { fn(ref(tup(dup826(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup810(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup832(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup816(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup844(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup827(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup851(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup834(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -475,7 +469,7 @@ ::std::array::Node::leaf { fn(x x) } -::std::array::Node::new { fn(dup887(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::array::Node::new { fn(dup869(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::array::Node::new::3 { x(_ x(w3 w1)) @@ -483,7 +477,7 @@ } ::std::array::Node::new::4 { - x(dup895(@add(1 @div(2 w2)) @div(2 w6)) x(dup896(w3 w7) tup(w4 w8))) + x(dup877(@add(1 @div(2 w2)) @div(2 w6)) x(dup878(w3 w7) tup(w4 w8))) ::std::array::Node::new = fn(w2 fn(w3 w4)) ::std::array::Node::new = fn(w6 fn(w7 w8)) } @@ -494,7 +488,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::zip_with { fn(dup963(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::array::Node::zip_with { fn(dup942(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -504,7 +498,7 @@ } ::std::array::Node::zip_with::4 { - x(dup975(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup978(w13 w19) tup(w14 w20))))) + x(dup954(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup957(w13 w19) tup(w14 w20))))) ::std::array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } @@ -520,7 +514,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup1043(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup1021(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -534,11 +528,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup1088(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup1066(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup1095(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup1073(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -553,7 +547,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup1112(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup1090(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -566,14 +560,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup1149(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup1127(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup1183(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup1161(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -583,20 +577,20 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } ::std::list::List::map { - fn(tup(dup1216(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup1194(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup1227(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup1205(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup1236(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup1214(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup1246(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup1224(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -631,7 +625,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup1329(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup1307(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -639,9 +633,9 @@ ::std::list::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::list::List::iter { fn(ref(tup(dup1406(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1384(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1413(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1391(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -654,7 +648,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1442(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1420(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -707,7 +701,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1608(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1583(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -716,7 +710,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1622(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1597(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -748,7 +742,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2736(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2701(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -757,10 +751,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2746(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2711(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2749(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2714(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -768,7 +762,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2756(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2721(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -780,10 +774,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2767(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2732(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2776(dup2771(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2741(dup2736(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/aoc_2024/day_18/stats.txt b/tests/snaps/vine/aoc_2024/day_18/stats.txt index 36646e00..57e9562e 100644 --- a/tests/snaps/vine/aoc_2024/day_18/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_18/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 164_698 - Annihilate 87_642 + Total 164_697 + Annihilate 87_102 Commute 1_352 - Copy 15_052 - Erase 13_665 + Copy 15_592 + Erase 13_664 Expand 20_610 Call 17_743 Branch 8_634 Memory Heap 14_912 B - Allocated 3_526_144 B - Freed 3_526_144 B + Allocated 3_517_504 B + Freed 3_517_504 B diff --git a/tests/snaps/vine/aoc_2024/day_19/compiled.iv b/tests/snaps/vine/aoc_2024/day_19/compiled.iv index 5db64dcc..68a6fedd 100644 --- a/tests/snaps/vine/aoc_2024/day_19/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_19/compiled.iv @@ -45,7 +45,7 @@ } ::day_19::match_counts::3 { - x(dup56(w0 w25) x(dup57(w7 w24) w12)) + x(dup55(w0 w25) x(dup56(w7 w24) w12)) ::std::list::List::pop_front = fn(ref(w0 w3) _) ::day_19::match_counts = fn(w3 fn(w7 w8)) ::day_19::match_counts::5 = x(w25 x(w24 x(x(w8 w23) x(0 w21)))) @@ -63,7 +63,7 @@ } ::day_19::match_counts::8 { - enum(w0 x(dup75(w9 w25) x(w6 x(x(w5 w23) x(w3 w21))))) + enum(w0 x(dup74(w9 w25) x(w6 x(x(w5 w23) x(w3 w21))))) ::std::list::List::strip_prefix = fn(w9 fn(ref(w0 _) enum(::day_19::match_counts::13 enum(::day_19::match_counts::14 x(x(w5 w19) x(x(w3 w17) _)))))) ::day_19::match_counts::5 = x(w25 x(w6 x(x(w19 w23) x(w17 w21)))) } @@ -73,7 +73,7 @@ ::day_19::match_counts::13 { enum(w0 x(x(w6 w9) x(x(w4 w19) _))) ::std::list::List::len = fn(ref(w0 _) w14) - ::std::array::Array::get = fn(ref(w6 w9) fn(w14 ref(dup89(w18 w17) w17))) + ::std::array::Array::get = fn(ref(w6 w9) fn(w14 ref(dup88(w18 w17) w17))) ::std::n64::N64::add = fn(w4 fn(w18 w19)) } @@ -85,22 +85,22 @@ } ::std::array::Array::get { - fn(ref(tup(dup215(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup213(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup226(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup224(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup230(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup228(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_back { fn(ref(tup(dup236(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup236(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_back { fn(ref(tup(dup234(?(::std::array::Array::push_back::4 ::std::array::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup234(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -113,58 +113,58 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_back::5 { x(w4 dup257(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } +::std::array::Array::push_back::5 { x(w4 dup255(@lt$(1 ?(::std::array::Array::push_back::7 ::std::array::Array::push_back::6 x(w4 w5))) w5)) } ::std::array::Array::push_back::6 { - x(x(w10 w13) dup261(w1 @rem(2 w3))) + x(x(w10 w13) dup259(w1 @rem(2 w3))) ::std::array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::array::Array::push_back::5 = x(x(w5 w13) w6) } ::std::array::Array::push_back::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup299(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup297(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup305(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup303(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup317(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup314(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup323(@sub(1 @rem(2 dup325(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup324(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup320(@sub(1 @rem(2 dup322(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup321(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -189,7 +189,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup568(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup558(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -203,11 +203,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup613(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup603(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup620(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup610(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -222,7 +222,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup637(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup627(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -235,9 +235,9 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup674(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup664(w13 w9) w10) tup(w9 w10)) w13) } -::std::list::List::pop_front { fn(ref(tup(dup771(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup761(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -248,9 +248,9 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::list::List::iter { fn(ref(tup(dup931(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup921(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup938(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup928(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -267,7 +267,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1014(w1 w20) x(w12 w18))) + x(w14 x(dup1004(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -305,7 +305,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1133(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1120(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -314,7 +314,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1147(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1134(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -353,7 +353,7 @@ } ::std::list::List::strip_prefix::3 { - x(_ x(x(dup1200(w3 w0) w3) w1)) + x(_ x(x(dup1186(w3 w0) w3) w1)) ::std::result::Result::Err = fn(w0 w1) } @@ -370,9 +370,9 @@ } ::std::list::List::strip_prefix::8 { - enum(ref(dup1220(w1 @ne(w18 ?(::std::list::List::strip_prefix::5 ::std::list::List::strip_prefix::11 x(w7 x(w9 w5))))) w1) x(w7 x(w6 w5))) + enum(ref(dup1205(w1 @ne(w18 ?(::std::list::List::strip_prefix::5 ::std::list::List::strip_prefix::11 x(w7 x(w9 w5))))) w1) x(w7 x(w6 w5))) ::std::list::List::Iter::next = fn(ref(w6 w9) w11) - ::std::option::Option::unwrap = fn(w11 ref(dup1221(w13 w18) w13)) + ::std::option::Option::unwrap = fn(w11 ref(dup1206(w13 w18) w13)) } ::std::list::List::strip_prefix::9 { @@ -387,7 +387,7 @@ ::std::result::Result::Err = fn(w13 w9) } -::std::n32::N32::to_string { fn(dup2261(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2238(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -396,10 +396,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2271(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2248(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2274(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2251(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -416,19 +416,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2507(@div(w9 w10) @rem(w12 dup2508(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2510(w9 dup2510(w12 dup2510(w31 dup2510(w36 dup2510(w41 dup2510(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2506(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2478(@div(w9 w10) @rem(w12 dup2479(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2481(w9 dup2481(w12 dup2481(w31 dup2481(w36 dup2481(w41 dup2481(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2477(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2521(@div(w1 w2) @rem(w4 w6)) w6) x(dup2522(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2492(@div(w1 w2) @rem(w4 w6)) w6) x(dup2493(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2530(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2500(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2537(w2 w9) x(dup2539(w0 dup2539(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2543(w5 w11))) + x(x(w27 w33) x(dup2507(w2 w9) x(dup2509(w0 dup2509(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2513(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -443,7 +443,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } ::std::n64::N64::to_string { - fn(dup2788(w6 w9) w8) + fn(dup2756(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -455,7 +455,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2798(w0 w7) w3) + x(dup2766(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } diff --git a/tests/snaps/vine/aoc_2024/day_20/compiled.iv b/tests/snaps/vine/aoc_2024/day_20/compiled.iv index 0f7f446c..8ab7a04e 100644 --- a/tests/snaps/vine/aoc_2024/day_20/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_20/compiled.iv @@ -7,9 +7,9 @@ ::std::array::Array::from_list = fn(w54 w12) 1 = @sub$(0 w19) 1 = @sub$(0 w20) - ::day_20::main::18 = x(w50 x(w12 x(x(tup(1 tup(tup(w14 w57) w57)) w61) x(w17 tup(w19 w20))))) + ::day_20::main::17 = x(w50 x(w12 x(x(tup(1 tup(tup(w14 w57) w57)) w61) x(w17 tup(w19 w20))))) ::std::list::List::len = fn(ref(w61 w24) @sub(1 _)) - ::day_20::main::28 = x(w24 x(x(0 w68) x(x(0 w66) 0))) + ::day_20::main::27 = x(w24 x(x(0 w68) x(x(0 w66) 0))) ::std::n32::N32::to_string = fn(w68 w37) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w70)))))))) w70)) fn(w37 w38)) ::std::io::IO::println = fn(ref(w56 w33) fn(w38 _)) @@ -52,91 +52,91 @@ ::std::list::List::len = fn(ref(w19 w5) w7) } -::day_20::main::14 { x(w10 x(x(w8 w8) x(w6 x(w4 x(@eq(69 ?(::day_20::main::17 ::day_20::main::16 x(w10 x(w6 x(w4 w13))))) w13))))) } +::day_20::main::14 { x(w11 x(x(w9 w9) x(w7 x(w5 x(@eq(69 ?(::day_20::main::16 ::day_20::main::15 x(w11 x(w7 x(w5 w12))))) w12))))) } -::day_20::main::16 { +::day_20::main::15 { x(x(w16 w5) x(x(_ tup(w3 w7)) x(x(w12 w1) _))) ::std::list::List::len = fn(ref(w12 w1) w3) ::std::list::List::len = fn(ref(w16 w5) w7) } -::day_20::main::17 { x(x(w6 w6) x(x(w4 w4) x(x(w2 w2) _))) } +::day_20::main::16 { x(x(w6 w6) x(x(w4 w4) x(x(w2 w2) _))) } -::day_20::main::18 { - x(dup115(w1 w14) x(w7 x(w6 x(dup119(w0 w10) w3)))) - ::day_20::eq = fn(w0 fn(w1 ?(::day_20::main::20 ::day_20::main::19 x(w14 x(w7 x(w6 x(w10 w3))))))) +::day_20::main::17 { + x(dup113(w1 w14) x(w7 x(w6 x(dup117(w0 w10) w3)))) + ::day_20::eq = fn(w0 fn(w1 ?(::day_20::main::19 ::day_20::main::18 x(w14 x(w7 x(w6 x(w10 w3))))))) } -::day_20::main::19 { x(_ x(_ x(x(w3 w3) _))) } +::day_20::main::18 { x(_ x(_ x(x(w3 w3) _))) } -::day_20::main::20 { - x(w37 x(w36 x(x(w35 w65) x(dup131(@add(tup(1 0) w4) dup131(@add(tup(w8 0) w10) dup131(@add(tup(0 1) w15) dup131(@add(tup(0 w19) w21) w28)))) dup133(w41 dup133(w47 dup133(w53 w59))))))) - ::day_20::main::21 = x(x(w36 w43) x(w41 x(x(_ w40) fn(w4 _)))) - ::day_20::main::21 = x(x(w43 w49) x(w47 x(x(w40 w46) fn(w10 _)))) +::day_20::main::19 { + x(w37 x(w36 x(x(w35 w65) x(dup129(@add(tup(1 0) w4) dup129(@add(tup(w8 0) w10) dup129(@add(tup(0 1) w15) dup129(@add(tup(0 w19) w21) w28)))) dup131(w41 dup131(w47 dup131(w53 w59))))))) + ::day_20::main::20 = x(x(w36 w43) x(w41 x(x(_ w40) fn(w4 _)))) + ::day_20::main::20 = x(x(w43 w49) x(w47 x(x(w40 w46) fn(w10 _)))) 1 = @sub$(0 w8) - ::day_20::main::21 = x(x(w49 w55) x(w53 x(x(w46 w52) fn(w15 _)))) - ::day_20::main::21 = x(x(w55 w61) x(w59 x(x(w52 dup135(w26 w30)) fn(w21 _)))) + ::day_20::main::20 = x(x(w49 w55) x(w53 x(x(w46 w52) fn(w15 _)))) + ::day_20::main::20 = x(x(w55 w61) x(w59 x(x(w52 dup133(w26 w30)) fn(w21 _)))) 1 = @sub$(0 w19) ::std::list::List::push_back = fn(ref(w35 w24) fn(w26 _)) - ::day_20::main::18 = x(w37 x(w61 x(x(w24 w65) x(w30 w28)))) + ::day_20::main::17 = x(w37 x(w61 x(x(w24 w65) x(w30 w28)))) } -::day_20::main::21 { - x(w9 x(w7 x(w6 fn(dup149(w11 w14) w13)))) - ::day_20::eq = fn(w7 fn(w11 ?(::day_20::main::24 ::day_20::main::23 x(w9 x(w6 x(w14 w13)))))) +::day_20::main::20 { + x(w9 x(w7 x(w6 fn(dup147(w11 w14) w13)))) + ::day_20::eq = fn(w7 fn(w11 ?(::day_20::main::23 ::day_20::main::22 x(w9 x(w6 x(w14 w13)))))) } -::day_20::main::23 { x(x(w5 w5) x(x(w3 w3) x(_ _))) } +::day_20::main::22 { x(x(w5 w5) x(x(w3 w3) _)) } -::day_20::main::24 { - x(x(w28 w1) x(w26 x(tup(w5 dup156(w8 w6)) w29))) +::day_20::main::23 { + x(x(w28 w1) x(w26 x(tup(w5 dup153(w8 w6)) w29))) ::std::array::Array::get = fn(ref(w28 w1) fn(w8 w10)) - ::std::array::Array::get = fn(w10 fn(w18 ref(dup158(?(::day_20::main::26 ::day_20::main::25 x(w26 x(tup(w15 w16) w29))) w21) w21))) - tup(w5 w6) = tup(dup157(w18 w15) w16) + ::std::array::Array::get = fn(w10 fn(w18 ref(dup155(?(::day_20::main::25 ::day_20::main::24 x(w26 x(tup(w15 w16) w29))) w21) w21))) + tup(w5 w6) = tup(dup154(w18 w15) w16) } -::day_20::main::25 { x(x(_ w3) x(w3 _)) } +::day_20::main::24 { x(x(_ w3) x(w3 _)) } -::day_20::main::26 { x(x(w3 w3) x(_ _)) } +::day_20::main::25 { x(x(w3 w3) _) } -::day_20::main::28 { +::day_20::main::27 { x(w10 w9) - ::std::list::List::pop_front = fn(ref(w10 w1) enum(::day_20::main::31 enum(::day_20::main::32 x(w1 w9)))) + ::std::list::List::pop_front = fn(ref(w10 w1) enum(::day_20::main::30 enum(::day_20::main::31 x(w1 w9)))) } -::day_20::main::31 { - enum(w0 x(dup181(w11 w29) x(x(w6 w28) x(x(w4 w26) dup188(@add(1 w9) dup188(w19 @add(1 w15))))))) +::day_20::main::30 { + enum(w0 x(dup176(w11 w29) x(x(w6 w28) x(x(w4 w26) dup183(@add(1 w9) dup183(w19 @add(1 w15))))))) ::std::list::List::into_iter = fn(w11 w12) - ::day_20::main::33 = x(x(w6 w23) x(x(w4 w21) x(w19 x(w0 x(w9 w12))))) - ::day_20::main::28 = x(w29 x(x(w23 w28) x(x(w21 w26) w15))) + ::day_20::main::32 = x(x(w6 w23) x(x(w4 w21) x(w19 x(w0 x(w9 w12))))) + ::day_20::main::27 = x(w29 x(x(w23 w28) x(x(w21 w26) w15))) } -::day_20::main::32 { x(_ x(x(w4 w4) x(x(w2 w2) _))) } +::day_20::main::31 { x(_ x(x(w4 w4) x(x(w2 w2) _))) } -::day_20::main::33 { +::day_20::main::32 { x(w12 x(w10 x(w8 x(w7 x(w6 w5))))) - ::std::list::List::IntoIter::next = fn(ref(w5 w1) enum(::day_20::main::36 enum(::day_20::main::37 x(w12 x(w10 x(w8 x(w7 x(w6 w1)))))))) + ::std::list::List::IntoIter::next = fn(ref(w5 w1) enum(::day_20::main::35 enum(::day_20::main::36 x(w12 x(w10 x(w8 x(w7 x(w6 w1)))))))) } -::day_20::main::36 { - enum(w0 x(x(w9 w38) x(x(w7 w36) x(dup212(w15 w34) x(dup213(w10 w33) x(dup214(@sub(w15 @sub(w17 @le$(50 ?(::day_20::main::40 ::day_20::main::39 x(x(w9 w30) x(x(w7 w28) x(w26 _))))))) @add(1 w22)) w2)))))) - ::day_20::dist = fn(w10 fn(w0 dup218(w17 w26))) - ::day_20::main::33 = x(x(w30 w38) x(x(w28 w36) x(w34 x(w33 x(w22 w2))))) +::day_20::main::35 { + enum(w0 x(x(w9 w38) x(x(w7 w36) x(dup207(w15 w34) x(dup208(w10 w33) x(dup209(@sub(w15 @sub(w17 @le$(50 ?(::day_20::main::39 ::day_20::main::38 x(x(w9 w30) x(x(w7 w28) x(w26 _))))))) @add(1 w22)) w2)))))) + ::day_20::dist = fn(w10 fn(w0 dup213(w17 w26))) + ::day_20::main::32 = x(x(w30 w38) x(x(w28 w36) x(w34 x(w33 x(w22 w2))))) } -::day_20::main::37 { x(x(w7 w7) x(x(w5 w5) _)) } +::day_20::main::36 { x(x(w7 w7) x(x(w5 w5) _)) } -::day_20::main::39 { x(w7 x(w5 x(dup228(@eq(2 ?(::day_20::main::43 ::day_20::main::42 x(w7 _))) @le(20 ?(::day_20::main::46 ::day_20::main::45 x(w5 w15)))) w15))) } +::day_20::main::38 { x(w7 x(w5 x(dup223(@eq(2 ?(::day_20::main::42 ::day_20::main::41 x(w7 _))) @le(20 ?(::day_20::main::45 ::day_20::main::44 x(w5 w15)))) w15))) } -::day_20::main::40 { x(x(w5 w5) x(x(w3 w3) _)) } +::day_20::main::39 { x(x(w5 w5) x(x(w3 w3) _)) } -::day_20::main::42 { x(x(@add(1 w1) w1) _) } +::day_20::main::41 { x(x(@add(1 w1) w1) _) } -::day_20::main::43 { x(x(w2 w2) _) } +::day_20::main::42 { x(x(w2 w2) _) } -::day_20::main::45 { x(x(@add(1 w1) w1) _) } +::day_20::main::44 { x(x(@add(1 w1) w1) _) } -::day_20::main::46 { x(x(w2 w2) _) } +::day_20::main::45 { x(x(w2 w2) _) } ::day_20::eq { fn(tup(@eq(w5 ?(::day_20::eq::4 ::day_20::eq::3 x(w3 x(w6 w14)))) w3) fn(tup(w5 w6) w14)) } @@ -157,10 +157,10 @@ ::std::array::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::array::Array::from_fn { fn(dup299(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup300(w3 w13) w3) fn(w6 w11))) } +::std::array::Array::from_fn { fn(dup291(?(::std::array::Array::from_fn::4 ::std::array::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup292(w3 w13) w3) fn(w6 w11))) } ::std::array::Array::from_fn::3 { - x(dup306(w1 dup306(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup298(w1 dup298(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::array::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::option::Option::unwrap = fn(w16 _) @@ -170,22 +170,22 @@ ::std::array::Array::from_fn::4 { x(_ x(_ x(_ ::std::array::Array::empty))) } ::std::array::Array::get { - fn(ref(tup(dup382(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup374(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup393(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup385(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup397(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup389(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::push_front { fn(ref(tup(dup432(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup432(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::array::Array::push_front { fn(ref(tup(dup424(?(::std::array::Array::push_front::4 ::std::array::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup424(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::array::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -198,7 +198,7 @@ ::std::array::Node::leaf = fn(w8 w5) } -::std::array::Array::push_front::5 { x(w4 dup453(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } +::std::array::Array::push_front::5 { x(w4 dup445(@lt$(1 ?(::std::array::Array::push_front::7 ::std::array::Array::push_front::6 x(w4 w5))) w5)) } ::std::array::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -208,48 +208,48 @@ ::std::array::Array::push_front::7 { x(x(w2 w2) _) } -::std::array::Array::pop_back { fn(ref(tup(dup466(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_back { fn(ref(tup(dup458(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup472(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup464(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup484(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup475(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup490(@sub(1 @rem(2 dup492(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup491(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup481(@sub(1 @rem(2 dup483(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup482(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -263,7 +263,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::unzip_with { fn(dup676(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup661(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -273,7 +273,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup688(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup690(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup673(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup675(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -289,7 +289,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup735(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup719(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -303,11 +303,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup780(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup764(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup787(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup771(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -322,7 +322,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup804(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup788(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -335,9 +335,9 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup841(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup825(w13 w9) w10) tup(w9 w10)) w13) } -::std::list::List::pop_front { fn(ref(tup(dup938(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup922(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -355,7 +355,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1134(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1118(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -364,7 +364,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2428(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2399(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -373,10 +373,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2438(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2409(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2441(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2412(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -384,7 +384,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::diff { fn(dup2529(@lt$(w8 ?(::std::n32::N32::diff::4 ::std::n32::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2530(w8 w11) w10)) } +::std::n32::N32::diff { fn(dup2498(@lt$(w8 ?(::std::n32::N32::diff::4 ::std::n32::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2499(w8 w11) w10)) } ::std::n32::N32::diff::3 { x(@sub(w4 w2) x(w4 w2)) } diff --git a/tests/snaps/vine/aoc_2024/day_20/stats.txt b/tests/snaps/vine/aoc_2024/day_20/stats.txt index da0d40f8..4dfafbae 100644 --- a/tests/snaps/vine/aoc_2024/day_20/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_20/stats.txt @@ -1,9 +1,9 @@ Interactions Total 481_239 - Annihilate 237_024 + Annihilate 236_772 Commute 13_532 - Copy 59_902 + Copy 60_154 Erase 38_403 Expand 58_365 Call 51_554 @@ -11,5 +11,5 @@ Interactions Memory Heap 18_000 B - Allocated 10_342_544 B - Freed 10_342_544 B + Allocated 10_338_512 B + Freed 10_338_512 B diff --git a/tests/snaps/vine/aoc_2024/day_21/compiled.iv b/tests/snaps/vine/aoc_2024/day_21/compiled.iv index 4a240609..76bafb84 100644 --- a/tests/snaps/vine/aoc_2024/day_21/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_21/compiled.iv @@ -96,11 +96,11 @@ ::day_21::main::23 { x(_ 1) } -::day_21::main::24 { x(dup103(@eq(65 ?(::day_21::main::27 ::day_21::main::26 x(w6 w5))) w6) w5) } +::day_21::main::24 { x(dup103(@eq(65 ?(::day_21::main::26 ::day_21::main::25 x(w5 w4))) w5) w4) } -::day_21::main::26 { x(_ 2) } +::day_21::main::25 { x(_ 2) } -::day_21::main::27 { x(@sub(49 @add(3 w2)) w2) } +::day_21::main::26 { x(@sub(49 @add(3 w2)) w2) } ::day_21::control_string { fn(w2 fn(w3 fn(w4 fn(w5 w13)))) @@ -113,7 +113,7 @@ } ::day_21::control_string::5 { - enum(dup135(w10 w17) x(w7 x(w6 x(dup129(@n32_and(1 @ne(0 w13)) @div(2 w20)) x(dup131(fn(w7 fn(w10 fn(w13 w14))) w23) x(w3 w22)))))) + enum(dup134(w10 w17) x(w7 x(w6 x(dup128(@n32_and(1 @ne(0 w13)) @div(2 w20)) x(dup130(fn(w7 fn(w10 fn(w13 w14))) w23) x(w3 w22)))))) ::std::list::List::concat = fn(w3 fn(w14 w16)) ::day_21::control_string::2 = x(w17 x(w6 x(w20 x(w23 x(w16 w22))))) } @@ -121,7 +121,7 @@ ::day_21::control_string::6 { x(_ x(_ x(_ x(_ x(w1 w1))))) } ::day_21::control_numeric { - fn(w2 fn(w3 fn(?(::day_21::control_numeric::11 ::day_21::control_numeric::10 x(w58 x(w57 x(w56 x(w55 dup140(?(::day_21::control_numeric::26 ::day_21::control_numeric::25 x(w65 x(w64 x(x(tup(0 tup(w59 w59)) w63) _)))) ?(::day_21::control_numeric::29 ::day_21::control_numeric::28 x(w71 x(w70 x(x(w45 w69) _)))))))))) w49))) + fn(w2 fn(w3 fn(?(::day_21::control_numeric::10 ::day_21::control_numeric::9 x(w58 x(w57 x(w56 x(w55 dup139(?(::day_21::control_numeric::25 ::day_21::control_numeric::24 x(w65 x(w64 x(x(tup(0 tup(w59 w59)) w63) _)))) ?(::day_21::control_numeric::28 ::day_21::control_numeric::27 x(w71 x(w70 x(x(w45 w69) _)))))))))) w49))) ::day_21::pos_diff = fn(w34 fn(w35 w36)) ::std::list::List::new = fn(w36 fn(118 w37)) ::std::list::List::concat = fn(w63 fn(w37 w39)) @@ -130,41 +130,41 @@ ::std::list::List::concat = fn(w39 fn(w43 w45)) ::std::list::List::concat = fn(w69 fn(tup(1 tup(tup(65 w72) w72)) w49)) tup(0 tup(w50 w50)) = _ - ::day_21::control_numeric::2 = fn(w2 dup142(@rem(3 dup144(w58 dup144(w65 w71))) @div(3 dup145(w57 dup145(w34 w41))))) - ::day_21::control_numeric::2 = fn(w3 dup143(@rem(3 dup146(w56 dup146(w64 w70))) @div(3 dup147(w55 dup147(w35 w40))))) + ::day_21::control_numeric::2 = fn(w2 dup141(@rem(3 dup143(w58 dup143(w65 w71))) @div(3 dup144(w57 dup144(w34 w41))))) + ::day_21::control_numeric::2 = fn(w3 dup142(@rem(3 dup145(w56 dup145(w64 w70))) @div(3 dup146(w55 dup146(w35 w40))))) } -::day_21::control_numeric::2 { fn(dup161(@eq(48 ?(::day_21::control_numeric::5 ::day_21::control_numeric::4 x(w8 w7))) w8) w7) } +::day_21::control_numeric::2 { fn(dup160(@eq(48 ?(::day_21::control_numeric::5 ::day_21::control_numeric::4 x(w8 w7))) w8) w7) } ::day_21::control_numeric::4 { x(_ 1) } -::day_21::control_numeric::5 { x(dup166(@eq(65 ?(::day_21::control_numeric::8 ::day_21::control_numeric::7 x(w6 w5))) w6) w5) } +::day_21::control_numeric::5 { x(dup165(@eq(65 ?(::day_21::control_numeric::7 ::day_21::control_numeric::6 x(w5 w4))) w5) w4) } -::day_21::control_numeric::7 { x(_ 2) } +::day_21::control_numeric::6 { x(_ 2) } -::day_21::control_numeric::8 { x(@sub(49 @add(3 w2)) w2) } +::day_21::control_numeric::7 { x(@sub(49 @add(3 w2)) w2) } -::day_21::control_numeric::10 { +::day_21::control_numeric::9 { x(_ x(w3 x(w2 x(_ w5)))) - ::day_21::control_numeric::17 = x(w3 x(w2 w5)) + ::day_21::control_numeric::16 = x(w3 x(w2 w5)) } -::day_21::control_numeric::11 { x(?(::day_21::control_numeric::13 ::day_21::control_numeric::12 w4) w4) } +::day_21::control_numeric::10 { x(?(::day_21::control_numeric::12 ::day_21::control_numeric::11 w4) w4) } -::day_21::control_numeric::12 { x(_ x(_ x(_ 0))) } +::day_21::control_numeric::11 { x(_ x(_ x(_ 0))) } -::day_21::control_numeric::13 { x(w4 x(w3 x(?(::day_21::control_numeric::17 ::day_21::control_numeric::14 x(w4 x(w3 w5))) w5))) } +::day_21::control_numeric::12 { x(w4 x(w3 x(?(::day_21::control_numeric::16 ::day_21::control_numeric::13 x(w4 x(w3 w5))) w5))) } -::day_21::control_numeric::14 { x(_ x(_ 0)) } +::day_21::control_numeric::13 { x(_ x(_ 0)) } -::day_21::control_numeric::17 { x(?(::day_21::control_numeric::19 ::day_21::control_numeric::18 w2) w2) } +::day_21::control_numeric::16 { x(?(::day_21::control_numeric::18 ::day_21::control_numeric::17 w2) w2) } -::day_21::control_numeric::18 { x(_ 1) } +::day_21::control_numeric::17 { x(_ 1) } -::day_21::control_numeric::19 { x(?(0 1 w3) w3) } +::day_21::control_numeric::18 { x(?(0 1 w3) w3) } -::day_21::control_numeric::25 { - x(dup200(w1 w6) x(dup201(w0 w7) x(x(w14 w11) _))) +::day_21::control_numeric::24 { + x(dup198(w1 w6) x(dup199(w0 w7) x(x(w14 w11) _))) ::day_21::pos_diff = fn(w0 fn(w1 w2)) ::std::list::List::new = fn(w2 fn(62 w3)) ::std::list::List::concat = fn(w14 fn(w3 w5)) @@ -173,12 +173,12 @@ ::std::list::List::concat = fn(w5 fn(w9 w11)) } -::day_21::control_numeric::26 { x(_ x(_ x(x(w2 w2) _))) } +::day_21::control_numeric::25 { x(_ x(_ x(x(w2 w2) _))) } -::day_21::control_numeric::28 { x(_ x(_ x(x(w2 w2) _))) } +::day_21::control_numeric::27 { x(_ x(_ x(x(w2 w2) _))) } -::day_21::control_numeric::29 { - x(dup210(w1 w6) x(dup211(w0 w7) x(x(w14 w11) _))) +::day_21::control_numeric::28 { + x(dup206(w1 w6) x(dup207(w0 w7) x(x(w14 w11) _))) ::day_21::pos_diff = fn(w0 fn(w1 w2)) ::std::list::List::new = fn(w2 fn(62 w3)) ::std::list::List::concat = fn(w14 fn(w3 w5)) @@ -203,25 +203,25 @@ ::std::list::List::concat = fn(w47 fn(w51 w53)) ::std::list::List::concat = fn(w53 fn(tup(1 tup(tup(65 w61) w61)) w56)) tup(0 tup(w57 w57)) = _ - ::day_21::control_directional::2 = fn(w2 dup218(@rem(3 dup220(w36 w43)) @div(3 dup221(w30 w49)))) - ::day_21::control_directional::2 = fn(w3 dup219(@rem(3 dup222(w37 w42)) @div(3 dup223(w31 w48)))) + ::day_21::control_directional::2 = fn(w2 dup214(@rem(3 dup216(w36 w43)) @div(3 dup217(w30 w49)))) + ::day_21::control_directional::2 = fn(w3 dup215(@rem(3 dup218(w37 w42)) @div(3 dup219(w31 w48)))) } -::day_21::control_directional::2 { fn(dup234(@eq(60 ?(::day_21::control_directional::5 ::day_21::control_directional::4 x(w8 w7))) w8) w7) } +::day_21::control_directional::2 { fn(dup230(@eq(60 ?(::day_21::control_directional::5 ::day_21::control_directional::4 x(w8 w7))) w8) w7) } ::day_21::control_directional::4 { x(_ 0) } -::day_21::control_directional::5 { x(dup239(@eq(118 ?(::day_21::control_directional::8 ::day_21::control_directional::7 x(w6 w5))) w6) w5) } +::day_21::control_directional::5 { x(dup235(@eq(118 ?(::day_21::control_directional::7 ::day_21::control_directional::6 x(w5 w4))) w5) w4) } -::day_21::control_directional::7 { x(_ 1) } +::day_21::control_directional::6 { x(_ 1) } -::day_21::control_directional::8 { x(dup243(@eq(62 ?(::day_21::control_directional::11 ::day_21::control_directional::10 x(w6 w5))) w6) w5) } +::day_21::control_directional::7 { x(dup238(@eq(62 ?(::day_21::control_directional::9 ::day_21::control_directional::8 x(w5 w4))) w5) w4) } -::day_21::control_directional::10 { x(_ 2) } +::day_21::control_directional::8 { x(_ 2) } -::day_21::control_directional::11 { x(@eq(94 ?(5 4 w5)) w5) } +::day_21::control_directional::9 { x(@eq(94 ?(5 4 w4)) w4) } -::day_21::pos_diff { fn(dup252(w8 w12) fn(dup253(@lt$(w8 ?(::day_21::pos_diff::4 ::day_21::pos_diff::3 x(w12 x(w11 w10)))) w11) w10)) } +::day_21::pos_diff { fn(dup245(w8 w12) fn(dup246(@lt$(w8 ?(::day_21::pos_diff::4 ::day_21::pos_diff::3 x(w12 x(w11 w10)))) w11) w10)) } ::day_21::pos_diff::3 { x(_ x(_ 0)) } @@ -234,26 +234,26 @@ } ::day_21::cost_func { - fn(w2 fn(dup266(w7 dup266(w8 w18)) fn(w4 w16))) + fn(w2 fn(dup259(w7 dup259(w8 w18)) fn(w4 w16))) ::std::array::Array::new = fn(w8 fn(_ w9)) ::std::array::Array::new = fn(w7 fn(w9 w10)) ::day_21::cost_func::2 = x(w2 x(w18 x(w4 x(x(w10 w16) 0)))) } -::day_21::cost_func::2 { x(w8 x(dup275(w1 w13) x(w6 x(w5 dup279(@lt(w1 ?(::day_21::cost_func::4 ::day_21::cost_func::3 x(w8 x(w13 x(w6 x(w5 w9)))))) w9))))) } +::day_21::cost_func::2 { x(w8 x(dup268(w1 w13) x(w6 x(w5 dup272(@lt(w1 ?(::day_21::cost_func::4 ::day_21::cost_func::3 x(w8 x(w13 x(w6 x(w5 w9)))))) w9))))) } ::day_21::cost_func::3 { - x(w8 x(dup282(w14 w21) x(dup283(w13 w20) x(x(w5 w19) dup287(w10 @add(1 w2)))))) + x(w8 x(dup275(w14 w21) x(dup276(w13 w20) x(x(w5 w19) dup280(w10 @add(1 w2)))))) ::day_21::cost_func::5 = x(x(w8 w16) x(w14 x(w13 x(x(w5 w12) x(w10 0))))) ::day_21::cost_func::2 = x(w16 x(w21 x(w20 x(x(w12 w19) w2)))) } ::day_21::cost_func::4 { x(_ x(_ x(_ x(x(w2 w2) _)))) } -::day_21::cost_func::5 { x(w10 x(dup293(w1 w16) x(w7 x(w6 x(w4 dup298(@lt(w1 ?(::day_21::cost_func::7 ::day_21::cost_func::6 x(w10 x(w16 x(w7 x(w6 x(w4 w11))))))) w11)))))) } +::day_21::cost_func::5 { x(w10 x(dup286(w1 w16) x(w7 x(w6 x(w4 dup291(@lt(w1 ?(::day_21::cost_func::7 ::day_21::cost_func::6 x(w10 x(w16 x(w7 x(w6 x(w4 w11))))))) w11)))))) } ::day_21::cost_func::6 { - x(x(w28 w48) x(w26 x(dup304(w32 dup304(w38 w45)) x(x(w24 w44) x(dup308(w31 dup308(w37 dup308(w10 w42))) dup309(w30 dup309(w36 dup309(w15 @add(1 w20))))))))) + x(x(w28 w48) x(w26 x(dup297(w32 dup297(w38 w45)) x(x(w24 w44) x(dup301(w31 dup301(w37 dup301(w10 w42))) dup302(w30 dup302(w36 dup302(w15 @add(1 w20))))))))) ::day_21::cost_func::8 = x(x(w28 w34) x(w32 x(w31 x(w30 fn(1 w1))))) ::day_21::cost_func::8 = x(x(w34 w40) x(w38 x(w37 x(w36 fn(0 w3))))) ::std::n64::N64::min = fn(w1 fn(w3 w4)) @@ -265,24 +265,24 @@ ::day_21::cost_func::7 { x(x(w7 w7) x(_ x(_ x(x(w3 w3) _)))) } ::day_21::cost_func::8 { - x(x(w28 w54) x(w26 x(dup320(@rem(3 dup326(w34 w43)) @div(3 dup327(w33 w42))) x(dup321(@rem(3 dup328(w32 w41)) @div(3 dup329(w31 w40))) fn(?(::day_21::cost_func::26 ::day_21::cost_func::25 x(w26 x(w34 x(w33 x(w32 x(w31 ?(::day_21::cost_func::41 ::day_21::cost_func::40 x(x(w28 w47) x(x(0 w45) x(w43 x(w42 x(w41 x(w40 x(x(5 w39) _)))))))))))))) w52))))) + x(x(w28 w54) x(w26 x(dup313(@rem(3 dup319(w34 w43)) @div(3 dup320(w33 w42))) x(dup314(@rem(3 dup321(w32 w41)) @div(3 dup322(w31 w40))) fn(?(::day_21::cost_func::26 ::day_21::cost_func::25 x(w26 x(w34 x(w33 x(w32 x(w31 ?(::day_21::cost_func::41 ::day_21::cost_func::40 x(x(w28 w47) x(x(0 w45) x(w43 x(w42 x(w41 x(w40 x(x(5 w39) _)))))))))))))) w52))))) ::day_21::cost_func::9 = x(x(w47 w54) x(x(w45 w52) x(x(w39 _) fn(5 _)))) } ::day_21::cost_func::9 { - x(x(w27 w5) x(x(w25 w17) x(x(w23 w19) fn(dup345(w12 w19) _)))) + x(x(w27 w5) x(x(w25 w17) x(x(w23 w19) fn(dup338(w12 w19) _)))) ::std::array::Array::get = fn(ref(w27 w5) fn(w23 w9)) - ::std::array::Array::get = fn(w9 fn(w12 ref(dup338(w16 w15) w15))) + ::std::array::Array::get = fn(w9 fn(w12 ref(dup331(w16 w15) w15))) ::std::n64::N64::add = fn(w25 fn(w16 w17)) } ::day_21::cost_func::10 { - x(x(w10 w27) x(x(w8 w25) x(w6 x(dup356(w13 w22) x(x(w4 w21) _))))) + x(x(w10 w27) x(x(w8 w25) x(w6 x(dup349(w13 w22) x(x(w4 w21) _))))) ::day_21::cost_func::11 = x(x(w10 w19) x(x(w8 w17) x(x(w6 w15) x(w13 x(w4 w12))))) ::day_21::cost_func::14 = x(x(w19 w27) x(x(w17 w25) x(w15 x(w22 x(w12 w21))))) } -::day_21::cost_func::11 { x(w11 x(w9 x(x(dup367(@lt(w1 ?(::day_21::cost_func::13 ::day_21::cost_func::12 x(w11 x(w9 x(x(w15 w16) x(w14 w4)))))) w15) w16) x(dup368(w1 w14) w4)))) } +::day_21::cost_func::11 { x(w11 x(w9 x(x(dup360(@lt(w1 ?(::day_21::cost_func::13 ::day_21::cost_func::12 x(w11 x(w9 x(x(w15 w16) x(w14 w4)))))) w15) w16) x(dup361(w1 w14) w4)))) } ::day_21::cost_func::12 { x(x(w12 w28) x(x(w10 w26) x(x(@add(1 w3) w24) x(w6 x(w5 w21))))) @@ -292,7 +292,7 @@ ::day_21::cost_func::13 { x(x(w8 w8) x(x(w6 w6) x(x(w4 w4) x(_ x(w1 w1))))) } -::day_21::cost_func::14 { x(w10 x(w8 x(dup393(@lt$(w1 ?(::day_21::cost_func::16 ::day_21::cost_func::15 x(w10 x(w8 x(w14 x(w13 w4)))))) w14) x(dup394(w1 w13) w4)))) } +::day_21::cost_func::14 { x(w10 x(w8 x(dup386(@lt$(w1 ?(::day_21::cost_func::16 ::day_21::cost_func::15 x(w10 x(w8 x(w14 x(w13 w4)))))) w14) x(dup387(w1 w13) w4)))) } ::day_21::cost_func::15 { x(x(w11 w26) x(x(w9 w24) x(@sub(1 w3) x(w6 x(w5 w20))))) @@ -303,12 +303,12 @@ ::day_21::cost_func::16 { x(x(w7 w7) x(x(w5 w5) x(_ x(_ x(w1 w1))))) } ::day_21::cost_func::17 { - x(x(w10 w27) x(x(w8 w25) x(w6 x(dup421(w13 w22) x(x(w4 w21) _))))) + x(x(w10 w27) x(x(w8 w25) x(w6 x(dup414(w13 w22) x(x(w4 w21) _))))) ::day_21::cost_func::18 = x(x(w10 w19) x(x(w8 w17) x(x(w6 w15) x(w13 x(w4 w12))))) ::day_21::cost_func::21 = x(x(w19 w27) x(x(w17 w25) x(w15 x(w22 x(w12 w21))))) } -::day_21::cost_func::18 { x(w11 x(w9 x(x(dup432(@lt(w1 ?(::day_21::cost_func::20 ::day_21::cost_func::19 x(w11 x(w9 x(x(w15 w16) x(w14 w4)))))) w15) w16) x(dup433(w1 w14) w4)))) } +::day_21::cost_func::18 { x(w11 x(w9 x(x(dup425(@lt(w1 ?(::day_21::cost_func::20 ::day_21::cost_func::19 x(w11 x(w9 x(x(w15 w16) x(w14 w4)))))) w15) w16) x(dup426(w1 w14) w4)))) } ::day_21::cost_func::19 { x(x(w12 w28) x(x(w10 w26) x(x(@add(1 w3) w24) x(w6 x(w5 w21))))) @@ -318,7 +318,7 @@ ::day_21::cost_func::20 { x(x(w8 w8) x(x(w6 w6) x(x(w4 w4) x(_ x(w1 w1))))) } -::day_21::cost_func::21 { x(w10 x(w8 x(dup458(@lt$(w1 ?(::day_21::cost_func::23 ::day_21::cost_func::22 x(w10 x(w8 x(w14 x(w13 w4)))))) w14) x(dup459(w1 w13) w4)))) } +::day_21::cost_func::21 { x(w10 x(w8 x(dup451(@lt$(w1 ?(::day_21::cost_func::23 ::day_21::cost_func::22 x(w10 x(w8 x(w14 x(w13 w4)))))) w14) x(dup452(w1 w13) w4)))) } ::day_21::cost_func::22 { x(x(w11 w26) x(x(w9 w24) x(@sub(1 w3) x(w6 x(w5 w20))))) @@ -337,7 +337,7 @@ ::day_21::cost_func::27 { x(_ x(_ x(_ x(_ 0)))) } -::day_21::cost_func::28 { x(dup489(w1 w11) x(w6 x(w5 x(@eq(w1 ?(::day_21::cost_func::30 ::day_21::cost_func::32 x(w11 x(w6 x(w5 w8))))) w8)))) } +::day_21::cost_func::28 { x(dup482(w1 w11) x(w6 x(w5 x(@eq(w1 ?(::day_21::cost_func::30 ::day_21::cost_func::32 x(w11 x(w6 x(w5 w8))))) w8)))) } ::day_21::cost_func::30 { x(_ x(_ x(_ 0))) } @@ -360,20 +360,20 @@ } ::std::array::Array::new { - fn(dup548(w6 w7) fn(w3 tup(w6 w9))) + fn(dup541(w6 w7) fn(w3 tup(w6 w9))) ::std::array::Node::new = fn(w7 fn(w3 w9)) } ::std::array::Array::get { - fn(ref(tup(dup658(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup651(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup669(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup662(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup673(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup666(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } @@ -384,7 +384,7 @@ ::std::array::Node::leaf { fn(x x) } -::std::array::Node::new { fn(dup855(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::array::Node::new { fn(dup844(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::array::Node::new::3 { x(_ x(w3 w1)) @@ -392,7 +392,7 @@ } ::std::array::Node::new::4 { - x(dup863(@add(1 @div(2 w2)) @div(2 w6)) x(dup864(w3 w7) tup(w4 w8))) + x(dup852(@add(1 @div(2 w2)) @div(2 w6)) x(dup853(w3 w7) tup(w4 w8))) ::std::array::Node::new = fn(w2 fn(w3 w4)) ::std::array::Node::new = fn(w6 fn(w7 w8)) } @@ -414,7 +414,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup1011(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup996(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -433,7 +433,7 @@ ::std::io::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup1105(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::io::IO::read_byte = fn(ref(w9 w1) fn(0 dup1090(@ne(0 ?(::std::io::IO::full_input::5 ::std::io::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::io::IO::full_input::4 { @@ -446,24 +446,24 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup1117(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup1102(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::new { fn(w2 fn(w3 w11)) ::std::list::List::new::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::list::List::new::2 { x(dup1130(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } +::std::list::List::new::2 { x(dup1115(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } ::std::list::List::new::3 { - x(@sub(1 w6) x(dup1136(w3 w13) x(w8 w12))) + x(@sub(1 w6) x(dup1121(w3 w13) x(w8 w12))) ::std::list::List::push_back = fn(ref(w8 w1) fn(w3 _)) ::std::list::List::new::2 = x(w6 x(w13 x(w1 w12))) } ::std::list::List::new::4 { x(_ x(_ x(w1 w1))) } -::std::list::List::pop_front { fn(ref(tup(dup1214(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup1199(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -479,9 +479,9 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::list::List::iter { fn(ref(tup(dup1374(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup1359(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup1381(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup1366(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -494,7 +494,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1410(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1395(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -509,20 +509,20 @@ } ::std::list::List::split_trim::2 { - x(w24 x(dup1482(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup1467(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::list::List::split_once = fn(w24 fn(w1 tup(w3 enum(::std::list::List::split_trim::24 enum(::std::list::List::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1493(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1486(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1488(w20 w31)))))) + ::std::list::List::len = fn(ref(w3 w7) @eq(0 dup1478(?(::std::list::List::split_trim::5 ::std::list::List::split_trim::4 x(w21 dup1471(?(::std::list::List::split_trim::11 ::std::list::List::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::list::List::split_trim::17 ::std::list::List::split_trim::16 x(w36 dup1473(w20 w31)))))) } ::std::list::List::split_trim::4 { x(?(0 1 w3) w3) } ::std::list::List::split_trim::5 { x(_ 0) } -::std::list::List::split_trim::10 { x(x(w4 w4) x(_ x(_ _))) } +::std::list::List::split_trim::10 { x(x(w4 w4) _) } ::std::list::List::split_trim::11 { x(w5 x(?(::std::list::List::split_trim::13 ::std::list::List::split_trim::12 x(w5 w2)) w2)) } -::std::list::List::split_trim::12 { x(x(w3 w3) x(_ _)) } +::std::list::List::split_trim::12 { x(x(w3 w3) _) } ::std::list::List::split_trim::13 { x(x(w7 w3) x(w5 _)) @@ -566,7 +566,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1576(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1558(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -575,7 +575,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1590(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1572(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -607,7 +607,7 @@ ::std::list::List::concat = fn(w14 fn(w13 w10)) } -::std::n32::N32::to_string { fn(dup2704(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2676(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -616,10 +616,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2714(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2686(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2717(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2689(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -627,7 +627,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2724(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2696(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -639,10 +639,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2735(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2707(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2744(dup2739(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2716(dup2711(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -661,7 +661,7 @@ ::std::n32::N32::parse::11 { x(w8 w8) } -::std::n32::N32::min { fn(dup2785(@lt(w8 ?(::std::n32::N32::min::4 ::std::n32::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2786(w8 w11) w10)) } +::std::n32::N32::min { fn(dup2755(@lt(w8 ?(::std::n32::N32::min::4 ::std::n32::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2756(w8 w11) w10)) } ::std::n32::N32::min::3 { x(w3 x(_ w3)) } @@ -680,19 +680,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2950(@div(w9 w10) @rem(w12 dup2951(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2953(w9 dup2953(w12 dup2953(w31 dup2953(w36 dup2953(w41 dup2953(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2949(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2916(@div(w9 w10) @rem(w12 dup2917(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2919(w9 dup2919(w12 dup2919(w31 dup2919(w36 dup2919(w41 dup2919(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2915(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2964(@div(w1 w2) @rem(w4 w6)) w6) x(dup2965(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2930(@div(w1 w2) @rem(w4 w6)) w6) x(dup2931(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2973(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2938(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2980(w2 w9) x(dup2982(w0 dup2982(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2986(w5 w11))) + x(x(w27 w33) x(dup2945(w2 w9) x(dup2947(w0 dup2947(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2951(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -706,7 +706,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } -::std::n64::N64::le { fn(tup(w2 dup3078(@lt(w12 ?(::std::n64::N64::le::4 ::std::n64::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup3080(w12 w15)) w14)) } +::std::n64::N64::le { fn(tup(w2 dup3043(@lt(w12 ?(::std::n64::N64::le::4 ::std::n64::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup3045(w12 w15)) w14)) } ::std::n64::N64::le::3 { x(_ x(_ x(_ x(_ 1)))) } @@ -717,7 +717,7 @@ ::std::n64::N64::le::6 { x(_ x(_ 0)) } ::std::n64::N64::min { - fn(dup3143(w7 w12) fn(dup3144(w8 w11) w10)) + fn(dup3108(w7 w12) fn(dup3109(w8 w11) w10)) ::std::n64::N64::le = fn(w7 fn(w8 ?(::std::n64::N64::min::4 ::std::n64::N64::min::3 x(w12 x(w11 w10))))) } @@ -726,7 +726,7 @@ ::std::n64::N64::min::4 { x(_ x(w2 w2)) } ::std::n64::N64::to_string { - fn(dup3231(w6 w9) w8) + fn(dup3194(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -738,7 +738,7 @@ } ::std::n64::N64::to_string::5 { - x(dup3241(w0 w7) w3) + x(dup3204(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } diff --git a/tests/snaps/vine/aoc_2024/day_21/stats.txt b/tests/snaps/vine/aoc_2024/day_21/stats.txt index 25095036..cb69e29e 100644 --- a/tests/snaps/vine/aoc_2024/day_21/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_21/stats.txt @@ -1,9 +1,9 @@ Interactions Total 2_357_636 - Annihilate 1_238_480 + Annihilate 1_238_479 Commute 8_274 - Copy 231_638 + Copy 231_639 Erase 205_326 Expand 291_338 Call 258_806 @@ -11,5 +11,5 @@ Interactions Memory Heap 11_920 B - Allocated 49_931_120 B - Freed 49_931_120 B + Allocated 49_931_104 B + Freed 49_931_104 B diff --git a/tests/snaps/vine/aoc_2024/day_22/compiled.iv b/tests/snaps/vine/aoc_2024/day_22/compiled.iv index 5ded66d1..618a9743 100644 --- a/tests/snaps/vine/aoc_2024/day_22/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_22/compiled.iv @@ -72,7 +72,7 @@ ::day_22::main::20 { x(x(w2 w2) _) } -::day_22::evolve { fn(ref(dup123(@n32_xor(w9 @n32_and(16777215 dup124(@n32_xor(w15 @n32_and(16777215 dup125(@n32_xor(w21 @n32_and(16777215 w23)) @n32_shl(11 w21)))) @n32_shr(5 w15)))) @n32_shl(6 w9)) w23) _) } +::day_22::evolve { fn(ref(dup121(@n32_xor(w9 @n32_and(16777215 dup122(@n32_xor(w15 @n32_and(16777215 dup123(@n32_xor(w21 @n32_and(16777215 w23)) @n32_shl(11 w21)))) @n32_shr(5 w15)))) @n32_shl(6 w9)) w23) _) } ::std::io::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -85,7 +85,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup597(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup587(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -99,11 +99,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup642(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup632(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup649(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup639(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -118,7 +118,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup666(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup656(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -131,7 +131,7 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::pop_front { fn(ref(tup(dup800(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup790(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -155,10 +155,10 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } -::std::map::Map::len { fn(ref(tup(w2 tup(dup1417(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } +::std::map::Map::len { fn(ref(tup(w2 tup(dup1399(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } ::std::map::Map::get_or_insert { - fn(ref(tup(dup1429(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1411(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::option::Option::unwrap_or = fn(w20 fn(w10 w24)) } @@ -190,7 +190,7 @@ ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1670(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1649(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -198,10 +198,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1683(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1662(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1698(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1677(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -273,18 +273,18 @@ } ::std::map::is_balanced { - fn(ref(tup(dup2274(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2275(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2251(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2252(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2279(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2280(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2256(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2257(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2284(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2285(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2261(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2262(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } -::std::n32::N32::to_string { fn(dup2290(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2267(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -293,10 +293,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2300(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2277(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2303(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2280(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -304,7 +304,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2310(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2287(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -316,10 +316,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2321(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2298(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2330(dup2325(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2307(dup2302(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -338,13 +338,13 @@ ::std::n32::N32::parse::11 { x(w8 w8) } -::std::n32::N32::cmp { fn(ref(dup2358(w2 dup2358(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2359(w5 dup2359(w12 w15)) w5) w14)) } +::std::n32::N32::cmp { fn(ref(dup2334(w2 dup2334(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2335(w5 dup2335(w12 w15)) w5) w14)) } ::std::n32::N32::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::n32::N32::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::n32::N32::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } -::std::n32::N32::max { fn(dup2381(@lt$(w8 ?(::std::n32::N32::max::4 ::std::n32::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2382(w8 w11) w10)) } +::std::n32::N32::max { fn(dup2356(@lt$(w8 ?(::std::n32::N32::max::4 ::std::n32::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2357(w8 w11) w10)) } ::std::n32::N32::max::3 { x(w3 x(_ w3)) } @@ -359,19 +359,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2536(@div(w9 w10) @rem(w12 dup2537(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2539(w9 dup2539(w12 dup2539(w31 dup2539(w36 dup2539(w41 dup2539(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2535(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2507(@div(w9 w10) @rem(w12 dup2508(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2510(w9 dup2510(w12 dup2510(w31 dup2510(w36 dup2510(w41 dup2510(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2506(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2550(@div(w1 w2) @rem(w4 w6)) w6) x(dup2551(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2521(@div(w1 w2) @rem(w4 w6)) w6) x(dup2522(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2559(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2529(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2566(w2 w9) x(dup2568(w0 dup2568(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2572(w5 w11))) + x(x(w27 w33) x(dup2536(w2 w9) x(dup2538(w0 dup2538(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2542(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -386,7 +386,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } ::std::n64::N64::to_string { - fn(dup2817(w6 w9) w8) + fn(dup2785(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -398,7 +398,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2827(w0 w7) w3) + x(dup2795(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } diff --git a/tests/snaps/vine/aoc_2024/day_23/compiled.iv b/tests/snaps/vine/aoc_2024/day_23/compiled.iv index 5c89b914..08c81af8 100644 --- a/tests/snaps/vine/aoc_2024/day_23/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_23/compiled.iv @@ -2,23 +2,23 @@ ::main { ::day_23::main } ::day_23::main { - fn(ref(w3 w32) _) + fn(ref(w3 w13) _) ::std::map::Map::new = fn(::std::n32::N32::cmp w7) - ::day_23::main::2 = x(x(w3 w45) x(w7 dup7(w9 w56))) - ::day_23::main::10 = x(w9 x(x(0 w49) x(0 w47))) - ::std::n32::N32::to_string = fn(w49 w18) - ::std::list::List::concat = fn(tup(11 tup(tup(84 tup(114 tup(105 tup(97 tup(110 tup(103 tup(108 tup(101 tup(115 tup(58 tup(32 w51))))))))))) w51)) fn(w18 w19)) - ::std::io::IO::println = fn(ref(w45 w14) fn(w19 _)) - ::std::n32::N32::to_string = fn(w47 w26) - ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w52)))))))) w52)) fn(w26 w27)) - ::std::io::IO::println = fn(ref(w14 w22) fn(w27 _)) - ::day_23::main::47 = x(w56 x(tup(0 tup(w53 w53)) w55)) - 97 = @add(w62 w63) - 97 = @add(w65 w66) - ::std::list::List::map = fn(w55 fn(fn(dup15(@div(26 w62) @rem(26 w65)) tup(2 tup(tup(w63 tup(w66 w68)) w68))) w37)) - ::std::list::List::join = fn(w37 fn(tup(1 tup(tup(44 w69) w69)) w39)) - ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(50 tup(58 tup(32 w57)))))))) w57)) fn(w39 w40)) - ::std::io::IO::println = fn(ref(w22 w32) fn(w40 _)) + ::day_23::main::2 = x(x(w3 w26) x(w7 dup7(w27 w57))) + ::day_23::main::11 = x(w27 x(x(0 w50) x(0 w48))) + ::std::n32::N32::to_string = fn(w50 w36) + ::std::list::List::concat = fn(tup(11 tup(tup(84 tup(114 tup(105 tup(97 tup(110 tup(103 tup(108 tup(101 tup(115 tup(58 tup(32 w52))))))))))) w52)) fn(w36 w37)) + ::std::io::IO::println = fn(ref(w26 w32) fn(w37 _)) + ::std::n32::N32::to_string = fn(w48 w44) + ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w53)))))))) w53)) fn(w44 w45)) + ::std::io::IO::println = fn(ref(w32 w40) fn(w45 _)) + ::day_23::main::48 = x(w57 x(tup(0 tup(w54 w54)) w56)) + 97 = @add(w63 w64) + 97 = @add(w66 w67) + ::std::list::List::map = fn(w56 fn(fn(dup15(@div(26 w63) @rem(26 w66)) tup(2 tup(tup(w64 tup(w67 w69)) w69))) w18)) + ::std::list::List::join = fn(w18 fn(tup(1 tup(tup(44 w70) w70)) w20)) + ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(50 tup(58 tup(32 w58)))))))) w58)) fn(w20 w21)) + ::std::io::IO::println = fn(ref(w40 w13) fn(w21 _)) } ::day_23::main::2 { @@ -29,12 +29,12 @@ ::day_23::main::5 { enum(w0 x(w5 x(w3 w62))) ::std::list::List::pop_front = fn(ref(w0 w7) w9) - ::std::option::Option::unwrap = fn(w9 @sub(97 @mul(26 @add(w18 dup38(@lt$(w54 ?(::day_23::main::9 ::day_23::main::8 x(x(w59 w60) x(x(w57 w58) _)))) w59))))) + ::std::option::Option::unwrap = fn(w9 @sub(97 @mul(26 @add(w18 dup39(@lt$(w54 ?(::day_23::main::9 ::day_23::main::8 x(x(w59 w60) x(x(w57 w58) _)))) w59))))) ::std::list::List::pop_front = fn(ref(w7 w14) w16) ::std::option::Option::unwrap = fn(w16 @sub(97 w18)) ::std::list::List::pop_front = fn(ref(w14 w22) _) ::std::list::List::pop_front = fn(ref(w22 w26) w28) - ::std::option::Option::unwrap = fn(w28 @sub(97 @mul(26 @add(w37 dup40(w54 w57))))) + ::std::option::Option::unwrap = fn(w28 @sub(97 @mul(26 @add(w37 dup41(w54 w57))))) ::std::list::List::pop_front = fn(ref(w26 _) w35) ::std::option::Option::unwrap = fn(w35 @sub(97 w37)) ::std::map::Map::new = fn(::std::n32::N32::cmp w45) @@ -52,93 +52,93 @@ ::day_23::main::9 { x(x(w4 w4) x(x(w2 w2) _)) } -::day_23::main::10 { +::day_23::main::11 { x(w9 w8) - ::std::map::Map::remove_min = fn(ref(w9 w1) enum(::day_23::main::13 enum(::day_23::main::14 x(w1 w8)))) + ::std::map::Map::remove_min = fn(ref(w9 w1) enum(::day_23::main::14 enum(::day_23::main::15 x(w1 w8)))) } -::day_23::main::13 { +::day_23::main::14 { enum(tup(w2 w3) x(w10 x(x(w9 w22) x(w7 w20)))) - ::day_23::main::15 = x(x(w10 w18) x(x(w9 w16) x(x(w7 w14) x(w2 w3)))) - ::day_23::main::10 = x(w18 x(x(w16 w22) x(w14 w20))) + ::day_23::main::16 = x(x(w10 w18) x(x(w9 w16) x(x(w7 w14) x(w2 w3)))) + ::day_23::main::11 = x(w18 x(x(w16 w22) x(w14 w20))) } -::day_23::main::14 { x(_ x(x(w3 w3) x(w1 w1))) } +::day_23::main::15 { x(_ x(x(w3 w3) x(w1 w1))) } -::day_23::main::15 { +::day_23::main::16 { x(w12 x(w10 x(w8 x(w6 w5)))) - ::std::map::Map::remove_min = fn(ref(w5 w1) enum(::day_23::main::18 enum(::day_23::main::19 x(w12 x(w10 x(w8 x(w6 w1))))))) + ::std::map::Map::remove_min = fn(ref(w5 w1) enum(::day_23::main::19 enum(::day_23::main::20 x(w12 x(w10 x(w8 x(w6 w1))))))) } -::day_23::main::18 { +::day_23::main::19 { enum(tup(w2 _) x(x(w12 w35) x(x(w10 w33) x(x(w8 w31) x(dup94(w21 w29) dup95(w15 w28)))))) - ::day_23::main::20 = x(x(w12 w27) x(x(w10 w25) x(x(w8 w23) x(w21 x(w2 x(tup(0 tup(w17 w17)) w15)))))) - ::day_23::main::15 = x(x(w27 w35) x(x(w25 w33) x(x(w23 w31) x(w29 w28)))) + ::day_23::main::21 = x(x(w12 w27) x(x(w10 w25) x(x(w8 w23) x(w21 x(w2 x(tup(0 tup(w17 w17)) w15)))))) + ::day_23::main::16 = x(x(w27 w35) x(x(w25 w33) x(x(w23 w31) x(w29 w28)))) } -::day_23::main::19 { x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) _))) } +::day_23::main::20 { x(x(w7 w7) x(x(w5 w5) x(x(w3 w3) _))) } -::day_23::main::20 { +::day_23::main::21 { x(w14 x(w12 x(w10 x(w8 x(w7 x(w6 w5)))))) - ::std::map::Map::remove_min = fn(ref(w5 w1) enum(::day_23::main::23 enum(::day_23::main::24 x(w14 x(w12 x(w10 x(w8 x(w7 x(w6 w1))))))))) + ::std::map::Map::remove_min = fn(ref(w5 w1) enum(::day_23::main::24 enum(::day_23::main::25 x(w14 x(w12 x(w10 x(w8 x(w7 x(w6 w1))))))))) } -::day_23::main::23 { +::day_23::main::24 { enum(tup(w2 _) x(x(w14 w49) x(x(w12 w47) x(x(w10 w45) x(dup126(w35 w43) x(w7 x(w6 w5))))))) - ::std::map::Map::get = fn(ref(w14 w19) fn(ref(w7 dup128(w34 w42)) enum(::day_23::main::28 enum(::day_23::main::29 x(x(w2 w28) ?(::day_23::main::37 ::day_23::main::36 x(x(w12 w39) x(x(w10 w37) x(w35 x(w34 x(x(w6 w33) x(w28 _)))))))))))) - ::day_23::main::20 = x(x(w19 w49) x(x(w39 w47) x(x(w37 w45) x(w43 x(w42 x(w33 w5)))))) + ::std::map::Map::get = fn(ref(w14 w19) fn(ref(w7 dup128(w34 w42)) enum(::day_23::main::29 enum(::day_23::main::30 x(x(w2 w28) ?(::day_23::main::38 ::day_23::main::37 x(x(w12 w39) x(x(w10 w37) x(w35 x(w34 x(x(w6 w33) x(w28 _)))))))))))) + ::day_23::main::21 = x(x(w19 w49) x(x(w39 w47) x(x(w37 w45) x(w43 x(w42 x(w33 w5)))))) } -::day_23::main::24 { x(x(w9 w9) x(x(w7 w7) x(x(w5 w5) _))) } +::day_23::main::25 { x(x(w9 w9) x(x(w7 w7) x(x(w5 w5) _))) } -::day_23::main::28 { +::day_23::main::29 { enum(w2 x(x(w6 w11) w15)) - ::std::map::Map::get = fn(w2 fn(ref(w6 w11) enum(::day_23::main::32 enum(0 w15)))) + ::std::map::Map::get = fn(w2 fn(ref(w6 w11) enum(::day_23::main::33 enum(0 w15)))) } -::day_23::main::29 { x(x(w2 w2) 0) } +::day_23::main::30 { x(x(w2 w2) 0) } -::day_23::main::32 { enum(ref(w1 w1) 1) } +::day_23::main::33 { enum(ref(w1 w1) 1) } -::day_23::main::36 { - x(x(@add(1 w5) w5) x(w14 x(@div(26 @eq(19 ?(::day_23::main::40 ::day_23::main::39 x(w14 x(w11 x(w22 w21)))))) x(w11 x(x(w10 w3) x(dup165(w0 w22) w21)))))) +::day_23::main::37 { + x(x(@add(1 w5) w5) x(w14 x(@div(26 @eq(19 ?(::day_23::main::41 ::day_23::main::40 x(w14 x(w11 x(w22 w21)))))) x(w11 x(x(w10 w3) x(dup165(w0 w22) w21)))))) ::std::list::List::concat = fn(w10 fn(tup(1 tup(tup(w0 w17) w17)) w3)) } -::day_23::main::37 { x(x(w9 w9) x(x(w7 w7) x(_ x(_ x(x(w3 w3) _))))) } +::day_23::main::38 { x(x(w9 w9) x(x(w7 w7) x(_ x(_ x(x(w3 w3) _))))) } -::day_23::main::39 { +::day_23::main::40 { x(w4 x(_ x(_ w5))) - ::day_23::main::46 = x(w4 w5) + ::day_23::main::47 = x(w4 w5) } -::day_23::main::40 { x(w7 x(@div(26 @eq(19 ?(::day_23::main::42 ::day_23::main::41 x(w7 w4)))) w4)) } +::day_23::main::41 { x(w7 x(@div(26 @eq(19 ?(::day_23::main::43 ::day_23::main::42 x(w7 w4)))) w4)) } -::day_23::main::41 { +::day_23::main::42 { x(w3 x(_ w4)) - ::day_23::main::46 = x(w3 w4) + ::day_23::main::47 = x(w3 w4) } -::day_23::main::42 { x(w6 x(@div(26 @eq(19 ?(::day_23::main::44 ::day_23::main::46 x(w6 w7)))) w7)) } +::day_23::main::43 { x(w6 x(@div(26 @eq(19 ?(::day_23::main::45 ::day_23::main::47 x(w6 w7)))) w7)) } -::day_23::main::44 { x(x(w2 w2) _) } +::day_23::main::45 { x(x(w2 w2) _) } -::day_23::main::46 { x(x(@add(1 w1) w1) _) } +::day_23::main::47 { x(x(@add(1 w1) w1) _) } -::day_23::main::47 { +::day_23::main::48 { x(w7 w6) - ::std::map::Map::remove_min = fn(ref(w7 w1) enum(::day_23::main::50 enum(::day_23::main::51 x(w1 w6)))) + ::std::map::Map::remove_min = fn(ref(w7 w1) enum(::day_23::main::51 enum(::day_23::main::52 x(w1 w6)))) } -::day_23::main::50 { +::day_23::main::51 { enum(tup(w2 w3) x(w8 x(w7 w29))) ::std::map::Map::to_list = fn(w3 w18) ::std::list::List::map = fn(w18 fn(fn(tup(w23 _) w23) w20)) ::day_23::main::extend_clique = fn(ref(w8 w10) fn(ref(w7 w13) fn(tup(1 tup(tup(w2 w22) w22)) fn(w20 _)))) - ::day_23::main::47 = x(w10 x(w13 w29)) + ::day_23::main::48 = x(w10 x(w13 w29)) } -::day_23::main::51 { x(_ x(w1 w1)) } +::day_23::main::52 { x(_ x(w1 w1)) } ::day_23::main::extend_clique { fn(ref(w3 w23) fn(ref(w6 w21) fn(w8 fn(w9 w17)))) @@ -147,7 +147,7 @@ ::day_23::main::extend_clique::3 { x(w7 x(x(w5 w26) x(w3 x(w2 _)))) - ::std::list::List::len = fn(ref(w3 dup235(w20 w24)) @le$(w15 ?(::day_23::main::extend_clique::7 ::day_23::main::extend_clique::6 x(x(w13 w22) x(w20 x(x(w2 w19) _)))))) + ::std::list::List::len = fn(ref(w3 dup233(w20 w24)) @le$(w15 ?(::day_23::main::extend_clique::7 ::day_23::main::extend_clique::6 x(x(w13 w22) x(w20 x(x(w2 w19) _)))))) ::std::list::List::len = fn(ref(w5 w13) w15) ::day_23::main::extend_clique::8 = x(w7 x(x(w22 w26) x(w24 w19))) } @@ -156,7 +156,7 @@ ::day_23::main::extend_clique::6 { x(x(_ w9) x(w14 x(x(w13 w2) _))) - ::std::list::List::get = fn(ref(w13 w2) fn(0 ref(dup243(w7 w6) w6))) + ::std::list::List::get = fn(ref(w13 w2) fn(0 ref(dup240(w7 w6) w6))) ::std::list::List::concat = fn(w14 fn(tup(1 tup(tup(w7 w17) w17)) w9)) } @@ -168,7 +168,7 @@ } ::day_23::main::extend_clique::11 { - enum(w0 x(x(w7 w38) x(x(w5 w36) x(dup267(w18 w34) dup268(w10 w33))))) + enum(w0 x(x(w7 w38) x(x(w5 w36) x(dup263(w18 w34) dup264(w10 w33))))) ::day_23::main::extend_clique::13 = x(x(w7 w31) x(x(w0 w29) x(x(tup(0 tup(w24 w24)) w27) w10))) ::std::list::List::concat = fn(w18 fn(tup(1 tup(tup(w29 w32) w32)) w21)) ::day_23::main::extend_clique = fn(ref(w31 w13) fn(ref(w5 w16) fn(w21 fn(w27 _)))) @@ -195,14 +195,14 @@ ::std::map::Map::get = fn(w2 fn(ref(w5 w12) enum(::day_23::main::extend_clique::25 enum(::day_23::main::extend_clique::26 x(w7 x(w12 w16)))))) } -::day_23::main::extend_clique::22 { x(x(w3 w3) x(_ _)) } +::day_23::main::extend_clique::22 { x(x(w3 w3) _) } ::day_23::main::extend_clique::25 { enum(ref(w1 w1) x(x(w6 w10) x(w4 _))) ::std::list::List::concat = fn(w6 fn(tup(1 tup(tup(w4 w11) w11)) w10)) } -::day_23::main::extend_clique::26 { x(x(w3 w3) x(_ _)) } +::day_23::main::extend_clique::26 { x(x(w3 w3) _) } ::std::io::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -215,7 +215,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup790(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup775(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -229,11 +229,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup835(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup820(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup842(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup827(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -248,7 +248,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup859(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup844(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -261,14 +261,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup896(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup881(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup930(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup915(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -278,20 +278,20 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } ::std::list::List::map { - fn(tup(dup963(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup948(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup974(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup959(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup983(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup968(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup993(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup978(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -321,7 +321,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup1076(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup1061(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -331,7 +331,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1189(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1174(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -349,23 +349,23 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } ::std::map::Map::insert { - fn(ref(tup(dup1614(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1591(w2 w16) w5) tup(w2 w14)) w9) ::std::map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::map::Map::get_or_insert { - fn(ref(tup(dup1622(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1599(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::option::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::map::Map::get { - fn(ref(tup(dup1635(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1612(w2 w17) w5) tup(w2 w15)) w10) ::std::map::Node::get = fn(ref(w5 w15) fn(w17 w10)) } ::std::map::Map::remove_min { - fn(ref(tup(dup1667(w2 w19) w5) tup(w2 w18)) w16) + fn(ref(tup(dup1644(w2 w19) w5) tup(w2 w18)) w16) ::std::map::Node::size = fn(ref(w5 w13) ?(::std::map::Map::remove_min::4 ::std::map::Map::remove_min::3 x(w19 x(x(w13 w18) w16)))) } @@ -384,7 +384,7 @@ ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1863(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1837(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -392,10 +392,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1876(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1850(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1891(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1865(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -420,10 +420,10 @@ ::std::map::balance_left = fn(ref(w26 w31) _) } -::std::map::Node::get { fn(ref(tup(dup1952(w2 ?(::std::map::Node::get::4 ::std::map::Node::get::3 x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w5) tup(w2 w22)) fn(w9 fn(ref(w11 w19) w17))) } +::std::map::Node::get { fn(ref(tup(dup1926(w2 ?(::std::map::Node::get::4 ::std::map::Node::get::3 x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w5) tup(w2 w22)) fn(w9 fn(ref(w11 w19) w17))) } ::std::map::Node::get::3 { - x(x(w22 w1) x(dup1964(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::map::Node::get::9 enum(::std::map::Node::get::10 enum(::std::map::Node::get::11 x(w41 x(x(w25 w40) x(x(w4 w38) x(x(w8 w36) x(x(w12 w34) w32)))))))))) w41) x(x(w19 w40) w32))) + x(x(w22 w1) x(dup1938(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::map::Node::get::9 enum(::std::map::Node::get::10 enum(::std::map::Node::get::11 x(w41 x(x(w25 w40) x(x(w4 w38) x(x(w8 w36) x(x(w12 w34) w32)))))))))) w41) x(x(w19 w40) w32))) ref(w22 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w38 tup(tup(w28 w36) w34))) } @@ -517,18 +517,18 @@ } ::std::map::is_balanced { - fn(ref(tup(dup2467(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2468(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2439(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2440(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2472(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2473(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2444(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2445(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2477(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2478(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2449(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2450(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } -::std::n32::N32::to_string { fn(dup2483(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2455(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -537,10 +537,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2493(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2465(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2496(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2468(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -548,11 +548,11 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::cmp { fn(ref(dup2551(w2 dup2551(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2552(w5 dup2552(w12 w15)) w5) w14)) } +::std::n32::N32::cmp { fn(ref(dup2522(w2 dup2522(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2523(w5 dup2523(w12 w15)) w5) w14)) } ::std::n32::N32::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::n32::N32::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::n32::N32::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } ::std::option::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } diff --git a/tests/snaps/vine/aoc_2024/day_23/stats.txt b/tests/snaps/vine/aoc_2024/day_23/stats.txt index c367c8f6..466706ef 100644 --- a/tests/snaps/vine/aoc_2024/day_23/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_23/stats.txt @@ -1,9 +1,9 @@ Interactions Total 65_833 - Annihilate 37_794 + Annihilate 37_776 Commute 870 - Copy 6_866 + Copy 6_884 Erase 6_817 Expand 8_086 Call 3_043 @@ -11,5 +11,5 @@ Interactions Memory Heap 16_816 B - Allocated 1_436_272 B - Freed 1_436_272 B + Allocated 1_435_984 B + Freed 1_435_984 B diff --git a/tests/snaps/vine/aoc_2024/day_24/compiled.iv b/tests/snaps/vine/aoc_2024/day_24/compiled.iv index 022833f0..4ab4cc82 100644 --- a/tests/snaps/vine/aoc_2024/day_24/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_24/compiled.iv @@ -7,7 +7,7 @@ ::day_24::main::2 = x(x(w3 w29) x(w7 w27)) ::day_24::main::11 = x(x(w29 w33) x(w27 w31)) ref(0 w11) = ref(w37 w14) - ::day_24::main::22 = x(w31 x(x(w14 w37) x(0 _))) + ::day_24::main::21 = x(w31 x(x(w14 w37) x(0 _))) ::std::n64::N64::to_string = fn(w11 w23) ::std::list::List::concat = fn(tup(8 tup(tup(80 tup(97 tup(114 tup(116 tup(32 tup(49 tup(58 tup(32 w39)))))))) w39)) fn(w23 w24)) ::std::io::IO::println = fn(ref(w33 w19) fn(w24 _)) @@ -23,10 +23,7 @@ ::std::list::List::len = fn(ref(w0 w7) ?(::day_24::main::8 ::day_24::main::7 x(w5 x(w3 w7)))) } -::day_24::main::6 { - x(x(w3 w3) x(w1 w1)) - _ = _ -} +::day_24::main::6 { x(x(w3 w3) x(w1 w1)) } ::day_24::main::7 { x(w26 x(x(w24 w29) w22)) @@ -38,10 +35,7 @@ ::day_24::main::2 = x(w26 x(w16 w29)) } -::day_24::main::8 { - x(x(w4 w4) x(x(w2 w2) _)) - _ = _ -} +::day_24::main::8 { x(x(w4 w4) x(x(w2 w2) _)) } ::day_24::main::10 { x(x(w11 w4) fn(w0 w8)) @@ -74,42 +68,42 @@ ::day_24::main::17 { x(@n32_and(w5 w2) x(w5 x(_ w2))) } -::day_24::main::18 { x(w4 x(w3 x(@eq(79 ?(::day_24::main::21 ::day_24::main::20 x(w4 x(w3 w7)))) w7))) } +::day_24::main::18 { x(w5 x(w4 x(@eq(79 ?(::day_24::main::20 ::day_24::main::19 x(w5 x(w4 w6)))) w6))) } -::day_24::main::20 { x(@n32_or(w4 w2) x(w4 w2)) } +::day_24::main::19 { x(@n32_or(w4 w2) x(w4 w2)) } -::day_24::main::21 { x(@n32_xor(w4 w2) x(w4 w2)) } +::day_24::main::20 { x(@n32_xor(w4 w2) x(w4 w2)) } -::day_24::main::22 { - x(w13 x(w12 x(dup100(@div(10 w1) dup100(@rem(10 w4) w24)) w23))) +::day_24::main::21 { + x(w13 x(w12 x(dup99(@div(10 w1) dup99(@rem(10 w4) w24)) w23))) 48 = @add(w1 w2) 48 = @add(w4 w5) - ::std::map::Map::get = fn(ref(w13 w16) fn(ref(tup(3 tup(tup(122 tup(w2 tup(w5 w14))) w14)) _) enum(::day_24::main::26 enum(::day_24::main::27 x(w16 x(w12 x(w24 w23))))))) + ::std::map::Map::get = fn(ref(w13 w16) fn(ref(tup(3 tup(tup(122 tup(w2 tup(w5 w14))) w14)) _) enum(::day_24::main::25 enum(::day_24::main::26 x(w16 x(w12 x(w24 w23))))))) } -::day_24::main::26 { +::day_24::main::25 { enum(w2 x(w8 x(x(w7 w37) x(@add(1 w19) w34)))) ::day_24::Wire::get = fn(w2 ?(0 ::std::n64::N64::one w24)) ::std::n64::N64::shl = fn(w14 fn(1 w15)) ::std::n64::N64::or = fn(w15 fn(w24 w7)) - ::day_24::main::22 = x(w8 x(x(dup104(w14 _) w37) x(w19 w34))) + ::day_24::main::21 = x(w8 x(x(dup103(w14 _) w37) x(w19 w34))) } -::day_24::main::27 { x(_ x(x(w3 w3) _)) } +::day_24::main::26 { x(_ x(x(w3 w3) _)) } ::day_24::Wire::new { tup(w6 w6) } ::day_24::Wire::input { fn(w2 tup(_ w2)) } -::day_24::Wire::get { fn(ref(tup(w2 dup131(w3 w10)) tup(w2 w3)) w10) } +::day_24::Wire::get { fn(ref(tup(w2 dup130(w3 w10)) tup(w2 w3)) w10) } ::day_24::Wire::set { fn(ref(tup(w8 w4) tup(_ w4)) fn(w8 _)) } -::std::char::Char::cmp { fn(ref(dup578(w2 dup578(@lt(w12 ?(::std::char::Char::cmp::4 ::std::char::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup579(w5 dup579(w12 w15)) w5) w14)) } +::std::char::Char::cmp { fn(ref(dup570(w2 dup570(@lt(w12 ?(::std::char::Char::cmp::4 ::std::char::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup571(w5 dup571(w12 w15)) w5) w14)) } ::std::char::Char::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::char::Char::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::char::Char::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } ::std::io::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -122,7 +116,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup608(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup599(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -136,11 +130,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup653(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup644(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup660(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup651(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -155,7 +149,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup677(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup668(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -168,14 +162,14 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup714(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup705(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::get { fn(ref(tup(w3 tup(w5 w7)) tup(w3 tup(w6 w7))) fn(w11 ref(w16 w17))) ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup748(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup739(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -184,7 +178,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup811(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup802(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -195,9 +189,9 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::list::List::iter { fn(ref(tup(dup971(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup962(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup978(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup969(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -214,7 +208,7 @@ } ::std::list::List::split::2 { - x(w14 x(dup1054(w1 w20) x(w12 w18))) + x(w14 x(dup1045(w1 w20) x(w12 w18))) ::std::list::List::split_once = fn(w14 fn(w1 tup(w3 enum(::std::list::List::split::6 enum(::std::list::List::split::7 x(w20 x(w9 w18))))))) ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -252,7 +246,7 @@ } ::std::list::List::split_once::9 { - enum(ref(dup1173(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup1161(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::list::List::Iter::next = fn(ref(w5 w11) enum(::std::list::List::split_once::13 enum(::std::list::List::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -261,7 +255,7 @@ ::std::list::List::split_once::15 = x(w4 x(w3 w1)) } -::std::list::List::split_once::13 { enum(ref(dup1187(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::list::List::split_once::13 { enum(ref(dup1175(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::list::List::split_once::6 ::std::list::List::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::list::List::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -315,7 +309,7 @@ ::std::list::List::cmp::16 { enum(w0 x(w8 x(w7 x(w5 x(w10 enum(::std::list::List::cmp::17 enum(::std::list::List::cmp::18 x(w8 x(w7 x(w5 x(w10 w0))))))))))) } -::std::list::List::cmp::17 { enum(w0 x(dup1375(fn(w0 fn(w3 enum(::std::list::List::cmp::13 enum(::std::list::List::cmp::3 enum(::std::list::List::cmp::15 x(w21 x(w8 x(w6 w16)))))))) w21) x(w8 x(w6 x(w16 w3))))) } +::std::list::List::cmp::17 { enum(w0 x(dup1358(fn(w0 fn(w3 enum(::std::list::List::cmp::13 enum(::std::list::List::cmp::3 enum(::std::list::List::cmp::15 x(w21 x(w8 x(w6 w16)))))))) w21) x(w8 x(w6 x(w16 w3))))) } ::std::list::List::cmp::18 { x(_ x(x(w5 w5) x(x(w3 w3) x(::std::map::Ord::Lt _)))) } @@ -337,24 +331,24 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } ::std::map::Map::insert { - fn(ref(tup(dup1432(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1415(w2 w16) w5) tup(w2 w14)) w9) ::std::map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::map::Map::get_or_insert { - fn(ref(tup(dup1440(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1423(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::option::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::map::Map::get { - fn(ref(tup(dup1453(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1436(w2 w17) w5) tup(w2 w15)) w10) ::std::map::Node::get = fn(ref(w5 w15) fn(w17 w10)) } ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1681(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1661(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -362,10 +356,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1694(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1674(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1709(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1689(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -390,10 +384,10 @@ ::std::map::balance_left = fn(ref(w26 w31) _) } -::std::map::Node::get { fn(ref(tup(dup1770(w2 ?(::std::map::Node::get::4 ::std::map::Node::get::3 x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w5) tup(w2 w22)) fn(w9 fn(ref(w11 w19) w17))) } +::std::map::Node::get { fn(ref(tup(dup1750(w2 ?(::std::map::Node::get::4 ::std::map::Node::get::3 x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w5) tup(w2 w22)) fn(w9 fn(ref(w11 w19) w17))) } ::std::map::Node::get::3 { - x(x(w22 w1) x(dup1782(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::map::Node::get::9 enum(::std::map::Node::get::10 enum(::std::map::Node::get::11 x(w41 x(x(w25 w40) x(x(w4 w38) x(x(w8 w36) x(x(w12 w34) w32)))))))))) w41) x(x(w19 w40) w32))) + x(x(w22 w1) x(dup1762(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::map::Node::get::9 enum(::std::map::Node::get::10 enum(::std::map::Node::get::11 x(w41 x(x(w25 w40) x(x(w4 w38) x(x(w8 w36) x(x(w12 w34) w32)))))))))) w41) x(x(w19 w40) w32))) ref(w22 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w38 tup(tup(w28 w36) w34))) } @@ -461,16 +455,16 @@ } ::std::map::is_balanced { - fn(ref(tup(dup2285(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2286(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2263(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2264(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2290(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2291(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2268(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2269(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2295(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2296(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2273(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2274(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::n64::N64::one { tup(1 0) } @@ -479,19 +473,19 @@ ::std::n64::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::n64::N64::div_rem_n32 { - fn(tup(w2 dup2547(@div(w9 w10) @rem(w12 dup2548(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2550(w9 dup2550(w12 dup2550(w31 dup2550(w36 dup2550(w41 dup2550(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2546(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2519(@div(w9 w10) @rem(w12 dup2520(@lt$(w31 ?(::std::n64::N64::div_rem_n32::4 ::std::n64::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2522(w9 dup2522(w12 dup2522(w31 dup2522(w36 dup2522(w41 dup2522(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::n64::N64::div_rem_n32::5 = x(x(w2 dup2518(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::n64::N64::div_rem_n32::3 { x(x(dup2561(@div(w1 w2) @rem(w4 w6)) w6) x(dup2562(w1 w4) x(x(_ w2) _))) } +::std::n64::N64::div_rem_n32::3 { x(x(dup2533(@div(w1 w2) @rem(w4 w6)) w6) x(dup2534(w1 w4) x(x(_ w2) _))) } ::std::n64::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2570(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::n64::N64::div_rem_n32::5 { x(w6 x(dup2541(?(::std::n64::N64::div_rem_n32::7 ::std::n64::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::n64::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2577(w2 w9) x(dup2579(w0 dup2579(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2583(w5 w11))) + x(x(w27 w33) x(dup2548(w2 w9) x(dup2550(w0 dup2550(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2554(w5 w11))) ::std::n64::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::n64::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::n64::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -501,11 +495,11 @@ ::std::n64::N64::or { fn(tup(@n32_or(w5 w12) @n32_or(w6 w15)) fn(tup(w5 w6) tup(w12 w15))) } -::std::n64::N64::shl { fn(tup(w2 w3) fn(dup2611(@n32_and(32 ?(::std::n64::N64::shl::4 ::std::n64::N64::shl::3 x(w2 x(w3 x(w12 w11))))) w12) w11)) } +::std::n64::N64::shl { fn(tup(w2 w3) fn(dup2582(@n32_and(32 ?(::std::n64::N64::shl::4 ::std::n64::N64::shl::3 x(w2 x(w3 x(w12 w11))))) w12) w11)) } ::std::n64::N64::shl::3 { x(@n32_shl(w5 w2) x(_ x(w5 tup(0 w2)))) } -::std::n64::N64::shl::4 { x(dup2619(@n32_shl(w1 w2) @n32_shr(w8 w9)) x(@n32_shl(w4 @n32_or(w9 w10)) x(dup2621(w1 dup2621(w4 @sub$(0 w8))) tup(w2 w10)))) } +::std::n64::N64::shl::4 { x(dup2590(@n32_shl(w1 w2) @n32_shr(w8 w9)) x(@n32_shl(w4 @n32_or(w9 w10)) x(dup2592(w1 dup2592(w4 @sub$(0 w8))) tup(w2 w10)))) } ::std::n64::N64::eq { fn(tup(@eq(w5 ?(::std::n64::N64::eq::4 ::std::n64::N64::eq::3 x(w3 x(w6 w14)))) w3) fn(tup(w5 w6) w14)) } @@ -514,7 +508,7 @@ ::std::n64::N64::eq::4 { x(_ x(_ 0)) } ::std::n64::N64::to_string { - fn(dup2828(w6 w9) w8) + fn(dup2797(w6 w9) w8) ::std::n64::N64::eq = fn(w6 fn(0 ?(::std::n64::N64::to_string::4 ::std::n64::N64::to_string::3 x(w9 w8)))) } @@ -526,7 +520,7 @@ } ::std::n64::N64::to_string::5 { - x(dup2838(w0 w7) w3) + x(dup2807(w0 w7) w3) ::std::n64::N64::eq = fn(w0 fn(0 ?(::std::n64::N64::to_string::7 ::std::n64::N64::to_string::6 x(w7 w3)))) } diff --git a/tests/snaps/vine/aoc_2024/day_24/stats.txt b/tests/snaps/vine/aoc_2024/day_24/stats.txt index 32b5c343..7c551cbf 100644 --- a/tests/snaps/vine/aoc_2024/day_24/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_24/stats.txt @@ -1,10 +1,10 @@ Interactions - Total 318_110 + Total 318_109 Annihilate 194_437 Commute 558 Copy 24_387 - Erase 31_259 + Erase 31_258 Expand 43_622 Call 13_859 Branch 9_988 diff --git a/tests/snaps/vine/aoc_2024/day_25/compiled.iv b/tests/snaps/vine/aoc_2024/day_25/compiled.iv index 06e3a9a7..bd1bab15 100644 --- a/tests/snaps/vine/aoc_2024/day_25/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_25/compiled.iv @@ -35,10 +35,7 @@ ::std::list::List::len = fn(ref(w0 w8) ?(::day_25::main::13 ::day_25::main::12 x(w6 x(w4 x(w3 w8))))) } -::day_25::main::11 { - x(x(w4 w4) x(_ x(w1 w1))) - _ = _ -} +::day_25::main::11 { x(x(w4 w4) x(_ x(w1 w1))) } ::day_25::main::12 { x(w6 x(dup60(w11 w14) x(x(w3 w13) w1))) @@ -46,10 +43,7 @@ ::day_25::main::7 = x(w6 x(w14 x(w10 w13))) } -::day_25::main::13 { - x(x(w5 w5) x(_ x(x(w2 w2) _))) - _ = _ -} +::day_25::main::13 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } ::day_25::main::15 { x(w9 x(w8 x(w6 w5))) @@ -86,7 +80,7 @@ } ::day_25::main::29 { - enum(w0 x(dup108(w7 w20) x(w4 x(@add(w15 w12) w18)))) + enum(w0 x(dup107(w7 w20) x(w4 x(@add(w15 w12) w18)))) ::std::list::List::into_iter = fn(w7 w8) ::day_25::main::31 = x(w0 x(x(0 w15) w8)) ::day_25::main::26 = x(w20 x(w4 x(w12 w18))) @@ -100,7 +94,7 @@ } ::day_25::main::34 { - enum(w0 x(dup125(w8 w16) x(x(w4 w15) w2))) + enum(w0 x(dup124(w8 w16) x(x(w4 w15) w2))) ::day_25::fits = fn(w0 fn(w8 ?(::day_25::main::38 ::day_25::main::37 x(x(w4 w12) _)))) ::day_25::main::31 = x(w16 x(x(w12 w15) w2)) } @@ -145,7 +139,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup638(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup627(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -159,11 +153,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup683(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup672(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup690(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup679(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -178,7 +172,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup707(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup696(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -191,17 +185,17 @@ ::std::io::IO::read_byte { fn(ref(dup(io0 @io_read_byte(default dup(byte @seq$(io0 io1)))) io1) fn(default byte)) } -::std::list::List::len { fn(ref(tup(dup744(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup733(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::new { fn(w2 fn(w3 w11)) ::std::list::List::new::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::list::List::new::2 { x(dup757(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } +::std::list::List::new::2 { x(dup746(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } ::std::list::List::new::3 { - x(@sub(1 w6) x(dup763(w3 w13) x(w8 w12))) + x(@sub(1 w6) x(dup752(w3 w13) x(w8 w12))) ::std::list::List::push_back = fn(ref(w8 w1) fn(w3 _)) ::std::list::List::new::2 = x(w6 x(w13 x(w1 w12))) } @@ -213,7 +207,7 @@ ::std::list::List::get::2 = x(x(ref(w5 w6) ref(tup(w16 w18) tup(w17 w18))) w11) } -::std::list::List::get::2 { x(w3 dup778(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } +::std::list::List::get::2 { x(w3 dup767(?(::std::list::List::get::4 ::std::list::List::get::3 x(w3 w4)) w4)) } ::std::list::List::get::3 { x(x(ref(tup(w1 w3) tup(w1 w4)) w17) @sub(1 w11)) @@ -222,7 +216,7 @@ ::std::list::List::get::4 { x(x(w2 w2) _) } -::std::list::List::pop_front { fn(ref(tup(dup841(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup830(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -240,7 +234,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1037(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1026(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -249,7 +243,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2331(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2307(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -258,10 +252,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2341(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2317(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2344(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2320(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/aoc_2024/day_25/stats.txt b/tests/snaps/vine/aoc_2024/day_25/stats.txt index ba05cefa..704ef6d8 100644 --- a/tests/snaps/vine/aoc_2024/day_25/stats.txt +++ b/tests/snaps/vine/aoc_2024/day_25/stats.txt @@ -1,10 +1,10 @@ Interactions - Total 21_418 + Total 21_413 Annihilate 11_519 Commute 96 Copy 1_988 - Erase 1_990 + Erase 1_985 Expand 3_109 Call 1_714 Branch 1_002 diff --git a/tests/snaps/vine/array_from_list/compiled.iv b/tests/snaps/vine/array_from_list/compiled.iv index bd7f143b..dcb37e61 100644 --- a/tests/snaps/vine/array_from_list/compiled.iv +++ b/tests/snaps/vine/array_from_list/compiled.iv @@ -56,46 +56,46 @@ ::std::array::Array::pop_back { fn(ref(tup(dup207(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup213(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup213(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup225(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup224(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup231(@sub(1 @rem(2 dup233(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup232(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup230(@sub(1 @rem(2 dup232(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup231(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -107,7 +107,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::unzip_with { fn(dup417(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup410(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -117,7 +117,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup429(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup431(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup422(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup424(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -133,7 +133,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup476(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup468(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -150,10 +150,10 @@ ::std::list::List::new::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::list::List::new::2 { x(dup595(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } +::std::list::List::new::2 { x(dup587(@lt$(0 ?(::std::list::List::new::4 ::std::list::List::new::3 x(w9 w4))) w9) w4) } ::std::list::List::new::3 { - x(@sub(1 w6) x(dup601(w3 w13) x(w8 w12))) + x(@sub(1 w6) x(dup593(w3 w13) x(w8 w12))) ::std::list::List::push_back = fn(ref(w8 w1) fn(w3 _)) ::std::list::List::new::2 = x(w6 x(w13 x(w1 w12))) } @@ -167,7 +167,7 @@ ::std::list::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::n32::N32::to_string { fn(dup2169(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2148(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -176,10 +176,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2179(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2158(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2182(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2161(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/array_order/compiled.iv b/tests/snaps/vine/array_order/compiled.iv index 9a0402f0..9a358bc1 100644 --- a/tests/snaps/vine/array_order/compiled.iv +++ b/tests/snaps/vine/array_order/compiled.iv @@ -84,46 +84,46 @@ ::std::array::Array::pop_back { fn(ref(tup(dup219(?(::std::array::Array::pop_back::4 ::std::array::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_back::3 { x(x(dup225(@eq(1 ?(::std::array::Array::pop_back::7 ::std::array::Array::pop_back::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_back::3 { x(x(dup225(@eq(1 ?(::std::array::Array::pop_back::6 ::std::array::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_back::15 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_back::14 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_back::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_back::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_back::15 = x(w12 w5) + ::std::array::Array::pop_back::14 = x(w11 w5) } -::std::array::Array::pop_back::7 { - x(x(dup237(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_back::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_back::6 { + x(x(dup236(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_back::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_back::8 { - x(ref(w6 w25) x(dup243(@sub(1 @rem(2 dup245(w12 w26))) w11) w23)) - ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup244(@eq(1 ?(::std::array::Array::pop_back::11 ::std::array::Array::pop_back::10 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) +::std::array::Array::pop_back::7 { + x(ref(w6 w25) x(dup242(@sub(1 @rem(2 dup244(w12 w26))) w11) w23)) + ::std::array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup243(@eq(1 ?(::std::array::Array::pop_back::10 ::std::array::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } -::std::array::Array::pop_back::10 { - x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::14 ::std::array::Array::pop_back::13 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) +::std::array::Array::pop_back::9 { + x(ref(w1 _) x(_ x(?(::std::array::Array::pop_back::13 ::std::array::Array::pop_back::12 x(w6 x(w7 w20))) x(x(tup(w6 w7) w20) w12)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w12) } -::std::array::Array::pop_back::11 { +::std::array::Array::pop_back::10 { x(w5 x(w4 x(_ x(x(w2 w2) w24)))) - ::std::array::Array::pop_back::8 = x(w5 x(w4 w24)) + ::std::array::Array::pop_back::7 = x(w5 x(w4 w24)) } -::std::array::Array::pop_back::13 { x(w3 x(_ w3)) } +::std::array::Array::pop_back::12 { x(w3 x(_ w3)) } -::std::array::Array::pop_back::14 { x(_ x(w2 w2)) } +::std::array::Array::pop_back::13 { x(_ x(w2 w2)) } -::std::array::Array::pop_back::15 { x(w11 w11) } +::std::array::Array::pop_back::14 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -137,7 +137,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::zip_with { fn(dup408(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::array::Node::zip_with { fn(dup401(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -147,12 +147,12 @@ } ::std::array::Node::zip_with::4 { - x(dup420(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup423(w13 w19) tup(w14 w20))))) + x(dup413(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup416(w13 w19) tup(w14 w20))))) ::std::array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } -::std::array::Node::unzip_with { fn(dup429(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::array::Node::unzip_with { fn(dup422(@eq(1 ?(::std::array::Node::unzip_with::4 ::std::array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -162,7 +162,7 @@ } ::std::array::Node::unzip_with::4 { - x(dup441(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup443(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup434(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup436(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -178,7 +178,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup488(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup480(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -192,7 +192,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2181(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2160(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -201,10 +201,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2191(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2170(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2194(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2173(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/array_to_list/compiled.iv b/tests/snaps/vine/array_to_list/compiled.iv index a51bdfb2..4dee037f 100644 --- a/tests/snaps/vine/array_to_list/compiled.iv +++ b/tests/snaps/vine/array_to_list/compiled.iv @@ -58,51 +58,51 @@ ::std::array::Array::push_back::7 { x(x(w2 w2) _) } -::std::array::Array::pop_front { fn(ref(tup(dup259(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup257(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup265(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup263(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup277(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup274(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup284(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup281(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } ::std::array::Node::leaf { fn(x x) } -::std::array::Node::new { fn(dup320(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::array::Node::new { fn(dup316(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::array::Node::new::3 { x(_ x(w3 w1)) @@ -110,7 +110,7 @@ } ::std::array::Node::new::4 { - x(dup328(@add(1 @div(2 w2)) @div(2 w6)) x(dup329(w3 w7) tup(w4 w8))) + x(dup324(@add(1 @div(2 w2)) @div(2 w6)) x(dup325(w3 w7) tup(w4 w8))) ::std::array::Node::new = fn(w2 fn(w3 w4)) ::std::array::Node::new = fn(w6 fn(w7 w8)) } @@ -121,7 +121,7 @@ ::std::array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::array::Node::zip_with { fn(dup396(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::array::Node::zip_with { fn(dup389(@eq(1 ?(::std::array::Node::zip_with::4 ::std::array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -131,7 +131,7 @@ } ::std::array::Node::zip_with::4 { - x(dup408(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup411(w13 w19) tup(w14 w20))))) + x(dup401(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup404(w13 w19) tup(w14 w20))))) ::std::array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } @@ -147,7 +147,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup476(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup468(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -159,11 +159,11 @@ ::std::io::IO::print_char { fn(ref(@io_print_char(char io) io) fn(char _)) } -::std::list::List::len { fn(ref(tup(dup582(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup574(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2169(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2148(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -172,10 +172,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2179(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2158(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2182(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2161(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/basic_diverge/compiled.iv b/tests/snaps/vine/basic_diverge/compiled.iv index fc500d37..7042de29 100644 --- a/tests/snaps/vine/basic_diverge/compiled.iv +++ b/tests/snaps/vine/basic_diverge/compiled.iv @@ -31,7 +31,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup493(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup484(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -45,7 +45,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2186(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2164(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -54,10 +54,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2196(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2174(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2199(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2177(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/break_result/compiled.iv b/tests/snaps/vine/break_result/compiled.iv index 473b4c95..8e154584 100644 --- a/tests/snaps/vine/break_result/compiled.iv +++ b/tests/snaps/vine/break_result/compiled.iv @@ -17,7 +17,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup475(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup467(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/cat/compiled.iv b/tests/snaps/vine/cat/compiled.iv index 73dbfc72..0e73387c 100644 --- a/tests/snaps/vine/cat/compiled.iv +++ b/tests/snaps/vine/cat/compiled.iv @@ -30,7 +30,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup484(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup476(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -44,11 +44,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup529(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup521(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup536(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup528(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -63,7 +63,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup553(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup545(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { diff --git a/tests/snaps/vine/classify_primes/compiled.iv b/tests/snaps/vine/classify_primes/compiled.iv index 9af89430..e42776a6 100644 --- a/tests/snaps/vine/classify_primes/compiled.iv +++ b/tests/snaps/vine/classify_primes/compiled.iv @@ -44,7 +44,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup501(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup492(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -58,7 +58,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2194(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2172(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -67,10 +67,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2204(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2182(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2207(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2185(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/cond_diverge/compiled.iv b/tests/snaps/vine/cond_diverge/compiled.iv index d81298b1..3917d033 100644 --- a/tests/snaps/vine/cond_diverge/compiled.iv +++ b/tests/snaps/vine/cond_diverge/compiled.iv @@ -36,7 +36,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup506(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup498(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -48,7 +48,7 @@ ::std::io::IO::print_char { fn(ref(@io_print_char(char io) io) fn(char _)) } -::std::list::List::pop_front { fn(ref(tup(dup709(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup701(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) diff --git a/tests/snaps/vine/cyclist/compiled.iv b/tests/snaps/vine/cyclist/compiled.iv index dba469d4..8fdfa497 100644 --- a/tests/snaps/vine/cyclist/compiled.iv +++ b/tests/snaps/vine/cyclist/compiled.iv @@ -52,7 +52,7 @@ ::cyclist::cycle::4 { x(x(w4 w4) _) } -::cyclist::cycle::5 { x(w3 dup51(?(::cyclist::cycle::7 ::cyclist::cycle::6 x(w3 w4)) w4)) } +::cyclist::cycle::5 { x(w3 dup50(?(::cyclist::cycle::7 ::cyclist::cycle::6 x(w3 w4)) w4)) } ::cyclist::cycle::6 { x(x(w15 w18) @sub(1 w12)) @@ -75,7 +75,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup528(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup519(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -87,23 +87,23 @@ ::std::io::IO::print_char { fn(ref(@io_print_char(char io) io) fn(char _)) } -::std::list::List::len { fn(ref(tup(dup634(w13 w9) w10) tup(w9 w10)) w13) } +::std::list::List::len { fn(ref(tup(dup625(w13 w9) w10) tup(w9 w10)) w13) } ::std::list::List::map { - fn(tup(dup701(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup692(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup712(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup703(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup721(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup712(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } ::std::list::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } -::std::list::List::pop_front { fn(ref(tup(dup731(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup722(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -138,7 +138,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup814(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup805(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -156,7 +156,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup927(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup918(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -165,7 +165,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2221(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2199(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -174,10 +174,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2231(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2209(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2234(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2212(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/fail/atypical.txt b/tests/snaps/vine/fail/atypical.txt index 8eddbe72..bd6ead49 100644 --- a/tests/snaps/vine/fail/atypical.txt +++ b/tests/snaps/vine/fail/atypical.txt @@ -18,7 +18,7 @@ error tests/programs/fail/atypical.vi:12:3 - cannot call non-function type `N32` error tests/programs/fail/atypical.vi:13:14 - cannot apply operator `+` to types `N32` and `~N32` error tests/programs/fail/atypical.vi:14:5 - cannot find `noop` in `::std::n32::N32` error tests/programs/fail/atypical.vi:15:6 - expected type `Bool`; found `F32` -error tests/programs/fail/atypical.vi:15:3 - then block has type `N32` but else block has type `List[Char]` +error tests/programs/fail/atypical.vi:15:21 - expected type `N32`; found `List[Char]` error tests/programs/fail/atypical.vi:16:3 - function type `fn(IO)` expects 1 argument; was passed 3 error tests/programs/fail/atypical.vi:17:3 - cannot compare `N32` and `F32` error tests/programs/fail/atypical.vi:17:3 - cannot compare `F32` and `N32` @@ -31,7 +31,7 @@ error tests/programs/fail/atypical.vi:21:14 - expected type `U`; found `T` error tests/programs/fail/atypical.vi:22:7 - expected an irrefutable pattern error tests/programs/fail/atypical.vi:22:17 - expected type `Ay`; found `N32` error tests/programs/fail/atypical.vi:23:4 - cannot apply operator `+` to types `List[Char]` and `N32` -error tests/programs/fail/atypical.vi:24:7 - expected type `N32`; found `&?15` +error tests/programs/fail/atypical.vi:24:7 - expected type `N32`; found `&?16` error tests/programs/fail/atypical.vi:27:10 - expected type `()`; found `F32` error tests/programs/fail/atypical.vi:28:14 - cannot apply operator `+` to types `~N32` and `~N32` error tests/programs/fail/atypical.vi:29:3 - cannot apply operator `+=` to types `N32` and `F32` diff --git a/tests/snaps/vine/fail/is_not.txt b/tests/snaps/vine/fail/is_not.txt index 04ae2ca4..f2a9339c 100644 --- a/tests/snaps/vine/fail/is_not.txt +++ b/tests/snaps/vine/fail/is_not.txt @@ -5,4 +5,4 @@ error tests/programs/fail/is_not.vi:5:26 - cannot find `y` in `::is_not::main` error tests/programs/fail/is_not.vi:5:29 - cannot find `z` in `::is_not::main` error tests/programs/fail/is_not.vi:7:3 - cannot find `y` in `::is_not::main` error tests/programs/fail/is_not.vi:2:13 - types in item signatures cannot be elided -error tests/programs/fail/is_not.vi:5:3 - then block has type `(??, ??)` but else block has type `()` +error tests/programs/fail/is_not.vi:5:23 - expected type `()`; found `(??, ??)` diff --git a/tests/snaps/vine/fib/compiled.iv b/tests/snaps/vine/fib/compiled.iv index 0508c87e..e6a047ff 100644 --- a/tests/snaps/vine/fib/compiled.iv +++ b/tests/snaps/vine/fib/compiled.iv @@ -33,7 +33,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup493(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup485(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -47,7 +47,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2186(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2165(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -56,10 +56,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2196(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2175(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2199(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2178(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/fib_repl/compiled.iv b/tests/snaps/vine/fib_repl/compiled.iv index 019aece5..1df60581 100644 --- a/tests/snaps/vine/fib_repl/compiled.iv +++ b/tests/snaps/vine/fib_repl/compiled.iv @@ -54,7 +54,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup510(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup502(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -77,11 +77,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup555(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup547(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup562(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup554(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -96,7 +96,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup579(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup571(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -111,7 +111,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2203(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2182(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -120,10 +120,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2213(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2192(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2216(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2195(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -131,7 +131,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2223(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2202(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -143,10 +143,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2234(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2213(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2243(dup2238(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2222(dup2217(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } diff --git a/tests/snaps/vine/final_countdown/compiled.iv b/tests/snaps/vine/final_countdown/compiled.iv index b65c0dec..3564ffdf 100644 --- a/tests/snaps/vine/final_countdown/compiled.iv +++ b/tests/snaps/vine/final_countdown/compiled.iv @@ -32,7 +32,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup492(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup484(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -46,7 +46,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2185(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2164(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -55,10 +55,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2195(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2174(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2198(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2177(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/find_primes/compiled.iv b/tests/snaps/vine/find_primes/compiled.iv index d8570b97..7f25ab6c 100644 --- a/tests/snaps/vine/find_primes/compiled.iv +++ b/tests/snaps/vine/find_primes/compiled.iv @@ -47,7 +47,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup517(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup507(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -61,7 +61,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2210(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2187(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -70,10 +70,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2220(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2197(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2223(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2200(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/fizzbuzz/compiled.iv b/tests/snaps/vine/fizzbuzz/compiled.iv index 56208403..d937d6c7 100644 --- a/tests/snaps/vine/fizzbuzz/compiled.iv +++ b/tests/snaps/vine/fizzbuzz/compiled.iv @@ -45,7 +45,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup504(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup496(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -59,7 +59,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2197(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2176(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -68,10 +68,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2207(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2186(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2210(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2189(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/fmt/objects.fmt.vi b/tests/snaps/vine/fmt/objects.fmt.vi new file mode 100644 index 00000000..478840d2 --- /dev/null +++ b/tests/snaps/vine/fmt/objects.fmt.vi @@ -0,0 +1,11 @@ + +struct Foo { + a: N32, + b: String, + c: F32, + d: { p: List[N32], q: &Char }, +} + +fn foo(Foo({ a:: N32, b: x: String, c:: F32, d })) { + Foo({ a, b: x, c, d: { p: d.p, q: d.q } }) +} diff --git a/tests/snaps/vine/guessing_game/compiled.iv b/tests/snaps/vine/guessing_game/compiled.iv index ada666b7..b59d6246 100644 --- a/tests/snaps/vine/guessing_game/compiled.iv +++ b/tests/snaps/vine/guessing_game/compiled.iv @@ -34,40 +34,40 @@ ::guessing_game::main::11 { enum(w0 x(x(w5 w5) x(_ w0))) } ::guessing_game::main::14 { - x(x(w11 w24) x(@add(1 w1) x(dup56(w17 w21) w19))) - ::guessing_game::main::2 = x(x(w11 w14) fn(tup(18 tup(tup(69 tup(110 tup(116 tup(101 tup(114 tup(32 tup(121 tup(111 tup(117 tup(114 tup(32 tup(103 tup(117 tup(101 tup(115 tup(115 tup(58 tup(32 w15)))))))))))))))))) w15)) dup57(@lt(w17 ?(::guessing_game::main::17 ::guessing_game::main::16 x(x(w14 w24) x(w1 x(w21 x(w20 w19)))))) w20))) + x(x(w11 w24) x(@add(1 w1) x(dup55(w17 w21) w19))) + ::guessing_game::main::2 = x(x(w11 w14) fn(tup(18 tup(tup(69 tup(110 tup(116 tup(101 tup(114 tup(32 tup(121 tup(111 tup(117 tup(114 tup(32 tup(103 tup(117 tup(101 tup(115 tup(115 tup(58 tup(32 w15)))))))))))))))))) w15)) dup56(@lt(w17 ?(::guessing_game::main::17 ::guessing_game::main::16 x(x(w14 w24) x(w1 x(w21 x(w20 w19)))))) w20))) } ::guessing_game::main::16 { x(x(w10 w17) x(w8 x(w7 x(_ w13)))) ::std::io::IO::println = fn(ref(w10 w1) fn(tup(8 tup(tup(84 tup(111 tup(111 tup(32 tup(108 tup(111 tup(119 tup(46 w11)))))))) w11)) _)) - ::guessing_game::main::30 = x(x(w1 w17) x(w8 x(w7 x(w13 _)))) + ::guessing_game::main::29 = x(x(w1 w17) x(w8 x(w7 x(w13 _)))) } -::guessing_game::main::17 { x(w6 x(w4 x(dup70(w8 w11) x(@lt$(w8 ?(::guessing_game::main::20 ::guessing_game::main::19 x(w6 x(w4 x(w11 w10))))) w10)))) } +::guessing_game::main::17 { x(w8 x(w6 x(dup69(w1 w10) x(@lt$(w1 ?(::guessing_game::main::19 ::guessing_game::main::18 x(w8 x(w6 x(w10 w9))))) w9)))) } -::guessing_game::main::19 { - x(x(w9 w17) x(w7 x(w6 w13))) +::guessing_game::main::18 { + x(x(w9 w16) x(w7 x(w6 w12))) ::std::io::IO::println = fn(ref(w9 w1) fn(tup(9 tup(tup(84 tup(111 tup(111 tup(32 tup(104 tup(105 tup(103 tup(104 tup(46 w10))))))))) w10)) _)) - ::guessing_game::main::30 = x(x(w1 w17) x(w7 x(w6 x(w13 _)))) + ::guessing_game::main::29 = x(x(w1 w16) x(w7 x(w6 x(w12 _)))) } -::guessing_game::main::20 { - x(x(w11 w1) x(dup83(@eq(1 ?(::guessing_game::main::23 ::guessing_game::main::22 x(w16 w15))) w16) _)) +::guessing_game::main::19 { + x(x(w11 w1) x(dup81(@eq(1 ?(::guessing_game::main::22 ::guessing_game::main::21 x(w16 w15))) w16) _)) ::std::list::List::concat = fn(tup(11 tup(tup(89 tup(111 tup(117 tup(32 tup(103 tup(111 tup(116 tup(32 tup(105 tup(116 tup(32 w12))))))))))) w12)) fn(w15 w5)) ::std::io::IO::println = fn(ref(w11 w1) fn(w5 _)) } -::guessing_game::main::22 { x(_ tup(13 tup(tup(105 tup(109 tup(109 tup(101 tup(100 tup(105 tup(97 tup(116 tup(101 tup(108 tup(121 tup(63 tup(33 w3))))))))))))) w3))) } +::guessing_game::main::21 { x(_ tup(13 tup(tup(105 tup(109 tup(109 tup(101 tup(100 tup(105 tup(97 tup(116 tup(101 tup(108 tup(121 tup(63 tup(33 w3))))))))))))) w3))) } -::guessing_game::main::23 { +::guessing_game::main::22 { x(w7 w5) ::std::n32::N32::to_string = fn(w7 w2) ::std::list::List::concat = fn(tup(3 tup(tup(105 tup(110 tup(32 w8))) w8)) fn(w2 w3)) ::std::list::List::concat = fn(w3 fn(tup(9 tup(tup(32 tup(103 tup(117 tup(101 tup(115 tup(115 tup(101 tup(115 tup(33 w9))))))))) w9)) w5)) } -::guessing_game::main::30 { +::guessing_game::main::29 { x(w12 x(w10 x(w9 x(w13 _)))) ::guessing_game::main::14 = x(w12 x(w10 x(w9 w13))) } @@ -85,7 +85,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup563(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup553(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -108,11 +108,11 @@ ::std::io::IO::read_line { fn(ref(w3 w18) w15) - ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup608(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::io::IO::read_byte = fn(ref(w3 w8) fn(0 dup598(@ne(0 ?(::std::io::IO::read_line::4 ::std::io::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::io::IO::read_line::3 { - x(w5 x(dup615(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup605(@eq(10 ?(::std::io::IO::read_line::7 ::std::io::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::option::Option::Some = fn(w8 w1) } @@ -127,7 +127,7 @@ ::std::io::IO::read_line::8 { x(x(w10 w18) w8) - ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup632(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::io::IO::read_byte = fn(ref(w10 w1) fn(10 dup622(@ne(10 ?(::std::io::IO::read_line::11 ::std::io::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::io::IO::read_line::10 { @@ -144,7 +144,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup962(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup952(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -153,7 +153,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2256(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2233(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -162,10 +162,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2266(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2243(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2269(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2246(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -173,7 +173,7 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::parse { fn(tup(dup2276(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } +::std::n32::N32::parse { fn(tup(dup2253(?(::std::n32::N32::parse::4 ::std::n32::N32::parse::3 x(w13 x(w7 w11))) w13) tup(w7 _)) w11) } ::std::n32::N32::parse::3 { x(w5 x(w4 w6)) @@ -185,10 +185,10 @@ ::std::n32::N32::parse::11 = x(w4 ::std::option::Option::None) } -::std::n32::N32::parse::5 { x(dup2287(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } +::std::n32::N32::parse::5 { x(dup2264(?(::std::n32::N32::parse::7 ::std::n32::N32::parse::6 x(w8 w3)) w8) w3) } ::std::n32::N32::parse::6 { - x(w18 x(tup(dup2296(dup2291(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2273(dup2268(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::n32::N32::parse::10 ::std::n32::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -230,7 +230,7 @@ ::std::rng::Rng::new { fn(w2 fn(w3 tup(w17 w20))) ::std::n64::N64::from_n32 = fn(1 w7) - ::std::n64::N64::or = fn(w3 fn(w7 dup3039(w11 dup3039(w16 w20)))) + ::std::n64::N64::or = fn(w3 fn(w7 dup3006(w11 dup3006(w16 w20)))) ::std::n64::N64::add = fn(w2 fn(w11 w12)) ::std::n64::N64::mul = fn(w12 fn(::std::rng::Rng::multiplier w15)) ::std::n64::N64::add = fn(w15 fn(w16 w17)) @@ -244,14 +244,14 @@ ::std::rng::Rng::multiplier { tup(1284865837 1481765933) } ::std::rng::Rng::gen_n32 { - fn(ref(tup(dup3047(tup(@n32_shr(27 w26) dup3050(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup3050(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup3048(w4 w17)) tup(w18 w4)) w30) + fn(ref(tup(dup3014(tup(@n32_shr(27 w26) dup3017(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup3017(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup3015(w4 w17)) tup(w18 w4)) w30) ::std::n64::N64::mul = fn(w15 fn(::std::rng::Rng::multiplier w16)) ::std::n64::N64::add = fn(w16 fn(w17 w18)) ::std::n32::N32::rotate_right = fn(w27 fn(w29 w30)) } ::std::rng::Rng::mix { - fn(ref(tup(w3 dup3057(w4 w19)) tup(w20 w4)) fn(w9 _)) + fn(ref(tup(w3 dup3024(w4 w19)) tup(w20 w4)) fn(w9 _)) ::std::n64::N64::xor = fn(w3 fn(tup(0 w9) w15)) ::std::n64::N64::mul = fn(w15 fn(::std::rng::Rng::multiplier w18)) ::std::n64::N64::add = fn(w18 fn(w19 w20)) diff --git a/tests/snaps/vine/hello_world/compiled.iv b/tests/snaps/vine/hello_world/compiled.iv index 562a5f05..212d55ab 100644 --- a/tests/snaps/vine/hello_world/compiled.iv +++ b/tests/snaps/vine/hello_world/compiled.iv @@ -17,7 +17,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup474(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup466(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/inverse/compiled.iv b/tests/snaps/vine/inverse/compiled.iv index 6f75c8f6..32be64d4 100644 --- a/tests/snaps/vine/inverse/compiled.iv +++ b/tests/snaps/vine/inverse/compiled.iv @@ -29,20 +29,20 @@ ::inverse::refs::inc { fn(tup(@add(1 w8) w8) _) } ::inverse::fns { - fn(ref(w3 w34) _) - ::inverse::fns::call = fn(w19 fn(1 w20)) - ::std::n32::N32::to_string = fn(w20 w21) - ::std::list::List::concat = fn(tup(7 tup(tup(102 tup(40 tup(49 tup(41 tup(32 tup(61 tup(32 w42))))))) w42)) fn(w21 w22)) - ::std::io::IO::println = fn(ref(w3 w16) fn(w22 _)) - ::inverse::fns::call = fn(w28 fn(2 w29)) - ::std::n32::N32::to_string = fn(w29 w30) - ::std::list::List::concat = fn(tup(7 tup(tup(102 tup(40 tup(50 tup(41 tup(32 tup(61 tup(32 w43))))))) w43)) fn(w30 w31)) - ::std::io::IO::println = fn(ref(w16 w25) fn(w31 _)) - ::inverse::fns::call = fn(w37 fn(3 w38)) - ::std::n32::N32::to_string = fn(w38 w39) - ::std::list::List::concat = fn(tup(7 tup(tup(102 tup(40 tup(51 tup(41 tup(32 tup(61 tup(32 w44))))))) w44)) fn(w39 w40)) - ::std::io::IO::println = fn(ref(w25 w34) fn(w40 _)) - tup(dup33(@mul(w11 w12) w11) w12) = dup35(w19 dup35(w28 w37)) + fn(ref(w3 w28) _) + ::inverse::fns::call = fn(w13 fn(1 w14)) + ::std::n32::N32::to_string = fn(w14 w15) + ::std::list::List::concat = fn(tup(7 tup(tup(102 tup(40 tup(49 tup(41 tup(32 tup(61 tup(32 w43))))))) w43)) fn(w15 w16)) + ::std::io::IO::println = fn(ref(w3 w10) fn(w16 _)) + ::inverse::fns::call = fn(w22 fn(2 w23)) + ::std::n32::N32::to_string = fn(w23 w24) + ::std::list::List::concat = fn(tup(7 tup(tup(102 tup(40 tup(50 tup(41 tup(32 tup(61 tup(32 w44))))))) w44)) fn(w24 w25)) + ::std::io::IO::println = fn(ref(w10 w19) fn(w25 _)) + ::inverse::fns::call = fn(w31 fn(3 w32)) + ::std::n32::N32::to_string = fn(w32 w33) + ::std::list::List::concat = fn(tup(7 tup(tup(102 tup(40 tup(51 tup(41 tup(32 tup(61 tup(32 w45))))))) w45)) fn(w33 w34)) + ::std::io::IO::println = fn(ref(w19 w28) fn(w34 _)) + tup(dup33(@mul(w40 w41) w40) w41) = dup35(w13 dup35(w22 w31)) } ::inverse::fns::call { fn(tup(w3 w8) fn(w3 w8)) } @@ -61,10 +61,10 @@ ::std::io::IO::println = fn(ref(w27 w37) fn(w44 _)) ::inverse::rev::set = fn(ref(w41 _) fn(tup(1 tup(tup(50 w57) w57)) _)) _ = tup(1 tup(tup(48 w51) w51)) - tup(1 tup(tup(49 w54) w54)) = dup52(w14 w21) + tup(1 tup(tup(49 w54) w54)) = dup53(w14 w21) } -::inverse::rev::get { fn(ref(w3 dup58(w3 w7)) w7) } +::inverse::rev::get { fn(ref(w3 dup59(w3 w7)) w7) } ::inverse::rev::set { fn(ref(w5 _) fn(w5 _)) } @@ -79,7 +79,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup535(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup528(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -93,7 +93,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2228(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2208(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -102,10 +102,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2238(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2218(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2241(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2221(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/logic/compiled.iv b/tests/snaps/vine/logic/compiled.iv index 1b14ec5b..68aed994 100644 --- a/tests/snaps/vine/logic/compiled.iv +++ b/tests/snaps/vine/logic/compiled.iv @@ -48,7 +48,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup540(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup532(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/loop_break_continue/compiled.iv b/tests/snaps/vine/loop_break_continue/compiled.iv index 1cf72278..dade2852 100644 --- a/tests/snaps/vine/loop_break_continue/compiled.iv +++ b/tests/snaps/vine/loop_break_continue/compiled.iv @@ -19,7 +19,7 @@ } ::loop_break_continue::main::8 { - x(x(w3 w17) x(dup29(w11 w15) w14)) + x(x(w3 w17) x(dup28(w11 w15) w14)) ::std::n32::N32::to_string = fn(w11 w12) ::std::io::IO::println = fn(ref(w3 w9) fn(w12 _)) ::loop_break_continue::main::2 = x(x(w9 w17) x(w15 w14)) @@ -36,7 +36,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup500(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup490(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -50,7 +50,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2193(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2170(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -59,10 +59,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2203(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2180(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2206(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2183(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/loop_vi_loop/compiled.iv b/tests/snaps/vine/loop_vi_loop/compiled.iv index c9d17e24..4e6de046 100644 --- a/tests/snaps/vine/loop_vi_loop/compiled.iv +++ b/tests/snaps/vine/loop_vi_loop/compiled.iv @@ -38,7 +38,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup504(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup496(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -52,7 +52,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2197(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2176(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -61,10 +61,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2207(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2186(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2210(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2189(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/mandelbrot_sixel/compiled.iv b/tests/snaps/vine/mandelbrot_sixel/compiled.iv index 13264750..2fb7f265 100644 --- a/tests/snaps/vine/mandelbrot_sixel/compiled.iv +++ b/tests/snaps/vine/mandelbrot_sixel/compiled.iv @@ -61,7 +61,7 @@ x(x(w29 w47) x(dup70(w2 w45) x(dup71(w37 w44) x(w25 x(x(w24 w42) dup77(w1 @add(1 w21))))))) +2.6 = @div(512 @mul(w7 w8)) tup(w1 w2) = @add(+0.5 @sub(w6 w7)) - tup(512 512) = @div(+2.0 w6) + 512 = @div(+2.0 w6) ::mandelbrot_sixel::center = @add(w8 tup(w10 w11)) ::mandelbrot_sixel::mandelbrot = fn(w10 fn(w11 dup81(@ne(w25 ?(::mandelbrot_sixel::main::13 ::mandelbrot_sixel::main::12 x(x(w29 w39) x(w37 x(x(w24 w36) x(w34 _)))))) dup81(w34 w18)))) ::mandelbrot_sixel::main::8 = x(x(w39 w47) x(w45 x(w44 x(w18 x(x(w36 w42) w21))))) @@ -108,7 +108,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup606(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup598(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -125,7 +125,7 @@ ::std::io::IO::print_bytes::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print_bytes::2 { x(w4 x(dup628(?(::std::io::IO::print_bytes::4 ::std::io::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print_bytes::2 { x(w4 x(dup620(?(::std::io::IO::print_bytes::4 ::std::io::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print_bytes::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -141,7 +141,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2299(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2278(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -150,10 +150,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2309(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2288(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2312(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2291(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/mandelbrot_sixel/stats.txt b/tests/snaps/vine/mandelbrot_sixel/stats.txt index 9da86aac..de347283 100644 --- a/tests/snaps/vine/mandelbrot_sixel/stats.txt +++ b/tests/snaps/vine/mandelbrot_sixel/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 199_183_095 - Annihilate 78_029_803 - Commute 1_310_720 + Total 198_396_663 + Annihilate 77_767_659 + Commute 1_048_576 Copy 40_528_299 Erase 7_807_974 Expand 10_836_410 - Call 55_514_615 + Call 55_252_471 Branch 5_155_274 Memory Heap 1_360 B - Allocated 4_330_628_640 B - Freed 4_330_628_640 B + Allocated 4_301_268_512 B + Freed 4_301_268_512 B diff --git a/tests/snaps/vine/mandelbrot_tga/compiled.iv b/tests/snaps/vine/mandelbrot_tga/compiled.iv index 228f9932..2fd5cf9c 100644 --- a/tests/snaps/vine/mandelbrot_tga/compiled.iv +++ b/tests/snaps/vine/mandelbrot_tga/compiled.iv @@ -30,7 +30,7 @@ x(x(w25 w29) x(dup30(w2 w27) dup31(w1 @add(1 w21)))) +2.6 = @div(1024 @mul(w7 w8)) tup(w1 w2) = @add(+0.5 @sub(w6 w7)) - tup(1024 1024) = @div(+2.0 w6) + 1024 = @div(+2.0 w6) ::mandelbrot_tga::center = @add(w8 tup(w10 w11)) ::mandelbrot_tga::mandelbrot = fn(w10 fn(w11 w18)) ::std::io::IO::print_byte = fn(ref(w25 w14) fn(w18 _)) @@ -60,7 +60,7 @@ ::std::io::IO::print_bytes::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print_bytes::2 { x(w4 x(dup559(?(::std::io::IO::print_bytes::4 ::std::io::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print_bytes::2 { x(w4 x(dup551(?(::std::io::IO::print_bytes::4 ::std::io::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print_bytes::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/mandelbrot_tga/stats.txt b/tests/snaps/vine/mandelbrot_tga/stats.txt index a2afbf7f..3c3bdc07 100644 --- a/tests/snaps/vine/mandelbrot_tga/stats.txt +++ b/tests/snaps/vine/mandelbrot_tga/stats.txt @@ -1,15 +1,15 @@ Interactions - Total 896_214_435 - Annihilate 346_595_362 - Commute 5_242_880 + Total 893_068_707 + Annihilate 345_546_786 + Commute 4_194_304 Copy 187_291_005 Erase 29_202_402 Expand 46_866_345 - Call 259_156_143 + Call 258_107_567 Branch 21_860_298 Memory Heap 784 B - Allocated 19_551_869_536 B - Freed 19_551_869_536 B + Allocated 19_434_429_024 B + Freed 19_434_429_024 B diff --git a/tests/snaps/vine/map_test/compiled.iv b/tests/snaps/vine/map_test/compiled.iv index 75d041da..b0c5ec54 100644 --- a/tests/snaps/vine/map_test/compiled.iv +++ b/tests/snaps/vine/map_test/compiled.iv @@ -68,7 +68,7 @@ ::std::io::IO::println = fn(ref(w7 w1) fn(tup(10 tup(tup(105 tup(109 tup(98 tup(97 tup(108 tup(97 tup(110 tup(99 tup(101 tup(100 w8)))))))))) w8)) _)) } -::map_test::main::20 { x(w7 x(w5 x(w3 dup101(@lt$(0 ?(::map_test::main::22 ::map_test::main::21 x(w7 x(w5 x(w3 w8))))) w8)))) } +::map_test::main::20 { x(w7 x(w5 x(w3 dup98(@lt$(0 ?(::map_test::main::22 ::map_test::main::21 x(w7 x(w5 x(w3 w8))))) w8)))) } ::map_test::main::21 { x(x(w13 w31) x(x(w11 w29) x(w9 @sub(1 w1)))) @@ -79,7 +79,7 @@ ::map_test::main::22 { x(x(w5 w5) x(x(w3 w3) _)) } -::map_test::main::26 { enum(ref(dup121(w1 @ne(w11 ?(::map_test::main::29 ::map_test::main::30 x(w7 x(w14 w13))))) w1) x(w7 x(dup120(@mul(w10 w11) dup120(w10 w14)) w13))) } +::map_test::main::26 { enum(ref(dup118(w1 @ne(w11 ?(::map_test::main::29 ::map_test::main::30 x(w7 x(w14 w13))))) w1) x(w7 x(dup117(@mul(w10 w11) dup117(w10 w14)) w13))) } ::map_test::main::29 { x(x(w3 w3) _) } @@ -90,10 +90,10 @@ ::std::io::IO::println = fn(ref(w11 w1) fn(w6 _)) } -::map_test::main::31 { x(w6 x(w4 x(w3 dup142(@lt$(0 ?(::map_test::main::33 ::map_test::main::32 x(w6 x(w4 x(w3 w7))))) w7)))) } +::map_test::main::31 { x(w6 x(w4 x(w3 dup138(@lt$(0 ?(::map_test::main::33 ::map_test::main::32 x(w6 x(w4 x(w3 w7))))) w7)))) } ::map_test::main::32 { - x(x(w13 w38) x(w11 x(w10 @sub(1 dup153(@rem(100 ?(::map_test::main::44 ::map_test::main::43 x(x(w25 w33) x(x(w15 w31) x(w29 _))))) dup153(w29 w34)))))) + x(x(w13 w38) x(w11 x(w10 @sub(1 dup149(@rem(100 ?(::map_test::main::44 ::map_test::main::43 x(x(w25 w33) x(x(w15 w31) x(w29 _))))) dup149(w29 w34)))))) ::std::rng::Rng::gen_n32 = fn(ref(w10 w3) w5) ::std::map::Map::remove = fn(ref(w11 w15) fn(ref(w5 w18) enum(::map_test::main::37 enum(::map_test::main::41 x(x(w13 w25) x(w18 _)))))) ::map_test::main::31 = x(x(w33 w38) x(w31 x(w3 w34))) @@ -101,7 +101,7 @@ ::map_test::main::33 { x(x(w4 w4) _) } -::map_test::main::37 { enum(@ne(w9 ?(::map_test::main::40 ::map_test::main::41 x(w5 x(w12 w11)))) x(w5 x(dup162(@mul(w8 w9) dup162(w8 w12)) w11))) } +::map_test::main::37 { enum(@ne(w9 ?(::map_test::main::40 ::map_test::main::41 x(w5 x(w12 w11)))) x(w5 x(dup158(@mul(w8 w9) dup158(w8 w12)) w11))) } ::map_test::main::40 { x(x(w3 w3) _) } @@ -137,7 +137,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup663(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup649(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -149,7 +149,7 @@ ::std::io::IO::print_char { fn(ref(@io_print_char(char io) io) fn(char _)) } -::std::list::List::pop_front { fn(ref(tup(dup866(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } +::std::list::List::pop_front { fn(ref(tup(dup852(?(::std::list::List::pop_front::4 ::std::list::List::pop_front::3 x(x(w17 w18) x(x(w5 w16) w14))) w17) tup(w5 w6)) tup(w18 tup(w16 w6))) w14) } ::std::list::List::pop_front::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -167,7 +167,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1062(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1048(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -184,20 +184,20 @@ ::std::map::Map::new { fn(w2 tup(w2 ::std::map::Node::leaf)) } -::std::map::Map::len { fn(ref(tup(w2 tup(dup1483(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } +::std::map::Map::len { fn(ref(tup(w2 tup(dup1461(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } ::std::map::Map::insert { - fn(ref(tup(dup1487(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1465(w2 w16) w5) tup(w2 w14)) w9) ::std::map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::map::Map::get { - fn(ref(tup(dup1508(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1486(w2 w17) w5) tup(w2 w15)) w10) ::std::map::Node::get = fn(ref(w5 w15) fn(w17 w10)) } ::std::map::Map::remove { - fn(ref(tup(dup1532(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1510(w2 w17) w5) tup(w2 w15)) w10) ::std::map::Node::remove = fn(ref(w5 w15) fn(w17 w10)) } @@ -209,7 +209,7 @@ ::std::list::List::pop_front = fn(ref(w15 w19) enum(::std::map::Map::Iter::next::9 enum(::std::map::Map::Iter::next::10 x(x(w17 w25) w23)))) } -::std::map::Map::Iter::next::2 { x(x(ref(tup(dup1590(w2 ?(::std::map::Map::Iter::next::5 ::std::map::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } +::std::map::Map::Iter::next::2 { x(x(ref(tup(dup1568(w2 ?(::std::map::Map::Iter::next::5 ::std::map::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } ::std::map::Map::Iter::next::4 { x(x(_ w48) x(x(w4 w46) x(x(w2 w18) w44))) @@ -229,7 +229,7 @@ ::std::map::Node::leaf { tup(0 _) } -::std::map::Node::size { fn(ref(tup(dup1736(w2 w10) w4) tup(w2 w4)) w10) } +::std::map::Node::size { fn(ref(tup(dup1711(w2 w10) w4) tup(w2 w4)) w10) } ::std::map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -237,10 +237,10 @@ ::std::map::Node::size = fn(ref(w4 w12) w14) } -::std::map::Node::insert { fn(ref(tup(dup1749(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } +::std::map::Node::insert { fn(ref(tup(dup1724(?(::std::map::Node::insert::4 ::std::map::Node::insert::3 x(x(w22 w23) x(x(w5 w21) x(w9 x(w10 x(w11 w16)))))) w22) w5) tup(w23 w21)) fn(w9 fn(w10 fn(w11 w16)))) } ::std::map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1764(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) + x(w26 x(x(w24 w50) x(dup1739(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::insert::9 enum(::std::map::Node::insert::10 enum(::std::map::Node::insert::11 x(w26 x(x(w1 w50) x(w48 x(w29 x(w20 x(x(w4 w45) x(x(w32 w43) x(x(w8 w41) x(x(w12 w39) x(w37 _))))))))))))))) w48) x(w21 x(w20 w37))))) ref(w24 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w45 tup(tup(w43 w41) w39))) } @@ -265,10 +265,10 @@ ::std::map::balance_left = fn(ref(w26 w31) _) } -::std::map::Node::get { fn(ref(tup(dup1825(w2 ?(::std::map::Node::get::4 ::std::map::Node::get::3 x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w5) tup(w2 w22)) fn(w9 fn(ref(w11 w19) w17))) } +::std::map::Node::get { fn(ref(tup(dup1800(w2 ?(::std::map::Node::get::4 ::std::map::Node::get::3 x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w5) tup(w2 w22)) fn(w9 fn(ref(w11 w19) w17))) } ::std::map::Node::get::3 { - x(x(w22 w1) x(dup1837(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::map::Node::get::9 enum(::std::map::Node::get::10 enum(::std::map::Node::get::11 x(w41 x(x(w25 w40) x(x(w4 w38) x(x(w8 w36) x(x(w12 w34) w32)))))))))) w41) x(x(w19 w40) w32))) + x(x(w22 w1) x(dup1812(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::map::Node::get::9 enum(::std::map::Node::get::10 enum(::std::map::Node::get::11 x(w41 x(x(w25 w40) x(x(w4 w38) x(x(w8 w36) x(x(w12 w34) w32)))))))))) w41) x(x(w19 w40) w32))) ref(w22 w1) = ref(tup(w4 tup(tup(w6 w8) w12)) tup(w38 tup(tup(w28 w36) w34))) } @@ -289,11 +289,11 @@ ::std::map::Node::get = fn(ref(w2 w11) fn(w9 fn(ref(w8 w15) w17))) } -::std::map::Node::remove { fn(ref(tup(dup2020(?(::std::map::Node::remove::4 ::std::map::Node::remove::3 x(x(w23 w24) x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w23) w5) tup(w24 w22)) fn(w9 fn(ref(w11 w19) w17))) } +::std::map::Node::remove { fn(ref(tup(dup1995(?(::std::map::Node::remove::4 ::std::map::Node::remove::3 x(x(w23 w24) x(x(w5 w22) x(w9 x(x(w11 w19) w17))))) w23) w5) tup(w24 w22)) fn(w9 fn(ref(w11 w19) w17))) } ::std::map::Node::remove::3 { - x(w26 x(x(w24 w47) x(dup2035(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::remove::9 enum(::std::map::Node::remove::10 enum(::std::map::Node::remove::11 x(w26 x(x(w1 w47) x(w45 x(x(w29 w44) x(x(w4 w42) x(w40 x(x(w12 w39) x(w37 _))))))))))))) w45) x(x(w21 w44) w37)))) - ref(w24 w1) = ref(tup(w4 tup(tup(w6 dup2043(w7 w40)) w12)) tup(w42 tup(tup(w32 w7) w39))) + x(w26 x(x(w24 w47) x(dup2010(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::map::Node::remove::9 enum(::std::map::Node::remove::10 enum(::std::map::Node::remove::11 x(w26 x(x(w1 w47) x(w45 x(x(w29 w44) x(x(w4 w42) x(w40 x(x(w12 w39) x(w37 _))))))))))))) w45) x(x(w21 w44) w37)))) + ref(w24 w1) = ref(tup(w4 tup(tup(w6 dup2018(w7 w40)) w12)) tup(w42 tup(tup(w32 w7) w39))) } ::std::map::Node::remove::4 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) ::std::option::Option::None)))) } @@ -346,7 +346,7 @@ ::std::map::Node::remove_max::4 { x(x(_ w2) x(_ x(x(tup(_ w2) _) x(x(w12 _) x(x(w10 w10) w12))))) } -::std::map::Node::balanced { fn(ref(tup(dup2170(w2 ?(::std::map::Node::balanced::4 ::std::map::Node::balanced::3 x(x(w5 w15) w13))) w5) tup(w2 w15)) w13) } +::std::map::Node::balanced { fn(ref(tup(dup2145(w2 ?(::std::map::Node::balanced::4 ::std::map::Node::balanced::3 x(x(w5 w15) w13))) w5) tup(w2 w15)) w13) } ::std::map::Node::balanced::3 { x(x(w16 w1) w30) @@ -429,43 +429,43 @@ } ::std::map::merge_balanced::3 { - x(w4 x(w3 x(w2 w9))) - ::std::map::Node::size = fn(ref(w2 w6) ?(::std::map::merge_balanced::7 ::std::map::merge_balanced::6 x(w4 x(w3 x(w6 w9))))) + x(w7 x(w6 x(w5 w8))) + ::std::map::Node::size = fn(ref(w5 w1) ?(::std::map::merge_balanced::6 ::std::map::merge_balanced::5 x(w7 x(w6 x(w1 w8))))) } ::std::map::merge_balanced::4 { x(_ x(_ x(tup(_ w1) w1))) } -::std::map::merge_balanced::6 { - x(w4 x(w3 x(w2 w14))) - ::std::map::Node::size = fn(ref(w3 w6) @lt$(w12 ?(::std::map::merge_balanced::10 ::std::map::merge_balanced::9 x(w4 x(w6 x(w10 w14)))))) - ::std::map::Node::size = fn(ref(w2 w10) w12) +::std::map::merge_balanced::5 { + x(w12 x(w11 x(w10 w13))) + ::std::map::Node::size = fn(ref(w11 w1) @lt$(w7 ?(::std::map::merge_balanced::8 ::std::map::merge_balanced::7 x(w12 x(w1 x(w5 w13)))))) + ::std::map::Node::size = fn(ref(w10 w5) w7) } -::std::map::merge_balanced::7 { x(_ x(tup(_ w1) x(_ w1))) } +::std::map::merge_balanced::6 { x(_ x(tup(_ w1) x(_ w1))) } -::std::map::merge_balanced::9 { +::std::map::merge_balanced::7 { x(w13 x(w12 x(w11 tup(w1 tup(w4 w11))))) ::std::map::Node::remove_max = fn(ref(w12 w1) fn(w13 w4)) } -::std::map::merge_balanced::10 { +::std::map::merge_balanced::8 { x(w13 x(w12 x(w11 tup(w12 tup(w4 w1))))) ::std::map::Node::remove_min = fn(ref(w11 w1) fn(w13 w4)) } ::std::map::is_balanced { - fn(ref(tup(dup2340(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2341(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2313(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2314(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::map::is_single { - fn(ref(tup(dup2345(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2346(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2318(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2319(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::map::size { fn(ref(tup(tup(dup2350(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2351(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::map::size { fn(ref(tup(tup(dup2323(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2324(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } -::std::n32::N32::to_string { fn(dup2356(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2329(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -474,10 +474,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2366(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2339(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2369(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2342(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -487,11 +487,11 @@ ::std::n32::N32::rotate_right { fn(@n32_rotr(x y) fn(x y)) } -::std::n32::N32::cmp { fn(ref(dup2424(w2 dup2424(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2425(w5 dup2425(w12 w15)) w5) w14)) } +::std::n32::N32::cmp { fn(ref(dup2396(w2 dup2396(@lt(w12 ?(::std::n32::N32::cmp::4 ::std::n32::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2397(w5 dup2397(w12 w15)) w5) w14)) } ::std::n32::N32::cmp::3 { x(_ x(_ ::std::map::Ord::Lt)) } -::std::n32::N32::cmp::4 { x(@lt$(w2 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w7)) x(w2 w7)) } +::std::n32::N32::cmp::4 { x(@lt$(w4 ?(::std::map::Ord::Eq ::std::map::Ord::Gt w6)) x(w4 w6)) } ::std::n64::N64::from_n32 { fn(w2 tup(w2 0)) } @@ -510,7 +510,7 @@ ::std::rng::Rng::new { fn(w2 fn(w3 tup(w17 w20))) ::std::n64::N64::from_n32 = fn(1 w7) - ::std::n64::N64::or = fn(w3 fn(w7 dup3139(w11 dup3139(w16 w20)))) + ::std::n64::N64::or = fn(w3 fn(w7 dup3102(w11 dup3102(w16 w20)))) ::std::n64::N64::add = fn(w2 fn(w11 w12)) ::std::n64::N64::mul = fn(w12 fn(::std::rng::Rng::multiplier w15)) ::std::n64::N64::add = fn(w15 fn(w16 w17)) @@ -524,14 +524,14 @@ ::std::rng::Rng::multiplier { tup(1284865837 1481765933) } ::std::rng::Rng::gen_n32 { - fn(ref(tup(dup3147(tup(@n32_shr(27 w26) dup3150(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup3150(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup3148(w4 w17)) tup(w18 w4)) w30) + fn(ref(tup(dup3110(tup(@n32_shr(27 w26) dup3113(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup3113(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup3111(w4 w17)) tup(w18 w4)) w30) ::std::n64::N64::mul = fn(w15 fn(::std::rng::Rng::multiplier w16)) ::std::n64::N64::add = fn(w16 fn(w17 w18)) ::std::n32::N32::rotate_right = fn(w27 fn(w29 w30)) } ::std::rng::Rng::mix { - fn(ref(tup(w3 dup3157(w4 w19)) tup(w20 w4)) fn(w9 _)) + fn(ref(tup(w3 dup3120(w4 w19)) tup(w20 w4)) fn(w9 _)) ::std::n64::N64::xor = fn(w3 fn(tup(0 w9) w15)) ::std::n64::N64::mul = fn(w15 fn(::std::rng::Rng::multiplier w18)) ::std::n64::N64::add = fn(w18 fn(w19 w20)) diff --git a/tests/snaps/vine/maybe_set/compiled.iv b/tests/snaps/vine/maybe_set/compiled.iv index dcec02de..4306c754 100644 --- a/tests/snaps/vine/maybe_set/compiled.iv +++ b/tests/snaps/vine/maybe_set/compiled.iv @@ -22,7 +22,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup481(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup472(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/no_return/compiled.iv b/tests/snaps/vine/no_return/compiled.iv index 6161dec5..3902c529 100644 --- a/tests/snaps/vine/no_return/compiled.iv +++ b/tests/snaps/vine/no_return/compiled.iv @@ -17,7 +17,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup474(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup466(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/option_party/compiled.iv b/tests/snaps/vine/option_party/compiled.iv index d60638b4..e9f099e0 100644 --- a/tests/snaps/vine/option_party/compiled.iv +++ b/tests/snaps/vine/option_party/compiled.iv @@ -170,7 +170,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup680(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup672(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -184,7 +184,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2373(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2352(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -193,10 +193,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2383(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2362(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2386(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2365(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/pretty_div/compiled.iv b/tests/snaps/vine/pretty_div/compiled.iv index ffe20321..ea7893e7 100644 --- a/tests/snaps/vine/pretty_div/compiled.iv +++ b/tests/snaps/vine/pretty_div/compiled.iv @@ -42,7 +42,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup491(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup483(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -56,7 +56,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2184(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2163(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -65,10 +65,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2194(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2173(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2197(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2176(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/primeness/compiled.iv b/tests/snaps/vine/primeness/compiled.iv index dc03d7ca..d157c717 100644 --- a/tests/snaps/vine/primeness/compiled.iv +++ b/tests/snaps/vine/primeness/compiled.iv @@ -20,9 +20,9 @@ ::primeness::8 = x(w1 x(2 w9)) } -::primeness::8 { x(dup14(w3 w10) x(dup15(@mul(w1 @le(w3 ?(::primeness::10 ::primeness::9 x(w10 x(w9 w8))))) dup15(w1 w9)) w8)) } +::primeness::8 { x(dup12(w3 w10) x(dup13(@mul(w1 @le(w3 ?(::primeness::10 ::primeness::9 x(w10 x(w9 w8))))) dup13(w1 w9)) w8)) } -::primeness::9 { x(dup17(@rem(w7 ?(::primeness::13 ::primeness::12 x(w11 x(w10 w9)))) w11) x(dup18(w7 w10) w9)) } +::primeness::9 { x(dup15(@rem(w7 ?(::primeness::13 ::primeness::12 x(w11 x(w10 w9)))) w11) x(dup16(w7 w10) w9)) } ::primeness::10 { x(_ x(_ w9)) @@ -44,10 +44,10 @@ ::primeness::main::2 = x(x(w3 w10) 0) } -::primeness::main::2 { x(w4 dup36(@le(46 ?(::primeness::main::4 ::primeness::main::3 x(w4 w5))) w5)) } +::primeness::main::2 { x(w4 dup33(@le(46 ?(::primeness::main::4 ::primeness::main::3 x(w4 w5))) w5)) } ::primeness::main::3 { - x(x(w17 w24) dup40(w0 dup40(w6 @add(1 w14)))) + x(x(w17 w24) dup37(w0 dup37(w6 @add(1 w14)))) ::primeness = fn(w0 enum(::primeness::main::11 enum(::primeness::main::12 w21))) ::std::n32::N32::to_string = fn(w6 w7) ::std::list::List::concat = fn(w7 fn(tup(2 tup(tup(58 tup(32 w18)) w18)) w9)) @@ -77,7 +77,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup523(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup512(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -91,7 +91,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2216(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2192(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -100,10 +100,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2226(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2202(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2229(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2205(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/repl/misc.repl.vi b/tests/snaps/vine/repl/misc.repl.vi index 9e6dd6dc..070a6e98 100644 --- a/tests/snaps/vine/repl/misc.repl.vi +++ b/tests/snaps/vine/repl/misc.repl.vi @@ -63,12 +63,12 @@ a = Array(5, Node(Node(Node(#ivy(0), #ivy(4)), #ivy(2)), Node(#ivy(1), #ivy(3))) io = #io a = Array(5, Node(Node(Node(#ivy(0), #ivy(4)), #ivy(2)), Node(#ivy(1), #ivy(3)))) -> -a.fold_front(0, fn(a: N32, b: N32) a - b) +> -a.fold_front(0, fn(a: N32, b: N32) { a - b }) 10 io = #io a = Array(5, Node(Node(Node(#ivy(0), #ivy(4)), #ivy(2)), Node(#ivy(1), #ivy(3)))) -> -a.fold_back(5, fn(a: N32, b: N32) a - b) +> -a.fold_back(5, fn(a: N32, b: N32) { a - b }) 5 io = #io diff --git a/tests/snaps/vine/repl/objects.repl.vi b/tests/snaps/vine/repl/objects.repl.vi new file mode 100644 index 00000000..83de2f9b --- /dev/null +++ b/tests/snaps/vine/repl/objects.repl.vi @@ -0,0 +1,112 @@ + +io = #io +> let x = { a: 1, c: 3, b: 2 } + +io = #io +x = { a: 1, b: 2, c: 3 } +> (x.a, x.b, x.c) +(1, 2, 3) + +io = #io +x = { a: 1, b: 2, c: 3 } +> (x.c, x.b, x.a) +(3, 2, 1) + +io = #io +x = { a: 1, b: 2, c: 3 } +> let y = { x } + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +> let z = { y } + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 1, b: 2, c: 3 } } } +> z.y.x.a +1 + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 1, b: 2, c: 3 } } } +> z.y.x.a += y.x.b + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +> let { y: { x: o } } = z + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +> let { c, b, a } = o + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +c = 3 +b = 2 +a = 3 +> a + b + c +8 + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +c = 3 +b = 2 +a = 3 +> x.p +error input:1:3 - type `{ a: N32, b: N32, c: N32 }` has no field `p` + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +c = 3 +b = 2 +a = 3 +> do { let { p } = x } +error input:1:18 - expected type `{ p: ?9 }`; found `{ a: N32, b: N32, c: N32 }` + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +c = 3 +b = 2 +a = 3 +> z = { Y: y } +error input:1:5 - expected type `{ y: { x: { a: N32, b: N32, c: N32 } } }`; found `{ Y: { x: { a: N32, b: N32, c: N32 } } }` + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +c = 3 +b = 2 +a = 3 +> z = { y: 1 } +error input:1:5 - expected type `{ y: { x: { a: N32, b: N32, c: N32 } } }`; found `{ y: N32 }` + +io = #io +x = { a: 1, b: 2, c: 3 } +y = { x: { a: 1, b: 2, c: 3 } } +z = { y: { x: { a: 3, b: 2, c: 3 } } } +o = { a: 3, b: 2, c: 3 } +c = 3 +b = 2 +a = 3 diff --git a/tests/snaps/vine/segmented_sieve/compiled.iv b/tests/snaps/vine/segmented_sieve/compiled.iv index fe2820e8..e1468710 100644 --- a/tests/snaps/vine/segmented_sieve/compiled.iv +++ b/tests/snaps/vine/segmented_sieve/compiled.iv @@ -31,21 +31,21 @@ ::segmented_sieve::main::9 { x(x(w9 w9) x(_ x(x(w6 w6) x(_ x(x(w3 w3) _))))) } -::segmented_sieve::main::10 { x(dup58(w1 w14) x(w7 x(w5 x(w4 dup63(@lt(w1 ?(::segmented_sieve::main::12 ::segmented_sieve::main::11 x(w14 x(w7 x(w5 x(w4 w9)))))) w9))))) } +::segmented_sieve::main::10 { x(dup57(w1 w14) x(w7 x(w5 x(w4 dup62(@lt(w1 ?(::segmented_sieve::main::12 ::segmented_sieve::main::11 x(w14 x(w7 x(w5 x(w4 w9)))))) w9))))) } ::segmented_sieve::main::11 { - x(w17 x(x(w16 w22) x(dup68(w4 w20) x(dup69(w9 w19) dup70(@sub(w4 w5) @add(w9 w11)))))) + x(w17 x(x(w16 w22) x(dup67(w4 w20) x(dup68(w9 w19) dup69(@sub(w4 w5) @add(w9 w11)))))) ::std::array::Array::get = fn(ref(w16 w1) fn(w5 ref(_ 0))) ::segmented_sieve::main::10 = x(w17 x(x(w1 w22) x(w20 x(w19 w11)))) } ::segmented_sieve::main::12 { x(_ x(x(w4 w4) _)) } -::segmented_sieve::main::13 { x(w6 x(w4 x(dup76(@lt(1000000 ?(::segmented_sieve::main::15 ::segmented_sieve::main::14 x(w6 x(w4 x(w8 w2))))) w8) w2))) } +::segmented_sieve::main::13 { x(w6 x(w4 x(dup75(@lt(1000000 ?(::segmented_sieve::main::15 ::segmented_sieve::main::14 x(w6 x(w4 x(w8 w2))))) w8) w2))) } ::segmented_sieve::main::14 { - x(x(w22 w36) x(dup81(w1 dup81(w15 w34)) x(dup82(@add(w1 w2) dup82(w6 dup82(w27 dup82(w13 @add(w15 w17))))) dup84(w10 w32)))) - ::std::n32::N32::min = fn(w2 fn(1000000 dup85(@sub(w6 w7) w26))) + x(x(w22 w36) x(dup80(w1 dup80(w15 w34)) x(dup81(@add(w1 w2) dup81(w6 dup81(w27 dup81(w13 @add(w15 w17))))) dup83(w10 w32)))) + ::std::n32::N32::min = fn(w2 fn(1000000 dup84(@sub(w6 w7) w26))) ::std::array::Array::new = fn(w7 fn(1 w8)) ::std::list::List::into_iter = fn(w10 w11) ::segmented_sieve::main::16 = x(w27 x(w26 x(x(w8 w25) w11))) @@ -61,7 +61,7 @@ } ::segmented_sieve::main::19 { - enum(dup104(@mul(w8 w9) dup104(w8 dup104(w12 dup104(w15 w20)))) x(dup98(@sub(1 @div(w12 @add(1 @mul(w15 w16)))) dup98(w24 w29)) x(dup99(w23 w28) x(x(w4 w27) w2)))) + enum(dup103(@mul(w8 w9) dup103(w8 dup103(w12 dup103(w15 w20)))) x(dup97(@sub(1 @div(w12 @add(1 @mul(w15 w16)))) dup97(w24 w29)) x(dup98(w23 w28) x(x(w4 w27) w2)))) ::std::n32::N32::max = fn(w9 fn(w16 w17)) ::segmented_sieve::main::21 = x(w24 x(w23 x(x(w4 w22) x(w20 w17)))) ::segmented_sieve::main::16 = x(w29 x(w28 x(x(w22 w27) w2))) @@ -69,10 +69,10 @@ ::segmented_sieve::main::20 { x(_ x(_ x(x(w2 w2) _))) } -::segmented_sieve::main::21 { x(w8 x(dup109(w1 w13) x(w6 x(w4 dup113(@lt(w1 ?(::segmented_sieve::main::23 ::segmented_sieve::main::22 x(w8 x(w13 x(w6 x(w4 w9)))))) w9))))) } +::segmented_sieve::main::21 { x(w8 x(dup108(w1 w13) x(w6 x(w4 dup112(@lt(w1 ?(::segmented_sieve::main::23 ::segmented_sieve::main::22 x(w8 x(w13 x(w6 x(w4 w9)))))) w9))))) } ::segmented_sieve::main::22 { - x(dup114(w4 w23) x(w16 x(x(w15 w21) x(dup119(w9 w19) dup120(@sub(w4 w5) @add(w9 w11)))))) + x(dup113(w4 w23) x(w16 x(x(w15 w21) x(dup118(w9 w19) dup119(@sub(w4 w5) @add(w9 w11)))))) ::std::array::Array::get = fn(ref(w15 w1) fn(w5 ref(_ 0))) ::segmented_sieve::main::21 = x(w23 x(w16 x(x(w1 w21) x(w19 w11)))) } @@ -85,7 +85,7 @@ } ::segmented_sieve::main::27 { - enum(?(::segmented_sieve::main::31 ::segmented_sieve::main::30 x(x(w5 w13) x(w11 _))) x(x(w5 w17) x(w3 dup133(w11 @add(1 w8))))) + enum(?(::segmented_sieve::main::31 ::segmented_sieve::main::30 x(x(w5 w13) x(w11 _))) x(x(w5 w17) x(w3 dup132(w11 @add(1 w8))))) ::segmented_sieve::main::24 = x(x(w13 w17) x(w3 w8)) } @@ -100,65 +100,65 @@ ::segmented_sieve::main::31 { x(x(w3 w3) _) } ::std::array::Array::new { - fn(dup150(w6 w7) fn(w3 tup(w6 w9))) + fn(dup148(w6 w7) fn(w3 tup(w6 w9))) ::std::array::Node::new = fn(w7 fn(w3 w9)) } ::std::array::Array::get { - fn(ref(tup(dup260(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup258(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup271(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup269(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup275(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup273(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::pop_front { fn(ref(tup(dup396(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup392(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup402(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup398(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup414(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup409(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup421(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup416(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -166,7 +166,7 @@ ::std::array::Node::leaf { fn(x x) } -::std::array::Node::new { fn(dup457(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::array::Node::new { fn(dup451(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::array::Node::new::3 { x(_ x(w3 w1)) @@ -174,7 +174,7 @@ } ::std::array::Node::new::4 { - x(dup465(@add(1 @div(2 w2)) @div(2 w6)) x(dup466(w3 w7) tup(w4 w8))) + x(dup459(@add(1 @div(2 w2)) @div(2 w6)) x(dup460(w3 w7) tup(w4 w8))) ::std::array::Node::new = fn(w2 fn(w3 w4)) ::std::array::Node::new = fn(w6 fn(w7 w8)) } @@ -196,7 +196,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup613(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup603(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -217,7 +217,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup1012(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup1002(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -226,7 +226,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2306(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2283(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -235,10 +235,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2316(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2293(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2319(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2296(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -246,13 +246,13 @@ ::std::n32::N32::to_string::7 { x(_ x(w1 w1)) } -::std::n32::N32::min { fn(dup2387(@lt(w8 ?(::std::n32::N32::min::4 ::std::n32::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2388(w8 w11) w10)) } +::std::n32::N32::min { fn(dup2362(@lt(w8 ?(::std::n32::N32::min::4 ::std::n32::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2363(w8 w11) w10)) } ::std::n32::N32::min::3 { x(w3 x(_ w3)) } ::std::n32::N32::min::4 { x(_ x(w2 w2)) } -::std::n32::N32::max { fn(dup2397(@lt$(w8 ?(::std::n32::N32::max::4 ::std::n32::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2398(w8 w11) w10)) } +::std::n32::N32::max { fn(dup2372(@lt$(w8 ?(::std::n32::N32::max::4 ::std::n32::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2373(w8 w11) w10)) } ::std::n32::N32::max::3 { x(w3 x(_ w3)) } @@ -263,10 +263,10 @@ ::std::n32::N32::sqrt::2 = x(w2 x(32768 x(0 w9))) } -::std::n32::N32::sqrt::2 { x(w4 x(dup2442(?(::std::n32::N32::sqrt::4 ::std::n32::N32::sqrt::3 x(w4 x(w7 w2))) w7) w2)) } +::std::n32::N32::sqrt::2 { x(w4 x(dup2417(?(::std::n32::N32::sqrt::4 ::std::n32::N32::sqrt::3 x(w4 x(w7 w2))) w7) w2)) } ::std::n32::N32::sqrt::3 { - x(dup2445(w14 w23) x(dup2446(w1 @n32_shr(1 w6)) x(dup2449(@add(w1 dup2451(@mul(w12 @le(w14 ?(::std::n32::N32::sqrt::7 ::std::n32::N32::sqrt::6 x(x(w18 w19) x(w17 _))))) dup2451(w12 w17))) w18) w21))) + x(dup2420(w14 w23) x(dup2421(w1 @n32_shr(1 w6)) x(dup2424(@add(w1 dup2426(@mul(w12 @le(w14 ?(::std::n32::N32::sqrt::7 ::std::n32::N32::sqrt::6 x(x(w18 w19) x(w17 _))))) dup2426(w12 w17))) w18) w21))) ::std::n32::N32::sqrt::2 = x(w23 x(w6 x(w19 w21))) } diff --git a/tests/snaps/vine/sieve/compiled.iv b/tests/snaps/vine/sieve/compiled.iv index d66e0ee8..c25ab680 100644 --- a/tests/snaps/vine/sieve/compiled.iv +++ b/tests/snaps/vine/sieve/compiled.iv @@ -29,10 +29,10 @@ ::sieve::main::9 { x(x(w6 w6) x(x(w4 w4) _)) } -::sieve::main::10 { x(w6 x(w4 x(w3 dup42(@lt(100000 ?(::sieve::main::12 ::sieve::main::11 x(w6 x(w4 x(w3 w7))))) w7)))) } +::sieve::main::10 { x(w6 x(w4 x(w3 dup41(@lt(100000 ?(::sieve::main::12 ::sieve::main::11 x(w6 x(w4 x(w3 w7))))) w7)))) } ::sieve::main::11 { - x(x(w16 w21) x(dup46(w4 w19) x(dup47(w9 w18) dup48(@sub(w4 w5) @add(w9 w11))))) + x(x(w16 w21) x(dup45(w4 w19) x(dup46(w9 w18) dup47(@sub(w4 w5) @add(w9 w11))))) ::std::array::Array::get = fn(ref(w16 w1) fn(w5 ref(_ 0))) ::sieve::main::10 = x(x(w1 w21) x(w19 x(w18 w11))) } @@ -40,65 +40,65 @@ ::sieve::main::12 { x(x(w4 w4) _) } ::std::array::Array::new { - fn(dup56(w6 w7) fn(w3 tup(w6 w9))) + fn(dup55(w6 w7) fn(w3 tup(w6 w9))) ::std::array::Node::new = fn(w7 fn(w3 w9)) } ::std::array::Array::get { - fn(ref(tup(dup166(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup165(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::array::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::array::Node::as_leaf = fn(w16 w19) } -::std::array::Array::get::2 { x(w5 x(w3 dup177(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::array::Array::get::2 { x(w5 x(w3 dup176(@lt$(1 ?(::std::array::Array::get::4 ::std::array::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::array::Array::get::3 { - x(x(w13 w17) x(dup181(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup180(@rem(2 w3) @div(2 w9)) w10)) ::std::array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::array::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::array::Array::get::4 { x(x(w3 w3) _) } -::std::array::Array::pop_front { fn(ref(tup(dup302(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::array::Array::pop_front { fn(ref(tup(dup299(?(::std::array::Array::pop_front::4 ::std::array::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::array::Array::pop_front::3 { x(x(dup308(@eq(1 ?(::std::array::Array::pop_front::7 ::std::array::Array::pop_front::6 x(x(w9 w10) w2))) w9) w10) w2) } +::std::array::Array::pop_front::3 { x(x(dup305(@eq(1 ?(::std::array::Array::pop_front::6 ::std::array::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::array::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) - ::std::array::Array::pop_front::12 = x(w5 ::std::option::Option::None) + ::std::array::Array::pop_front::11 = x(w5 ::std::option::Option::None) } -::std::array::Array::pop_front::6 { - x(x(_ 0) x(ref(w2 _) w12)) +::std::array::Array::pop_front::5 { + x(x(_ 0) x(ref(w2 _) w11)) ::std::array::Node::to_leaf = fn(w2 w4) ::std::option::Option::Some = fn(w4 w5) - ::std::array::Array::pop_front::12 = x(w12 w5) + ::std::array::Array::pop_front::11 = x(w11 w5) } -::std::array::Array::pop_front::7 { - x(x(dup320(w0 @sub(1 w3)) w3) x(w6 w9)) - ::std::array::Array::pop_front::8 = x(w6 x(w0 w9)) +::std::array::Array::pop_front::6 { + x(x(dup316(w0 @sub(1 w3)) w3) x(w6 w9)) + ::std::array::Array::pop_front::7 = x(w6 x(w0 w9)) } -::std::array::Array::pop_front::8 { - x(ref(w2 w38) x(@add(1 @div(2 dup327(@eq(1 ?(::std::array::Array::pop_front::11 ::std::array::Array::pop_front::10 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) +::std::array::Array::pop_front::7 { + x(ref(w2 w38) x(@add(1 @div(2 dup323(@eq(1 ?(::std::array::Array::pop_front::10 ::std::array::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) ref(w2 w5) = ref(tup(w8 w10) tup(w36 w21)) tup(w10 w8) = tup(w17 w18) } -::std::array::Array::pop_front::10 { +::std::array::Array::pop_front::9 { x(ref(w1 _) x(_ x(x(_ w12) x(x(w12 _) w9)))) ::std::array::Node::to_leaf = fn(w1 w3) ::std::option::Option::Some = fn(w3 w9) } -::std::array::Array::pop_front::11 { +::std::array::Array::pop_front::10 { x(w6 x(w5 x(x(w4 w4) x(x(w2 w2) w36)))) - ::std::array::Array::pop_front::8 = x(w6 x(w5 w36)) + ::std::array::Array::pop_front::7 = x(w6 x(w5 w36)) } -::std::array::Array::pop_front::12 { x(w11 w11) } +::std::array::Array::pop_front::11 { x(w11 w11) } ::std::array::Node::to_leaf { fn(x x) } @@ -106,7 +106,7 @@ ::std::array::Node::leaf { fn(x x) } -::std::array::Node::new { fn(dup363(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::array::Node::new { fn(dup358(@eq(1 ?(::std::array::Node::new::4 ::std::array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::array::Node::new::3 { x(_ x(w3 w1)) @@ -114,7 +114,7 @@ } ::std::array::Node::new::4 { - x(dup371(@add(1 @div(2 w2)) @div(2 w6)) x(dup372(w3 w7) tup(w4 w8))) + x(dup366(@add(1 @div(2 w2)) @div(2 w6)) x(dup367(w3 w7) tup(w4 w8))) ::std::array::Node::new = fn(w2 fn(w3 w4)) ::std::array::Node::new = fn(w6 fn(w7 w8)) } @@ -136,7 +136,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup519(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup510(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -150,7 +150,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2212(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2190(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -159,10 +159,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2222(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2200(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2225(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2203(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/so_random/compiled.iv b/tests/snaps/vine/so_random/compiled.iv index fe6b6f60..5b8bdf00 100644 --- a/tests/snaps/vine/so_random/compiled.iv +++ b/tests/snaps/vine/so_random/compiled.iv @@ -29,7 +29,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup488(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup480(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -43,7 +43,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2181(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2160(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -52,10 +52,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2191(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2170(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2194(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2173(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) @@ -76,7 +76,7 @@ ::std::rng::Rng::new { fn(w2 fn(w3 tup(w17 w20))) ::std::n64::N64::from_n32 = fn(1 w7) - ::std::n64::N64::or = fn(w3 fn(w7 dup2964(w11 dup2964(w16 w20)))) + ::std::n64::N64::or = fn(w3 fn(w7 dup2933(w11 dup2933(w16 w20)))) ::std::n64::N64::add = fn(w2 fn(w11 w12)) ::std::n64::N64::mul = fn(w12 fn(::std::rng::Rng::multiplier w15)) ::std::n64::N64::add = fn(w15 fn(w16 w17)) @@ -90,7 +90,7 @@ ::std::rng::Rng::multiplier { tup(1284865837 1481765933) } ::std::rng::Rng::gen_n32 { - fn(ref(tup(dup2972(tup(@n32_shr(27 w26) dup2975(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2975(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2973(w4 w17)) tup(w18 w4)) w30) + fn(ref(tup(dup2941(tup(@n32_shr(27 w26) dup2944(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2944(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2942(w4 w17)) tup(w18 w4)) w30) ::std::n64::N64::mul = fn(w15 fn(::std::rng::Rng::multiplier w16)) ::std::n64::N64::add = fn(w16 fn(w17 w18)) ::std::n32::N32::rotate_right = fn(w27 fn(w29 w30)) diff --git a/tests/snaps/vine/stream_primes/compiled.iv b/tests/snaps/vine/stream_primes/compiled.iv index 365f9f34..84c7bc43 100644 --- a/tests/snaps/vine/stream_primes/compiled.iv +++ b/tests/snaps/vine/stream_primes/compiled.iv @@ -48,7 +48,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup511(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup501(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -62,7 +62,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2204(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2181(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -71,10 +71,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2214(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2191(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2217(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2194(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/sub_min/compiled.iv b/tests/snaps/vine/sub_min/compiled.iv index 7c81fd5c..50ac119c 100644 --- a/tests/snaps/vine/sub_min/compiled.iv +++ b/tests/snaps/vine/sub_min/compiled.iv @@ -57,7 +57,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup519(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup510(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -70,14 +70,14 @@ ::std::io::IO::print_char { fn(ref(@io_print_char(char io) io) fn(char _)) } ::std::list::List::map { - fn(tup(dup692(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + fn(tup(dup683(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) ::std::list::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) } -::std::list::List::map::2 { x(dup703(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } +::std::list::List::map::2 { x(dup694(?(::std::list::List::map::4 ::std::list::List::map::3 x(w10 w4)) w10) w4) } ::std::list::List::map::3 { - x(@sub(1 w18) x(tup(w1 w2) x(dup712(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + x(@sub(1 w18) x(tup(w1 w2) x(dup703(fn(w1 w9) w26) x(tup(w9 w11) w25)))) ::std::list::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) } @@ -104,7 +104,7 @@ } ::std::list::List::join::10 { - enum(w0 x(dup805(w6 w14) x(w4 x(w3 w12)))) + enum(w0 x(dup796(w6 w14) x(w4 x(w3 w12)))) ::std::list::List::concat = fn(w6 fn(w0 w8)) ::std::list::List::concat = fn(w3 fn(w8 w10)) ::std::list::List::join::7 = x(w14 x(w4 x(w10 w12))) @@ -120,9 +120,9 @@ ::std::list::List::concat = fn(w12 fn(tup(1 tup(tup(93 w17) w17)) w14)) } -::std::list::List::iter { fn(ref(tup(dup882(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::list::List::iter { fn(ref(tup(dup873(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::list::List::Iter::next { fn(ref(tup(dup889(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::Iter::next { fn(ref(tup(dup880(?(::std::list::List::Iter::next::4 ::std::list::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -133,7 +133,7 @@ ::std::list::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::list::List::IntoIter::next { fn(ref(tup(dup918(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::list::List::IntoIter::next { fn(ref(tup(dup909(?(::std::list::List::IntoIter::next::4 ::std::list::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::list::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -142,7 +142,7 @@ ::std::list::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::option::Option::None)) } -::std::n32::N32::to_string { fn(dup2212(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2190(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -151,10 +151,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2222(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2200(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2225(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2203(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/sum_divisors/compiled.iv b/tests/snaps/vine/sum_divisors/compiled.iv index dd2dfe3d..2c0c3b18 100644 --- a/tests/snaps/vine/sum_divisors/compiled.iv +++ b/tests/snaps/vine/sum_divisors/compiled.iv @@ -23,12 +23,12 @@ ::sum_divisors::2 = x(x(w21 w26) x(x(w14 w24) w16)) } -::sum_divisors::8 { x(x(dup41(@rem(w1 ?(::sum_divisors::10 ::sum_divisors::9 x(x(w11 w12) x(w10 w4)))) w11) w12) x(dup42(w1 w10) w4)) } +::sum_divisors::8 { x(x(dup40(@rem(w1 ?(::sum_divisors::10 ::sum_divisors::9 x(x(w11 w12) x(w10 w4)))) w11) w12) x(dup41(w1 w10) w4)) } ::sum_divisors::9 { x(x(w4 w4) x(_ x(w1 w1))) } ::sum_divisors::10 { - x(x(@div(w3 w5) w15) x(dup50(w0 dup50(w3 w13)) x(@mul(w0 w2) w12))) + x(x(@div(w3 w5) w15) x(dup49(w0 dup49(w3 w13)) x(@mul(w0 w2) w12))) ::sum_divisors::8 = x(x(w5 w15) x(w13 x(w2 w12))) } @@ -41,11 +41,11 @@ ::sum_divisors::main::2 = x(x(w3 w10) 1) } -::sum_divisors::main::2 { x(w4 dup69(@le(100 ?(::sum_divisors::main::4 ::sum_divisors::main::3 x(w4 w5))) w5)) } +::sum_divisors::main::2 { x(w4 dup67(@le(100 ?(::sum_divisors::main::4 ::sum_divisors::main::3 x(w4 w5))) w5)) } ::sum_divisors::main::3 { - x(x(w22 w33) dup73(w0 dup73(@add(1 w25) dup73(w29 dup73(w8 @add(1 w19)))))) - ::sum_divisors = fn(w0 dup75(@eq(w25 ?(::sum_divisors::main::7 ::sum_divisors::main::6 x(w29 x(w28 w27)))) dup75(w28 w12))) + x(x(w22 w33) dup71(w0 dup71(@add(1 w25) dup71(w29 dup71(w8 @add(1 w19)))))) + ::sum_divisors = fn(w0 dup73(@eq(w25 ?(::sum_divisors::main::7 ::sum_divisors::main::6 x(w29 x(w28 w27)))) dup73(w28 w12))) ::std::n32::N32::to_string = fn(w8 w9) ::std::list::List::concat = fn(w9 fn(tup(2 tup(tup(58 tup(32 w30)) w30)) w11)) ::std::n32::N32::to_string = fn(w12 w13) @@ -59,11 +59,11 @@ ::sum_divisors::main::6 { x(_ x(_ tup(8 tup(tup(32 tup(40 tup(112 tup(114 tup(105 tup(109 tup(101 tup(41 w4)))))))) w4)))) } -::sum_divisors::main::7 { x(@mul(2 w6) x(@eq(w6 ?(::sum_divisors::main::10 ::sum_divisors::main::9 w8)) w8)) } +::sum_divisors::main::7 { x(@mul(2 w2) x(@eq(w2 ?(::sum_divisors::main::9 ::sum_divisors::main::8 w7)) w7)) } -::sum_divisors::main::9 { tup(11 tup(tup(32 tup(40 tup(112 tup(101 tup(114 tup(102 tup(101 tup(99 tup(116 tup(33 tup(41 w2))))))))))) w2)) } +::sum_divisors::main::8 { tup(11 tup(tup(32 tup(40 tup(112 tup(101 tup(114 tup(102 tup(101 tup(99 tup(116 tup(33 tup(41 w2))))))))))) w2)) } -::sum_divisors::main::10 { tup(0 tup(w2 w2)) } +::sum_divisors::main::9 { tup(0 tup(w2 w2)) } ::std::io::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -76,7 +76,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup554(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup543(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -90,7 +90,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2247(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2223(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -99,10 +99,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2257(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2233(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2260(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2236(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/snaps/vine/verbose_add/compiled.iv b/tests/snaps/vine/verbose_add/compiled.iv index da9eef5a..5b877caa 100644 --- a/tests/snaps/vine/verbose_add/compiled.iv +++ b/tests/snaps/vine/verbose_add/compiled.iv @@ -47,7 +47,7 @@ ::std::io::IO::print::2 = x(x(w3 w15) x(w9 w10)) } -::std::io::IO::print::2 { x(w4 x(dup496(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::io::IO::print::2 { x(w4 x(dup488(?(::std::io::IO::print::4 ::std::io::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::io::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -61,7 +61,7 @@ ::std::list::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::n32::N32::to_string { fn(dup2189(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::n32::N32::to_string { fn(dup2168(?(::std::n32::N32::to_string::4 ::std::n32::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::n32::N32::to_string::3 { x(w4 w7) @@ -70,10 +70,10 @@ ::std::n32::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::n32::N32::to_string::5 { x(dup2199(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::n32::N32::to_string::5 { x(dup2178(?(::std::n32::N32::to_string::7 ::std::n32::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::n32::N32::to_string::6 { - x(dup2202(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2181(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::list::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::n32::N32::to_string::5 = x(w8 x(w5 w15)) diff --git a/tests/tests.rs b/tests/tests.rs index 8f0603b4..1dd0d722 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -74,6 +74,10 @@ fn tests(t: &mut DynTester) { test_vi(t, leak(format!("tests/programs/aoc_2024/{name}.vi")), leak(input), ".txt"); } + t.group("fmt", |t| { + test_vi_fmt(t, "tests/programs/fmt/objects.vi"); + }); + t.group("fail", |t| { test_vi_fail(t, "tests/programs/fail/atypical.vi"); test_vi_fail(t, "tests/programs/fail/hallo_world.vi"); @@ -87,6 +91,7 @@ fn tests(t: &mut DynTester) { test_vi_repl(t, "tests/programs/repl/advanced_repl.vi"); test_vi_repl(t, "tests/programs/repl/basic_repl.vi"); test_vi_repl(t, "tests/programs/repl/misc.vi"); + test_vi_repl(t, "tests/programs/repl/objects.vi"); test_vi_repl(t, "tests/programs/repl/randomness.vi"); }); }); @@ -133,6 +138,19 @@ fn test_vi_repl(t: &mut DynTester, path: &'static str) { }); } +fn test_vi_fmt(t: &mut DynTester, path: &'static str) { + let name = Path::file_stem(path.as_ref()).unwrap().to_str().unwrap(); + t.test(name, move || { + let input = fs::read_to_string(path).unwrap(); + let (formatted, stderr) = exec(VINE, &["fmt"], input.as_bytes(), true); + assert!(stderr.is_empty()); + test_snapshot(&["vine", "fmt", &format!("{name}.fmt.vi")], &formatted); + let (stdout, stderr) = exec(VINE, &["fmt"], input.as_bytes(), true); + assert!(stderr.is_empty()); + assert_eq!(stdout, formatted); + }); +} + fn test_iv(t: &mut DynTester, path: &'static str, input: &'static [u8], output_ext: &'static str) { let name = Path::file_stem(path.as_ref()).unwrap().to_str().unwrap(); t.test(name, || { diff --git a/vine/examples/fib_repl.vi b/vine/examples/fib_repl.vi index 3743616b..a2853179 100644 --- a/vine/examples/fib_repl.vi +++ b/vine/examples/fib_repl.vi @@ -5,8 +5,8 @@ pub fn main(&io: &IO) { while io.prompt("> ") is Some(line) { let num = N32::parse(line); io.println(match num { - Some(num) => fib(num).to_string(), - None => "invalid number", + Some(num) { fib(num).to_string() } + None { "invalid number" } }); } } diff --git a/vine/examples/primeness.vi b/vine/examples/primeness.vi index 002b61bd..e86ef7db 100644 --- a/vine/examples/primeness.vi +++ b/vine/examples/primeness.vi @@ -9,12 +9,14 @@ pub fn main(&io: &IO) { let primeness = primeness(n); io.println(n.to_string() ++ ": " ++ match primeness { - Ok(primeness) => if primeness { - "prime" - } else { - "composite" - }, - Err(msg) => msg, + Ok(primeness) { + if primeness { + "prime" + } else { + "composite" + } + } + Err(msg) { msg } }); n += 1; diff --git a/vine/src/ast.rs b/vine/src/ast.rs index 68314baa..68a7535f 100644 --- a/vine/src/ast.rs +++ b/vine/src/ast.rs @@ -64,6 +64,7 @@ pub struct StructItem<'core> { pub name: Ident<'core>, pub generics: Vec>, pub fields: Vec>, + pub object: bool, } #[derive(Debug, Clone)] @@ -214,19 +215,17 @@ pub enum ExprKind<'core> { #[class(value)] Do(Label<'core>, Block<'core>), #[class(value)] - Block(Block<'core>), - #[class(value)] Assign(bool, B>, B>), #[class(value)] - Match(B>, Vec<(Pat<'core>, Expr<'core>)>), + Match(B>, Vec<(Pat<'core>, Block<'core>)>), #[class(value)] - If(B>, Block<'core>, B>), + If(Vec<(Expr<'core>, Block<'core>)>, Option>), #[class(value)] While(Label<'core>, B>, Block<'core>), #[class(value)] Loop(Label<'core>, Block<'core>), #[class(value)] - Fn(Vec>, Option>>, B>), + Fn(Vec>, Option>>, Block<'core>), #[class(value)] Return(Option>>), #[class(value)] @@ -245,10 +244,14 @@ pub enum ExprKind<'core> { Place(B>, B>), #[class(value, place, space)] Tuple(Vec>), + #[class(value, place, space)] + Object(Vec<(Key<'core>, Expr<'core>)>), #[class(value)] List(Vec>), #[class(value, place)] TupleField(B>, usize, Option), + #[class(value, place, sugar)] + ObjectField(B>, Key<'core>), #[class(value, sugar)] Method(B>, GenericPath<'core>, Vec>), #[class(value)] @@ -342,6 +345,8 @@ pub enum PatKind<'core> { Inverse(B>), #[class(value, place, space)] Tuple(Vec>), + #[class(value, place, space)] + Object(Vec<(Key<'core>, Pat<'core>)>), #[class(error)] Error(ErrorGuaranteed), } @@ -365,6 +370,7 @@ pub enum TyKind<'core> { Paren(B>), Fn(Vec>, Option>>), Tuple(Vec>), + Object(Vec<(Key<'core>, Ty<'core>)>), Ref(B>), Inverse(B>), Path(GenericPath<'core>), @@ -431,6 +437,12 @@ pub enum ComparisonOp { #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Ident<'core>(pub Interned<'core, str>); +#[derive(Debug, Clone, Copy)] +pub struct Key<'core> { + pub span: Span, + pub ident: Ident<'core>, +} + impl Display for Ident<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.0 .0) @@ -495,11 +507,15 @@ impl Display for Path<'_> { } } -// impl Debug for Path { -// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { -// write!(f, "`{self}`") -// } -// } +impl<'core> From> for GenericPath<'core> { + fn from(key: Key<'core>) -> Self { + GenericPath { + span: key.span, + path: Path { segments: vec![key.ident], absolute: false, resolved: None }, + generics: None, + } + } +} impl Debug for Ident<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/vine/src/checker.rs b/vine/src/checker.rs index 364b8db4..c9debaca 100644 --- a/vine/src/checker.rs +++ b/vine/src/checker.rs @@ -1,4 +1,5 @@ use std::{ + collections::BTreeMap, iter, mem::{replace, take}, ops::Range, @@ -11,7 +12,7 @@ use vine_util::{ use crate::{ ast::{ - Block, Builtin, DynFnId, ExprKind, GenericPath, Ident, LabelId, Local, Pat, PatKind, Span, + Block, Builtin, DynFnId, ExprKind, GenericPath, Ident, Key, LabelId, Local, Pat, PatKind, Span, StmtKind, Ty, TyKind, }, core::Core, @@ -29,10 +30,10 @@ mod unify; pub struct Checker<'core, 'r> { core: &'core Core<'core>, resolver: &'r mut Resolver<'core>, - state: CheckerState, + state: CheckerState<'core>, generics: Vec>, - return_ty: Option, - labels: IdxVec>, + return_ty: Option>, + labels: IdxVec>>, cur_def: DefId, bool: Option, @@ -41,15 +42,15 @@ pub struct Checker<'core, 'r> { char: Option, io: Option, list: Option, - string: Option, + string: Option>, concat: Option, } #[derive(Default, Debug, Clone)] -pub(crate) struct CheckerState { - pub(crate) vars: IdxVec>, +pub(crate) struct CheckerState<'core> { + pub(crate) vars: IdxVec, Span>>, pub(crate) locals: IntMap, - pub(crate) dyn_fns: IntMap, + pub(crate) dyn_fns: IntMap>, } impl<'core, 'r> Checker<'core, 'r> { @@ -124,20 +125,20 @@ impl<'core, 'r> Checker<'core, 'r> { pub(crate) fn _check_custom( &mut self, def_id: DefId, - state: CheckerState, + state: CheckerState<'core>, block: &mut Block<'core>, - ) -> (Type, CheckerState) { + ) -> (Type<'core>, CheckerState<'core>) { self.cur_def = def_id; self.state = state; let ty = self.check_block(block); (ty, take(&mut self.state)) } - fn new_var(&mut self, span: Span) -> Type { + fn new_var(&mut self, span: Span) -> Type<'core> { Type::Var(self.state.vars.push(Err(span))) } - fn check_block(&mut self, block: &mut Block<'core>) -> Type { + fn check_block(&mut self, block: &mut Block<'core>) -> Type<'core> { let mut ty = Type::UNIT; for stmt in block.stmts.iter_mut() { ty = Type::UNIT; @@ -176,7 +177,7 @@ impl<'core, 'r> Checker<'core, 'r> { ty } - fn check_block_type(&mut self, block: &mut Block<'core>, ty: &mut Type) { + fn check_block_type(&mut self, block: &mut Block<'core>, ty: &mut Type<'core>) { let mut found = self.check_block(block); if !self.unify(&mut found, ty) { self.core.report(Diag::ExpectedTypeFound { @@ -187,7 +188,7 @@ impl<'core, 'r> Checker<'core, 'r> { } } - fn hydrate_type(&mut self, ty: &mut Ty<'core>, inference: bool) -> Type { + fn hydrate_type(&mut self, ty: &mut Ty<'core>, inference: bool) -> Type<'core> { let span = ty.span; match &mut ty.kind { TyKind::Hole if inference => self.new_var(span), @@ -200,6 +201,9 @@ impl<'core, 'r> Checker<'core, 'r> { TyKind::Tuple(tys) => { Type::Tuple(tys.iter_mut().map(|arg| self.hydrate_type(arg, inference)).collect()) } + TyKind::Object(entries) => { + report!(self.core, ty.kind; self.build_object_type(entries, |self_, t| self_.hydrate_type(t, inference))) + } TyKind::Ref(t) => Type::Ref(Box::new(self.hydrate_type(t, inference))), TyKind::Inverse(t) => Type::Inverse(Box::new(self.hydrate_type(t, inference))), TyKind::Path(path) => { @@ -210,7 +214,7 @@ impl<'core, 'r> Checker<'core, 'r> { } } - fn hydrate_param(&mut self, pat: &mut Pat<'core>) -> Type { + fn hydrate_param(&mut self, pat: &mut Pat<'core>) -> Type<'core> { let span = pat.span; match &mut pat.kind { PatKind::Paren(inner) => self.hydrate_param(inner), @@ -221,6 +225,9 @@ impl<'core, 'r> Checker<'core, 'r> { PatKind::Ref(p) => Type::Ref(Box::new(self.hydrate_param(p))), PatKind::Inverse(p) => Type::Inverse(Box::new(self.hydrate_param(p))), PatKind::Tuple(t) => Type::Tuple(t.iter_mut().map(|p| self.hydrate_param(p)).collect()), + PatKind::Object(entries) => { + report!(self.core, pat.kind; self.build_object_type(entries, Self::hydrate_param)) + } PatKind::Hole | PatKind::Local(_) | PatKind::Deref(_) => { Type::Error(self.core.report(Diag::ItemTypeHole { span })) } @@ -233,7 +240,7 @@ impl<'core, 'r> Checker<'core, 'r> { path: &mut GenericPath<'core>, generic_count: usize, inference: bool, - ) -> Vec { + ) -> Vec> { if let Some(generics) = &mut path.generics { generics.iter_mut().map(|t| self.hydrate_type(t, inference)).collect::>() } else { @@ -289,9 +296,30 @@ impl<'core, 'r> Checker<'core, 'r> { self.resolver.defs[def_id].value_def = Some(value); } } + + fn build_object_type( + &mut self, + entries: &mut Vec<(Key<'core>, T)>, + mut f: impl FnMut(&mut Self, &mut T) -> Type<'core>, + ) -> Result, Diag<'core>> { + let mut fields = BTreeMap::new(); + let mut duplicate = Ok(()); + for (key, value) in entries { + let old = fields.insert(key.ident, f(self, value)); + if old.is_some() { + duplicate = Err(self.core.report(Diag::DuplicateKey { span: key.span })); + } + } + duplicate?; + Ok(Type::Object(fields)) + } } -fn define_primitive_type(resolver: &mut Resolver, def_id: Option, ty: Type) { +fn define_primitive_type<'core>( + resolver: &mut Resolver<'core>, + def_id: Option, + ty: Type<'core>, +) { if let Some(def_id) = def_id { resolver.defs[def_id].type_def = Some(TypeDef { vis: DefId::ROOT, generics: Vec::new(), alias: None, ty: Some(ty) }); @@ -320,27 +348,28 @@ impl Form { new_idx!(pub Var); #[derive(Debug, Clone, PartialEq, Eq)] -pub enum Type { +pub enum Type<'core> { Bool, N32, F32, Char, IO, - Tuple(Vec), - Fn(Vec, Box), - Ref(Box), - Inverse(Box), - Adt(DefId, Vec), + Tuple(Vec>), + Object(BTreeMap, Type<'core>>), + Fn(Vec>, Box>), + Ref(Box>), + Inverse(Box>), + Adt(DefId, Vec>), Opaque(usize), Var(Var), Never, Error(ErrorGuaranteed), } -impl Type { - const UNIT: Type = Type::Tuple(Vec::new()); +impl<'core> Type<'core> { + const UNIT: Type<'static> = Type::Tuple(Vec::new()); - pub(crate) fn instantiate(&self, opaque: &[Type]) -> Type { + pub(crate) fn instantiate(&self, opaque: &[Type<'core>]) -> Type<'core> { match self { Type::Bool => Type::Bool, Type::N32 => Type::N32, @@ -348,6 +377,9 @@ impl Type { Type::Char => Type::Char, Type::IO => Type::IO, Type::Tuple(tys) => Type::Tuple(tys.iter().map(|t| t.instantiate(opaque)).collect()), + Type::Object(entries) => { + Type::Object(entries.iter().map(|(&k, t)| (k, t.instantiate(opaque))).collect()) + } Type::Fn(tys, ret) => Type::Fn( tys.iter().map(|t| t.instantiate(opaque)).collect(), Box::new(ret.instantiate(opaque)), @@ -378,13 +410,13 @@ impl Type { } } -impl Default for Type { +impl Default for Type<'_> { fn default() -> Self { Self::UNIT } } -impl From for Type { +impl From for Type<'_> { fn from(value: ErrorGuaranteed) -> Self { Type::Error(value) } diff --git a/vine/src/checker/check_expr.rs b/vine/src/checker/check_expr.rs index 6ded4401..6c7405cb 100644 --- a/vine/src/checker/check_expr.rs +++ b/vine/src/checker/check_expr.rs @@ -1,3 +1,5 @@ +use std::{collections::BTreeMap, mem::take}; + use crate::{ ast::{BinaryOp, Expr, ExprKind, Label, Span}, checker::{Checker, Form, Type}, @@ -10,7 +12,12 @@ mod check_method; mod coerce_expr; impl<'core> Checker<'core, '_> { - pub(super) fn check_expr_form_type(&mut self, expr: &mut Expr<'core>, form: Form, ty: &mut Type) { + pub(super) fn check_expr_form_type( + &mut self, + expr: &mut Expr<'core>, + form: Form, + ty: &mut Type<'core>, + ) { let mut found = self.check_expr_form(expr, form); if !self.unify(&mut found, ty) { self.core.report(Diag::ExpectedTypeFound { @@ -21,13 +28,13 @@ impl<'core> Checker<'core, '_> { } } - pub(super) fn check_expr_form(&mut self, expr: &mut Expr<'core>, form: Form) -> Type { + pub(super) fn check_expr_form(&mut self, expr: &mut Expr<'core>, form: Form) -> Type<'core> { let (found, ty) = self.check_expr(expr); self.coerce_expr(expr, found, form); ty } - pub(super) fn check_expr(&mut self, expr: &mut Expr<'core>) -> (Form, Type) { + pub(super) fn check_expr(&mut self, expr: &mut Expr<'core>) -> (Form, Type<'core>) { let span = expr.span; match &mut expr.kind { ExprKind![synthetic] => unreachable!(), @@ -80,7 +87,7 @@ impl<'core> Checker<'core, '_> { } Type::Adt(adt, gens) => { self.resolver.defs[*adt].variant_def.as_ref().and_then(|variant| { - if variant.adt == *adt && *i < variant.fields.len() { + if !variant.object && variant.adt == *adt && *i < variant.fields.len() { *l = Some(variant.fields.len()); Some(variant.field_types.as_ref().unwrap()[*i].instantiate(gens)) } else { @@ -101,6 +108,54 @@ impl<'core> Checker<'core, '_> { (form, field_ty) } + ExprKind::ObjectField(e, k) => { + let (form, mut ty) = self.check_expr(e); + + if form == Form::Space { + let e = self.core.report(Diag::SpaceField { span }); + return (Form::Error(e), Type::Error(e)); + } + + self.concretize(&mut ty); + let field = match &ty { + Type::Object(e) => e + .iter() + .enumerate() + .find(|&(_, (&n, _))| k.ident == n) + .map(|(i, (_, t))| (t.clone(), i, e.len())), + Type::Adt(adt, gens) => { + self.resolver.defs[*adt].variant_def.as_ref().and_then(|variant| { + if variant.object && variant.adt == *adt { + let Some([Type::Object(e)]) = variant.field_types.as_deref() else { + unreachable!() + }; + if let Some((i, (_, ty))) = e.iter().enumerate().find(|&(_, (&n, _))| k.ident == n) + { + return Some((ty.instantiate(gens), i, e.len())); + } + } + None + }) + } + _ => None, + }; + + let (field_ty, i, len) = field.unwrap_or_else(|| { + ( + Type::Error(self.core.report(Diag::MissingObjectField { + span: k.span, + ty: self.display_type(&ty), + key: k.ident, + })), + 0, + 0, + ) + }); + + expr.kind = ExprKind::TupleField(take(e), i, Some(len)); + + (form, field_ty) + } ExprKind::Tuple(v) => { if v.is_empty() { (Form::Place, Type::UNIT) @@ -114,6 +169,29 @@ impl<'core> Checker<'core, '_> { (form, Type::Tuple(types)) } } + ExprKind::Object(entries) => { + if entries.is_empty() { + (Form::Place, Type::Object(BTreeMap::new())) + } else { + let mut forms = Vec::new(); + let ty = self.build_object_type(entries, |self_, e| { + let (form, ty) = self_.check_expr(e); + forms.push(form); + ty + }); + let form = self.tuple_form(span, &forms); + for (f, (_, v)) in forms.into_iter().zip(entries) { + self.coerce_expr(v, f, form); + } + ( + form, + match ty { + Ok(ty) => ty, + Err(diag) => Type::Error(self.core.report(diag)), + }, + ) + } + } ExprKind::Adt(path, fields) => { let variant_id = path.path.resolved.unwrap(); let (forms, types) = @@ -160,7 +238,7 @@ impl<'core> Checker<'core, '_> { } } - fn _check_expr_value(&mut self, expr: &mut Expr<'core>) -> Type { + fn _check_expr_value(&mut self, expr: &mut Expr<'core>) -> Type<'core> { let span = expr.span; match &mut expr.kind { ExprKind![error || place || space || synthetic] => unreachable!(), @@ -179,7 +257,6 @@ impl<'core> Checker<'core, '_> { } ty } - ExprKind::Block(block) => self.check_block(block), ExprKind::Assign(_, space, value) => { let mut ty = self.check_expr_form(space, Form::Space); self.check_expr_form_type(value, Form::Value, &mut ty); @@ -188,25 +265,22 @@ impl<'core> Checker<'core, '_> { ExprKind::Match(scrutinee, arms) => { let mut scrutinee = self.check_expr_form(scrutinee, Form::Value); let mut result = self.new_var(span); - for (pat, expr) in arms { + for (pat, block) in arms { self.check_pat_type(pat, Form::Value, true, &mut scrutinee); - self.check_expr_form_type(expr, Form::Value, &mut result); + self.check_block_type(block, &mut result); } result } - ExprKind::If(cond, then, els) => { - self.check_expr_form_type(cond, Form::Value, &mut Type::Bool); - let mut then = self.check_block(then); - let mut els = self.check_expr_form(els, Form::Value); - if !self.unify(&mut then, &mut els) { - Type::Error(self.core.report(Diag::MismatchedThenElseTypes { - span, - then: self.display_type(&then), - els: self.display_type(&els), - })) - } else { - then + ExprKind::If(arms, leg) => { + let mut result = if leg.is_some() { self.new_var(span) } else { Type::UNIT }; + for (cond, block) in arms { + self.check_expr_form_type(cond, Form::Value, &mut Type::Bool); + self.check_block_type(block, &mut result); } + if let Some(leg) = leg { + self.check_block_type(leg, &mut result); + } + result } ExprKind::While(label, cond, block) => { *self.labels.get_or_extend(label.as_id()) = Some(Type::UNIT); @@ -229,7 +303,7 @@ impl<'core> Checker<'core, '_> { None => self.new_var(span), }; let old = self.return_ty.replace(ret.clone()); - self.check_expr_form_type(body, Form::Value, &mut ret); + self.check_block_type(body, &mut ret); self.return_ty = old; ret }), @@ -354,7 +428,7 @@ impl<'core> Checker<'core, '_> { func: &mut Box>, args: &mut Vec>, span: Span, - ) -> Type { + ) -> Type<'core> { let ty = self.check_expr_form(func, Form::Value); match self.fn_sig(span, ty, args.len()) { Ok((params, ret)) => { @@ -375,9 +449,9 @@ impl<'core> Checker<'core, '_> { fn fn_sig( &mut self, span: Span, - mut ty: Type, + mut ty: Type<'core>, args: usize, - ) -> Result<(Vec, Type), Diag<'core>> { + ) -> Result<(Vec>, Type<'core>), Diag<'core>> { self.concretize(&mut ty); match ty { Type::Fn(params, ret) => { @@ -402,9 +476,9 @@ impl<'core> Checker<'core, '_> { span: Span, op: BinaryOp, assign: bool, - mut a: Type, - mut b: Type, - ) -> Type { + mut a: Type<'core>, + mut b: Type<'core>, + ) -> Type<'core> { match op { BinaryOp::Concat => { if self.concat.is_none() { @@ -435,11 +509,11 @@ impl<'core> Checker<'core, '_> { &mut self, op: BinaryOp, assign: bool, - mut a: &mut Type, - mut b: &mut Type, + mut a: &mut Type<'core>, + mut b: &mut Type<'core>, i: bool, j: bool, - ) -> Result { + ) -> Result, ()> { self.concretize(a); self.concretize(b); match (op, &mut a, &mut b) { diff --git a/vine/src/checker/check_expr/check_method.rs b/vine/src/checker/check_expr/check_method.rs index 9e428f11..ba96df3c 100644 --- a/vine/src/checker/check_expr/check_method.rs +++ b/vine/src/checker/check_expr/check_method.rs @@ -14,7 +14,7 @@ impl<'core> Checker<'core, '_> { receiver: &mut Box>, path: &mut GenericPath<'core>, args: &mut Vec>, - ) -> (ExprKind<'core>, Type) { + ) -> (ExprKind<'core>, Type<'core>) { if path.path.resolved.is_some() { match self.method_sig(span, path, args.len()) { Ok((form, mut rec, params, ret)) => { @@ -53,7 +53,7 @@ impl<'core> Checker<'core, '_> { receiver: &mut Box>, path: &mut GenericPath<'core>, args: &mut [Expr<'core>], - ) -> Result<(Form, Type), Diag<'core>> { + ) -> Result<(Form, Type<'core>), Diag<'core>> { let (receiver_form, mut ty) = self.check_expr(receiver); self.concretize(&mut ty); let mod_id = self.get_ty_mod(&ty)?; @@ -87,7 +87,7 @@ impl<'core> Checker<'core, '_> { span: Span, path: &mut GenericPath<'core>, args: usize, - ) -> Result<(Form, Type, Vec, Type), Diag<'core>> { + ) -> Result<(Form, Type<'core>, Vec>, Type<'core>), Diag<'core>> { let ty = self.typeof_value_def(path)?; match ty { Type::Fn(mut params, ret) => { @@ -133,7 +133,7 @@ impl<'core> Checker<'core, '_> { ExprKind::Call(Box::new(func), args) } - fn get_ty_mod(&mut self, ty: &Type) -> Result, Diag<'core>> { + fn get_ty_mod(&mut self, ty: &Type<'core>) -> Result, Diag<'core>> { Ok(match ty { Type::Adt(mod_id, _) => Some(*mod_id), Type::Bool => self.bool, @@ -142,6 +142,7 @@ impl<'core> Checker<'core, '_> { Type::Char => self.char, Type::IO => self.io, Type::Tuple(_) + | Type::Object(_) | Type::Fn(..) | Type::Ref(_) | Type::Inverse(_) diff --git a/vine/src/checker/check_pat.rs b/vine/src/checker/check_pat.rs index fb708e4e..3b1cecb4 100644 --- a/vine/src/checker/check_pat.rs +++ b/vine/src/checker/check_pat.rs @@ -10,7 +10,7 @@ impl<'core> Checker<'core, '_> { pat: &mut Pat<'core>, form: Form, refutable: bool, - ty: &mut Type, + ty: &mut Type<'core>, ) { let mut found = self.check_pat(pat, form, refutable); if !self.unify(&mut found, ty) { @@ -22,7 +22,12 @@ impl<'core> Checker<'core, '_> { } } - pub(super) fn check_pat(&mut self, pat: &mut Pat<'core>, form: Form, refutable: bool) -> Type { + pub(super) fn check_pat( + &mut self, + pat: &mut Pat<'core>, + form: Form, + refutable: bool, + ) -> Type<'core> { let span = pat.span; match (&mut pat.kind, form) { (_, Form::Error(_)) => unreachable!(), @@ -50,6 +55,9 @@ impl<'core> Checker<'core, '_> { (PatKind::Tuple(t), _) => { Type::Tuple(t.iter_mut().map(|p| self.check_pat(p, form, refutable)).collect()) } + (PatKind::Object(e), _) => { + report!(self.core, pat.kind; self.build_object_type(e, |self_, p| self_.check_pat(p, form, refutable))) + } (PatKind::Deref(p), Form::Place) => { let ty = self.new_var(span); self.check_pat_type(p, Form::Value, refutable, &mut Type::Ref(Box::new(ty.clone()))); @@ -80,7 +88,7 @@ impl<'core> Checker<'core, '_> { fields: &mut Option>>, form: Form, refutable: bool, - ) -> Result> { + ) -> Result, Diag<'core>> { let (adt, field_tys) = self.typeof_variant_def(path, refutable, true)?; let field_tys = field_tys.unwrap(); let fields = fields.get_or_insert(Vec::new()); diff --git a/vine/src/checker/display_type.rs b/vine/src/checker/display_type.rs index 2fdfd9d1..30c73264 100644 --- a/vine/src/checker/display_type.rs +++ b/vine/src/checker/display_type.rs @@ -3,13 +3,13 @@ use std::fmt::Write; use crate::checker::{Checker, Type}; impl<'core> Checker<'core, '_> { - pub(super) fn display_type(&self, ty: &Type) -> String { + pub(super) fn display_type(&self, ty: &Type<'core>) -> String { let mut str = String::new(); self._display_type(ty, &mut str); str } - fn _display_type(&self, ty: &Type, str: &mut String) { + fn _display_type(&self, ty: &Type<'core>, str: &mut String) { match ty { Type::Bool => *str += "Bool", Type::N32 => *str += "N32", @@ -31,6 +31,24 @@ impl<'core> Checker<'core, '_> { } *str += ")" } + Type::Object(e) => { + if e.is_empty() { + *str += "{}" + } else { + *str += "{ "; + let mut first = true; + for (v, t) in e { + if !first { + *str += ", "; + } + *str += v.0 .0; + *str += ": "; + self._display_type(t, str); + first = false; + } + *str += " }"; + } + } Type::Fn(args, ret) => { *str += "fn("; let mut first = true; diff --git a/vine/src/checker/typeof_def.rs b/vine/src/checker/typeof_def.rs index 6dc641b0..b9a13906 100644 --- a/vine/src/checker/typeof_def.rs +++ b/vine/src/checker/typeof_def.rs @@ -9,7 +9,7 @@ impl<'core> Checker<'core, '_> { pub(super) fn typeof_value_def( &mut self, path: &mut GenericPath<'core>, - ) -> Result> { + ) -> Result, Diag<'core>> { let span = path.span; let def_id = path.path.resolved.unwrap(); let def = &self.resolver.defs[def_id]; @@ -34,7 +34,7 @@ impl<'core> Checker<'core, '_> { &mut self, path: &mut GenericPath<'core>, inference: bool, - ) -> Result> { + ) -> Result, Diag<'core>> { let span = path.span; let def_id = path.path.resolved.unwrap(); let def = &self.resolver.defs[def_id]; @@ -73,7 +73,7 @@ impl<'core> Checker<'core, '_> { path: &mut GenericPath<'core>, refutable: bool, inference: bool, - ) -> Result<(Type, Option>), Diag<'core>> { + ) -> Result<(Type<'core>, Option>>), Diag<'core>> { let span = path.span; let variant_id = path.path.resolved.unwrap(); let variant = &self.resolver.defs[variant_id]; diff --git a/vine/src/checker/unify.rs b/vine/src/checker/unify.rs index 5fc70679..045b937f 100644 --- a/vine/src/checker/unify.rs +++ b/vine/src/checker/unify.rs @@ -9,12 +9,12 @@ use super::CheckerState; impl<'core> Checker<'core, '_> { #[must_use] - pub(super) fn unify(&mut self, a: &mut Type, b: &mut Type) -> bool { + pub(super) fn unify(&mut self, a: &mut Type<'core>, b: &mut Type<'core>) -> bool { self._unify(a, b, false, false) } #[must_use] - fn _unify(&mut self, a: &mut Type, b: &mut Type, i: bool, j: bool) -> bool { + fn _unify(&mut self, a: &mut Type<'core>, b: &mut Type<'core>, i: bool, j: bool) -> bool { match (&mut *a, &mut *b) { (Type::Error(_), _) | (_, Type::Error(_)) => true, (Type::Inverse(a), Type::Inverse(b)) => self._unify(a, b, !i, !j), @@ -72,6 +72,17 @@ impl<'core> Checker<'core, '_> { } success } + (Type::Object(a), Type::Object(b)) => { + let mut success = true; + for (k, a) in a { + if let Some(b) = b.get_mut(k) { + success &= self._unify(a, b, i, j); + } else { + success = false; + } + } + success + } (Type::Ref(a), Type::Ref(b)) if i == j => self._unify(a, b, i, j), (Type::Fn(x, a), Type::Fn(y, b)) if i == j => { let mut success = true; @@ -92,7 +103,7 @@ impl<'core> Checker<'core, '_> { } } - pub(super) fn concretize(&mut self, ty: &mut Type) { + pub(super) fn concretize(&mut self, ty: &mut Type<'core>) { while let Type::Var(v) = *ty { match self.state.vars[v].clone() { Ok(t) => *ty = t, @@ -111,8 +122,8 @@ impl<'core> Checker<'core, '_> { } } -impl CheckerState { - pub(crate) fn try_concretize(&self, ty: &mut Type) { +impl<'core> CheckerState<'core> { + pub(crate) fn try_concretize(&self, ty: &mut Type<'core>) { while let Type::Var(v) = *ty { if let Ok(t) = self.vars[v].clone() { *ty = t diff --git a/vine/src/diag.rs b/vine/src/diag.rs index 1caf71ce..c32fe261 100644 --- a/vine/src/diag.rs +++ b/vine/src/diag.rs @@ -90,8 +90,6 @@ diags! { ["cannot infer type"] BadBinOp { op: BinaryOp, assign: bool, lhs: String, rhs: String } ["cannot apply operator `{op}{}` to types `{lhs}` and `{rhs}`", if *assign { "=" } else { "" }] - MismatchedThenElseTypes { then: String, els: String } - ["then block has type `{then}` but else block has type `{els}`"] MismatchedValueSpaceTypes { value: String, space: String } ["value has type `{value}` but space has type `{space}`"] BadArgCount { ty: String, expected: usize, got: usize } @@ -116,6 +114,8 @@ diags! { ["`{path}` has {expected} field{}; {got} {} matched", plural(*expected, "s", ""), plural(*got, "were", "was")] MissingTupleField { ty: String, i: usize } ["type `{ty}` has no field `{i}`"] + MissingObjectField { ty: String, key: Ident<'core> } + ["type `{ty}` has no field `{key}`"] SpaceField ["cannot access a field of a space expression"] FnItemUntypedParam @@ -156,6 +156,8 @@ diags! { ["the pattern `{path}` is only visible within `{vis}`"] VisibleSubitem ["subitems must be private"] + DuplicateKey + ["duplicate object key"] } fn plural<'a>(n: usize, plural: &'a str, singular: &'a str) -> &'a str { diff --git a/vine/src/distiller.rs b/vine/src/distiller.rs index 72a99eb0..019337a1 100644 --- a/vine/src/distiller.rs +++ b/vine/src/distiller.rs @@ -1,4 +1,7 @@ -use std::mem::{replace, take}; +use std::{ + collections::BTreeMap, + mem::{replace, take}, +}; use ivm::ext::{ExtFn, ExtFnKind}; use vine_util::{ @@ -9,8 +12,8 @@ use vine_util::{ use crate::{ analyzer::usage::Usage, ast::{ - BinaryOp, Builtin, ComparisonOp, DynFnId, Expr, ExprKind, GenericPath, LabelId, Local, Pat, - PatKind, + BinaryOp, Builtin, ComparisonOp, DynFnId, Expr, ExprKind, GenericPath, Key, LabelId, Local, + Pat, PatKind, }, resolver::{Def, DefId, Resolver, ValueDefKind}, vir::{ @@ -77,14 +80,19 @@ impl<'core, 'r> Distiller<'core, 'r> { pub fn distill(&mut self, def: &Def<'core>) -> Option { let value_def = def.value_def.as_ref()?; let ValueDefKind::Expr(expr) = &value_def.kind else { None? }; - Some(self.distill_expr(value_def.locals, expr)) + Some(self.distill_root(value_def.locals, expr, Self::distill_expr_value)) } - pub fn distill_expr(&mut self, locals: Counter, expr: &Expr<'core>) -> VIR { + pub fn distill_root( + &mut self, + locals: Counter, + root: &T, + distill_root: fn(&mut Self, &mut Stage, &T) -> Port, + ) -> VIR { self.locals = locals; let (layer, mut stage) = self.root_layer(); let local = self.locals.next(); - let result = self.distill_expr_value(&mut stage, expr); + let result = distill_root(self, &mut stage, root); stage.set_local_to(local, result); self.finish_stage(stage); self.finish_layer(layer); @@ -106,9 +114,7 @@ impl<'core, 'r> Distiller<'core, 'r> { ExprKind![cond] => self.distill_cond_bool(stage, expr, false), ExprKind::Do(label, block) => self.distill_do(stage, label.as_id(), block), - ExprKind::If(cond, then_branch, else_branch) => { - self.distill_if(stage, cond, then_branch, else_branch) - } + ExprKind::If(arms, leg) => self.distill_if(stage, arms, leg), ExprKind::While(label, cond, block) => self.distill_while(stage, label.as_id(), cond, block), ExprKind::Loop(label, block) => self.distill_loop(stage, label.as_id(), block), ExprKind::Return(value) => self.distill_return(stage, value), @@ -128,7 +134,6 @@ impl<'core, 'r> Distiller<'core, 'r> { stage.steps.push(Step::Transfer(Transfer::unconditional(dyn_fn.interface))); stage.take_local(dyn_fn.local) } - ExprKind::Block(block) => self.distill_block(stage, block), ExprKind::Assign(inverse, space, value) => { if *inverse { let space = self.distill_expr_space(stage, space); @@ -162,6 +167,7 @@ impl<'core, 'r> Distiller<'core, 'r> { ExprKind::Tuple(tuple) => { self.distill_vec(stage, tuple, Self::distill_expr_value, Step::Tuple) } + ExprKind::Object(fields) => self.distill_object(stage, fields, Self::distill_expr_value), ExprKind::Adt(path, args) => { self.distill_vec(stage, args, Self::distill_expr_value, adt(path)) } @@ -251,6 +257,7 @@ impl<'core, 'r> Distiller<'core, 'r> { ExprKind::Tuple(tuple) => { self.distill_vec(stage, tuple, Self::distill_expr_space, Step::Tuple) } + ExprKind::Object(fields) => self.distill_object(stage, fields, Self::distill_expr_space), ExprKind::Adt(path, args) => { self.distill_vec(stage, args, Self::distill_expr_space, adt(path)) } @@ -292,6 +299,7 @@ impl<'core, 'r> Distiller<'core, 'r> { ExprKind::Tuple(tuple) => { self.distill_vec_pair(stage, tuple, Self::distill_expr_place, Step::Tuple) } + ExprKind::Object(fields) => self.distill_object_pair(stage, fields, Self::distill_expr_place), ExprKind::Adt(path, args) => { self.distill_vec_pair(stage, args, Self::distill_expr_place, adt(path)) } @@ -320,6 +328,7 @@ impl<'core, 'r> Distiller<'core, 'r> { stage.set_local(*local) } PatKind::Tuple(tuple) => self.distill_vec(stage, tuple, Self::distill_pat_value, Step::Tuple), + PatKind::Object(fields) => self.distill_object(stage, fields, Self::distill_pat_value), PatKind::Adt(path, args) => { self.distill_vec(stage, args.as_deref().unwrap_or(&[]), Self::distill_pat_value, adt(path)) } @@ -343,6 +352,7 @@ impl<'core, 'r> Distiller<'core, 'r> { stage.take_local(*local) } PatKind::Tuple(tuple) => self.distill_vec(stage, tuple, Self::distill_pat_space, Step::Tuple), + PatKind::Object(fields) => self.distill_object(stage, fields, Self::distill_pat_space), PatKind::Adt(path, args) => { self.distill_vec(stage, args.as_deref().unwrap_or(&[]), Self::distill_pat_space, adt(path)) } @@ -366,6 +376,7 @@ impl<'core, 'r> Distiller<'core, 'r> { PatKind::Tuple(tuple) => { self.distill_vec_pair(stage, tuple, Self::distill_pat_place, Step::Tuple) } + PatKind::Object(fields) => self.distill_object_pair(stage, fields, Self::distill_pat_place), PatKind::Adt(path, args) => self.distill_vec_pair( stage, args.as_deref().unwrap_or(&[]), @@ -496,6 +507,42 @@ impl<'core, 'r> Distiller<'core, 'r> { stage.steps.push(s(right.0, rights)); (left.1, right.1) } + + fn distill_object( + &mut self, + stage: &mut Stage, + fields: &Vec<(Key<'core>, T)>, + mut f: impl FnMut(&mut Self, &mut Stage, &T) -> Port, + ) -> Port { + let ports = fields + .iter() + .map(|(k, v)| (k.ident, f(self, stage, v))) + .collect::>() + .into_values() + .collect::>(); + let wire = stage.new_wire(); + stage.steps.push(Step::Tuple(wire.0, ports)); + wire.1 + } + + fn distill_object_pair( + &mut self, + stage: &mut Stage, + fields: &Vec<(Key<'core>, T)>, + mut f: impl FnMut(&mut Self, &mut Stage, &T) -> (Port, Port), + ) -> (Port, Port) { + let (lefts, rights) = fields + .iter() + .map(|(k, v)| (k.ident, f(self, stage, v))) + .collect::>() + .into_values() + .collect::<(Vec<_>, Vec<_>)>(); + let left = stage.new_wire(); + let right = stage.new_wire(); + stage.steps.push(Step::Tuple(left.0, lefts)); + stage.steps.push(Step::Tuple(right.0, rights)); + (left.1, right.1) + } } fn adt(path: &GenericPath) -> impl Fn(Port, Vec) -> Step { diff --git a/vine/src/distiller/control_flow.rs b/vine/src/distiller/control_flow.rs index d1f00804..4628d3b0 100644 --- a/vine/src/distiller/control_flow.rs +++ b/vine/src/distiller/control_flow.rs @@ -8,7 +8,7 @@ use crate::{ use super::{pattern_matching::Row, Distiller, DynFn, Label, Return}; impl<'core, 'r> Distiller<'core, 'r> { - pub(super) fn distill_block(&mut self, stage: &mut Stage, block: &Block<'core>) -> Port { + pub fn distill_block(&mut self, stage: &mut Stage, block: &Block<'core>) -> Port { self.distill_stmts(stage, &block.stmts) } @@ -61,7 +61,7 @@ impl<'core, 'r> Distiller<'core, 'r> { let (layer, mut stage) = self.root_layer(); *self.dyn_fns.get_or_extend(dyn_fn.id.unwrap()) = Some(DynFn { interface: stage.interface, local }); - self._distill_fn(&mut stage, local, &dyn_fn.params, &dyn_fn.body, Self::distill_block); + self._distill_fn(&mut stage, local, &dyn_fn.params, &dyn_fn.body); self.finish_stage(stage); self.finish_layer(layer); } @@ -82,7 +82,7 @@ impl<'core, 'r> Distiller<'core, 'r> { &mut self, stage: &mut Stage, value: &Expr<'core>, - arms: &Vec<(Pat<'core>, Expr<'core>)>, + arms: &Vec<(Pat<'core>, Block<'core>)>, ) -> Port { let local = self.new_local(stage); let (mut layer, mut init_stage) = self.child_layer(stage); @@ -91,7 +91,7 @@ impl<'core, 'r> Distiller<'core, 'r> { .iter() .map(|(pat, expr)| { let mut stage = self.new_unconditional_stage(&mut layer); - let result = self.distill_expr_value(&mut stage, expr); + let result = self.distill_block(&mut stage, expr); stage.set_local_to(local, result); let interface = stage.interface; self.finish_stage(stage); @@ -108,12 +108,12 @@ impl<'core, 'r> Distiller<'core, 'r> { &mut self, stage: &mut Stage, params: &[Pat<'core>], - body: &Expr<'core>, + body: &Block<'core>, ) -> Port { let fn_local = self.new_local(stage); let (layer, mut body_stage) = self.child_layer(stage); - self._distill_fn(&mut body_stage, fn_local, params, body, Self::distill_expr_value); + self._distill_fn(&mut body_stage, fn_local, params, body); self.finish_stage(body_stage); self.finish_layer(layer); @@ -121,13 +121,12 @@ impl<'core, 'r> Distiller<'core, 'r> { stage.take_local(fn_local) } - pub(super) fn _distill_fn( + pub(super) fn _distill_fn( &mut self, stage: &mut Stage, fn_local: Local, params: &[Pat<'core>], - body: &B, - distill_body: impl Fn(&mut Self, &mut Stage, &B) -> Port, + body: &Block<'core>, ) { let return_local = self.new_local(stage); @@ -140,7 +139,7 @@ impl<'core, 'r> Distiller<'core, 'r> { self.returns.push(Return { layer: stage.layer, local: return_local }); - let result = distill_body(self, stage, body); + let result = self.distill_block(stage, body); stage.set_local_to(return_local, result); self.returns.pop(); @@ -244,23 +243,29 @@ impl<'core, 'r> Distiller<'core, 'r> { pub(super) fn distill_if( &mut self, stage: &mut Stage, - cond: &Expr<'core>, - then_branch: &Block<'core>, - else_branch: &Expr<'core>, + arms: &[(Expr<'core>, Block<'core>)], + leg: &Option>, ) -> Port { let local = self.new_local(stage); - let (mut layer, mut cond_stage) = self.child_layer(stage); - let (mut then_stage, mut else_stage) = self.distill_cond(&mut layer, &mut cond_stage, cond); - - let result = self.distill_block(&mut then_stage, then_branch); - then_stage.set_local_to(local, result); + let (mut layer, mut cur_stage) = self.child_layer(stage); + + for (cond, block) in arms { + let (mut then_stage, else_stage) = self.distill_cond(&mut layer, &mut cur_stage, cond); + let result = self.distill_block(&mut then_stage, block); + then_stage.set_local_to(local, result); + self.finish_stage(cur_stage); + self.finish_stage(then_stage); + cur_stage = else_stage; + } - let result = self.distill_expr_value(&mut else_stage, else_branch); - else_stage.set_local_to(local, result); + if let Some(leg) = leg { + let result = self.distill_block(&mut cur_stage, leg); + cur_stage.set_local_to(local, result); + } else { + cur_stage.erase_local(local); + } - self.finish_stage(cond_stage); - self.finish_stage(then_stage); - self.finish_stage(else_stage); + self.finish_stage(cur_stage); self.finish_layer(layer); stage.take_local(local) diff --git a/vine/src/distiller/pattern_matching.rs b/vine/src/distiller/pattern_matching.rs index be167bb0..c5bd0307 100644 --- a/vine/src/distiller/pattern_matching.rs +++ b/vine/src/distiller/pattern_matching.rs @@ -74,6 +74,7 @@ enum MatchKind { Ref, Inverse, Tuple(usize), + Object(usize), Adt(DefId), } @@ -191,6 +192,36 @@ impl<'core, 'd, 'r> Matcher<'core, 'd, 'r> { }); } + MatchKind::Object(len) => { + let (new_vars, new_locals) = self.new_var_range(stage, form, len); + match form { + Form::Value => { + let value = stage.take_local(local); + let spaces = new_locals.iter().map(|l| stage.set_local(l)).collect::>(); + stage.steps.push(Step::Tuple(value, spaces)); + } + Form::Space => { + let space = stage.set_local(local); + let values = new_locals.iter().map(|l| stage.take_local(l)).collect::>(); + stage.steps.push(Step::Tuple(space, values)); + } + Form::Place => { + let (value, space) = stage.mut_local(local); + let (values, spaces) = + new_locals.iter().map(|l| stage.mut_local(l)).collect::<(Vec<_>, Vec<_>)>(); + stage.steps.push(Step::Tuple(value, spaces)); + stage.steps.push(Step::Tuple(space, values)); + } + } + + self.eliminate_col(&mut rows, var, |p| match &p.kind { + PatKind::Object(fields) => new_vars.iter().zip( + fields.iter().map(|(k, v)| (k.ident, v)).collect::>().into_values(), + ), + _ => unreachable!(), + }); + } + MatchKind::Adt(adt_id) => { let adt = self.distiller.resolver.defs[adt_id].adt_def.as_ref().unwrap(); let interface = self.distiller.interfaces.push(None); @@ -335,6 +366,7 @@ impl<'core, 'd, 'r> Matcher<'core, 'd, 'r> { self.match_kind(&mut &**p).map(|_| MatchKind::Inverse) } PatKind::Tuple(t) => Some(MatchKind::Tuple(t.len())), + PatKind::Object(e) => Some(MatchKind::Object(e.len())), }; } } diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index 4dc33d30..2baf8c5f 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -68,8 +68,17 @@ impl<'core: 'src, 'src> Formatter<'src> { Doc("struct "), Doc(s.name), self.fmt_generics(&s.generics), - Doc::paren_comma(s.fields.iter().map(|x| self.fmt_ty(x))), - Doc(";"), + if s.object { + let TyKind::Object(e) = &s.fields[0].kind else { unreachable!() }; + Doc::concat([ + Doc(" "), + Doc::brace_comma_multiline( + e.iter().map(|(k, v)| Doc::concat([Doc(k.ident), Doc(": "), self.fmt_ty(v)])), + ), + ]) + } else { + Doc::concat([Doc::paren_comma(s.fields.iter().map(|x| self.fmt_ty(x))), Doc(";")]) + }, ]), ItemKind::Enum(e) => Doc::concat([ Doc("enum "), @@ -265,7 +274,6 @@ impl<'core: 'src, 'src> Formatter<'src> { ExprKind::Paren(p) => Doc::paren(self.fmt_expr(p)), ExprKind::Hole => Doc("_"), ExprKind::Path(path) => self.fmt_generic_path(path), - ExprKind::Block(block) => self.fmt_block(block, false), ExprKind::Do(label, block) => { Doc::concat([Doc("do"), self.fmt_label(label), Doc(" "), self.fmt_block(block, false)]) } @@ -276,21 +284,21 @@ impl<'core: 'src, 'src> Formatter<'src> { Doc("match "), self.fmt_expr(expr), Doc(" "), - Doc::brace_comma_multiline( - arms.iter().map(|(p, e)| Doc::concat([self.fmt_pat(p), Doc(" => "), self.fmt_expr(e)])), + Doc::brace_multiline( + arms + .iter() + .map(|(p, e)| Doc::concat([self.fmt_pat(p), Doc(" "), self.fmt_block(e, false)])), ), ]), - ExprKind::If(c, t, e) => Doc::concat([ - Doc("if "), - self.fmt_expr(c), - Doc(" "), - self.fmt_block(t, true), - match &e.kind { - ExprKind::Block(b) if b.stmts.is_empty() => Doc::EMPTY, - ExprKind::Block(b) => Doc::concat([Doc(" else "), self.fmt_block(b, true)]), - _ => Doc::concat([Doc(" else "), self.fmt_expr(e)]), - }, - ]), + ExprKind::If(arms, leg) => Doc::interleave( + arms + .iter() + .map(|(cond, block)| { + Doc::concat([Doc("if "), self.fmt_expr(cond), Doc(" "), self.fmt_block(block, true)]) + }) + .chain(leg.iter().map(|block| self.fmt_block(block, true))), + Doc(" else "), + ), ExprKind::While(l, c, b) => Doc::concat([ Doc("while"), self.fmt_label(l), @@ -306,7 +314,7 @@ impl<'core: 'src, 'src> Formatter<'src> { Doc("fn"), Doc::paren_comma(p.iter().map(|p| self.fmt_pat(p))), Doc(" "), - self.fmt_expr(b), + self.fmt_block(b, false), ]), ExprKind::Return(Some(x)) => Doc::concat([Doc("return "), self.fmt_expr(x)]), ExprKind::Break(label, Some(x)) => { @@ -327,10 +335,21 @@ impl<'core: 'src, 'src> Formatter<'src> { Doc::concat([Doc("("), self.fmt_expr(v), Doc("; "), self.fmt_expr(s), Doc(")")]) } ExprKind::Tuple(t) => Doc::tuple(t.iter().map(|x| self.fmt_expr(x))), + ExprKind::Object(o) => Doc::brace_comma_space(o.iter().map(|(k, v)| { + if let ExprKind::Path(p) = &v.kind { + if let Some(i) = p.path.as_ident() { + if k.ident == i { + return Doc(k.ident); + } + } + } + Doc::concat([Doc(k.ident), Doc(": "), self.fmt_expr(v)]) + })), ExprKind::List(l) => Doc::bracket_comma(l.iter().map(|x| self.fmt_expr(x))), ExprKind::TupleField(e, i, _) => { Doc::concat([self.fmt_expr(e), Doc("."), Doc(format!("{i}"))]) } + ExprKind::ObjectField(e, k) => Doc::concat([self.fmt_expr(e), Doc("."), Doc(k.ident)]), ExprKind::Method(e, p, a) => Doc::concat([ self.fmt_expr(e), Doc("."), @@ -402,6 +421,33 @@ impl<'core: 'src, 'src> Formatter<'src> { PatKind::Deref(p) => Doc::concat([Doc("*"), self.fmt_pat(p)]), PatKind::Inverse(p) => Doc::concat([Doc("~"), self.fmt_pat(p)]), PatKind::Annotation(p, t) => Doc::concat([self.fmt_pat(p), Doc(": "), self.fmt_ty(t)]), + PatKind::Object(o) => Doc::brace_comma_space(o.iter().map(|(key, pat)| { + let (pat, ty) = match &pat.kind { + PatKind::Annotation(p, t) => (&**p, Some(t)), + _ => (pat, None), + }; + let pat = if let PatKind::Adt(p, None) = &pat.kind { + if let Some(i) = p.path.as_ident() { + if key.ident == i { + None + } else { + Some(pat) + } + } else { + Some(pat) + } + } else { + Some(pat) + }; + match (pat, ty) { + (None, None) => Doc(key.ident), + (Some(pat), None) => Doc::concat([Doc(key.ident), Doc(": "), self.fmt_pat(pat)]), + (None, Some(ty)) => Doc::concat([Doc(key.ident), Doc(":: "), self.fmt_ty(ty)]), + (Some(pat), Some(ty)) => { + Doc::concat([Doc(key.ident), Doc(": "), self.fmt_pat(pat), Doc(": "), self.fmt_ty(ty)]) + } + } + })), PatKind::Tuple(t) => Doc::tuple(t.iter().map(|x| self.fmt_pat(x))), } } @@ -419,6 +465,9 @@ impl<'core: 'src, 'src> Formatter<'src> { TyKind::Ref(t) => Doc::concat([Doc("&"), self.fmt_ty(t)]), TyKind::Inverse(t) => Doc::concat([Doc("~"), self.fmt_ty(t)]), TyKind::Path(p) => self.fmt_generic_path(p), + TyKind::Object(o) => Doc::brace_comma_space( + o.iter().map(|(k, t)| Doc::concat([Doc(k.ident), Doc(": "), self.fmt_ty(t)])), + ), TyKind::Generic(_) | TyKind::Error(_) => unreachable!(), } } diff --git a/vine/src/fmt/doc.rs b/vine/src/fmt/doc.rs index 6627bb92..9716e609 100644 --- a/vine/src/fmt/doc.rs +++ b/vine/src/fmt/doc.rs @@ -67,6 +67,7 @@ impl<'src> Doc<'src> { Doc::concat([Doc("("), Doc::group([doc]), Doc(")")]) } + #[allow(clippy::too_many_arguments)] pub fn delimited( empty: &'src str, open: &'src str, @@ -74,6 +75,7 @@ impl<'src> Doc<'src> { force_multi: bool, force_trailing: bool, lazy_single: bool, + space: bool, mut docs: impl ExactSizeIterator, ) -> Self { if docs.len() == 0 { @@ -81,35 +83,48 @@ impl<'src> Doc<'src> { } else { let trailing = if force_multi || force_trailing { Doc(",") } else { Doc::if_multi(",") }; let sep = Doc::concat([Doc(","), if force_multi { Doc::LINE } else { Doc::soft_line(" ") }]); + let space = || if space && !force_multi { Doc::if_single(" ") } else { Doc("") }; let inner = if force_multi { - Doc::indent([Doc::interleave(docs, sep), trailing]) + Doc::indent([space(), Doc::interleave(docs, sep), trailing, space()]) } else if lazy_single && docs.len() == 1 { - Doc::lazy_group([docs.next().unwrap(), trailing]) + Doc::lazy_group([space(), docs.next().unwrap(), trailing, space()]) } else { - Doc::group([Doc::interleave(docs, sep), trailing]) + Doc::group([space(), Doc::interleave(docs, sep), trailing, space()]) }; Doc::concat([Doc(open), inner, Doc(close)]) } } pub fn paren_comma(docs: impl ExactSizeIterator) -> Self { - Self::delimited("()", "(", ")", false, false, true, docs) + Self::delimited("()", "(", ")", false, false, true, false, docs) } pub fn tuple(docs: impl ExactSizeIterator) -> Self { - Self::delimited("()", "(", ")", false, docs.len() == 1, false, docs) + Self::delimited("()", "(", ")", false, docs.len() == 1, false, false, docs) } pub fn bracket_comma(docs: impl ExactSizeIterator) -> Self { - Self::delimited("[]", "[", "]", false, false, false, docs) + Self::delimited("[]", "[", "]", false, false, false, false, docs) } pub fn brace_comma(docs: impl ExactSizeIterator) -> Self { - Self::delimited("{}", "{", "}", false, false, false, docs) + Self::delimited("{}", "{", "}", false, false, false, false, docs) + } + + pub fn brace_comma_space(docs: impl ExactSizeIterator) -> Self { + Self::delimited("{}", "{", "}", false, false, false, true, docs) } pub fn brace_comma_multiline(docs: impl ExactSizeIterator) -> Self { - Self::delimited("{}", "{", "}", true, false, false, docs) + Self::delimited("{}", "{", "}", true, false, false, false, docs) + } + + pub fn brace_multiline(docs: impl ExactSizeIterator) -> Self { + if docs.len() == 0 { + Doc("{}") + } else { + Doc::concat([Doc("{"), Doc::indent([Doc::interleave(docs, Doc::LINE)]), Doc("}")]) + } } } diff --git a/vine/src/parser.rs b/vine/src/parser.rs index 7741ae7d..ef6ff941 100644 --- a/vine/src/parser.rs +++ b/vine/src/parser.rs @@ -7,7 +7,7 @@ use crate::{core::Core, diag::Diag, lexer::Token}; use crate::ast::{ Attr, AttrKind, BinaryOp, Block, Builtin, ComparisonOp, ConstItem, DynFnStmt, Enum, Expr, - ExprKind, FnItem, GenericPath, Ident, InlineIvy, Item, ItemKind, Label, LetStmt, LogicalOp, + ExprKind, FnItem, GenericPath, Ident, InlineIvy, Item, ItemKind, Key, Label, LetStmt, LogicalOp, ModItem, ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, StructItem, Ty, TyKind, TypeItem, UseItem, UseTree, Variant, Vis, }; @@ -137,6 +137,13 @@ impl<'core, 'src> VineParser<'core, 'src> { Ok(self.core.ident(token)) } + fn parse_key(&mut self) -> Parse<'core, Key<'core>> { + let span = self.start_span(); + let ident = self.parse_ident()?; + let span = self.end_span(span); + Ok(Key { span, ident }) + } + fn parse_num(&mut self) -> Parse<'core, ExprKind<'core>> { let span = self.span(); let token = self.expect(Token::Num)?; @@ -189,13 +196,15 @@ impl<'core, 'src> VineParser<'core, 'src> { self.expect(Token::Struct)?; let name = self.parse_ident()?; let generics = self.parse_generics()?; - let fields = if self.check(Token::OpenParen) { - self.parse_delimited(PAREN_COMMA, Self::parse_type)? + let (fields, object) = if self.check(Token::OpenParen) { + (self.parse_delimited(PAREN_COMMA, Self::parse_type)?, false) + } else if self.check(Token::OpenBrace) { + (vec![self.parse_type()?], true) } else { - Vec::new() + (Vec::new(), false) }; - self.expect(Token::Semi)?; - Ok(StructItem { name, generics, fields }) + self.eat(Token::Semi)?; + Ok(StructItem { name, generics, fields, object }) } fn parse_enum_item(&mut self) -> Parse<'core, Enum<'core>> { @@ -220,6 +229,8 @@ impl<'core, 'src> VineParser<'core, 'src> { let name = self.parse_ident()?; let fields = if self.check(Token::OpenParen) { self.parse_delimited(PAREN_COMMA, Self::parse_type)? + } else if self.check(Token::OpenBrace) { + vec![self.parse_type()?] } else { Vec::new() }; @@ -424,29 +435,41 @@ impl<'core, 'src> VineParser<'core, 'src> { self.expect(Token::CloseParen)?; return Ok(ExprKind::Tuple(exprs)); } + if self.check(Token::OpenBrace) { + return Ok(ExprKind::Object(self.parse_delimited(BRACE_COMMA, |self_| { + let key = self_.parse_key()?; + let value = if self_.eat(Token::Colon)? { + self_.parse_expr()? + } else { + Expr { span: key.span, kind: ExprKind::Path(key.into()) } + }; + Ok((key, value)) + })?)); + } if self.check(Token::OpenBracket) { let exprs = self.parse_delimited(BRACKET_COMMA, Self::parse_expr)?; return Ok(ExprKind::List(exprs)); } - if self.check(Token::OpenBrace) { - return Ok(ExprKind::Block(self.parse_block()?)); - } if self.eat(Token::Do)? { return Ok(ExprKind::Do(self.parse_label()?, self.parse_block()?)); } if self.eat(Token::If)? { - let cond = self.parse_expr()?; - let then = self.parse_block()?; - let else_ = if self.eat(Token::Else)? { - if self.check(Token::If) || self.check(Token::OpenBrace) { - self.parse_expr()? + let mut arms = Vec::new(); + loop { + let cond = self.parse_expr()?; + let then = self.parse_block()?; + arms.push((cond, then)); + if self.eat(Token::Else)? { + if self.eat(Token::If)? { + continue; + } else { + let leg = self.parse_block()?; + return Ok(ExprKind::If(arms, Some(leg))); + } } else { - self.unexpected()? + return Ok(ExprKind::If(arms, None)); } - } else { - Expr { span: Span::NONE, kind: ExprKind::Block(Block::default()) } - }; - return Ok(ExprKind::If(Box::new(cond), then, Box::new(else_))); + } } if self.eat(Token::While)? { let label = self.parse_label()?; @@ -461,15 +484,14 @@ impl<'core, 'src> VineParser<'core, 'src> { } if self.eat(Token::Fn)? { let params = self.parse_delimited(PAREN_COMMA, Self::parse_pat)?; - let body = self.parse_expr()?; - return Ok(ExprKind::Fn(params, None, Box::new(body))); + let body = self.parse_block()?; + return Ok(ExprKind::Fn(params, None, body)); } if self.eat(Token::Match)? { let scrutinee = self.parse_expr()?; - let arms = self.parse_delimited(BRACE_COMMA, |self_| { + let arms = self.parse_delimited(BRACE, |self_| { let pat = self_.parse_pat()?; - self_.expect(Token::ThickArrow)?; - let value = self_.parse_expr()?; + let value = self_.parse_block()?; Ok((pat, value)) })?; return Ok(ExprKind::Match(Box::new(scrutinee), arms)); @@ -583,10 +605,14 @@ impl<'core, 'src> VineParser<'core, 'src> { let i = self.parse_u32_like(num, |_| Diag::InvalidNum { span: token_span })? as usize; return Ok(Ok(ExprKind::TupleField(Box::new(lhs), i, None))); } - } else { - let path = self.parse_generic_path()?; + } + let path = self.parse_generic_path()?; + if path.path.as_ident().is_none() || path.generics.is_some() || self.check(Token::OpenParen) { let args = self.parse_expr_list()?; return Ok(Ok(ExprKind::Method(Box::new(lhs), path, args))); + } else { + let key = Key { span: path.span, ident: path.path.as_ident().unwrap() }; + return Ok(Ok(ExprKind::ObjectField(Box::new(lhs), key))); } } @@ -661,6 +687,30 @@ impl<'core, 'src> VineParser<'core, 'src> { } return Ok(PatKind::Tuple(pats)); } + if self.check(Token::OpenBrace) { + return Ok(PatKind::Object(self.parse_delimited(BRACE_COMMA, |self_| { + let span = self_.start_span(); + let key = self_.parse_key()?; + let (pat, ty) = if self_.eat(Token::Colon)? { + if self_.eat(Token::Colon)? { + (None, Some(self_.parse_type()?)) + } else { + (Some(self_.parse_pat()?), None) + } + } else if self_.eat(Token::ColonColon)? { + (None, Some(self_.parse_type()?)) + } else { + (None, None) + }; + let span = self_.end_span(span); + let mut pat = + pat.unwrap_or_else(|| Pat { span: key.span, kind: PatKind::Adt(key.into(), None) }); + if let Some(ty) = ty { + pat = Pat { span, kind: PatKind::Annotation(Box::new(pat), Box::new(ty)) }; + } + Ok((key, pat)) + })?)); + } self.unexpected() } @@ -706,6 +756,14 @@ impl<'core, 'src> VineParser<'core, 'src> { } return Ok(TyKind::Tuple(types)); } + if self.check(Token::OpenBrace) { + return Ok(TyKind::Object(self.parse_delimited(BRACE_COMMA, |self_| { + let key = self_.parse_key()?; + self_.expect(Token::Colon)?; + let value = self_.parse_type()?; + Ok((key, value)) + })?)); + } if self.eat(Token::And)? { return Ok(TyKind::Ref(Box::new(self.parse_type()?))); } @@ -739,7 +797,6 @@ impl<'core, 'src> VineParser<'core, 'src> { || self.check(Token::Loop) || self.check(Token::While) || self.check(Token::For) - || self.check(Token::OpenBrace) { let expr = self.parse_expr_prefix()?; let semi = self.eat(Token::Semi)?; diff --git a/vine/src/repl.rs b/vine/src/repl.rs index 760848f1..b5aa2631 100644 --- a/vine/src/repl.rs +++ b/vine/src/repl.rs @@ -18,7 +18,7 @@ use vine_util::{ use crate::{ analyzer::{analyze, usage::Usage}, - ast::{Block, Builtin, Expr, ExprKind, Ident, Local, Span, Stmt}, + ast::{Block, Builtin, Ident, Local, Span, Stmt}, checker::{self, Checker, CheckerState, Type}, core::Core, diag::Diag, @@ -42,7 +42,7 @@ pub struct Repl<'core, 'ctx, 'ivm> { vars: HashMap, Var<'ivm>>, locals: BTreeMap>, local_count: Counter, - checker_state: CheckerState, + checker_state: CheckerState<'core>, } #[derive(Debug)] @@ -194,8 +194,7 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { let name = format!("::repl::{line}"); - let expr = Expr { span: Span::NONE, kind: ExprKind::Block(block) }; - let mut vir = distiller.distill_expr(self.local_count, &expr); + let mut vir = distiller.distill_root(self.local_count, &block, Distiller::distill_block); vir.stages[StageId(0)].declarations.retain(|l| !self.locals.contains_key(l)); vir.globals.extend(self.vars.values().map(|v| (v.local, Usage::Mut))); let mut vir = normalize(&vir); @@ -248,11 +247,11 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { Ok(stmts) } - fn show(&self, ty: &mut Type, tree: &Tree) -> String { + fn show(&self, ty: &mut Type<'core>, tree: &Tree) -> String { self._show(ty, tree).unwrap_or_else(|| format!("#ivy({})", tree)) } - fn _show(&self, ty: &mut Type, tree: &Tree) -> Option { + fn _show(&self, ty: &mut Type<'core>, tree: &Tree) -> Option { self.checker_state.try_concretize(ty); Some(match (ty, tree) { (_, Tree::Global(g)) => g.clone(), @@ -267,6 +266,14 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { (Type::Tuple(tys), _) if !tys.is_empty() => { format!("({})", self.read_tuple(tys, tree)?.join(", ")) } + (Type::Object(tys), _) if tys.is_empty() => "{}".into(), + (Type::Object(tys), _) => { + let values = self.read_tuple(tys.values_mut(), tree)?; + format!( + "{{ {} }}", + tys.keys().zip(values).map(|(k, v)| format!("{k}: {v}")).collect::>().join(", ") + ) + } (Type::Adt(def, args), tree) if self.resolver.builtins.get(&Builtin::List) == Some(def) => { let [arg] = &mut **args else { None? }; let Tree::Comb(c, l, r) = tree else { None? }; @@ -376,17 +383,25 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { }) } - fn read_tuple(&self, tys: &mut [Type], tree: &Tree) -> Option> { + fn read_tuple<'a>( + &self, + tys: impl IntoIterator, IntoIter: DoubleEndedIterator>, + tree: &Tree, + ) -> Option> + where + 'core: 'a, + { + let mut tys = tys.into_iter(); let mut tup = Vec::new(); let mut tree = tree; - let i = tys.len() - 1; - for ty in &mut tys[..i] { + let last = tys.next_back().unwrap(); + for ty in tys { let Tree::Comb(l, a, b) = tree else { None? }; let "tup" = &**l else { None? }; tup.push(self.show(ty, a)); tree = b; } - tup.push(self.show(tys.last_mut().unwrap(), tree)); + tup.push(self.show(last, tree)); Some(tup) } } diff --git a/vine/src/resolver.rs b/vine/src/resolver.rs index 547c4ffd..fc554ecd 100644 --- a/vine/src/resolver.rs +++ b/vine/src/resolver.rs @@ -75,7 +75,7 @@ pub struct ValueDef<'core> { pub vis: DefId, pub generics: Vec>, pub annotation: Option>, - pub ty: Option, + pub ty: Option>, pub locals: Counter, pub kind: ValueDefKind<'core>, } @@ -92,7 +92,7 @@ pub struct TypeDef<'core> { pub vis: DefId, pub generics: Vec>, pub alias: Option>, - pub ty: Option, + pub ty: Option>, } #[derive(Debug)] @@ -108,5 +108,6 @@ pub struct VariantDef<'core> { pub adt: DefId, pub variant: usize, pub fields: Vec>, - pub field_types: Option>, + pub object: bool, + pub field_types: Option>>, } diff --git a/vine/src/resolver/build_graph.rs b/vine/src/resolver/build_graph.rs index 0c08382d..7255f5af 100644 --- a/vine/src/resolver/build_graph.rs +++ b/vine/src/resolver/build_graph.rs @@ -51,11 +51,7 @@ impl<'core> Resolver<'core> { locals: Counter::default(), kind: ValueDefKind::Expr(Expr { span, - kind: ExprKind::Fn( - f.params, - Some(f.ret), - Box::new(Expr { span: f.body.span, kind: ExprKind::Block(f.body) }), - ), + kind: ExprKind::Fn(f.params, Some(f.ret), f.body), }), }, member_vis, @@ -122,6 +118,7 @@ impl<'core> Resolver<'core> { adt: child.id, variant: 0, fields: s.fields, + object: s.object, field_types: None, }); child.value_def = Some(ValueDef { @@ -157,6 +154,7 @@ impl<'core> Resolver<'core> { adt, variant: i, fields: v.fields, + object: false, field_types: None, }); variant.value_def = Some(ValueDef { diff --git a/vine/src/resolver/resolve_defs.rs b/vine/src/resolver/resolve_defs.rs index cd90083b..32d06cd9 100644 --- a/vine/src/resolver/resolve_defs.rs +++ b/vine/src/resolver/resolve_defs.rs @@ -208,12 +208,16 @@ impl<'core> VisitMut<'core, '_> for ResolveVisitor<'core, '_> { self.visit_cond(expr); self.exit_scope(); } - ExprKind::If(cond, block, els) => { - self.enter_scope(); - self.visit_cond(cond); - self.visit_block(block); - self.exit_scope(); - self.visit_expr(els); + ExprKind::If(arms, leg) => { + for (cond, block) in arms { + self.enter_scope(); + self.visit_cond(cond); + self.visit_block(block); + self.exit_scope(); + } + if let Some(leg) = leg { + self.visit_block(leg); + } } ExprKind::While(label, cond, block) => { self.bind_label(label, true, |self_| { diff --git a/vine/src/visit.rs b/vine/src/visit.rs index 3969d1ec..6b001f86 100644 --- a/vine/src/visit.rs +++ b/vine/src/visit.rs @@ -77,6 +77,7 @@ pub trait VisitMut<'core, 'a> { | ExprKind::Break(_, Some(a)) | ExprKind::Return(Some(a)) | ExprKind::TupleField(a, _, _) + | ExprKind::ObjectField(a, _) | ExprKind::Inverse(a, _) | ExprKind::Copy(a) | ExprKind::Hedge(a) @@ -91,20 +92,26 @@ pub trait VisitMut<'core, 'a> { } ExprKind::Path(p) => self.visit_generic_path(p), - ExprKind::Block(b) | ExprKind::Do(_, b) | ExprKind::Loop(_, b) => self.visit_block(b), + ExprKind::Do(_, b) | ExprKind::Loop(_, b) => self.visit_block(b), ExprKind::Match(a, b) => { self.visit_expr(a); - for (t, u) in b { + for (p, b) in b { self.enter_scope(); - self.visit_pat(t); - self.visit_expr(u); + self.visit_pat(p); + self.visit_block(b); self.exit_scope(); } } - ExprKind::If(a, b, c) => { - self.visit_expr(a); - self.visit_block(b); - self.visit_expr(c); + ExprKind::If(arms, leg) => { + for (cond, block) in arms { + self.enter_scope(); + self.visit_expr(cond); + self.visit_block(block); + self.exit_scope(); + } + if let Some(leg) = leg { + self.visit_block(leg); + } } ExprKind::While(_, a, b) => { self.visit_expr(a); @@ -118,7 +125,7 @@ pub trait VisitMut<'core, 'a> { if let Some(Some(b)) = b { self.visit_type(b); } - self.visit_expr(c); + self.visit_block(c); self.exit_scope(); } ExprKind::Tuple(a) | ExprKind::List(a) | ExprKind::Adt(_, a) => { @@ -149,6 +156,11 @@ pub trait VisitMut<'core, 'a> { self.visit_expr(e); self.visit_pat(p); } + ExprKind::Object(o) => { + for (_, v) in o { + self.visit_expr(v); + } + } } } @@ -175,6 +187,11 @@ pub trait VisitMut<'core, 'a> { self.visit_pat(p); self.visit_type(t); } + PatKind::Object(o) => { + for (_, v) in o { + self.visit_pat(v); + } + } } } @@ -196,6 +213,11 @@ pub trait VisitMut<'core, 'a> { self.visit_type(r); } } + TyKind::Object(o) => { + for (_, v) in o { + self.visit_type(v); + } + } TyKind::Error(_) => {} } } diff --git a/vine/std/array.vi b/vine/std/array.vi index 264470fe..a42720e2 100644 --- a/vine/std/array.vi +++ b/vine/std/array.vi @@ -28,7 +28,7 @@ pub mod Array { pub fn to_list[T](self: Array[T]) -> List[T] { let end; - List(self.len(), self.fold_back(move ~end, fn(a, b) Buf(b, a)), end) + List(self.len(), self.fold_back(move ~end, fn(a, b) { Buf(b, a) }), end) } pub fn from_fn[T, S](len: N32, &state: &S, f: fn(&S) -> T) -> Array[T] { @@ -36,7 +36,7 @@ pub mod Array { Array::empty } else { let ~ins; - let (node, outs) = Node::unzip_with(len, move ~ins, fn(s) (f(&s), s)); + let (node, outs) = Node::unzip_with(len, move ~ins, fn(s) { (f(&s), s) }); let outs = Array(len, outs); let end = outs.pop_back().unwrap(); outs.push_front(state); diff --git a/vine/std/list.vi b/vine/std/list.vi index 72b2ca58..a0eee81d 100644 --- a/vine/std/list.vi +++ b/vine/std/list.vi @@ -286,14 +286,16 @@ pub mod List { let b = b.iter(); let ord = loop { match (a.next(), b.next()) { - (None, None) => break Ord::Eq, - (None, Some(_)) => break Ord::Lt, - (Some(_), None) => break Ord::Gt, - (Some(a), Some(b)) => match cmp_el(a, b) { - Ord::Lt => break Ord::Lt, - Ord::Eq => {}, - Ord::Gt => break Ord::Gt, - }, + (None, None) { break Ord::Eq } + (None, Some(_)) { break Ord::Lt } + (Some(_), None) { break Ord::Gt } + (Some(a), Some(b)) { + match cmp_el(a, b) { + Ord::Lt { break Ord::Lt } + Ord::Eq {} + Ord::Gt { break Ord::Gt } + } + } } }; a.drop(); diff --git a/vine/std/map.vi b/vine/std/map.vi index b442016f..37f397e0 100644 --- a/vine/std/map.vi +++ b/vine/std/map.vi @@ -182,21 +182,21 @@ mod Node { let &(left, (cur_key, cur_value), right) = &data; let old; match cmp(&key, &cur_key) { - Ord::Lt => { + Ord::Lt { old = left.insert(cmp, key, value); len = map::size(&data); balance_right(&data); - }, - Ord::Eq => { + } + Ord::Eq { old = Some(cur_value); cur_key = key; cur_value = value; - }, - Ord::Gt => { + } + Ord::Gt { old = right.insert(cmp, key, value); len = map::size(&data); balance_left(&data); - }, + } } old } @@ -208,9 +208,9 @@ mod Node { } else { let &(left, (cur_key, cur_value), right) = &data; match cmp(&key, &cur_key) { - Ord::Lt => left.get(cmp, &key), - Ord::Eq => Some(&cur_value), - Ord::Gt => right.get(cmp, &key), + Ord::Lt { left.get(cmp, &key) } + Ord::Eq { Some(&cur_value) } + Ord::Gt { right.get(cmp, &key) } } } } @@ -221,13 +221,15 @@ mod Node { } else { let &(left, (cur_key, cur_value), right) = &data; match cmp(&key, &cur_key) { - Ord::Lt => left.get_ge(cmp, &key), - Ord::Eq => Some(&(cur_key, cur_value)), - Ord::Gt => if right.get_ge(cmp, &key) is Some(entry) { - Some(entry) - } else { - Some(&(cur_key, cur_value)) - }, + Ord::Lt { left.get_ge(cmp, &key) } + Ord::Eq { Some(&(cur_key, cur_value)) } + Ord::Gt { + if right.get_ge(cmp, &key) is Some(entry) { + Some(entry) + } else { + Some(&(cur_key, cur_value)) + } + } } } } @@ -238,13 +240,15 @@ mod Node { } else { let &(left, (cur_key, cur_value), right) = &data; match cmp(&key, &cur_key) { - Ord::Lt => if left.get_ge(cmp, &key) is Some(entry) { - Some(entry) - } else { - Some(&(cur_key, cur_value)) - }, - Ord::Eq => Some(&(cur_key, cur_value)), - Ord::Gt => right.get_ge(cmp, &key), + Ord::Lt { + if left.get_ge(cmp, &key) is Some(entry) { + Some(entry) + } else { + Some(&(cur_key, cur_value)) + } + } + Ord::Eq { Some(&(cur_key, cur_value)) } + Ord::Gt { right.get_ge(cmp, &key) } } } } @@ -256,21 +260,21 @@ mod Node { let &(left, (cur_key, cur_value), right) = &data; let old; match cmp(&key, &cur_key) { - Ord::Lt => { + Ord::Lt { old = left.remove(cmp, &key); len = map::size(&data); balance_left(&data); - }, - Ord::Eq => { + } + Ord::Eq { old = Some(cur_value); len -= 1; data = merge_balanced(cmp, move left, move right); - }, - Ord::Gt => { + } + Ord::Gt { old = right.remove(cmp, &key); len = map::size(&data); balance_right(&data); - }, + } } old } diff --git a/vine/std/option.vi b/vine/std/option.vi index aa674c55..d03bb3b0 100644 --- a/vine/std/option.vi +++ b/vine/std/option.vi @@ -7,22 +7,22 @@ pub enum Option[T] { pub mod Option { pub fn map[T, U](self: Option[T], f: fn(T) -> U) -> Option[U] { match self { - Some(val) => Some(f(val)), - None => None, + Some(val) { Some(f(val)) } + None { None } } } pub fn as_ref[T](&self: &Option[T]) -> Option[&T] { match &self { - &Some(val) => Some(&val), - &None => None, + &Some(val) { Some(&val) } + &None { None } } } pub fn flatten[T](self: Option[Option[T]]) -> Option[T] { match self { - Some(Some(val)) => Some(val), - _ => None, + Some(Some(val)) { Some(val) } + _ { None } } } @@ -32,21 +32,21 @@ pub mod Option { pub fn or[T](self: Option[T], default: Option[T]) -> Option[T] { match self { - None => default, - x => x, + None { default } + x { x } } } pub fn unwrap_or[T](self: Option[T], default: T) -> T { match self { - Some(val) => val, - None => default, + Some(val) { val } + None { default } } } pub fn unwrap[T](self: Option[T]) -> T { match self { - Some(val) => val, + Some(val) { val } } } } diff --git a/vine/std/result.vi b/vine/std/result.vi index 8440f5df..578188b3 100644 --- a/vine/std/result.vi +++ b/vine/std/result.vi @@ -7,23 +7,23 @@ pub enum Result[T, E] { pub mod Result { pub fn map[T, U, E](self: Result[T, E], f: fn(T) -> U) -> Result[U, E] { match self { - Ok(val) => Ok(f(val)), - Err(err) => Err(err), + Ok(val) { Ok(f(val)) } + Err(err) { Err(err) } } } pub fn as_ref[T, E](&self: &Result[T, E]) -> Result[&T, &E] { match &self { - &Ok(val) => Ok(&val), - &Err(err) => Err(&err), + &Ok(val) { Ok(&val) } + &Err(err) { Err(&err) } } } pub fn flatten[T, E](self: Result[Result[T, E], E]) -> Result[T, E] { match self { - Ok(Ok(val)) => Ok(val), - Ok(Err(err)) => Err(err), - Err(err) => Err(err), + Ok(Ok(val)) { Ok(val) } + Ok(Err(err)) { Err(err) } + Err(err) { Err(err) } } } @@ -33,21 +33,21 @@ pub mod Result { pub fn or[T, E](self: Result[T, E], default: Result[T, E]) -> Result[T, E] { match self { - Err(_) => default, - x => x, + Err(_) { default } + x { x } } } pub fn unwrap_or[T, E](self: Result[T, E], default: T) -> T { match self { - Ok(val) => val, - Err(_) => default, + Ok(val) { val } + Err(_) { default } } } pub fn unwrap[T, E](self: Result[T, E], default: T) -> T { match self { - Ok(val) => val, + Ok(val) { val } } } } diff --git a/vine/std/tuple.vi b/vine/std/tuple.vi index 1c8f6d0e..d080c283 100644 --- a/vine/std/tuple.vi +++ b/vine/std/tuple.vi @@ -8,15 +8,15 @@ pub mod Pair { ( fn(&(a0: A, b0: B), &(a1: A, b1: B)) { match f(&a0, &a1) { - Ord::Lt => Ord::Lt, - Ord::Gt => Ord::Gt, - Ord::Eq => g(&b0, &b1), + Ord::Lt { Ord::Lt } + Ord::Gt { Ord::Gt } + Ord::Eq { g(&b0, &b1) } } } ) } pub fn to_string[A, B](show_a: fn(A) -> String, show_b: fn(B) -> String) -> fn((A, B)) -> String { - (fn((a: A, b: B)) "(" ++ show_a(a) ++ ", " ++ show_b(b) ++ ")") + (fn((a: A, b: B)) { "(" ++ show_a(a) ++ ", " ++ show_b(b) ++ ")" }) } }