From bc23051438cb0b502dfaff6350a4a9d442045077 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 6 Jan 2025 09:46:37 -0500 Subject: [PATCH 01/13] trait/impl items in ast --- vine/src/ast.rs | 28 +++++++++++++++++++++-- vine/src/diag.rs | 2 ++ vine/src/fmt.rs | 29 ++++++++++++++++++++---- vine/src/lexer.rs | 4 ++++ vine/src/loader.rs | 4 ++-- vine/src/parser.rs | 39 +++++++++++++++++++++++++++----- vine/src/resolver/build_graph.rs | 28 ++++++++++++++++++++--- vine/src/visit.rs | 6 +++-- 8 files changed, 121 insertions(+), 19 deletions(-) diff --git a/vine/src/ast.rs b/vine/src/ast.rs index 34d09dcb..50da21c6 100644 --- a/vine/src/ast.rs +++ b/vine/src/ast.rs @@ -30,6 +30,8 @@ pub enum ItemKind<'core> { Enum(Enum<'core>), Type(TypeItem<'core>), Mod(ModItem<'core>), + Trait(TraitItem<'core>), + Impl(ImplItem<'core>), Use(UseItem<'core>), Ivy(InlineIvy<'core>), #[default] @@ -42,7 +44,7 @@ pub struct FnItem<'core> { pub generics: Vec>, pub params: Vec>, pub ret: Option>, - pub body: Block<'core>, + pub body: Option>, } #[derive(Debug, Clone)] @@ -50,7 +52,7 @@ pub struct ConstItem<'core> { pub name: Ident<'core>, pub generics: Vec>, pub ty: Ty<'core>, - pub value: Expr<'core>, + pub value: Option>, } #[derive(Debug, Clone)] @@ -94,6 +96,28 @@ pub enum ModKind<'core> { Error(ErrorGuaranteed), } +#[derive(Debug, Clone)] +pub struct TraitItem<'core> { + pub name: Ident<'core>, + pub generics: Vec>, + pub items: Vec>, +} + +#[derive(Debug, Clone)] +pub struct ImplItem<'core> { + pub name: Ident<'core>, + pub generics: Vec>, + pub trait_: Trait<'core>, + pub items: Vec>, +} + +#[derive(Debug, Clone)] +pub struct Trait<'core> { + pub span: Span, + pub path: Path<'core>, + pub args: Vec>, +} + #[derive(Debug, Clone)] pub struct UseItem<'core> { pub absolute: bool, diff --git a/vine/src/diag.rs b/vine/src/diag.rs index c32fe261..dcaeed5c 100644 --- a/vine/src/diag.rs +++ b/vine/src/diag.rs @@ -158,6 +158,8 @@ diags! { ["subitems must be private"] DuplicateKey ["duplicate object key"] + MissingImplementation + ["missing implementation"] } fn plural<'a>(n: usize, plural: &'a str, singular: &'a str) -> &'a str { diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index 98b01284..7dec644c 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -50,8 +50,10 @@ impl<'core: 'src, 'src> Formatter<'src> { self.fmt_generics(&f.generics), Doc::paren_comma(params.iter().map(|p| self.fmt_pat(p))), self.fmt_return_ty(f.ret.as_ref()), - Doc(" "), - self.fmt_block(&f.body, true), + match &f.body { + Some(b) => Doc::concat([Doc(" "), self.fmt_block(b, true)]), + None => Doc(";"), + }, ]) } ItemKind::Const(c) => Doc::concat([ @@ -60,8 +62,10 @@ impl<'core: 'src, 'src> Formatter<'src> { self.fmt_generics(&c.generics), Doc(": "), self.fmt_ty(&c.ty), - Doc(" = "), - self.fmt_expr(&c.value), + match &c.value { + Some(v) => Doc::concat([Doc(" = "), self.fmt_expr(v)]), + None => Doc(""), + }, Doc(";"), ]), ItemKind::Struct(s) => Doc::concat([ @@ -118,6 +122,23 @@ impl<'core: 'src, 'src> Formatter<'src> { ModKind::Error(_) => unreachable!(), }, ]), + ItemKind::Trait(t) => Doc::concat([ + Doc("trait "), + Doc(t.name), + self.fmt_generics(&t.generics), + Doc(" "), + self.fmt_block_like(item.span, t.items.iter().map(|i| (i.span, self.fmt_item(i)))), + ]), + ItemKind::Impl(i) => Doc::concat([ + Doc("impl "), + Doc(i.name), + self.fmt_generics(&i.generics), + Doc(": "), + self.fmt_path(&i.trait_.path), + Doc::bracket_comma(i.trait_.args.iter().map(|a| self.fmt_ty(a))), + Doc(" "), + self.fmt_block_like(item.span, i.items.iter().map(|i| (i.span, self.fmt_item(i)))), + ]), ItemKind::Use(u) => Doc::concat([ Doc(if u.absolute { "use ::" } else { "use " }), Self::fmt_use_tree(None, &u.tree), diff --git a/vine/src/lexer.rs b/vine/src/lexer.rs index f077e84e..407842e1 100644 --- a/vine/src/lexer.rs +++ b/vine/src/lexer.rs @@ -112,6 +112,10 @@ pub enum Token { Type, #[token("inline_ivy")] InlineIvy, + #[token("trait")] + Trait, + #[token("impl")] + Impl, #[token("match")] Match, #[token("move")] diff --git a/vine/src/loader.rs b/vine/src/loader.rs index 269536a8..6df5edfd 100644 --- a/vine/src/loader.rs +++ b/vine/src/loader.rs @@ -60,7 +60,7 @@ impl<'core> Loader<'core> { None, ), }, - value: Expr { + value: Some(Expr { span: Span::NONE, kind: ExprKind::Path(ast::GenericPath { span: Span::NONE, @@ -71,7 +71,7 @@ impl<'core> Loader<'core> { }, generics: None, }), - }, + }), }), }); self.load_mod(path) diff --git a/vine/src/parser.rs b/vine/src/parser.rs index 9497213c..a606384b 100644 --- a/vine/src/parser.rs +++ b/vine/src/parser.rs @@ -7,9 +7,9 @@ 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, Key, Label, LetStmt, LogicalOp, - ModItem, ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, StructItem, Ty, TyKind, TypeItem, - UseItem, UseTree, Variant, Vis, + ExprKind, FnItem, GenericPath, Ident, ImplItem, InlineIvy, Item, ItemKind, Key, Label, LetStmt, + LogicalOp, ModItem, ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, StructItem, Trait, + TraitItem, Ty, TyKind, TypeItem, UseItem, UseTree, Variant, Vis, }; pub struct VineParser<'core, 'src> { @@ -74,6 +74,8 @@ impl<'core, 'src> VineParser<'core, 'src> { _ if self.check(Token::Enum) => ItemKind::Enum(self.parse_enum_item()?), _ if self.check(Token::Type) => ItemKind::Type(self.parse_type_item()?), _ if self.check(Token::Mod) => ItemKind::Mod(self.parse_mod_item()?), + _ if self.check(Token::Trait) => ItemKind::Trait(self.parse_trait_item()?), + _ if self.check(Token::Impl) => ItemKind::Impl(self.parse_impl_item()?), _ if self.check(Token::Use) => ItemKind::Use(self.parse_use_item()?), _ if self.check(Token::InlineIvy) => ItemKind::Ivy(self.parse_ivy_item()?), _ if span == self.start_span() => return Ok(None), @@ -177,7 +179,7 @@ impl<'core, 'src> VineParser<'core, 'src> { let generics = self.parse_generics()?; let params = self.parse_delimited(PAREN_COMMA, Self::parse_pat)?; let ret = self.eat(Token::ThinArrow)?.then(|| self.parse_type()).transpose()?; - let body = self.parse_block()?; + let body = (!self.eat(Token::Semi)?).then(|| self.parse_block()).transpose()?; Ok(FnItem { name, generics, params, ret, body }) } @@ -187,8 +189,7 @@ impl<'core, 'src> VineParser<'core, 'src> { let generics = self.parse_generics()?; self.expect(Token::Colon)?; let ty = self.parse_type()?; - self.expect(Token::Eq)?; - let value = self.parse_expr()?; + let value = self.eat(Token::Eq)?.then(|| self.parse_expr()).transpose()?; self.expect(Token::Semi)?; Ok(ConstItem { name, generics, ty, value }) } @@ -263,6 +264,32 @@ impl<'core, 'src> VineParser<'core, 'src> { } } + fn parse_trait_item(&mut self) -> Parse<'core, TraitItem<'core>> { + self.expect(Token::Trait)?; + let name = self.parse_ident()?; + let generics = self.parse_generics()?; + let items = self.parse_delimited(BRACE, Self::parse_item)?; + Ok(TraitItem { name, generics, items }) + } + + fn parse_impl_item(&mut self) -> Parse<'core, ImplItem<'core>> { + self.expect(Token::Impl)?; + let name = self.parse_ident()?; + let generics = self.parse_generics()?; + self.expect(Token::Colon)?; + let trait_ = self.parse_trait()?; + let items = self.parse_delimited(BRACE, Self::parse_item)?; + Ok(ImplItem { name, generics, trait_, items }) + } + + fn parse_trait(&mut self) -> Parse<'core, Trait<'core>> { + let span = self.start_span(); + let path = self.parse_path()?; + let args = self.parse_delimited(BRACKET_COMMA, Self::parse_type)?; + let span = self.end_span(span); + Ok(Trait { span, path, args }) + } + fn parse_use_item(&mut self) -> Parse<'core, UseItem<'core>> { self.expect(Token::Use)?; let absolute = self.eat(Token::ColonColon)?; diff --git a/vine/src/resolver/build_graph.rs b/vine/src/resolver/build_graph.rs index 1c6e1e8c..04a525f0 100644 --- a/vine/src/resolver/build_graph.rs +++ b/vine/src/resolver/build_graph.rs @@ -4,7 +4,8 @@ use vine_util::idx::Counter; use crate::{ ast::{ - AttrKind, Builtin, Expr, ExprKind, Ident, Item, ItemKind, ModKind, Path, Span, UseTree, Vis, + AttrKind, Block, Builtin, Expr, ExprKind, Ident, Item, ItemKind, ModKind, Path, Span, Stmt, + StmtKind, UseTree, Vis, }, core::Core, diag::Diag, @@ -51,7 +52,23 @@ impl<'core> Resolver<'core> { locals: Counter::default(), kind: ValueDefKind::Expr(Expr { span, - kind: ExprKind::Fn(f.params, Some(f.ret), f.body), + kind: ExprKind::Fn( + f.params, + Some(f.ret), + f.body.unwrap_or_else(|| Block { + span, + stmts: vec![Stmt { + span, + kind: StmtKind::Expr( + Expr { + span, + kind: ExprKind::Error(self.core.report(Diag::MissingImplementation { span })), + }, + false, + ), + }], + }), + ), }), }, member_vis, @@ -66,7 +83,10 @@ impl<'core> Resolver<'core> { annotation: Some(c.ty), ty: None, locals: Counter::default(), - kind: ValueDefKind::Expr(c.value), + kind: ValueDefKind::Expr(c.value.unwrap_or_else(|| Expr { + span, + kind: ExprKind::Error(self.core.report(Diag::MissingImplementation { span })), + })), }, member_vis, ), @@ -184,6 +204,8 @@ impl<'core> Resolver<'core> { Some(TypeDef { vis, generics: t.generics.clone(), alias: Some(t.ty), ty: None }); Some(child.id) } + ItemKind::Trait(_) => todo!(), + ItemKind::Impl(_) => todo!(), ItemKind::Taken => None, }; for attr in item.attrs { diff --git a/vine/src/visit.rs b/vine/src/visit.rs index 6b001f86..638cc034 100644 --- a/vine/src/visit.rs +++ b/vine/src/visit.rs @@ -259,11 +259,11 @@ pub trait VisitMut<'core, 'a> { if let Some(ty) = &mut f.ret { self.visit_type(ty); } - self.visit_block(&mut f.body); + self.visit(&mut f.body); } ItemKind::Const(c) => { self.visit_type(&mut c.ty); - self.visit_expr(&mut c.value); + self.visit(&mut c.value); } ItemKind::Mod(m) => match &mut m.kind { ModKind::Loaded(_, items) => { @@ -288,6 +288,8 @@ pub trait VisitMut<'core, 'a> { ItemKind::Type(t) => { self.visit_type(&mut t.ty); } + ItemKind::Trait(_) => todo!(), + ItemKind::Impl(_) => todo!(), ItemKind::Use(..) | ItemKind::Ivy(_) | ItemKind::Taken => {} } } From 9cb65748ba0f612546d7e8c82c3e09a3f48406b2 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Thu, 9 Jan 2025 08:53:08 -0500 Subject: [PATCH 02/13] add impl generics to ast --- vine/src/ast.rs | 42 ++++++++++++--------- vine/src/fmt.rs | 69 ++++++++++++++++++++++------------ vine/src/loader.rs | 6 +-- vine/src/parser.rs | 94 +++++++++++++++++++++++++++++++--------------- vine/src/visit.rs | 2 +- 5 files changed, 139 insertions(+), 74 deletions(-) diff --git a/vine/src/ast.rs b/vine/src/ast.rs index 50da21c6..63d825a7 100644 --- a/vine/src/ast.rs +++ b/vine/src/ast.rs @@ -41,7 +41,7 @@ pub enum ItemKind<'core> { #[derive(Debug, Clone)] pub struct FnItem<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub params: Vec>, pub ret: Option>, pub body: Option>, @@ -50,7 +50,7 @@ pub struct FnItem<'core> { #[derive(Debug, Clone)] pub struct ConstItem<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub ty: Ty<'core>, pub value: Option>, } @@ -58,14 +58,14 @@ pub struct ConstItem<'core> { #[derive(Debug, Clone)] pub struct TypeItem<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub ty: Ty<'core>, } #[derive(Debug, Clone)] pub struct StructItem<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub fields: Vec>, pub object: bool, } @@ -73,7 +73,7 @@ pub struct StructItem<'core> { #[derive(Debug, Clone)] pub struct Enum<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub variants: Vec>, } @@ -99,25 +99,18 @@ pub enum ModKind<'core> { #[derive(Debug, Clone)] pub struct TraitItem<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub items: Vec>, } #[derive(Debug, Clone)] pub struct ImplItem<'core> { pub name: Ident<'core>, - pub generics: Vec>, - pub trait_: Trait<'core>, + pub generics: GenericParams<'core>, + pub trait_: GenericPath<'core>, pub items: Vec>, } -#[derive(Debug, Clone)] -pub struct Trait<'core> { - pub span: Span, - pub path: Path<'core>, - pub args: Vec>, -} - #[derive(Debug, Clone)] pub struct UseItem<'core> { pub absolute: bool, @@ -140,7 +133,7 @@ impl<'core> UseTree<'core> { #[derive(Debug, Clone)] pub struct InlineIvy<'core> { pub name: Ident<'core>, - pub generics: Vec>, + pub generics: GenericParams<'core>, pub ty: Ty<'core>, pub net: Net, } @@ -177,6 +170,21 @@ pub enum Builtin { Concat, } +pub type GenericParams<'core> = Generics, (Ident<'core>, GenericPath<'core>)>; +pub type GenericArgs<'core> = Generics, Option>>; + +#[derive(Debug, Clone)] +pub struct Generics { + pub types: Vec, + pub impls: Vec, +} + +impl Default for Generics { + fn default() -> Self { + Self { types: Default::default(), impls: Default::default() } + } +} + #[derive(Default, Debug, Clone, PartialEq, Eq)] pub struct Path<'core> { pub segments: Vec>, @@ -387,7 +395,7 @@ pub enum PatKind<'core> { pub struct GenericPath<'core> { pub span: Span, pub path: Path<'core>, - pub generics: Option>>, + pub generics: Option>, } #[derive(Clone)] diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index 7dec644c..5af5028b 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -4,8 +4,9 @@ use doc::{Doc, Writer}; use crate::{ ast::{ - Block, ComparisonOp, Expr, ExprKind, GenericPath, Ident, Item, ItemKind, Label, LogicalOp, - ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, Ty, TyKind, UseTree, Vis, + Block, ComparisonOp, Expr, ExprKind, GenericArgs, GenericParams, GenericPath, Generics, Ident, + Item, ItemKind, Label, LogicalOp, ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, Ty, + TyKind, UseTree, Vis, }, core::Core, diag::Diag, @@ -47,7 +48,7 @@ impl<'core: 'src, 'src> Formatter<'src> { Doc::concat([ Doc("fn "), Doc(f.name), - self.fmt_generics(&f.generics), + self.fmt_generic_params(&f.generics), Doc::paren_comma(params.iter().map(|p| self.fmt_pat(p))), self.fmt_return_ty(f.ret.as_ref()), match &f.body { @@ -59,7 +60,7 @@ impl<'core: 'src, 'src> Formatter<'src> { ItemKind::Const(c) => Doc::concat([ Doc("const "), Doc(c.name), - self.fmt_generics(&c.generics), + self.fmt_generic_params(&c.generics), Doc(": "), self.fmt_ty(&c.ty), match &c.value { @@ -71,7 +72,7 @@ impl<'core: 'src, 'src> Formatter<'src> { ItemKind::Struct(s) => Doc::concat([ Doc("struct "), Doc(s.name), - self.fmt_generics(&s.generics), + self.fmt_generic_params(&s.generics), if s.object { let TyKind::Object(e) = &s.fields[0].kind else { unreachable!() }; Doc::concat([ @@ -87,7 +88,7 @@ impl<'core: 'src, 'src> Formatter<'src> { ItemKind::Enum(e) => Doc::concat([ Doc("enum "), Doc(e.name), - self.fmt_generics(&e.generics), + self.fmt_generic_params(&e.generics), Doc(" "), Doc::brace_comma_multiline(e.variants.iter().map(|v| { Doc::concat([ @@ -103,7 +104,7 @@ impl<'core: 'src, 'src> Formatter<'src> { ItemKind::Type(t) => Doc::concat([ Doc("type "), Doc(t.name), - self.fmt_generics(&t.generics), + self.fmt_generic_params(&t.generics), Doc(" = "), self.fmt_ty(&t.ty), Doc(";"), @@ -125,17 +126,16 @@ impl<'core: 'src, 'src> Formatter<'src> { ItemKind::Trait(t) => Doc::concat([ Doc("trait "), Doc(t.name), - self.fmt_generics(&t.generics), + self.fmt_generic_params(&t.generics), Doc(" "), self.fmt_block_like(item.span, t.items.iter().map(|i| (i.span, self.fmt_item(i)))), ]), ItemKind::Impl(i) => Doc::concat([ Doc("impl "), Doc(i.name), - self.fmt_generics(&i.generics), + self.fmt_generic_params(&i.generics), Doc(": "), - self.fmt_path(&i.trait_.path), - Doc::bracket_comma(i.trait_.args.iter().map(|a| self.fmt_ty(a))), + self.fmt_generic_path(&i.trait_), Doc(" "), self.fmt_block_like(item.span, i.items.iter().map(|i| (i.span, self.fmt_item(i)))), ]), @@ -293,11 +293,38 @@ impl<'core: 'src, 'src> Formatter<'src> { } } - fn fmt_generics(&self, generics: &[Ident<'core>]) -> Doc<'src> { - if generics.is_empty() { - Doc::EMPTY + fn fmt_generic_params(&self, generics: &GenericParams<'core>) -> Doc<'src> { + self.fmt_generics( + generics, + |i| Doc(*i), + |(i, t)| Doc::concat([Doc(*i), Doc(": "), self.fmt_generic_path(&t)]), + ) + } + + fn fmt_generic_args(&self, generics: &GenericArgs<'core>) -> Doc<'src> { + self.fmt_generics( + generics, + |t| self.fmt_ty(t), + |p| p.as_ref().map(|p| self.fmt_generic_path(p)).unwrap_or(Doc("_")), + ) + } + + fn fmt_generics( + &self, + generics: &Generics, + fmt_t: impl Fn(&T) -> Doc<'src>, + fmt_i: impl Fn(&I) -> Doc<'src>, + ) -> Doc<'src> { + if generics.impls.is_empty() { + if generics.types.is_empty() { + Doc::EMPTY + } else { + Doc::bracket_comma(generics.types.iter().map(fmt_t)) + } + } else if generics.types.is_empty() { + Doc::delimited("", "[;", "]", false, false, false, false, generics.impls.iter().map(fmt_i)) } else { - Doc::bracket_comma(generics.iter().map(|x| Doc(*x))) + todo!() } } @@ -506,14 +533,10 @@ impl<'core: 'src, 'src> Formatter<'src> { } fn fmt_generic_path(&self, path: &GenericPath<'core>) -> Doc<'src> { - if let Some(gens) = &path.generics { - Doc::concat([ - self.fmt_path(&path.path), - Doc::bracket_comma(gens.iter().map(|x| self.fmt_ty(x))), - ]) - } else { - self.fmt_path(&path.path) - } + Doc::concat([ + self.fmt_path(&path.path), + path.generics.as_ref().map(|g| self.fmt_generic_args(g)).unwrap_or(Doc("")), + ]) } fn fmt_path(&self, path: &Path<'core>) -> Doc<'src> { diff --git a/vine/src/loader.rs b/vine/src/loader.rs index 6df5edfd..ceeb75cb 100644 --- a/vine/src/loader.rs +++ b/vine/src/loader.rs @@ -8,8 +8,8 @@ use std::{ use crate::{ ast::{ - self, ConstItem, Expr, ExprKind, GenericPath, Ident, Item, ItemKind, ModItem, ModKind, Span, - Ty, TyKind, Vis, + self, ConstItem, Expr, ExprKind, GenericParams, GenericPath, Ident, Item, ItemKind, ModItem, + ModKind, Span, Ty, TyKind, Vis, }, core::Core, diag::{Diag, FileInfo}, @@ -42,7 +42,7 @@ impl<'core> Loader<'core> { attrs: Vec::new(), kind: ItemKind::Const(ConstItem { name: main, - generics: Vec::new(), + generics: GenericParams::default(), ty: Ty { span: Span::NONE, kind: TyKind::Fn( diff --git a/vine/src/parser.rs b/vine/src/parser.rs index a606384b..d8329c85 100644 --- a/vine/src/parser.rs +++ b/vine/src/parser.rs @@ -7,9 +7,9 @@ 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, ImplItem, InlineIvy, Item, ItemKind, Key, Label, LetStmt, - LogicalOp, ModItem, ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, StructItem, Trait, - TraitItem, Ty, TyKind, TypeItem, UseItem, UseTree, Variant, Vis, + ExprKind, FnItem, GenericArgs, GenericParams, GenericPath, Generics, Ident, ImplItem, InlineIvy, + Item, ItemKind, Key, Label, LetStmt, LogicalOp, ModItem, ModKind, Pat, PatKind, Path, Span, Stmt, + StmtKind, StructItem, TraitItem, Ty, TyKind, TypeItem, UseItem, UseTree, Variant, Vis, }; pub struct VineParser<'core, 'src> { @@ -176,7 +176,7 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_fn_item(&mut self) -> Parse<'core, FnItem<'core>> { self.expect(Token::Fn)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; let params = self.parse_delimited(PAREN_COMMA, Self::parse_pat)?; let ret = self.eat(Token::ThinArrow)?.then(|| self.parse_type()).transpose()?; let body = (!self.eat(Token::Semi)?).then(|| self.parse_block()).transpose()?; @@ -186,7 +186,7 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_const_item(&mut self) -> Parse<'core, ConstItem<'core>> { self.expect(Token::Const)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; self.expect(Token::Colon)?; let ty = self.parse_type()?; let value = self.eat(Token::Eq)?.then(|| self.parse_expr()).transpose()?; @@ -197,7 +197,7 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_struct_item(&mut self) -> Parse<'core, StructItem<'core>> { self.expect(Token::Struct)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; let (fields, object) = if self.check(Token::OpenParen) { (self.parse_delimited(PAREN_COMMA, Self::parse_type)?, false) } else if self.check(Token::OpenBrace) { @@ -212,7 +212,7 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_enum_item(&mut self) -> Parse<'core, Enum<'core>> { self.expect(Token::Enum)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; let variants = self.parse_delimited(BRACE_COMMA, Self::parse_variant)?; Ok(Enum { name, generics, variants }) } @@ -220,7 +220,7 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_type_item(&mut self) -> Parse<'core, TypeItem<'core>> { self.expect(Token::Type)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; self.expect(Token::Eq)?; let ty = self.parse_type()?; self.expect(Token::Semi)?; @@ -239,12 +239,57 @@ impl<'core, 'src> VineParser<'core, 'src> { Ok(Variant { name, fields }) } - fn parse_generics(&mut self) -> Parse<'core, Vec>> { - if self.check(Token::OpenBracket) { - self.parse_delimited(BRACKET_COMMA, Self::parse_ident) - } else { - Ok(Vec::new()) + fn parse_generic_params(&mut self) -> Parse<'core, GenericParams<'core>> { + self.parse_generics(Self::parse_ident, |self_| { + let name = self_.parse_ident()?; + self_.expect(Token::Colon)?; + let trait_ = self_.parse_generic_path()?; + Ok((name, trait_)) + }) + } + + fn parse_generic_args(&mut self) -> Parse<'core, GenericArgs<'core>> { + self.parse_generics(Self::parse_type, |self_| { + (!self_.eat(Token::Hole)?).then(|| self_.parse_generic_path()).transpose() + }) + } + + fn parse_generics( + &mut self, + mut parse_t: impl FnMut(&mut Self) -> Parse<'core, T>, + mut parse_i: impl FnMut(&mut Self) -> Parse<'core, I>, + ) -> Parse<'core, Generics> { + if !self.eat(Token::OpenBracket)? { + return Ok(Generics::default()); + } + let mut params = Generics::default(); + loop { + if self.eat(Token::Semi)? || self.check(Token::CloseBracket) { + break; + } + params.types.push(parse_t(self)?); + if self.eat(Token::Comma)? { + continue; + } + if self.eat(Token::Semi)? { + break; + } + if !self.check(Token::CloseBracket) { + self.unexpected()?; + } + } + loop { + if self.eat(Token::CloseBracket)? { + break; + } + params.impls.push(parse_i(self)?); + if self.eat(Token::Comma)? { + continue; + } + self.expect(Token::CloseBracket)?; + break; } + Ok(params) } fn parse_mod_item(&mut self) -> Parse<'core, ModItem<'core>> { @@ -267,7 +312,7 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_trait_item(&mut self) -> Parse<'core, TraitItem<'core>> { self.expect(Token::Trait)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; let items = self.parse_delimited(BRACE, Self::parse_item)?; Ok(TraitItem { name, generics, items }) } @@ -275,21 +320,13 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_impl_item(&mut self) -> Parse<'core, ImplItem<'core>> { self.expect(Token::Impl)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; self.expect(Token::Colon)?; - let trait_ = self.parse_trait()?; + let trait_ = self.parse_generic_path()?; let items = self.parse_delimited(BRACE, Self::parse_item)?; Ok(ImplItem { name, generics, trait_, items }) } - fn parse_trait(&mut self) -> Parse<'core, Trait<'core>> { - let span = self.start_span(); - let path = self.parse_path()?; - let args = self.parse_delimited(BRACKET_COMMA, Self::parse_type)?; - let span = self.end_span(span); - Ok(Trait { span, path, args }) - } - fn parse_use_item(&mut self) -> Parse<'core, UseItem<'core>> { self.expect(Token::Use)?; let absolute = self.eat(Token::ColonColon)?; @@ -342,7 +379,7 @@ impl<'core, 'src> VineParser<'core, 'src> { self.expect(Token::InlineIvy)?; self.expect(Token::Bang)?; let name = self.parse_ident()?; - let generics = self.parse_generics()?; + let generics = self.parse_generic_params()?; self.expect(Token::Colon)?; let ty = self.parse_type()?; if !self.check(Token::OpenBrace) { @@ -890,12 +927,9 @@ impl<'core, 'src> VineParser<'core, 'src> { fn parse_generic_path(&mut self) -> Parse<'core, GenericPath<'core>> { let span = self.start_span(); let path = self.parse_path()?; - let args = self - .check(Token::OpenBracket) - .then(|| self.parse_delimited(BRACKET_COMMA, Self::parse_type)) - .transpose()?; + let generics = self.check(Token::OpenBracket).then(|| self.parse_generic_args()).transpose()?; let span = self.end_span(span); - Ok(GenericPath { span, path, generics: args }) + Ok(GenericPath { span, path, generics }) } fn start_span(&self) -> usize { diff --git a/vine/src/visit.rs b/vine/src/visit.rs index 638cc034..df092939 100644 --- a/vine/src/visit.rs +++ b/vine/src/visit.rs @@ -304,7 +304,7 @@ pub trait VisitMut<'core, 'a> { fn _visit_generic_path(&mut self, path: &'a mut GenericPath<'core>) { if let Some(args) = &mut path.generics { - for t in args { + for t in &mut args.types { self.visit_type(t) } } From 7b571e561757ef949f7e6d4e4017589d2333104c Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Thu, 9 Jan 2025 10:23:57 -0500 Subject: [PATCH 03/13] build traits/impls into module graph --- vine/src/checker.rs | 6 +- vine/src/checker/check_expr.rs | 2 +- vine/src/checker/typeof_def.rs | 6 +- vine/src/diag.rs | 16 +++ vine/src/resolver.rs | 37 ++++++- vine/src/resolver/build_graph.rs | 162 ++++++++++++++++++++++++++---- vine/src/resolver/resolve_defs.rs | 12 +-- 7 files changed, 202 insertions(+), 39 deletions(-) diff --git a/vine/src/checker.rs b/vine/src/checker.rs index 1c259791..e9c111a5 100644 --- a/vine/src/checker.rs +++ b/vine/src/checker.rs @@ -110,7 +110,7 @@ impl<'core, 'r> Checker<'core, 'r> { let def = &mut self.resolver.defs[def_id]; if let Some(value_def) = &mut def.value_def { if let ValueDefKind::Expr(expr) = &mut value_def.kind { - self.generics.clone_from(&value_def.generics); + self.generics.clone_from(&value_def.type_params); let mut ty = value_def.ty.clone().unwrap(); let mut expr = take(expr); self.check_expr_form_type(&mut expr, Form::Value, &mut ty); @@ -283,7 +283,7 @@ impl<'core, 'r> Checker<'core, 'r> { let variant = self.resolver.defs[def_id].variant_def.as_ref().unwrap(); let params = variant.field_types.clone().unwrap(); let adt = - Type::Adt(variant.adt, (0..variant.generics.len()).map(Type::Opaque).collect()); + Type::Adt(variant.adt, (0..variant.type_params.len()).map(Type::Opaque).collect()); if params.is_empty() { adt } else { @@ -322,7 +322,7 @@ fn define_primitive_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) }); + Some(TypeDef { vis: DefId::ROOT, type_params: Vec::new(), alias: None, ty: Some(ty) }); } } diff --git a/vine/src/checker/check_expr.rs b/vine/src/checker/check_expr.rs index 72e45f28..16e4d12f 100644 --- a/vine/src/checker/check_expr.rs +++ b/vine/src/checker/check_expr.rs @@ -198,7 +198,7 @@ impl<'core> Checker<'core, '_> { fields.iter_mut().map(|x| self.check_expr(x)).collect::<(Vec<_>, Vec<_>)>(); let variant = self.resolver.defs[variant_id].variant_def.as_ref().unwrap(); let adt_id = variant.adt; - let generics = variant.generics.len(); + let generics = variant.type_params.len(); let form = if adt_id == variant_id { self.tuple_form(span, &forms) } else { Form::Value }; let generics = self.hydrate_generics(path, generics, true); let variant = self.resolver.defs[variant_id].variant_def.as_ref().unwrap(); diff --git a/vine/src/checker/typeof_def.rs b/vine/src/checker/typeof_def.rs index b9a13906..65aa5937 100644 --- a/vine/src/checker/typeof_def.rs +++ b/vine/src/checker/typeof_def.rs @@ -23,7 +23,7 @@ impl<'core> Checker<'core, '_> { vis: self.resolver.defs[value_def.vis].canonical.clone(), }); } - let generic_count = value_def.generics.len(); + let generic_count = value_def.type_params.len(); Self::check_generic_count(span, def, path, generic_count)?; let generics = self.hydrate_generics(path, generic_count, true); let def = &self.resolver.defs[def_id]; @@ -48,7 +48,7 @@ impl<'core> Checker<'core, '_> { vis: self.resolver.defs[type_def.vis].canonical.clone(), }); } - let generic_count = type_def.generics.len(); + let generic_count = type_def.type_params.len(); Self::check_generic_count(span, def, path, generic_count)?; if !inference && path.generics.is_none() && generic_count != 0 { Err(Diag::ItemTypeHole { span })? @@ -93,7 +93,7 @@ impl<'core> Checker<'core, '_> { if !refutable && adt_def.variants.len() > 1 { self.core.report(Diag::ExpectedIrrefutablePat { span }); } - let generic_count = adt_def.generics.len(); + let generic_count = adt_def.type_params.len(); Self::check_generic_count(span, variant, path, generic_count)?; if !inference && path.generics.is_none() && generic_count != 0 { Err(Diag::ItemTypeHole { span })? diff --git a/vine/src/diag.rs b/vine/src/diag.rs index dcaeed5c..d66c2f31 100644 --- a/vine/src/diag.rs +++ b/vine/src/diag.rs @@ -160,6 +160,22 @@ diags! { ["duplicate object key"] MissingImplementation ["missing implementation"] + UnexpectedImplParam { kind: &'static str } + ["{kind} items cannot have impl parameters"] + InvalidTraitItem + ["invalid trait item"] + InvalidImplItem + ["invalid impl item"] + TraitItemVis + ["trait items cannot have visibility"] + ImplItemVis + ["impl items cannot have visibility"] + TraitItemGen + ["trait items cannot have generics"] + ImplItemGen + ["impl items cannot have generics"] + ImplementedTraitItem + ["trait items cannot have implementations"] } fn plural<'a>(n: usize, plural: &'a str, singular: &'a str) -> &'a str { diff --git a/vine/src/resolver.rs b/vine/src/resolver.rs index fc554ecd..05d7e7a5 100644 --- a/vine/src/resolver.rs +++ b/vine/src/resolver.rs @@ -7,7 +7,7 @@ use vine_util::{ }; use crate::{ - ast::{Builtin, Expr, Ident, Local, Path, Span, Ty}, + ast::{Builtin, Expr, GenericPath, Ident, Local, Pat, Path, Span, Ty}, checker::Type, core::Core, }; @@ -51,6 +51,8 @@ pub struct Def<'core> { pub type_def: Option>, pub adt_def: Option>, pub variant_def: Option>, + pub trait_def: Option>, + pub impl_def: Option>, members: HashMap, Member<'core>>, parent: Option, @@ -73,7 +75,9 @@ enum MemberKind<'core> { #[derive(Debug)] pub struct ValueDef<'core> { pub vis: DefId, - pub generics: Vec>, + pub type_params: Vec>, + pub impl_params: Vec<(Ident<'core>, GenericPath<'core>)>, + pub impl_param_tys: Option>)>>, pub annotation: Option>, pub ty: Option>, pub locals: Counter, @@ -85,29 +89,52 @@ pub enum ValueDefKind<'core> { Expr(Expr<'core>), Ivy(Net), AdtConstructor, + TraitSubitem(DefId), } #[derive(Debug)] pub struct TypeDef<'core> { pub vis: DefId, - pub generics: Vec>, + pub type_params: Vec>, pub alias: Option>, pub ty: Option>, } #[derive(Debug)] pub struct AdtDef<'core> { - pub generics: Vec>, + pub type_params: Vec>, pub variants: Vec, } #[derive(Debug)] pub struct VariantDef<'core> { pub vis: DefId, - pub generics: Vec>, + pub type_params: Vec>, pub adt: DefId, pub variant: usize, pub fields: Vec>, pub object: bool, pub field_types: Option>>, } + +#[derive(Debug)] +pub struct TraitDef<'core> { + pub vis: DefId, + pub type_params: Vec>, + pub subitems: Vec<(Ident<'core>, TraitSubitem<'core>)>, +} + +#[derive(Debug)] +pub enum TraitSubitem<'core> { + Fn(Vec>, Option>, Option>), + Const(Ty<'core>, Option>), +} + +#[derive(Debug)] +pub struct ImplDef<'core> { + pub vis: DefId, + pub type_params: Vec>, + pub impl_params: Vec<(Ident<'core>, GenericPath<'core>)>, + pub impl_param_tys: Option>)>>, + pub subitems: Vec<(Ident<'core>, DefId)>, +} diff --git a/vine/src/resolver/build_graph.rs b/vine/src/resolver/build_graph.rs index 04a525f0..f6414cc3 100644 --- a/vine/src/resolver/build_graph.rs +++ b/vine/src/resolver/build_graph.rs @@ -4,11 +4,13 @@ use vine_util::idx::Counter; use crate::{ ast::{ - AttrKind, Block, Builtin, Expr, ExprKind, Ident, Item, ItemKind, ModKind, Path, Span, Stmt, - StmtKind, UseTree, Vis, + AttrKind, Block, Builtin, Expr, ExprKind, GenericParams, Ident, Item, ItemKind, ModKind, Path, + Span, Stmt, StmtKind, UseTree, Vis, }, + checker::Type, core::Core, diag::Diag, + resolver::{ImplDef, TraitDef, TraitSubitem}, visit::{VisitMut, Visitee}, }; @@ -35,7 +37,7 @@ impl<'core> Resolver<'core> { } } - fn build_item(&mut self, member_vis: DefId, item: Item<'core>, parent: DefId) { + fn build_item(&mut self, member_vis: DefId, item: Item<'core>, parent: DefId) -> Option { let span = item.span; let vis = self.resolve_vis(parent, item.vis); let member_vis = vis.max(member_vis); @@ -46,7 +48,9 @@ impl<'core> Resolver<'core> { f.name, ValueDef { vis, - generics: f.generics, + type_params: f.generics.types, + impl_params: f.generics.impls, + impl_param_tys: None, annotation: None, ty: None, locals: Counter::default(), @@ -79,7 +83,9 @@ impl<'core> Resolver<'core> { c.name, ValueDef { vis, - generics: c.generics, + type_params: c.generics.types, + impl_params: c.generics.impls, + impl_param_tys: None, annotation: Some(c.ty), ty: None, locals: Counter::default(), @@ -96,7 +102,9 @@ impl<'core> Resolver<'core> { i.name, ValueDef { vis, - generics: i.generics, + type_params: self.type_only_generics(i.generics, span, "inline ivy"), + impl_params: Vec::new(), + impl_param_tys: None, annotation: Some(i.ty), ty: None, locals: Counter::default(), @@ -122,6 +130,7 @@ impl<'core> Resolver<'core> { None } ItemKind::Struct(s) => { + let generics = self.type_only_generics(s.generics, span, "struct"); let child = self.get_or_insert_child(parent, s.name, member_vis); if child.type_def.is_some() || child.adt_def.is_some() @@ -129,13 +138,14 @@ impl<'core> Resolver<'core> { || child.value_def.is_some() { self.core.report(Diag::DuplicateItem { span, name: s.name }); - return; + return None; } - child.type_def = Some(TypeDef { vis, generics: s.generics.clone(), alias: None, ty: None }); - child.adt_def = Some(AdtDef { generics: s.generics.clone(), variants: vec![child.id] }); + child.type_def = + Some(TypeDef { vis, type_params: generics.clone(), alias: None, ty: None }); + child.adt_def = Some(AdtDef { type_params: generics.clone(), variants: vec![child.id] }); child.variant_def = Some(VariantDef { vis, - generics: s.generics.clone(), + type_params: generics.clone(), adt: child.id, variant: 0, fields: s.fields, @@ -144,7 +154,9 @@ impl<'core> Resolver<'core> { }); child.value_def = Some(ValueDef { vis, - generics: s.generics, + type_params: generics, + impl_params: Vec::new(), + impl_param_tys: None, annotation: None, ty: None, locals: Counter::default(), @@ -156,9 +168,10 @@ impl<'core> Resolver<'core> { let child = self.get_or_insert_child(parent, e.name, member_vis); if child.type_def.is_some() || child.adt_def.is_some() { self.core.report(Diag::DuplicateItem { span, name: e.name }); - return; + return None; } let adt = child.id; + let generics = self.type_only_generics(e.generics, span, "struct"); let variants = e .variants .into_iter() @@ -171,7 +184,7 @@ impl<'core> Resolver<'core> { } variant.variant_def = Some(VariantDef { vis, - generics: e.generics.clone(), + type_params: generics.clone(), adt, variant: i, fields: v.fields, @@ -180,7 +193,9 @@ impl<'core> Resolver<'core> { }); variant.value_def = Some(ValueDef { vis, - generics: e.generics.clone(), + type_params: generics.clone(), + impl_params: Vec::new(), + impl_param_tys: None, annotation: None, ty: None, locals: Counter::default(), @@ -190,22 +205,112 @@ impl<'core> Resolver<'core> { }) .collect(); self.defs[adt].type_def = - Some(TypeDef { vis, generics: e.generics.clone(), alias: None, ty: None }); - self.defs[adt].adt_def = Some(AdtDef { generics: e.generics, variants }); + Some(TypeDef { vis, type_params: generics.clone(), alias: None, ty: None }); + self.defs[adt].adt_def = Some(AdtDef { type_params: generics, variants }); Some(adt) } ItemKind::Type(t) => { + let type_params = self.type_only_generics(t.generics, span, "type"); let child = self.get_or_insert_child(parent, t.name, member_vis); if child.type_def.is_some() || child.adt_def.is_some() { self.core.report(Diag::DuplicateItem { span, name: t.name }); - return; + return None; } - child.type_def = - Some(TypeDef { vis, generics: t.generics.clone(), alias: Some(t.ty), ty: None }); + child.type_def = Some(TypeDef { vis, type_params, alias: Some(t.ty), ty: None }); Some(child.id) } - ItemKind::Trait(_) => todo!(), - ItemKind::Impl(_) => todo!(), + ItemKind::Trait(t) => { + let generics = self.type_only_generics(t.generics, span, "trait"); + let def = self.get_or_insert_child(parent, t.name, member_vis).id; + let mut subitems = Vec::new(); + for item in t.items { + let (name, subitem) = match item.kind { + ItemKind::Fn(f) => { + if f.body.is_some() { + self.core.report(Diag::ImplementedTraitItem { span: item.span }); + } + if !f.generics.impls.is_empty() || !f.generics.types.is_empty() { + self.core.report(Diag::TraitItemGen { span: item.span }); + } + (f.name, TraitSubitem::Fn(f.params, f.ret, None)) + } + ItemKind::Const(c) => { + if c.value.is_some() { + self.core.report(Diag::ImplementedTraitItem { span: item.span }); + } + if !c.generics.impls.is_empty() || !c.generics.types.is_empty() { + self.core.report(Diag::TraitItemGen { span: item.span }); + } + (c.name, TraitSubitem::Const(c.ty, None)) + } + _ => { + self.core.report(Diag::InvalidTraitItem { span: item.span }); + continue; + } + }; + subitems.push((name, subitem)); + let child = self.get_or_insert_child(def, name, vis); + if child.value_def.is_some() { + self.core.report(Diag::DuplicateItem { span: item.span, name }); + continue; + } + child.value_def = Some(ValueDef { + vis, + type_params: generics.clone(), + impl_params: Vec::new(), + impl_param_tys: Some(vec![( + def, + (0..generics.len()).map(|i| Type::Opaque(i)).collect(), + )]), + annotation: None, + ty: None, + locals: Counter::default(), + kind: ValueDefKind::TraitSubitem(def), + }); + } + let def = &mut self.defs[def]; + if def.trait_def.is_some() { + self.core.report(Diag::DuplicateItem { span, name: t.name }); + } + def.trait_def = Some(TraitDef { vis, type_params: generics, subitems }); + Some(def.id) + } + ItemKind::Impl(i) => { + let def = self.get_or_insert_child(parent, i.name, member_vis).id; + let mut subitems = Vec::new(); + for mut item in i.items { + if !matches!(item.vis, Vis::Private) { + self.core.report(Diag::ImplItemVis { span: item.span }); + } + item.vis = Vis::Public; + let (name, generics) = match &mut item.kind { + ItemKind::Fn(f) => (f.name, &mut f.generics), + ItemKind::Const(c) => (c.name, &mut c.generics), + _ => { + self.core.report(Diag::InvalidImplItem { span: item.span }); + continue; + } + }; + if !generics.types.is_empty() || !generics.impls.is_empty() { + self.core.report(Diag::ImplItemGen { span: item.span }); + } + *generics = i.generics.clone(); + let child = self.build_item(vis, item, def).unwrap(); + subitems.push((name, child)); + } + let def = &mut self.defs[def]; + if def.impl_def.is_some() { + self.core.report(Diag::DuplicateItem { span, name: i.name }); + } + def.impl_def = Some(ImplDef { + vis, + type_params: i.generics.types, + impl_params: i.generics.impls, + impl_param_tys: None, + subitems, + }); + Some(def.id) + } ItemKind::Taken => None, }; for attr in item.attrs { @@ -222,6 +327,7 @@ impl<'core> Resolver<'core> { } } } + def_id } fn resolve_vis(&mut self, base: DefId, vis: Vis) -> DefId { @@ -242,6 +348,18 @@ impl<'core> Resolver<'core> { } } + fn type_only_generics( + &self, + generics: GenericParams<'core>, + span: Span, + kind: &'static str, + ) -> Vec> { + if !generics.impls.is_empty() { + self.core.report(Diag::UnexpectedImplParam { span, kind }); + } + generics.types + } + fn define_value( &mut self, span: Span, @@ -337,6 +455,8 @@ impl<'core> Resolver<'core> { type_def: None, adt_def: None, variant_def: None, + trait_def: None, + impl_def: None, }; if let Some(parent) = parent { def.ancestors = self.defs[parent].ancestors.iter().copied().chain([parent]).collect(); diff --git a/vine/src/resolver/resolve_defs.rs b/vine/src/resolver/resolve_defs.rs index 32d06cd9..e4f1ddbd 100644 --- a/vine/src/resolver/resolve_defs.rs +++ b/vine/src/resolver/resolve_defs.rs @@ -42,14 +42,14 @@ impl<'core> Resolver<'core> { let def = &mut visitor.resolver.defs[def_id]; let mut value_def = def.value_def.take(); if let Some(value_def) = &mut value_def { - visitor.generics = take(&mut value_def.generics); + visitor.generics = take(&mut value_def.type_params); if let Some(ty) = &mut value_def.annotation { visitor.visit_type(ty); } if let ValueDefKind::Expr(expr) = &mut value_def.kind { visitor.visit_expr(expr); } - value_def.generics = take(&mut visitor.generics); + value_def.type_params = take(&mut visitor.generics); value_def.locals = visitor.locals; } @@ -59,9 +59,9 @@ impl<'core> Resolver<'core> { let mut type_def = def.type_def.take(); if let Some(type_def) = &mut type_def { if let Some(alias) = &mut type_def.alias { - visitor.generics = take(&mut type_def.generics); + visitor.generics = take(&mut type_def.type_params); visitor.visit_type(alias); - type_def.generics = take(&mut visitor.generics); + type_def.type_params = take(&mut visitor.generics); } } @@ -70,9 +70,9 @@ impl<'core> Resolver<'core> { let mut variant_def = def.variant_def.take(); if let Some(variant_def) = &mut variant_def { - visitor.generics = take(&mut variant_def.generics); + visitor.generics = take(&mut variant_def.type_params); visitor.visit(&mut variant_def.fields); - variant_def.generics = take(&mut visitor.generics); + variant_def.type_params = take(&mut visitor.generics); } let def = &mut visitor.resolver.defs[def_id]; From 5ae5ab3bf3e6a5ba56b6082e0a49f4c7ecc1206e Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Thu, 9 Jan 2025 12:13:19 -0500 Subject: [PATCH 04/13] make impl ast node --- vine/src/ast.rs | 17 +++++++++++++++-- vine/src/fmt.rs | 18 +++++++++++------- vine/src/parser.rs | 22 ++++++++++++++++------ 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/vine/src/ast.rs b/vine/src/ast.rs index 63d825a7..ed09c440 100644 --- a/vine/src/ast.rs +++ b/vine/src/ast.rs @@ -171,7 +171,7 @@ pub enum Builtin { } pub type GenericParams<'core> = Generics, (Ident<'core>, GenericPath<'core>)>; -pub type GenericArgs<'core> = Generics, Option>>; +pub type GenericArgs<'core> = Generics, Impl<'core>>; #[derive(Debug, Clone)] pub struct Generics { @@ -418,6 +418,19 @@ pub enum TyKind<'core> { Error(ErrorGuaranteed), } +#[derive(Clone)] +pub struct Impl<'core> { + pub span: Span, + pub kind: ImplKind<'core>, +} + +#[derive(Debug, Clone)] +pub enum ImplKind<'core> { + Hole, + Param(usize), + Path(GenericPath<'core>), +} + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum BinaryOp { BitOr, @@ -576,7 +589,7 @@ macro_rules! debug_kind { )*}; } -debug_kind!(Item<'_>, Attr, Stmt<'_>, Expr<'_>, Pat<'_>, Ty<'_>); +debug_kind!(Item<'_>, Attr, Stmt<'_>, Expr<'_>, Pat<'_>, Ty<'_>, Impl<'_>); impl From for ExprKind<'_> { fn from(value: ErrorGuaranteed) -> Self { diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index 5af5028b..9e250bcb 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -5,8 +5,8 @@ use doc::{Doc, Writer}; use crate::{ ast::{ Block, ComparisonOp, Expr, ExprKind, GenericArgs, GenericParams, GenericPath, Generics, Ident, - Item, ItemKind, Label, LogicalOp, ModKind, Pat, PatKind, Path, Span, Stmt, StmtKind, Ty, - TyKind, UseTree, Vis, + Impl, ImplKind, Item, ItemKind, Label, LogicalOp, ModKind, Pat, PatKind, Path, Span, Stmt, + StmtKind, Ty, TyKind, UseTree, Vis, }, core::Core, diag::Diag, @@ -302,11 +302,15 @@ impl<'core: 'src, 'src> Formatter<'src> { } fn fmt_generic_args(&self, generics: &GenericArgs<'core>) -> Doc<'src> { - self.fmt_generics( - generics, - |t| self.fmt_ty(t), - |p| p.as_ref().map(|p| self.fmt_generic_path(p)).unwrap_or(Doc("_")), - ) + self.fmt_generics(generics, |t| self.fmt_ty(t), |p| self.fmt_impl(p)) + } + + fn fmt_impl(&self, impl_: &Impl<'core>) -> Doc<'src> { + match &impl_.kind { + ImplKind::Hole => Doc("_"), + ImplKind::Param(_) => unreachable!(), + ImplKind::Path(path) => self.fmt_generic_path(path), + } } fn fmt_generics( diff --git a/vine/src/parser.rs b/vine/src/parser.rs index d8329c85..92bba04d 100644 --- a/vine/src/parser.rs +++ b/vine/src/parser.rs @@ -7,9 +7,10 @@ use crate::{core::Core, diag::Diag, lexer::Token}; use crate::ast::{ Attr, AttrKind, BinaryOp, Block, Builtin, ComparisonOp, ConstItem, DynFnStmt, Enum, Expr, - ExprKind, FnItem, GenericArgs, GenericParams, GenericPath, Generics, Ident, ImplItem, InlineIvy, - Item, ItemKind, Key, Label, LetStmt, LogicalOp, ModItem, ModKind, Pat, PatKind, Path, Span, Stmt, - StmtKind, StructItem, TraitItem, Ty, TyKind, TypeItem, UseItem, UseTree, Variant, Vis, + ExprKind, FnItem, GenericArgs, GenericParams, GenericPath, Generics, Ident, Impl, ImplItem, + ImplKind, InlineIvy, Item, ItemKind, Key, Label, LetStmt, LogicalOp, ModItem, ModKind, Pat, + PatKind, Path, Span, Stmt, StmtKind, StructItem, TraitItem, Ty, TyKind, TypeItem, UseItem, + UseTree, Variant, Vis, }; pub struct VineParser<'core, 'src> { @@ -249,9 +250,7 @@ impl<'core, 'src> VineParser<'core, 'src> { } fn parse_generic_args(&mut self) -> Parse<'core, GenericArgs<'core>> { - self.parse_generics(Self::parse_type, |self_| { - (!self_.eat(Token::Hole)?).then(|| self_.parse_generic_path()).transpose() - }) + self.parse_generics(Self::parse_type, Self::parse_impl) } fn parse_generics( @@ -871,6 +870,17 @@ impl<'core, 'src> VineParser<'core, 'src> { self.unexpected() } + fn parse_impl(&mut self) -> Parse<'core, Impl<'core>> { + let span = self.start_span(); + let kind = if self.eat(Token::Hole)? { + ImplKind::Hole + } else { + ImplKind::Path(self.parse_generic_path()?) + }; + let span = self.end_span(span); + Ok(Impl { span, kind }) + } + pub(crate) fn parse_stmt(&mut self) -> Parse<'core, Stmt<'core>> { let span = self.start_span(); let kind = if self.check(Token::Let) { From 33729c59415a744d638359e41fd7d137f44ce29a Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Thu, 9 Jan 2025 12:56:41 -0500 Subject: [PATCH 05/13] resolve impls --- vine/src/ast.rs | 3 +- vine/src/checker.rs | 2 +- vine/src/fmt.rs | 4 +- vine/src/resolver/resolve_defs.rs | 92 +++++++++++++++++++++++++------ vine/src/visit.rs | 26 ++++++++- 5 files changed, 104 insertions(+), 23 deletions(-) diff --git a/vine/src/ast.rs b/vine/src/ast.rs index ed09c440..186f4281 100644 --- a/vine/src/ast.rs +++ b/vine/src/ast.rs @@ -414,7 +414,7 @@ pub enum TyKind<'core> { Ref(B>), Inverse(B>), Path(GenericPath<'core>), - Generic(usize), + Param(usize), Error(ErrorGuaranteed), } @@ -429,6 +429,7 @@ pub enum ImplKind<'core> { Hole, Param(usize), Path(GenericPath<'core>), + Error(ErrorGuaranteed), } #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/vine/src/checker.rs b/vine/src/checker.rs index e9c111a5..9589ebb4 100644 --- a/vine/src/checker.rs +++ b/vine/src/checker.rs @@ -209,7 +209,7 @@ impl<'core, 'r> Checker<'core, 'r> { TyKind::Path(path) => { report!(self.core, ty.kind; self.typeof_type_def(path, inference)) } - TyKind::Generic(n) => Type::Opaque(*n), + TyKind::Param(n) => Type::Opaque(*n), TyKind::Error(e) => Type::Error(*e), } } diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index 9e250bcb..1f586915 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -308,8 +308,8 @@ impl<'core: 'src, 'src> Formatter<'src> { fn fmt_impl(&self, impl_: &Impl<'core>) -> Doc<'src> { match &impl_.kind { ImplKind::Hole => Doc("_"), - ImplKind::Param(_) => unreachable!(), ImplKind::Path(path) => self.fmt_generic_path(path), + ImplKind::Error(_) | ImplKind::Param(_) => unreachable!(), } } @@ -532,7 +532,7 @@ impl<'core: 'src, 'src> Formatter<'src> { 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!(), + TyKind::Param(_) | TyKind::Error(_) => unreachable!(), } } diff --git a/vine/src/resolver/resolve_defs.rs b/vine/src/resolver/resolve_defs.rs index e4f1ddbd..445ab4c0 100644 --- a/vine/src/resolver/resolve_defs.rs +++ b/vine/src/resolver/resolve_defs.rs @@ -8,14 +8,14 @@ use vine_util::idx::{Counter, RangeExt}; use crate::{ ast::{ - DynFnId, Expr, ExprKind, GenericPath, Ident, Label, LabelId, Local, LogicalOp, Pat, PatKind, - Stmt, StmtKind, Ty, TyKind, + DynFnId, Expr, ExprKind, GenericPath, Ident, Impl, ImplKind, Label, LabelId, Local, LogicalOp, + Pat, PatKind, Stmt, StmtKind, Ty, TyKind, }, diag::Diag, visit::{VisitMut, Visitee}, }; -use super::{DefId, Resolver, ValueDefKind}; +use super::{DefId, Resolver, TraitSubitem, ValueDefKind}; impl<'core> Resolver<'core> { pub fn resolve_defs(&mut self) { @@ -26,7 +26,8 @@ impl<'core> Resolver<'core> { let mut visitor = ResolveVisitor { resolver: self, def: DefId::ROOT, - generics: Vec::new(), + type_params: Vec::new(), + impl_params: Vec::new(), scope: HashMap::new(), scope_depth: 0, locals: Counter::default(), @@ -42,15 +43,20 @@ impl<'core> Resolver<'core> { let def = &mut visitor.resolver.defs[def_id]; let mut value_def = def.value_def.take(); if let Some(value_def) = &mut value_def { - visitor.generics = take(&mut value_def.type_params); + visitor.type_params = take(&mut value_def.type_params); + visitor.visit_impl_params(&mut value_def.impl_params); + visitor.impl_params = take(&mut value_def.impl_params); if let Some(ty) = &mut value_def.annotation { visitor.visit_type(ty); } if let ValueDefKind::Expr(expr) = &mut value_def.kind { visitor.visit_expr(expr); } - value_def.type_params = take(&mut visitor.generics); + value_def.type_params = take(&mut visitor.type_params); + value_def.impl_params = take(&mut visitor.impl_params); value_def.locals = visitor.locals; + visitor.scope.clear(); + visitor.locals = Counter::default(); } let def = &mut visitor.resolver.defs[def_id]; @@ -59,9 +65,9 @@ impl<'core> Resolver<'core> { let mut type_def = def.type_def.take(); if let Some(type_def) = &mut type_def { if let Some(alias) = &mut type_def.alias { - visitor.generics = take(&mut type_def.type_params); + visitor.type_params = take(&mut type_def.type_params); visitor.visit_type(alias); - type_def.type_params = take(&mut visitor.generics); + type_def.type_params = take(&mut visitor.type_params); } } @@ -70,16 +76,43 @@ impl<'core> Resolver<'core> { let mut variant_def = def.variant_def.take(); if let Some(variant_def) = &mut variant_def { - visitor.generics = take(&mut variant_def.type_params); + visitor.type_params = take(&mut variant_def.type_params); visitor.visit(&mut variant_def.fields); - variant_def.type_params = take(&mut visitor.generics); + variant_def.type_params = take(&mut visitor.type_params); } let def = &mut visitor.resolver.defs[def_id]; def.variant_def = variant_def; - visitor.scope.clear(); - visitor.locals = Counter::default(); + let mut trait_def = def.trait_def.take(); + if let Some(trait_def) = &mut trait_def { + visitor.type_params = take(&mut trait_def.type_params); + for (_, subitem) in &mut trait_def.subitems { + match subitem { + TraitSubitem::Fn(pats, ty, _) => { + visitor.visit(pats); + visitor.visit(ty); + } + TraitSubitem::Const(ty, _) => visitor.visit_type(ty), + } + } + trait_def.type_params = take(&mut visitor.type_params); + visitor.scope.clear(); + visitor.locals = Counter::default(); + } + + let def = &mut visitor.resolver.defs[def_id]; + def.trait_def = trait_def; + + let mut impl_def = def.impl_def.take(); + if let Some(impl_def) = &mut impl_def { + visitor.type_params = take(&mut impl_def.type_params); + visitor.visit_impl_params(&mut impl_def.impl_params); + impl_def.type_params = take(&mut visitor.type_params); + } + + let def = &mut visitor.resolver.defs[def_id]; + def.impl_def = impl_def; } } @@ -93,7 +126,8 @@ impl<'core> Resolver<'core> { let mut visitor = ResolveVisitor { resolver: self, def, - generics: Vec::new(), + type_params: Vec::new(), + impl_params: Vec::new(), scope: initial .iter() .map(|(&l, &i)| (i, vec![ScopeEntry { depth: 0, binding: Binding::Local(l) }])) @@ -126,7 +160,8 @@ impl<'core> Resolver<'core> { struct ResolveVisitor<'core, 'a> { resolver: &'a mut Resolver<'core>, def: DefId, - generics: Vec>, + type_params: Vec>, + impl_params: Vec<(Ident<'core>, GenericPath<'core>)>, scope: HashMap, Vec>, scope_depth: usize, locals: Counter, @@ -316,8 +351,8 @@ impl<'core> VisitMut<'core, '_> for ResolveVisitor<'core, '_> { if let TyKind::Path(path) = &mut ty.kind { if path.generics.is_none() { if let Some(ident) = path.path.as_ident() { - if let Some((i, _)) = self.generics.iter().enumerate().find(|(_, &g)| g == ident) { - ty.kind = TyKind::Generic(i); + if let Some((i, _)) = self.type_params.iter().enumerate().find(|(_, &g)| g == ident) { + ty.kind = TyKind::Param(i); return; } } @@ -328,6 +363,22 @@ impl<'core> VisitMut<'core, '_> for ResolveVisitor<'core, '_> { } self._visit_type(ty); } + + fn _visit_impl(&mut self, impl_: &mut Impl<'core>) { + if let ImplKind::Path(path) = &mut impl_.kind { + if path.generics.is_none() { + if let Some(ident) = path.path.as_ident() { + if let Some((i, _)) = self.type_params.iter().enumerate().find(|(_, &g)| g == ident) { + impl_.kind = ImplKind::Param(i); + return; + } + } + } + if let Err(diag) = self.visit_path(path) { + impl_.kind = ImplKind::Error(self.resolver.core.report(diag)); + } + } + } } impl<'core> ResolveVisitor<'core, '_> { @@ -382,6 +433,15 @@ impl<'core> ResolveVisitor<'core, '_> { } } + fn visit_impl_params(&mut self, impl_params: &mut [(Ident<'core>, GenericPath<'core>)]) { + for (_, path) in impl_params { + if let Err(diag) = self.visit_path(path) { + self.resolver.core.report(diag); + } + self.visit_generic_path(path); + } + } + fn bind_label(&mut self, label: &mut Label<'core>, cont: bool, f: impl FnOnce(&mut Self)) { let id = self.label_id.next(); if cont { diff --git a/vine/src/visit.rs b/vine/src/visit.rs index df092939..cdffd793 100644 --- a/vine/src/visit.rs +++ b/vine/src/visit.rs @@ -1,7 +1,7 @@ use crate::{ ast::{ - Block, Expr, ExprKind, GenericPath, Item, ItemKind, ModKind, Pat, PatKind, Stmt, StmtKind, Ty, - TyKind, + Block, Expr, ExprKind, GenericPath, Impl, ImplKind, Item, ItemKind, ModKind, Pat, PatKind, + Stmt, StmtKind, Ty, TyKind, }, resolver::{Def, ValueDefKind}, }; @@ -34,6 +34,10 @@ pub trait VisitMut<'core, 'a> { self._visit_type(ty); } + fn visit_impl(&mut self, ty: &'a mut Impl<'core>) { + self._visit_impl(ty); + } + fn visit_stmt(&mut self, stmt: &'a mut Stmt<'core>) { self._visit_stmt(stmt) } @@ -197,7 +201,7 @@ pub trait VisitMut<'core, 'a> { fn _visit_type(&mut self, ty: &'a mut Ty<'core>) { match &mut ty.kind { - TyKind::Hole | TyKind::Generic(_) => {} + TyKind::Hole | TyKind::Param(_) => {} TyKind::Paren(t) | TyKind::Ref(t) | TyKind::Inverse(t) => self.visit_type(t), TyKind::Path(p) => self.visit_generic_path(p), TyKind::Tuple(a) => { @@ -222,6 +226,13 @@ pub trait VisitMut<'core, 'a> { } } + fn _visit_impl(&mut self, impl_: &'a mut Impl<'core>) { + match &mut impl_.kind { + ImplKind::Hole | ImplKind::Param(_) | ImplKind::Error(_) => {} + ImplKind::Path(p) => self.visit_generic_path(p), + } + } + fn _visit_stmt(&mut self, stmt: &'a mut Stmt<'core>) { match &mut stmt.kind { StmtKind::Let(l) => { @@ -307,6 +318,9 @@ pub trait VisitMut<'core, 'a> { for t in &mut args.types { self.visit_type(t) } + for i in &mut args.impls { + self.visit_impl(i) + } } } @@ -343,6 +357,12 @@ impl<'core: 't, 't> Visitee<'core, 't> for &'t mut Ty<'core> { } } +impl<'core: 't, 't> Visitee<'core, 't> for &'t mut Impl<'core> { + fn visit(self, visitor: &mut (impl VisitMut<'core, 't> + ?Sized)) { + visitor.visit_impl(self) + } +} + impl<'core: 't, 't> Visitee<'core, 't> for &'t mut Stmt<'core> { fn visit(self, visitor: &mut (impl VisitMut<'core, 't> + ?Sized)) { visitor.visit_stmt(self) From 32c0dd0b0c1e4acd2a63d9703d21ef84ab75149e Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Thu, 9 Jan 2025 15:44:29 -0500 Subject: [PATCH 06/13] check impls & impl params --- vine/src/checker.rs | 119 +++++++++++++++++++++++++-- vine/src/checker/typeof_def.rs | 129 +++++++++++++++++++++++++++--- vine/src/diag.rs | 14 +++- vine/src/emitter.rs | 1 + vine/src/fmt.rs | 2 +- vine/src/resolver.rs | 17 ++-- vine/src/resolver/build_graph.rs | 20 +++-- vine/src/resolver/resolve_defs.rs | 9 ++- 8 files changed, 275 insertions(+), 36 deletions(-) diff --git a/vine/src/checker.rs b/vine/src/checker.rs index 9589ebb4..bb7876c8 100644 --- a/vine/src/checker.rs +++ b/vine/src/checker.rs @@ -17,7 +17,7 @@ use crate::{ }, core::Core, diag::{report, Diag, ErrorGuaranteed}, - resolver::{DefId, Resolver, TypeDef, ValueDefKind}, + resolver::{DefId, Resolver, TraitSubitem, TypeDef, ValueDefKind}, }; mod check_expr; @@ -34,6 +34,7 @@ pub struct Checker<'core, 'r> { generics: Vec>, return_ty: Option>, labels: IdxVec>>, + impl_params: Vec>, cur_def: DefId, bool: Option, @@ -73,6 +74,7 @@ impl<'core, 'r> Checker<'core, 'r> { resolver, state: CheckerState::default(), generics: Vec::new(), + impl_params: Vec::new(), return_ty: None, labels: Default::default(), cur_def: DefId::ROOT, @@ -95,9 +97,15 @@ impl<'core, 'r> Checker<'core, 'r> { for def in range.iter() { self.resolve_type_alias(def); } + for def in range.iter() { + self.resolve_trait_types(def); + } for def in range.iter() { self.resolve_def_types(def); } + for def in range.iter() { + self.check_impl_def(def); + } debug_assert!(self.state.vars.is_empty()); for def in range.iter() { self.check_value_def(def); @@ -110,6 +118,7 @@ impl<'core, 'r> Checker<'core, 'r> { let def = &mut self.resolver.defs[def_id]; if let Some(value_def) = &mut def.value_def { if let ValueDefKind::Expr(expr) = &mut value_def.kind { + self.impl_params.clone_from(value_def.impl_param_tys.as_ref().unwrap()); self.generics.clone_from(&value_def.type_params); let mut ty = value_def.ty.clone().unwrap(); let mut expr = take(expr); @@ -242,10 +251,15 @@ impl<'core, 'r> Checker<'core, 'r> { inference: bool, ) -> Vec> { if let Some(generics) = &mut path.generics { - generics.iter_mut().map(|t| self.hydrate_type(t, inference)).collect::>() - } else { - iter::from_fn(|| Some(self.new_var(path.span))).take(generic_count).collect() + if !generics.types.is_empty() { + return generics + .types + .iter_mut() + .map(|t| self.hydrate_type(t, inference)) + .collect::>(); + } } + iter::from_fn(|| Some(self.new_var(path.span))).take(generic_count).collect() } fn resolve_type_alias(&mut self, def_id: DefId) { @@ -259,6 +273,24 @@ impl<'core, 'r> Checker<'core, 'r> { self.cur_def = old; } + fn resolve_trait_types(&mut self, def_id: DefId) { + self.cur_def = def_id; + if let Some(mut trait_def) = self.resolver.defs[def_id].trait_def.take() { + for (_, sub_id, subitem, ty_out) in trait_def.subitems.iter_mut() { + let ty = match subitem { + TraitSubitem::Fn(pats, ret) => Type::Fn( + pats.iter_mut().map(|pat| self.hydrate_param(pat)).collect(), + Box::new(ret.as_mut().map(|r| self.hydrate_type(r, false)).unwrap_or(Type::UNIT)), + ), + TraitSubitem::Const(ty) => self.hydrate_type(ty, false), + }; + *ty_out = Some(ty.clone()); + self.resolver.defs[*sub_id].value_def.as_mut().unwrap().ty = Some(ty); + } + self.resolver.defs[def_id].trait_def = Some(trait_def); + } + } + fn resolve_def_types(&mut self, def_id: DefId) { self.cur_def = def_id; if let Some(mut variant) = self.resolver.defs[def_id].variant_def.take() { @@ -267,7 +299,29 @@ impl<'core, 'r> Checker<'core, 'r> { self.resolver.defs[def_id].variant_def = Some(variant); } if let Some(mut value) = self.resolver.defs[def_id].value_def.take() { - let ty = if let Some(ty) = &mut value.annotation { + if value.impl_param_tys.is_none() { + value.impl_param_tys = Some( + value + .impl_params + .iter_mut() + .map(|(_, trait_)| { + trait_ + .path + .resolved + .map(|trait_id| { + let trait_def = self.resolver.defs[trait_id].trait_def.take().unwrap(); + let trait_args = self.hydrate_generics(trait_, trait_def.generics, false); + self.resolver.defs[trait_id].trait_def = Some(trait_def); + Type::Adt(trait_id, trait_args) + }) + .unwrap_or(Type::Error(ErrorGuaranteed::new_unchecked())) + }) + .collect(), + ); + } + let ty = if let Some(ty) = value.ty.take() { + ty + } else if let Some(ty) = &mut value.annotation { self.hydrate_type(ty, false) } else { match &mut value.kind { @@ -290,11 +344,66 @@ impl<'core, 'r> Checker<'core, 'r> { Type::Fn(params, Box::new(adt)) } } + ValueDefKind::TraitSubitem(..) => unreachable!(), } }; value.ty = Some(ty); self.resolver.defs[def_id].value_def = Some(value); } + if let Some(mut impl_def) = self.resolver.defs[def_id].impl_def.take() { + impl_def.impl_param_tys = Some( + impl_def + .impl_params + .iter_mut() + .map(|(_, trait_)| { + trait_ + .path + .resolved + .map(|trait_id| { + let trait_def = self.resolver.defs[trait_id].trait_def.take().unwrap(); + let trait_args = self.hydrate_generics(trait_, trait_def.generics, false); + self.resolver.defs[trait_id].trait_def = Some(trait_def); + Type::Adt(trait_id, trait_args) + }) + .unwrap_or(Type::Error(ErrorGuaranteed::new_unchecked())) + }) + .collect(), + ); + if let Some(trait_id) = impl_def.trait_.path.resolved { + let trait_def = self.resolver.defs[trait_id].trait_def.take().unwrap(); + let trait_args = self.hydrate_generics(&mut impl_def.trait_, trait_def.generics, false); + impl_def.trait_ty = Some((trait_id, trait_args)); + self.resolver.defs[trait_id].trait_def = Some(trait_def); + } + self.resolver.defs[def_id].impl_def = Some(impl_def); + } + } + + fn check_impl_def(&mut self, def_id: DefId) { + if let Some(impl_def) = self.resolver.defs[def_id].impl_def.take() { + if let Some((trait_id, trait_args)) = &impl_def.trait_ty { + let trait_def = self.resolver.defs[*trait_id].trait_def.take().unwrap(); + for &(span, name, sub_id) in &impl_def.subitems { + if let Some(subitem) = trait_def.subitems.iter().find(|x| x.0 == name) { + let mut value_def = self.resolver.defs[sub_id].value_def.take().unwrap(); + let ty = value_def.ty.as_mut().unwrap(); + let mut expected = subitem.3.as_ref().unwrap().instantiate(trait_args); + if !self.unify(ty, &mut expected) { + self.core.report(Diag::ExpectedTypeFound { + span, + expected: self.display_type(&expected), + found: self.display_type(ty), + }); + } + self.resolver.defs[sub_id].value_def = Some(value_def); + } else { + self.core.report(Diag::ExtraneousImplItem { span, name }); + } + } + self.resolver.defs[*trait_id].trait_def = Some(trait_def); + } + self.resolver.defs[def_id].impl_def = Some(impl_def); + } } fn build_object_type( diff --git a/vine/src/checker/typeof_def.rs b/vine/src/checker/typeof_def.rs index 65aa5937..63099af9 100644 --- a/vine/src/checker/typeof_def.rs +++ b/vine/src/checker/typeof_def.rs @@ -1,10 +1,12 @@ use crate::{ - ast::{GenericPath, Span}, + ast::{GenericPath, Impl, ImplKind, Span}, checker::{Checker, Type}, - diag::Diag, + diag::{Diag, ErrorGuaranteed}, resolver::Def, }; +use super::report; + impl<'core> Checker<'core, '_> { pub(super) fn typeof_value_def( &mut self, @@ -24,10 +26,110 @@ impl<'core> Checker<'core, '_> { }); } let generic_count = value_def.type_params.len(); - Self::check_generic_count(span, def, path, generic_count)?; - let generics = self.hydrate_generics(path, generic_count, true); + Self::check_type_param_count(span, def, path, generic_count)?; + let type_params = self.hydrate_generics(path, generic_count, true); + let def = &self.resolver.defs[def_id]; + let value_def = def.value_def.as_ref().unwrap(); + let impl_params = path.generics.as_mut().map(|x| &mut x.impls[..]).unwrap_or(&mut []); + let impl_param_tys = value_def + .impl_param_tys + .as_ref() + .unwrap() + .iter() + .map(|t| t.instantiate(&type_params)) + .collect::>(); + if impl_params.len() != impl_param_tys.len() { + return Err(Diag::BadGenericCount { + span, + path: def.canonical.clone(), + expected: impl_param_tys.len(), + got: impl_params.len(), + kind: "impl", + }); + } + for (impl_, mut expected) in impl_params.iter_mut().zip(impl_param_tys) { + let mut ty = self.check_impl(impl_); + if !self.unify(&mut ty, &mut expected) { + self.core.report(Diag::ExpectedTypeFound { + span: impl_.span, + expected: self.display_type(&expected), + found: self.display_type(&ty), + }); + } + } + let def = &self.resolver.defs[def_id]; + let value_def = def.value_def.as_ref().unwrap(); + Ok(value_def.ty.as_ref().unwrap().instantiate(&type_params)) + } + + pub(super) fn typeof_impl_def( + &mut self, + path: &mut GenericPath<'core>, + ) -> Result, Diag<'core>> { + let span = path.span; + let def_id = path.path.resolved.unwrap(); + let def = &self.resolver.defs[def_id]; + let Some(impl_def) = &def.impl_def else { + return Err(Diag::PathNoImpl { span, path: def.canonical.clone() }); + }; + if !self.resolver.visible(impl_def.vis, self.cur_def) { + return Err(Diag::ImplInvisible { + span, + path: def.canonical.clone(), + vis: self.resolver.defs[impl_def.vis].canonical.clone(), + }); + } + let generic_count = impl_def.type_params.len(); + Self::check_type_param_count(span, def, path, generic_count)?; + let type_params = self.hydrate_generics(path, generic_count, true); let def = &self.resolver.defs[def_id]; - Ok(def.value_def.as_ref().unwrap().ty.as_ref().unwrap().instantiate(&generics)) + let impl_def = def.impl_def.as_ref().unwrap(); + let impl_params = path.generics.as_mut().map(|x| &mut x.impls[..]).unwrap_or(&mut []); + let impl_param_tys = impl_def + .impl_param_tys + .as_ref() + .unwrap() + .iter() + .map(|t| t.instantiate(&type_params)) + .collect::>(); + if impl_params.len() != impl_param_tys.len() { + return Err(Diag::BadGenericCount { + span, + path: def.canonical.clone(), + expected: impl_param_tys.len(), + got: impl_params.len(), + kind: "impl", + }); + } + for (impl_, mut expected) in impl_params.iter_mut().zip(impl_param_tys) { + let mut ty = self.check_impl(impl_); + if !self.unify(&mut ty, &mut expected) { + self.core.report(Diag::ExpectedTypeFound { + span: impl_.span, + expected: self.display_type(&expected), + found: self.display_type(&ty), + }); + } + } + let def = &self.resolver.defs[def_id]; + let impl_def = def.impl_def.as_ref().unwrap(); + let ty = impl_def + .trait_ty + .clone() + .map(|(a, b)| Type::Adt(a, b)) + .unwrap_or(Type::Error(ErrorGuaranteed::new_unchecked())) + .instantiate(&type_params); + Ok(ty) + } + + fn check_impl(&mut self, impl_: &mut Impl<'core>) -> Type<'core> { + let span = impl_.span; + match &mut impl_.kind { + ImplKind::Hole => Type::Error(self.core.report(Diag::UnspecifiedImpl { span })), + ImplKind::Param(n) => self.impl_params[*n].clone(), + ImplKind::Path(path) => report!(self.core; self.typeof_impl_def(path)), + ImplKind::Error(e) => Type::Error(*e), + } } pub(super) fn typeof_type_def( @@ -36,6 +138,9 @@ impl<'core> Checker<'core, '_> { inference: bool, ) -> Result, Diag<'core>> { let span = path.span; + if path.generics.as_ref().is_some_and(|g| !g.impls.is_empty()) { + self.core.report(Diag::UnexpectedImplArgs { span }); + } let def_id = path.path.resolved.unwrap(); let def = &self.resolver.defs[def_id]; let Some(type_def) = &def.type_def else { @@ -49,7 +154,7 @@ impl<'core> Checker<'core, '_> { }); } let generic_count = type_def.type_params.len(); - Self::check_generic_count(span, def, path, generic_count)?; + Self::check_type_param_count(span, def, path, generic_count)?; if !inference && path.generics.is_none() && generic_count != 0 { Err(Diag::ItemTypeHole { span })? } @@ -75,6 +180,9 @@ impl<'core> Checker<'core, '_> { inference: bool, ) -> Result<(Type<'core>, Option>>), Diag<'core>> { let span = path.span; + if path.generics.as_ref().is_some_and(|g| !g.impls.is_empty()) { + self.core.report(Diag::UnexpectedImplArgs { span }); + } let variant_id = path.path.resolved.unwrap(); let variant = &self.resolver.defs[variant_id]; let Some(variant_def) = &variant.variant_def else { @@ -94,7 +202,7 @@ impl<'core> Checker<'core, '_> { self.core.report(Diag::ExpectedIrrefutablePat { span }); } let generic_count = adt_def.type_params.len(); - Self::check_generic_count(span, variant, path, generic_count)?; + Self::check_type_param_count(span, variant, path, generic_count)?; if !inference && path.generics.is_none() && generic_count != 0 { Err(Diag::ItemTypeHole { span })? } @@ -112,19 +220,20 @@ impl<'core> Checker<'core, '_> { Ok((adt, field_tys)) } - fn check_generic_count( + fn check_type_param_count( span: Span, def: &Def<'core>, path: &GenericPath<'core>, expected: usize, ) -> Result<(), Diag<'core>> { if let Some(generics) = &path.generics { - if generics.len() != expected { + if !generics.types.is_empty() && generics.types.len() != expected { Err(Diag::BadGenericCount { span, path: def.canonical.clone(), expected, - got: path.generics.as_ref().unwrap().len(), + got: generics.types.len(), + kind: "type", })? } } diff --git a/vine/src/diag.rs b/vine/src/diag.rs index d66c2f31..d7f1d4b2 100644 --- a/vine/src/diag.rs +++ b/vine/src/diag.rs @@ -108,8 +108,10 @@ diags! { ["no type associated with `{path}`"] PathNoPat { path: Path<'core> } ["no pattern associated with `{path}`"] - BadGenericCount { path: Path<'core>, expected: usize, got: usize } - ["`{path}` expects {expected} generic{}; was passed {got}", plural(*expected, "s", "")] + PathNoImpl { path: Path<'core> } + ["no impl associated with `{path}`"] + BadGenericCount { path: Path<'core>, expected: usize, got: usize, kind: &'static str } + ["`{path}` expects {expected} {kind} parameter{}; was passed {got}", plural(*expected, "s", "")] BadFieldCount { path: Path<'core>, expected: usize, got: usize } ["`{path}` has {expected} field{}; {got} {} matched", plural(*expected, "s", ""), plural(*got, "were", "was")] MissingTupleField { ty: String, i: usize } @@ -154,6 +156,8 @@ diags! { ["the type `{path}` is only visible within `{vis}`"] PatInvisible { path: Path<'core>, vis: Path<'core> } ["the pattern `{path}` is only visible within `{vis}`"] + ImplInvisible { path: Path<'core>, vis: Path<'core> } + ["the impl `{path}` is only visible within `{vis}`"] VisibleSubitem ["subitems must be private"] DuplicateKey @@ -176,6 +180,12 @@ diags! { ["impl items cannot have generics"] ImplementedTraitItem ["trait items cannot have implementations"] + UnexpectedImplArgs + ["impl arguments are not allowed in types or patterns"] + ExtraneousImplItem { name: Ident<'core> } + ["no item `{name}` exists in trait"] + UnspecifiedImpl + ["impl parameters must be explicitly specified"] } fn plural<'a>(n: usize, plural: &'a str, singular: &'a str) -> &'a str { diff --git a/vine/src/emitter.rs b/vine/src/emitter.rs index fd862959..9cfe5ed7 100644 --- a/vine/src/emitter.rs +++ b/vine/src/emitter.rs @@ -85,6 +85,7 @@ impl<'core, 'a> Emitter<'core, 'a> { ); self.nets.insert(def.canonical.to_string(), Net { root, pairs: Vec::new() }); } + ValueDefKind::TraitSubitem(..) => todo!(), } } } diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index 1f586915..a1658e10 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -297,7 +297,7 @@ impl<'core: 'src, 'src> Formatter<'src> { self.fmt_generics( generics, |i| Doc(*i), - |(i, t)| Doc::concat([Doc(*i), Doc(": "), self.fmt_generic_path(&t)]), + |(i, t)| Doc::concat([Doc(*i), Doc(": "), self.fmt_generic_path(t)]), ) } diff --git a/vine/src/resolver.rs b/vine/src/resolver.rs index 05d7e7a5..f679117f 100644 --- a/vine/src/resolver.rs +++ b/vine/src/resolver.rs @@ -77,7 +77,7 @@ pub struct ValueDef<'core> { pub vis: DefId, pub type_params: Vec>, pub impl_params: Vec<(Ident<'core>, GenericPath<'core>)>, - pub impl_param_tys: Option>)>>, + pub impl_param_tys: Option>>, pub annotation: Option>, pub ty: Option>, pub locals: Counter, @@ -89,7 +89,7 @@ pub enum ValueDefKind<'core> { Expr(Expr<'core>), Ivy(Net), AdtConstructor, - TraitSubitem(DefId), + TraitSubitem(DefId, Ident<'core>), } #[derive(Debug)] @@ -120,14 +120,15 @@ pub struct VariantDef<'core> { #[derive(Debug)] pub struct TraitDef<'core> { pub vis: DefId, + pub generics: usize, pub type_params: Vec>, - pub subitems: Vec<(Ident<'core>, TraitSubitem<'core>)>, + pub subitems: Vec<(Ident<'core>, DefId, TraitSubitem<'core>, Option>)>, } #[derive(Debug)] pub enum TraitSubitem<'core> { - Fn(Vec>, Option>, Option>), - Const(Ty<'core>, Option>), + Fn(Vec>, Option>), + Const(Ty<'core>), } #[derive(Debug)] @@ -135,6 +136,8 @@ pub struct ImplDef<'core> { pub vis: DefId, pub type_params: Vec>, pub impl_params: Vec<(Ident<'core>, GenericPath<'core>)>, - pub impl_param_tys: Option>)>>, - pub subitems: Vec<(Ident<'core>, DefId)>, + pub impl_param_tys: Option>>, + pub trait_: GenericPath<'core>, + pub trait_ty: Option<(DefId, Vec>)>, + pub subitems: Vec<(Span, Ident<'core>, DefId)>, } diff --git a/vine/src/resolver/build_graph.rs b/vine/src/resolver/build_graph.rs index f6414cc3..304b5bee 100644 --- a/vine/src/resolver/build_graph.rs +++ b/vine/src/resolver/build_graph.rs @@ -232,7 +232,7 @@ impl<'core> Resolver<'core> { if !f.generics.impls.is_empty() || !f.generics.types.is_empty() { self.core.report(Diag::TraitItemGen { span: item.span }); } - (f.name, TraitSubitem::Fn(f.params, f.ret, None)) + (f.name, TraitSubitem::Fn(f.params, f.ret)) } ItemKind::Const(c) => { if c.value.is_some() { @@ -241,15 +241,15 @@ impl<'core> Resolver<'core> { if !c.generics.impls.is_empty() || !c.generics.types.is_empty() { self.core.report(Diag::TraitItemGen { span: item.span }); } - (c.name, TraitSubitem::Const(c.ty, None)) + (c.name, TraitSubitem::Const(c.ty)) } _ => { self.core.report(Diag::InvalidTraitItem { span: item.span }); continue; } }; - subitems.push((name, subitem)); let child = self.get_or_insert_child(def, name, vis); + subitems.push((name, child.id, subitem, None)); if child.value_def.is_some() { self.core.report(Diag::DuplicateItem { span: item.span, name }); continue; @@ -258,21 +258,22 @@ impl<'core> Resolver<'core> { vis, type_params: generics.clone(), impl_params: Vec::new(), - impl_param_tys: Some(vec![( + impl_param_tys: Some(vec![Type::Adt( def, - (0..generics.len()).map(|i| Type::Opaque(i)).collect(), + (0..generics.len()).map(Type::Opaque).collect(), )]), annotation: None, ty: None, locals: Counter::default(), - kind: ValueDefKind::TraitSubitem(def), + kind: ValueDefKind::TraitSubitem(def, name), }); } let def = &mut self.defs[def]; if def.trait_def.is_some() { self.core.report(Diag::DuplicateItem { span, name: t.name }); } - def.trait_def = Some(TraitDef { vis, type_params: generics, subitems }); + def.trait_def = + Some(TraitDef { vis, generics: generics.len(), type_params: generics, subitems }); Some(def.id) } ItemKind::Impl(i) => { @@ -295,8 +296,9 @@ impl<'core> Resolver<'core> { self.core.report(Diag::ImplItemGen { span: item.span }); } *generics = i.generics.clone(); + let span = item.span; let child = self.build_item(vis, item, def).unwrap(); - subitems.push((name, child)); + subitems.push((span, name, child)); } let def = &mut self.defs[def]; if def.impl_def.is_some() { @@ -307,6 +309,8 @@ impl<'core> Resolver<'core> { type_params: i.generics.types, impl_params: i.generics.impls, impl_param_tys: None, + trait_: i.trait_, + trait_ty: None, subitems, }); Some(def.id) diff --git a/vine/src/resolver/resolve_defs.rs b/vine/src/resolver/resolve_defs.rs index 445ab4c0..aa6b98b2 100644 --- a/vine/src/resolver/resolve_defs.rs +++ b/vine/src/resolver/resolve_defs.rs @@ -87,13 +87,13 @@ impl<'core> Resolver<'core> { let mut trait_def = def.trait_def.take(); if let Some(trait_def) = &mut trait_def { visitor.type_params = take(&mut trait_def.type_params); - for (_, subitem) in &mut trait_def.subitems { + for (_, _, subitem, _) in &mut trait_def.subitems { match subitem { - TraitSubitem::Fn(pats, ty, _) => { + TraitSubitem::Fn(pats, ty) => { visitor.visit(pats); visitor.visit(ty); } - TraitSubitem::Const(ty, _) => visitor.visit_type(ty), + TraitSubitem::Const(ty) => visitor.visit_type(ty), } } trait_def.type_params = take(&mut visitor.type_params); @@ -106,6 +106,9 @@ impl<'core> Resolver<'core> { let mut impl_def = def.impl_def.take(); if let Some(impl_def) = &mut impl_def { + if let Err(diag) = visitor.visit_path(&mut impl_def.trait_) { + visitor.resolver.core.report(diag); + } visitor.type_params = take(&mut impl_def.type_params); visitor.visit_impl_params(&mut impl_def.impl_params); impl_def.type_params = take(&mut visitor.type_params); From 4dfa05669bda7e6c5f8b4471e3b473dba61ddaad Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:29:28 -0500 Subject: [PATCH 07/13] fix bugs --- vine/src/checker.rs | 4 ++++ vine/src/checker/typeof_def.rs | 1 + vine/src/checker/unify.rs | 1 + vine/src/diag.rs | 2 ++ vine/src/fmt.rs | 34 +++++++++++++++++++++++-------- vine/src/resolver.rs | 1 + vine/src/resolver/build_graph.rs | 1 + vine/src/resolver/resolve_defs.rs | 16 ++++++++++----- vine/src/visit.rs | 8 ++++++-- 9 files changed, 52 insertions(+), 16 deletions(-) diff --git a/vine/src/checker.rs b/vine/src/checker.rs index bb7876c8..f27f50ef 100644 --- a/vine/src/checker.rs +++ b/vine/src/checker.rs @@ -381,6 +381,7 @@ impl<'core, 'r> Checker<'core, 'r> { fn check_impl_def(&mut self, def_id: DefId) { if let Some(impl_def) = self.resolver.defs[def_id].impl_def.take() { + self.generics.clone_from(&impl_def.type_params); if let Some((trait_id, trait_args)) = &impl_def.trait_ty { let trait_def = self.resolver.defs[*trait_id].trait_def.take().unwrap(); for &(span, name, sub_id) in &impl_def.subitems { @@ -400,6 +401,9 @@ impl<'core, 'r> Checker<'core, 'r> { self.core.report(Diag::ExtraneousImplItem { span, name }); } } + if trait_def.subitems.len() > impl_def.subitems.len() { + self.core.report(Diag::IncompleteImpl { span: impl_def.span }); + } self.resolver.defs[*trait_id].trait_def = Some(trait_def); } self.resolver.defs[def_id].impl_def = Some(impl_def); diff --git a/vine/src/checker/typeof_def.rs b/vine/src/checker/typeof_def.rs index 63099af9..d60991c6 100644 --- a/vine/src/checker/typeof_def.rs +++ b/vine/src/checker/typeof_def.rs @@ -141,6 +141,7 @@ impl<'core> Checker<'core, '_> { if path.generics.as_ref().is_some_and(|g| !g.impls.is_empty()) { self.core.report(Diag::UnexpectedImplArgs { span }); } + // dbg!(&path); let def_id = path.path.resolved.unwrap(); let def = &self.resolver.defs[def_id]; let Some(type_def) = &def.type_def else { diff --git a/vine/src/checker/unify.rs b/vine/src/checker/unify.rs index 045b937f..82273e1f 100644 --- a/vine/src/checker/unify.rs +++ b/vine/src/checker/unify.rs @@ -86,6 +86,7 @@ impl<'core> Checker<'core, '_> { (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; + success &= x.len() == y.len(); for (x, y) in x.iter_mut().zip(y) { success &= self._unify(x, y, i, j); } diff --git a/vine/src/diag.rs b/vine/src/diag.rs index d7f1d4b2..f60bb35e 100644 --- a/vine/src/diag.rs +++ b/vine/src/diag.rs @@ -186,6 +186,8 @@ diags! { ["no item `{name}` exists in trait"] UnspecifiedImpl ["impl parameters must be explicitly specified"] + IncompleteImpl + ["not all trait items implemented"] } fn plural<'a>(n: usize, plural: &'a str, singular: &'a str) -> &'a str { diff --git a/vine/src/fmt.rs b/vine/src/fmt.rs index a1658e10..b0632c45 100644 --- a/vine/src/fmt.rs +++ b/vine/src/fmt.rs @@ -319,16 +319,32 @@ impl<'core: 'src, 'src> Formatter<'src> { fmt_t: impl Fn(&T) -> Doc<'src>, fmt_i: impl Fn(&I) -> Doc<'src>, ) -> Doc<'src> { - if generics.impls.is_empty() { - if generics.types.is_empty() { - Doc::EMPTY - } else { - Doc::bracket_comma(generics.types.iter().map(fmt_t)) - } - } else if generics.types.is_empty() { - Doc::delimited("", "[;", "]", false, false, false, false, generics.impls.iter().map(fmt_i)) + if generics.impls.is_empty() && generics.types.is_empty() { + Doc::EMPTY } else { - todo!() + let trailing = || Doc::if_multi(","); + let sep = || Doc::concat([Doc(","), Doc::soft_line(" ")]); + Doc::concat([ + Doc("["), + if generics.types.is_empty() { + Doc::EMPTY + } else { + Doc::group([Doc::interleave(generics.types.iter().map(fmt_t), sep()), trailing()]) + }, + if generics.impls.is_empty() { + Doc::EMPTY + } else { + Doc::concat([ + Doc(";"), + Doc::group([ + Doc::if_single(" "), + Doc::interleave(generics.impls.iter().map(fmt_i), sep()), + trailing(), + ]), + ]) + }, + Doc("]"), + ]) } } diff --git a/vine/src/resolver.rs b/vine/src/resolver.rs index f679117f..e14e74a5 100644 --- a/vine/src/resolver.rs +++ b/vine/src/resolver.rs @@ -134,6 +134,7 @@ pub enum TraitSubitem<'core> { #[derive(Debug)] pub struct ImplDef<'core> { pub vis: DefId, + pub span: Span, pub type_params: Vec>, pub impl_params: Vec<(Ident<'core>, GenericPath<'core>)>, pub impl_param_tys: Option>>, diff --git a/vine/src/resolver/build_graph.rs b/vine/src/resolver/build_graph.rs index 304b5bee..19a5b14f 100644 --- a/vine/src/resolver/build_graph.rs +++ b/vine/src/resolver/build_graph.rs @@ -306,6 +306,7 @@ impl<'core> Resolver<'core> { } def.impl_def = Some(ImplDef { vis, + span, type_params: i.generics.types, impl_params: i.generics.impls, impl_param_tys: None, diff --git a/vine/src/resolver/resolve_defs.rs b/vine/src/resolver/resolve_defs.rs index aa6b98b2..377093f2 100644 --- a/vine/src/resolver/resolve_defs.rs +++ b/vine/src/resolver/resolve_defs.rs @@ -111,6 +111,7 @@ impl<'core> Resolver<'core> { } visitor.type_params = take(&mut impl_def.type_params); visitor.visit_impl_params(&mut impl_def.impl_params); + visitor.visit_trait(&mut impl_def.trait_); impl_def.type_params = take(&mut visitor.type_params); } @@ -371,7 +372,8 @@ impl<'core> VisitMut<'core, '_> for ResolveVisitor<'core, '_> { if let ImplKind::Path(path) = &mut impl_.kind { if path.generics.is_none() { if let Some(ident) = path.path.as_ident() { - if let Some((i, _)) = self.type_params.iter().enumerate().find(|(_, &g)| g == ident) { + if let Some((i, _)) = self.impl_params.iter().enumerate().find(|(_, &(g, _))| g == ident) + { impl_.kind = ImplKind::Param(i); return; } @@ -438,11 +440,15 @@ impl<'core> ResolveVisitor<'core, '_> { fn visit_impl_params(&mut self, impl_params: &mut [(Ident<'core>, GenericPath<'core>)]) { for (_, path) in impl_params { - if let Err(diag) = self.visit_path(path) { - self.resolver.core.report(diag); - } - self.visit_generic_path(path); + self.visit_trait(path); + } + } + + fn visit_trait(&mut self, path: &mut GenericPath<'core>) { + if let Err(diag) = self.visit_path(path) { + self.resolver.core.report(diag); } + self.visit_generic_path(path); } fn bind_label(&mut self, label: &mut Label<'core>, cont: bool, f: impl FnOnce(&mut Self)) { diff --git a/vine/src/visit.rs b/vine/src/visit.rs index cdffd793..9617b64c 100644 --- a/vine/src/visit.rs +++ b/vine/src/visit.rs @@ -299,8 +299,12 @@ pub trait VisitMut<'core, 'a> { ItemKind::Type(t) => { self.visit_type(&mut t.ty); } - ItemKind::Trait(_) => todo!(), - ItemKind::Impl(_) => todo!(), + ItemKind::Trait(t) => { + self.visit(&mut t.items); + } + ItemKind::Impl(t) => { + self.visit(&mut t.items); + } ItemKind::Use(..) | ItemKind::Ivy(_) | ItemKind::Taken => {} } } From af9ff0f8b97ea16b0eaed5cfa308b817e11617f5 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:29:37 -0500 Subject: [PATCH 08/13] ToString --- tests/programs/aoc_2024/day_12.vi | 17 ++++++++++------ tests/programs/cyclist.vi | 2 +- vine/examples/sub_min.vi | 2 +- vine/std/data/List.vi | 7 +++++-- vine/std/data/Map.vi | 34 ++++++++++++++++++------------- vine/std/logical/Bool.vi | 14 ++++++++----- vine/std/numeric/N32.vi | 21 +++++++++++-------- vine/std/numeric/N64.vi | 23 ++++++++++++--------- vine/std/tuple.vi | 7 +++++-- vine/std/unicode/Char.vi | 6 ++++++ vine/std/unicode/String.vi | 6 ++++++ vine/std/unicode/ToString.vi | 4 ++++ vine/std/unicode/unicode.vi | 1 + 13 files changed, 94 insertions(+), 50 deletions(-) create mode 100644 vine/std/unicode/ToString.vi diff --git a/tests/programs/aoc_2024/day_12.vi b/tests/programs/aoc_2024/day_12.vi index 099b8c83..fb604dbf 100644 --- a/tests/programs/aoc_2024/day_12.vi +++ b/tests/programs/aoc_2024/day_12.vi @@ -1,5 +1,6 @@ use std::data::Array; +use std::unicode::ToString; pub fn main(&io: &IO) { let regions = Regions(Array::empty); @@ -87,17 +88,21 @@ 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() ++ ")" } + pub impl to_string: ToString[Region] { + 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() ++ ")" } + } } } } mod Regions { - pub fn to_string(Regions(array)) -> String { - array.to_list().to_string(Region::to_string) + pub impl to_string: ToString[Regions] { + fn to_string(Regions(array)) -> String { + array.to_list().to_string[;Region::to_string]() + } } pub fn new(&Regions(array)) -> N32 { diff --git a/tests/programs/cyclist.vi b/tests/programs/cyclist.vi index ad24feb3..ad5a9f6b 100644 --- a/tests/programs/cyclist.vi +++ b/tests/programs/cyclist.vi @@ -7,7 +7,7 @@ pub fn main(&io: &IO) { while list.pop_front() is Some(val) { cycle(&list, val); - io.println(val.to_string() ++ ";\t" ++ list.to_string(N32::to_string)); + io.println(val.to_string() ++ ";\t" ++ list.to_string[;N32::to_string]()); } } diff --git a/vine/examples/sub_min.vi b/vine/examples/sub_min.vi index 338883c5..17b7ca23 100644 --- a/vine/examples/sub_min.vi +++ b/vine/examples/sub_min.vi @@ -2,7 +2,7 @@ pub fn main(&io: &IO) { let list = [4, 3, 7, 9]; sub_min(&list); - io.println(list.to_string(N32::to_string)); + io.println(list.to_string[;N32::to_string]()); } pub fn sub_min(&list: &List[N32]) { diff --git a/vine/std/data/List.vi b/vine/std/data/List.vi index d9e73341..3eb14006 100644 --- a/vine/std/data/List.vi +++ b/vine/std/data/List.vi @@ -1,5 +1,6 @@ use Map::{Cmp, Ord}; +use unicode::ToString; #[builtin = "List"] pub struct List[T](N32, Buf[T], ~Buf[T]); @@ -108,8 +109,10 @@ pub mod List { } } - pub fn to_string[T](list: List[T], elem_to_string: fn(T) -> String) -> String { - "[" ++ list.map(elem_to_string).join(", ") ++ "]" + pub impl to_string[T; t_to_string: ToString[T]]: ToString[List[T]] { + fn to_string(list: List[T]) -> String { + "[" ++ list.map(ToString::to_string[; t_to_string]).join(", ") ++ "]" + } } pub fn sort_by[T](&self: &List[T], cmp: fn(&T, &T) -> Bool) { diff --git a/vine/std/data/Map.vi b/vine/std/data/Map.vi index 22841463..5924d7e4 100644 --- a/vine/std/data/Map.vi +++ b/vine/std/data/Map.vi @@ -1,4 +1,6 @@ +use unicode::ToString; + pub type Cmp[K] = fn(&K, &K) -> Ord; pub enum Ord { @@ -137,21 +139,25 @@ pub mod Map { node.to_list() } - pub fn to_string[K, V](&map: &Map[K, V], show_key: fn(K) -> String, show_value: fn(V) -> String) -> String { - let string = ""; - let iter = map.iter(); - let first = true; - while iter.next() is Some(&(key, value)) { - if !first { - string ++= ", "; + pub impl to_string[K, V; k_to_string: ToString[K], v_to_string: ToString[V]]: ToString[Map[K, V]] { + fn to_string(map: Map[K, V]) -> String { + let string = ""; + let iter = map.into_iter(); + let first = true; + while iter.next() is Some((key, value)) { + if !first { + string ++= ", "; + } + first = false; + let key = ToString::to_string[; k_to_string](key); + let value = ToString::to_string[; v_to_string](value); + string ++= key ++ ": " ++ value; + } + if first { + "{}" + } else { + "{ " ++ string ++ " }" } - first = false - string ++= show_key(key) ++ ": " ++ show_value(value); - } - if first { - "{}" - } else { - "{ " ++ string ++ " }" } } } diff --git a/vine/std/logical/Bool.vi b/vine/std/logical/Bool.vi index 7cd58030..02bc6beb 100644 --- a/vine/std/logical/Bool.vi +++ b/vine/std/logical/Bool.vi @@ -1,11 +1,15 @@ +use unicode::ToString; + #[builtin = "Bool"] pub mod Bool { - pub fn to_string(self: Bool) -> String { - if self { - "true" - } else { - "false" + pub impl to_string: ToString[Bool] { + fn to_string(self: Bool) -> String { + if self { + "true" + } else { + "false" + } } } } diff --git a/vine/std/numeric/N32.vi b/vine/std/numeric/N32.vi index 514ce95e..8a34b94e 100644 --- a/vine/std/numeric/N32.vi +++ b/vine/std/numeric/N32.vi @@ -1,20 +1,23 @@ use data::Map::Ord; +use unicode::ToString; #[builtin = "N32"] pub mod N32 { pub const maximum: N32 = 0xffffffff; - pub fn to_string(n: N32) -> String { - if n != 0 { - let chars = []; - while n != 0 { - chars = ['0' + n % 10] ++ chars; - n = n / 10; + pub impl to_string: ToString[N32] { + fn to_string(n: N32) -> String { + if n != 0 { + let chars = []; + while n != 0 { + chars = ['0' + n % 10] ++ chars; + n = n / 10; + } + String({ chars }) + } else { + "0" } - String({ chars }) - } else { - "0" } } diff --git a/vine/std/numeric/N64.vi b/vine/std/numeric/N64.vi index 7d1f1525..56a33370 100644 --- a/vine/std/numeric/N64.vi +++ b/vine/std/numeric/N64.vi @@ -1,5 +1,6 @@ use data::Map::Ord; +use unicode::ToString; pub struct N64(N32, N32); @@ -159,17 +160,19 @@ pub mod N64 { } } - pub fn to_string(n: N64) -> String { - if !n.eq(N64::zero) { - let str = ""; - while !n.eq(N64::zero) { - let (q, r) = N64::div_rem_n32(n, 10); - str = String({ chars: ['0' + r] }) ++ str; - n = q; + pub impl to_string: ToString[N64] { + fn to_string(n: N64) -> String { + if !n.eq(N64::zero) { + let str = ""; + while !n.eq(N64::zero) { + let (q, r) = N64::div_rem_n32(n, 10); + str = String({ chars: ['0' + r] }) ++ str; + n = q; + } + str + } else { + "0" } - str - } else { - "0" } } diff --git a/vine/std/tuple.vi b/vine/std/tuple.vi index 6b457fe4..fcd902a0 100644 --- a/vine/std/tuple.vi +++ b/vine/std/tuple.vi @@ -1,5 +1,6 @@ use data::Map::{Cmp, Ord}; +use unicode::ToString; pub type Pair[A, B] = (A, B); @@ -16,7 +17,9 @@ pub mod Pair { ) } - 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) ++ ")" }) + pub impl to_string[A, B; a_to_string: ToString[A], b_to_string: ToString[B]]: ToString[Pair[A, B]] { + fn to_string((a: A, b: B)) -> String { + "(" ++ ToString::to_string[; a_to_string](a) ++ ", " ++ ToString::to_string[; b_to_string](b) ++ ")" + } } } diff --git a/vine/std/unicode/Char.vi b/vine/std/unicode/Char.vi index 3e9417db..bbbbba52 100644 --- a/vine/std/unicode/Char.vi +++ b/vine/std/unicode/Char.vi @@ -15,4 +15,10 @@ pub mod Char { Ord::Eq } } + + pub impl to_string: ToString[Char] { + fn to_string(self: Char) -> String { + String({ chars: [self] }) + } + } } diff --git a/vine/std/unicode/String.vi b/vine/std/unicode/String.vi index 1c0646b7..897dbc6d 100644 --- a/vine/std/unicode/String.vi +++ b/vine/std/unicode/String.vi @@ -116,4 +116,10 @@ pub mod String { } out } + + pub impl to_string: ToString[String] { + fn to_string(self: String) -> String { + self + } + } } diff --git a/vine/std/unicode/ToString.vi b/vine/std/unicode/ToString.vi new file mode 100644 index 00000000..eed654ff --- /dev/null +++ b/vine/std/unicode/ToString.vi @@ -0,0 +1,4 @@ + +pub trait ToString[T] { + fn to_string(self: T) -> String; +} diff --git a/vine/std/unicode/unicode.vi b/vine/std/unicode/unicode.vi index 40fd3861..87439b59 100644 --- a/vine/std/unicode/unicode.vi +++ b/vine/std/unicode/unicode.vi @@ -1,3 +1,4 @@ pub mod Char = "./Char.vi"; pub mod String = "./String.vi"; +pub mod ToString = "./ToString.vi"; From 9a20e2269b7b3c3755ae1abd612785995c72397e Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:27:34 -0500 Subject: [PATCH 09/13] specialization ... --- tests/programs/specializations.vi | 10 ++ vine/examples/sub_min.vi | 2 +- vine/src/ast.rs | 4 +- vine/src/checker/typeof_def.rs | 1 - vine/src/distiller.rs | 2 + vine/src/emitter.rs | 75 ++++++++------ vine/src/lib.rs | 7 +- vine/src/repl.rs | 12 ++- vine/src/resolver/resolve_defs.rs | 3 +- vine/src/specializer.rs | 159 ++++++++++++++++++++++++++++++ vine/src/vir.rs | 2 + vine/src/visit.rs | 3 +- 12 files changed, 240 insertions(+), 40 deletions(-) create mode 100644 tests/programs/specializations.vi create mode 100644 vine/src/specializer.rs diff --git a/tests/programs/specializations.vi b/tests/programs/specializations.vi new file mode 100644 index 00000000..cc4e051f --- /dev/null +++ b/tests/programs/specializations.vi @@ -0,0 +1,10 @@ + +use std::tuple::Pair; + +pub fn main(&io: &IO) { + io.println([1, 2, 3, 4].to_string[; N32::to_string]()); + io.println(["abc", "def", "ghi"].to_string[; String::to_string]()); + io.println(['x', 'y', 'z'].to_string[; Char::to_string]()); + io.println([true, false].to_string[; Bool::to_string]()); + io.println([(1, 'a'), (2, 'b')].to_string[; Pair::to_string[; N32::to_string, Char::to_string]]()); +} diff --git a/vine/examples/sub_min.vi b/vine/examples/sub_min.vi index 17b7ca23..37e4abbc 100644 --- a/vine/examples/sub_min.vi +++ b/vine/examples/sub_min.vi @@ -2,7 +2,7 @@ pub fn main(&io: &IO) { let list = [4, 3, 7, 9]; sub_min(&list); - io.println(list.to_string[;N32::to_string]()); + io.println(list.to_string[; N32::to_string]()); } pub fn sub_min(&list: &List[N32]) { diff --git a/vine/src/ast.rs b/vine/src/ast.rs index 186f4281..afbb3663 100644 --- a/vine/src/ast.rs +++ b/vine/src/ast.rs @@ -9,7 +9,7 @@ use class::Classes; use ivy::ast::Net; use vine_util::{interner::Interned, new_idx}; -use crate::{diag::ErrorGuaranteed, resolver::DefId}; +use crate::{diag::ErrorGuaranteed, resolver::DefId, specializer::RelId}; new_idx!(pub Local; n => ["l{n}"]); new_idx!(pub DynFnId; n => ["f{n}"]); @@ -248,6 +248,8 @@ pub enum ExprKind<'core> { Paren(B>), #[class(value)] Path(GenericPath<'core>), + #[class(value, synthetic)] + Rel(RelId), #[class(place, resolved)] Local(Local), #[class(value, resolved)] diff --git a/vine/src/checker/typeof_def.rs b/vine/src/checker/typeof_def.rs index d60991c6..63099af9 100644 --- a/vine/src/checker/typeof_def.rs +++ b/vine/src/checker/typeof_def.rs @@ -141,7 +141,6 @@ impl<'core> Checker<'core, '_> { if path.generics.as_ref().is_some_and(|g| !g.impls.is_empty()) { self.core.report(Diag::UnexpectedImplArgs { span }); } - // dbg!(&path); let def_id = path.path.resolved.unwrap(); let def = &self.resolver.defs[def_id]; let Some(type_def) = &def.type_def else { diff --git a/vine/src/distiller.rs b/vine/src/distiller.rs index 019337a1..e85ae6f2 100644 --- a/vine/src/distiller.rs +++ b/vine/src/distiller.rs @@ -129,6 +129,8 @@ impl<'core, 'r> Distiller<'core, 'r> { ExprKind::F32(f) => Port::F32(*f), ExprKind::Path(path) => Port::Const(path.path.resolved.unwrap()), + ExprKind::Rel(rel_id) => Port::Rel(*rel_id), + ExprKind::DynFn(dyn_fn) => { let dyn_fn = self.dyn_fns[*dyn_fn].as_ref().unwrap(); stage.steps.push(Step::Transfer(Transfer::unconditional(dyn_fn.interface))); diff --git a/vine/src/emitter.rs b/vine/src/emitter.rs index 9cfe5ed7..4969d6b8 100644 --- a/vine/src/emitter.rs +++ b/vine/src/emitter.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeMap, mem::take}; +use std::{collections::BTreeMap, fmt::Write, mem::take}; use ivy::ast::{Net, Nets, Tree}; use vine_util::idx::{Counter, IdxVec}; @@ -7,6 +7,7 @@ use crate::{ analyzer::usage::Usage, ast::Local, resolver::{AdtDef, Def, Resolver, ValueDefKind, VariantDef}, + specializer::{Spec, SpecId}, vir::{ Interface, InterfaceId, InterfaceKind, Invocation, Port, Stage, StageId, Step, Transfer, VIR, }, @@ -23,12 +24,14 @@ impl<'core, 'a> Emitter<'core, 'a> { Emitter { nets: Nets::default(), resolver, dup_labels: Counter::default() } } - pub fn emit_vir(&mut self, path: String, vir: &VIR) { + pub fn emit_vir(&mut self, path: String, vir: &VIR, specs: &IdxVec) { let mut emitter = VirEmitter { resolver: self.resolver, path, stages: &vir.stages, interfaces: &vir.interfaces, + specs, + spec_id: SpecId::default(), locals: BTreeMap::new(), pairs: Vec::new(), wire_offset: 0, @@ -36,27 +39,23 @@ impl<'core, 'a> Emitter<'core, 'a> { dup_labels: self.dup_labels, }; - for stage in vir.stages.values() { - let interface = &vir.interfaces[stage.interface]; - if interface.incoming != 0 && !interface.inline() { - emitter.wire_offset = 0; - emitter.wires.0 = stage.wires.0 .0; - let root = emitter.emit_interface(interface, true); - let root = - Tree::n_ary("enum", stage.header.iter().map(|p| emitter.emit_port(p)).chain([root])); - emitter._emit_stage(stage); - for (_, local) in take(&mut emitter.locals) { - emitter.finish_local(local); + for spec_id in specs.keys() { + emitter.spec_id = spec_id; + for stage in vir.stages.values() { + let interface = &vir.interfaces[stage.interface]; + if interface.incoming != 0 && !interface.inline() { + emitter.wire_offset = 0; + emitter.wires.0 = stage.wires.0 .0; + let root = emitter.emit_interface(interface, true); + let root = + Tree::n_ary("enum", stage.header.iter().map(|p| emitter.emit_port(p)).chain([root])); + emitter._emit_stage(stage); + for (_, local) in take(&mut emitter.locals) { + emitter.finish_local(local); + } + let net = Net { root, pairs: take(&mut emitter.pairs) }; + self.nets.insert(emitter.stage_name(stage.id), net); } - let net = Net { root, pairs: take(&mut emitter.pairs) }; - self.nets.insert( - if stage.id.0 == 0 { - emitter.path.clone() - } else { - format!("{}::{}", emitter.path, stage.id.0) - }, - net, - ); } } @@ -66,7 +65,7 @@ impl<'core, 'a> Emitter<'core, 'a> { pub fn emit_ivy(&mut self, def: &Def<'core>) { if let Some(value_def) = &def.value_def { match &value_def.kind { - ValueDefKind::Expr(_) => {} + ValueDefKind::Expr(_) | ValueDefKind::TraitSubitem(..) => {} ValueDefKind::Ivy(net) => { self.nets.insert(def.canonical.to_string(), net.clone()); } @@ -85,7 +84,6 @@ impl<'core, 'a> Emitter<'core, 'a> { ); self.nets.insert(def.canonical.to_string(), Net { root, pairs: Vec::new() }); } - ValueDefKind::TraitSubitem(..) => todo!(), } } } @@ -96,6 +94,8 @@ struct VirEmitter<'core, 'a> { path: String, stages: &'a IdxVec, interfaces: &'a IdxVec, + specs: &'a IdxVec, + spec_id: SpecId, locals: BTreeMap, pairs: Vec<(Tree, Tree)>, wire_offset: usize, @@ -234,8 +234,8 @@ impl<'core, 'a> VirEmitter<'core, 'a> { ) } - fn emit_stage_node(&self, stage: StageId) -> Tree { - Tree::Global(format!("{}::{}", self.path, stage.0)) + fn emit_stage_node(&self, stage_id: StageId) -> Tree { + Tree::Global(self.stage_name(stage_id)) } fn local(&mut self, local: Local) -> &mut LocalState { @@ -244,7 +244,8 @@ impl<'core, 'a> VirEmitter<'core, 'a> { fn emit_step(&mut self, step: &Step) { let wire_offset = self.wire_offset; - let emit_port = |p| Self::_emit_port(wire_offset, self.resolver, p); + let spec_id = self.spec_id; + let emit_port = |p| Self::_emit_port(wire_offset, self.resolver, &self.specs[spec_id], p); match step { Step::Invoke(local, invocation) => match invocation { Invocation::Erase => self.local(*local).erase(), @@ -297,16 +298,21 @@ impl<'core, 'a> VirEmitter<'core, 'a> { } fn emit_port(&self, port: &Port) -> Tree { - Self::_emit_port(self.wire_offset, self.resolver, port) + Self::_emit_port(self.wire_offset, self.resolver, &self.specs[self.spec_id], port) } - fn _emit_port(wire_offset: usize, resolver: &Resolver, port: &Port) -> Tree { + fn _emit_port(wire_offset: usize, resolver: &Resolver, spec: &Spec, port: &Port) -> Tree { match port { Port::Erase => Tree::Erase, Port::N32(n) => Tree::N32(*n), Port::F32(f) => Tree::F32(*f), Port::Wire(w) => Tree::Var(format!("w{}", wire_offset + w.0)), Port::Const(def) => Tree::Global(resolver.defs[*def].canonical.to_string()), + Port::Rel(rel) => { + let (def, spec, singular) = spec.rels[*rel]; + let path = &resolver.defs[def].canonical; + Tree::Global(if singular { path.to_string() } else { format!("{}::{}", path, spec.0) }) + } } } @@ -324,6 +330,17 @@ impl<'core, 'a> VirEmitter<'core, 'a> { let label = format!("w{}", self.wires.next()); (Tree::Var(label.clone()), Tree::Var(label)) } + + fn stage_name(&self, stage_id: StageId) -> String { + let mut name = self.path.clone(); + if !self.specs[self.spec_id].singular { + write!(name, "::{}", self.spec_id.0).unwrap(); + } + if stage_id.0 != 0 { + write!(name, "::{}", stage_id.0).unwrap(); + } + name + } } #[derive(Default)] diff --git a/vine/src/lib.rs b/vine/src/lib.rs index 40e0acfa..79915a93 100644 --- a/vine/src/lib.rs +++ b/vine/src/lib.rs @@ -12,6 +12,7 @@ pub mod normalizer; pub mod parser; pub mod repl; pub mod resolver; +pub mod specializer; pub mod vir; pub mod visit; @@ -19,6 +20,7 @@ use core::{Core, CoreArenas}; use std::path::PathBuf; use ivy::ast::Nets; +use specializer::specialize; use crate::{ analyzer::analyze, ast::Path, checker::Checker, distiller::Distiller, emitter::Emitter, @@ -57,14 +59,15 @@ pub fn compile(config: Config) -> Result { core.bail()?; + let specializations = specialize(&mut resolver); let mut distiller = Distiller::new(&resolver); let mut emitter = Emitter::new(&resolver); - for (_, def) in &resolver.defs { + for (def_id, def) in &resolver.defs { if matches_filter(&def.canonical, &config.items) { if let Some(vir) = distiller.distill(def) { let mut vir = normalize(&vir); analyze(&mut vir); - emitter.emit_vir(def.canonical.to_string(), &vir); + emitter.emit_vir(def.canonical.to_string(), &vir, &specializations[def_id]); } else { emitter.emit_ivy(def); } diff --git a/vine/src/repl.rs b/vine/src/repl.rs index f7a30b22..7600adba 100644 --- a/vine/src/repl.rs +++ b/vine/src/repl.rs @@ -28,6 +28,7 @@ use crate::{ normalizer::normalize, parser::VineParser, resolver::{DefId, Resolver}, + specializer::specialize, vir::{InterfaceId, StageId}, }; @@ -78,13 +79,14 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { core.bail()?; + let specializations = specialize(&mut resolver); let mut distiller = Distiller::new(&resolver); let mut emitter = Emitter::new(&resolver); - for (_, def) in &resolver.defs { + for (def_id, def) in &resolver.defs { if let Some(vir) = distiller.distill(def) { let mut vir = normalize(&vir); analyze(&mut vir); - emitter.emit_vir(def.canonical.to_string(), &vir); + emitter.emit_vir(def.canonical.to_string(), &vir, &specializations[def_id]); } else { emitter.emit_ivy(def); } @@ -183,7 +185,8 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { if let Some(vir) = distiller.distill(def) { let mut vir = normalize(&vir); analyze(&mut vir); - emitter.emit_vir(def.canonical.to_string(), &vir); + // emitter.emit_vir(def.canonical.to_string(), &vir); + todo!() } else { emitter.emit_ivy(def); } @@ -202,7 +205,8 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { for var in self.vars.values() { vir.interfaces[InterfaceId(0)].wires.insert(var.local, (Usage::Mut, Usage::Mut)); } - emitter.emit_vir(name.clone(), &vir); + // emitter.emit_vir(name.clone(), &vir); + todo!(); self.host.insert_nets(&emitter.nets); diff --git a/vine/src/resolver/resolve_defs.rs b/vine/src/resolver/resolve_defs.rs index 377093f2..ff62c08e 100644 --- a/vine/src/resolver/resolve_defs.rs +++ b/vine/src/resolver/resolve_defs.rs @@ -368,7 +368,7 @@ impl<'core> VisitMut<'core, '_> for ResolveVisitor<'core, '_> { self._visit_type(ty); } - fn _visit_impl(&mut self, impl_: &mut Impl<'core>) { + fn visit_impl(&mut self, impl_: &mut Impl<'core>) { if let ImplKind::Path(path) = &mut impl_.kind { if path.generics.is_none() { if let Some(ident) = path.path.as_ident() { @@ -383,6 +383,7 @@ impl<'core> VisitMut<'core, '_> for ResolveVisitor<'core, '_> { impl_.kind = ImplKind::Error(self.resolver.core.report(diag)); } } + self._visit_impl(impl_); } } diff --git a/vine/src/specializer.rs b/vine/src/specializer.rs new file mode 100644 index 00000000..6e023037 --- /dev/null +++ b/vine/src/specializer.rs @@ -0,0 +1,159 @@ +use std::{ + collections::{hash_map::Entry, HashMap}, + mem::take, +}; + +use vine_util::{idx::IdxVec, new_idx, unwrap_idx_vec}; + +use crate::{ + ast::{Expr, ExprKind, Ident, Impl, ImplKind}, + resolver::{DefId, Resolver, ValueDefKind}, + visit::VisitMut, +}; + +pub fn specialize(resolver: &mut Resolver) -> IdxVec> { + let mut specializer = Specializer { defs: IdxVec::new(), resolver }; + specializer.initialize(); + specializer.specialize_roots(); + specializer.defs.into_iter().map(|d| unwrap_idx_vec(d.1.specs)).collect::>().into() +} + +#[derive(Debug)] +struct Specializer<'core, 'a> { + defs: IdxVec>, + resolver: &'a mut Resolver<'core>, +} + +impl<'core, 'a> Specializer<'core, 'a> { + fn initialize(&mut self) { + for def_id in self.resolver.defs.keys() { + let def = &mut self.resolver.defs[def_id]; + let def_info = if let Some(mut value_def) = def.value_def.take() { + let impl_params = value_def.impl_params.len(); + let mut extractor = RelExtractor { rels: IdxVec::new(), resolver: self.resolver }; + if let ValueDefKind::Expr(expr) = &mut value_def.kind { + extractor.visit_expr(expr); + } + let rels = extractor.rels; + self.resolver.defs[def_id].value_def = Some(value_def); + DefInfo { impl_params, rels, specs_lookup: HashMap::new(), specs: IdxVec::new() } + } else { + DefInfo::default() + }; + self.defs.push(def_info); + } + } + + fn specialize_roots(&mut self) { + for def_id in self.defs.keys() { + if self.defs[def_id].impl_params == 0 { + self.specialize(def_id, Vec::new()); + self.defs[def_id].specs[SpecId(0)].as_mut().unwrap().singular = true; + } + } + } + + fn specialize(&mut self, def_id: DefId, impl_args: Vec) -> SpecId { + let def = &mut self.defs[def_id]; + let entry = match def.specs_lookup.entry(impl_args) { + Entry::Occupied(e) => return *e.get(), + Entry::Vacant(e) => e, + }; + let spec_id = def.specs.push(None); + let impl_args = entry.key().clone(); + entry.insert(spec_id); + let mut spec = Spec::default(); + for rel_id in def.rels.keys() { + let rel = &self.defs[def_id].rels[rel_id]; + let (rel_def_id, rel_impl_args) = match rel { + Rel::Def(rel_def_id, impls) => { + (*rel_def_id, impls.iter().map(|x| instantiate(x, &impl_args)).collect()) + } + Rel::Subitem(impl_, name) => { + let impl_ = instantiate(impl_, &impl_args); + let subitem_id = self.resolver.defs[impl_.0] + .impl_def + .as_ref() + .unwrap() + .subitems + .iter() + .find(|(_, n, _)| n == name) + .unwrap() + .2; + (subitem_id, impl_.1) + } + }; + let singular = rel_impl_args.is_empty(); + let rel_spec_id = self.specialize(rel_def_id, rel_impl_args); + spec.rels.push((rel_def_id, rel_spec_id, singular)); + } + self.defs[def_id].specs[spec_id] = Some(spec); + spec_id + } +} + +struct RelExtractor<'core, 'a> { + rels: IdxVec>, + resolver: &'a Resolver<'core>, +} + +impl<'core> VisitMut<'core, '_> for RelExtractor<'core, '_> { + fn visit_expr(&mut self, expr: &mut Expr<'core>) { + if let ExprKind::Path(path) = &mut expr.kind { + if let Some(generics) = &mut path.generics { + if !generics.impls.is_empty() { + let def_id = path.path.resolved.unwrap(); + let mut impls = take(&mut generics.impls); + let rel = if let ValueDefKind::TraitSubitem(_, name) = + self.resolver.defs[def_id].value_def.as_ref().unwrap().kind + { + Rel::Subitem(impls.pop().unwrap(), name) + } else { + Rel::Def(def_id, impls) + }; + let rel_id = self.rels.push(rel); + expr.kind = ExprKind::Rel(rel_id); + } + } + } + self._visit_expr(expr); + } +} + +#[derive(Debug, Default)] +struct DefInfo<'core> { + impl_params: usize, + rels: IdxVec>, + specs_lookup: HashMap, SpecId>, + specs: IdxVec>, +} + +new_idx!(pub RelId); +new_idx!(pub SpecId); +new_idx!(pub ImplId); + +#[derive(Debug, Default)] +pub struct Spec { + pub singular: bool, + pub rels: IdxVec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +struct ImplTree(DefId, Vec); + +#[derive(Debug)] +enum Rel<'core> { + Def(DefId, Vec>), + Subitem(Impl<'core>, Ident<'core>), +} + +fn instantiate<'core>(impl_: &Impl<'core>, params: &[ImplTree]) -> ImplTree { + match &impl_.kind { + ImplKind::Hole | ImplKind::Error(_) => unreachable!(), + ImplKind::Param(i) => params[*i].clone(), + ImplKind::Path(p) => ImplTree( + p.path.resolved.unwrap(), + p.generics.iter().flat_map(|x| &x.impls).map(|i| instantiate(i, params)).collect(), + ), + } +} diff --git a/vine/src/vir.rs b/vine/src/vir.rs index 59f6ee16..aa2aead1 100644 --- a/vine/src/vir.rs +++ b/vine/src/vir.rs @@ -11,6 +11,7 @@ use crate::{ analyzer::{usage::Usage, UsageVar}, ast::Local, resolver::DefId, + specializer::RelId, }; new_idx!(pub LayerId; n => ["L{n}"]); @@ -164,6 +165,7 @@ impl Invocation { pub enum Port { Erase, Const(DefId), + Rel(RelId), N32(u32), F32(f32), Wire(WireId), diff --git a/vine/src/visit.rs b/vine/src/visit.rs index 9617b64c..f02de24d 100644 --- a/vine/src/visit.rs +++ b/vine/src/visit.rs @@ -71,7 +71,8 @@ pub trait VisitMut<'core, 'a> { | ExprKind::Return(None) | ExprKind::Break(_, None) | ExprKind::SetLocal(_) - | ExprKind::HedgeLocal(_) => {} + | ExprKind::HedgeLocal(_) + | ExprKind::Rel(..) => {} ExprKind::Paren(a) | ExprKind::Ref(a, _) | ExprKind::Deref(a, _) From c3e7e241f00479092c4ae2d435e6eabd187e97e6 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:30:20 -0500 Subject: [PATCH 10/13] fmt --- tests/programs/aoc_2024/day_12.vi | 2 +- tests/programs/cyclist.vi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/programs/aoc_2024/day_12.vi b/tests/programs/aoc_2024/day_12.vi index fb604dbf..ae1eca2b 100644 --- a/tests/programs/aoc_2024/day_12.vi +++ b/tests/programs/aoc_2024/day_12.vi @@ -101,7 +101,7 @@ mod Region { mod Regions { pub impl to_string: ToString[Regions] { fn to_string(Regions(array)) -> String { - array.to_list().to_string[;Region::to_string]() + array.to_list().to_string[; Region::to_string]() } } diff --git a/tests/programs/cyclist.vi b/tests/programs/cyclist.vi index ad5a9f6b..8d97a32b 100644 --- a/tests/programs/cyclist.vi +++ b/tests/programs/cyclist.vi @@ -7,7 +7,7 @@ pub fn main(&io: &IO) { while list.pop_front() is Some(val) { cycle(&list, val); - io.println(val.to_string() ++ ";\t" ++ list.to_string[;N32::to_string]()); + io.println(val.to_string() ++ ";\t" ++ list.to_string[; N32::to_string]()); } } From ae7bd97936f0cf623a2f602b6f1739dbb1f739b9 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:31:26 -0500 Subject: [PATCH 11/13] cspell --- cspell.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cspell.json b/cspell.json index 54340e04..11ab35c1 100644 --- a/cspell.json +++ b/cspell.json @@ -14,6 +14,7 @@ "deque", "desugared", "dyntest", + "impls", "fizzbuzz", "freelist", "hashbrown", @@ -31,11 +32,13 @@ "primality", "readback", "readline", + "rels", "repr", "rotr", "rustyline", "scrutinee", "sixel", + "specializer", "strs", "unpark", "vecs", From 07837b17267fc2f5ec02945d85ab8ec25f3e4322 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:32:57 -0500 Subject: [PATCH 12/13] lint --- vine/src/repl.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/vine/src/repl.rs b/vine/src/repl.rs index 7600adba..c88af248 100644 --- a/vine/src/repl.rs +++ b/vine/src/repl.rs @@ -186,7 +186,6 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { let mut vir = normalize(&vir); analyze(&mut vir); // emitter.emit_vir(def.canonical.to_string(), &vir); - todo!() } else { emitter.emit_ivy(def); } @@ -206,7 +205,6 @@ impl<'core, 'ctx, 'ivm> Repl<'core, 'ctx, 'ivm> { vir.interfaces[InterfaceId(0)].wires.insert(var.local, (Usage::Mut, Usage::Mut)); } // emitter.emit_vir(name.clone(), &vir); - todo!(); self.host.insert_nets(&emitter.nets); From 85b56835d76d5baea812a03fe8c50987356cfc1c Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Mon, 13 Jan 2025 12:35:44 -0500 Subject: [PATCH 13/13] snaps --- tests/snaps/vine/aoc_2024/day_01/compiled.iv | 40 ++-- tests/snaps/vine/aoc_2024/day_02/compiled.iv | 34 ++-- tests/snaps/vine/aoc_2024/day_03/compiled.iv | 30 +-- tests/snaps/vine/aoc_2024/day_04/compiled.iv | 18 +- tests/snaps/vine/aoc_2024/day_05/compiled.iv | 34 ++-- tests/snaps/vine/aoc_2024/day_06/compiled.iv | 54 +++--- tests/snaps/vine/aoc_2024/day_07/compiled.iv | 48 ++--- tests/snaps/vine/aoc_2024/day_08/compiled.iv | 54 +++--- tests/snaps/vine/aoc_2024/day_09/compiled.iv | 30 +-- tests/snaps/vine/aoc_2024/day_10/compiled.iv | 24 +-- tests/snaps/vine/aoc_2024/day_11/compiled.iv | 80 ++++---- tests/snaps/vine/aoc_2024/day_12/compiled.iv | 28 +-- tests/snaps/vine/aoc_2024/day_13/compiled.iv | 54 +++--- tests/snaps/vine/aoc_2024/day_14/compiled.iv | 68 +++---- tests/snaps/vine/aoc_2024/day_15/compiled.iv | 74 ++++---- tests/snaps/vine/aoc_2024/day_16/compiled.iv | 86 ++++----- tests/snaps/vine/aoc_2024/day_17/compiled.iv | 60 +++--- tests/snaps/vine/aoc_2024/day_18/compiled.iv | 86 ++++----- tests/snaps/vine/aoc_2024/day_19/compiled.iv | 70 +++---- tests/snaps/vine/aoc_2024/day_20/compiled.iv | 46 ++--- tests/snaps/vine/aoc_2024/day_21/compiled.iv | 70 +++---- tests/snaps/vine/aoc_2024/day_22/compiled.iv | 56 +++--- tests/snaps/vine/aoc_2024/day_23/compiled.iv | 42 ++--- tests/snaps/vine/aoc_2024/day_24/compiled.iv | 66 +++---- tests/snaps/vine/aoc_2024/day_25/compiled.iv | 18 +- tests/snaps/vine/array_from_list/compiled.iv | 32 ++-- tests/snaps/vine/array_order/compiled.iv | 44 ++--- tests/snaps/vine/array_to_list/compiled.iv | 38 ++-- 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 | 2 +- tests/snaps/vine/cyclist/compiled.iv | 24 +-- tests/snaps/vine/cyclist/stats.txt | 8 +- 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/guessing_game/compiled.iv | 30 +-- tests/snaps/vine/hello_world/compiled.iv | 2 +- tests/snaps/vine/inverse/compiled.iv | 8 +- tests/snaps/vine/logic/compiled.iv | 2 +- .../vine/loop_break_continue/compiled.iv | 8 +- tests/snaps/vine/loop_vi_loop/compiled.iv | 8 +- tests/snaps/vine/mandelbrot_sixel/compiled.iv | 10 +- tests/snaps/vine/mandelbrot_tga/compiled.iv | 2 +- tests/snaps/vine/map_test/compiled.iv | 54 +++--- 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 | 8 +- tests/snaps/vine/segmented_sieve/compiled.iv | 38 ++-- tests/snaps/vine/sieve/compiled.iv | 28 +-- tests/snaps/vine/so_random/compiled.iv | 12 +- tests/snaps/vine/specializations/compiled.iv | 178 ++++++++++++++++++ tests/snaps/vine/specializations/output.txt | 5 + tests/snaps/vine/specializations/stats.txt | 15 ++ tests/snaps/vine/stream_primes/compiled.iv | 8 +- tests/snaps/vine/sub_min/compiled.iv | 28 +-- tests/snaps/vine/sub_min/stats.txt | 8 +- tests/snaps/vine/sum_divisors/compiled.iv | 8 +- tests/snaps/vine/verbose_add/compiled.iv | 8 +- tests/tests.rs | 1 + 66 files changed, 1092 insertions(+), 893 deletions(-) create mode 100644 tests/snaps/vine/specializations/compiled.iv create mode 100644 tests/snaps/vine/specializations/output.txt create mode 100644 tests/snaps/vine/specializations/stats.txt diff --git a/tests/snaps/vine/aoc_2024/day_01/compiled.iv b/tests/snaps/vine/aoc_2024/day_01/compiled.iv index 2c4ba91a..bbd73595 100644 --- a/tests/snaps/vine/aoc_2024/day_01/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_01/compiled.iv @@ -131,7 +131,7 @@ } ::std::data::List::sort_by::5 { - enum(w0 x(w5 x(dup309(w22 w26) x(w3 w25)))) + enum(w0 x(w5 x(dup304(w22 w26) x(w3 w25)))) ::std::data::List::sort_by::7 = x(w22 x(x(w3 w21) x(x(w0 w19) x(tup(0 tup(w15 w15)) w17)))) ::std::data::List::concat = fn(w17 fn(tup(1 tup(tup(w19 w23) w23)) w11)) ::std::data::List::concat = fn(w11 fn(w21 w13)) @@ -145,7 +145,7 @@ ::std::data::List::pop_front = fn(ref(w10 w1) enum(::std::data::List::sort_by::10 enum(::std::data::List::sort_by::11 x(w11 x(x(w1 w17) w8))))) } -::std::data::List::sort_by::10 { enum(w0 x(dup329(fn(ref(w5 w12) fn(ref(w0 w15) ?(::std::data::List::sort_by::14 ::std::data::List::sort_by::13 x(w25 x(w7 x(x(w12 w22) x(w3 w15))))))) w25) x(w7 x(x(w5 w22) w3)))) } +::std::data::List::sort_by::10 { enum(w0 x(dup324(fn(ref(w5 w12) fn(ref(w0 w15) ?(::std::data::List::sort_by::14 ::std::data::List::sort_by::13 x(w25 x(w7 x(x(w12 w22) x(w3 w15))))))) w25) x(w7 x(x(w5 w22) w3)))) } ::std::data::List::sort_by::11 { x(_ x(x(w5 w5) x(x(w3 w3) x(w1 w1)))) } @@ -160,9 +160,9 @@ ::std::data::List::sort_by::7 = x(w12 x(w11 x(w9 x(w1 w15)))) } -::std::data::List::iter { fn(ref(tup(dup358(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup353(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup365(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup360(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::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::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup394(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup389(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -192,7 +192,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2009(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1953(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -201,10 +201,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2019(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1963(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2022(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1966(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -212,7 +212,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2029(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup1973(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -224,10 +224,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2040(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup1984(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2049(dup2044(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup1993(dup1988(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -246,9 +246,9 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::numeric::N32::ascending { fn(ref(dup2066(w2 @lt(w11 w12)) w2) fn(ref(dup2067(w5 w11) w5) w12)) } +::std::numeric::N32::ascending { fn(ref(dup2010(w2 @lt(w11 w12)) w2) fn(ref(dup2011(w5 w11) w5) w12)) } -::std::unicode::String::len { fn(ref(tup(dup2662(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2610(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -256,7 +256,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2673(w1 w20) x(w12 w18))) + x(w14 x(dup2621(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -274,9 +274,9 @@ } ::std::unicode::String::split_trim::2 { - x(w24 x(dup2698(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup2646(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::unicode::String::split_once = fn(w24 fn(w1 tup(w3 enum(::std::unicode::String::split_trim::24 enum(::std::unicode::String::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2709(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2702(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2704(w20 w31)))))) + ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2657(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2650(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2652(w20 w31)))))) } ::std::unicode::String::split_trim::4 { x(?(0 1 w3) w3) } @@ -331,7 +331,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2789(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2737(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -340,7 +340,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2803(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2751(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -383,7 +383,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2979(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2931(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -402,7 +402,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3073(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3025(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_02/compiled.iv b/tests/snaps/vine/aoc_2024/day_02/compiled.iv index af3938f2..0c4da2d2 100644 --- a/tests/snaps/vine/aoc_2024/day_02/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_02/compiled.iv @@ -143,9 +143,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup406(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup401(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup413(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup408(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -158,7 +158,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup442(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup437(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -175,7 +175,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2057(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2001(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -184,10 +184,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2067(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2011(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2070(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2014(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -195,7 +195,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2077(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2021(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -207,10 +207,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2088(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2032(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2097(dup2092(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2041(dup2036(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -229,7 +229,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::unicode::String::len { fn(ref(tup(dup2710(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2658(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -237,7 +237,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2721(w1 w20) x(w12 w18))) + x(w14 x(dup2669(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -255,9 +255,9 @@ } ::std::unicode::String::split_trim::2 { - x(w24 x(dup2746(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup2694(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::unicode::String::split_once = fn(w24 fn(w1 tup(w3 enum(::std::unicode::String::split_trim::24 enum(::std::unicode::String::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2757(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2750(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2752(w20 w31)))))) + ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2705(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2698(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2700(w20 w31)))))) } ::std::unicode::String::split_trim::4 { x(?(0 1 w3) w3) } @@ -312,7 +312,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2837(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2785(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -321,7 +321,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2851(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2799(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -364,7 +364,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3027(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2979(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -383,7 +383,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3121(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3073(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_03/compiled.iv b/tests/snaps/vine/aoc_2024/day_03/compiled.iv index 0ccf4257..db64251b 100644 --- a/tests/snaps/vine/aoc_2024/day_03/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_03/compiled.iv @@ -115,9 +115,9 @@ ::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::data::List::iter { fn(ref(tup(dup333(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup328(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup340(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup335(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -130,7 +130,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup369(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup364(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -143,7 +143,7 @@ ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup1984(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1928(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -152,10 +152,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1994(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1938(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1997(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1941(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -163,7 +163,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2004(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup1948(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -175,10 +175,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2015(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup1959(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2024(dup2019(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup1968(dup1963(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -197,7 +197,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::unicode::String::len { fn(ref(tup(dup2637(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2585(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -205,7 +205,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2648(w1 w20) x(w12 w18))) + x(w14 x(dup2596(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -243,7 +243,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2764(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2712(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -252,7 +252,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2778(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2726(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -295,7 +295,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2954(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2906(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -314,7 +314,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3048(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3000(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_04/compiled.iv b/tests/snaps/vine/aoc_2024/day_04/compiled.iv index 2e7a7c9a..38d8c08b 100644 --- a/tests/snaps/vine/aoc_2024/day_04/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_04/compiled.iv @@ -282,9 +282,9 @@ ::std::data::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::data::List::iter { fn(ref(tup(dup688(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup683(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup695(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup690(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -303,7 +303,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2339(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2283(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -312,10 +312,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2349(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2293(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2352(@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::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -334,7 +334,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3309(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3261(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -348,11 +348,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3354(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3306(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3361(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3313(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -367,7 +367,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3378(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3330(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_05/compiled.iv b/tests/snaps/vine/aoc_2024/day_05/compiled.iv index 1261369f..4810d982 100644 --- a/tests/snaps/vine/aoc_2024/day_05/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_05/compiled.iv @@ -254,9 +254,9 @@ ::std::data::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::data::List::iter { fn(ref(tup(dup567(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup562(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup574(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup569(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -269,7 +269,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup603(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup598(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -286,7 +286,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2218(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2162(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -295,10 +295,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2228(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2172(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2231(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2175(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -306,7 +306,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2238(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2182(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -318,10 +318,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2249(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2193(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2258(dup2253(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2202(dup2197(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -340,7 +340,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::unicode::String::len { fn(ref(tup(dup2871(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2819(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -348,7 +348,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2882(w1 w20) x(w12 w18))) + x(w14 x(dup2830(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -386,7 +386,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2998(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2946(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -395,7 +395,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup3012(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2960(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -438,7 +438,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3188(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3140(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -452,11 +452,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3233(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3185(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3240(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3192(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -471,7 +471,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3257(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3209(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_06/compiled.iv b/tests/snaps/vine/aoc_2024/day_06/compiled.iv index ce4fff73..cd8f54e0 100644 --- a/tests/snaps/vine/aoc_2024/day_06/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_06/compiled.iv @@ -187,9 +187,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup537(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup532(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup544(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup539(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -207,10 +207,10 @@ ::std::data::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::data::Array::from_fn { fn(dup716(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup717(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup711(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup712(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup723(w1 dup723(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup718(w1 dup718(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -219,25 +219,25 @@ ::std::data::Array::from_fn::4 { x(_ x(_ x(_ ::std::data::Array::empty))) } -::std::data::Array::len { fn(ref(tup(dup793(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup788(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup799(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup794(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup810(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup805(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup814(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup809(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_front { fn(ref(tup(dup849(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup849(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup844(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup844(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -250,7 +250,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup870(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup865(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -260,9 +260,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup883(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup878(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup889(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup884(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -277,13 +277,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup900(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup895(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup906(@sub(1 @rem(2 dup908(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup907(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup901(@sub(1 @rem(2 dup903(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup902(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -315,7 +315,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::unzip_with { fn(dup1086(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup1081(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -325,7 +325,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup1098(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1100(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup1093(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1095(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -338,7 +338,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2188(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2132(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -347,10 +347,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2198(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2142(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2201(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2145(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -358,7 +358,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::unicode::String::len { fn(ref(tup(dup2841(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2789(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split_trim { fn(w2 fn(w3 w12)) @@ -366,9 +366,9 @@ } ::std::unicode::String::split_trim::2 { - x(w24 x(dup2877(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup2825(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::unicode::String::split_once = fn(w24 fn(w1 tup(w3 enum(::std::unicode::String::split_trim::24 enum(::std::unicode::String::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2888(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2881(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2883(w20 w31)))))) + ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2836(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2829(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2831(w20 w31)))))) } ::std::unicode::String::split_trim::4 { x(?(0 1 w3) w3) } @@ -423,7 +423,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2968(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2916(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -432,7 +432,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2982(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2930(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -475,7 +475,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3158(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3110(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -494,7 +494,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3252(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3204(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_07/compiled.iv b/tests/snaps/vine/aoc_2024/day_07/compiled.iv index 5e88d593..8e36d174 100644 --- a/tests/snaps/vine/aoc_2024/day_07/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_07/compiled.iv @@ -143,9 +143,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup417(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup412(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup424(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup419(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -164,7 +164,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::parse { fn(tup(dup2088(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2032(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -176,10 +176,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2099(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2043(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2108(dup2103(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2052(dup2047(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -209,19 +209,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2308(@div(w9 w10) @rem(w12 dup2309(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2311(w9 dup2311(w12 dup2311(w31 dup2311(w36 dup2311(w41 dup2311(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2307(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2252(@div(w9 w10) @rem(w12 dup2253(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2255(w9 dup2255(w12 dup2255(w31 dup2255(w36 dup2255(w41 dup2255(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2251(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2322(@div(w1 w2) @rem(w4 w6)) w6) x(dup2323(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2266(@div(w1 w2) @rem(w4 w6)) w6) x(dup2267(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2330(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2274(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2337(w2 w9) x(dup2339(w0 dup2339(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2343(w5 w11))) + x(x(w27 w33) x(dup2281(w2 w9) x(dup2283(w0 dup2283(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2287(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -235,7 +235,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } -::std::numeric::N64::parse { fn(tup(dup2549(?(::std::numeric::N64::parse::4 ::std::numeric::N64::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N64::parse { fn(tup(dup2493(?(::std::numeric::N64::parse::4 ::std::numeric::N64::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N64::parse::3 { x(w6 x(w5 w7)) @@ -248,10 +248,10 @@ ::std::numeric::N64::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N64::parse::5 { x(dup2560(?(::std::numeric::N64::parse::7 ::std::numeric::N64::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N64::parse::5 { x(dup2504(?(::std::numeric::N64::parse::7 ::std::numeric::N64::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N64::parse::6 { - x(w22 x(tup(dup2569(dup2564(w24 @le(57 w27)) w30) w2) x(w20 w29))) + x(w22 x(tup(dup2513(dup2508(w24 @le(57 w27)) w30) w2) x(w20 w29))) 48 = @le(w24 @n32_and(w27 ?(::std::numeric::N64::parse::10 ::std::numeric::N64::parse::9 x(w22 x(w2 x(w20 x(w30 w29))))))) } @@ -275,7 +275,7 @@ ::std::numeric::N64::parse::11 { x(w10 w10) } ::std::numeric::N64::to_string { - fn(dup2586(w6 w9) w8) + fn(dup2530(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -287,7 +287,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2596(w0 w7) w3) + x(dup2540(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -301,7 +301,7 @@ ::std::numeric::N64::to_string::5 = x(w2 x(w11 w20)) } -::std::unicode::String::len { fn(ref(tup(dup2721(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2669(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -309,7 +309,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2732(w1 w20) x(w12 w18))) + x(w14 x(dup2680(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -347,7 +347,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2848(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2796(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -356,7 +356,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2862(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2810(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -399,7 +399,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3038(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2990(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -413,11 +413,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3083(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3035(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3090(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3042(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -432,7 +432,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3107(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3059(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_08/compiled.iv b/tests/snaps/vine/aoc_2024/day_08/compiled.iv index ec0cf7c0..ee76efea 100644 --- a/tests/snaps/vine/aoc_2024/day_08/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_08/compiled.iv @@ -144,9 +144,9 @@ ::std::data::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::data::List::iter { fn(ref(tup(dup453(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup448(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup460(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup455(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -159,7 +159,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup489(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup484(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -176,22 +176,22 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } -::std::data::Map::len { fn(ref(tup(w2 tup(dup1054(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } +::std::data::Map::len { fn(ref(tup(w2 tup(dup1049(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } ::std::data::Map::insert { - fn(ref(tup(dup1058(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1053(w2 w16) w5) tup(w2 w14)) w9) ::std::data::Map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::data::Map::get_or_insert { - fn(ref(tup(dup1066(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1061(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::data::Map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::logical::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1304(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1248(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -199,10 +199,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1317(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1261(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1332(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1276(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -274,16 +274,16 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup1906(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1907(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup1850(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1851(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup1911(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1912(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup1855(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1856(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup1916(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1917(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup1860(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1861(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -295,7 +295,7 @@ ::std::logical::Option::unwrap_or::6 { x(w1 w1) } -::std::numeric::N32::to_string { fn(dup2104(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2048(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -304,10 +304,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2114(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2058(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2117(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2061(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -315,13 +315,13 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::cmp { fn(ref(dup2171(w2 dup2171(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2172(w5 dup2172(w12 w15)) w5) w14)) } +::std::numeric::N32::cmp { fn(ref(dup2115(w2 dup2115(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2116(w5 dup2116(w12 w15)) w5) w14)) } ::std::numeric::N32::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } ::std::numeric::N32::cmp::4 { x(@lt$(w4 ?(::std::data::Map::Ord::Eq ::std::data::Map::Ord::Gt w6)) x(w4 w6)) } -::std::numeric::N32::diff { fn(dup2203(@lt$(w8 ?(::std::numeric::N32::diff::4 ::std::numeric::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2204(w8 w11) w10)) } +::std::numeric::N32::diff { fn(dup2147(@lt$(w8 ?(::std::numeric::N32::diff::4 ::std::numeric::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2148(w8 w11) w10)) } ::std::numeric::N32::diff::3 { x(@sub(w4 w2) x(w4 w2)) } @@ -332,23 +332,23 @@ ::std::numeric::N32::gcd::2 = x(w2 x(w3 w8)) } -::std::numeric::N32::gcd::2 { x(dup2221(?(::std::numeric::N32::gcd::4 ::std::numeric::N32::gcd::3 x(w6 w2)) w6) w2) } +::std::numeric::N32::gcd::2 { x(dup2165(?(::std::numeric::N32::gcd::4 ::std::numeric::N32::gcd::3 x(w6 w2)) w6) w2) } ::std::numeric::N32::gcd::3 { - x(dup2224(w1 w3) x(@rem(w1 w2) w12)) + x(dup2168(w1 w3) x(@rem(w1 w2) w12)) tup(w2 w3) = tup(w5 w6) ::std::numeric::N32::gcd::2 = x(w5 x(w6 w12)) } ::std::numeric::N32::gcd::4 { x(_ x(w1 w1)) } -::std::unicode::Char::cmp { fn(ref(dup2745(w2 dup2745(@lt(w12 ?(::std::unicode::Char::cmp::4 ::std::unicode::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2746(w5 dup2746(w12 w15)) w5) w14)) } +::std::unicode::Char::cmp { fn(ref(dup2689(w2 dup2689(@lt(w12 ?(::std::unicode::Char::cmp::4 ::std::unicode::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2690(w5 dup2690(w12 w15)) w5) w14)) } ::std::unicode::Char::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } ::std::unicode::Char::cmp::4 { x(@lt$(w4 ?(::std::data::Map::Ord::Eq ::std::data::Map::Ord::Gt w6)) x(w4 w6)) } -::std::unicode::String::len { fn(ref(tup(dup2757(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2705(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split_trim { fn(w2 fn(w3 w12)) @@ -356,9 +356,9 @@ } ::std::unicode::String::split_trim::2 { - x(w24 x(dup2793(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup2741(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::unicode::String::split_once = fn(w24 fn(w1 tup(w3 enum(::std::unicode::String::split_trim::24 enum(::std::unicode::String::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2804(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2797(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2799(w20 w31)))))) + ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2752(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2745(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2747(w20 w31)))))) } ::std::unicode::String::split_trim::4 { x(?(0 1 w3) w3) } @@ -413,7 +413,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2884(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2832(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -422,7 +422,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2898(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2846(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -465,7 +465,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3074(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3026(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -484,7 +484,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3168(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3120(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_09/compiled.iv b/tests/snaps/vine/aoc_2024/day_09/compiled.iv index 75ef00b7..29d0e9de 100644 --- a/tests/snaps/vine/aoc_2024/day_09/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_09/compiled.iv @@ -171,9 +171,9 @@ ::std::data::List::concat = fn(tup(1 tup(tup(w5 w13) w13)) fn(w3 w11)) } -::std::data::List::iter { fn(ref(tup(dup500(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup495(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup507(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup502(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -198,7 +198,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::min { fn(dup2230(@lt(w8 ?(::std::numeric::N32::min::4 ::std::numeric::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2231(w8 w11) w10)) } +::std::numeric::N32::min { fn(dup2174(@lt(w8 ?(::std::numeric::N32::min::4 ::std::numeric::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2175(w8 w11) w10)) } ::std::numeric::N32::min::3 { x(w3 x(_ w3)) } @@ -211,19 +211,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2391(@div(w9 w10) @rem(w12 dup2392(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2394(w9 dup2394(w12 dup2394(w31 dup2394(w36 dup2394(w41 dup2394(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2390(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2335(@div(w9 w10) @rem(w12 dup2336(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2338(w9 dup2338(w12 dup2338(w31 dup2338(w36 dup2338(w41 dup2338(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2334(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2405(@div(w1 w2) @rem(w4 w6)) w6) x(dup2406(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2349(@div(w1 w2) @rem(w4 w6)) w6) x(dup2350(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2413(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2357(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2420(w2 w9) x(dup2422(w0 dup2422(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2426(w5 w11))) + x(x(w27 w33) x(dup2364(w2 w9) x(dup2366(w0 dup2366(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2370(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -238,7 +238,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } ::std::numeric::N64::to_string { - fn(dup2669(w6 w9) w8) + fn(dup2613(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -250,7 +250,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2679(w0 w7) w3) + x(dup2623(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -275,7 +275,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3121(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3073(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -289,11 +289,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3166(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3118(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3173(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3125(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -308,7 +308,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3190(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3142(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_10/compiled.iv b/tests/snaps/vine/aoc_2024/day_10/compiled.iv index 712bc00c..93ed1b15 100644 --- a/tests/snaps/vine/aoc_2024/day_10/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_10/compiled.iv @@ -218,9 +218,9 @@ ::std::data::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::data::List::iter { fn(ref(tup(dup569(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup564(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup576(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup571(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -239,7 +239,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2220(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2164(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -248,10 +248,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2230(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2174(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2233(@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::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -259,7 +259,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::unicode::String::len { fn(ref(tup(dup2873(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2821(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split_trim { fn(w2 fn(w3 w12)) @@ -267,9 +267,9 @@ } ::std::unicode::String::split_trim::2 { - x(w24 x(dup2909(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup2857(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::unicode::String::split_once = fn(w24 fn(w1 tup(w3 enum(::std::unicode::String::split_trim::24 enum(::std::unicode::String::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2920(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2913(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2915(w20 w31)))))) + ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup2868(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup2861(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup2863(w20 w31)))))) } ::std::unicode::String::split_trim::4 { x(?(0 1 w3) w3) } @@ -324,7 +324,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup3000(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2948(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -333,7 +333,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup3014(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2962(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -376,7 +376,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3190(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3142(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -395,7 +395,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3284(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3236(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_11/compiled.iv b/tests/snaps/vine/aoc_2024/day_11/compiled.iv index d033ad24..355433a2 100644 --- a/tests/snaps/vine/aoc_2024/day_11/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_11/compiled.iv @@ -130,9 +130,9 @@ ::std::data::List::concat = fn(tup(1 tup(tup(w5 w13) w13)) fn(w3 w11)) } -::std::data::List::iter { fn(ref(tup(dup385(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup380(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup392(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup387(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -152,12 +152,12 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } ::std::data::Map::insert { - fn(ref(tup(dup990(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup985(w2 w16) w5) tup(w2 w14)) w9) ::std::data::Map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::data::Map::get_or_insert { - fn(ref(tup(dup998(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup993(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::data::Map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::logical::Option::unwrap_or = fn(w20 fn(w10 w24)) } @@ -170,7 +170,7 @@ ::std::data::List::pop_front = fn(ref(w15 w19) enum(::std::data::Map::Iter::next::9 enum(::std::data::Map::Iter::next::10 x(x(w17 w25) w23)))) } -::std::data::Map::Iter::next::2 { x(x(ref(tup(dup1093(w2 ?(::std::data::Map::Iter::next::5 ::std::data::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } +::std::data::Map::Iter::next::2 { x(x(ref(tup(dup1088(w2 ?(::std::data::Map::Iter::next::5 ::std::data::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } ::std::data::Map::Iter::next::4 { x(x(_ w48) x(x(w4 w46) x(x(w2 w18) w44))) @@ -215,7 +215,7 @@ ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1236(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1180(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -223,10 +223,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1249(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1193(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1264(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1208(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -298,16 +298,16 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup1838(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1839(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup1782(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1783(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup1843(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1844(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup1787(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1788(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup1848(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1849(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup1792(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1793(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -323,7 +323,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2036(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1980(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -332,10 +332,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2046(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1990(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2049(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1993(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -343,7 +343,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2056(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2000(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -355,10 +355,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2067(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2011(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2076(dup2071(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2020(dup2015(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -377,7 +377,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::numeric::N32::cmp { fn(ref(dup2103(w2 dup2103(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2104(w5 dup2104(w12 w15)) w5) w14)) } +::std::numeric::N32::cmp { fn(ref(dup2047(w2 dup2047(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2048(w5 dup2048(w12 w15)) w5) w14)) } ::std::numeric::N32::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } @@ -388,10 +388,10 @@ ::std::numeric::N32::pow::2 = x(w2 x(w3 x(1 w9))) } -::std::numeric::N32::pow::2 { x(w4 x(dup2194(?(::std::numeric::N32::pow::4 ::std::numeric::N32::pow::3 x(w4 x(w7 w2))) w7) w2)) } +::std::numeric::N32::pow::2 { x(w4 x(dup2138(?(::std::numeric::N32::pow::4 ::std::numeric::N32::pow::3 x(w4 x(w7 w2))) w7) w2)) } ::std::numeric::N32::pow::3 { - x(dup2197(w15 dup2197(w1 @mul(w1 w3))) x(dup2199(@rem(2 ?(::std::numeric::N32::pow::7 ::std::numeric::N32::pow::6 x(w15 x(x(w7 w14) _)))) @div(2 w5)) x(w7 w17))) + x(dup2141(w15 dup2141(w1 @mul(w1 w3))) x(dup2143(@rem(2 ?(::std::numeric::N32::pow::7 ::std::numeric::N32::pow::6 x(w15 x(x(w7 w14) _)))) @div(2 w5)) x(w7 w17))) ::std::numeric::N32::pow::2 = x(w3 x(w5 x(w14 w17))) } @@ -414,19 +414,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2276(@div(w9 w10) @rem(w12 dup2277(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2279(w9 dup2279(w12 dup2279(w31 dup2279(w36 dup2279(w41 dup2279(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2275(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2220(@div(w9 w10) @rem(w12 dup2221(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2223(w9 dup2223(w12 dup2223(w31 dup2223(w36 dup2223(w41 dup2223(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2219(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2290(@div(w1 w2) @rem(w4 w6)) w6) x(dup2291(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2234(@div(w1 w2) @rem(w4 w6)) w6) x(dup2235(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2298(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2242(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2305(w2 w9) x(dup2307(w0 dup2307(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2311(w5 w11))) + x(x(w27 w33) x(dup2249(w2 w9) x(dup2251(w0 dup2251(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2255(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -440,7 +440,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } -::std::numeric::N64::le { fn(tup(w2 dup2403(@lt(w12 ?(::std::numeric::N64::le::4 ::std::numeric::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2405(w12 w15)) w14)) } +::std::numeric::N64::le { fn(tup(w2 dup2347(@lt(w12 ?(::std::numeric::N64::le::4 ::std::numeric::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2349(w12 w15)) w14)) } ::std::numeric::N64::le::3 { x(_ x(_ x(_ x(_ 1)))) } @@ -450,7 +450,7 @@ ::std::numeric::N64::le::6 { x(_ x(_ 0)) } -::std::numeric::N64::cmp { fn(ref(tup(w3 dup2490(w4 dup2490(@lt(w20 ?(::std::numeric::N64::cmp::4 ::std::numeric::N64::cmp::3 x(x(w3 w28) x(w26 x(x(w10 w25) x(w23 w22)))))) w26))) tup(w28 w4)) fn(ref(tup(w10 dup2493(w11 dup2493(w20 w23))) tup(w25 w11)) w22)) } +::std::numeric::N64::cmp { fn(ref(tup(w3 dup2434(w4 dup2434(@lt(w20 ?(::std::numeric::N64::cmp::4 ::std::numeric::N64::cmp::3 x(x(w3 w28) x(w26 x(x(w10 w25) x(w23 w22)))))) w26))) tup(w28 w4)) fn(ref(tup(w10 dup2437(w11 dup2437(w20 w23))) tup(w25 w11)) w22)) } ::std::numeric::N64::cmp::3 { x(x(w6 w6) x(_ x(x(w3 w3) x(_ ::std::data::Map::Ord::Lt)))) } @@ -464,7 +464,7 @@ } ::std::numeric::N64::to_string { - fn(dup2554(w6 w9) w8) + fn(dup2498(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -476,7 +476,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2564(w0 w7) w3) + x(dup2508(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -496,20 +496,20 @@ } ::std::numeric::N64::log_n32::2 { - x(dup2607(w2 w11) x(dup2608(w0 w10) w5)) + x(dup2551(w2 w11) x(dup2552(w0 w10) w5)) ::std::numeric::N64::from_n32 = fn(w0 w1) ::std::numeric::N64::le = fn(w1 fn(w2 ?(::std::numeric::N64::log_n32::4 ::std::numeric::N64::log_n32::3 x(w11 x(w10 w5))))) } ::std::numeric::N64::log_n32::3 { - x(w12 x(dup2613(w3 w15) x(@add(1 w1) w14))) + x(w12 x(dup2557(w3 w15) x(@add(1 w1) w14))) ::std::numeric::N64::div_rem_n32 = fn(w12 fn(w3 tup(w5 _))) ::std::numeric::N64::log_n32::2 = x(w5 x(w15 x(w1 w14))) } ::std::numeric::N64::log_n32::4 { x(_ x(_ x(w1 w1))) } -::std::unicode::String::len { fn(ref(tup(dup2689(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2637(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -517,7 +517,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2700(w1 w20) x(w12 w18))) + x(w14 x(dup2648(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -555,7 +555,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2816(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2764(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -564,7 +564,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2830(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2778(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -607,7 +607,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3006(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2958(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -621,11 +621,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3051(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3003(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3058(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3010(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -640,7 +640,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3075(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3027(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_12/compiled.iv b/tests/snaps/vine/aoc_2024/day_12/compiled.iv index 225be36c..9056ba63 100644 --- a/tests/snaps/vine/aoc_2024/day_12/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_12/compiled.iv @@ -218,25 +218,25 @@ ::std::data::Array::empty { tup(0 _) } -::std::data::Array::len { fn(ref(tup(dup968(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup967(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup974(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup973(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup985(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup984(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup989(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup988(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_back { fn(ref(tup(dup995(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup995(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup994(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup994(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -249,10 +249,10 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup1016(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup1015(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup1020(w1 @rem(2 w3))) + x(x(w10 w13) dup1019(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } @@ -279,7 +279,7 @@ ::std::logical::Option::unwrap_or::6 { x(w1 w1) } -::std::numeric::N32::to_string { fn(dup2363(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2311(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -288,10 +288,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2373(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2321(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2376(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2324(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -310,7 +310,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3333(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3289(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -324,11 +324,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3378(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3334(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3385(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3341(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -343,7 +343,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3402(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3358(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_13/compiled.iv b/tests/snaps/vine/aoc_2024/day_13/compiled.iv index 26382344..44ced924 100644 --- a/tests/snaps/vine/aoc_2024/day_13/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_13/compiled.iv @@ -119,9 +119,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup352(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup347(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup359(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup354(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -140,7 +140,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2003(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1947(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -149,10 +149,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2013(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1957(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2016(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1960(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -160,7 +160,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2023(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup1967(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -172,10 +172,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2034(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup1978(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2043(dup2038(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup1987(dup1982(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -194,7 +194,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::numeric::N32::diff { fn(dup2102(@lt$(w8 ?(::std::numeric::N32::diff::4 ::std::numeric::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2103(w8 w11) w10)) } +::std::numeric::N32::diff { fn(dup2046(@lt$(w8 ?(::std::numeric::N32::diff::4 ::std::numeric::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2047(w8 w11) w10)) } ::std::numeric::N32::diff::3 { x(@sub(w4 w2) x(w4 w2)) } @@ -213,19 +213,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2243(@div(w9 w10) @rem(w12 dup2244(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2246(w9 dup2246(w12 dup2246(w31 dup2246(w36 dup2246(w41 dup2246(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2242(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2187(@div(w9 w10) @rem(w12 dup2188(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2190(w9 dup2190(w12 dup2190(w31 dup2190(w36 dup2190(w41 dup2190(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2186(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2257(@div(w1 w2) @rem(w4 w6)) w6) x(dup2258(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2201(@div(w1 w2) @rem(w4 w6)) w6) x(dup2202(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2265(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2209(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2272(w2 w9) x(dup2274(w0 dup2274(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2278(w5 w11))) + x(x(w27 w33) x(dup2216(w2 w9) x(dup2218(w0 dup2218(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2222(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -239,7 +239,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } -::std::numeric::N64::ge { fn(tup(w2 dup2414(@lt$(w12 ?(::std::numeric::N64::ge::4 ::std::numeric::N64::ge::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2416(w12 w15)) w14)) } +::std::numeric::N64::ge { fn(tup(w2 dup2358(@lt$(w12 ?(::std::numeric::N64::ge::4 ::std::numeric::N64::ge::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2360(w12 w15)) w14)) } ::std::numeric::N64::ge::3 { x(_ x(_ x(_ x(_ 1)))) } @@ -250,7 +250,7 @@ ::std::numeric::N64::ge::6 { x(_ x(_ 0)) } ::std::numeric::N64::to_string { - fn(dup2521(w6 w9) w8) + fn(dup2465(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -262,7 +262,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2531(w0 w7) w3) + x(dup2475(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -281,10 +281,10 @@ ::std::numeric::N64::pow_n32::2 = x(w2 x(w3 x(::std::numeric::N64::one w9))) } -::std::numeric::N64::pow_n32::2 { x(w4 x(dup2550(?(::std::numeric::N64::pow_n32::4 ::std::numeric::N64::pow_n32::3 x(w4 x(w7 w2))) w7) w2)) } +::std::numeric::N64::pow_n32::2 { x(w4 x(dup2494(?(::std::numeric::N64::pow_n32::4 ::std::numeric::N64::pow_n32::3 x(w4 x(w7 w2))) w7) w2)) } ::std::numeric::N64::pow_n32::3 { - x(dup2553(w16 dup2553(w1 w2)) x(dup2555(@rem(2 ?(::std::numeric::N64::pow_n32::7 ::std::numeric::N64::pow_n32::6 x(w16 x(x(w8 w15) _)))) @div(2 w6)) x(w8 w18))) + x(dup2497(w16 dup2497(w1 w2)) x(dup2499(@rem(2 ?(::std::numeric::N64::pow_n32::7 ::std::numeric::N64::pow_n32::6 x(w16 x(x(w8 w15) _)))) @div(2 w6)) x(w8 w18))) ::std::numeric::N64::mul = fn(w1 fn(w2 w3)) ::std::numeric::N64::pow_n32::2 = x(w3 x(w6 x(w15 w18))) } @@ -299,7 +299,7 @@ ::std::numeric::N64::pow_n32::7 { x(_ x(x(w2 w2) _)) } ::std::numeric::N64::diff { - fn(dup2586(w7 w12) fn(dup2587(w8 w11) w10)) + fn(dup2530(w7 w12) fn(dup2531(w8 w11) w10)) ::std::numeric::N64::ge = fn(w7 fn(w8 ?(::std::numeric::N64::diff::4 ::std::numeric::N64::diff::3 x(w12 x(w11 w10))))) } @@ -313,7 +313,7 @@ ::std::numeric::N64::sub = fn(w4 fn(w5 w2)) } -::std::unicode::String::len { fn(ref(tup(dup2656(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2604(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -321,7 +321,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2667(w1 w20) x(w12 w18))) + x(w14 x(dup2615(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -359,7 +359,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2783(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2731(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -368,7 +368,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2797(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2745(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -411,7 +411,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2973(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2925(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -430,7 +430,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3067(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3019(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_14/compiled.iv b/tests/snaps/vine/aoc_2024/day_14/compiled.iv index b38798f4..a803c361 100644 --- a/tests/snaps/vine/aoc_2024/day_14/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_14/compiled.iv @@ -208,9 +208,9 @@ ::std::data::List::concat = fn(w3 fn(tup(1 tup(tup(w5 w12) w12)) w11)) } -::std::data::List::iter { fn(ref(tup(dup490(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup485(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup497(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup492(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -223,7 +223,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup526(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup521(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -233,7 +233,7 @@ ::std::data::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::logical::Option::None)) } ::std::data::Array::new { - fn(dup642(w6 w7) fn(w3 tup(w6 w9))) + fn(dup637(w6 w7) fn(w3 tup(w6 w9))) ::std::data::Array::Node::new = fn(w7 fn(w3 w9)) } @@ -243,10 +243,10 @@ ::std::data::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::data::Array::fold_back { fn(tup(dup725(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_back { fn(tup(dup720(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_back::3 { - x(dup733(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup728(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -255,25 +255,25 @@ ::std::data::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::data::Array::len { fn(ref(tup(dup746(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup741(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup752(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup747(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup763(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup758(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup767(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup762(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_back { fn(ref(tup(dup773(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup773(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup768(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup768(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -286,19 +286,19 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup794(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup789(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup798(w1 @rem(2 w3))) + x(x(w10 w13) dup793(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } ::std::data::Array::push_back::7 { x(x(w2 w2) _) } -::std::data::Array::pop_front { fn(ref(tup(dup886(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup881(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup892(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup887(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -313,12 +313,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup903(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup898(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup910(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup905(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -342,7 +342,7 @@ ::std::data::Array::Node::leaf { fn(x x) } -::std::data::Array::Node::new { fn(dup945(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::data::Array::Node::new { fn(dup940(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::data::Array::Node::new::3 { x(_ x(w3 w1)) @@ -350,7 +350,7 @@ } ::std::data::Array::Node::new::4 { - x(dup953(@add(1 @div(2 w2)) @div(2 w6)) x(dup954(w3 w7) tup(w4 w8))) + x(dup948(@add(1 @div(2 w2)) @div(2 w6)) x(dup949(w3 w7) tup(w4 w8))) ::std::data::Array::Node::new = fn(w2 fn(w3 w4)) ::std::data::Array::Node::new = fn(w6 fn(w7 w8)) } @@ -361,7 +361,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::zip_with { fn(dup1018(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::data::Array::Node::zip_with { fn(dup1013(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::data::Array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -371,7 +371,7 @@ } ::std::data::Array::Node::zip_with::4 { - x(dup1030(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1033(w13 w19) tup(w14 w20))))) + x(dup1025(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1028(w13 w19) tup(w14 w20))))) ::std::data::Array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::data::Array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } @@ -384,7 +384,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2141(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2085(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -393,10 +393,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2151(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2095(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2154(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2098(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -404,7 +404,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2161(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2105(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -416,10 +416,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2172(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2116(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2181(dup2176(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2125(dup2120(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -440,7 +440,7 @@ ::std::unicode::Char::from_n32 { fn(x x) } -::std::unicode::String::len { fn(ref(tup(dup2794(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2742(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split_once { fn(w2 fn(w3 w15)) @@ -468,7 +468,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2921(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2869(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -477,7 +477,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2935(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2883(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -520,7 +520,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3111(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3063(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -534,11 +534,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3156(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3108(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3163(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3115(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -553,7 +553,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3180(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3132(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_15/compiled.iv b/tests/snaps/vine/aoc_2024/day_15/compiled.iv index 39e65cc4..f25614c6 100644 --- a/tests/snaps/vine/aoc_2024/day_15/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_15/compiled.iv @@ -444,9 +444,9 @@ ::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::data::List::iter { fn(ref(tup(dup857(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup852(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup864(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup859(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -459,7 +459,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup893(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup888(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -481,10 +481,10 @@ ::std::data::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::data::Array::from_fn { fn(dup1036(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup1037(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup1031(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup1032(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup1043(w1 dup1043(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup1038(w1 dup1038(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -493,10 +493,10 @@ ::std::data::Array::from_fn::4 { x(_ x(_ x(_ ::std::data::Array::empty))) } -::std::data::Array::fold_back { fn(tup(dup1092(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_back { fn(tup(dup1087(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_back::3 { - x(dup1100(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup1095(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -505,25 +505,25 @@ ::std::data::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::data::Array::len { fn(ref(tup(dup1113(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup1108(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup1119(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup1114(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup1130(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup1125(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup1134(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup1129(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_back { fn(ref(tup(dup1140(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1140(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup1135(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1135(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -536,17 +536,17 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup1161(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup1156(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup1165(w1 @rem(2 w3))) + x(x(w10 w13) dup1160(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } ::std::data::Array::push_back::7 { x(x(w2 w2) _) } -::std::data::Array::push_front { fn(ref(tup(dup1169(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1169(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup1164(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1164(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -559,7 +559,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup1190(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup1185(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -569,9 +569,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup1203(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup1198(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup1209(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup1204(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -586,13 +586,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup1220(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup1215(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup1226(@sub(1 @rem(2 dup1228(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup1227(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup1221(@sub(1 @rem(2 dup1223(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup1222(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -612,9 +612,9 @@ ::std::data::Array::pop_back::14 { x(w11 w11) } -::std::data::Array::pop_front { fn(ref(tup(dup1253(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup1248(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup1259(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup1254(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -629,12 +629,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup1270(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup1265(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup1277(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup1272(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -664,7 +664,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::zip_with { fn(dup1385(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::data::Array::Node::zip_with { fn(dup1380(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::data::Array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -674,12 +674,12 @@ } ::std::data::Array::Node::zip_with::4 { - x(dup1397(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1400(w13 w19) tup(w14 w20))))) + x(dup1392(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1395(w13 w19) tup(w14 w20))))) ::std::data::Array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::data::Array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } -::std::data::Array::Node::unzip_with { fn(dup1406(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup1401(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -689,7 +689,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup1418(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1420(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup1413(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1415(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -702,7 +702,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2508(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2452(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -711,10 +711,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2518(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2462(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2521(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2465(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -722,7 +722,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::unicode::String::len { fn(ref(tup(dup3161(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup3109(w2 w15) w4) tup(w2 w4)) w15) } ::std::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -735,7 +735,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3478(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3430(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -749,11 +749,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3523(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3475(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3530(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3482(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -768,7 +768,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3547(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3499(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_16/compiled.iv b/tests/snaps/vine/aoc_2024/day_16/compiled.iv index 2ddc9962..3cf5c136 100644 --- a/tests/snaps/vine/aoc_2024/day_16/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_16/compiled.iv @@ -232,10 +232,10 @@ ::std::data::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::data::Array::from_fn { fn(dup823(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup824(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup818(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup819(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup830(w1 dup830(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup825(w1 dup825(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -244,10 +244,10 @@ ::std::data::Array::from_fn::4 { x(_ x(_ x(_ ::std::data::Array::empty))) } -::std::data::Array::fold_back { fn(tup(dup879(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_back { fn(tup(dup874(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_back::3 { - x(dup887(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup882(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -256,25 +256,25 @@ ::std::data::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::data::Array::len { fn(ref(tup(dup900(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup895(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup906(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup901(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup917(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup912(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup921(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup916(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_back { fn(ref(tup(dup927(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup927(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup922(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup922(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -287,17 +287,17 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup948(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup943(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup952(w1 @rem(2 w3))) + x(x(w10 w13) dup947(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } ::std::data::Array::push_back::7 { x(x(w2 w2) _) } -::std::data::Array::push_front { fn(ref(tup(dup956(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup956(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup951(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup951(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -310,7 +310,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup977(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup972(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -320,9 +320,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup990(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup985(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup996(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup991(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -337,13 +337,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup1007(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup1002(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup1013(@sub(1 @rem(2 dup1015(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup1014(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup1008(@sub(1 @rem(2 dup1010(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup1009(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -363,9 +363,9 @@ ::std::data::Array::pop_back::14 { x(w11 w11) } -::std::data::Array::pop_front { fn(ref(tup(dup1040(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup1035(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup1046(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup1041(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -380,12 +380,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup1057(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup1052(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup1064(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup1059(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -415,7 +415,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::zip_with { fn(dup1172(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::data::Array::Node::zip_with { fn(dup1167(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::data::Array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -425,12 +425,12 @@ } ::std::data::Array::Node::zip_with::4 { - x(dup1184(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1187(w13 w19) tup(w14 w20))))) + x(dup1179(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1182(w13 w19) tup(w14 w20))))) ::std::data::Array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::data::Array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } -::std::data::Array::Node::unzip_with { fn(dup1193(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup1188(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -440,7 +440,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup1205(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1207(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup1200(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1202(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -454,18 +454,18 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } ::std::data::Map::insert { - fn(ref(tup(dup1249(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1244(w2 w16) w5) tup(w2 w14)) w9) ::std::data::Map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::data::Map::get_or_insert { - fn(ref(tup(dup1257(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1252(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::data::Map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::logical::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::data::Map::remove_min { - fn(ref(tup(dup1302(w2 w19) w5) tup(w2 w18)) w16) + fn(ref(tup(dup1297(w2 w19) w5) tup(w2 w18)) w16) ::std::data::Map::Node::size = fn(ref(w5 w13) ?(::std::data::Map::remove_min::4 ::std::data::Map::remove_min::3 x(w19 x(x(w13 w18) w16)))) } @@ -479,7 +479,7 @@ ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1495(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1439(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -487,10 +487,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1508(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1452(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1523(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1467(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -576,16 +576,16 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup2097(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2098(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup2041(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2042(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup2102(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2103(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup2046(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2047(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup2107(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2108(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup2051(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2052(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -601,7 +601,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2295(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2239(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -610,10 +610,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2305(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2249(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2308(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2252(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -621,7 +621,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::cmp { fn(ref(dup2362(w2 dup2362(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2363(w5 dup2363(w12 w15)) w5) w14)) } +::std::numeric::N32::cmp { fn(ref(dup2306(w2 dup2306(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2307(w5 dup2307(w12 w15)) w5) w14)) } ::std::numeric::N32::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } @@ -638,7 +638,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3265(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3217(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -652,11 +652,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3310(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3262(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3317(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3269(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -671,7 +671,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3334(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3286(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_17/compiled.iv b/tests/snaps/vine/aoc_2024/day_17/compiled.iv index 2479d34d..48d0bce5 100644 --- a/tests/snaps/vine/aoc_2024/day_17/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_17/compiled.iv @@ -170,9 +170,9 @@ ::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::data::List::iter { fn(ref(tup(dup494(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup489(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup501(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup496(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -185,7 +185,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup530(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup525(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -201,10 +201,10 @@ ::std::data::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::data::Array::from_fn { fn(dup673(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup674(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup668(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup669(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup680(w1 dup680(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup675(w1 dup675(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -213,25 +213,25 @@ ::std::data::Array::from_fn::4 { x(_ x(_ x(_ ::std::data::Array::empty))) } -::std::data::Array::len { fn(ref(tup(dup750(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup745(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup756(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup751(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup767(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup762(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup771(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup766(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_front { fn(ref(tup(dup806(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup806(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup801(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup801(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -244,7 +244,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup827(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup822(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -254,9 +254,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup840(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup835(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup846(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup841(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -271,13 +271,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup857(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup852(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup863(@sub(1 @rem(2 dup865(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup864(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup858(@sub(1 @rem(2 dup860(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup859(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -309,7 +309,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::unzip_with { fn(dup1043(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup1038(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -319,7 +319,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup1055(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1057(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup1050(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1052(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -332,7 +332,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2145(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2089(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -341,10 +341,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2155(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2099(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2158(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2102(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -352,7 +352,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2165(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2109(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -364,10 +364,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2176(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2120(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2185(dup2180(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2129(dup2124(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -386,7 +386,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::unicode::String::len { fn(ref(tup(dup2798(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2746(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -394,7 +394,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2809(w1 w20) x(w12 w18))) + x(w14 x(dup2757(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -432,7 +432,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2925(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2873(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -441,7 +441,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2939(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2887(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -484,7 +484,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3115(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3067(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -503,7 +503,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3209(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3161(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_18/compiled.iv b/tests/snaps/vine/aoc_2024/day_18/compiled.iv index f8da51b3..99058a79 100644 --- a/tests/snaps/vine/aoc_2024/day_18/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_18/compiled.iv @@ -354,9 +354,9 @@ ::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::data::List::iter { fn(ref(tup(dup818(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup813(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup825(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup820(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -369,7 +369,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup854(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup849(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -397,7 +397,7 @@ ::std::data::List::reversed::6 { x(_ x(w1 w1)) } ::std::data::Array::new { - fn(dup970(w6 w7) fn(w3 tup(w6 w9))) + fn(dup965(w6 w7) fn(w3 tup(w6 w9))) ::std::data::Array::Node::new = fn(w7 fn(w3 w9)) } @@ -407,10 +407,10 @@ ::std::data::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::data::Array::fold_front { fn(tup(dup1032(?(::std::data::Array::fold_front::4 ::std::data::Array::fold_front::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_front { fn(tup(dup1027(?(::std::data::Array::fold_front::4 ::std::data::Array::fold_front::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_front::3 { - x(dup1040(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup1035(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -419,10 +419,10 @@ ::std::data::Array::fold_front::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::data::Array::fold_back { fn(tup(dup1053(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_back { fn(tup(dup1048(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_back::3 { - x(dup1061(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup1056(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -431,25 +431,25 @@ ::std::data::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::data::Array::len { fn(ref(tup(dup1074(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup1069(w12 w9) w10) tup(w9 w10)) w12) } ::std::data::Array::get { - fn(ref(tup(dup1080(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup1075(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup1091(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup1086(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup1095(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup1090(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_back { fn(ref(tup(dup1101(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1101(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup1096(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1096(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -462,17 +462,17 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup1122(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup1117(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup1126(w1 @rem(2 w3))) + x(x(w10 w13) dup1121(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } ::std::data::Array::push_back::7 { x(x(w2 w2) _) } -::std::data::Array::push_front { fn(ref(tup(dup1130(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1130(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup1125(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup1125(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -485,7 +485,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup1151(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup1146(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -495,9 +495,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup1164(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup1159(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup1170(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup1165(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -512,13 +512,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup1181(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup1176(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup1187(@sub(1 @rem(2 dup1189(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup1188(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup1182(@sub(1 @rem(2 dup1184(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup1183(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -538,9 +538,9 @@ ::std::data::Array::pop_back::14 { x(w11 w11) } -::std::data::Array::pop_front { fn(ref(tup(dup1214(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup1209(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup1220(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup1215(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -555,12 +555,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup1231(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup1226(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup1238(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup1233(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -584,7 +584,7 @@ ::std::data::Array::Node::leaf { fn(x x) } -::std::data::Array::Node::new { fn(dup1273(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::data::Array::Node::new { fn(dup1268(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::data::Array::Node::new::3 { x(_ x(w3 w1)) @@ -592,7 +592,7 @@ } ::std::data::Array::Node::new::4 { - x(dup1281(@add(1 @div(2 w2)) @div(2 w6)) x(dup1282(w3 w7) tup(w4 w8))) + x(dup1276(@add(1 @div(2 w2)) @div(2 w6)) x(dup1277(w3 w7) tup(w4 w8))) ::std::data::Array::Node::new = fn(w2 fn(w3 w4)) ::std::data::Array::Node::new = fn(w6 fn(w7 w8)) } @@ -603,7 +603,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::zip_with { fn(dup1346(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::data::Array::Node::zip_with { fn(dup1341(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::data::Array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -613,7 +613,7 @@ } ::std::data::Array::Node::zip_with::4 { - x(dup1358(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1361(w13 w19) tup(w14 w20))))) + x(dup1353(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup1356(w13 w19) tup(w14 w20))))) ::std::data::Array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::data::Array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } @@ -626,7 +626,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2469(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2413(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -635,10 +635,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2479(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2423(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2482(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2426(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -646,7 +646,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2489(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2433(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -658,10 +658,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2500(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2444(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2509(dup2504(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2453(dup2448(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -680,7 +680,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::unicode::String::len { fn(ref(tup(dup3122(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup3070(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split_once { fn(w2 fn(w3 w15)) @@ -708,7 +708,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup3249(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup3197(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -717,7 +717,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup3263(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup3211(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -760,7 +760,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3439(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3391(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -774,11 +774,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3484(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3436(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3491(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3443(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -793,7 +793,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3508(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3460(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_19/compiled.iv b/tests/snaps/vine/aoc_2024/day_19/compiled.iv index caf53a0c..2a2a7a6c 100644 --- a/tests/snaps/vine/aoc_2024/day_19/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_19/compiled.iv @@ -90,9 +90,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup355(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup350(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup362(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup357(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -109,22 +109,22 @@ } ::std::data::Array::get { - fn(ref(tup(dup617(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup612(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup628(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup623(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup632(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup627(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_back { fn(ref(tup(dup638(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup638(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup633(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup633(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -137,19 +137,19 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup659(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup654(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup663(w1 @rem(2 w3))) + x(x(w10 w13) dup658(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } ::std::data::Array::push_back::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup701(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup696(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup707(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup702(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -164,13 +164,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup718(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup713(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup724(@sub(1 @rem(2 dup726(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup725(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup719(@sub(1 @rem(2 dup721(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup720(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -214,7 +214,7 @@ ::std::logical::Result::Err { fn(f0 enum(_ enum(enum(f0 r) r))) } -::std::numeric::N32::to_string { fn(dup2006(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1950(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -223,10 +223,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2016(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1960(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2019(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1963(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -243,19 +243,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2246(@div(w9 w10) @rem(w12 dup2247(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2249(w9 dup2249(w12 dup2249(w31 dup2249(w36 dup2249(w41 dup2249(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2245(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2190(@div(w9 w10) @rem(w12 dup2191(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2193(w9 dup2193(w12 dup2193(w31 dup2193(w36 dup2193(w41 dup2193(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2189(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2260(@div(w1 w2) @rem(w4 w6)) w6) x(dup2261(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2204(@div(w1 w2) @rem(w4 w6)) w6) x(dup2205(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2268(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2212(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2275(w2 w9) x(dup2277(w0 dup2277(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2281(w5 w11))) + x(x(w27 w33) x(dup2219(w2 w9) x(dup2221(w0 dup2221(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2225(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -270,7 +270,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } ::std::numeric::N64::to_string { - fn(dup2524(w6 w9) w8) + fn(dup2468(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -282,7 +282,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2534(w0 w7) w3) + x(dup2478(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -296,7 +296,7 @@ ::std::numeric::N64::to_string::5 = x(w2 x(w11 w20)) } -::std::unicode::String::len { fn(ref(tup(dup2659(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2607(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -304,7 +304,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2670(w1 w20) x(w12 w18))) + x(w14 x(dup2618(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -342,7 +342,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2786(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2734(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -351,7 +351,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2800(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2748(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -390,7 +390,7 @@ } ::std::unicode::String::strip_prefix::3 { - x(_ x(x(dup2852(w3 w0) w3) w1)) + x(_ x(x(dup2800(w3 w0) w3) w1)) ::std::logical::Result::Err = fn(w0 w1) } @@ -407,9 +407,9 @@ } ::std::unicode::String::strip_prefix::8 { - enum(ref(dup2871(w1 @ne(w18 ?(::std::unicode::String::strip_prefix::5 ::std::unicode::String::strip_prefix::11 x(w7 x(w9 w5))))) w1) x(w7 x(w6 w5))) + enum(ref(dup2819(w1 @ne(w18 ?(::std::unicode::String::strip_prefix::5 ::std::unicode::String::strip_prefix::11 x(w7 x(w9 w5))))) w1) x(w7 x(w6 w5))) ::std::data::List::Iter::next = fn(ref(w6 w9) w11) - ::std::logical::Option::unwrap = fn(w11 ref(dup2872(w13 w18) w13)) + ::std::logical::Option::unwrap = fn(w11 ref(dup2820(w13 w18) w13)) } ::std::unicode::String::strip_prefix::9 { @@ -435,7 +435,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2976(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2928(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -449,11 +449,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3021(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup2973(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3028(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup2980(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -468,7 +468,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3045(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup2997(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_20/compiled.iv b/tests/snaps/vine/aoc_2024/day_20/compiled.iv index 4e237018..b5ee1e27 100644 --- a/tests/snaps/vine/aoc_2024/day_20/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_20/compiled.iv @@ -170,7 +170,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup552(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup547(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -186,10 +186,10 @@ ::std::data::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::data::Array::from_fn { fn(dup695(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup696(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup690(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup691(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup702(w1 dup702(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup697(w1 dup697(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -199,22 +199,22 @@ ::std::data::Array::from_fn::4 { x(_ x(_ x(_ ::std::data::Array::empty))) } ::std::data::Array::get { - fn(ref(tup(dup778(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup773(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup789(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup784(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup793(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup788(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_front { fn(ref(tup(dup828(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup828(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup823(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup823(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -227,7 +227,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup849(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup844(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -237,9 +237,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup862(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup857(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup868(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup863(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -254,13 +254,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup879(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup874(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup885(@sub(1 @rem(2 dup887(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup886(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup880(@sub(1 @rem(2 dup882(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup881(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -292,7 +292,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::unzip_with { fn(dup1065(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup1060(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -302,7 +302,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup1077(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1079(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup1072(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup1074(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -315,7 +315,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2167(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2111(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -324,10 +324,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2177(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2121(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2180(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2124(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -335,7 +335,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::diff { fn(dup2266(@lt$(w8 ?(::std::numeric::N32::diff::4 ::std::numeric::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2267(w8 w11) w10)) } +::std::numeric::N32::diff { fn(dup2210(@lt$(w8 ?(::std::numeric::N32::diff::4 ::std::numeric::N32::diff::3 x(w12 x(w11 w10)))) w12) fn(dup2211(w8 w11) w10)) } ::std::numeric::N32::diff::3 { x(@sub(w4 w2) x(w4 w2)) } @@ -352,7 +352,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3137(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3089(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -366,11 +366,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3182(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3134(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3189(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3141(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -385,7 +385,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3206(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3158(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_21/compiled.iv b/tests/snaps/vine/aoc_2024/day_21/compiled.iv index b579533f..98c64e6f 100644 --- a/tests/snaps/vine/aoc_2024/day_21/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_21/compiled.iv @@ -370,9 +370,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup793(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup788(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup800(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup795(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -385,7 +385,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup829(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup824(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -395,20 +395,20 @@ ::std::data::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::logical::Option::None)) } ::std::data::Array::new { - fn(dup945(w6 w7) fn(w3 tup(w6 w9))) + fn(dup940(w6 w7) fn(w3 tup(w6 w9))) ::std::data::Array::Node::new = fn(w7 fn(w3 w9)) } ::std::data::Array::get { - fn(ref(tup(dup1055(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup1050(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup1066(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup1061(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup1070(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup1065(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } @@ -419,7 +419,7 @@ ::std::data::Array::Node::leaf { fn(x x) } -::std::data::Array::Node::new { fn(dup1248(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::data::Array::Node::new { fn(dup1243(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::data::Array::Node::new::3 { x(_ x(w3 w1)) @@ -427,7 +427,7 @@ } ::std::data::Array::Node::new::4 { - x(dup1256(@add(1 @div(2 w2)) @div(2 w6)) x(dup1257(w3 w7) tup(w4 w8))) + x(dup1251(@add(1 @div(2 w2)) @div(2 w6)) x(dup1252(w3 w7) tup(w4 w8))) ::std::data::Array::Node::new = fn(w2 fn(w3 w4)) ::std::data::Array::Node::new = fn(w6 fn(w7 w8)) } @@ -446,7 +446,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2444(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2388(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -455,10 +455,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2454(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2398(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2457(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2401(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -466,7 +466,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2464(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup2408(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -478,10 +478,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2475(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2419(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2484(dup2479(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2428(dup2423(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -500,7 +500,7 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::numeric::N32::min { fn(dup2523(@lt(w8 ?(::std::numeric::N32::min::4 ::std::numeric::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2524(w8 w11) w10)) } +::std::numeric::N32::min { fn(dup2467(@lt(w8 ?(::std::numeric::N32::min::4 ::std::numeric::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2468(w8 w11) w10)) } ::std::numeric::N32::min::3 { x(w3 x(_ w3)) } @@ -519,19 +519,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2684(@div(w9 w10) @rem(w12 dup2685(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2687(w9 dup2687(w12 dup2687(w31 dup2687(w36 dup2687(w41 dup2687(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2683(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2628(@div(w9 w10) @rem(w12 dup2629(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2631(w9 dup2631(w12 dup2631(w31 dup2631(w36 dup2631(w41 dup2631(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2627(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2698(@div(w1 w2) @rem(w4 w6)) w6) x(dup2699(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2642(@div(w1 w2) @rem(w4 w6)) w6) x(dup2643(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2706(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2650(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2713(w2 w9) x(dup2715(w0 dup2715(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2719(w5 w11))) + x(x(w27 w33) x(dup2657(w2 w9) x(dup2659(w0 dup2659(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2663(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -545,7 +545,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } -::std::numeric::N64::le { fn(tup(w2 dup2811(@lt(w12 ?(::std::numeric::N64::le::4 ::std::numeric::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2813(w12 w15)) w14)) } +::std::numeric::N64::le { fn(tup(w2 dup2755(@lt(w12 ?(::std::numeric::N64::le::4 ::std::numeric::N64::le::3 x(w2 x(w17 x(w5 x(w15 w14)))))) w17)) fn(tup(w5 dup2757(w12 w15)) w14)) } ::std::numeric::N64::le::3 { x(_ x(_ x(_ x(_ 1)))) } @@ -556,7 +556,7 @@ ::std::numeric::N64::le::6 { x(_ x(_ 0)) } ::std::numeric::N64::min { - fn(dup2876(w7 w12) fn(dup2877(w8 w11) w10)) + fn(dup2820(w7 w12) fn(dup2821(w8 w11) w10)) ::std::numeric::N64::le = fn(w7 fn(w8 ?(::std::numeric::N64::min::4 ::std::numeric::N64::min::3 x(w12 x(w11 w10))))) } @@ -565,7 +565,7 @@ ::std::numeric::N64::min::4 { x(_ x(w2 w2)) } ::std::numeric::N64::to_string { - fn(dup2962(w6 w9) w8) + fn(dup2906(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -577,7 +577,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2972(w0 w7) w3) + x(dup2916(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -591,7 +591,7 @@ ::std::numeric::N64::to_string::5 = x(w2 x(w11 w20)) } -::std::unicode::String::len { fn(ref(tup(dup3097(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup3045(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split_trim { fn(w2 fn(w3 w12)) @@ -599,9 +599,9 @@ } ::std::unicode::String::split_trim::2 { - x(w24 x(dup3133(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) + x(w24 x(dup3081(w1 w44) x(w22 x(w21 x(x(w20 w41) w39))))) ::std::unicode::String::split_once = fn(w24 fn(w1 tup(w3 enum(::std::unicode::String::split_trim::24 enum(::std::unicode::String::split_trim::25 x(w44 x(w33 x(w42 x(x(w36 w41) w39))))))))) - ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup3144(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup3137(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup3139(w20 w31)))))) + ::std::unicode::String::len = fn(ref(w3 w7) @eq(0 dup3092(?(::std::unicode::String::split_trim::5 ::std::unicode::String::split_trim::4 x(w21 dup3085(?(::std::unicode::String::split_trim::11 ::std::unicode::String::split_trim::10 x(x(w22 w33) x(w31 x(w7 _)))) w42))) ?(::std::unicode::String::split_trim::17 ::std::unicode::String::split_trim::16 x(w36 dup3087(w20 w31)))))) } ::std::unicode::String::split_trim::4 { x(?(0 1 w3) w3) } @@ -656,7 +656,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup3224(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup3172(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -665,7 +665,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup3238(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup3186(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -702,10 +702,10 @@ ::std::unicode::String::repeat::2 = x(w2 x(w3 x(tup(0 tup(w9 w9)) w11))) } -::std::unicode::String::repeat::2 { x(w4 x(dup3387(?(::std::unicode::String::repeat::4 ::std::unicode::String::repeat::3 x(w4 x(w7 w2))) w7) w2)) } +::std::unicode::String::repeat::2 { x(w4 x(dup3335(?(::std::unicode::String::repeat::4 ::std::unicode::String::repeat::3 x(w4 x(w7 w2))) w7) w2)) } ::std::unicode::String::repeat::3 { - x(dup3390(w0 w12) x(@sub(1 w4) x(w6 w10))) + x(dup3338(w0 w12) x(@sub(1 w4) x(w6 w10))) ::std::data::List::concat = fn(w6 fn(w0 w2)) ::std::unicode::String::repeat::2 = x(w12 x(w4 x(w2 w10))) } @@ -723,7 +723,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3414(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3366(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -742,7 +742,7 @@ ::std::IO::full_input::2 { x(x(w9 w16) x(w7 w12)) - ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3508(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) + ::std::IO::read_byte = fn(ref(w9 w1) fn(0 dup3460(@ne(0 ?(::std::IO::full_input::5 ::std::IO::full_input::4 x(x(w1 w16) x(w7 x(w13 w12))))) w13))) } ::std::IO::full_input::4 { diff --git a/tests/snaps/vine/aoc_2024/day_22/compiled.iv b/tests/snaps/vine/aoc_2024/day_22/compiled.iv index e62ebd1b..052356b1 100644 --- a/tests/snaps/vine/aoc_2024/day_22/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_22/compiled.iv @@ -98,10 +98,10 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } -::std::data::Map::len { fn(ref(tup(w2 tup(dup985(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } +::std::data::Map::len { fn(ref(tup(w2 tup(dup980(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } ::std::data::Map::get_or_insert { - fn(ref(tup(dup997(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup992(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::data::Map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::logical::Option::unwrap_or = fn(w20 fn(w10 w24)) } @@ -133,7 +133,7 @@ ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1235(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1179(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -141,10 +141,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1248(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1192(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1263(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1207(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -216,16 +216,16 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup1837(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1838(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup1781(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1782(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup1842(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1843(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup1786(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1787(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup1847(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1848(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup1791(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1792(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -241,7 +241,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2035(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1979(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -250,10 +250,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2045(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1989(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2048(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1992(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -261,7 +261,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2055(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup1999(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -273,10 +273,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2066(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup2010(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2075(dup2070(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup2019(dup2014(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -295,13 +295,13 @@ ::std::numeric::N32::parse::11 { x(w10 w10) } -::std::numeric::N32::cmp { fn(ref(dup2102(w2 dup2102(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2103(w5 dup2103(w12 w15)) w5) w14)) } +::std::numeric::N32::cmp { fn(ref(dup2046(w2 dup2046(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2047(w5 dup2047(w12 w15)) w5) w14)) } ::std::numeric::N32::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } ::std::numeric::N32::cmp::4 { x(@lt$(w4 ?(::std::data::Map::Ord::Eq ::std::data::Map::Ord::Gt w6)) x(w4 w6)) } -::std::numeric::N32::max { fn(dup2124(@lt$(w8 ?(::std::numeric::N32::max::4 ::std::numeric::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2125(w8 w11) w10)) } +::std::numeric::N32::max { fn(dup2068(@lt$(w8 ?(::std::numeric::N32::max::4 ::std::numeric::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2069(w8 w11) w10)) } ::std::numeric::N32::max::3 { x(w3 x(_ w3)) } @@ -316,19 +316,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2275(@div(w9 w10) @rem(w12 dup2276(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2278(w9 dup2278(w12 dup2278(w31 dup2278(w36 dup2278(w41 dup2278(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2274(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2219(@div(w9 w10) @rem(w12 dup2220(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2222(w9 dup2222(w12 dup2222(w31 dup2222(w36 dup2222(w41 dup2222(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2218(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2289(@div(w1 w2) @rem(w4 w6)) w6) x(dup2290(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2233(@div(w1 w2) @rem(w4 w6)) w6) x(dup2234(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2297(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2241(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2304(w2 w9) x(dup2306(w0 dup2306(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2310(w5 w11))) + x(x(w27 w33) x(dup2248(w2 w9) x(dup2250(w0 dup2250(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2254(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -343,7 +343,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } ::std::numeric::N64::to_string { - fn(dup2553(w6 w9) w8) + fn(dup2497(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -355,7 +355,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2563(w0 w7) w3) + x(dup2507(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -380,7 +380,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3005(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2957(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -394,11 +394,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3050(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3002(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3057(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3009(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -413,7 +413,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3074(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3026(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_23/compiled.iv b/tests/snaps/vine/aoc_2024/day_23/compiled.iv index 89987d90..38829b92 100644 --- a/tests/snaps/vine/aoc_2024/day_23/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_23/compiled.iv @@ -274,7 +274,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup610(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup605(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -292,23 +292,23 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } ::std::data::Map::insert { - fn(ref(tup(dup1179(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1174(w2 w16) w5) tup(w2 w14)) w9) ::std::data::Map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::data::Map::get_or_insert { - fn(ref(tup(dup1187(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1182(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::data::Map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::logical::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::data::Map::get { - fn(ref(tup(dup1200(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1195(w2 w17) w5) tup(w2 w15)) w10) ::std::data::Map::Node::get = fn(ref(w5 w15) fn(w17 w10)) } ::std::data::Map::remove_min { - fn(ref(tup(dup1232(w2 w19) w5) tup(w2 w18)) w16) + fn(ref(tup(dup1227(w2 w19) w5) tup(w2 w18)) w16) ::std::data::Map::Node::size = fn(ref(w5 w13) ?(::std::data::Map::remove_min::4 ::std::data::Map::remove_min::3 x(w19 x(x(w13 w18) w16)))) } @@ -327,7 +327,7 @@ ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1425(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1369(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -335,10 +335,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1438(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1382(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1453(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1397(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -363,10 +363,10 @@ ::std::data::Map::balance_left = fn(ref(w26 w31) _) } -::std::data::Map::Node::get { fn(ref(tup(dup1514(w2 ?(::std::data::Map::Node::get::4 ::std::data::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::data::Map::Node::get { fn(ref(tup(dup1458(w2 ?(::std::data::Map::Node::get::4 ::std::data::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::data::Map::Node::get::3 { - x(x(w22 w1) x(dup1526(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::data::Map::Node::get::9 enum(::std::data::Map::Node::get::10 enum(::std::data::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(dup1470(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::data::Map::Node::get::9 enum(::std::data::Map::Node::get::10 enum(::std::data::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))) } @@ -460,16 +460,16 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup2027(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup2028(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup1971(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1972(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup2032(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup2033(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup1976(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1977(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup2037(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup2038(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup1981(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1982(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -485,7 +485,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2225(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2169(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -494,10 +494,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2235(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2179(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2238(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2182(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -505,7 +505,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::cmp { fn(ref(dup2292(w2 dup2292(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2293(w5 dup2293(w12 w15)) w5) w14)) } +::std::numeric::N32::cmp { fn(ref(dup2236(w2 dup2236(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2237(w5 dup2237(w12 w15)) w5) w14)) } ::std::numeric::N32::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } @@ -522,7 +522,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3195(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3147(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -536,11 +536,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3240(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3192(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3247(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3199(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -555,7 +555,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3264(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3216(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_24/compiled.iv b/tests/snaps/vine/aoc_2024/day_24/compiled.iv index 08d89c16..a5109002 100644 --- a/tests/snaps/vine/aoc_2024/day_24/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_24/compiled.iv @@ -124,9 +124,9 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::data::List::iter { fn(ref(tup(dup396(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup391(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup403(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup398(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -159,7 +159,7 @@ ::std::data::List::cmp::16 { enum(w0 x(w8 x(w7 x(w5 x(w10 enum(::std::data::List::cmp::17 enum(::std::data::List::cmp::18 x(w8 x(w7 x(w5 x(w10 w0))))))))))) } -::std::data::List::cmp::17 { enum(w0 x(dup521(fn(w0 fn(w3 enum(::std::data::List::cmp::13 enum(::std::data::List::cmp::3 enum(::std::data::List::cmp::15 x(w21 x(w8 x(w6 w16)))))))) w21) x(w8 x(w6 x(w16 w3))))) } +::std::data::List::cmp::17 { enum(w0 x(dup516(fn(w0 fn(w3 enum(::std::data::List::cmp::13 enum(::std::data::List::cmp::3 enum(::std::data::List::cmp::15 x(w21 x(w8 x(w6 w16)))))))) w21) x(w8 x(w6 x(w16 w3))))) } ::std::data::List::cmp::18 { x(_ x(x(w5 w5) x(x(w3 w3) x(::std::data::Map::Ord::Lt _)))) } @@ -176,24 +176,24 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } ::std::data::Map::insert { - fn(ref(tup(dup1001(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup996(w2 w16) w5) tup(w2 w14)) w9) ::std::data::Map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::data::Map::get_or_insert { - fn(ref(tup(dup1009(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) + fn(ref(tup(dup1004(w2 w17) w5) tup(w2 w15)) fn(w9 fn(w10 ref(w24 w27)))) ::std::data::Map::Node::insert = fn(ref(w5 w15) fn(w17 fn(w9 fn(w27 w20)))) ::std::logical::Option::unwrap_or = fn(w20 fn(w10 w24)) } ::std::data::Map::get { - fn(ref(tup(dup1022(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1017(w2 w17) w5) tup(w2 w15)) w10) ::std::data::Map::Node::get = fn(ref(w5 w15) fn(w17 w10)) } ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1247(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1191(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -201,10 +201,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1260(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1204(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1275(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1219(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -229,10 +229,10 @@ ::std::data::Map::balance_left = fn(ref(w26 w31) _) } -::std::data::Map::Node::get { fn(ref(tup(dup1336(w2 ?(::std::data::Map::Node::get::4 ::std::data::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::data::Map::Node::get { fn(ref(tup(dup1280(w2 ?(::std::data::Map::Node::get::4 ::std::data::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::data::Map::Node::get::3 { - x(x(w22 w1) x(dup1348(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::data::Map::Node::get::9 enum(::std::data::Map::Node::get::10 enum(::std::data::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(dup1292(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::data::Map::Node::get::9 enum(::std::data::Map::Node::get::10 enum(::std::data::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))) } @@ -300,16 +300,16 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup1849(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1850(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup1793(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1794(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup1854(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1855(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup1798(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1799(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup1859(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1860(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup1803(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1804(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } @@ -332,19 +332,19 @@ ::std::numeric::N64::mul_n32_n32 { fn(dup(@mul(b0 l) @n32_mul_high(b1 h)) fn(dup(b0 b1) tup(l h))) } ::std::numeric::N64::div_rem_n32 { - fn(tup(w2 dup2287(@div(w9 w10) @rem(w12 dup2288(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2290(w9 dup2290(w12 dup2290(w31 dup2290(w36 dup2290(w41 dup2290(w18 w22)))))) tup(tup(w21 w35) w24))) - ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2286(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) + fn(tup(w2 dup2231(@div(w9 w10) @rem(w12 dup2232(@lt$(w31 ?(::std::numeric::N64::div_rem_n32::4 ::std::numeric::N64::div_rem_n32::3 x(x(w37 w38) x(w36 x(x(w10 w35) _))))) w37)))) fn(dup2234(w9 dup2234(w12 dup2234(w31 dup2234(w36 dup2234(w41 dup2234(w18 w22)))))) tup(tup(w21 w35) w24))) + ::std::numeric::N64::div_rem_n32::5 = x(x(w2 dup2230(@div(w18 w19) @rem(w22 w24))) x(w38 x(w41 x(0 @add(w19 w21))))) } -::std::numeric::N64::div_rem_n32::3 { x(x(dup2301(@div(w1 w2) @rem(w4 w6)) w6) x(dup2302(w1 w4) x(x(_ w2) _))) } +::std::numeric::N64::div_rem_n32::3 { x(x(dup2245(@div(w1 w2) @rem(w4 w6)) w6) x(dup2246(w1 w4) x(x(_ w2) _))) } ::std::numeric::N64::div_rem_n32::4 { x(x(w5 w5) x(_ x(x(w2 w2) _))) } -::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2309(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } +::std::numeric::N64::div_rem_n32::5 { x(w6 x(dup2253(?(::std::numeric::N64::div_rem_n32::7 ::std::numeric::N64::div_rem_n32::6 x(w6 x(w10 w3))) w10) w3)) } ::std::numeric::N64::div_rem_n32::6 { - x(x(w27 w33) x(dup2316(w2 w9) x(dup2318(w0 dup2318(w12 w30)) x(@add(w5 w7) w29)))) - 4294967295 = @div(w0 @mul(w2 dup2322(w5 w11))) + x(x(w27 w33) x(dup2260(w2 w9) x(dup2262(w0 dup2262(w12 w30)) x(@add(w5 w7) w29)))) + 4294967295 = @div(w0 @mul(w2 dup2266(w5 w11))) ::std::numeric::N64::mul_n32_n32 = fn(w11 fn(w12 w13)) ::std::numeric::N64::sub = fn(tup(w27 w9) fn(w13 tup(w15 w16))) ::std::numeric::N64::div_rem_n32::5 = x(x(w15 w33) x(w16 x(w30 x(w7 w29)))) @@ -354,11 +354,11 @@ ::std::numeric::N64::or { fn(tup(@n32_or(w5 w12) @n32_or(w6 w15)) fn(tup(w5 w6) tup(w12 w15))) } -::std::numeric::N64::shl { fn(tup(w2 w3) fn(dup2350(@n32_and(32 ?(::std::numeric::N64::shl::4 ::std::numeric::N64::shl::3 x(w2 x(w3 x(w12 w11))))) w12) w11)) } +::std::numeric::N64::shl { fn(tup(w2 w3) fn(dup2294(@n32_and(32 ?(::std::numeric::N64::shl::4 ::std::numeric::N64::shl::3 x(w2 x(w3 x(w12 w11))))) w12) w11)) } ::std::numeric::N64::shl::3 { x(@n32_shl(w5 w2) x(_ x(w5 tup(0 w2)))) } -::std::numeric::N64::shl::4 { x(dup2358(@n32_shl(w1 w2) @n32_shr(w8 w9)) x(@n32_shl(w4 @n32_or(w9 w10)) x(dup2360(w1 dup2360(w4 @sub$(0 w8))) tup(w2 w10)))) } +::std::numeric::N64::shl::4 { x(dup2302(@n32_shl(w1 w2) @n32_shr(w8 w9)) x(@n32_shl(w4 @n32_or(w9 w10)) x(dup2304(w1 dup2304(w4 @sub$(0 w8))) tup(w2 w10)))) } ::std::numeric::N64::eq { fn(tup(@eq(w5 ?(::std::numeric::N64::eq::4 ::std::numeric::N64::eq::3 x(w3 x(w6 w14)))) w3) fn(tup(w5 w6) w14)) } @@ -367,7 +367,7 @@ ::std::numeric::N64::eq::4 { x(_ x(_ 0)) } ::std::numeric::N64::to_string { - fn(dup2565(w6 w9) w8) + fn(dup2509(w6 w9) w8) ::std::numeric::N64::eq = fn(w6 fn(0 ?(::std::numeric::N64::to_string::4 ::std::numeric::N64::to_string::3 x(w9 w8)))) } @@ -379,7 +379,7 @@ } ::std::numeric::N64::to_string::5 { - x(dup2575(w0 w7) w3) + x(dup2519(w0 w7) w3) ::std::numeric::N64::eq = fn(w0 fn(0 ?(::std::numeric::N64::to_string::7 ::std::numeric::N64::to_string::6 x(w7 w3)))) } @@ -393,13 +393,13 @@ ::std::numeric::N64::to_string::5 = x(w2 x(w11 w20)) } -::std::unicode::Char::cmp { fn(ref(dup2688(w2 dup2688(@lt(w12 ?(::std::unicode::Char::cmp::4 ::std::unicode::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2689(w5 dup2689(w12 w15)) w5) w14)) } +::std::unicode::Char::cmp { fn(ref(dup2632(w2 dup2632(@lt(w12 ?(::std::unicode::Char::cmp::4 ::std::unicode::Char::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2633(w5 dup2633(w12 w15)) w5) w14)) } ::std::unicode::Char::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } ::std::unicode::Char::cmp::4 { x(@lt$(w4 ?(::std::data::Map::Ord::Eq ::std::data::Map::Ord::Gt w6)) x(w4 w6)) } -::std::unicode::String::len { fn(ref(tup(dup2700(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2648(w2 w15) w4) tup(w2 w4)) w15) } ::std::unicode::String::split { fn(w2 fn(w3 w10)) @@ -407,7 +407,7 @@ } ::std::unicode::String::split::2 { - x(w14 x(dup2711(w1 w20) x(w12 w18))) + x(w14 x(dup2659(w1 w20) x(w12 w18))) ::std::unicode::String::split_once = fn(w14 fn(w1 tup(w3 enum(::std::unicode::String::split::6 enum(::std::unicode::String::split::7 x(w20 x(w9 w18))))))) ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(w3 w15) w15)) w9)) } @@ -445,7 +445,7 @@ } ::std::unicode::String::split_once::9 { - enum(ref(dup2827(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) + enum(ref(dup2775(w1 w16) w1) x(w9 x(w8 x(w7 x(w6 x(w5 w15)))))) ::std::data::List::Iter::next = fn(ref(w5 w11) enum(::std::unicode::String::split_once::13 enum(::std::unicode::String::split_once::14 x(w9 x(w8 x(w7 x(w6 x(w11 x(w16 w15))))))))) } @@ -454,7 +454,7 @@ ::std::unicode::String::split_once::15 = x(w4 x(w3 w1)) } -::std::unicode::String::split_once::13 { enum(ref(dup2841(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } +::std::unicode::String::split_once::13 { enum(ref(dup2789(w1 w13) w1) x(w10 x(w9 x(w8 x(w7 x(w6 x(@ne(w13 ?(::std::unicode::String::split_once::6 ::std::unicode::String::split_once::17 x(w10 x(w9 x(w8 x(w7 x(w6 w15))))))) w15))))))) } ::std::unicode::String::split_once::14 { x(_ x(w5 x(w4 x(_ x(w2 x(_ w7)))))) @@ -502,7 +502,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3017(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2969(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -516,11 +516,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3062(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3014(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3069(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3021(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -535,7 +535,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3086(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3038(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/aoc_2024/day_25/compiled.iv b/tests/snaps/vine/aoc_2024/day_25/compiled.iv index 5f638ba2..59dd3042 100644 --- a/tests/snaps/vine/aoc_2024/day_25/compiled.iv +++ b/tests/snaps/vine/aoc_2024/day_25/compiled.iv @@ -175,7 +175,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup460(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup455(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -188,7 +188,7 @@ ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup2075(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2019(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -197,10 +197,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2085(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2029(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2088(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2032(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -208,7 +208,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::unicode::String::len { fn(ref(tup(dup2728(w2 w15) w4) tup(w2 w4)) w15) } +::std::unicode::String::len { fn(ref(tup(dup2676(w2 w15) w4) tup(w2 w4)) w15) } ::std::IO::println { fn(ref(w3 w14) fn(w5 _)) @@ -221,7 +221,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3045(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2997(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -235,11 +235,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3090(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3042(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3097(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup3049(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -254,7 +254,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3114(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3066(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/array_from_list/compiled.iv b/tests/snaps/vine/array_from_list/compiled.iv index 5946a2d9..58fa1af1 100644 --- a/tests/snaps/vine/array_from_list/compiled.iv +++ b/tests/snaps/vine/array_from_list/compiled.iv @@ -39,10 +39,10 @@ ::std::data::Array::from_fn = fn(w2 fn(ref(w3 _) fn(fn(ref(tup(w19 w20) w20) w19) w12))) } -::std::data::Array::from_fn { fn(dup444(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup445(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup439(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup440(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup451(w1 dup451(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup446(w1 dup446(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -51,9 +51,9 @@ ::std::data::Array::from_fn::4 { x(_ x(_ x(_ ::std::data::Array::empty))) } -::std::data::Array::len { fn(ref(tup(dup521(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup516(w12 w9) w10) tup(w9 w10)) w12) } -::std::data::Array::push_front { fn(ref(tup(dup577(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup577(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup572(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup572(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -66,7 +66,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup598(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup593(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -76,9 +76,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup611(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup606(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup617(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup612(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -93,13 +93,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup628(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup623(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup634(@sub(1 @rem(2 dup636(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup635(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup629(@sub(1 @rem(2 dup631(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup630(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -129,7 +129,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::unzip_with { fn(dup814(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup809(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -139,7 +139,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup826(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup828(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup821(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup823(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -152,7 +152,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup1916(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1860(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -161,10 +161,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1926(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1870(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1929(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1873(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -183,7 +183,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2886(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2838(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/array_order/compiled.iv b/tests/snaps/vine/array_order/compiled.iv index 8a9d3de8..2913aeb0 100644 --- a/tests/snaps/vine/array_order/compiled.iv +++ b/tests/snaps/vine/array_order/compiled.iv @@ -16,10 +16,10 @@ ::std::data::Array::empty { tup(0 _) } -::std::data::Array::from_fn { fn(dup456(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup457(w3 w13) w3) fn(w6 w11))) } +::std::data::Array::from_fn { fn(dup451(?(::std::data::Array::from_fn::4 ::std::data::Array::from_fn::3 x(w14 x(w13 x(w6 w11)))) w14) fn(ref(dup452(w3 w13) w3) fn(w6 w11))) } ::std::data::Array::from_fn::3 { - x(dup463(w1 dup463(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) + x(dup458(w1 dup458(w9 w29)) x(w34 x(fn(ref(w36 w41) w43) tup(w29 w6)))) ::std::data::Array::Node::unzip_with = fn(w1 fn(w25 fn(fn(w36 tup(w43 w41)) tup(w6 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w9 w7) w14) w16) ::std::logical::Option::unwrap = fn(w16 _) @@ -33,10 +33,10 @@ ::std::data::Array::fold_front = fn(w2 fn(w4 fn(fn(w14 fn(w15 w20)) w12))) } -::std::data::Array::fold_front { fn(tup(dup491(?(::std::data::Array::fold_front::4 ::std::data::Array::fold_front::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_front { fn(tup(dup486(?(::std::data::Array::fold_front::4 ::std::data::Array::fold_front::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_front::3 { - x(dup499(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup494(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_back = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -46,22 +46,22 @@ ::std::data::Array::fold_front::4 { x(_ x(_ x(w3 x(_ w3)))) } ::std::data::Array::get { - fn(ref(tup(dup539(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup534(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup550(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup545(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup554(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup549(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::push_front { fn(ref(tup(dup589(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup589(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_front { fn(ref(tup(dup584(?(::std::data::Array::push_front::4 ::std::data::Array::push_front::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup584(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_front::3 { x(w14 x(w13 x(w12 _))) @@ -74,7 +74,7 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_front::5 { x(w4 dup610(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } +::std::data::Array::push_front::5 { x(w4 dup605(@lt$(1 ?(::std::data::Array::push_front::7 ::std::data::Array::push_front::6 x(w4 w5))) w5)) } ::std::data::Array::push_front::6 { x(x(ref(tup(w2 w4) tup(w15 w12)) w26) @div(2 w19)) @@ -84,9 +84,9 @@ ::std::data::Array::push_front::7 { x(x(w2 w2) _) } -::std::data::Array::pop_back { fn(ref(tup(dup623(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_back { fn(ref(tup(dup618(?(::std::data::Array::pop_back::4 ::std::data::Array::pop_back::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_back::3 { x(x(dup629(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_back::3 { x(x(dup624(@eq(1 ?(::std::data::Array::pop_back::6 ::std::data::Array::pop_back::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_back::4 { x(x(w3 w3) x(_ w5)) @@ -101,13 +101,13 @@ } ::std::data::Array::pop_back::6 { - x(x(dup640(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup635(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_back::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_back::7 { - x(ref(w6 w25) x(dup646(@sub(1 @rem(2 dup648(w12 w26))) w11) w23)) - ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup647(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) + x(ref(w6 w25) x(dup641(@sub(1 @rem(2 dup643(w12 w26))) w11) w23)) + ::std::data::Array::Node::half = fn(ref(w6 w9) fn(w11 fn(w12 tup(w14 dup642(@eq(1 ?(::std::data::Array::pop_back::10 ::std::data::Array::pop_back::9 x(w14 x(w27 x(w26 x(x(w9 w25) w23)))))) w27))))) } ::std::data::Array::pop_back::9 { @@ -139,7 +139,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::zip_with { fn(dup805(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::data::Array::Node::zip_with { fn(dup800(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::data::Array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -149,12 +149,12 @@ } ::std::data::Array::Node::zip_with::4 { - x(dup817(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup820(w13 w19) tup(w14 w20))))) + x(dup812(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup815(w13 w19) tup(w14 w20))))) ::std::data::Array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::data::Array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } -::std::data::Array::Node::unzip_with { fn(dup826(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } +::std::data::Array::Node::unzip_with { fn(dup821(@eq(1 ?(::std::data::Array::Node::unzip_with::4 ::std::data::Array::Node::unzip_with::3 x(w13 x(w3 x(w4 w10))))) w13) fn(w3 fn(w4 w10))) } ::std::data::Array::Node::unzip_with::3 { x(_ x(w14 x(fn(w2 tup(w4 w5)) tup(w8 w10)))) @@ -164,7 +164,7 @@ } ::std::data::Array::Node::unzip_with::4 { - x(dup838(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup840(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) + x(dup833(@add(1 @div(2 w6)) @div(2 w14)) x(tup(w1 w2) x(dup835(w8 w16) tup(tup(w10 w18) tup(w11 w19))))) ::std::data::Array::Node::unzip_with = fn(w6 fn(w1 fn(w8 tup(w10 w11)))) ::std::data::Array::Node::unzip_with = fn(w14 fn(w2 fn(w16 tup(w18 w19)))) } @@ -177,7 +177,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup1928(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1872(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -186,10 +186,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1938(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1882(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1941(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1885(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -208,7 +208,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2898(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2850(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/array_to_list/compiled.iv b/tests/snaps/vine/array_to_list/compiled.iv index 92d2f53b..256456d0 100644 --- a/tests/snaps/vine/array_to_list/compiled.iv +++ b/tests/snaps/vine/array_to_list/compiled.iv @@ -15,7 +15,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } ::std::data::Array::new { - fn(dup417(w6 w7) fn(w3 tup(w6 w9))) + fn(dup412(w6 w7) fn(w3 tup(w6 w9))) ::std::data::Array::Node::new = fn(w7 fn(w3 w9)) } @@ -25,10 +25,10 @@ ::std::data::Array::fold_back = fn(w7 fn(w12 fn(fn(w17 fn(w18 tup(w18 w17))) w14))) } -::std::data::Array::fold_back { fn(tup(dup500(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } +::std::data::Array::fold_back { fn(tup(dup495(?(::std::data::Array::fold_back::4 ::std::data::Array::fold_back::3 x(w15 x(w3 x(w5 x(w6 w11))))) w15) w3) fn(w5 fn(w6 w11))) } ::std::data::Array::fold_back::3 { - x(dup508(w1 w2) x(w30 x(w29 x(w28 w14)))) + x(dup503(w1 w2) x(w30 x(w29 x(w28 w14)))) ::std::data::Array::Node::zip_with = fn(w2 fn(w22 fn(w30 fn(w28 w7)))) ::std::data::Array::pop_front = fn(ref(tup(w1 w7) w11) w13) ::std::logical::Option::unwrap = fn(w13 w14) @@ -37,9 +37,9 @@ ::std::data::Array::fold_back::4 { x(_ x(_ x(w3 x(_ w3)))) } -::std::data::Array::len { fn(ref(tup(dup521(w12 w9) w10) tup(w9 w10)) w12) } +::std::data::Array::len { fn(ref(tup(dup516(w12 w9) w10) tup(w9 w10)) w12) } -::std::data::Array::push_back { fn(ref(tup(dup548(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup548(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } +::std::data::Array::push_back { fn(ref(tup(dup543(?(::std::data::Array::push_back::4 ::std::data::Array::push_back::3 x(w20 x(ref(w5 w6) x(w10 _)))) dup543(w20 @add(1 w15))) w5) tup(w15 w6)) fn(w10 _)) } ::std::data::Array::push_back::3 { x(w14 x(w13 x(w12 _))) @@ -52,19 +52,19 @@ ::std::data::Array::Node::leaf = fn(w8 w5) } -::std::data::Array::push_back::5 { x(w4 dup569(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } +::std::data::Array::push_back::5 { x(w4 dup564(@lt$(1 ?(::std::data::Array::push_back::7 ::std::data::Array::push_back::6 x(w4 w5))) w5)) } ::std::data::Array::push_back::6 { - x(x(w10 w13) dup573(w1 @rem(2 w3))) + x(x(w10 w13) dup568(w1 @rem(2 w3))) ::std::data::Array::Node::half = fn(w10 fn(w1 fn(w3 tup(w5 w6)))) ::std::data::Array::push_back::5 = x(x(w5 w13) w6) } ::std::data::Array::push_back::7 { x(x(w2 w2) _) } -::std::data::Array::pop_front { fn(ref(tup(dup661(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup656(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup667(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup662(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -79,12 +79,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup678(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup673(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup685(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup680(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -106,7 +106,7 @@ ::std::data::Array::Node::leaf { fn(x x) } -::std::data::Array::Node::new { fn(dup720(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::data::Array::Node::new { fn(dup715(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::data::Array::Node::new::3 { x(_ x(w3 w1)) @@ -114,7 +114,7 @@ } ::std::data::Array::Node::new::4 { - x(dup728(@add(1 @div(2 w2)) @div(2 w6)) x(dup729(w3 w7) tup(w4 w8))) + x(dup723(@add(1 @div(2 w2)) @div(2 w6)) x(dup724(w3 w7) tup(w4 w8))) ::std::data::Array::Node::new = fn(w2 fn(w3 w4)) ::std::data::Array::Node::new = fn(w6 fn(w7 w8)) } @@ -125,7 +125,7 @@ ::std::data::Array::Node::half::4 { x(x(w12 w1) x(x(w10 w10) x(@add(1 @div(2 w5)) tup(ref(w12 w1) w5)))) } -::std::data::Array::Node::zip_with { fn(dup793(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } +::std::data::Array::Node::zip_with { fn(dup788(@eq(1 ?(::std::data::Array::Node::zip_with::4 ::std::data::Array::Node::zip_with::3 x(w15 x(w3 x(w4 x(w5 w11)))))) w15) fn(w3 fn(w4 fn(w5 w11)))) } ::std::data::Array::Node::zip_with::3 { x(_ x(w10 x(w9 x(fn(w2 fn(w4 w5)) w6)))) @@ -135,7 +135,7 @@ } ::std::data::Array::Node::zip_with::4 { - x(dup805(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup808(w13 w19) tup(w14 w20))))) + x(dup800(@add(1 @div(2 w10)) @div(2 w16)) x(tup(w1 w2) x(tup(w5 w6) x(dup803(w13 w19) tup(w14 w20))))) ::std::data::Array::Node::zip_with = fn(w10 fn(w1 fn(w5 fn(w13 w14)))) ::std::data::Array::Node::zip_with = fn(w16 fn(w2 fn(w6 fn(w19 w20)))) } @@ -148,7 +148,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup1916(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1860(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -157,10 +157,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1926(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1870(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1929(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1873(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -179,7 +179,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2886(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2838(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/basic_diverge/compiled.iv b/tests/snaps/vine/basic_diverge/compiled.iv index 92a17256..96193633 100644 --- a/tests/snaps/vine/basic_diverge/compiled.iv +++ b/tests/snaps/vine/basic_diverge/compiled.iv @@ -22,7 +22,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1932(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1876(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -31,10 +31,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1942(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1886(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1945(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1889(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -53,7 +53,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2902(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2854(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/break_result/compiled.iv b/tests/snaps/vine/break_result/compiled.iv index 68dfb662..7c006626 100644 --- a/tests/snaps/vine/break_result/compiled.iv +++ b/tests/snaps/vine/break_result/compiled.iv @@ -17,7 +17,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2885(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2837(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::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 f9d006a2..531fcd3f 100644 --- a/tests/snaps/vine/cat/compiled.iv +++ b/tests/snaps/vine/cat/compiled.iv @@ -36,7 +36,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2894(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2846(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -50,11 +50,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup2939(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup2891(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup2946(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup2898(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -69,7 +69,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup2963(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup2915(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/classify_primes/compiled.iv b/tests/snaps/vine/classify_primes/compiled.iv index c140ebb2..a4b4d13c 100644 --- a/tests/snaps/vine/classify_primes/compiled.iv +++ b/tests/snaps/vine/classify_primes/compiled.iv @@ -35,7 +35,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1940(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1884(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -44,10 +44,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1950(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1894(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1953(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1897(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -66,7 +66,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2910(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2862(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/cond_diverge/compiled.iv b/tests/snaps/vine/cond_diverge/compiled.iv index 3a3f39f5..13c08d86 100644 --- a/tests/snaps/vine/cond_diverge/compiled.iv +++ b/tests/snaps/vine/cond_diverge/compiled.iv @@ -49,7 +49,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2916(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2868(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/cyclist/compiled.iv b/tests/snaps/vine/cyclist/compiled.iv index a188e55b..c2937283 100644 --- a/tests/snaps/vine/cyclist/compiled.iv +++ b/tests/snaps/vine/cyclist/compiled.iv @@ -32,7 +32,7 @@ ::cyclist::cycle = fn(ref(w2 dup28(w17 w22)) fn(w8 _)) ::std::numeric::N32::to_string = fn(w13 w14) ::std::data::List::concat = fn(w14 fn(tup(2 tup(tup(59 tup(9 w21)) w21)) w16)) - ::std::data::List::to_string = fn(w17 fn(::std::numeric::N32::to_string w18)) + ::std::data::List::to_string::0 = fn(w17 w18) ::std::data::List::concat = fn(w16 fn(w18 w19)) ::std::IO::println = fn(ref(w4 w11) fn(w19 _)) ::cyclist::main::6 = x(x(w11 w24) w22) @@ -123,17 +123,17 @@ ::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::data::List::to_string { - fn(w2 fn(w3 w14)) - ::std::data::List::map = fn(w2 fn(w3 w9)) - ::std::data::List::join = fn(w9 fn(tup(2 tup(tup(44 tup(32 w16)) w16)) w11)) - ::std::data::List::concat = fn(tup(1 tup(tup(91 w15) w15)) fn(w11 w12)) - ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(93 w17) w17)) w14)) +::std::data::List::to_string::0 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::numeric::N32::to_string w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) } ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup352(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup351(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -150,7 +150,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup1967(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1915(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -159,10 +159,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1977(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1925(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1980(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1928(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -181,7 +181,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2937(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2893(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/cyclist/stats.txt b/tests/snaps/vine/cyclist/stats.txt index b913b03e..87960de6 100644 --- a/tests/snaps/vine/cyclist/stats.txt +++ b/tests/snaps/vine/cyclist/stats.txt @@ -1,7 +1,7 @@ Interactions - Total 117_506 - Annihilate 61_335 + Total 117_474 + Annihilate 61_303 Commute 2_523 Copy 9_368 Erase 9_721 @@ -11,5 +11,5 @@ Interactions Memory Heap 7_408 B - Allocated 2_453_216 B - Freed 2_453_216 B + Allocated 2_452_192 B + Freed 2_452_192 B diff --git a/tests/snaps/vine/fib/compiled.iv b/tests/snaps/vine/fib/compiled.iv index c98ff907..d5180c6d 100644 --- a/tests/snaps/vine/fib/compiled.iv +++ b/tests/snaps/vine/fib/compiled.iv @@ -24,7 +24,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1933(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1877(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -33,10 +33,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1943(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1887(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1946(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1890(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -55,7 +55,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2903(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2855(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/fib_repl/compiled.iv b/tests/snaps/vine/fib_repl/compiled.iv index 85c6551c..7b17cd94 100644 --- a/tests/snaps/vine/fib_repl/compiled.iv +++ b/tests/snaps/vine/fib_repl/compiled.iv @@ -49,7 +49,7 @@ ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup1950(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1894(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -58,10 +58,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1960(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1904(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1963(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1907(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -69,7 +69,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup1970(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup1914(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -81,10 +81,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup1981(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup1925(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup1990(dup1985(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup1934(dup1929(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -114,7 +114,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2920(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2872(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -137,11 +137,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup2965(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup2917(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup2972(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup2924(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -156,7 +156,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup2989(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup2941(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/final_countdown/compiled.iv b/tests/snaps/vine/final_countdown/compiled.iv index 9c2ccc74..a6278b88 100644 --- a/tests/snaps/vine/final_countdown/compiled.iv +++ b/tests/snaps/vine/final_countdown/compiled.iv @@ -23,7 +23,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1932(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1876(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -32,10 +32,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1942(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1886(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1945(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1889(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -54,7 +54,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2902(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2854(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/find_primes/compiled.iv b/tests/snaps/vine/find_primes/compiled.iv index 2efd2593..fc72c9b0 100644 --- a/tests/snaps/vine/find_primes/compiled.iv +++ b/tests/snaps/vine/find_primes/compiled.iv @@ -38,7 +38,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1955(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1899(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -47,10 +47,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1965(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1909(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1968(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1912(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -69,7 +69,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2925(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2877(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/fizzbuzz/compiled.iv b/tests/snaps/vine/fizzbuzz/compiled.iv index e74f1e2c..cd9e8a6d 100644 --- a/tests/snaps/vine/fizzbuzz/compiled.iv +++ b/tests/snaps/vine/fizzbuzz/compiled.iv @@ -36,7 +36,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1944(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1888(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -45,10 +45,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1954(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1898(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1957(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1901(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -67,7 +67,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2914(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2866(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/guessing_game/compiled.iv b/tests/snaps/vine/guessing_game/compiled.iv index 276b01c5..a35ca10c 100644 --- a/tests/snaps/vine/guessing_game/compiled.iv +++ b/tests/snaps/vine/guessing_game/compiled.iv @@ -76,7 +76,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup386(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup381(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -93,7 +93,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2001(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1945(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -102,10 +102,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2011(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1955(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2014(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1958(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -113,7 +113,7 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::parse { fn(tup(dup2021(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } +::std::numeric::N32::parse { fn(tup(dup1965(?(::std::numeric::N32::parse::4 ::std::numeric::N32::parse::3 x(w15 x(w7 w13))) w15) tup(w7 _)) w13) } ::std::numeric::N32::parse::3 { x(w5 x(w4 w6)) @@ -125,10 +125,10 @@ ::std::numeric::N32::parse::11 = x(w4 ::std::logical::Option::None) } -::std::numeric::N32::parse::5 { x(dup2032(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } +::std::numeric::N32::parse::5 { x(dup1976(?(::std::numeric::N32::parse::7 ::std::numeric::N32::parse::6 x(w8 w3)) w8) w3) } ::std::numeric::N32::parse::6 { - x(w18 x(tup(dup2041(dup2036(w20 @le(57 w23)) w26) w2) x(w16 w25))) + x(w18 x(tup(dup1985(dup1980(w20 @le(57 w23)) w26) w2) x(w16 w25))) 48 = @le(w20 @n32_and(w23 ?(::std::numeric::N32::parse::10 ::std::numeric::N32::parse::9 x(w18 x(w2 x(w16 x(w26 w25))))))) } @@ -162,7 +162,7 @@ ::std::rng::Pcg32::new { fn(w2 fn(w3 tup(w17 w20))) ::std::numeric::N64::from_n32 = fn(1 w7) - ::std::numeric::N64::or = fn(w3 fn(w7 dup2599(w11 dup2599(w16 w20)))) + ::std::numeric::N64::or = fn(w3 fn(w7 dup2543(w11 dup2543(w16 w20)))) ::std::numeric::N64::add = fn(w2 fn(w11 w12)) ::std::numeric::N64::mul = fn(w12 fn(::std::rng::Pcg32::multiplier w15)) ::std::numeric::N64::add = fn(w15 fn(w16 w17)) @@ -176,21 +176,21 @@ ::std::rng::Pcg32::multiplier { tup(1284865837 1481765933) } ::std::rng::Pcg32::gen_n32 { - fn(ref(tup(dup2607(tup(@n32_shr(27 w26) dup2610(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2610(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2608(w4 w17)) tup(w18 w4)) w30) + fn(ref(tup(dup2551(tup(@n32_shr(27 w26) dup2554(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2554(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2552(w4 w17)) tup(w18 w4)) w30) ::std::numeric::N64::mul = fn(w15 fn(::std::rng::Pcg32::multiplier w16)) ::std::numeric::N64::add = fn(w16 fn(w17 w18)) ::std::numeric::N32::rotate_right = fn(w27 fn(w29 w30)) } ::std::rng::Pcg32::mix { - fn(ref(tup(w3 dup2617(w4 w19)) tup(w20 w4)) fn(w9 _)) + fn(ref(tup(w3 dup2561(w4 w19)) tup(w20 w4)) fn(w9 _)) ::std::numeric::N64::xor = fn(w3 fn(tup(0 w9) w15)) ::std::numeric::N64::mul = fn(w15 fn(::std::rng::Pcg32::multiplier w18)) ::std::numeric::N64::add = fn(w18 fn(w19 w20)) } ::std::rng::Pcg32::seeded { - fn(dup2622(w10 _) w16) + fn(dup2566(w10 _) w16) ::std::data::List::into_iter = fn(w10 w11) ::std::rng::Pcg32::seeded::2 = x(x(::std::rng::Pcg32::default w16) w11) } @@ -222,7 +222,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2971(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2923(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -245,11 +245,11 @@ ::std::IO::read_line { fn(ref(w3 w18) w15) - ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup3016(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) + ::std::IO::read_byte = fn(ref(w3 w8) fn(0 dup2968(@ne(0 ?(::std::IO::read_line::4 ::std::IO::read_line::3 x(x(w8 w18) x(w16 w15)))) w16))) } ::std::IO::read_line::3 { - x(w5 x(dup3023(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) + x(w5 x(dup2975(@eq(10 ?(::std::IO::read_line::7 ::std::IO::read_line::6 x(w5 x(w9 w8)))) w9) w1)) ::std::logical::Option::Some = fn(w8 w1) } @@ -264,7 +264,7 @@ ::std::IO::read_line::8 { x(x(w10 w18) w8) - ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup3040(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) + ::std::IO::read_byte = fn(ref(w10 w1) fn(10 dup2992(@ne(10 ?(::std::IO::read_line::11 ::std::IO::read_line::10 x(x(w1 w18) x(w16 w8)))) w16))) } ::std::IO::read_line::10 { diff --git a/tests/snaps/vine/hello_world/compiled.iv b/tests/snaps/vine/hello_world/compiled.iv index f48bd812..5f85d4e1 100644 --- a/tests/snaps/vine/hello_world/compiled.iv +++ b/tests/snaps/vine/hello_world/compiled.iv @@ -17,7 +17,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2884(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2836(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::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 89ab5306..6633769a 100644 --- a/tests/snaps/vine/inverse/compiled.iv +++ b/tests/snaps/vine/inverse/compiled.iv @@ -70,7 +70,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1976(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1920(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -79,10 +79,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1986(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1930(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1989(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1933(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -101,7 +101,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2946(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2898(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/logic/compiled.iv b/tests/snaps/vine/logic/compiled.iv index b576ef72..a445c3d0 100644 --- a/tests/snaps/vine/logic/compiled.iv +++ b/tests/snaps/vine/logic/compiled.iv @@ -48,7 +48,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2950(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2902(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::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 adedbb13..9448629a 100644 --- a/tests/snaps/vine/loop_break_continue/compiled.iv +++ b/tests/snaps/vine/loop_break_continue/compiled.iv @@ -27,7 +27,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1938(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1882(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -36,10 +36,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1948(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1892(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1951(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1895(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -58,7 +58,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2908(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2860(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/loop_vi_loop/compiled.iv b/tests/snaps/vine/loop_vi_loop/compiled.iv index 14789808..41b275cd 100644 --- a/tests/snaps/vine/loop_vi_loop/compiled.iv +++ b/tests/snaps/vine/loop_vi_loop/compiled.iv @@ -29,7 +29,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1944(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1888(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -38,10 +38,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1954(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1898(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1957(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1901(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -60,7 +60,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2914(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2866(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/mandelbrot_sixel/compiled.iv b/tests/snaps/vine/mandelbrot_sixel/compiled.iv index e338003b..a71a1595 100644 --- a/tests/snaps/vine/mandelbrot_sixel/compiled.iv +++ b/tests/snaps/vine/mandelbrot_sixel/compiled.iv @@ -105,7 +105,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup2046(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1990(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -114,10 +114,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2056(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2000(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2059(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2003(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -130,7 +130,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3016(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2968(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) @@ -147,7 +147,7 @@ ::std::IO::print_bytes::2 = x(x(w3 w15) x(w9 w10)) } -::std::IO::print_bytes::2 { x(w4 x(dup3038(?(::std::IO::print_bytes::4 ::std::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print_bytes::2 { x(w4 x(dup2990(?(::std::IO::print_bytes::4 ::std::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print_bytes::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/mandelbrot_tga/compiled.iv b/tests/snaps/vine/mandelbrot_tga/compiled.iv index 04ba6fab..ae3ec93d 100644 --- a/tests/snaps/vine/mandelbrot_tga/compiled.iv +++ b/tests/snaps/vine/mandelbrot_tga/compiled.iv @@ -60,7 +60,7 @@ ::std::IO::print_bytes::2 = x(x(w3 w15) x(w9 w10)) } -::std::IO::print_bytes::2 { x(w4 x(dup2969(?(::std::IO::print_bytes::4 ::std::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print_bytes::2 { x(w4 x(dup2921(?(::std::IO::print_bytes::4 ::std::IO::print_bytes::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print_bytes::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/map_test/compiled.iv b/tests/snaps/vine/map_test/compiled.iv index e7f77198..11a537ce 100644 --- a/tests/snaps/vine/map_test/compiled.iv +++ b/tests/snaps/vine/map_test/compiled.iv @@ -142,7 +142,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup482(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup477(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -159,20 +159,20 @@ ::std::data::Map::new { fn(w2 tup(w2 ::std::data::Map::Node::leaf)) } -::std::data::Map::len { fn(ref(tup(w2 tup(dup1047(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } +::std::data::Map::len { fn(ref(tup(w2 tup(dup1042(w3 w13) w5)) tup(w2 tup(w3 w5))) w13) } ::std::data::Map::insert { - fn(ref(tup(dup1051(w2 w16) w5) tup(w2 w14)) w9) + fn(ref(tup(dup1046(w2 w16) w5) tup(w2 w14)) w9) ::std::data::Map::Node::insert = fn(ref(w5 w14) fn(w16 w9)) } ::std::data::Map::get { - fn(ref(tup(dup1072(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1067(w2 w17) w5) tup(w2 w15)) w10) ::std::data::Map::Node::get = fn(ref(w5 w15) fn(w17 w10)) } ::std::data::Map::remove { - fn(ref(tup(dup1096(w2 w17) w5) tup(w2 w15)) w10) + fn(ref(tup(dup1091(w2 w17) w5) tup(w2 w15)) w10) ::std::data::Map::Node::remove = fn(ref(w5 w15) fn(w17 w10)) } @@ -184,7 +184,7 @@ ::std::data::List::pop_front = fn(ref(w15 w19) enum(::std::data::Map::Iter::next::9 enum(::std::data::Map::Iter::next::10 x(x(w17 w25) w23)))) } -::std::data::Map::Iter::next::2 { x(x(ref(tup(dup1154(w2 ?(::std::data::Map::Iter::next::5 ::std::data::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } +::std::data::Map::Iter::next::2 { x(x(ref(tup(dup1149(w2 ?(::std::data::Map::Iter::next::5 ::std::data::Map::Iter::next::4 x(x(_ w49) x(w39 x(x(w5 w45) w43))))) w5) tup(w2 w45)) w49) x(w39 w43)) } ::std::data::Map::Iter::next::4 { x(x(_ w48) x(x(w4 w46) x(x(w2 w18) w44))) @@ -204,7 +204,7 @@ ::std::data::Map::Node::leaf { tup(0 _) } -::std::data::Map::Node::size { fn(ref(tup(dup1297(w2 w10) w4) tup(w2 w4)) w10) } +::std::data::Map::Node::size { fn(ref(tup(dup1241(w2 w10) w4) tup(w2 w4)) w10) } ::std::data::Map::Node::new { fn(w2 fn(w3 fn(w4 tup(w16 tup(w8 tup(w3 w12)))))) @@ -212,10 +212,10 @@ ::std::data::Map::Node::size = fn(ref(w4 w12) w14) } -::std::data::Map::Node::insert { fn(ref(tup(dup1310(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert { fn(ref(tup(dup1254(?(::std::data::Map::Node::insert::4 ::std::data::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::data::Map::Node::insert::3 { - x(w26 x(x(w24 w50) x(dup1325(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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(dup1269(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::insert::9 enum(::std::data::Map::Node::insert::10 enum(::std::data::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))) } @@ -240,10 +240,10 @@ ::std::data::Map::balance_left = fn(ref(w26 w31) _) } -::std::data::Map::Node::get { fn(ref(tup(dup1386(w2 ?(::std::data::Map::Node::get::4 ::std::data::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::data::Map::Node::get { fn(ref(tup(dup1330(w2 ?(::std::data::Map::Node::get::4 ::std::data::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::data::Map::Node::get::3 { - x(x(w22 w1) x(dup1398(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::data::Map::Node::get::9 enum(::std::data::Map::Node::get::10 enum(::std::data::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(dup1342(fn(ref(w19 w25) fn(ref(w6 w28) enum(::std::data::Map::Node::get::9 enum(::std::data::Map::Node::get::10 enum(::std::data::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))) } @@ -264,11 +264,11 @@ ::std::data::Map::Node::get = fn(ref(w2 w11) fn(w9 fn(ref(w8 w15) w17))) } -::std::data::Map::Node::remove { fn(ref(tup(dup1581(?(::std::data::Map::Node::remove::4 ::std::data::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::data::Map::Node::remove { fn(ref(tup(dup1525(?(::std::data::Map::Node::remove::4 ::std::data::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::data::Map::Node::remove::3 { - x(w26 x(x(w24 w47) x(dup1596(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::remove::9 enum(::std::data::Map::Node::remove::10 enum(::std::data::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 dup1604(w7 w40)) w12)) tup(w42 tup(tup(w32 w7) w39))) + x(w26 x(x(w24 w47) x(dup1540(fn(ref(w21 w29) fn(ref(w6 w32) enum(::std::data::Map::Node::remove::9 enum(::std::data::Map::Node::remove::10 enum(::std::data::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 dup1548(w7 w40)) w12)) tup(w42 tup(tup(w32 w7) w39))) } ::std::data::Map::Node::remove::4 { x(x(w7 w7) x(x(w5 w5) x(_ x(x(w2 w2) ::std::logical::Option::None)))) } @@ -321,7 +321,7 @@ ::std::data::Map::Node::remove_max::4 { x(x(_ w2) x(_ x(x(tup(_ w2) _) x(x(w12 _) x(x(w10 w10) w12))))) } -::std::data::Map::Node::balanced { fn(ref(tup(dup1731(w2 ?(::std::data::Map::Node::balanced::4 ::std::data::Map::Node::balanced::3 x(x(w5 w15) w13))) w5) tup(w2 w15)) w13) } +::std::data::Map::Node::balanced { fn(ref(tup(dup1675(w2 ?(::std::data::Map::Node::balanced::4 ::std::data::Map::Node::balanced::3 x(x(w5 w15) w13))) w5) tup(w2 w15)) w13) } ::std::data::Map::Node::balanced::3 { x(x(w16 w1) w30) @@ -429,22 +429,22 @@ } ::std::data::Map::is_balanced { - fn(ref(tup(dup1899(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1900(w8 w19) w10) tup(w8 w10)) w20)) + fn(ref(tup(dup1843(w2 w16) w4) tup(w2 w4)) fn(ref(tup(dup1844(w8 w19) w10) tup(w8 w10)) w20)) 3 = @mul(w16 @add(2 @le$(w19 w20))) } ::std::data::Map::is_single { - fn(ref(tup(dup1904(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1905(w8 w17) w10) tup(w8 w10)) w19)) + fn(ref(tup(dup1848(w2 @le(w18 w19)) w4) tup(w2 w4)) fn(ref(tup(dup1849(w8 w17) w10) tup(w8 w10)) w19)) 2 = @mul(w17 w18) } -::std::data::Map::size { fn(ref(tup(tup(dup1909(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1910(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } +::std::data::Map::size { fn(ref(tup(tup(dup1853(w2 @add(w19 @add(1 w21))) w4) tup(w7 tup(dup1854(w8 w19) w10))) tup(tup(w2 w4) tup(w7 tup(w8 w10)))) w21) } ::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup2097(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2041(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -453,10 +453,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2107(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2051(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2110(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2054(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -466,7 +466,7 @@ ::std::numeric::N32::rotate_right { fn(@n32_rotr(x y) fn(x y)) } -::std::numeric::N32::cmp { fn(ref(dup2164(w2 dup2164(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2165(w5 dup2165(w12 w15)) w5) w14)) } +::std::numeric::N32::cmp { fn(ref(dup2108(w2 dup2108(@lt(w12 ?(::std::numeric::N32::cmp::4 ::std::numeric::N32::cmp::3 x(w16 x(w15 w14)))) w16)) w2) fn(ref(dup2109(w5 dup2109(w12 w15)) w5) w14)) } ::std::numeric::N32::cmp::3 { x(_ x(_ ::std::data::Map::Ord::Lt)) } @@ -485,7 +485,7 @@ ::std::rng::Pcg32::new { fn(w2 fn(w3 tup(w17 w20))) ::std::numeric::N64::from_n32 = fn(1 w7) - ::std::numeric::N64::or = fn(w3 fn(w7 dup2695(w11 dup2695(w16 w20)))) + ::std::numeric::N64::or = fn(w3 fn(w7 dup2639(w11 dup2639(w16 w20)))) ::std::numeric::N64::add = fn(w2 fn(w11 w12)) ::std::numeric::N64::mul = fn(w12 fn(::std::rng::Pcg32::multiplier w15)) ::std::numeric::N64::add = fn(w15 fn(w16 w17)) @@ -499,21 +499,21 @@ ::std::rng::Pcg32::multiplier { tup(1284865837 1481765933) } ::std::rng::Pcg32::gen_n32 { - fn(ref(tup(dup2703(tup(@n32_shr(27 w26) dup2706(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2706(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2704(w4 w17)) tup(w18 w4)) w30) + fn(ref(tup(dup2647(tup(@n32_shr(27 w26) dup2650(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2650(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2648(w4 w17)) tup(w18 w4)) w30) ::std::numeric::N64::mul = fn(w15 fn(::std::rng::Pcg32::multiplier w16)) ::std::numeric::N64::add = fn(w16 fn(w17 w18)) ::std::numeric::N32::rotate_right = fn(w27 fn(w29 w30)) } ::std::rng::Pcg32::mix { - fn(ref(tup(w3 dup2713(w4 w19)) tup(w20 w4)) fn(w9 _)) + fn(ref(tup(w3 dup2657(w4 w19)) tup(w20 w4)) fn(w9 _)) ::std::numeric::N64::xor = fn(w3 fn(tup(0 w9) w15)) ::std::numeric::N64::mul = fn(w15 fn(::std::rng::Pcg32::multiplier w18)) ::std::numeric::N64::add = fn(w18 fn(w19 w20)) } ::std::rng::Pcg32::seeded { - fn(dup2718(w10 _) w16) + fn(dup2662(w10 _) w16) ::std::data::List::into_iter = fn(w10 w11) ::std::rng::Pcg32::seeded::2 = x(x(::std::rng::Pcg32::default w16) w11) } @@ -545,7 +545,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3067(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3019(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/maybe_set/compiled.iv b/tests/snaps/vine/maybe_set/compiled.iv index 94651eb2..985f4a27 100644 --- a/tests/snaps/vine/maybe_set/compiled.iv +++ b/tests/snaps/vine/maybe_set/compiled.iv @@ -22,7 +22,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2890(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2842(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::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 9b792574..276bfec9 100644 --- a/tests/snaps/vine/no_return/compiled.iv +++ b/tests/snaps/vine/no_return/compiled.iv @@ -17,7 +17,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2884(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2836(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::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 48e19c0c..4f54d494 100644 --- a/tests/snaps/vine/option_party/compiled.iv +++ b/tests/snaps/vine/option_party/compiled.iv @@ -217,7 +217,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup2120(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup2064(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -226,10 +226,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2130(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2074(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2133(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2077(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -248,7 +248,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3090(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup3042(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/pretty_div/compiled.iv b/tests/snaps/vine/pretty_div/compiled.iv index 78f55dfc..2ee12c81 100644 --- a/tests/snaps/vine/pretty_div/compiled.iv +++ b/tests/snaps/vine/pretty_div/compiled.iv @@ -33,7 +33,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1931(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1875(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -42,10 +42,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1941(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1885(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1944(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1888(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -64,7 +64,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2901(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2853(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/primeness/compiled.iv b/tests/snaps/vine/primeness/compiled.iv index 5c31bbd6..77551268 100644 --- a/tests/snaps/vine/primeness/compiled.iv +++ b/tests/snaps/vine/primeness/compiled.iv @@ -72,7 +72,7 @@ ::std::logical::Result::Err { fn(f0 enum(_ enum(enum(f0 r) r))) } -::std::numeric::N32::to_string { fn(dup1960(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1904(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -81,10 +81,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1970(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1914(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1973(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1917(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -103,7 +103,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2930(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2882(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/segmented_sieve/compiled.iv b/tests/snaps/vine/segmented_sieve/compiled.iv index d52ecce8..0f96df7d 100644 --- a/tests/snaps/vine/segmented_sieve/compiled.iv +++ b/tests/snaps/vine/segmented_sieve/compiled.iv @@ -108,7 +108,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup436(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup431(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -118,29 +118,29 @@ ::std::data::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::logical::Option::None)) } ::std::data::Array::new { - fn(dup552(w6 w7) fn(w3 tup(w6 w9))) + fn(dup547(w6 w7) fn(w3 tup(w6 w9))) ::std::data::Array::Node::new = fn(w7 fn(w3 w9)) } ::std::data::Array::get { - fn(ref(tup(dup662(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup657(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup673(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup668(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup677(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup672(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::pop_front { fn(ref(tup(dup796(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup791(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup802(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup797(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -155,12 +155,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup813(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup808(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup820(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup815(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -184,7 +184,7 @@ ::std::data::Array::Node::leaf { fn(x x) } -::std::data::Array::Node::new { fn(dup855(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::data::Array::Node::new { fn(dup850(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::data::Array::Node::new::3 { x(_ x(w3 w1)) @@ -192,7 +192,7 @@ } ::std::data::Array::Node::new::4 { - x(dup863(@add(1 @div(2 w2)) @div(2 w6)) x(dup864(w3 w7) tup(w4 w8))) + x(dup858(@add(1 @div(2 w2)) @div(2 w6)) x(dup859(w3 w7) tup(w4 w8))) ::std::data::Array::Node::new = fn(w2 fn(w3 w4)) ::std::data::Array::Node::new = fn(w6 fn(w7 w8)) } @@ -207,7 +207,7 @@ ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup2051(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1995(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -216,10 +216,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2061(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup2005(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2064(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup2008(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -227,13 +227,13 @@ ::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } -::std::numeric::N32::min { fn(dup2130(@lt(w8 ?(::std::numeric::N32::min::4 ::std::numeric::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2131(w8 w11) w10)) } +::std::numeric::N32::min { fn(dup2074(@lt(w8 ?(::std::numeric::N32::min::4 ::std::numeric::N32::min::3 x(w12 x(w11 w10)))) w12) fn(dup2075(w8 w11) w10)) } ::std::numeric::N32::min::3 { x(w3 x(_ w3)) } ::std::numeric::N32::min::4 { x(_ x(w2 w2)) } -::std::numeric::N32::max { fn(dup2140(@lt$(w8 ?(::std::numeric::N32::max::4 ::std::numeric::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2141(w8 w11) w10)) } +::std::numeric::N32::max { fn(dup2084(@lt$(w8 ?(::std::numeric::N32::max::4 ::std::numeric::N32::max::3 x(w12 x(w11 w10)))) w12) fn(dup2085(w8 w11) w10)) } ::std::numeric::N32::max::3 { x(w3 x(_ w3)) } @@ -244,10 +244,10 @@ ::std::numeric::N32::sqrt::2 = x(w2 x(32768 x(0 w9))) } -::std::numeric::N32::sqrt::2 { x(w4 x(dup2185(?(::std::numeric::N32::sqrt::4 ::std::numeric::N32::sqrt::3 x(w4 x(w7 w2))) w7) w2)) } +::std::numeric::N32::sqrt::2 { x(w4 x(dup2129(?(::std::numeric::N32::sqrt::4 ::std::numeric::N32::sqrt::3 x(w4 x(w7 w2))) w7) w2)) } ::std::numeric::N32::sqrt::3 { - x(dup2188(w14 w23) x(dup2189(w1 @n32_shr(1 w6)) x(dup2192(@add(w1 dup2194(@mul(w12 @le(w14 ?(::std::numeric::N32::sqrt::7 ::std::numeric::N32::sqrt::6 x(x(w18 w19) x(w17 _))))) dup2194(w12 w17))) w18) w21))) + x(dup2132(w14 w23) x(dup2133(w1 @n32_shr(1 w6)) x(dup2136(@add(w1 dup2138(@mul(w12 @le(w14 ?(::std::numeric::N32::sqrt::7 ::std::numeric::N32::sqrt::6 x(x(w18 w19) x(w17 _))))) dup2138(w12 w17))) w18) w21))) ::std::numeric::N32::sqrt::2 = x(w23 x(w6 x(w19 w21))) } @@ -268,7 +268,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup3021(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2973(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/sieve/compiled.iv b/tests/snaps/vine/sieve/compiled.iv index de50818f..ea302173 100644 --- a/tests/snaps/vine/sieve/compiled.iv +++ b/tests/snaps/vine/sieve/compiled.iv @@ -42,29 +42,29 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } ::std::data::Array::new { - fn(dup459(w6 w7) fn(w3 tup(w6 w9))) + fn(dup454(w6 w7) fn(w3 tup(w6 w9))) ::std::data::Array::Node::new = fn(w7 fn(w3 w9)) } ::std::data::Array::get { - fn(ref(tup(dup569(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) + fn(ref(tup(dup564(w2 w13) w5) tup(w2 w6)) fn(w10 w19)) ::std::data::Array::get::2 = x(x(ref(w5 w6) w16) x(w10 w13)) ::std::data::Array::Node::as_leaf = fn(w16 w19) } -::std::data::Array::get::2 { x(w5 x(w3 dup580(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } +::std::data::Array::get::2 { x(w5 x(w3 dup575(@lt$(1 ?(::std::data::Array::get::4 ::std::data::Array::get::3 x(w5 x(w3 w6)))) w6))) } ::std::data::Array::get::3 { - x(x(w13 w17) x(dup584(@rem(2 w3) @div(2 w9)) w10)) + x(x(w13 w17) x(dup579(@rem(2 w3) @div(2 w9)) w10)) ::std::data::Array::Node::half = fn(w13 fn(w10 fn(w3 tup(w5 w6)))) ::std::data::Array::get::2 = x(x(w5 w17) x(w9 w6)) } ::std::data::Array::get::4 { x(x(w3 w3) _) } -::std::data::Array::pop_front { fn(ref(tup(dup703(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } +::std::data::Array::pop_front { fn(ref(tup(dup698(?(::std::data::Array::pop_front::4 ::std::data::Array::pop_front::3 x(x(w16 w17) x(ref(w5 w6) w14))) w16) w5) tup(w17 w6)) w14) } -::std::data::Array::pop_front::3 { x(x(dup709(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } +::std::data::Array::pop_front::3 { x(x(dup704(@eq(1 ?(::std::data::Array::pop_front::6 ::std::data::Array::pop_front::5 x(x(w8 w9) w3))) w8) w9) w3) } ::std::data::Array::pop_front::4 { x(x(w3 w3) x(_ w5)) @@ -79,12 +79,12 @@ } ::std::data::Array::pop_front::6 { - x(x(dup720(w0 @sub(1 w3)) w3) x(w6 w9)) + x(x(dup715(w0 @sub(1 w3)) w3) x(w6 w9)) ::std::data::Array::pop_front::7 = x(w6 x(w0 w9)) } ::std::data::Array::pop_front::7 { - x(ref(w2 w38) x(@add(1 @div(2 dup727(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::Array::pop_front::9 x(ref(w18 w21) x(w39 x(x(w5 w38) x(x(w17 w36) w34)))))) w39))) w34)) + x(ref(w2 w38) x(@add(1 @div(2 dup722(@eq(1 ?(::std::data::Array::pop_front::10 ::std::data::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) } @@ -108,7 +108,7 @@ ::std::data::Array::Node::leaf { fn(x x) } -::std::data::Array::Node::new { fn(dup762(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } +::std::data::Array::Node::new { fn(dup757(@eq(1 ?(::std::data::Array::Node::new::4 ::std::data::Array::Node::new::3 x(w11 x(w3 w9)))) w11) fn(w3 w9)) } ::std::data::Array::Node::new::3 { x(_ x(w3 w1)) @@ -116,7 +116,7 @@ } ::std::data::Array::Node::new::4 { - x(dup770(@add(1 @div(2 w2)) @div(2 w6)) x(dup771(w3 w7) tup(w4 w8))) + x(dup765(@add(1 @div(2 w2)) @div(2 w6)) x(dup766(w3 w7) tup(w4 w8))) ::std::data::Array::Node::new = fn(w2 fn(w3 w4)) ::std::data::Array::Node::new = fn(w6 fn(w7 w8)) } @@ -131,7 +131,7 @@ ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup1958(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1902(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -140,10 +140,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1968(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1912(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1971(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1915(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -162,7 +162,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2928(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2880(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/so_random/compiled.iv b/tests/snaps/vine/so_random/compiled.iv index 2a951b67..0277cb1a 100644 --- a/tests/snaps/vine/so_random/compiled.iv +++ b/tests/snaps/vine/so_random/compiled.iv @@ -20,7 +20,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1928(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1872(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -29,10 +29,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1938(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1882(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1941(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1885(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -53,7 +53,7 @@ ::std::rng::Pcg32::new { fn(w2 fn(w3 tup(w17 w20))) ::std::numeric::N64::from_n32 = fn(1 w7) - ::std::numeric::N64::or = fn(w3 fn(w7 dup2526(w11 dup2526(w16 w20)))) + ::std::numeric::N64::or = fn(w3 fn(w7 dup2470(w11 dup2470(w16 w20)))) ::std::numeric::N64::add = fn(w2 fn(w11 w12)) ::std::numeric::N64::mul = fn(w12 fn(::std::rng::Pcg32::multiplier w15)) ::std::numeric::N64::add = fn(w15 fn(w16 w17)) @@ -67,7 +67,7 @@ ::std::rng::Pcg32::multiplier { tup(1284865837 1481765933) } ::std::rng::Pcg32::gen_n32 { - fn(ref(tup(dup2534(tup(@n32_shr(27 w26) dup2537(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2537(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2535(w4 w17)) tup(w18 w4)) w30) + fn(ref(tup(dup2478(tup(@n32_shr(27 w26) dup2481(@n32_shr(13 @n32_xor(w23 @n32_xor(w26 w27))) dup2481(@n32_shl(5 w23) @n32_shr(27 w29)))) w15) dup2479(w4 w17)) tup(w18 w4)) w30) ::std::numeric::N64::mul = fn(w15 fn(::std::rng::Pcg32::multiplier w16)) ::std::numeric::N64::add = fn(w16 fn(w17 w18)) ::std::numeric::N32::rotate_right = fn(w27 fn(w29 w30)) @@ -84,7 +84,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2898(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2850(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/specializations/compiled.iv b/tests/snaps/vine/specializations/compiled.iv new file mode 100644 index 00000000..c67f6128 --- /dev/null +++ b/tests/snaps/vine/specializations/compiled.iv @@ -0,0 +1,178 @@ + +::main { ::specializations::main } + +::specializations::main { + fn(ref(w3 w35) _) + ::std::data::List::to_string::0 = fn(tup(4 tup(tup(1 tup(2 tup(3 tup(4 w42)))) w42)) w11) + ::std::IO::println = fn(ref(w3 w8) fn(w11 _)) + ::std::data::List::to_string::1 = fn(tup(3 tup(tup(tup(3 tup(tup(97 tup(98 tup(99 w43))) w43)) tup(tup(3 tup(tup(100 tup(101 tup(102 w44))) w44)) tup(tup(3 tup(tup(103 tup(104 tup(105 w45))) w45)) w46))) w46)) w20) + ::std::IO::println = fn(ref(w8 w14) fn(w20 _)) + ::std::data::List::to_string::2 = fn(tup(3 tup(tup(120 tup(121 tup(122 w47))) w47)) w26) + ::std::IO::println = fn(ref(w14 w23) fn(w26 _)) + ::std::data::List::to_string::3 = fn(tup(2 tup(tup(1 tup(0 w48)) w48)) w32) + ::std::IO::println = fn(ref(w23 w29) fn(w32 _)) + ::std::data::List::to_string::4 = fn(tup(2 tup(tup(tup(1 97) tup(tup(2 98) w49)) w49)) w40) + ::std::IO::println = fn(ref(w29 w35) fn(w40 _)) +} + +::std::data::List::map { + fn(tup(dup77(w8 w23) tup(w3 _)) fn(w5 tup(w8 tup(w12 w20)))) + ::std::data::List::map::2 = x(w23 x(w3 x(w5 x(w12 w20)))) +} + +::std::data::List::map::2 { x(dup88(?(::std::data::List::map::4 ::std::data::List::map::3 x(w10 w4)) w10) w4) } + +::std::data::List::map::3 { + x(@sub(1 w18) x(tup(w1 w2) x(dup97(fn(w1 w9) w26) x(tup(w9 w11) w25)))) + ::std::data::List::map::2 = x(w18 x(w2 x(w26 x(w11 w25)))) +} + +::std::data::List::map::4 { x(_ x(_ x(_ x(w1 w1)))) } + +::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } + +::std::data::List::join { + fn(w2 fn(w3 w15)) + ::std::data::List::into_iter = fn(w2 w7) + ::std::data::List::IntoIter::next = fn(ref(w7 w11) enum(::std::data::List::join::5 enum(::std::data::List::join::6 x(w3 x(w11 w15))))) +} + +::std::data::List::join::5 { + enum(w0 x(w4 x(w3 w7))) + ::std::data::List::join::7 = x(w4 x(w3 x(w0 w7))) +} + +::std::data::List::join::6 { x(_ x(_ tup(0 tup(w4 w4)))) } + +::std::data::List::join::7 { + x(w8 x(w7 w6)) + ::std::data::List::IntoIter::next = fn(ref(w7 w1) enum(::std::data::List::join::10 enum(::std::data::List::join::11 x(w8 x(w1 w6))))) +} + +::std::data::List::join::10 { + enum(w0 x(dup190(w6 w14) x(w4 x(w3 w12)))) + ::std::data::List::concat = fn(w6 fn(w0 w8)) + ::std::data::List::concat = fn(w3 fn(w8 w10)) + ::std::data::List::join::7 = x(w14 x(w4 x(w10 w12))) +} + +::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } + +::std::data::List::to_string::0 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::numeric::N32::to_string w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) +} + +::std::data::List::to_string::1 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::unicode::String::to_string w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) +} + +::std::data::List::to_string::2 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::unicode::Char::to_string w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) +} + +::std::data::List::to_string::3 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::logical::Bool::to_string w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) +} + +::std::data::List::to_string::4 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::tuple::Pair::to_string::0 w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) +} + +::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } + +::std::data::List::IntoIter::next { fn(ref(tup(dup318(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } + +::std::data::List::IntoIter::next::3 { + x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) + ::std::logical::Option::Some = fn(w3 w9) +} + +::std::data::List::IntoIter::next::4 { x(x(w4 w4) x(x(w2 w2) ::std::logical::Option::None)) } + +::std::logical::Bool::to_string { fn(?(::std::logical::Bool::to_string::4 ::std::logical::Bool::to_string::3 w7) w7) } + +::std::logical::Bool::to_string::3 { tup(4 tup(tup(116 tup(114 tup(117 tup(101 w2)))) w2)) } + +::std::logical::Bool::to_string::4 { tup(5 tup(tup(102 tup(97 tup(108 tup(115 tup(101 w2))))) w2)) } + +::std::logical::Option::Some { fn(f0 enum(enum(f0 r) enum(_ r))) } + +::std::logical::Option::None { enum(_ enum(r r)) } + +::std::numeric::N32::to_string { fn(dup1882(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } + +::std::numeric::N32::to_string::3 { + x(w6 w9) + ::std::numeric::N32::to_string::5 = x(w6 x(tup(0 tup(w7 w7)) w9)) +} + +::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } + +::std::numeric::N32::to_string::5 { x(dup1892(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } + +::std::numeric::N32::to_string::6 { + x(dup1895(@rem(10 w1) @div(10 w8)) x(w11 w15)) + 48 = @add(w1 w2) + ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) + ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) +} + +::std::numeric::N32::to_string::7 { x(_ x(w1 w1)) } + +::std::unicode::Char::to_string { fn(w2 tup(1 tup(tup(w2 w9) w9))) } + +::std::unicode::String::to_string { fn(w2 w2) } + +::std::IO::println { + fn(ref(w3 w14) fn(w5 _)) + ::std::IO::print = fn(ref(w3 w9) fn(w5 _)) + ::std::IO::print_char = fn(ref(w9 w14) fn(10 _)) +} + +::std::IO::print { + fn(ref(w3 w17) fn(tup(w9 tup(w10 _)) _)) + ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) +} + +::std::IO::print::2 { x(w4 x(dup2860(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } + +::std::IO::print::3 { + x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) + ::std::IO::print_char = fn(ref(w17 w10) fn(w4 _)) + ::std::IO::print::2 = x(x(w10 w21) x(w1 w5)) +} + +::std::IO::print::4 { x(x(w3 w3) _) } + +::std::IO::print_char { fn(ref(@io_print_char(char io) io) fn(char _)) } + +::std::tuple::Pair::to_string::0 { + fn(tup(w2 w3) w17) + ::std::numeric::N32::to_string = fn(w2 w9) + ::std::data::List::concat = fn(tup(1 tup(tup(40 w18) w18)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(2 tup(tup(44 tup(32 w19)) w19)) w12)) + ::std::unicode::Char::to_string = fn(w3 w14) + ::std::data::List::concat = fn(w12 fn(w14 w15)) + ::std::data::List::concat = fn(w15 fn(tup(1 tup(tup(41 w20) w20)) w17)) +} + diff --git a/tests/snaps/vine/specializations/output.txt b/tests/snaps/vine/specializations/output.txt new file mode 100644 index 00000000..f7896357 --- /dev/null +++ b/tests/snaps/vine/specializations/output.txt @@ -0,0 +1,5 @@ +[1, 2, 3, 4] +[abc, def, ghi] +[x, y, z] +[true, false] +[(1, a), (2, b)] diff --git a/tests/snaps/vine/specializations/stats.txt b/tests/snaps/vine/specializations/stats.txt new file mode 100644 index 00000000..2df4d9a7 --- /dev/null +++ b/tests/snaps/vine/specializations/stats.txt @@ -0,0 +1,15 @@ + +Interactions + Total 2_912 + Annihilate 1_563 + Commute 36 + Copy 210 + Erase 290 + Expand 462 + Call 223 + Branch 128 + +Memory + Heap 2_112 B + Allocated 60_160 B + Freed 60_160 B diff --git a/tests/snaps/vine/stream_primes/compiled.iv b/tests/snaps/vine/stream_primes/compiled.iv index fbbdd1ed..122e2901 100644 --- a/tests/snaps/vine/stream_primes/compiled.iv +++ b/tests/snaps/vine/stream_primes/compiled.iv @@ -39,7 +39,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1949(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1893(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -48,10 +48,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1959(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1903(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1962(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1906(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -70,7 +70,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2919(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2871(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/sub_min/compiled.iv b/tests/snaps/vine/sub_min/compiled.iv index 6544cc13..e9da954b 100644 --- a/tests/snaps/vine/sub_min/compiled.iv +++ b/tests/snaps/vine/sub_min/compiled.iv @@ -42,7 +42,7 @@ ::sub_min::main { fn(w3 _) ::sub_min = fn(ref(tup(4 tup(tup(4 tup(3 tup(7 tup(9 w19)))) w19)) w10) _) - ::std::data::List::to_string = fn(w10 fn(::std::numeric::N32::to_string w17)) + ::std::data::List::to_string::0 = fn(w10 w17) ::std::IO::println = fn(w3 fn(w17 _)) } @@ -89,17 +89,17 @@ ::std::data::List::join::11 { x(_ x(_ x(w1 w1))) } -::std::data::List::to_string { - fn(w2 fn(w3 w14)) - ::std::data::List::map = fn(w2 fn(w3 w9)) - ::std::data::List::join = fn(w9 fn(tup(2 tup(tup(44 tup(32 w16)) w16)) w11)) - ::std::data::List::concat = fn(tup(1 tup(tup(91 w15) w15)) fn(w11 w12)) - ::std::data::List::concat = fn(w12 fn(tup(1 tup(tup(93 w17) w17)) w14)) +::std::data::List::to_string::0 { + fn(w2 w12) + ::std::data::List::map = fn(w2 fn(::std::numeric::N32::to_string w7)) + ::std::data::List::join = fn(w7 fn(tup(2 tup(tup(44 tup(32 w14)) w14)) w9)) + ::std::data::List::concat = fn(tup(1 tup(tup(91 w13) w13)) fn(w9 w10)) + ::std::data::List::concat = fn(w10 fn(tup(1 tup(tup(93 w15) w15)) w12)) } -::std::data::List::iter { fn(ref(tup(dup307(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } +::std::data::List::iter { fn(ref(tup(dup306(w2 w12) tup(w5 w6)) tup(w2 tup(w14 w6))) tup(w12 ref(w5 w14))) } -::std::data::List::Iter::next { fn(ref(tup(dup314(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::Iter::next { fn(ref(tup(dup313(?(::std::data::List::Iter::next::4 ::std::data::List::Iter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::Iter::next::3 { x(x(@sub(1 w1) w1) x(x(ref(tup(w4 w7) tup(w5 w8)) ref(w7 w8)) w15)) @@ -110,7 +110,7 @@ ::std::data::List::into_iter { fn(tup(w2 tup(w3 _)) tup(w2 w3)) } -::std::data::List::IntoIter::next { fn(ref(tup(dup343(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } +::std::data::List::IntoIter::next { fn(ref(tup(dup342(?(::std::data::List::IntoIter::next::4 ::std::data::List::IntoIter::next::3 x(x(w16 w17) x(x(w5 w15) w13))) w16) w5) tup(w17 w15)) w13) } ::std::data::List::IntoIter::next::3 { x(x(@sub(1 w1) w1) x(x(tup(w3 w4) w4) w9)) @@ -127,7 +127,7 @@ ::std::logical::Option::unwrap::4 { enum(w0 w0) } -::std::numeric::N32::to_string { fn(dup1958(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1906(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -136,10 +136,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1968(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1916(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1971(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1919(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -158,7 +158,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2928(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2884(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/sub_min/stats.txt b/tests/snaps/vine/sub_min/stats.txt index 9e464274..bddf88c9 100644 --- a/tests/snaps/vine/sub_min/stats.txt +++ b/tests/snaps/vine/sub_min/stats.txt @@ -1,7 +1,7 @@ Interactions - Total 980 - Annihilate 511 + Total 979 + Annihilate 510 Commute 21 Copy 88 Erase 102 @@ -11,5 +11,5 @@ Interactions Memory Heap 1_216 B - Allocated 20_176 B - Freed 20_176 B + Allocated 20_144 B + Freed 20_144 B diff --git a/tests/snaps/vine/sum_divisors/compiled.iv b/tests/snaps/vine/sum_divisors/compiled.iv index 6336f015..35be3de8 100644 --- a/tests/snaps/vine/sum_divisors/compiled.iv +++ b/tests/snaps/vine/sum_divisors/compiled.iv @@ -67,7 +67,7 @@ ::std::data::List::concat { fn(tup(@add(w12 w20) tup(w8 w13)) fn(tup(w12 tup(w13 w23)) tup(w20 tup(w8 w23)))) } -::std::numeric::N32::to_string { fn(dup1991(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1935(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -76,10 +76,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup2001(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1945(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup2004(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1948(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -98,7 +98,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2961(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2913(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/snaps/vine/verbose_add/compiled.iv b/tests/snaps/vine/verbose_add/compiled.iv index 9cdaa964..e3162f26 100644 --- a/tests/snaps/vine/verbose_add/compiled.iv +++ b/tests/snaps/vine/verbose_add/compiled.iv @@ -42,7 +42,7 @@ ::std::logical::Option::None { enum(_ enum(r r)) } -::std::numeric::N32::to_string { fn(dup1936(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } +::std::numeric::N32::to_string { fn(dup1880(?(::std::numeric::N32::to_string::4 ::std::numeric::N32::to_string::3 x(w8 w7)) w8) w7) } ::std::numeric::N32::to_string::3 { x(w6 w9) @@ -51,10 +51,10 @@ ::std::numeric::N32::to_string::4 { x(_ tup(1 tup(tup(48 w3) w3))) } -::std::numeric::N32::to_string::5 { x(dup1946(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } +::std::numeric::N32::to_string::5 { x(dup1890(?(::std::numeric::N32::to_string::7 ::std::numeric::N32::to_string::6 x(w6 w2)) w6) w2) } ::std::numeric::N32::to_string::6 { - x(dup1949(@rem(10 w1) @div(10 w8)) x(w11 w15)) + x(dup1893(@rem(10 w1) @div(10 w8)) x(w11 w15)) 48 = @add(w1 w2) ::std::data::List::concat = fn(tup(1 tup(tup(w2 w13) w13)) fn(w11 w5)) ::std::numeric::N32::to_string::5 = x(w8 x(w5 w15)) @@ -73,7 +73,7 @@ ::std::IO::print::2 = x(x(w3 w17) x(w9 w10)) } -::std::IO::print::2 { x(w4 x(dup2906(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } +::std::IO::print::2 { x(w4 x(dup2858(?(::std::IO::print::4 ::std::IO::print::3 x(w4 x(w6 w1))) w6) w1)) } ::std::IO::print::3 { x(x(w17 w21) x(@sub(1 w1) tup(w4 w5))) diff --git a/tests/tests.rs b/tests/tests.rs index 0820e1b6..5b30060f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -65,6 +65,7 @@ fn tests(t: &mut DynTester) { test_vi(t, "tests/programs/segmented_sieve.vi", b"", ".txt"); test_vi(t, "tests/programs/sieve.vi", b"", ".txt"); test_vi(t, "tests/programs/so_random.vi", b"", ".txt"); + test_vi(t, "tests/programs/specializations.vi", b"", ".txt"); test_vi(t, "tests/programs/square_case.vi", b"", ".txt"); test_vi(t, "tests/programs/verbose_add.vi", b"", ".txt");