From 523beeffc4ed36fd181e67b662ce5e7ee882ee6b Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 16 Jul 2024 10:55:12 -0500 Subject: [PATCH 01/37] Parse associated constants --- compiler/noirc_frontend/src/parser/errors.rs | 2 ++ compiler/noirc_frontend/src/parser/parser.rs | 12 +++++++++--- .../noirc_frontend/src/parser/parser/traits.rs | 18 +++++++++++------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/compiler/noirc_frontend/src/parser/errors.rs b/compiler/noirc_frontend/src/parser/errors.rs index 41ea9f88c19..9dd4da82272 100644 --- a/compiler/noirc_frontend/src/parser/errors.rs +++ b/compiler/noirc_frontend/src/parser/errors.rs @@ -26,6 +26,8 @@ pub enum ParserErrorReason { EarlyReturn, #[error("Patterns aren't allowed in a trait's function declarations")] PatternInTraitFunctionParameter, + #[error("Patterns aren't allowed in a trait impl's associated constants")] + PatternInAssociatedConstant, #[error("Modifiers are ignored on a trait impl method")] TraitImplFunctionModifiers, #[error("comptime keyword is deprecated")] diff --git a/compiler/noirc_frontend/src/parser/parser.rs b/compiler/noirc_frontend/src/parser/parser.rs index de9095aaff2..7fb353f36da 100644 --- a/compiler/noirc_frontend/src/parser/parser.rs +++ b/compiler/noirc_frontend/src/parser/parser.rs @@ -566,7 +566,7 @@ where .map(|(block, span)| ExpressionKind::Comptime(block, span)) } -fn declaration<'a, P>(expr_parser: P) -> impl NoirParser + 'a +fn let_statement<'a, P>(expr_parser: P) -> impl NoirParser<((Pattern, UnresolvedType), Expression)> + 'a where P: ExprParser + 'a, { @@ -574,8 +574,14 @@ where ignore_then_commit(keyword(Keyword::Let).labelled(ParsingRuleLabel::Statement), pattern()); let p = p.then(optional_type_annotation()); let p = then_commit_ignore(p, just(Token::Assign)); - let p = then_commit(p, expr_parser); - p.map(StatementKind::new_let) + then_commit(p, expr_parser) +} + +fn declaration<'a, P>(expr_parser: P) -> impl NoirParser + 'a +where + P: ExprParser + 'a, +{ + let_statement(expr_parser).map(StatementKind::new_let) } fn pattern() -> impl NoirParser { diff --git a/compiler/noirc_frontend/src/parser/parser/traits.rs b/compiler/noirc_frontend/src/parser/parser/traits.rs index e64de584da4..bdc020e7441 100644 --- a/compiler/noirc_frontend/src/parser/parser/traits.rs +++ b/compiler/noirc_frontend/src/parser/parser/traits.rs @@ -2,12 +2,13 @@ use chumsky::prelude::*; use super::attributes::{attributes, validate_secondary_attributes}; use super::function::function_return_type; -use super::{block, expression, fresh_statement, function, function_declaration_parameters}; +use super::{block, expression, fresh_statement, function, function_declaration_parameters, let_statement}; use crate::ast::{ Expression, ItemVisibility, NoirTrait, NoirTraitImpl, TraitBound, TraitImplItem, TraitItem, UnresolvedTraitConstraint, UnresolvedType, }; +use crate::macros_api::Pattern; use crate::{ parser::{ ignore_then_commit, parenthesized, parser::primitives::keyword, NoirParser, ParserError, @@ -58,11 +59,7 @@ fn trait_constant_declaration() -> impl NoirParser { .then(parse_type()) .then(optional_default_value()) .then_ignore(just(Token::Semicolon)) - .validate(|((name, typ), default_value), span, emit| { - emit(ParserError::with_reason( - ParserErrorReason::ExperimentalFeature("Associated constants"), - span, - )); + .map(|((name, typ), default_value)| { TraitItem::Constant { name, typ, default_value } }) } @@ -145,7 +142,14 @@ fn trait_implementation_body() -> impl NoirParser> { .then_ignore(just(Token::Semicolon)) .map(|(name, alias)| TraitImplItem::Type { name, alias }); - function.or(alias).repeated() + let let_statement = let_statement(expression()) + .then_ignore(just(Token::Semicolon)) + .try_map(|((pattern, typ), expr), span| match pattern { + Pattern::Identifier(ident) => Ok(TraitImplItem::Constant(ident, typ, expr)), + _ => Err(ParserError::with_reason(ParserErrorReason::PatternInTraitFunctionParameter, span)), + }); + + choice((function, alias, let_statement)).repeated() } fn where_clause() -> impl NoirParser> { From 7901f663aaadb598aa5123eca82452a107c8d0fe Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 6 Aug 2024 12:58:28 -0500 Subject: [PATCH 02/37] Add features to the AST --- aztec_macros/src/utils/parse_utils.rs | 10 ++++++++ compiler/noirc_frontend/src/ast/expression.rs | 10 +++++++- compiler/noirc_frontend/src/ast/mod.rs | 7 +++++- compiler/noirc_frontend/src/ast/statement.rs | 14 +++++++++++ .../src/elaborator/expressions.rs | 1 + .../noirc_frontend/src/elaborator/types.rs | 1 + compiler/noirc_frontend/src/parser/parser.rs | 6 ++++- .../noirc_frontend/src/parser/parser/path.rs | 25 ++++++++++++++++--- .../src/parser/parser/traits.rs | 21 +++++++++------- .../noirc_frontend/src/parser/parser/types.rs | 12 +++++++-- tooling/lsp/src/requests/inlay_hint.rs | 4 +++ tooling/nargo_fmt/src/rewrite/expr.rs | 4 +++ tooling/nargo_fmt/src/rewrite/typ.rs | 1 + 13 files changed, 99 insertions(+), 17 deletions(-) diff --git a/aztec_macros/src/utils/parse_utils.rs b/aztec_macros/src/utils/parse_utils.rs index a2c177026c4..3b3813da6ee 100644 --- a/aztec_macros/src/utils/parse_utils.rs +++ b/aztec_macros/src/utils/parse_utils.rs @@ -268,6 +268,11 @@ fn empty_expression(expression: &mut Expression) { empty_block_expression(block_expression); } ExpressionKind::Quote(..) | ExpressionKind::Resolved(_) | ExpressionKind::Error => (), + ExpressionKind::AsTraitPath(path) => { + empty_unresolved_type(&mut path.typ); + empty_path(&mut path.trait_path); + empty_ident(&mut path.impl_item); + } } } @@ -324,6 +329,11 @@ fn empty_unresolved_type(unresolved_type: &mut UnresolvedType) { empty_unresolved_types(args); empty_unresolved_type(ret); } + UnresolvedTypeData::AsTraitPath(path) => { + empty_unresolved_type(&mut path.typ); + empty_path(&mut path.trait_path); + empty_ident(&mut path.impl_item); + } UnresolvedTypeData::FieldElement | UnresolvedTypeData::Integer(_, _) | UnresolvedTypeData::Bool diff --git a/compiler/noirc_frontend/src/ast/expression.rs b/compiler/noirc_frontend/src/ast/expression.rs index 7a324eb2600..aab995c49a1 100644 --- a/compiler/noirc_frontend/src/ast/expression.rs +++ b/compiler/noirc_frontend/src/ast/expression.rs @@ -14,7 +14,7 @@ use acvm::{acir::AcirField, FieldElement}; use iter_extended::vecmap; use noirc_errors::{Span, Spanned}; -use super::UnaryRhsMemberAccess; +use super::{AsTraitPath, UnaryRhsMemberAccess}; #[derive(Debug, PartialEq, Eq, Clone)] pub enum ExpressionKind { @@ -36,6 +36,7 @@ pub enum ExpressionKind { Quote(Tokens), Unquote(Box), Comptime(BlockExpression, Span), + AsTraitPath(AsTraitPath), // This variant is only emitted when inlining the result of comptime // code. It is used to translate function values back into the AST while @@ -593,6 +594,7 @@ impl Display for ExpressionKind { let tokens = vecmap(&tokens.0, ToString::to_string); write!(f, "quote {{ {} }}", tokens.join(" ")) } + AsTraitPath(path) => write!(f, "{path}"), } } } @@ -752,6 +754,12 @@ impl Display for Lambda { } } +impl Display for AsTraitPath { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "<{} as {}>::{}", self.typ, self.trait_path, self.impl_item) + } +} + impl FunctionDefinition { pub fn normal( name: &Ident, diff --git a/compiler/noirc_frontend/src/ast/mod.rs b/compiler/noirc_frontend/src/ast/mod.rs index f59d316950c..8e27f0bdda9 100644 --- a/compiler/noirc_frontend/src/ast/mod.rs +++ b/compiler/noirc_frontend/src/ast/mod.rs @@ -129,9 +129,13 @@ pub enum UnresolvedTypeData { /*env:*/ Box, ), - // The type of quoted code for metaprogramming + /// The type of quoted code for metaprogramming Quoted(crate::QuotedType), + /// An "as Trait" path leading to an associated type. + /// E.g. `::Bar` + AsTraitPath(Box), + /// An already resolved type. These can only be parsed if they were present in the token stream /// as a result of being spliced into a macro's token stream input. Resolved(QuotedTypeId), @@ -239,6 +243,7 @@ impl std::fmt::Display for UnresolvedTypeData { Unspecified => write!(f, "unspecified"), Parenthesized(typ) => write!(f, "({typ})"), Resolved(_) => write!(f, "(resolved type)"), + AsTraitPath(path) => write!(f, "{path}"), } } } diff --git a/compiler/noirc_frontend/src/ast/statement.rs b/compiler/noirc_frontend/src/ast/statement.rs index 8ce2e1a41c0..5d9a97fa6cf 100644 --- a/compiler/noirc_frontend/src/ast/statement.rs +++ b/compiler/noirc_frontend/src/ast/statement.rs @@ -358,6 +358,20 @@ impl UseTree { } } +/// A special kind of path in the form `::ident`. +/// Note that this path must consist of exactly two segments. +/// +/// An AsTraitPath may be used in either a type context where `ident` +/// refers to an associated type of a particular impl, or in a value +/// context where `ident` may refer to an associated constant or a +/// function within the impl. +#[derive(Debug, PartialEq, Eq, Clone, Hash)] +pub struct AsTraitPath { + pub typ: UnresolvedType, + pub trait_path: Path, + pub impl_item: Ident, +} + // Note: Path deliberately doesn't implement Recoverable. // No matter which default value we could give in Recoverable::error, // it would most likely cause further errors during name resolution diff --git a/compiler/noirc_frontend/src/elaborator/expressions.rs b/compiler/noirc_frontend/src/elaborator/expressions.rs index 6e2756f0301..5ba448f890e 100644 --- a/compiler/noirc_frontend/src/elaborator/expressions.rs +++ b/compiler/noirc_frontend/src/elaborator/expressions.rs @@ -64,6 +64,7 @@ impl<'context> Elaborator<'context> { self.push_err(ResolverError::UnquoteUsedOutsideQuote { span: expr.span }); (HirExpression::Error, Type::Error) } + ExpressionKind::AsTraitPath(_) => todo!("Implement AsTraitPath"), }; let id = self.interner.push_expr(hir_expr); self.interner.push_expr_location(id, expr.span, self.file); diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 7448ccaa42b..f8ba994f66b 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -155,6 +155,7 @@ impl<'context> Elaborator<'context> { } Parenthesized(typ) => self.resolve_type_inner(*typ, kind), Resolved(id) => self.interner.get_quoted_type(id).clone(), + AsTraitPath(_) => todo!("Resolve AsTraitPath"), }; if let Some(unresolved_span) = typ.span { diff --git a/compiler/noirc_frontend/src/parser/parser.rs b/compiler/noirc_frontend/src/parser/parser.rs index fdd2ab6d24f..fac52545ab4 100644 --- a/compiler/noirc_frontend/src/parser/parser.rs +++ b/compiler/noirc_frontend/src/parser/parser.rs @@ -23,6 +23,7 @@ //! prevent other parsers from being tried afterward since there is no longer an error. Thus, they should //! be limited to cases like the above `fn` example where it is clear we shouldn't back out of the //! current parser to try alternative parsers in a `choice` expression. +use self::path::as_trait_path; use self::primitives::{keyword, macro_quote_marker, mutable_reference, variable}; use self::types::{generic_type_args, maybe_comp_time}; pub use types::parse_type; @@ -522,7 +523,9 @@ where .map(|(block, span)| ExpressionKind::Comptime(block, span)) } -fn let_statement<'a, P>(expr_parser: P) -> impl NoirParser<((Pattern, UnresolvedType), Expression)> + 'a +fn let_statement<'a, P>( + expr_parser: P, +) -> impl NoirParser<((Pattern, UnresolvedType), Expression)> + 'a where P: ExprParser + 'a, { @@ -1086,6 +1089,7 @@ where unquote(expr_parser.clone()), variable(), literal(), + as_trait_path(parse_type()).map(ExpressionKind::AsTraitPath), macro_quote_marker(), )) .map_with_span(Expression::new) diff --git a/compiler/noirc_frontend/src/parser/parser/path.rs b/compiler/noirc_frontend/src/parser/parser/path.rs index 140650af1a2..091ac33a4b2 100644 --- a/compiler/noirc_frontend/src/parser/parser/path.rs +++ b/compiler/noirc_frontend/src/parser/parser/path.rs @@ -1,12 +1,12 @@ -use crate::ast::{Path, PathKind, PathSegment, UnresolvedType}; -use crate::parser::NoirParser; +use crate::ast::{AsTraitPath, Path, PathKind, PathSegment, UnresolvedType}; +use crate::parser::{NoirParser, ParserError, ParserErrorReason}; use crate::token::{Keyword, Token}; use chumsky::prelude::*; use super::keyword; -use super::primitives::{path_segment, path_segment_no_turbofish}; +use super::primitives::{ident, path_segment, path_segment_no_turbofish}; pub(super) fn path<'a>( type_parser: impl NoirParser + 'a, @@ -34,6 +34,25 @@ fn path_inner<'a>(segment: impl NoirParser + 'a) -> impl NoirParser )) } +/// Parses `::path_segment` +/// These paths only support exactly two segments. +pub(super) fn as_trait_path<'a>( + type_parser: impl NoirParser + 'a, +) -> impl NoirParser + 'a { + just(Token::Less) + .ignore_then(type_parser.clone()) + .then_ignore(keyword(Keyword::As)) + .then(path(type_parser)) + .then_ignore(just(Token::Greater)) + .then_ignore(just(Token::DoubleColon)) + .then(ident()) + .validate(|((typ, trait_path), impl_item), span, emit| { + let reason = ParserErrorReason::ExperimentalFeature("Fully qualified trait impl paths"); + emit(ParserError::with_reason(reason, span)); + AsTraitPath { typ, trait_path, impl_item } + }) +} + fn empty_path() -> impl NoirParser { let make_path = |kind| move |_, span| Path { segments: Vec::new(), kind, span }; let path_kind = |key, kind| keyword(key).map_with_span(make_path(kind)); diff --git a/compiler/noirc_frontend/src/parser/parser/traits.rs b/compiler/noirc_frontend/src/parser/parser/traits.rs index 4e1b0c3bc3d..4f1594c8801 100644 --- a/compiler/noirc_frontend/src/parser/parser/traits.rs +++ b/compiler/noirc_frontend/src/parser/parser/traits.rs @@ -3,7 +3,9 @@ use chumsky::prelude::*; use super::attributes::{attributes, validate_secondary_attributes}; use super::function::function_return_type; use super::path::path_no_turbofish; -use super::{block, expression, fresh_statement, function, function_declaration_parameters, let_statement}; +use super::{ + block, expression, fresh_statement, function, function_declaration_parameters, let_statement, +}; use crate::ast::{ Expression, ItemVisibility, NoirTrait, NoirTraitImpl, TraitBound, TraitImplItem, TraitItem, @@ -60,9 +62,7 @@ fn trait_constant_declaration() -> impl NoirParser { .then(parse_type()) .then(optional_default_value()) .then_ignore(just(Token::Semicolon)) - .map(|((name, typ), default_value)| { - TraitItem::Constant { name, typ, default_value } - }) + .map(|((name, typ), default_value)| TraitItem::Constant { name, typ, default_value }) } /// trait_function_declaration: 'fn' ident generics '(' declaration_parameters ')' function_return_type @@ -143,12 +143,15 @@ fn trait_implementation_body() -> impl NoirParser> { .then_ignore(just(Token::Semicolon)) .map(|(name, alias)| TraitImplItem::Type { name, alias }); - let let_statement = let_statement(expression()) - .then_ignore(just(Token::Semicolon)) - .try_map(|((pattern, typ), expr), span| match pattern { + let let_statement = let_statement(expression()).then_ignore(just(Token::Semicolon)).try_map( + |((pattern, typ), expr), span| match pattern { Pattern::Identifier(ident) => Ok(TraitImplItem::Constant(ident, typ, expr)), - _ => Err(ParserError::with_reason(ParserErrorReason::PatternInTraitFunctionParameter, span)), - }); + _ => Err(ParserError::with_reason( + ParserErrorReason::PatternInTraitFunctionParameter, + span, + )), + }, + ); choice((function, alias, let_statement)).repeated() } diff --git a/compiler/noirc_frontend/src/parser/parser/types.rs b/compiler/noirc_frontend/src/parser/parser/types.rs index 7c2bdcb9fa3..7c551ca96d1 100644 --- a/compiler/noirc_frontend/src/parser/parser/types.rs +++ b/compiler/noirc_frontend/src/parser/parser/types.rs @@ -1,4 +1,4 @@ -use super::path::path_no_turbofish; +use super::path::{as_trait_path, path_no_turbofish}; use super::primitives::token_kind; use super::{ expression_with_precedence, keyword, nothing, parenthesized, NoirParser, ParserError, @@ -45,10 +45,18 @@ pub(super) fn parse_type_inner<'a>( parenthesized_type(recursive_type_parser.clone()), tuple_type(recursive_type_parser.clone()), function_type(recursive_type_parser.clone()), - mutable_reference_type(recursive_type_parser), + mutable_reference_type(recursive_type_parser.clone()), + as_trait_path_type(recursive_type_parser), )) } +fn as_trait_path_type<'a>( + type_parser: impl NoirParser + 'a, +) -> impl NoirParser + 'a { + as_trait_path(type_parser) + .map_with_span(|path, span| UnresolvedTypeData::AsTraitPath(Box::new(path)).with_span(span)) +} + pub(super) fn parenthesized_type( recursive_type_parser: impl NoirParser, ) -> impl NoirParser { diff --git a/tooling/lsp/src/requests/inlay_hint.rs b/tooling/lsp/src/requests/inlay_hint.rs index 2ed441c623e..1f30d8f9ac1 100644 --- a/tooling/lsp/src/requests/inlay_hint.rs +++ b/tooling/lsp/src/requests/inlay_hint.rs @@ -269,6 +269,9 @@ impl<'a> InlayHintCollector<'a> { ExpressionKind::Comptime(block_expression, _span) => { self.collect_in_block_expression(block_expression); } + ExpressionKind::AsTraitPath(path) => { + self.collect_in_ident(&path.impl_item, true); + } ExpressionKind::Literal(..) | ExpressionKind::Variable(..) | ExpressionKind::Quote(..) @@ -632,6 +635,7 @@ fn get_expression_name(expression: &Expression) -> Option { ExpressionKind::MethodCall(method_call) => Some(method_call.method_name.to_string()), ExpressionKind::Cast(cast) => get_expression_name(&cast.lhs), ExpressionKind::Parenthesized(expr) => get_expression_name(expr), + ExpressionKind::AsTraitPath(path) => Some(path.impl_item.to_string()), ExpressionKind::Constructor(..) | ExpressionKind::Infix(..) | ExpressionKind::Index(..) diff --git a/tooling/nargo_fmt/src/rewrite/expr.rs b/tooling/nargo_fmt/src/rewrite/expr.rs index 5673baf2893..41b15069546 100644 --- a/tooling/nargo_fmt/src/rewrite/expr.rs +++ b/tooling/nargo_fmt/src/rewrite/expr.rs @@ -179,6 +179,10 @@ pub(crate) fn rewrite( format!("$({})", rewrite_sub_expr(visitor, shape, *expr)) } } + ExpressionKind::AsTraitPath(path) => { + let trait_path = rewrite_path(visitor, shape, path.trait_path); + format!("<{} as {}>::{}", path.typ, trait_path, path.impl_item) + } } } diff --git a/tooling/nargo_fmt/src/rewrite/typ.rs b/tooling/nargo_fmt/src/rewrite/typ.rs index 3298ed8ae73..b586f32a6fe 100644 --- a/tooling/nargo_fmt/src/rewrite/typ.rs +++ b/tooling/nargo_fmt/src/rewrite/typ.rs @@ -58,6 +58,7 @@ pub(crate) fn rewrite(visitor: &FmtVisitor, _shape: Shape, typ: UnresolvedType) UnresolvedTypeData::Resolved(_) => { unreachable!("Unexpected macro expansion of a type in nargo fmt input") } + UnresolvedTypeData::AsTraitPath(path) => path.to_string(), UnresolvedTypeData::Unspecified => todo!(), UnresolvedTypeData::FieldElement From 38e09eff2567d7246b9d06bc1efd4a7fff69ab33 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 6 Aug 2024 16:01:42 -0500 Subject: [PATCH 03/37] Some progress --- compiler/noirc_frontend/src/elaborator/mod.rs | 23 +++++--- .../noirc_frontend/src/elaborator/traits.rs | 57 +++++++++++++------ .../noirc_frontend/src/elaborator/types.rs | 17 ++++++ compiler/noirc_frontend/src/hir_def/traits.rs | 27 +++++++-- compiler/noirc_frontend/src/node_interner.rs | 3 +- 5 files changed, 95 insertions(+), 32 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 873da5a0c5e..43e02b373ba 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -121,6 +121,9 @@ pub struct Elaborator<'context> { /// to the corresponding trait impl ID. current_trait_impl: Option, + /// The trait we're currently resolving, if we are resolving one. + current_trait: Option, + /// In-resolution names /// /// This needs to be a set because we can have multiple in-resolution @@ -208,6 +211,7 @@ impl<'context> Elaborator<'context> { debug_comptime_in_file, unresolved_globals: BTreeMap::new(), enable_arithmetic_generics, + current_trait: None, } } @@ -1009,18 +1013,20 @@ impl<'context> Elaborator<'context> { .flat_map(|item| self.resolve_trait_constraint(item)) .collect::>(); + // TODO: UnresolvedTraitImpl doesn't have constants & types + // but NoirTraitImpl does + let associated_types = + self.collect_associated_types(trait_impl.resolved_trait_generics); self.collect_trait_impl_methods(trait_id, trait_impl, &where_clause); let span = trait_impl.object_type.span; - let span = if let Some(span) = span { - span - } else if self.interner.is_in_lsp_mode() { - // A span might not be set if this was generated by a macro - Default::default() - } else { - span.expect("All trait self types should have spans") - }; + let span = span.unwrap_or_else(|| { + if self.interner.is_in_lsp_mode() { + return Default::default(); + } + unreachable!("All trait self types should have spans") + }); self.declare_methods_on_struct(true, &mut trait_impl.methods, span); let methods = trait_impl.methods.function_ids(); @@ -1038,6 +1044,7 @@ impl<'context> Elaborator<'context> { file: trait_impl.file_id, where_clause, methods, + associated_types: Vec::new(), }); let generics = vecmap(&self.generics, |generic| generic.type_var.clone()); diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index 1e48fdd07e7..f2b999592e1 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -13,7 +13,7 @@ use crate::{ }, hir_def::{ function::Parameters, - traits::{TraitConstant, TraitFunction, TraitType}, + traits::{TraitFunction, TraitType}, }, macros_api::{ BlockExpression, FunctionDefinition, FunctionReturnType, Ident, ItemVisibility, @@ -21,7 +21,7 @@ use crate::{ }, node_interner::{FuncId, TraitId}, token::Attributes, - Kind, ResolvedGeneric, Type, TypeBindings, TypeVariableKind, + Kind, ResolvedGeneric, Type, TypeBindings, TypeVariable, TypeVariableKind, }; use super::Elaborator; @@ -30,18 +30,21 @@ impl<'context> Elaborator<'context> { pub fn collect_traits(&mut self, traits: &BTreeMap) { for (trait_id, unresolved_trait) in traits { self.recover_generics(|this| { + this.current_trait = Some(*trait_id); + let resolved_generics = this.interner.get_trait(*trait_id).generics.clone(); this.add_existing_generics( &unresolved_trait.trait_def.generics, &resolved_generics, ); - // Resolve order - // 1. Trait Types ( Trait constants can have a trait type, therefore types before constants) - let _ = this.resolve_trait_types(unresolved_trait); - // 2. Trait Constants ( Trait's methods can use trait types & constants, therefore they should be after) - let _ = this.resolve_trait_constants(unresolved_trait); - // 3. Trait Methods + // Resolve constants before types & methods since both types & methods may refer to trait constants. + let mut associated_types = this.resolve_trait_constants(unresolved_trait); + associated_types.extend(this.resolve_trait_types(unresolved_trait)); + this.interner.update_trait(*trait_id, |trait_def| { + trait_def.set_associated_types(associated_types); + }); + let methods = this.resolve_trait_methods(*trait_id, unresolved_trait); this.interner.update_trait(*trait_id, |trait_def| { @@ -57,19 +60,39 @@ impl<'context> Elaborator<'context> { self.interner.try_add_prefix_operator_trait(*trait_id); } } + + self.current_trait = None; } - fn resolve_trait_types(&mut self, _unresolved_trait: &UnresolvedTrait) -> Vec { - // TODO - vec![] + fn resolve_trait_types(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { + let mut types = Vec::new(); + + for item in &unresolved_trait.trait_def.items { + if let TraitItem::Type { name } = item { + let type_variable = TypeVariable::unbound(self.interner.next_type_variable_id()); + let name_string = Rc::new(name.to_string()); + let typ = Type::NamedGeneric(type_variable, name_string, Kind::Normal); + types.push(TraitType { name: name.clone(), typ }); + } + } + + types } - fn resolve_trait_constants( - &mut self, - _unresolved_trait: &UnresolvedTrait, - ) -> Vec { - // TODO - vec![] + fn resolve_trait_constants(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { + let mut types = Vec::new(); + + for item in &unresolved_trait.trait_def.items { + if let TraitItem::Constant { name, typ, default_value: _ } = item { + let type_variable = TypeVariable::unbound(self.interner.next_type_variable_id()); + let name_string = Rc::new(name.to_string()); + let typ = Box::new(self.resolve_type(typ.clone())); + let typ = Type::NamedGeneric(type_variable, name_string, Kind::Numeric(typ)); + types.push(TraitType { name: name.clone(), typ }); + } + } + + types } fn resolve_trait_methods( diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index f8ba994f66b..b6cfc41eb0d 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -234,6 +234,23 @@ impl<'context> Elaborator<'context> { } else if name == WILDCARD_TYPE { return self.interner.next_type_variable(); } + // Resolve Self::Foo to an associated type + } else if path.segments.len() == 2 && path.first_name() == SELF_TYPE_NAME { + if let Some(trait_id) = self.current_trait { + let the_trait = self.interner.get_trait(trait_id); + if let Some(typ) = the_trait.get_associated_type(path.last_name()) { + return typ.clone(); + } + } + + if let Some(impl_id) = self.current_trait_impl { + let the_impl = self.interner.get_trait_implementation(impl_id); + let the_impl = the_impl.borrow(); + + if let Some(typ) = the_impl.get_associated_type(path.last_name()) { + return typ.clone(); + } + } } let span = path.span(); diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 099c9ea78f7..51279ed3b54 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -23,15 +23,14 @@ pub struct TraitFunction { #[derive(Clone, Debug, PartialEq, Eq)] pub struct TraitConstant { pub name: Ident, - pub ty: Type, + pub typ: Type, pub span: Span, } #[derive(Clone, Debug, PartialEq, Eq)] pub struct TraitType { pub name: Ident, - pub ty: Type, - pub span: Span, + pub typ: Type, } /// Represents a trait in the type system. Each instance of this struct @@ -53,8 +52,7 @@ pub struct Trait { /// the information needed to create the full TraitFunction. pub method_ids: HashMap, - pub constants: Vec, - pub types: Vec, + pub associated_types: Vec, pub name: Ident, pub generics: Generics, @@ -77,6 +75,8 @@ pub struct TraitImpl { pub file: FileId, pub methods: Vec, // methods[i] is the implementation of trait.methods[i] for Type typ + pub associated_types: Vec, + /// The where clause, if present, contains each trait requirement which must /// be satisfied for this impl to be selected. E.g. in `impl Eq for [T] where T: Eq`, /// `where_clause` would contain the one `T: Eq` constraint. If there is no where clause, @@ -84,6 +84,12 @@ pub struct TraitImpl { pub where_clause: Vec, } +impl TraitImpl { + pub fn get_associated_type(&self, name: &str) -> Option<&Type> { + self.associated_types.iter().find(|typ| typ.name.0.contents == name).map(|typ| &typ.typ) + } +} + #[derive(Debug, Clone, PartialEq, Eq)] pub struct TraitConstraint { pub typ: Type, @@ -131,6 +137,17 @@ impl Trait { } None } + + pub fn set_associated_types(&mut self, associated_types: Vec) { + self.associated_types = associated_types; + } + + pub fn get_associated_type(&self, last_name: &str) -> Option<&Type> { + self.associated_types + .iter() + .find(|typ| typ.name.0.contents == last_name) + .map(|typ| &typ.typ) + } } impl std::fmt::Display for Trait { diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index c701b29f898..48086c99a74 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -657,8 +657,7 @@ impl NodeInterner { self_type_typevar: TypeVariable::unbound(self_type_typevar_id), methods: Vec::new(), method_ids: unresolved_trait.method_ids.clone(), - constants: Vec::new(), - types: Vec::new(), + associated_types: Vec::new(), }; self.traits.insert(type_id, new_trait); From b862af39fc665ff54a18ffee4815862c14e502cb Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Wed, 7 Aug 2024 16:08:09 -0500 Subject: [PATCH 04/37] Resolve associated type paths from Self --- .../noirc_frontend/src/elaborator/comptime.rs | 17 +++-- compiler/noirc_frontend/src/elaborator/mod.rs | 15 +--- .../noirc_frontend/src/elaborator/patterns.rs | 2 +- .../src/elaborator/trait_impls.rs | 66 +++++++++++++---- .../noirc_frontend/src/elaborator/traits.rs | 19 ++--- .../noirc_frontend/src/elaborator/types.rs | 43 ++++++----- .../src/hir/def_collector/dc_crate.rs | 5 +- .../src/hir/def_collector/dc_mod.rs | 47 ++++++++---- compiler/noirc_frontend/src/hir_def/traits.rs | 11 +-- compiler/noirc_frontend/src/node_interner.rs | 73 +++++++++++++++++-- 10 files changed, 202 insertions(+), 96 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/comptime.rs b/compiler/noirc_frontend/src/elaborator/comptime.rs index afa2e7fa7a8..7195d96efcc 100644 --- a/compiler/noirc_frontend/src/elaborator/comptime.rs +++ b/compiler/noirc_frontend/src/elaborator/comptime.rs @@ -276,13 +276,14 @@ impl<'context> Elaborator<'context> { }); } TopLevelStatement::TraitImpl(mut trait_impl) => { - let methods = dc_mod::collect_trait_impl_functions( - self.interner, - &mut trait_impl, - self.crate_id, - self.file, - self.local_module, - ); + let (methods, associated_types, associated_constants) = + dc_mod::collect_trait_impl_items( + self.interner, + &mut trait_impl, + self.crate_id, + self.file, + self.local_module, + ); generated_items.trait_impls.push(UnresolvedTraitImpl { file_id: self.file, @@ -293,6 +294,8 @@ impl<'context> Elaborator<'context> { methods, generics: trait_impl.impl_generics, where_clause: trait_impl.where_clause, + associated_types, + associated_constants, // These last fields are filled in later trait_id: None, diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 43e02b373ba..9df18fdefb4 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -1013,15 +1013,9 @@ impl<'context> Elaborator<'context> { .flat_map(|item| self.resolve_trait_constraint(item)) .collect::>(); - // TODO: UnresolvedTraitImpl doesn't have constants & types - // but NoirTraitImpl does - let associated_types = - self.collect_associated_types(trait_impl.resolved_trait_generics); self.collect_trait_impl_methods(trait_id, trait_impl, &where_clause); - let span = trait_impl.object_type.span; - - let span = span.unwrap_or_else(|| { + let span = trait_impl.object_type.span.unwrap_or_else(|| { if self.interner.is_in_lsp_mode() { return Default::default(); } @@ -1040,11 +1034,10 @@ impl<'context> Elaborator<'context> { ident: trait_impl.trait_path.last_ident(), typ: self_type.clone(), trait_id, - trait_generics: trait_generics.clone(), + trait_generics, file: trait_impl.file_id, - where_clause, + where_clause: where_clause.clone(), methods, - associated_types: Vec::new(), }); let generics = vecmap(&self.generics, |generic| generic.type_var.clone()); @@ -1052,7 +1045,6 @@ impl<'context> Elaborator<'context> { if let Err((prev_span, prev_file)) = self.interner.add_trait_implementation( self_type.clone(), trait_id, - trait_generics, trait_impl.impl_id.expect("impl_id should be set in define_function_metas"), generics, resolved_trait_impl, @@ -1388,6 +1380,7 @@ impl<'context> Elaborator<'context> { let impl_id = self.interner.next_trait_impl_id(); self.current_trait_impl = Some(impl_id); + self.register_associated_types(impl_id, trait_impl); self.define_function_metas_for_functions(&mut trait_impl.methods); trait_impl.resolved_object_type = self.self_type.take(); diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index ade5420bce4..de928b4e2e3 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -600,7 +600,7 @@ impl<'context> Elaborator<'context> { // to specify a redundant type annotation. if *assumed { bindings.insert( - the_trait.self_type_typevar_id, + the_trait.self_type_typevar.id(), (the_trait.self_type_typevar.clone(), constraint.typ.clone()), ); } diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index 853ee6389fd..64893b7cddc 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -1,16 +1,16 @@ use crate::{ + ast::UnresolvedTypeExpression, graph::CrateId, hir::def_collector::{dc_crate::UnresolvedTraitImpl, errors::DefCollectorErrorKind}, + hir_def::traits::TraitType, + node_interner::TraitImplId, ResolvedGeneric, }; use crate::{ hir::def_collector::errors::DuplicateType, - hir_def::{ - traits::{TraitConstraint, TraitFunction}, - types::Generics, - }, + hir_def::traits::{TraitConstraint, TraitFunction}, node_interner::{FuncId, TraitId}, - Type, TypeBindings, + Type, }; use noirc_errors::Location; @@ -28,6 +28,8 @@ impl<'context> Elaborator<'context> { self.local_module = trait_impl.module_id; self.file = trait_impl.file_id; + let impl_id = trait_impl.impl_id.expect("impl_id should be set in define_function_metas"); + // In this Vec methods[i] corresponds to trait.methods[i]. If the impl has no implementation // for a particular method, the default implementation will be added at that slot. let mut ordered_methods = Vec::new(); @@ -38,7 +40,6 @@ impl<'context> Elaborator<'context> { // set of function ids that have a corresponding method in the trait let mut func_ids_in_trait = HashSet::default(); - let trait_generics = &self.interner.get_trait(trait_id).generics.clone(); // Temporarily take ownership of the trait's methods so we can iterate over them // while also mutating the interner let the_trait = self.interner.get_trait_mut(trait_id); @@ -85,7 +86,8 @@ impl<'context> Elaborator<'context> { method, trait_impl_where_clause, &trait_impl.resolved_trait_generics, - trait_generics, + trait_id, + impl_id, ); func_ids_in_trait.insert(*func_id); @@ -141,16 +143,15 @@ impl<'context> Elaborator<'context> { func_id: &FuncId, method: &TraitFunction, trait_impl_where_clause: &[TraitConstraint], - impl_trait_generics: &[Type], - trait_generics: &Generics, + trait_impl_generics: &[Type], + trait_id: TraitId, + impl_id: TraitImplId, ) { - let mut bindings = TypeBindings::new(); - for (trait_generic, impl_trait_generic) in trait_generics.iter().zip(impl_trait_generics) { - bindings.insert( - trait_generic.type_var.id(), - (trait_generic.type_var.clone(), impl_trait_generic.clone()), - ); - } + // First get the general trait to impl bindings. + // Then we'll need to add the bindings for this specific method. + let self_type = self.self_type.as_ref().unwrap().clone(); + let mut bindings = + self.interner.trait_to_impl_bindings(trait_id, impl_id, trait_impl_generics, self_type); let override_meta = self.interner.function_meta(func_id); // Substitute each generic on the trait function with the corresponding generic on the impl function @@ -225,4 +226,37 @@ impl<'context> Elaborator<'context> { }); } } + + /// Resolve & save the associated types for the given trait impl. + /// These are stored outside of the TraitImpl object since they are + /// required before it is created to resolve the type signature of each method. + pub(super) fn register_associated_types( + &mut self, + impl_id: TraitImplId, + trait_impl: &mut UnresolvedTraitImpl, + ) { + let mut associated_types = Vec::new(); + + for (name, typ, expression) in trait_impl.associated_constants.drain(..) { + // TODO: What to do with the expression type? + let _typ = self.resolve_type(typ.clone()); + let span = expression.span; + let expr = match UnresolvedTypeExpression::from_expr(expression, span) { + Ok(expr) => expr, + Err(error) => { + self.push_err(error); + continue; + } + }; + let typ = self.convert_expression_type(expr); + associated_types.push(TraitType { name, typ }); + } + + for (name, typ) in trait_impl.associated_types.drain(..) { + let typ = self.resolve_type(typ); + associated_types.push(TraitType { name, typ }); + } + + self.interner.set_associated_types_for_impl(impl_id, associated_types); + } } diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index f2b999592e1..788993bbc7a 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -286,24 +286,18 @@ pub(crate) fn check_trait_impl_method_matches_declaration( let definition_type = meta.typ.as_monotype(); - let impl_ = + let impl_id = meta.trait_impl.expect("Trait impl function should have a corresponding trait impl"); // If the trait implementation is not defined in the interner then there was a previous // error in resolving the trait path and there is likely no trait for this impl. - let Some(impl_) = interner.try_get_trait_implementation(impl_) else { + let Some(impl_) = interner.try_get_trait_implementation(impl_id) else { return errors; }; let impl_ = impl_.borrow(); let trait_info = interner.get_trait(impl_.trait_id); - let mut bindings = TypeBindings::new(); - bindings.insert( - trait_info.self_type_typevar_id, - (trait_info.self_type_typevar.clone(), impl_.typ.clone()), - ); - if trait_info.generics.len() != impl_.trait_generics.len() { let expected = trait_info.generics.len(); let found = impl_.trait_generics.len(); @@ -313,9 +307,12 @@ pub(crate) fn check_trait_impl_method_matches_declaration( } // Substitute each generic on the trait with the corresponding generic on the impl - for (generic, arg) in trait_info.generics.iter().zip(&impl_.trait_generics) { - bindings.insert(generic.type_var.id(), (generic.type_var.clone(), arg.clone())); - } + let mut bindings = interner.trait_to_impl_bindings( + impl_.trait_id, + impl_id, + &impl_.trait_generics, + impl_.typ.clone(), + ); // If this is None, the trait does not have the corresponding function. // This error should have been caught in name resolution already so we don't diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index b6cfc41eb0d..8b0aea0e516 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -212,6 +212,26 @@ impl<'context> Elaborator<'context> { self.generics.iter().find(|generic| generic.name.as_ref() == target_name) } + // Resolve Self::Foo to an associated type on the current trait or trait impl + fn lookup_associated_type_on_self(&self, path: &Path) -> Option { + if path.segments.len() == 2 && path.first_name() == SELF_TYPE_NAME { + if let Some(trait_id) = self.current_trait { + let the_trait = self.interner.get_trait(trait_id); + if let Some(typ) = the_trait.get_associated_type(path.last_name()) { + return Some(typ.clone()); + } + } + + if let Some(impl_id) = self.current_trait_impl { + let name = path.last_name(); + if let Some(typ) = self.interner.find_associated_type_for_impl(impl_id, name) { + return Some(typ.clone()); + } + } + } + None + } + fn resolve_named_type(&mut self, path: Path, args: Vec) -> Type { if args.is_empty() { if let Some(typ) = self.lookup_generic_or_global_type(&path) { @@ -234,23 +254,8 @@ impl<'context> Elaborator<'context> { } else if name == WILDCARD_TYPE { return self.interner.next_type_variable(); } - // Resolve Self::Foo to an associated type - } else if path.segments.len() == 2 && path.first_name() == SELF_TYPE_NAME { - if let Some(trait_id) = self.current_trait { - let the_trait = self.interner.get_trait(trait_id); - if let Some(typ) = the_trait.get_associated_type(path.last_name()) { - return typ.clone(); - } - } - - if let Some(impl_id) = self.current_trait_impl { - let the_impl = self.interner.get_trait_implementation(impl_id); - let the_impl = the_impl.borrow(); - - if let Some(typ) = the_impl.get_associated_type(path.last_name()) { - return typ.clone(); - } - } + } else if let Some(typ) = self.lookup_associated_type_on_self(&path) { + return typ; } let span = path.span(); @@ -387,6 +392,8 @@ impl<'context> Elaborator<'context> { let generic = generic.clone(); return Some(Type::NamedGeneric(generic.type_var, generic.name, generic.kind)); } + } else if let Some(typ) = self.lookup_associated_type_on_self(path) { + return Some(typ); } // If we cannot find a local generic of the same name, try to look up a global @@ -1167,7 +1174,7 @@ impl<'context> Elaborator<'context> { let the_trait = self.interner.get_trait(trait_method_id.trait_id); let object_type = object_type.substitute(&bindings); bindings.insert( - the_trait.self_type_typevar_id, + the_trait.self_type_typevar.id(), (the_trait.self_type_typevar.clone(), object_type.clone()), ); self.interner.select_impl_for_expression( diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs index fabd76a2818..1a1071ae0ab 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs @@ -12,7 +12,7 @@ use crate::{Generics, Type}; use crate::hir::resolution::import::{resolve_import, ImportDirective, PathResolution}; use crate::hir::Context; -use crate::macros_api::{MacroError, MacroProcessor}; +use crate::macros_api::{Expression, MacroError, MacroProcessor}; use crate::node_interner::{ FuncId, GlobalId, NodeInterner, ReferenceId, StructId, TraitId, TraitImplId, TypeAliasId, }; @@ -81,6 +81,9 @@ pub struct UnresolvedTraitImpl { pub generics: UnresolvedGenerics, pub where_clause: Vec, + pub associated_types: Vec<(Ident, UnresolvedType)>, + pub associated_constants: Vec<(Ident, UnresolvedType, Expression)>, + // Every field after this line is filled in later in the elaborator pub trait_id: Option, pub impl_id: Option, diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index be2afd13507..163ed45e385 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -13,7 +13,7 @@ use crate::ast::{ NoirStruct, NoirTrait, NoirTraitImpl, NoirTypeAlias, Pattern, TraitImplItem, TraitItem, TypeImpl, }; -use crate::macros_api::NodeInterner; +use crate::macros_api::{Expression, NodeInterner, UnresolvedType}; use crate::node_interner::{ModuleAttributes, ReferenceId}; use crate::{ graph::CrateId, @@ -162,13 +162,14 @@ impl<'a> ModCollector<'a> { for mut trait_impl in impls { let trait_name = trait_impl.trait_name.clone(); - let mut unresolved_functions = collect_trait_impl_functions( - &mut context.def_interner, - &mut trait_impl, - krate, - self.file_id, - self.module_id, - ); + let (mut unresolved_functions, associated_types, associated_constants) = + collect_trait_impl_items( + &mut context.def_interner, + &mut trait_impl, + krate, + self.file_id, + self.module_id, + ); let module = ModuleId { krate, local_id: self.module_id }; @@ -186,6 +187,8 @@ impl<'a> ModCollector<'a> { generics: trait_impl.impl_generics, where_clause: trait_impl.where_clause, trait_generics: trait_impl.trait_generics, + associated_constants, + associated_types, // These last fields are filled later on trait_id: None, @@ -858,28 +861,40 @@ fn is_native_field(str: &str) -> bool { } } -pub(crate) fn collect_trait_impl_functions( +/// Returns a tuple of (methods, associated types, associated constants) +pub(crate) fn collect_trait_impl_items( interner: &mut NodeInterner, trait_impl: &mut NoirTraitImpl, krate: CrateId, file_id: FileId, local_id: LocalModuleId, -) -> UnresolvedFunctions { +) -> (UnresolvedFunctions, Vec<(Ident, UnresolvedType)>, Vec<(Ident, UnresolvedType, Expression)>) { let mut unresolved_functions = UnresolvedFunctions { file_id, functions: Vec::new(), trait_id: None, self_type: None }; + let mut associated_types = Vec::new(); + let mut associated_constants = Vec::new(); + let module = ModuleId { krate, local_id }; for item in std::mem::take(&mut trait_impl.items) { - if let TraitImplItem::Function(impl_method) = item { - let func_id = interner.push_empty_fn(); - let location = Location::new(impl_method.span(), file_id); - interner.push_function(func_id, &impl_method.def, module, location); - unresolved_functions.push_fn(local_id, func_id, impl_method); + match item { + TraitImplItem::Function(impl_method) => { + let func_id = interner.push_empty_fn(); + let location = Location::new(impl_method.span(), file_id); + interner.push_function(func_id, &impl_method.def, module, location); + unresolved_functions.push_fn(local_id, func_id, impl_method); + } + TraitImplItem::Constant(name, typ, expr) => { + associated_constants.push((name, typ, expr)); + } + TraitImplItem::Type { name, alias } => { + associated_types.push((name, alias)); + } } } - unresolved_functions + (unresolved_functions, associated_types, associated_constants) } pub(crate) fn collect_global( diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 51279ed3b54..2a5421f0fe7 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -4,7 +4,7 @@ use crate::ast::{Ident, NoirFunction}; use crate::{ graph::CrateId, node_interner::{FuncId, TraitId, TraitMethodId}, - Generics, Type, TypeBindings, TypeVariable, TypeVariableId, + Generics, Type, TypeBindings, TypeVariable, }; use fm::FileId; use noirc_errors::{Location, Span}; @@ -62,7 +62,6 @@ pub struct Trait { /// to this TypeVariable. Then when we check if the types of trait impl elements /// match the definition in the trait, we bind this TypeVariable to whatever /// the correct Self type is for that particular impl block. - pub self_type_typevar_id: TypeVariableId, pub self_type_typevar: TypeVariable, } @@ -75,8 +74,6 @@ pub struct TraitImpl { pub file: FileId, pub methods: Vec, // methods[i] is the implementation of trait.methods[i] for Type typ - pub associated_types: Vec, - /// The where clause, if present, contains each trait requirement which must /// be satisfied for this impl to be selected. E.g. in `impl Eq for [T] where T: Eq`, /// `where_clause` would contain the one `T: Eq` constraint. If there is no where clause, @@ -84,12 +81,6 @@ pub struct TraitImpl { pub where_clause: Vec, } -impl TraitImpl { - pub fn get_associated_type(&self, name: &str) -> Option<&Type> { - self.associated_types.iter().find(|typ| typ.name.0.contents == name).map(|typ| &typ.typ) - } -} - #[derive(Debug, Clone, PartialEq, Eq)] pub struct TraitConstraint { pub typ: Type, diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 48086c99a74..e4601b189d6 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -19,6 +19,7 @@ use crate::hir::comptime; use crate::hir::def_collector::dc_crate::CompilationError; use crate::hir::def_collector::dc_crate::{UnresolvedStruct, UnresolvedTrait, UnresolvedTypeAlias}; use crate::hir::def_map::{LocalModuleId, ModuleId}; +use crate::hir_def::traits::TraitType; use crate::macros_api::UnaryOp; use crate::QuotedType; @@ -132,6 +133,11 @@ pub struct NodeInterner { next_trait_implementation_id: usize, + /// The associated types for each trait impl. + /// This is stored outside of the TraitImpl object since it is required before that object is + /// created, when resolving the type signature of each method in the impl. + trait_impl_associated_types: HashMap>, + /// Trait implementations on each type. This is expected to always have the same length as /// `self.trait_implementations`. /// @@ -603,6 +609,7 @@ impl Default for NodeInterner { reference_graph_indices: HashMap::default(), reference_modules: HashMap::default(), comptime_scopes: vec![HashMap::default()], + trait_impl_associated_types: HashMap::default(), } } } @@ -645,16 +652,13 @@ impl NodeInterner { unresolved_trait: &UnresolvedTrait, generics: Generics, ) { - let self_type_typevar_id = self.next_type_variable_id(); - let new_trait = Trait { id: type_id, name: unresolved_trait.trait_def.name.clone(), crate_id: unresolved_trait.crate_id, location: Location::new(unresolved_trait.trait_def.span, unresolved_trait.file_id), generics, - self_type_typevar_id, - self_type_typevar: TypeVariable::unbound(self_type_typevar_id), + self_type_typevar: TypeVariable::unbound(self.next_type_variable_id()), methods: Vec::new(), method_ids: unresolved_trait.method_ids.clone(), associated_types: Vec::new(), @@ -1575,7 +1579,6 @@ impl NodeInterner { &mut self, object_type: Type, trait_id: TraitId, - trait_generics: Vec, impl_id: TraitImplId, impl_generics: GenericTypeVars, trait_impl: Shared, @@ -1597,6 +1600,8 @@ impl NodeInterner { let instantiated_object_type = object_type.substitute(&substitutions); + let trait_generics = &trait_impl.borrow().trait_generics; + // Ignoring overlapping `TraitImplKind::Assumed` impls here is perfectly fine. // It should never happen since impls are defined at global scope, but even // if they were, we should never prevent defining a new impl because a 'where' @@ -1987,6 +1992,64 @@ impl NodeInterner { pub fn is_in_lsp_mode(&self) -> bool { self.lsp_mode } + + pub fn set_associated_types_for_impl( + &mut self, + impl_id: TraitImplId, + associated_types: Vec, + ) { + self.trait_impl_associated_types.insert(impl_id, associated_types); + } + + pub fn get_associated_types_for_impl(&self, impl_id: TraitImplId) -> &[TraitType] { + &self.trait_impl_associated_types[&impl_id] + } + + pub fn find_associated_type_for_impl( + &self, + impl_id: TraitImplId, + type_name: &str, + ) -> Option<&Type> { + let types = self.trait_impl_associated_types.get(&impl_id)?; + types.iter().find(|typ| typ.name.0.contents == type_name).map(|typ| &typ.typ) + } + + /// Return a set of TypeBindings to bind types from the parent trait to those from the trait impl. + pub fn trait_to_impl_bindings( + &self, + trait_id: TraitId, + impl_id: TraitImplId, + trait_impl_generics: &[Type], + impl_self_type: Type, + ) -> TypeBindings { + let mut bindings = TypeBindings::new(); + let the_trait = self.get_trait(trait_id); + let trait_generics = the_trait.generics.clone(); + + let self_type_var = the_trait.self_type_typevar.clone(); + bindings.insert(self_type_var.id(), (self_type_var, impl_self_type)); + + for (trait_generic, trait_impl_generic) in trait_generics.iter().zip(trait_impl_generics) { + bindings.insert( + trait_generic.type_var.id(), + (trait_generic.type_var.clone(), trait_impl_generic.clone()), + ); + } + + // Now that the normal bindings are added, we still need to bind the associated types + let impl_associated_types = self.get_associated_types_for_impl(impl_id); + let trait_associated_types = &the_trait.associated_types; + + for (trait_type, impl_type) in trait_associated_types.iter().zip(impl_associated_types) { + let type_variable = match &trait_type.typ { + Type::NamedGeneric(type_variable, ..) => type_variable, + other => unreachable!("A trait's associated type should always be a named generic, but found: {other:?}"), + }; + bindings.insert(type_variable.id(), (type_variable.clone(), impl_type.typ.clone())); + } + + bindings + } } impl Methods { From 9f1402b35643779da5230f42dcb2f931a4d5e9e9 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Thu, 8 Aug 2024 15:56:33 -0500 Subject: [PATCH 05/37] Break everything --- compiler/noirc_frontend/src/ast/mod.rs | 82 +++++++++++++++---- compiler/noirc_frontend/src/ast/traits.rs | 4 +- compiler/noirc_frontend/src/elaborator/mod.rs | 24 +++--- .../src/hir/comptime/hir_to_display_ast.rs | 15 ++-- compiler/noirc_frontend/src/hir_def/expr.rs | 1 + compiler/noirc_frontend/src/hir_def/traits.rs | 12 ++- compiler/noirc_frontend/src/node_interner.rs | 2 +- compiler/noirc_frontend/src/parser/parser.rs | 12 +-- .../noirc_frontend/src/parser/parser/types.rs | 20 +++-- 9 files changed, 122 insertions(+), 50 deletions(-) diff --git a/compiler/noirc_frontend/src/ast/mod.rs b/compiler/noirc_frontend/src/ast/mod.rs index 8e27f0bdda9..5dad4b9cddc 100644 --- a/compiler/noirc_frontend/src/ast/mod.rs +++ b/compiler/noirc_frontend/src/ast/mod.rs @@ -112,10 +112,10 @@ pub enum UnresolvedTypeData { Parenthesized(Box), /// A Named UnresolvedType can be a struct type or a type variable - Named(Path, Vec, /*is_synthesized*/ bool), + Named(Path, GenericTypeArgs, /*is_synthesized*/ bool), /// A Trait as return type or parameter of function, including its generics - TraitAsType(Path, Vec), + TraitAsType(Path, GenericTypeArgs), /// &mut T MutableReference(Box), @@ -154,6 +154,40 @@ pub struct UnresolvedType { pub span: Option, } +/// An argument to a generic type or trait. +#[derive(Debug, PartialEq, Eq, Clone, Hash)] +pub enum GenericTypeArg { + /// An ordered argument, e.g. `` + Ordered(UnresolvedType), + + /// A named argument, e.g. ``. + /// Used for associated types. + Named(Ident, UnresolvedType), +} + +#[derive(Debug, Default, PartialEq, Eq, Clone, Hash)] +pub struct GenericTypeArgs { + /// Each ordered argument, e.g. `` + pub ordered_args: Vec, + + /// All named arguments, e.g. ``. + /// Used for associated types. + pub named_args: Vec<(Ident, UnresolvedType)>, +} + +impl From> for GenericTypeArgs { + fn from(args: Vec) -> Self { + let mut this = GenericTypeArgs::default(); + for arg in args { + match arg { + GenericTypeArg::Ordered(typ) => this.ordered_args.push(typ), + GenericTypeArg::Named(name, typ) => this.named_args.push((name, typ)), + } + } + this + } +} + /// Type wrapper for a member access pub struct UnaryRhsMemberAccess { pub method_or_field: Ident, @@ -187,6 +221,32 @@ impl Recoverable for UnresolvedType { } } +impl std::fmt::Display for GenericTypeArg { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + GenericTypeArg::Ordered(typ) => typ.fmt(f), + GenericTypeArg::Named(name, typ) => write!(f, "{name} = {typ}"), + } + } +} + +impl std::fmt::Display for GenericTypeArgs { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if self.ordered_args.is_empty() && self.named_args.is_empty() { + Ok(()) + } else { + let mut args = vecmap(&self.ordered_args, ToString::to_string).join(", "); + + if !self.ordered_args.is_empty() && !self.named_args.is_empty() { + args += ", "; + } + + args += &vecmap(&self.named_args, |(name, typ)| format!("{name} = {typ}")).join(", "); + write!(f, "<{args}>") + } + } +} + impl std::fmt::Display for UnresolvedTypeData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { use UnresolvedTypeData::*; @@ -198,22 +258,8 @@ impl std::fmt::Display for UnresolvedTypeData { Signedness::Signed => write!(f, "i{num_bits}"), Signedness::Unsigned => write!(f, "u{num_bits}"), }, - Named(s, args, _) => { - let args = vecmap(args, |arg| ToString::to_string(&arg.typ)); - if args.is_empty() { - write!(f, "{s}") - } else { - write!(f, "{}<{}>", s, args.join(", ")) - } - } - TraitAsType(s, args) => { - let args = vecmap(args, |arg| ToString::to_string(&arg.typ)); - if args.is_empty() { - write!(f, "impl {s}") - } else { - write!(f, "impl {}<{}>", s, args.join(", ")) - } - } + Named(s, args, _) => write!(f, "{s}{args}"), + TraitAsType(s, args) => write!(f, "impl {s}{args}"), Tuple(elements) => { let elements = vecmap(elements, ToString::to_string); write!(f, "({})", elements.join(", ")) diff --git a/compiler/noirc_frontend/src/ast/traits.rs b/compiler/noirc_frontend/src/ast/traits.rs index f8f8ef667b4..c3104dc4f44 100644 --- a/compiler/noirc_frontend/src/ast/traits.rs +++ b/compiler/noirc_frontend/src/ast/traits.rs @@ -10,6 +10,8 @@ use crate::ast::{ use crate::macros_api::SecondaryAttribute; use crate::node_interner::TraitId; +use super::GenericTypeArgs; + /// AST node for trait definitions: /// `trait name { ... items ... }` #[derive(Clone, Debug)] @@ -88,7 +90,7 @@ pub struct UnresolvedTraitConstraint { pub struct TraitBound { pub trait_path: Path, pub trait_id: Option, // initially None, gets assigned during DC - pub trait_generics: Vec, + pub trait_generics: GenericTypeArgs, } #[derive(Clone, Debug)] diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 9df18fdefb4..04672b07ecf 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -4,7 +4,7 @@ use std::{ }; use crate::{ - ast::{FunctionKind, UnresolvedTraitConstraint}, + ast::{FunctionKind, GenericTypeArg, UnresolvedTraitConstraint}, hir::{ def_collector::dc_crate::{ filter_literal_globals, CompilationError, ImplMap, UnresolvedGlobal, UnresolvedStruct, @@ -18,7 +18,7 @@ use crate::{ hir_def::{ expr::{HirCapturedVar, HirIdent}, function::{FunctionBody, Parameters}, - traits::TraitConstraint, + traits::{TraitConstraint, TraitType}, types::{Generics, Kind, ResolvedGeneric}, }, macros_api::{ @@ -40,7 +40,7 @@ use crate::{ Context, }, hir_def::function::{FuncMeta, HirFunction}, - macros_api::{Param, Path, UnresolvedType, UnresolvedTypeData}, + macros_api::{Param, Path, UnresolvedTypeData}, node_interner::TraitImplId, }; use crate::{ @@ -504,7 +504,7 @@ impl<'context> Elaborator<'context> { fn desugar_impl_trait_arg( &mut self, trait_path: Path, - trait_generics: Vec, + trait_generics: Vec, generics: &mut Vec, trait_constraints: &mut Vec, ) -> Type { @@ -672,7 +672,7 @@ impl<'context> Elaborator<'context> { let the_trait = self.lookup_trait_or_error(bound.trait_path.clone())?; let resolved_generics = &the_trait.generics.clone(); - assert_eq!(resolved_generics.len(), bound.trait_generics.len()); + let generics_with_types = resolved_generics.iter().zip(&bound.trait_generics); let trait_generics = vecmap(generics_with_types, |(generic, typ)| { self.resolve_type_inner(typ.clone(), &generic.kind) @@ -696,7 +696,13 @@ impl<'context> Elaborator<'context> { }); } - Some(TraitConstraint { typ, trait_id, trait_generics, span }) + // Associated types can't be explicitly specified yet so they're all implicitly introduced + let associated_types = vecmap(&the_trait.associated_types, |typ| TraitType { + name: typ.name.clone(), + typ: self.interner.next_type_variable(), + }); + + Some(TraitConstraint { typ, trait_id, trait_generics, span, associated_types }) } /// Extract metadata from a NoirFunction @@ -1007,11 +1013,7 @@ impl<'context> Elaborator<'context> { if let Some(trait_id) = trait_impl.trait_id { self.generics = trait_impl.resolved_generics.clone(); - let where_clause = trait_impl - .where_clause - .iter() - .flat_map(|item| self.resolve_trait_constraint(item)) - .collect::>(); + let where_clause = self.resolve_trait_constraints(&trait_impl.where_clause); self.collect_trait_impl_methods(trait_id, trait_impl, &where_clause); diff --git a/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs b/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs index bc48b2875c8..559de0247a6 100644 --- a/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs +++ b/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs @@ -3,8 +3,8 @@ use noirc_errors::{Span, Spanned}; use crate::ast::{ ArrayLiteral, AssignStatement, BlockExpression, CallExpression, CastExpression, ConstrainKind, - ConstructorExpression, ExpressionKind, ForLoopStatement, ForRange, Ident, IfExpression, - IndexExpression, InfixExpression, LValue, Lambda, LetStatement, Literal, + ConstructorExpression, ExpressionKind, ForLoopStatement, ForRange, GenericTypeArgs, Ident, + IfExpression, IndexExpression, InfixExpression, LValue, Lambda, LetStatement, Literal, MemberAccessExpression, MethodCallExpression, Path, PathSegment, Pattern, PrefixExpression, UnresolvedType, UnresolvedTypeData, UnresolvedTypeExpression, }; @@ -297,7 +297,8 @@ impl Type { } Type::Struct(def, generics) => { let struct_def = def.borrow(); - let generics = vecmap(generics, |generic| generic.to_display_ast()); + let ordered_args = vecmap(generics, |generic| generic.to_display_ast()); + let generics = GenericTypeArgs { ordered_args, named_args: Vec::new() }; let name = Path::from_ident(struct_def.name.clone()); UnresolvedTypeData::Named(name, generics, false) } @@ -305,7 +306,8 @@ impl Type { // Keep the alias name instead of expanding this in case the // alias' definition was changed let type_def = type_def.borrow(); - let generics = vecmap(generics, |generic| generic.to_display_ast()); + let ordered_args = vecmap(generics, |generic| generic.to_display_ast()); + let generics = GenericTypeArgs { ordered_args, named_args: Vec::new() }; let name = Path::from_ident(type_def.name.clone()); UnresolvedTypeData::Named(name, generics, false) } @@ -332,13 +334,14 @@ impl Type { } } Type::TraitAsType(_, name, generics) => { - let generics = vecmap(generics, |generic| generic.to_display_ast()); + let ordered_args = vecmap(generics, |generic| generic.to_display_ast()); + let generics = GenericTypeArgs { ordered_args, named_args: Vec::new() }; let name = Path::from_single(name.as_ref().clone(), Span::default()); UnresolvedTypeData::TraitAsType(name, generics) } Type::NamedGeneric(_var, name, _kind) => { let name = Path::from_single(name.as_ref().clone(), Span::default()); - UnresolvedTypeData::TraitAsType(name, Vec::new()) + UnresolvedTypeData::Named(name, GenericTypeArgs::default(), true) } Type::Function(args, ret, env) => { let args = vecmap(args, |arg| arg.to_display_ast()); diff --git a/compiler/noirc_frontend/src/hir_def/expr.rs b/compiler/noirc_frontend/src/hir_def/expr.rs index e85d30f0c32..7333774565b 100644 --- a/compiler/noirc_frontend/src/hir_def/expr.rs +++ b/compiler/noirc_frontend/src/hir_def/expr.rs @@ -226,6 +226,7 @@ impl HirMethodCallExpression { typ: object_type, trait_id: method_id.trait_id, trait_generics: generics.clone(), + associated_types: Vec::new(), span: location.span, }; (id, ImplKind::TraitMethod(*method_id, constraint, false)) diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 2a5421f0fe7..05a06f4ee60 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -87,11 +87,19 @@ pub struct TraitConstraint { pub trait_id: TraitId, pub trait_generics: Vec, pub span: Span, + + pub associated_types: Vec, } impl TraitConstraint { - pub fn new(typ: Type, trait_id: TraitId, trait_generics: Vec, span: Span) -> Self { - Self { typ, trait_id, trait_generics, span } + pub fn new( + typ: Type, + trait_id: TraitId, + trait_generics: Vec, + span: Span, + associated_types: Vec, + ) -> Self { + Self { typ, trait_id, trait_generics, span, associated_types } } pub fn apply_bindings(&mut self, type_bindings: &TypeBindings) { diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index e4601b189d6..caba07d7aec 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -1609,7 +1609,7 @@ impl NodeInterner { if let Ok((TraitImplKind::Normal(existing), _)) = self.try_lookup_trait_implementation( &instantiated_object_type, trait_id, - &trait_generics, + trait_generics, ) { let existing_impl = self.get_trait_implementation(existing); let existing_impl = existing_impl.borrow(); diff --git a/compiler/noirc_frontend/src/parser/parser.rs b/compiler/noirc_frontend/src/parser/parser.rs index fac52545ab4..de847918deb 100644 --- a/compiler/noirc_frontend/src/parser/parser.rs +++ b/compiler/noirc_frontend/src/parser/parser.rs @@ -36,10 +36,10 @@ use super::{ }; use super::{spanned, Item, ItemKind}; use crate::ast::{ - BinaryOp, BinaryOpKind, BlockExpression, ForLoopStatement, ForRange, Ident, IfExpression, - InfixExpression, LValue, Literal, ModuleDeclaration, NoirTypeAlias, Param, Path, Pattern, - Recoverable, Statement, TraitBound, TypeImpl, UnaryRhsMemberAccess, UnaryRhsMethodCall, - UseTree, UseTreeKind, Visibility, + BinaryOp, BinaryOpKind, BlockExpression, ForLoopStatement, ForRange, GenericTypeArgs, Ident, + IfExpression, InfixExpression, LValue, Literal, ModuleDeclaration, NoirTypeAlias, Param, Path, + Pattern, Recoverable, Statement, TraitBound, TypeImpl, UnaryRhsMemberAccess, + UnaryRhsMethodCall, UseTree, UseTreeKind, Visibility, }; use crate::ast::{ Expression, ExpressionKind, LetStatement, StatementKind, UnresolvedType, UnresolvedTypeData, @@ -319,7 +319,9 @@ fn self_parameter() -> impl NoirParser { .map(|(pattern_keyword, ident_span)| { let ident = Ident::new("self".to_string(), ident_span); let path = Path::from_single("Self".to_owned(), ident_span); - let mut self_type = UnresolvedTypeData::Named(path, vec![], true).with_span(ident_span); + let no_args = GenericTypeArgs::default(); + let mut self_type = + UnresolvedTypeData::Named(path, no_args, true).with_span(ident_span); let mut pattern = Pattern::Identifier(ident); match pattern_keyword { diff --git a/compiler/noirc_frontend/src/parser/parser/types.rs b/compiler/noirc_frontend/src/parser/parser/types.rs index 7c551ca96d1..32615e1f520 100644 --- a/compiler/noirc_frontend/src/parser/parser/types.rs +++ b/compiler/noirc_frontend/src/parser/parser/types.rs @@ -1,11 +1,12 @@ use super::path::{as_trait_path, path_no_turbofish}; -use super::primitives::token_kind; +use super::primitives::{ident, token_kind}; use super::{ expression_with_precedence, keyword, nothing, parenthesized, NoirParser, ParserError, ParserErrorReason, Precedence, }; use crate::ast::{ - Expression, Recoverable, UnresolvedType, UnresolvedTypeData, UnresolvedTypeExpression, + Expression, GenericTypeArg, GenericTypeArgs, Recoverable, UnresolvedType, UnresolvedTypeData, + UnresolvedTypeExpression, }; use crate::QuotedType; @@ -207,25 +208,32 @@ pub(super) fn named_trait<'a>( pub(super) fn generic_type_args<'a>( type_parser: impl NoirParser + 'a, -) -> impl NoirParser> + 'a { +) -> impl NoirParser + 'a { required_generic_type_args(type_parser).or_not().map(Option::unwrap_or_default) } pub(super) fn required_generic_type_args<'a>( type_parser: impl NoirParser + 'a, -) -> impl NoirParser> + 'a { +) -> impl NoirParser + 'a { + let named_arg = ident() + .then_ignore(just(Token::Equal)) + .then(type_parser.clone()) + .map(|(name, typ)| GenericTypeArg::Named(name, typ)); + type_parser - .clone() + .map(GenericTypeArg::Ordered) // Without checking for a terminating ',' or '>' here we may incorrectly // parse a generic `N * 2` as just the type `N` then fail when there is no // separator afterward. Failing early here ensures we try the `type_expression` // parser afterward. .then_ignore(one_of([Token::Comma, Token::Greater]).rewind()) - .or(type_expression_validated()) + .or(type_expression_validated().map(GenericTypeArg::Ordered)) + .or(named_arg) .separated_by(just(Token::Comma)) .allow_trailing() .at_least(1) .delimited_by(just(Token::Less), just(Token::Greater)) + .map(GenericTypeArgs::from) } pub(super) fn array_type<'a>( From 2b16d759a528c6522629c2cb8956e238ffa6b56b Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 9 Aug 2024 14:32:30 -0500 Subject: [PATCH 06/37] Overhaul resolution of generics --- compiler/noirc_frontend/src/ast/mod.rs | 6 + compiler/noirc_frontend/src/elaborator/mod.rs | 4 +- .../src/elaborator/trait_impls.rs | 6 +- .../noirc_frontend/src/elaborator/traits.rs | 10 +- .../noirc_frontend/src/elaborator/types.rs | 162 ++++++++++-------- .../src/hir/resolution/errors.rs | 16 ++ .../src/hir/type_check/errors.rs | 23 +++ .../src/hir/type_check/generics.rs | 42 +++++ .../noirc_frontend/src/hir/type_check/mod.rs | 12 +- compiler/noirc_frontend/src/hir_def/traits.rs | 35 ++-- compiler/noirc_frontend/src/hir_def/types.rs | 79 +++++++-- compiler/noirc_frontend/src/node_interner.rs | 8 +- 12 files changed, 281 insertions(+), 122 deletions(-) create mode 100644 compiler/noirc_frontend/src/hir/type_check/generics.rs diff --git a/compiler/noirc_frontend/src/ast/mod.rs b/compiler/noirc_frontend/src/ast/mod.rs index 5dad4b9cddc..55575840444 100644 --- a/compiler/noirc_frontend/src/ast/mod.rs +++ b/compiler/noirc_frontend/src/ast/mod.rs @@ -175,6 +175,12 @@ pub struct GenericTypeArgs { pub named_args: Vec<(Ident, UnresolvedType)>, } +impl GenericTypeArgs { + pub fn is_empty(&self) -> bool { + self.ordered_args.is_empty() && self.named_args.is_empty() + } +} + impl From> for GenericTypeArgs { fn from(args: Vec) -> Self { let mut this = GenericTypeArgs::default(); diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 04672b07ecf..4cbe14d2636 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -18,7 +18,7 @@ use crate::{ hir_def::{ expr::{HirCapturedVar, HirIdent}, function::{FunctionBody, Parameters}, - traits::{TraitConstraint, TraitType}, + traits::{NamedType, TraitConstraint}, types::{Generics, Kind, ResolvedGeneric}, }, macros_api::{ @@ -697,7 +697,7 @@ impl<'context> Elaborator<'context> { } // Associated types can't be explicitly specified yet so they're all implicitly introduced - let associated_types = vecmap(&the_trait.associated_types, |typ| TraitType { + let associated_types = vecmap(&the_trait.associated_types, |typ| NamedType { name: typ.name.clone(), typ: self.interner.next_type_variable(), }); diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index 64893b7cddc..e47c732a032 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -2,7 +2,7 @@ use crate::{ ast::UnresolvedTypeExpression, graph::CrateId, hir::def_collector::{dc_crate::UnresolvedTraitImpl, errors::DefCollectorErrorKind}, - hir_def::traits::TraitType, + hir_def::traits::NamedType, node_interner::TraitImplId, ResolvedGeneric, }; @@ -249,12 +249,12 @@ impl<'context> Elaborator<'context> { } }; let typ = self.convert_expression_type(expr); - associated_types.push(TraitType { name, typ }); + associated_types.push(NamedType { name, typ }); } for (name, typ) in trait_impl.associated_types.drain(..) { let typ = self.resolve_type(typ); - associated_types.push(TraitType { name, typ }); + associated_types.push(NamedType { name, typ }); } self.interner.set_associated_types_for_impl(impl_id, associated_types); diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index 788993bbc7a..abe45d69c7a 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -13,7 +13,7 @@ use crate::{ }, hir_def::{ function::Parameters, - traits::{TraitFunction, TraitType}, + traits::{NamedType, TraitFunction}, }, macros_api::{ BlockExpression, FunctionDefinition, FunctionReturnType, Ident, ItemVisibility, @@ -64,7 +64,7 @@ impl<'context> Elaborator<'context> { self.current_trait = None; } - fn resolve_trait_types(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { + fn resolve_trait_types(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { let mut types = Vec::new(); for item in &unresolved_trait.trait_def.items { @@ -72,14 +72,14 @@ impl<'context> Elaborator<'context> { let type_variable = TypeVariable::unbound(self.interner.next_type_variable_id()); let name_string = Rc::new(name.to_string()); let typ = Type::NamedGeneric(type_variable, name_string, Kind::Normal); - types.push(TraitType { name: name.clone(), typ }); + types.push(NamedType { name: name.clone(), typ }); } } types } - fn resolve_trait_constants(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { + fn resolve_trait_constants(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { let mut types = Vec::new(); for item in &unresolved_trait.trait_def.items { @@ -88,7 +88,7 @@ impl<'context> Elaborator<'context> { let name_string = Rc::new(name.to_string()); let typ = Box::new(self.resolve_type(typ.clone())); let typ = Type::NamedGeneric(type_variable, name_string, Kind::Numeric(typ)); - types.push(TraitType { name: name.clone(), typ }); + types.push(NamedType { name: name.clone(), typ }); } } diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 8b0aea0e516..7d0360e1ebb 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -3,17 +3,18 @@ use std::{collections::BTreeMap, rc::Rc}; use acvm::acir::AcirField; use iter_extended::vecmap; use noirc_errors::{Location, Span}; +use rustc_hash::FxHashMap as HashMap; use crate::{ ast::{ - BinaryOpKind, IntegerBitSize, UnresolvedGeneric, UnresolvedGenerics, + BinaryOpKind, GenericTypeArgs, IntegerBitSize, UnresolvedGeneric, UnresolvedGenerics, UnresolvedTypeExpression, }, hir::{ comptime::{Interpreter, Value}, def_map::ModuleDefId, resolution::errors::ResolverError, - type_check::{NoMatchingImplFoundError, Source, TypeCheckError}, + type_check::{Generic, NoMatchingImplFoundError, Source, TypeCheckError}, }, hir_def::{ expr::{ @@ -21,11 +22,11 @@ use crate::{ HirPrefixExpression, }, function::{FuncMeta, Parameters}, - traits::TraitConstraint, + traits::{NamedType, TraitConstraint}, }, macros_api::{ - HirExpression, HirLiteral, HirStatement, NodeInterner, Path, PathKind, SecondaryAttribute, - Signedness, UnaryOp, UnresolvedType, UnresolvedTypeData, + HirExpression, HirLiteral, HirStatement, Ident, NodeInterner, Path, PathKind, + SecondaryAttribute, Signedness, UnaryOp, UnresolvedType, UnresolvedTypeData, }, node_interner::{ DefinitionKind, DependencyId, ExprId, FuncId, GlobalId, TraitId, TraitImplKind, @@ -218,7 +219,7 @@ impl<'context> Elaborator<'context> { if let Some(trait_id) = self.current_trait { let the_trait = self.interner.get_trait(trait_id); if let Some(typ) = the_trait.get_associated_type(path.last_name()) { - return Some(typ.clone()); + return Some(typ.clone().as_named_generic()); } } @@ -232,7 +233,7 @@ impl<'context> Elaborator<'context> { None } - fn resolve_named_type(&mut self, path: Path, args: Vec) -> Type { + fn resolve_named_type(&mut self, path: Path, args: GenericTypeArgs) -> Type { if args.is_empty() { if let Some(typ) = self.lookup_generic_or_global_type(&path) { return typ; @@ -255,29 +256,17 @@ impl<'context> Elaborator<'context> { return self.interner.next_type_variable(); } } else if let Some(typ) = self.lookup_associated_type_on_self(&path) { + if !args.is_empty() { + self.push_err(ResolverError::GenericsOnAssociatedType { span: path.span() }); + } return typ; } let span = path.span(); if let Some(type_alias) = self.lookup_type_alias(path.clone()) { - let type_alias = type_alias.borrow(); - let actual_generic_count = args.len(); - let expected_generic_count = type_alias.generics.len(); - let type_alias_string = type_alias.to_string(); - let id = type_alias.id; - - let mut args = vecmap(type_alias.generics.iter().zip(args), |(generic, arg)| { - self.resolve_type_inner(arg, &generic.kind) - }); - - self.verify_generics_count( - expected_generic_count, - actual_generic_count, - &mut args, - span, - || type_alias_string, - ); + let id = type_alias.borrow().id; + let (args, _) = self.resolve_type_args(args, id, path.span()); if let Some(item) = self.current_item { self.interner.add_type_alias_dependency(item, id); @@ -292,8 +281,7 @@ impl<'context> Elaborator<'context> { // equal to another type alias. Fixing this fully requires an analysis to create a DFG // of definition ordering, but for now we have an explicit check here so that we at // least issue an error that the type was not found instead of silently passing. - let alias = self.interner.get_type_alias(id); - return Type::Alias(alias, args); + return Type::Alias(type_alias, args); } match self.lookup_struct_or_error(path) { @@ -306,9 +294,6 @@ impl<'context> Elaborator<'context> { return Type::Error; } - let expected_generic_count = struct_type.borrow().generics.len(); - let actual_generic_count = args.len(); - if !self.in_contract() && self .interner @@ -321,18 +306,7 @@ impl<'context> Elaborator<'context> { }); } - let mut args = - vecmap(struct_type.borrow().generics.iter().zip(args), |(generic, arg)| { - self.resolve_type_inner(arg, &generic.kind) - }); - - self.verify_generics_count( - expected_generic_count, - actual_generic_count, - &mut args, - span, - || struct_type.borrow().to_string(), - ); + let (args, _) = self.resolve_type_args(args, struct_type.borrow(), path.span()); if let Some(current_item) = self.current_item { let dependency_id = struct_type.borrow().id; @@ -345,44 +319,94 @@ impl<'context> Elaborator<'context> { } } - fn resolve_trait_as_type(&mut self, path: Path, args: Vec) -> Type { + fn resolve_trait_as_type(&mut self, path: Path, args: GenericTypeArgs) -> Type { // Fetch information needed from the trait as the closure for resolving all the `args` // requires exclusive access to `self` - let trait_as_type_info = self - .lookup_trait_or_error(path) - .map(|t| (t.id, Rc::new(t.name.to_string()), t.generics.clone())); - - if let Some((id, name, resolved_generics)) = trait_as_type_info { - assert_eq!(resolved_generics.len(), args.len()); - let generics_with_types = resolved_generics.iter().zip(args); - let args = vecmap(generics_with_types, |(generic, typ)| { - self.resolve_type_inner(typ, &generic.kind) - }); - Type::TraitAsType(id, Rc::new(name.to_string()), args) + let trait_as_type_info = self.lookup_trait_or_error(path).map(|t| t.id); + + if let Some(id) = trait_as_type_info { + let (ordered, named) = self.resolve_type_args(args, id, path.span()); + let name = self.interner.get_trait(id).name.to_string(); + Type::TraitAsType(id, Rc::new(name), ordered, named) } else { Type::Error } } - fn verify_generics_count( + fn resolve_type_args( &mut self, - expected_count: usize, - actual_count: usize, - args: &mut Vec, + args: GenericTypeArgs, + item: impl Generic, span: Span, - type_name: impl FnOnce() -> String, - ) { - if actual_count != expected_count { - self.push_err(ResolverError::IncorrectGenericCount { + ) -> (Vec, Vec) { + let expected_kinds = item.generics(self.interner); + + if args.ordered_args.len() != expected_kinds.len() { + self.push_err(TypeCheckError::GenericCountMismatch { + item: item.item_name(self.interner), + expected: expected_kinds.len(), + found: args.ordered_args.len(), span, - item_name: type_name(), - actual: actual_count, - expected: expected_count, }); + args.ordered_args.truncate(expected_kinds.len()); + } + + let ordered_args = expected_kinds.iter().zip(args.ordered_args); + let ordered = + vecmap(ordered_args, |(generic, typ)| self.resolve_type_inner(typ, &generic.kind)); + + let mut associated = Vec::new(); - // Fix the generic count so we can continue typechecking - args.resize_with(expected_count, || Type::Error); + if item.accepts_named_type_args() { + associated = self.resolve_associated_type_args(args.named_args, item, span); + } else if !args.named_args.is_empty() { + let item_kind = item.item_kind(); + self.push_err(ResolverError::NamedTypeArgs { span, item_kind }); } + + (ordered, associated) + } + + fn resolve_associated_type_args( + &mut self, + args: Vec<(Ident, UnresolvedType)>, + item: impl Generic, + span: Span, + ) -> Vec { + let mut seen_args = HashMap::default(); + let required_args = item.named_generics(self.interner); + let mut resolved = Vec::with_capacity(required_args.len()); + + for (name, typ) in args { + let index = + required_args.iter().position(|item| item.name.as_ref() == &name.0.contents); + + let Some(index) = index else { + if let Some(prev_span) = seen_args.get(&name.0.contents).copied() { + self.push_err(TypeCheckError::DuplicateNamedTypeArg { name, prev_span }); + } else { + let item = item.item_name(self.interner); + self.push_err(TypeCheckError::NoSuchNamedTypeArg { name, item }); + } + continue; + }; + + // Remove the argument from the required list so we remember that we already have it + let expected = required_args.remove(index); + seen_args.insert(name.0.contents.clone(), name.span()); + + let typ = self.resolve_type_inner(typ, &expected.kind); + resolved.push(NamedType { name, typ }); + } + + // Anything that hasn't been removed yet is missing + for generic in required_args { + let item = item.item_name(self.interner); + let name = generic.name.clone(); + self.push_err(TypeCheckError::MissingNamedTypeArg { item, span, name }); + } + + resolved } pub fn lookup_generic_or_global_type(&mut self, path: &Path) -> Option { @@ -462,12 +486,12 @@ impl<'context> Elaborator<'context> { if name == SELF_TYPE_NAME { let the_trait = self.interner.get_trait(trait_id); let method = the_trait.find_method(method.0.contents.as_str())?; + let (trait_generics, associated_types) = the_trait.get_generics(); let constraint = TraitConstraint { typ: self.self_type.clone()?, - trait_generics: Type::from_generics(&vecmap(&the_trait.generics, |generic| { - generic.type_var.clone() - })), + trait_generics, + associated_types, trait_id, span: path.span(), }; diff --git a/compiler/noirc_frontend/src/hir/resolution/errors.rs b/compiler/noirc_frontend/src/hir/resolution/errors.rs index cfaa2063c40..c0fc66f0892 100644 --- a/compiler/noirc_frontend/src/hir/resolution/errors.rs +++ b/compiler/noirc_frontend/src/hir/resolution/errors.rs @@ -58,6 +58,8 @@ pub enum ResolverError { NonStructWithGenerics { span: Span }, #[error("Cannot apply generics on Self type")] GenericsOnSelfType { span: Span }, + #[error("Cannot apply generics on an associated type")] + GenericsOnAssociatedType { span: Span }, #[error("Incorrect amount of arguments to {item_name}")] IncorrectGenericCount { span: Span, item_name: String, actual: usize, expected: usize }, #[error("{0}")] @@ -116,6 +118,8 @@ pub enum ResolverError { NonFunctionInAnnotation { span: Span }, #[error("Type `{typ}` was inserted into the generics list from a macro, but is not a generic")] MacroResultInGenericsListNotAGeneric { span: Span, typ: Type }, + #[error("Named type arguments aren't allowed in a {item_kind}")] + NamedTypeArgs { span: Span, item_kind: &'static str }, } impl ResolverError { @@ -281,6 +285,11 @@ impl<'a> From<&'a ResolverError> for Diagnostic { "Use an explicit type name or apply the generics at the start of the impl instead".into(), *span, ), + ResolverError::GenericsOnAssociatedType { span } => Diagnostic::simple_error( + "Generic Associated Types (GATs) are currently unsupported in Noir".into(), + "Cannot apply generics to an associated type".into(), + *span, + ), ResolverError::IncorrectGenericCount { span, item_name, actual, expected } => { let expected_plural = if *expected == 1 { "" } else { "s" }; let actual_plural = if *actual == 1 { "is" } else { "are" }; @@ -467,6 +476,13 @@ impl<'a> From<&'a ResolverError> for Diagnostic { *span, ) } + ResolverError::NamedTypeArgs { span, item_kind } => { + Diagnostic::simple_error( + format!("Named type arguments aren't allowed on a {item_kind}"), + format!("Named type arguments are only allowed for associated types on traits"), + *span, + ) + } } } } diff --git a/compiler/noirc_frontend/src/hir/type_check/errors.rs b/compiler/noirc_frontend/src/hir/type_check/errors.rs index 8eba8215f84..febdee31df9 100644 --- a/compiler/noirc_frontend/src/hir/type_check/errors.rs +++ b/compiler/noirc_frontend/src/hir/type_check/errors.rs @@ -1,3 +1,5 @@ +use std::rc::Rc; + use acvm::FieldElement; use iter_extended::vecmap; use noirc_errors::CustomDiagnostic as Diagnostic; @@ -9,6 +11,7 @@ use crate::hir::resolution::errors::ResolverError; use crate::hir_def::expr::HirBinaryOp; use crate::hir_def::traits::TraitConstraint; use crate::hir_def::types::Type; +use crate::macros_api::Ident; use crate::macros_api::NodeInterner; #[derive(Error, Debug, Clone, PartialEq, Eq)] @@ -154,6 +157,12 @@ pub enum TypeCheckError { MacroReturningNonExpr { typ: Type, span: Span }, #[error("turbofish (`::<_>`) usage at this position isn't supported yet")] UnsupportedTurbofishUsage { span: Span }, + #[error("`{name}` has already been specified")] + DuplicateNamedTypeArg { name: Ident, prev_span: Span }, + #[error("`{item}` has no associated type named `{name}`")] + NoSuchNamedTypeArg { name: Ident, item: String }, + #[error("`{item}` is missing the associated type `{name}`")] + MissingNamedTypeArg { name: Rc, item: String, span: Span }, } #[derive(Debug, Clone, PartialEq, Eq)] @@ -356,6 +365,20 @@ impl<'a> From<&'a TypeCheckError> for Diagnostic { let msg = "turbofish (`::<_>`) usage at this position isn't supported yet"; Diagnostic::simple_error(msg.to_string(), "".to_string(), *span) }, + TypeCheckError::DuplicateNamedTypeArg { name, prev_span } => { + let msg = format!("`{name}` has already been specified"); + let error = Diagnostic::simple_error(msg.to_string(), "".to_string(), name.span()); + error.add_secondary(format!("`{name}` previously specified here"), *prev_span); + error + }, + TypeCheckError::NoSuchNamedTypeArg { name, item } => { + let msg = format!("`{item}` has no associated type named `{name}`"); + Diagnostic::simple_error(msg.to_string(), "".to_string(), name.span()) + }, + TypeCheckError::MissingNamedTypeArg { name, item, span } => { + let msg = format!("`{item}` is missing the associated type `{name}`"); + Diagnostic::simple_error(msg.to_string(), "".to_string(), *span) + }, } } } diff --git a/compiler/noirc_frontend/src/hir/type_check/generics.rs b/compiler/noirc_frontend/src/hir/type_check/generics.rs new file mode 100644 index 00000000000..caaa9bae6c4 --- /dev/null +++ b/compiler/noirc_frontend/src/hir/type_check/generics.rs @@ -0,0 +1,42 @@ +use crate::{macros_api::NodeInterner, node_interner::TraitId, ResolvedGeneric}; + +/// Represents something that can be generic over type variables +/// such as a trait, struct type, or type alias. +pub trait Generic { + /// The name of this kind of item, for error messages. E.g. "trait", "struct type". + fn item_kind(&self) -> &'static str; + + /// The name of this item, usually named by a user. E.g. "Foo" for "struct Foo {}" + fn item_name(&self, interner: &NodeInterner) -> String; + + /// Each ordered generic on this type, excluding any named generics. + fn generics(&self, interner: &NodeInterner) -> Vec; + + /// True if this item kind can ever accept named type arguments. + /// Currently, this is only true for traits. Structs & aliases can never have named args. + fn accepts_named_type_args(&self) -> bool; + + fn named_generics(&self, interner: &NodeInterner) -> Vec; +} + +impl Generic for TraitId { + fn item_kind(&self) -> &'static str { + "trait" + } + + fn item_name(&self, interner: &NodeInterner) -> String { + interner.get_trait(*self).name.to_string() + } + + fn generics(&self, interner: &NodeInterner) -> Vec { + interner.get_trait(*self).generics.clone() + } + + fn accepts_named_type_args(&self) -> bool { + true + } + + fn named_generics(&self, interner: &NodeInterner) -> Vec { + interner.get_trait(*self).associated_types.clone() + } +} diff --git a/compiler/noirc_frontend/src/hir/type_check/mod.rs b/compiler/noirc_frontend/src/hir/type_check/mod.rs index b6efa17a529..9b953b7f27a 100644 --- a/compiler/noirc_frontend/src/hir/type_check/mod.rs +++ b/compiler/noirc_frontend/src/hir/type_check/mod.rs @@ -1,12 +1,6 @@ -//! This file contains type_check_func, the entry point to the type checking pass (for each function). -//! -//! The pass structure of type checking is relatively straightforward. It is a single pass through -//! the HIR of each function and outputs the inferred type of each HIR node into the NodeInterner, -//! keyed by the ID of the node. -//! -//! Although this algorithm features inference via TypeVariables, there is no generalization step -//! as all functions are required to give their full signatures. Closures are inferred but are -//! never generalized and thus cannot be used polymorphically. mod errors; +mod generics; + pub use self::errors::Source; pub use errors::{NoMatchingImplFoundError, TypeCheckError}; +pub use generics::Generic; diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 05a06f4ee60..e36eddc802f 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -1,6 +1,8 @@ +use iter_extended::vecmap; use rustc_hash::FxHashMap as HashMap; use crate::ast::{Ident, NoirFunction}; +use crate::ResolvedGeneric; use crate::{ graph::CrateId, node_interner::{FuncId, TraitId, TraitMethodId}, @@ -27,12 +29,18 @@ pub struct TraitConstant { pub span: Span, } -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct TraitType { +#[derive(Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd)] +pub struct NamedType { pub name: Ident, pub typ: Type, } +impl std::fmt::Display for NamedType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{} = {}", self.name, self.typ) + } +} + /// Represents a trait in the type system. Each instance of this struct /// will be shared across all Type::Trait variants that represent /// the same trait. @@ -52,7 +60,7 @@ pub struct Trait { /// the information needed to create the full TraitFunction. pub method_ids: HashMap, - pub associated_types: Vec, + pub associated_types: Generics, pub name: Ident, pub generics: Generics, @@ -88,7 +96,7 @@ pub struct TraitConstraint { pub trait_generics: Vec, pub span: Span, - pub associated_types: Vec, + pub associated_types: Vec, } impl TraitConstraint { @@ -97,7 +105,7 @@ impl TraitConstraint { trait_id: TraitId, trait_generics: Vec, span: Span, - associated_types: Vec, + associated_types: Vec, ) -> Self { Self { typ, trait_id, trait_generics, span, associated_types } } @@ -137,15 +145,20 @@ impl Trait { None } - pub fn set_associated_types(&mut self, associated_types: Vec) { + pub fn set_associated_types(&mut self, associated_types: Generics) { self.associated_types = associated_types; } - pub fn get_associated_type(&self, last_name: &str) -> Option<&Type> { - self.associated_types - .iter() - .find(|typ| typ.name.0.contents == last_name) - .map(|typ| &typ.typ) + pub fn get_associated_type(&self, last_name: &str) -> Option<&ResolvedGeneric> { + self.associated_types.iter().find(|typ| typ.name.as_ref() == last_name) + } + + /// Returns both the ordered generics of this type, and its named, associated types. + /// These types are all as-is and are not instantiated. + pub fn get_generics(&self) -> (Vec, Vec) { + let ordered = vecmap(&self.generics, |generic| generic.as_named_generic()); + let named = vecmap(&self.associated_types, |generic| generic.as_named_generic()); + (ordered, named) } } diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 177d23c74dd..1c0aedf4279 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -19,7 +19,10 @@ use crate::{ node_interner::StructId, }; -use super::expr::{HirCallExpression, HirExpression, HirIdent}; +use super::{ + expr::{HirCallExpression, HirExpression, HirIdent}, + traits::NamedType, +}; #[derive(PartialEq, Eq, Clone, Hash, Ord, PartialOrd)] pub enum Type { @@ -78,7 +81,12 @@ pub enum Type { /// `impl Trait` when used in a type position. /// These are only matched based on the TraitId. The trait name parameter is only /// used for displaying error messages using the name of the trait. - TraitAsType(TraitId, /*name:*/ Rc, /*generics:*/ Vec), + TraitAsType( + TraitId, + /*name:*/ Rc, + /*generics:*/ Vec, + /*associated types*/ Vec, + ), /// NamedGenerics are the 'T' or 'U' in a user-defined generic function /// like `fn foo(...) {}`. Unlike TypeVariables, they cannot be bound over. @@ -633,10 +641,16 @@ impl std::fmt::Display for Type { write!(f, "{}<{}>", alias.borrow(), args.join(", ")) } } - Type::TraitAsType(_id, name, generics) => { + Type::TraitAsType(_id, name, generics, associated_types) => { write!(f, "impl {}", name)?; - if !generics.is_empty() { - let generics = vecmap(generics, ToString::to_string).join(", "); + if !generics.is_empty() || !associated_types.is_empty() { + let mut generics = vecmap(generics, ToString::to_string).join(", "); + + if !generics.is_empty() && !associated_types.is_empty() { + generics += ", "; + } + + generics += &vecmap(associated_types, ToString::to_string).join(", "); write!(f, "<{generics}>")?; } Ok(()) @@ -843,8 +857,11 @@ impl Type { | Type::Forall(_, _) | Type::Quoted(_) => false, - Type::TraitAsType(_, _, args) => { + Type::TraitAsType(_, _, args, associated_types) => { args.iter().any(|generic| generic.contains_numeric_typevar(target_id)) + || associated_types + .iter() + .any(|typ| typ.typ.contains_numeric_typevar(target_id)) } Type::Array(length, elem) => { elem.contains_numeric_typevar(target_id) || named_generic_id_matches_target(length) @@ -918,10 +935,13 @@ impl Type { named_generic_is_numeric(self, found_names); } - Type::TraitAsType(_, _, args) => { + Type::TraitAsType(_, _, args, associated_types) => { for arg in args.iter() { arg.find_numeric_type_vars(found_names); } + for arg in associated_types { + arg.typ.find_numeric_type_vars(found_names); + } } Type::Array(length, elem) => { elem.find_numeric_type_vars(found_names); @@ -2082,11 +2102,15 @@ impl Type { element.substitute_helper(type_bindings, substitute_bound_typevars), )), - Type::TraitAsType(s, name, args) => { + Type::TraitAsType(s, name, args, associated_types) => { let args = vecmap(args, |arg| { arg.substitute_helper(type_bindings, substitute_bound_typevars) }); - Type::TraitAsType(*s, name.clone(), args) + let associated_types = vecmap(associated_types, |arg| { + let typ = arg.typ.substitute_helper(type_bindings, substitute_bound_typevars); + NamedType { name: arg.name.clone(), typ } + }); + Type::TraitAsType(*s, name.clone(), args, associated_types) } Type::InfixExpr(lhs, op, rhs) => { let lhs = lhs.substitute_helper(type_bindings, substitute_bound_typevars); @@ -2115,11 +2139,13 @@ impl Type { let field_occurs = fields.occurs(target_id); len_occurs || field_occurs } - Type::Struct(_, generic_args) - | Type::Alias(_, generic_args) - | Type::TraitAsType(_, _, generic_args) => { + Type::Struct(_, generic_args) | Type::Alias(_, generic_args) => { generic_args.iter().any(|arg| arg.occurs(target_id)) } + Type::TraitAsType(_, _, generic_args, associated_types) => { + generic_args.iter().any(|arg| arg.occurs(target_id)) + || associated_types.iter().any(|arg| arg.typ.occurs(target_id)) + } Type::Tuple(fields) => fields.iter().any(|field| field.occurs(target_id)), Type::NamedGeneric(type_var, _, _) | Type::TypeVariable(type_var, _) => { match &*type_var.borrow() { @@ -2195,9 +2221,13 @@ impl Type { MutableReference(element) => MutableReference(Box::new(element.follow_bindings())), - TraitAsType(s, name, args) => { + TraitAsType(s, name, args, associated_types) => { let args = vecmap(args, |arg| arg.follow_bindings()); - TraitAsType(*s, name.clone(), args) + let associated_types = vecmap(associated_types, |arg| NamedType { + name: arg.name.clone(), + typ: arg.typ.follow_bindings(), + }); + TraitAsType(*s, name.clone(), args, associated_types) } InfixExpr(lhs, op, rhs) => { let lhs = lhs.follow_bindings(); @@ -2265,10 +2295,13 @@ impl Type { *self = binding; } } - Type::TraitAsType(_, _, generics) => { + Type::TraitAsType(_, _, generics, associated_types) => { for generic in generics { generic.replace_named_generics_with_type_variables(); } + for generic in associated_types { + generic.typ.replace_named_generics_with_type_variables(); + } } Type::NamedGeneric(var, _, _) => { let type_binding = var.borrow(); @@ -2424,7 +2457,7 @@ impl From<&Type> for PrintableType { PrintableType::Struct { fields, name: struct_type.name.to_string() } } Type::Alias(alias, args) => alias.borrow().get_type(args).into(), - Type::TraitAsType(_, _, _) => unreachable!(), + Type::TraitAsType(..) => unreachable!(), Type::Tuple(types) => PrintableType::Tuple { types: vecmap(types, |typ| typ.into()) }, Type::TypeVariable(_, _) => unreachable!(), Type::NamedGeneric(..) => unreachable!(), @@ -2485,10 +2518,18 @@ impl std::fmt::Debug for Type { write!(f, "{}<{}>", alias.borrow(), args.join(", ")) } } - Type::TraitAsType(_id, name, generics) => { + Type::TraitAsType(_id, name, generics, associated_types) => { write!(f, "impl {}", name)?; - if !generics.is_empty() { - let generics = vecmap(generics, |arg| format!("{:?}", arg)).join(", "); + if !generics.is_empty() || !associated_types.is_empty() { + let mut generics = vecmap(generics, |arg| format!("{:?}", arg)).join(", "); + + if !generics.is_empty() { + generics += ", "; + } + + generics += + &vecmap(associated_types, |arg| format!("{} = {:?}", arg.name, arg.typ)) + .join(", "); write!(f, "<{generics}>")?; } Ok(()) diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index caba07d7aec..c8ba53eef48 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -19,7 +19,7 @@ use crate::hir::comptime; use crate::hir::def_collector::dc_crate::CompilationError; use crate::hir::def_collector::dc_crate::{UnresolvedStruct, UnresolvedTrait, UnresolvedTypeAlias}; use crate::hir::def_map::{LocalModuleId, ModuleId}; -use crate::hir_def::traits::TraitType; +use crate::hir_def::traits::NamedType; use crate::macros_api::UnaryOp; use crate::QuotedType; @@ -136,7 +136,7 @@ pub struct NodeInterner { /// The associated types for each trait impl. /// This is stored outside of the TraitImpl object since it is required before that object is /// created, when resolving the type signature of each method in the impl. - trait_impl_associated_types: HashMap>, + trait_impl_associated_types: HashMap>, /// Trait implementations on each type. This is expected to always have the same length as /// `self.trait_implementations`. @@ -1996,12 +1996,12 @@ impl NodeInterner { pub fn set_associated_types_for_impl( &mut self, impl_id: TraitImplId, - associated_types: Vec, + associated_types: Vec, ) { self.trait_impl_associated_types.insert(impl_id, associated_types); } - pub fn get_associated_types_for_impl(&self, impl_id: TraitImplId) -> &[TraitType] { + pub fn get_associated_types_for_impl(&self, impl_id: TraitImplId) -> &[NamedType] { &self.trait_impl_associated_types[&impl_id] } From 98e0db603c527ba0fbfa5a0e994ebe37e07dbf10 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Mon, 12 Aug 2024 13:39:27 -0500 Subject: [PATCH 07/37] It compiles! --- aztec_macros/src/transforms/functions.rs | 2 +- aztec_macros/src/transforms/note_interface.rs | 3 +- aztec_macros/src/transforms/storage.rs | 32 ++++++---- aztec_macros/src/utils/ast_utils.rs | 2 +- aztec_macros/src/utils/parse_utils.rs | 25 +++++--- compiler/noirc_frontend/src/ast/traits.rs | 15 ++--- .../noirc_frontend/src/elaborator/comptime.rs | 1 + .../src/elaborator/expressions.rs | 1 + compiler/noirc_frontend/src/elaborator/mod.rs | 60 +++++++------------ .../noirc_frontend/src/elaborator/traits.rs | 59 +++++------------- .../noirc_frontend/src/elaborator/types.rs | 43 +++++-------- .../src/hir/comptime/hir_to_display_ast.rs | 7 ++- .../src/hir/comptime/interpreter/builtin.rs | 2 +- .../src/hir/def_collector/dc_crate.rs | 10 ++-- .../src/hir/def_collector/dc_mod.rs | 6 +- .../src/hir/resolution/errors.rs | 2 +- .../src/hir/type_check/errors.rs | 2 +- .../src/hir/type_check/generics.rs | 55 ++++++++++++++++- compiler/noirc_frontend/src/hir_def/traits.rs | 39 +++++++++--- compiler/noirc_frontend/src/node_interner.rs | 16 +++-- compiler/noirc_frontend/src/parser/errors.rs | 4 ++ compiler/noirc_frontend/src/parser/parser.rs | 13 ++-- .../src/parser/parser/primitives.rs | 17 ++++-- tooling/lsp/src/requests/document_symbol.rs | 12 +++- tooling/lsp/src/requests/hover.rs | 5 +- 25 files changed, 247 insertions(+), 186 deletions(-) diff --git a/aztec_macros/src/transforms/functions.rs b/aztec_macros/src/transforms/functions.rs index cd3fdd1fc62..157ffe9cfbc 100644 --- a/aztec_macros/src/transforms/functions.rs +++ b/aztec_macros/src/transforms/functions.rs @@ -267,7 +267,7 @@ fn create_inputs(ty: &str) -> Param { let path_snippet = ty.to_case(Case::Snake); // e.g. private_context_inputs let type_path = chained_dep!("aztec", "context", "inputs", &path_snippet, ty); - let context_type = make_type(UnresolvedTypeData::Named(type_path, vec![], true)); + let context_type = make_type(UnresolvedTypeData::Named(type_path, Default::default(), true)); let visibility = Visibility::Private; Param { pattern: context_pattern, typ: context_type, visibility, span: Span::default() } diff --git a/aztec_macros/src/transforms/note_interface.rs b/aztec_macros/src/transforms/note_interface.rs index 6fccded45ef..2df91210752 100644 --- a/aztec_macros/src/transforms/note_interface.rs +++ b/aztec_macros/src/transforms/note_interface.rs @@ -87,6 +87,7 @@ pub fn generate_note_interface_impl( let mut note_fields = vec![]; let note_interface_generics = trait_impl .trait_generics + .ordered_args .iter() .map(|gen| match gen.typ.clone() { UnresolvedTypeData::Named(path, _, _) => Ok(path.last_name().to_string()), @@ -119,7 +120,7 @@ pub fn generate_note_interface_impl( ident("header"), make_type(UnresolvedTypeData::Named( chained_dep!("aztec", "note", "note_header", "NoteHeader"), - vec![], + Default::default(), false, )), ); diff --git a/aztec_macros/src/transforms/storage.rs b/aztec_macros/src/transforms/storage.rs index dacea1a95e3..a47e4633c4b 100644 --- a/aztec_macros/src/transforms/storage.rs +++ b/aztec_macros/src/transforms/storage.rs @@ -1,8 +1,9 @@ use acvm::acir::AcirField; use noirc_errors::Span; use noirc_frontend::ast::{ - BlockExpression, Expression, ExpressionKind, FunctionDefinition, Ident, Literal, NoirFunction, - NoirStruct, Pattern, StatementKind, TypeImpl, UnresolvedType, UnresolvedTypeData, + BlockExpression, Expression, ExpressionKind, FunctionDefinition, GenericTypeArgs, Ident, + Literal, NoirFunction, NoirStruct, Pattern, StatementKind, TypeImpl, UnresolvedType, + UnresolvedTypeData, }; use noirc_frontend::{ graph::CrateId, @@ -54,13 +55,13 @@ pub fn check_for_storage_definition( fn inject_context_in_storage_field(field: &mut UnresolvedType) -> Result<(), AztecMacroError> { match &mut field.typ { UnresolvedTypeData::Named(path, generics, _) => { - generics.push(make_type(UnresolvedTypeData::Named( + generics.ordered_args.push(make_type(UnresolvedTypeData::Named( ident_path("Context"), - vec![], + GenericTypeArgs::default(), false, ))); match path.last_name() { - "Map" => inject_context_in_storage_field(&mut generics[1]), + "Map" => inject_context_in_storage_field(&mut generics.ordered_args[1]), _ => Ok(()), } } @@ -144,7 +145,10 @@ pub fn generate_storage_field_constructor( generate_storage_field_constructor( // Map is expected to have three generic parameters: key, value and context (i.e. // Map. Here `get(1)` fetches the value type. - &(type_ident.clone(), generics.get(1).unwrap().clone()), + &( + type_ident.clone(), + generics.ordered_args.get(1).unwrap().clone(), + ), variable("slot"), )?, ), @@ -219,8 +223,11 @@ pub fn generate_storage_implementation( // This is the type over which the impl is generic. let generic_context_ident = ident("Context"); - let generic_context_type = - make_type(UnresolvedTypeData::Named(ident_path("Context"), vec![], true)); + let generic_context_type = make_type(UnresolvedTypeData::Named( + ident_path("Context"), + GenericTypeArgs::default(), + true, + )); let init = NoirFunction::normal(FunctionDefinition::normal( &ident("init"), @@ -231,13 +238,12 @@ pub fn generate_storage_implementation( &return_type(chained_path!("Self")), )); + let ordered_args = vec![generic_context_type.clone()]; + let generics = GenericTypeArgs { ordered_args, named_args: Vec::new() }; + let storage_impl = TypeImpl { object_type: UnresolvedType { - typ: UnresolvedTypeData::Named( - chained_path!(storage_struct_name), - vec![generic_context_type.clone()], - true, - ), + typ: UnresolvedTypeData::Named(chained_path!(storage_struct_name), generics, true), span: Some(Span::default()), }, type_span: Span::default(), diff --git a/aztec_macros/src/utils/ast_utils.rs b/aztec_macros/src/utils/ast_utils.rs index a74ec5b777a..592e048cbdc 100644 --- a/aztec_macros/src/utils/ast_utils.rs +++ b/aztec_macros/src/utils/ast_utils.rs @@ -108,7 +108,7 @@ pub fn assignment_with_type( } pub fn return_type(path: Path) -> FunctionReturnType { - let ty = make_type(UnresolvedTypeData::Named(path, vec![], true)); + let ty = make_type(UnresolvedTypeData::Named(path, Default::default(), true)); FunctionReturnType::Ty(ty) } diff --git a/aztec_macros/src/utils/parse_utils.rs b/aztec_macros/src/utils/parse_utils.rs index 3b3813da6ee..162f21338d9 100644 --- a/aztec_macros/src/utils/parse_utils.rs +++ b/aztec_macros/src/utils/parse_utils.rs @@ -2,12 +2,13 @@ use noirc_frontend::{ ast::{ ArrayLiteral, AssignStatement, BlockExpression, CallExpression, CastExpression, ConstrainStatement, ConstructorExpression, Expression, ExpressionKind, ForLoopStatement, - ForRange, FunctionReturnType, Ident, IfExpression, IndexExpression, InfixExpression, - LValue, Lambda, LetStatement, Literal, MemberAccessExpression, MethodCallExpression, - ModuleDeclaration, NoirFunction, NoirStruct, NoirTrait, NoirTraitImpl, NoirTypeAlias, Path, - PathSegment, Pattern, PrefixExpression, Statement, StatementKind, TraitImplItem, TraitItem, - TypeImpl, UnresolvedGeneric, UnresolvedGenerics, UnresolvedTraitConstraint, UnresolvedType, - UnresolvedTypeData, UnresolvedTypeExpression, UseTree, UseTreeKind, + ForRange, FunctionReturnType, GenericTypeArgs, Ident, IfExpression, IndexExpression, + InfixExpression, LValue, Lambda, LetStatement, Literal, MemberAccessExpression, + MethodCallExpression, ModuleDeclaration, NoirFunction, NoirStruct, NoirTrait, + NoirTraitImpl, NoirTypeAlias, Path, PathSegment, Pattern, PrefixExpression, Statement, + StatementKind, TraitImplItem, TraitItem, TypeImpl, UnresolvedGeneric, UnresolvedGenerics, + UnresolvedTraitConstraint, UnresolvedType, UnresolvedTypeData, UnresolvedTypeExpression, + UseTree, UseTreeKind, }, parser::{Item, ItemKind, ParsedSubModule, ParserError}, ParsedModule, @@ -294,6 +295,14 @@ fn empty_unresolved_types(unresolved_types: &mut [UnresolvedType]) { } } +fn empty_type_args(generics: &mut GenericTypeArgs) { + empty_unresolved_types(&mut generics.ordered_args); + for (name, typ) in &mut generics.named_args { + empty_ident(name); + empty_unresolved_type(typ); + } +} + fn empty_unresolved_type(unresolved_type: &mut UnresolvedType) { unresolved_type.span = Default::default(); @@ -315,11 +324,11 @@ fn empty_unresolved_type(unresolved_type: &mut UnresolvedType) { } UnresolvedTypeData::Named(path, unresolved_types, _) => { empty_path(path); - empty_unresolved_types(unresolved_types); + empty_type_args(unresolved_types); } UnresolvedTypeData::TraitAsType(path, unresolved_types) => { empty_path(path); - empty_unresolved_types(unresolved_types); + empty_type_args(unresolved_types); } UnresolvedTypeData::MutableReference(unresolved_type) => { empty_unresolved_type(unresolved_type) diff --git a/compiler/noirc_frontend/src/ast/traits.rs b/compiler/noirc_frontend/src/ast/traits.rs index c3104dc4f44..e3221f287d3 100644 --- a/compiler/noirc_frontend/src/ast/traits.rs +++ b/compiler/noirc_frontend/src/ast/traits.rs @@ -64,7 +64,8 @@ pub struct NoirTraitImpl { pub impl_generics: UnresolvedGenerics, pub trait_name: Path, - pub trait_generics: Vec, + + pub trait_generics: GenericTypeArgs, pub object_type: UnresolvedType, @@ -181,21 +182,13 @@ impl Display for UnresolvedTraitConstraint { impl Display for TraitBound { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let generics = vecmap(&self.trait_generics, |generic| generic.to_string()); - if !generics.is_empty() { - write!(f, "{}<{}>", self.trait_path, generics.join(", ")) - } else { - write!(f, "{}", self.trait_path) - } + write!(f, "{}{}", self.trait_path, self.trait_generics) } } impl Display for NoirTraitImpl { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let generics = vecmap(&self.trait_generics, |generic| generic.to_string()); - let generics = generics.join(", "); - - writeln!(f, "impl {}<{}> for {} {{", self.trait_name, generics, self.object_type)?; + writeln!(f, "impl {}{} for {} {{", self.trait_name, self.trait_generics, self.object_type)?; for item in self.items.iter() { let item = item.to_string(); diff --git a/compiler/noirc_frontend/src/elaborator/comptime.rs b/compiler/noirc_frontend/src/elaborator/comptime.rs index 7195d96efcc..88253535aff 100644 --- a/compiler/noirc_frontend/src/elaborator/comptime.rs +++ b/compiler/noirc_frontend/src/elaborator/comptime.rs @@ -303,6 +303,7 @@ impl<'context> Elaborator<'context> { resolved_object_type: None, resolved_generics: Vec::new(), resolved_trait_generics: Vec::new(), + resolved_associated_types: Vec::new(), }); } TopLevelStatement::Global(global) => { diff --git a/compiler/noirc_frontend/src/elaborator/expressions.rs b/compiler/noirc_frontend/src/elaborator/expressions.rs index 5ba448f890e..c136841bafa 100644 --- a/compiler/noirc_frontend/src/elaborator/expressions.rs +++ b/compiler/noirc_frontend/src/elaborator/expressions.rs @@ -604,6 +604,7 @@ impl<'context> Elaborator<'context> { typ: operand_type.clone(), trait_id: trait_id.trait_id, trait_generics: Vec::new(), + associated_types: Vec::new(), span, }; self.push_trait_constraint(constraint, expr_id); diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 4cbe14d2636..e7962301ee8 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -4,7 +4,7 @@ use std::{ }; use crate::{ - ast::{FunctionKind, GenericTypeArg, UnresolvedTraitConstraint}, + ast::{FunctionKind, GenericTypeArgs, UnresolvedTraitConstraint}, hir::{ def_collector::dc_crate::{ filter_literal_globals, CompilationError, ImplMap, UnresolvedGlobal, UnresolvedStruct, @@ -18,7 +18,7 @@ use crate::{ hir_def::{ expr::{HirCapturedVar, HirIdent}, function::{FunctionBody, Parameters}, - traits::{NamedType, TraitConstraint}, + traits::TraitConstraint, types::{Generics, Kind, ResolvedGeneric}, }, macros_api::{ @@ -504,7 +504,7 @@ impl<'context> Elaborator<'context> { fn desugar_impl_trait_arg( &mut self, trait_path: Path, - trait_generics: Vec, + trait_generics: GenericTypeArgs, generics: &mut Vec, trait_constraints: &mut Vec, ) -> Type { @@ -669,38 +669,12 @@ impl<'context> Elaborator<'context> { bound: &TraitBound, typ: Type, ) -> Option { - let the_trait = self.lookup_trait_or_error(bound.trait_path.clone())?; - - let resolved_generics = &the_trait.generics.clone(); - - let generics_with_types = resolved_generics.iter().zip(&bound.trait_generics); - let trait_generics = vecmap(generics_with_types, |(generic, typ)| { - self.resolve_type_inner(typ.clone(), &generic.kind) - }); - let the_trait = self.lookup_trait_or_error(bound.trait_path.clone())?; let trait_id = the_trait.id; + let span = bound.trait_path.span; - let span = bound.trait_path.span(); - - let expected_generics = the_trait.generics.len(); - let actual_generics = trait_generics.len(); - - if actual_generics != expected_generics { - let item_name = the_trait.name.to_string(); - self.push_err(ResolverError::IncorrectGenericCount { - span, - item_name, - actual: actual_generics, - expected: expected_generics, - }); - } - - // Associated types can't be explicitly specified yet so they're all implicitly introduced - let associated_types = vecmap(&the_trait.associated_types, |typ| NamedType { - name: typ.name.clone(), - typ: self.interner.next_type_variable(), - }); + let (trait_generics, associated_types) = + self.resolve_type_args(bound.trait_generics.clone(), trait_id, span); Some(TraitConstraint { typ, trait_id, trait_generics, span, associated_types }) } @@ -1031,12 +1005,14 @@ impl<'context> Elaborator<'context> { } let trait_generics = trait_impl.resolved_trait_generics.clone(); + let trait_associated_types = trait_impl.resolved_associated_types.clone(); let resolved_trait_impl = Shared::new(TraitImpl { ident: trait_impl.trait_path.last_ident(), typ: self_type.clone(), trait_id, trait_generics, + trait_associated_types, file: trait_impl.file_id, where_clause: where_clause.clone(), methods, @@ -1365,15 +1341,19 @@ impl<'context> Elaborator<'context> { } // Fetch trait constraints here - let trait_generics = trait_impl + let (ordered_generics, named_generics) = trait_impl .trait_id - .and_then(|trait_id| self.resolve_trait_impl_generics(trait_impl, trait_id)) - .unwrap_or_else(|| { - // We still resolve as to continue type checking - vecmap(&trait_impl.trait_generics, |generic| self.resolve_type(generic.clone())) - }); - - trait_impl.resolved_trait_generics = trait_generics; + .map(|trait_id| { + self.resolve_type_args( + trait_impl.trait_generics.clone(), + trait_id, + trait_impl.trait_path.span, + ) + }) + .unwrap_or_default(); + + trait_impl.resolved_trait_generics = ordered_generics; + trait_impl.resolved_associated_types = named_generics; let self_type = self.resolve_type(unresolved_type.clone()); self.self_type = Some(self_type.clone()); diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index abe45d69c7a..bf4173b73ec 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -7,21 +7,15 @@ use crate::{ ast::{ FunctionKind, TraitItem, UnresolvedGeneric, UnresolvedGenerics, UnresolvedTraitConstraint, }, - hir::{ - def_collector::dc_crate::{CompilationError, UnresolvedTrait, UnresolvedTraitImpl}, - type_check::TypeCheckError, - }, - hir_def::{ - function::Parameters, - traits::{NamedType, TraitFunction}, - }, + hir::{def_collector::dc_crate::UnresolvedTrait, type_check::TypeCheckError}, + hir_def::{function::Parameters, traits::TraitFunction}, macros_api::{ BlockExpression, FunctionDefinition, FunctionReturnType, Ident, ItemVisibility, NodeInterner, NoirFunction, Param, Pattern, UnresolvedType, Visibility, }, node_interner::{FuncId, TraitId}, token::Attributes, - Kind, ResolvedGeneric, Type, TypeBindings, TypeVariable, TypeVariableKind, + Generics, Kind, ResolvedGeneric, Type, TypeBindings, TypeVariable, TypeVariableKind, }; use super::Elaborator; @@ -64,31 +58,31 @@ impl<'context> Elaborator<'context> { self.current_trait = None; } - fn resolve_trait_types(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { + fn resolve_trait_types(&mut self, unresolved_trait: &UnresolvedTrait) -> Generics { let mut types = Vec::new(); for item in &unresolved_trait.trait_def.items { if let TraitItem::Type { name } = item { - let type_variable = TypeVariable::unbound(self.interner.next_type_variable_id()); - let name_string = Rc::new(name.to_string()); - let typ = Type::NamedGeneric(type_variable, name_string, Kind::Normal); - types.push(NamedType { name: name.clone(), typ }); + let type_var = TypeVariable::unbound(self.interner.next_type_variable_id()); + let span = name.span(); + let name = Rc::new(name.to_string()); + types.push(ResolvedGeneric { name, type_var, kind: Kind::Normal, span }); } } types } - fn resolve_trait_constants(&mut self, unresolved_trait: &UnresolvedTrait) -> Vec { + fn resolve_trait_constants(&mut self, unresolved_trait: &UnresolvedTrait) -> Generics { let mut types = Vec::new(); for item in &unresolved_trait.trait_def.items { if let TraitItem::Constant { name, typ, default_value: _ } = item { - let type_variable = TypeVariable::unbound(self.interner.next_type_variable_id()); - let name_string = Rc::new(name.to_string()); - let typ = Box::new(self.resolve_type(typ.clone())); - let typ = Type::NamedGeneric(type_variable, name_string, Kind::Numeric(typ)); - types.push(NamedType { name: name.clone(), typ }); + let type_var = TypeVariable::unbound(self.interner.next_type_variable_id()); + let kind = Kind::Numeric(Box::new(self.resolve_type(typ.clone()))); + let span = name.span(); + let name = Rc::new(name.to_string()); + types.push(ResolvedGeneric { name, type_var, kind, span }); } } @@ -229,31 +223,6 @@ impl<'context> Elaborator<'context> { // Don't check the scope tree for unused variables, they can't be used in a declaration anyway. self.generics.truncate(old_generic_count); } - - pub fn resolve_trait_impl_generics( - &mut self, - trait_impl: &UnresolvedTraitImpl, - trait_id: TraitId, - ) -> Option> { - let trait_def = self.interner.get_trait(trait_id); - let resolved_generics = trait_def.generics.clone(); - if resolved_generics.len() != trait_impl.trait_generics.len() { - self.push_err(CompilationError::TypeError(TypeCheckError::GenericCountMismatch { - item: trait_def.name.to_string(), - expected: resolved_generics.len(), - found: trait_impl.trait_generics.len(), - span: trait_impl.trait_path.span(), - })); - - return None; - } - - let generics = trait_impl.trait_generics.iter().zip(resolved_generics.iter()); - let mapped = generics.map(|(generic, resolved_generic)| { - self.resolve_type_inner(generic.clone(), &resolved_generic.kind) - }); - Some(mapped.collect()) - } } /// Checks that the type of a function in a trait impl matches the type diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 7d0360e1ebb..22b1860c843 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -306,7 +306,7 @@ impl<'context> Elaborator<'context> { }); } - let (args, _) = self.resolve_type_args(args, struct_type.borrow(), path.span()); + let (args, _) = self.resolve_type_args(args, struct_type.borrow(), span); if let Some(current_item) = self.current_item { let dependency_id = struct_type.borrow().id; @@ -322,10 +322,11 @@ impl<'context> Elaborator<'context> { fn resolve_trait_as_type(&mut self, path: Path, args: GenericTypeArgs) -> Type { // Fetch information needed from the trait as the closure for resolving all the `args` // requires exclusive access to `self` + let span = path.span; let trait_as_type_info = self.lookup_trait_or_error(path).map(|t| t.id); if let Some(id) = trait_as_type_info { - let (ordered, named) = self.resolve_type_args(args, id, path.span()); + let (ordered, named) = self.resolve_type_args(args, id, span); let name = self.interner.get_trait(id).name.to_string(); Type::TraitAsType(id, Rc::new(name), ordered, named) } else { @@ -333,9 +334,9 @@ impl<'context> Elaborator<'context> { } } - fn resolve_type_args( + pub(super) fn resolve_type_args( &mut self, - args: GenericTypeArgs, + mut args: GenericTypeArgs, item: impl Generic, span: Span, ) -> (Vec, Vec) { @@ -374,9 +375,11 @@ impl<'context> Elaborator<'context> { span: Span, ) -> Vec { let mut seen_args = HashMap::default(); - let required_args = item.named_generics(self.interner); + let mut required_args = item.named_generics(self.interner); let mut resolved = Vec::with_capacity(required_args.len()); + // Go through each argument to check if it is in our required_args list. + // If it is remove it from the list, otherwise issue an error. for (name, typ) in args { let index = required_args.iter().position(|item| item.name.as_ref() == &name.0.contents); @@ -486,16 +489,7 @@ impl<'context> Elaborator<'context> { if name == SELF_TYPE_NAME { let the_trait = self.interner.get_trait(trait_id); let method = the_trait.find_method(method.0.contents.as_str())?; - let (trait_generics, associated_types) = the_trait.get_generics(); - - let constraint = TraitConstraint { - typ: self.self_type.clone()?, - trait_generics, - associated_types, - trait_id, - span: path.span(), - }; - + let constraint = the_trait.as_constraint(path.span); return Some((method, constraint, false)); } } @@ -512,17 +506,9 @@ impl<'context> Elaborator<'context> { ) -> Option<(TraitMethodId, TraitConstraint, bool)> { let func_id: FuncId = self.lookup(path.clone()).ok()?; let meta = self.interner.function_meta(&func_id); - let trait_id = meta.trait_id?; - let the_trait = self.interner.get_trait(trait_id); + let the_trait = self.interner.get_trait(meta.trait_id?); let method = the_trait.find_method(path.last_name())?; - let constraint = TraitConstraint { - typ: Type::TypeVariable(the_trait.self_type_typevar.clone(), TypeVariableKind::Normal), - trait_generics: Type::from_generics(&vecmap(&the_trait.generics, |generic| { - generic.type_var.clone() - })), - trait_id, - span: path.span(), - }; + let constraint = the_trait.as_constraint(path.span); Some((method, constraint, false)) } @@ -1475,7 +1461,7 @@ impl<'context> Elaborator<'context> { let declared_return_type = meta.return_type(); let func_span = self.interner.expr_span(&body_id); // XXX: We could be more specific and return the span of the last stmt, however stmts do not have spans yet - if let Type::TraitAsType(trait_id, _, generics) = declared_return_type { + if let Type::TraitAsType(trait_id, _, generics, _associated_types) = declared_return_type { if self.interner.lookup_trait_implementation(&body_type, *trait_id, generics).is_err() { self.push_err(TypeCheckError::TypeMismatchWithSource { expected: declared_return_type.clone(), @@ -1602,10 +1588,13 @@ impl<'context> Elaborator<'context> { | Type::Quoted(_) | Type::Forall(_, _) => (), - Type::TraitAsType(_, _, args) => { + Type::TraitAsType(_, _, args, associated_types) => { for arg in args { Self::find_numeric_generics_in_type(arg, found); } + for arg in associated_types { + Self::find_numeric_generics_in_type(&arg.typ, found); + } } Type::Array(length, element_type) => { diff --git a/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs b/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs index 559de0247a6..2c6997c6a89 100644 --- a/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs +++ b/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs @@ -333,9 +333,12 @@ impl Type { } } } - Type::TraitAsType(_, name, generics) => { + Type::TraitAsType(_, name, generics, associated_types) => { let ordered_args = vecmap(generics, |generic| generic.to_display_ast()); - let generics = GenericTypeArgs { ordered_args, named_args: Vec::new() }; + let named_args = vecmap(associated_types, |named_type| { + (named_type.name.clone(), named_type.typ.to_display_ast()) + }); + let generics = GenericTypeArgs { ordered_args, named_args }; let name = Path::from_single(name.as_ref().clone(), Span::default()); UnresolvedTypeData::TraitAsType(name, generics) } diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs index 20527f8bea0..29c069eb843 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs @@ -647,7 +647,7 @@ fn zeroed(return_type: Type) -> IResult { | Type::InfixExpr(..) | Type::Quoted(_) | Type::Error - | Type::TraitAsType(_, _, _) + | Type::TraitAsType(..) | Type::NamedGeneric(_, _, _) => Ok(Value::Zeroed(return_type)), } } diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs index 1a1071ae0ab..223a815072c 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs @@ -7,6 +7,7 @@ use crate::hir::def_map::{CrateDefMap, LocalModuleId, ModuleId}; use crate::hir::resolution::errors::ResolverError; use crate::hir::resolution::path_resolver; use crate::hir::type_check::TypeCheckError; +use crate::hir_def::traits::NamedType; use crate::{Generics, Type}; use crate::hir::resolution::import::{resolve_import, ImportDirective, PathResolution}; @@ -18,9 +19,9 @@ use crate::node_interner::{ }; use crate::ast::{ - ExpressionKind, Ident, LetStatement, Literal, NoirFunction, NoirStruct, NoirTrait, - NoirTypeAlias, Path, PathKind, PathSegment, UnresolvedGenerics, UnresolvedTraitConstraint, - UnresolvedType, + ExpressionKind, GenericTypeArgs, Ident, LetStatement, Literal, NoirFunction, NoirStruct, + NoirTrait, NoirTypeAlias, Path, PathKind, PathSegment, UnresolvedGenerics, + UnresolvedTraitConstraint, UnresolvedType, }; use crate::parser::{ParserError, SortedModule}; @@ -74,7 +75,7 @@ pub struct UnresolvedTrait { pub struct UnresolvedTraitImpl { pub file_id: FileId, pub module_id: LocalModuleId, - pub trait_generics: Vec, + pub trait_generics: GenericTypeArgs, pub trait_path: Path, pub object_type: UnresolvedType, pub methods: UnresolvedFunctions, @@ -93,6 +94,7 @@ pub struct UnresolvedTraitImpl { // The resolved generic on the trait itself. E.g. it is the `` in // `impl Foo for Bar { ... }` pub resolved_trait_generics: Vec, + pub resolved_associated_types: Vec, } #[derive(Clone)] diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index 163ed45e385..4abf547d7a0 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -196,6 +196,7 @@ impl<'a> ModCollector<'a> { resolved_object_type: None, resolved_generics: Vec::new(), resolved_trait_generics: Vec::new(), + resolved_associated_types: Vec::new(), }; self.def_collector.items.trait_impls.push(unresolved_trait_impl); @@ -861,6 +862,9 @@ fn is_native_field(str: &str) -> bool { } } +type AssociatedTypes = Vec<(Ident, UnresolvedType)>; +type AssociatedConstants = Vec<(Ident, UnresolvedType, Expression)>; + /// Returns a tuple of (methods, associated types, associated constants) pub(crate) fn collect_trait_impl_items( interner: &mut NodeInterner, @@ -868,7 +872,7 @@ pub(crate) fn collect_trait_impl_items( krate: CrateId, file_id: FileId, local_id: LocalModuleId, -) -> (UnresolvedFunctions, Vec<(Ident, UnresolvedType)>, Vec<(Ident, UnresolvedType, Expression)>) { +) -> (UnresolvedFunctions, AssociatedTypes, AssociatedConstants) { let mut unresolved_functions = UnresolvedFunctions { file_id, functions: Vec::new(), trait_id: None, self_type: None }; diff --git a/compiler/noirc_frontend/src/hir/resolution/errors.rs b/compiler/noirc_frontend/src/hir/resolution/errors.rs index c0fc66f0892..c8567c1dc25 100644 --- a/compiler/noirc_frontend/src/hir/resolution/errors.rs +++ b/compiler/noirc_frontend/src/hir/resolution/errors.rs @@ -479,7 +479,7 @@ impl<'a> From<&'a ResolverError> for Diagnostic { ResolverError::NamedTypeArgs { span, item_kind } => { Diagnostic::simple_error( format!("Named type arguments aren't allowed on a {item_kind}"), - format!("Named type arguments are only allowed for associated types on traits"), + "Named type arguments are only allowed for associated types on traits".to_string(), *span, ) } diff --git a/compiler/noirc_frontend/src/hir/type_check/errors.rs b/compiler/noirc_frontend/src/hir/type_check/errors.rs index febdee31df9..ab1b440779e 100644 --- a/compiler/noirc_frontend/src/hir/type_check/errors.rs +++ b/compiler/noirc_frontend/src/hir/type_check/errors.rs @@ -367,7 +367,7 @@ impl<'a> From<&'a TypeCheckError> for Diagnostic { }, TypeCheckError::DuplicateNamedTypeArg { name, prev_span } => { let msg = format!("`{name}` has already been specified"); - let error = Diagnostic::simple_error(msg.to_string(), "".to_string(), name.span()); + let mut error = Diagnostic::simple_error(msg.to_string(), "".to_string(), name.span()); error.add_secondary(format!("`{name}` previously specified here"), *prev_span); error }, diff --git a/compiler/noirc_frontend/src/hir/type_check/generics.rs b/compiler/noirc_frontend/src/hir/type_check/generics.rs index caaa9bae6c4..5aa1010f90d 100644 --- a/compiler/noirc_frontend/src/hir/type_check/generics.rs +++ b/compiler/noirc_frontend/src/hir/type_check/generics.rs @@ -1,7 +1,16 @@ -use crate::{macros_api::NodeInterner, node_interner::TraitId, ResolvedGeneric}; +use std::cell::Ref; + +use crate::{ + macros_api::NodeInterner, + node_interner::{TraitId, TypeAliasId}, + ResolvedGeneric, StructType, +}; /// Represents something that can be generic over type variables /// such as a trait, struct type, or type alias. +/// +/// Used primarily by `Elaborator::resolve_type_args` so that we can +/// have one function to do this for struct types, type aliases, traits, etc. pub trait Generic { /// The name of this kind of item, for error messages. E.g. "trait", "struct type". fn item_kind(&self) -> &'static str; @@ -40,3 +49,47 @@ impl Generic for TraitId { interner.get_trait(*self).associated_types.clone() } } + +impl Generic for TypeAliasId { + fn item_kind(&self) -> &'static str { + "type alias" + } + + fn item_name(&self, interner: &NodeInterner) -> String { + interner.get_type_alias(*self).borrow().name.to_string() + } + + fn generics(&self, interner: &NodeInterner) -> Vec { + interner.get_type_alias(*self).borrow().generics.clone() + } + + fn accepts_named_type_args(&self) -> bool { + false + } + + fn named_generics(&self, _interner: &NodeInterner) -> Vec { + Vec::new() + } +} + +impl Generic for Ref<'_, StructType> { + fn item_kind(&self) -> &'static str { + "struct" + } + + fn item_name(&self, _interner: &NodeInterner) -> String { + self.name.to_string() + } + + fn generics(&self, _interner: &NodeInterner) -> Vec { + self.generics.clone() + } + + fn accepts_named_type_args(&self) -> bool { + false + } + + fn named_generics(&self, _interner: &NodeInterner) -> Vec { + Vec::new() + } +} diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index e36eddc802f..3eb51d8aa98 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -2,12 +2,12 @@ use iter_extended::vecmap; use rustc_hash::FxHashMap as HashMap; use crate::ast::{Ident, NoirFunction}; -use crate::ResolvedGeneric; use crate::{ graph::CrateId, node_interner::{FuncId, TraitId, TraitMethodId}, Generics, Type, TypeBindings, TypeVariable, }; +use crate::{ResolvedGeneric, TypeVariableKind}; use fm::FileId; use noirc_errors::{Location, Span}; @@ -78,7 +78,15 @@ pub struct TraitImpl { pub ident: Ident, pub typ: Type, pub trait_id: TraitId, + + /// Any ordered type arguments on the trait this impl is for. + /// E.g. `A, B` in `impl Foo for Bar` pub trait_generics: Vec, + + /// Any named type arguments on the trait this impl is for. + /// E.g. `C = D` in `impl Foo for Bar` + pub trait_associated_types: Vec, + pub file: FileId, pub methods: Vec, // methods[i] is the implementation of trait.methods[i] for Type typ @@ -94,9 +102,8 @@ pub struct TraitConstraint { pub typ: Type, pub trait_id: TraitId, pub trait_generics: Vec, - pub span: Span, - pub associated_types: Vec, + pub span: Span, } impl TraitConstraint { @@ -104,10 +111,10 @@ impl TraitConstraint { typ: Type, trait_id: TraitId, trait_generics: Vec, - span: Span, associated_types: Vec, + span: Span, ) -> Self { - Self { typ, trait_id, trait_generics, span, associated_types } + Self { typ, trait_id, trait_generics, associated_types, span } } pub fn apply_bindings(&mut self, type_bindings: &TypeBindings) { @@ -156,10 +163,28 @@ impl Trait { /// Returns both the ordered generics of this type, and its named, associated types. /// These types are all as-is and are not instantiated. pub fn get_generics(&self) -> (Vec, Vec) { - let ordered = vecmap(&self.generics, |generic| generic.as_named_generic()); - let named = vecmap(&self.associated_types, |generic| generic.as_named_generic()); + let ordered = vecmap(&self.generics, |generic| generic.clone().as_named_generic()); + let named = vecmap(&self.associated_types, |generic| generic.clone().as_named_generic()); (ordered, named) } + + /// Returns a TraitConstraint for this trait using Self as the object + /// type and the uninstantiated generics for any trait generics. + pub fn as_constraint(&self, span: Span) -> TraitConstraint { + TraitConstraint { + typ: Type::TypeVariable(self.self_type_typevar.clone(), TypeVariableKind::Normal), + trait_generics: Type::from_generics(&vecmap(&self.generics, |generic| { + generic.type_var.clone() + })), + trait_id: self.id, + span, + associated_types: vecmap(&self.associated_types, |generic| { + let name = Ident::new(generic.name.to_string(), span); + // This may need to be a TypeVariable instead of a named generic + NamedType { name, typ: generic.clone().as_named_generic() } + }), + } + } } impl std::fmt::Display for Trait { diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index c8ba53eef48..366edeb1e4b 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -1428,6 +1428,7 @@ impl NodeInterner { object_type.clone(), trait_id, trait_generics.to_vec(), + Vec::new(), Span::default(), ) }; @@ -1536,6 +1537,8 @@ impl NodeInterner { generic.force_substitute(instantiation_bindings).substitute(type_bindings) }); + // We can ignore any associated types on the constraint since those should not affect + // which impl we choose. self.lookup_trait_implementation_helper( &constraint_type, constraint.trait_id, @@ -2030,10 +2033,8 @@ impl NodeInterner { bindings.insert(self_type_var.id(), (self_type_var, impl_self_type)); for (trait_generic, trait_impl_generic) in trait_generics.iter().zip(trait_impl_generics) { - bindings.insert( - trait_generic.type_var.id(), - (trait_generic.type_var.clone(), trait_impl_generic.clone()), - ); + let type_var = trait_generic.type_var.clone(); + bindings.insert(type_var.id(), (type_var, trait_impl_generic.clone())); } // Now that the normal bindings are added, we still need to bind the associated types @@ -2041,11 +2042,8 @@ impl NodeInterner { let trait_associated_types = &the_trait.associated_types; for (trait_type, impl_type) in trait_associated_types.iter().zip(impl_associated_types) { - let type_variable = match &trait_type.typ { - Type::NamedGeneric(type_variable, ..) => type_variable, - other => unreachable!("A trait's associated type should always be a named generic, but found: {other:?}"), - }; - bindings.insert(type_variable.id(), (type_variable.clone(), impl_type.typ.clone())); + let type_variable = trait_type.type_var.clone(); + bindings.insert(type_variable.id(), (type_variable, impl_type.typ.clone())); } bindings diff --git a/compiler/noirc_frontend/src/parser/errors.rs b/compiler/noirc_frontend/src/parser/errors.rs index 390afbefcda..0ff051eb8c9 100644 --- a/compiler/noirc_frontend/src/parser/errors.rs +++ b/compiler/noirc_frontend/src/parser/errors.rs @@ -50,6 +50,10 @@ pub enum ParserErrorReason { ForbiddenNumericGenericType, #[error("Invalid call data identifier, must be a number. E.g `call_data(0)`")] InvalidCallDataIdentifier, + #[error("Associated types are not allowed in paths")] + AssociatedTypesNotAllowedInPaths, + #[error("Associated types are not allowed on a method call")] + AssociatedTypesNotAllowedInMethodCalls, } /// Represents a parsing error, or a parsing error in the making. diff --git a/compiler/noirc_frontend/src/parser/parser.rs b/compiler/noirc_frontend/src/parser/parser.rs index de847918deb..f684bfda926 100644 --- a/compiler/noirc_frontend/src/parser/parser.rs +++ b/compiler/noirc_frontend/src/parser/parser.rs @@ -881,10 +881,15 @@ where let method_call_rhs = turbofish .then(just(Token::Bang).or_not()) .then(parenthesized(expression_list(expr_parser.clone()))) - .map(|((turbofish, macro_call), args)| UnaryRhsMethodCall { - turbofish, - macro_call: macro_call.is_some(), - args, + .validate(|((turbofish, macro_call), args), span, emit| { + if turbofish.as_ref().map_or(false, |generics| !generics.named_args.is_empty()) { + let reason = ParserErrorReason::AssociatedTypesNotAllowedInMethodCalls; + emit(ParserError::with_reason(reason, span)); + } + + let macro_call = macro_call.is_some(); + let turbofish = turbofish.map(|generics| generics.ordered_args); + UnaryRhsMethodCall { turbofish, macro_call, args } }); // `.foo` or `.foo(args)` in `atom.foo` or `atom.foo(args)` diff --git a/compiler/noirc_frontend/src/parser/parser/primitives.rs b/compiler/noirc_frontend/src/parser/parser/primitives.rs index 25f693bf504..9145fb945c9 100644 --- a/compiler/noirc_frontend/src/parser/parser/primitives.rs +++ b/compiler/noirc_frontend/src/parser/parser/primitives.rs @@ -1,7 +1,8 @@ use chumsky::prelude::*; -use crate::ast::{ExpressionKind, Ident, PathSegment, UnaryOp}; +use crate::ast::{ExpressionKind, GenericTypeArgs, Ident, PathSegment, UnaryOp}; use crate::macros_api::UnresolvedType; +use crate::parser::ParserErrorReason; use crate::{ parser::{labels::ParsingRuleLabel, ExprParser, NoirParser, ParserError}, token::{Keyword, Token, TokenKind}, @@ -36,10 +37,14 @@ pub(super) fn token_kind(token_kind: TokenKind) -> impl NoirParser { pub(super) fn path_segment<'a>( type_parser: impl NoirParser + 'a, ) -> impl NoirParser + 'a { - ident().then(turbofish(type_parser)).map_with_span(|(ident, generics), span| PathSegment { - ident, - generics, - span, + ident().then(turbofish(type_parser)).validate(|(ident, generics), span, emit| { + if generics.as_ref().map_or(false, |generics| !generics.named_args.is_empty()) { + let reason = ParserErrorReason::AssociatedTypesNotAllowedInPaths; + emit(ParserError::with_reason(reason, span)); + } + + let generics = generics.map(|generics| generics.ordered_args); + PathSegment { ident, generics, span } }) } @@ -95,7 +100,7 @@ where pub(super) fn turbofish<'a>( type_parser: impl NoirParser + 'a, -) -> impl NoirParser>> + 'a { +) -> impl NoirParser> + 'a { just(Token::DoubleColon).ignore_then(required_generic_type_args(type_parser)).or_not() } diff --git a/tooling/lsp/src/requests/document_symbol.rs b/tooling/lsp/src/requests/document_symbol.rs index 20fdfb6ece7..73a2dd7935e 100644 --- a/tooling/lsp/src/requests/document_symbol.rs +++ b/tooling/lsp/src/requests/document_symbol.rs @@ -367,12 +367,22 @@ impl<'a> DocumentSymbolCollector<'a> { trait_name.push_str(&noir_trait_impl.trait_name.to_string()); if !noir_trait_impl.trait_generics.is_empty() { trait_name.push('<'); - for (index, generic) in noir_trait_impl.trait_generics.iter().enumerate() { + for (index, generic) in noir_trait_impl.trait_generics.ordered_args.iter().enumerate() { if index > 0 { trait_name.push_str(", "); } trait_name.push_str(&generic.to_string()); } + for (index, (name, generic)) in + noir_trait_impl.trait_generics.named_args.iter().enumerate() + { + if index > 0 { + trait_name.push_str(", "); + } + trait_name.push_str(&name.0.contents); + trait_name.push_str(" = "); + trait_name.push_str(&generic.to_string()); + } trait_name.push('>'); } diff --git a/tooling/lsp/src/requests/hover.rs b/tooling/lsp/src/requests/hover.rs index 73ea504b496..ab50fda1c25 100644 --- a/tooling/lsp/src/requests/hover.rs +++ b/tooling/lsp/src/requests/hover.rs @@ -421,12 +421,15 @@ impl<'a> TypeLinksGatherer<'a> { Type::TypeVariable(var, _) => { self.gather_type_variable_links(var); } - Type::TraitAsType(trait_id, _, generics) => { + Type::TraitAsType(trait_id, _, generics, associated_types) => { let some_trait = self.interner.get_trait(*trait_id); self.gather_trait_links(some_trait); for generic in generics { self.gather_type_links(generic); } + for named_type in associated_types { + self.gather_type_links(&named_type.typ); + } } Type::NamedGeneric(var, _, _) => { self.gather_type_variable_links(var); From 21baa22fcb987f87e5f430c8038d5e02dccad516 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Mon, 12 Aug 2024 16:09:49 -0500 Subject: [PATCH 08/37] Update some tests --- compiler/noirc_frontend/src/elaborator/mod.rs | 2 +- compiler/noirc_frontend/src/elaborator/patterns.rs | 1 + compiler/noirc_frontend/src/elaborator/types.rs | 2 +- compiler/noirc_frontend/src/hir/resolution/errors.rs | 12 ------------ compiler/noirc_frontend/src/hir_def/traits.rs | 5 +---- compiler/noirc_frontend/src/hir_def/types.rs | 2 +- compiler/noirc_frontend/src/tests.rs | 12 ++++++------ 7 files changed, 11 insertions(+), 25 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index e7962301ee8..606858a4f86 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -751,7 +751,7 @@ impl<'context> Elaborator<'context> { }; self.check_if_type_is_valid_for_program_input( - &typ, + dbg!(&typ), is_entry_point, has_inline_attribute, type_span, diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index de928b4e2e3..ad2511b7a10 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -622,6 +622,7 @@ impl<'context> Elaborator<'context> { let span = self.interner.expr_span(&expr_id); let location = self.interner.expr_location(&expr_id); + // This instantiates a trait's generics as well which need to be set // when the constraint below is later solved for when the function is // finished. How to link the two? diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 22b1860c843..01fdf3e1631 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -490,7 +490,7 @@ impl<'context> Elaborator<'context> { let the_trait = self.interner.get_trait(trait_id); let method = the_trait.find_method(method.0.contents.as_str())?; let constraint = the_trait.as_constraint(path.span); - return Some((method, constraint, false)); + return Some((method, constraint, true)); } } None diff --git a/compiler/noirc_frontend/src/hir/resolution/errors.rs b/compiler/noirc_frontend/src/hir/resolution/errors.rs index c8567c1dc25..7901052ace8 100644 --- a/compiler/noirc_frontend/src/hir/resolution/errors.rs +++ b/compiler/noirc_frontend/src/hir/resolution/errors.rs @@ -60,8 +60,6 @@ pub enum ResolverError { GenericsOnSelfType { span: Span }, #[error("Cannot apply generics on an associated type")] GenericsOnAssociatedType { span: Span }, - #[error("Incorrect amount of arguments to {item_name}")] - IncorrectGenericCount { span: Span, item_name: String, actual: usize, expected: usize }, #[error("{0}")] ParserError(Box), #[error("Cannot create a mutable reference to {variable}, it was declared to be immutable")] @@ -290,16 +288,6 @@ impl<'a> From<&'a ResolverError> for Diagnostic { "Cannot apply generics to an associated type".into(), *span, ), - ResolverError::IncorrectGenericCount { span, item_name, actual, expected } => { - let expected_plural = if *expected == 1 { "" } else { "s" }; - let actual_plural = if *actual == 1 { "is" } else { "are" }; - - Diagnostic::simple_error( - format!("`{item_name}` has {expected} generic argument{expected_plural} but {actual} {actual_plural} given here"), - "Incorrect number of generic arguments".into(), - *span, - ) - } ResolverError::ParserError(error) => error.as_ref().into(), ResolverError::MutableReferenceToImmutableVariable { variable, span } => { Diagnostic::simple_error(format!("Cannot mutably reference the immutable variable {variable}"), format!("{variable} is immutable"), *span) diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 3eb51d8aa98..302433585f4 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -173,14 +173,11 @@ impl Trait { pub fn as_constraint(&self, span: Span) -> TraitConstraint { TraitConstraint { typ: Type::TypeVariable(self.self_type_typevar.clone(), TypeVariableKind::Normal), - trait_generics: Type::from_generics(&vecmap(&self.generics, |generic| { - generic.type_var.clone() - })), + trait_generics: vecmap(&self.generics, |generic| generic.clone().as_named_generic()), trait_id: self.id, span, associated_types: vecmap(&self.associated_types, |generic| { let name = Ident::new(generic.name.to_string(), span); - // This may need to be a TypeVariable instead of a named generic NamedType { name, typ: generic.clone().as_named_generic() } }), } diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 1c0aedf4279..a155277b346 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -276,7 +276,7 @@ impl StructType { /// Returns all the fields of this type, after being applied to the given generic arguments. pub fn get_fields(&self, generic_args: &[Type]) -> Vec<(String, Type)> { - assert_eq!(self.generics.len(), generic_args.len()); + assert_eq!(dbg!(&self.generics).len(), generic_args.len()); let substitutions = self .generics diff --git a/compiler/noirc_frontend/src/tests.rs b/compiler/noirc_frontend/src/tests.rs index 9124567b4e5..1c31e0d04be 100644 --- a/compiler/noirc_frontend/src/tests.rs +++ b/compiler/noirc_frontend/src/tests.rs @@ -2694,8 +2694,8 @@ fn incorrect_generic_count_on_struct_impl() { let errors = get_program_errors(src); assert_eq!(errors.len(), 1); - let CompilationError::ResolverError(ResolverError::IncorrectGenericCount { - actual, + let CompilationError::TypeError(TypeCheckError::GenericCountMismatch { + found, expected, .. }) = errors[0].0 @@ -2703,7 +2703,7 @@ fn incorrect_generic_count_on_struct_impl() { panic!("Expected an incorrect generic count mismatch error, got {:?}", errors[0].0); }; - assert_eq!(actual, 1); + assert_eq!(found, 1); assert_eq!(expected, 0); } @@ -2718,8 +2718,8 @@ fn incorrect_generic_count_on_type_alias() { let errors = get_program_errors(src); assert_eq!(errors.len(), 1); - let CompilationError::ResolverError(ResolverError::IncorrectGenericCount { - actual, + let CompilationError::TypeError(TypeCheckError::GenericCountMismatch { + found, expected, .. }) = errors[0].0 @@ -2727,7 +2727,7 @@ fn incorrect_generic_count_on_type_alias() { panic!("Expected an incorrect generic count mismatch error, got {:?}", errors[0].0); }; - assert_eq!(actual, 1); + assert_eq!(found, 1); assert_eq!(expected, 0); } From bda71e05e5c1e5fba6c9da0e1272cf867a811dc6 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 13 Aug 2024 10:57:52 -0500 Subject: [PATCH 09/37] Fix name shadowing test --- compiler/noirc_frontend/src/elaborator/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 01fdf3e1631..e24973b8035 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -349,7 +349,8 @@ impl<'context> Elaborator<'context> { found: args.ordered_args.len(), span, }); - args.ordered_args.truncate(expected_kinds.len()); + let error_type = UnresolvedTypeData::Error.with_span(span); + args.ordered_args.resize(expected_kinds.len(), error_type); } let ordered_args = expected_kinds.iter().zip(args.ordered_args); From 11864a2dadb051d99fe2b94534a229e5fdcb7701 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 13 Aug 2024 13:13:09 -0500 Subject: [PATCH 10/37] Get some programs compiling w/ type annotations --- .../noirc_frontend/src/elaborator/comptime.rs | 1 - compiler/noirc_frontend/src/elaborator/mod.rs | 27 +++++----- .../src/elaborator/trait_impls.rs | 35 +++---------- .../noirc_frontend/src/elaborator/traits.rs | 40 +------------- .../src/hir/def_collector/dc_crate.rs | 2 - .../src/hir/def_collector/dc_mod.rs | 52 +++++++++++++++++-- .../src/hir/resolution/errors.rs | 9 ++++ compiler/noirc_frontend/src/hir_def/traits.rs | 12 ++--- compiler/noirc_frontend/src/hir_def/types.rs | 2 +- compiler/noirc_frontend/src/node_interner.rs | 3 +- .../noirc_frontend/src/parser/parser/types.rs | 19 ++++--- 11 files changed, 96 insertions(+), 106 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/comptime.rs b/compiler/noirc_frontend/src/elaborator/comptime.rs index 88253535aff..7195d96efcc 100644 --- a/compiler/noirc_frontend/src/elaborator/comptime.rs +++ b/compiler/noirc_frontend/src/elaborator/comptime.rs @@ -303,7 +303,6 @@ impl<'context> Elaborator<'context> { resolved_object_type: None, resolved_generics: Vec::new(), resolved_trait_generics: Vec::new(), - resolved_associated_types: Vec::new(), }); } TopLevelStatement::Global(global) => { diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 32e6c14c4e2..a116e773bba 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -766,7 +766,7 @@ impl<'context> Elaborator<'context> { }; self.check_if_type_is_valid_for_program_input( - dbg!(&typ), + &typ, is_entry_point, has_inline_attribute, type_span, @@ -1024,14 +1024,12 @@ impl<'context> Elaborator<'context> { } let trait_generics = trait_impl.resolved_trait_generics.clone(); - let trait_associated_types = trait_impl.resolved_associated_types.clone(); let resolved_trait_impl = Shared::new(TraitImpl { ident: trait_impl.trait_path.last_ident(), typ: self_type.clone(), trait_id, trait_generics, - trait_associated_types, file: trait_impl.file_id, where_clause: where_clause.clone(), methods, @@ -1354,7 +1352,7 @@ impl<'context> Elaborator<'context> { let trait_id = self.resolve_trait_by_path(trait_impl.trait_path.clone()); trait_impl.trait_id = trait_id; - let unresolved_type = &trait_impl.object_type; + let unresolved_type = trait_impl.object_type.clone(); self.add_generics(&trait_impl.generics); trait_impl.resolved_generics = self.generics.clone(); @@ -1364,29 +1362,28 @@ impl<'context> Elaborator<'context> { method.def.where_clause.append(&mut trait_impl.where_clause.clone()); } + // Add each associated type to the list of named type arguments + let mut trait_generics = trait_impl.trait_generics.clone(); + trait_generics.named_args.extend(Self::take_unresolved_associated_types(trait_impl)); + + let impl_id = self.interner.next_trait_impl_id(); + self.current_trait_impl = Some(impl_id); + // Fetch trait constraints here let (ordered_generics, named_generics) = trait_impl .trait_id .map(|trait_id| { - self.resolve_type_args( - trait_impl.trait_generics.clone(), - trait_id, - trait_impl.trait_path.span, - ) + self.resolve_type_args(trait_generics, trait_id, trait_impl.trait_path.span) }) .unwrap_or_default(); trait_impl.resolved_trait_generics = ordered_generics; - trait_impl.resolved_associated_types = named_generics; + self.interner.set_associated_types_for_impl(impl_id, named_generics); - let self_type = self.resolve_type(unresolved_type.clone()); + let self_type = self.resolve_type(unresolved_type); self.self_type = Some(self_type.clone()); trait_impl.methods.self_type = Some(self_type); - let impl_id = self.interner.next_trait_impl_id(); - self.current_trait_impl = Some(impl_id); - - self.register_associated_types(impl_id, trait_impl); self.define_function_metas_for_functions(&mut trait_impl.methods); trait_impl.resolved_object_type = self.self_type.take(); diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index e47c732a032..af4a23a72a4 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -1,8 +1,7 @@ use crate::{ - ast::UnresolvedTypeExpression, graph::CrateId, hir::def_collector::{dc_crate::UnresolvedTraitImpl, errors::DefCollectorErrorKind}, - hir_def::traits::NamedType, + macros_api::{Ident, UnresolvedType}, node_interner::TraitImplId, ResolvedGeneric, }; @@ -227,36 +226,16 @@ impl<'context> Elaborator<'context> { } } - /// Resolve & save the associated types for the given trait impl. - /// These are stored outside of the TraitImpl object since they are - /// required before it is created to resolve the type signature of each method. - pub(super) fn register_associated_types( - &mut self, - impl_id: TraitImplId, + pub(super) fn take_unresolved_associated_types( trait_impl: &mut UnresolvedTraitImpl, - ) { + ) -> Vec<(Ident, UnresolvedType)> { let mut associated_types = Vec::new(); - - for (name, typ, expression) in trait_impl.associated_constants.drain(..) { - // TODO: What to do with the expression type? - let _typ = self.resolve_type(typ.clone()); - let span = expression.span; - let expr = match UnresolvedTypeExpression::from_expr(expression, span) { - Ok(expr) => expr, - Err(error) => { - self.push_err(error); - continue; - } - }; - let typ = self.convert_expression_type(expr); - associated_types.push(NamedType { name, typ }); + for (name, typ, _) in trait_impl.associated_constants.drain(..) { + associated_types.push((name, typ)); } - for (name, typ) in trait_impl.associated_types.drain(..) { - let typ = self.resolve_type(typ); - associated_types.push(NamedType { name, typ }); + associated_types.push((name, typ)); } - - self.interner.set_associated_types_for_impl(impl_id, associated_types); + associated_types } } diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index bf4173b73ec..8c3e414a004 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -15,7 +15,7 @@ use crate::{ }, node_interner::{FuncId, TraitId}, token::Attributes, - Generics, Kind, ResolvedGeneric, Type, TypeBindings, TypeVariable, TypeVariableKind, + Kind, ResolvedGeneric, Type, TypeBindings, TypeVariableKind, }; use super::Elaborator; @@ -32,13 +32,6 @@ impl<'context> Elaborator<'context> { &resolved_generics, ); - // Resolve constants before types & methods since both types & methods may refer to trait constants. - let mut associated_types = this.resolve_trait_constants(unresolved_trait); - associated_types.extend(this.resolve_trait_types(unresolved_trait)); - this.interner.update_trait(*trait_id, |trait_def| { - trait_def.set_associated_types(associated_types); - }); - let methods = this.resolve_trait_methods(*trait_id, unresolved_trait); this.interner.update_trait(*trait_id, |trait_def| { @@ -58,37 +51,6 @@ impl<'context> Elaborator<'context> { self.current_trait = None; } - fn resolve_trait_types(&mut self, unresolved_trait: &UnresolvedTrait) -> Generics { - let mut types = Vec::new(); - - for item in &unresolved_trait.trait_def.items { - if let TraitItem::Type { name } = item { - let type_var = TypeVariable::unbound(self.interner.next_type_variable_id()); - let span = name.span(); - let name = Rc::new(name.to_string()); - types.push(ResolvedGeneric { name, type_var, kind: Kind::Normal, span }); - } - } - - types - } - - fn resolve_trait_constants(&mut self, unresolved_trait: &UnresolvedTrait) -> Generics { - let mut types = Vec::new(); - - for item in &unresolved_trait.trait_def.items { - if let TraitItem::Constant { name, typ, default_value: _ } = item { - let type_var = TypeVariable::unbound(self.interner.next_type_variable_id()); - let kind = Kind::Numeric(Box::new(self.resolve_type(typ.clone()))); - let span = name.span(); - let name = Rc::new(name.to_string()); - types.push(ResolvedGeneric { name, type_var, kind, span }); - } - } - - types - } - fn resolve_trait_methods( &mut self, trait_id: TraitId, diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs index 223a815072c..f1875a0f729 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs @@ -7,7 +7,6 @@ use crate::hir::def_map::{CrateDefMap, LocalModuleId, ModuleId}; use crate::hir::resolution::errors::ResolverError; use crate::hir::resolution::path_resolver; use crate::hir::type_check::TypeCheckError; -use crate::hir_def::traits::NamedType; use crate::{Generics, Type}; use crate::hir::resolution::import::{resolve_import, ImportDirective, PathResolution}; @@ -94,7 +93,6 @@ pub struct UnresolvedTraitImpl { // The resolved generic on the trait itself. E.g. it is the `` in // `impl Foo for Bar { ... }` pub resolved_trait_generics: Vec, - pub resolved_associated_types: Vec, } #[derive(Clone)] diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index 4abf547d7a0..c849fa74174 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -1,4 +1,5 @@ use std::path::Path; +use std::rc::Rc; use std::vec; use acvm::{AcirField, FieldElement}; @@ -13,7 +14,8 @@ use crate::ast::{ NoirStruct, NoirTrait, NoirTraitImpl, NoirTypeAlias, Pattern, TraitImplItem, TraitItem, TypeImpl, }; -use crate::macros_api::{Expression, NodeInterner, UnresolvedType}; +use crate::hir::resolution::errors::ResolverError; +use crate::macros_api::{Expression, NodeInterner, UnresolvedType, UnresolvedTypeData}; use crate::node_interner::{ModuleAttributes, ReferenceId}; use crate::{ graph::CrateId, @@ -22,6 +24,7 @@ use crate::{ node_interner::{FunctionModifiers, TraitId, TypeAliasId}, parser::{SortedModule, SortedSubModule}, }; +use crate::{Generics, Kind, ResolvedGeneric, Type, TypeVariable}; use super::{ dc_crate::{ @@ -196,7 +199,6 @@ impl<'a> ModCollector<'a> { resolved_object_type: None, resolved_generics: Vec::new(), resolved_trait_generics: Vec::new(), - resolved_associated_types: Vec::new(), }; self.def_collector.items.trait_impls.push(unresolved_trait_impl); @@ -457,6 +459,8 @@ impl<'a> ModCollector<'a> { }; let mut method_ids = HashMap::default(); + let mut associated_types = Generics::new(); + for trait_item in &trait_definition.items { match trait_item { TraitItem::Function { @@ -517,7 +521,7 @@ impl<'a> ModCollector<'a> { } } } - TraitItem::Constant { name, .. } => { + TraitItem::Constant { name, typ, default_value: _ } => { let global_id = context.def_interner.push_empty_global( name.clone(), trait_id.0.local_id, @@ -538,6 +542,16 @@ impl<'a> ModCollector<'a> { second_def, }; errors.push((error.into(), self.file_id)); + } else { + let type_variable_id = context.def_interner.next_type_variable_id(); + let typ = self.resolve_associated_constant_type(typ, &mut errors); + + associated_types.push(ResolvedGeneric { + name: Rc::new(name.to_string()), + type_var: TypeVariable::unbound(type_variable_id), + kind: Kind::Numeric(Box::new(typ)), + span: name.span(), + }); } } TraitItem::Type { name } => { @@ -552,6 +566,14 @@ impl<'a> ModCollector<'a> { second_def, }; errors.push((error.into(), self.file_id)); + } else { + let type_variable_id = context.def_interner.next_type_variable_id(); + associated_types.push(ResolvedGeneric { + name: Rc::new(name.to_string()), + type_var: TypeVariable::unbound(type_variable_id), + kind: Kind::Normal, + span: name.span(), + }); } } } @@ -569,7 +591,12 @@ impl<'a> ModCollector<'a> { method_ids, fns_with_default_impl: unresolved_functions, }; - context.def_interner.push_empty_trait(trait_id, &unresolved, resolved_generics); + context.def_interner.push_empty_trait( + trait_id, + &unresolved, + resolved_generics, + associated_types, + ); context.def_interner.add_definition_location( ReferenceId::Trait(trait_id), @@ -774,6 +801,23 @@ impl<'a> ModCollector<'a> { Ok(mod_id) } + + fn resolve_associated_constant_type( + &self, + typ: &UnresolvedType, + errors: &mut Vec<(CompilationError, FileId)>, + ) -> Type { + match &typ.typ { + UnresolvedTypeData::FieldElement => Type::FieldElement, + UnresolvedTypeData::Integer(sign, bits) => Type::Integer(*sign, *bits), + _ => { + let span = typ.span.expect("UnresolvedTypes should have spans"); + let error = ResolverError::AssociatedConstantsMustBeNumeric { span }; + errors.push((error.into(), self.file_id)); + Type::Error + } + } + } } fn find_module( diff --git a/compiler/noirc_frontend/src/hir/resolution/errors.rs b/compiler/noirc_frontend/src/hir/resolution/errors.rs index 7901052ace8..0aad50d13b2 100644 --- a/compiler/noirc_frontend/src/hir/resolution/errors.rs +++ b/compiler/noirc_frontend/src/hir/resolution/errors.rs @@ -118,6 +118,8 @@ pub enum ResolverError { MacroResultInGenericsListNotAGeneric { span: Span, typ: Type }, #[error("Named type arguments aren't allowed in a {item_kind}")] NamedTypeArgs { span: Span, item_kind: &'static str }, + #[error("Associated constants may only be a field or integer type")] + AssociatedConstantsMustBeNumeric { span: Span }, } impl ResolverError { @@ -471,6 +473,13 @@ impl<'a> From<&'a ResolverError> for Diagnostic { *span, ) } + ResolverError::AssociatedConstantsMustBeNumeric { span } => { + Diagnostic::simple_error( + "Associated constants may only be a field or integer type".to_string(), + "Only numeric constants are allowed".to_string(), + *span, + ) + } } } } diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 302433585f4..6293840fd8a 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -81,12 +81,12 @@ pub struct TraitImpl { /// Any ordered type arguments on the trait this impl is for. /// E.g. `A, B` in `impl Foo for Bar` + /// + /// Note that named arguments (associated types) are stored separately + /// in the NodeInterner. This is because they're required to resolve types + /// before the impl as a whole is finished resolving. pub trait_generics: Vec, - /// Any named type arguments on the trait this impl is for. - /// E.g. `C = D` in `impl Foo for Bar` - pub trait_associated_types: Vec, - pub file: FileId, pub methods: Vec, // methods[i] is the implementation of trait.methods[i] for Type typ @@ -152,10 +152,6 @@ impl Trait { None } - pub fn set_associated_types(&mut self, associated_types: Generics) { - self.associated_types = associated_types; - } - pub fn get_associated_type(&self, last_name: &str) -> Option<&ResolvedGeneric> { self.associated_types.iter().find(|typ| typ.name.as_ref() == last_name) } diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index a155277b346..1c0aedf4279 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -276,7 +276,7 @@ impl StructType { /// Returns all the fields of this type, after being applied to the given generic arguments. pub fn get_fields(&self, generic_args: &[Type]) -> Vec<(String, Type)> { - assert_eq!(dbg!(&self.generics).len(), generic_args.len()); + assert_eq!(self.generics.len(), generic_args.len()); let substitutions = self .generics diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 778d58d393b..952aa736250 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -651,6 +651,7 @@ impl NodeInterner { type_id: TraitId, unresolved_trait: &UnresolvedTrait, generics: Generics, + associated_types: Generics, ) { let new_trait = Trait { id: type_id, @@ -661,7 +662,7 @@ impl NodeInterner { self_type_typevar: TypeVariable::unbound(self.next_type_variable_id()), methods: Vec::new(), method_ids: unresolved_trait.method_ids.clone(), - associated_types: Vec::new(), + associated_types, }; self.traits.insert(type_id, new_trait); diff --git a/compiler/noirc_frontend/src/parser/parser/types.rs b/compiler/noirc_frontend/src/parser/parser/types.rs index 32615e1f520..a3c57f3f72e 100644 --- a/compiler/noirc_frontend/src/parser/parser/types.rs +++ b/compiler/noirc_frontend/src/parser/parser/types.rs @@ -215,20 +215,25 @@ pub(super) fn generic_type_args<'a>( pub(super) fn required_generic_type_args<'a>( type_parser: impl NoirParser + 'a, ) -> impl NoirParser + 'a { + let generic_type_arg = type_parser + .clone() + .then_ignore(one_of([Token::Comma, Token::Greater]).rewind()) + .or(type_expression_validated()); + let named_arg = ident() - .then_ignore(just(Token::Equal)) - .then(type_parser.clone()) + .then_ignore(just(Token::Assign)) + .then(generic_type_arg.clone()) .map(|(name, typ)| GenericTypeArg::Named(name, typ)); - type_parser - .map(GenericTypeArg::Ordered) + // We need to parse named arguments first since otherwise when we see + // `Foo = Bar`, just `Foo` is a valid type, and we'd parse an ordered + // generic before erroring that an `=` is invalid after an ordered generic. + named_arg + .or(generic_type_arg.map(GenericTypeArg::Ordered)) // Without checking for a terminating ',' or '>' here we may incorrectly // parse a generic `N * 2` as just the type `N` then fail when there is no // separator afterward. Failing early here ensures we try the `type_expression` // parser afterward. - .then_ignore(one_of([Token::Comma, Token::Greater]).rewind()) - .or(type_expression_validated().map(GenericTypeArg::Ordered)) - .or(named_arg) .separated_by(just(Token::Comma)) .allow_trailing() .at_least(1) From 488db35612caa5439b18c738cf83b34163231341 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 13 Aug 2024 15:55:05 -0500 Subject: [PATCH 11/37] Add TraitGenerics --- .../noirc_frontend/src/elaborator/patterns.rs | 6 +- .../noirc_frontend/src/elaborator/types.rs | 2 +- .../interpreter/builtin/builtin_helpers.rs | 3 +- .../noirc_frontend/src/hir/comptime/value.rs | 11 +-- .../src/hir/type_check/generics.rs | 61 +++++++++++++- .../noirc_frontend/src/hir/type_check/mod.rs | 3 +- compiler/noirc_frontend/src/hir_def/types.rs | 83 ++++++------------- compiler/noirc_frontend/src/node_interner.rs | 33 ++++++-- 8 files changed, 122 insertions(+), 80 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index 7fd009c3e14..515de574610 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -599,10 +599,8 @@ impl<'context> Elaborator<'context> { // Otherwise `self` will be replaced with a fresh type variable, which will require the user // to specify a redundant type annotation. if *assumed { - bindings.insert( - the_trait.self_type_typevar.id(), - (the_trait.self_type_typevar.clone(), constraint.typ.clone()), - ); + let self_type = the_trait.self_type_typevar.clone(); + bindings.insert(self_type.id(), (self_type, constraint.typ.clone())); } } diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index e24973b8035..7090d959aec 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -14,7 +14,7 @@ use crate::{ comptime::{Interpreter, Value}, def_map::ModuleDefId, resolution::errors::ResolverError, - type_check::{Generic, NoMatchingImplFoundError, Source, TypeCheckError}, + type_check::{generics::Generic, NoMatchingImplFoundError, Source, TypeCheckError}, }, hir_def::{ expr::{ diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs index 56f6c11974f..b0a84b91572 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs @@ -8,6 +8,7 @@ use crate::{ hir::{ comptime::{errors::IResult, value::add_token_spans, Interpreter, InterpreterError, Value}, def_map::ModuleId, + type_check::generics::TraitGenerics, }, hir_def::{ function::{FuncMeta, FunctionBody}, @@ -191,7 +192,7 @@ pub(crate) fn get_struct((value, location): (Value, Location)) -> IResult IResult<(TraitId, Vec)> { +) -> IResult<(TraitId, TraitGenerics)> { match value { Value::TraitConstraint(trait_id, generics) => Ok((trait_id, generics)), value => { diff --git a/compiler/noirc_frontend/src/hir/comptime/value.rs b/compiler/noirc_frontend/src/hir/comptime/value.rs index d5408309e55..80392023578 100644 --- a/compiler/noirc_frontend/src/hir/comptime/value.rs +++ b/compiler/noirc_frontend/src/hir/comptime/value.rs @@ -8,7 +8,7 @@ use noirc_errors::{Location, Span}; use crate::{ ast::{ArrayLiteral, ConstructorExpression, Ident, IntegerBitSize, Signedness}, - hir::def_map::ModuleId, + hir::{def_map::ModuleId, type_check::generics::TraitGenerics}, hir_def::expr::{HirArrayLiteral, HirConstructorExpression, HirIdent, HirLambda, ImplKind}, macros_api::{ Expression, ExpressionKind, HirExpression, HirLiteral, Literal, NodeInterner, Path, @@ -51,7 +51,7 @@ pub enum Value { /// be inserted into separate files entirely. Quoted(Rc>), StructDefinition(StructId), - TraitConstraint(TraitId, /* trait generics */ Vec), + TraitConstraint(TraitId, TraitGenerics), TraitDefinition(TraitId), FunctionDefinition(FuncId), ModuleDefinition(ModuleId), @@ -517,12 +517,7 @@ impl<'value, 'interner> Display for ValuePrinter<'value, 'interner> { } Value::TraitConstraint(trait_id, generics) => { let trait_ = self.interner.get_trait(*trait_id); - let generic_string = vecmap(generics, ToString::to_string).join(", "); - if generics.is_empty() { - write!(f, "{}", trait_.name) - } else { - write!(f, "{}<{generic_string}>", trait_.name) - } + write!(f, "{}{generics}", trait_.name) } Value::TraitDefinition(trait_id) => { let trait_ = self.interner.get_trait(*trait_id); diff --git a/compiler/noirc_frontend/src/hir/type_check/generics.rs b/compiler/noirc_frontend/src/hir/type_check/generics.rs index 5aa1010f90d..44dce9aafb6 100644 --- a/compiler/noirc_frontend/src/hir/type_check/generics.rs +++ b/compiler/noirc_frontend/src/hir/type_check/generics.rs @@ -1,9 +1,10 @@ use std::cell::Ref; use crate::{ + hir_def::traits::NamedType, macros_api::NodeInterner, node_interner::{TraitId, TypeAliasId}, - ResolvedGeneric, StructType, + ResolvedGeneric, StructType, Type, }; /// Represents something that can be generic over type variables @@ -93,3 +94,61 @@ impl Generic for Ref<'_, StructType> { Vec::new() } } + +/// TraitGenerics are different from regular generics in that they can +/// also contain associated type arguments. +#[derive(PartialEq, Eq, Clone, Hash, Ord, PartialOrd)] +pub struct TraitGenerics { + pub ordered: Vec, + pub named: Vec, +} + +impl std::fmt::Display for TraitGenerics { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fmt_trait_generics(self, f, false) + } +} + +impl std::fmt::Debug for TraitGenerics { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fmt_trait_generics(self, f, true) + } +} + +fn fmt_trait_generics( + generics: &TraitGenerics, + f: &mut std::fmt::Formatter<'_>, + debug: bool, +) -> std::fmt::Result { + if !generics.ordered.is_empty() || !generics.named.is_empty() { + write!(f, "<")?; + for (i, typ) in generics.ordered.iter().enumerate() { + if i != 0 { + write!(f, ", ")?; + } + + if debug { + write!(f, "{typ:?}")?; + } else { + write!(f, "{typ}")?; + } + } + + if !generics.ordered.is_empty() && !generics.named.is_empty() { + write!(f, ", ")?; + } + + for (i, named) in generics.named.iter().enumerate() { + if i != 0 { + write!(f, ", ")?; + } + + if debug { + write!(f, "{} = {:?}", named.name, named.typ)?; + } else { + write!(f, "{} = {}", named.name, named.typ)?; + } + } + } + Ok(()) +} diff --git a/compiler/noirc_frontend/src/hir/type_check/mod.rs b/compiler/noirc_frontend/src/hir/type_check/mod.rs index 9b953b7f27a..f45b68dd818 100644 --- a/compiler/noirc_frontend/src/hir/type_check/mod.rs +++ b/compiler/noirc_frontend/src/hir/type_check/mod.rs @@ -1,6 +1,5 @@ mod errors; -mod generics; +pub mod generics; pub use self::errors::Source; pub use errors::{NoMatchingImplFoundError, TypeCheckError}; -pub use generics::Generic; diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 1c0aedf4279..866cdfd2af7 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -7,7 +7,7 @@ use std::{ use crate::{ ast::IntegerBitSize, - hir::type_check::TypeCheckError, + hir::type_check::{generics::TraitGenerics, TypeCheckError}, node_interner::{ExprId, NodeInterner, TraitId, TypeAliasId}, }; use iter_extended::vecmap; @@ -81,12 +81,7 @@ pub enum Type { /// `impl Trait` when used in a type position. /// These are only matched based on the TraitId. The trait name parameter is only /// used for displaying error messages using the name of the trait. - TraitAsType( - TraitId, - /*name:*/ Rc, - /*generics:*/ Vec, - /*associated types*/ Vec, - ), + TraitAsType(TraitId, Rc, TraitGenerics), /// NamedGenerics are the 'T' or 'U' in a user-defined generic function /// like `fn foo(...) {}`. Unlike TypeVariables, they cannot be bound over. @@ -641,19 +636,8 @@ impl std::fmt::Display for Type { write!(f, "{}<{}>", alias.borrow(), args.join(", ")) } } - Type::TraitAsType(_id, name, generics, associated_types) => { - write!(f, "impl {}", name)?; - if !generics.is_empty() || !associated_types.is_empty() { - let mut generics = vecmap(generics, ToString::to_string).join(", "); - - if !generics.is_empty() && !associated_types.is_empty() { - generics += ", "; - } - - generics += &vecmap(associated_types, ToString::to_string).join(", "); - write!(f, "<{generics}>")?; - } - Ok(()) + Type::TraitAsType(_id, name, generics) => { + write!(f, "impl {}{}", name, generics) } Type::Tuple(elements) => { let elements = vecmap(elements, ToString::to_string); @@ -857,11 +841,9 @@ impl Type { | Type::Forall(_, _) | Type::Quoted(_) => false, - Type::TraitAsType(_, _, args, associated_types) => { - args.iter().any(|generic| generic.contains_numeric_typevar(target_id)) - || associated_types - .iter() - .any(|typ| typ.typ.contains_numeric_typevar(target_id)) + Type::TraitAsType(_, _, generics) => { + generics.ordered.iter().any(|generic| generic.contains_numeric_typevar(target_id)) + || generics.named.iter().any(|typ| typ.typ.contains_numeric_typevar(target_id)) } Type::Array(length, elem) => { elem.contains_numeric_typevar(target_id) || named_generic_id_matches_target(length) @@ -935,11 +917,11 @@ impl Type { named_generic_is_numeric(self, found_names); } - Type::TraitAsType(_, _, args, associated_types) => { - for arg in args.iter() { + Type::TraitAsType(_, _, args) => { + for arg in args.ordered.iter() { arg.find_numeric_type_vars(found_names); } - for arg in associated_types { + for arg in args.named.iter() { arg.typ.find_numeric_type_vars(found_names); } } @@ -2102,15 +2084,15 @@ impl Type { element.substitute_helper(type_bindings, substitute_bound_typevars), )), - Type::TraitAsType(s, name, args, associated_types) => { - let args = vecmap(args, |arg| { + Type::TraitAsType(s, name, generics) => { + let ordered = vecmap(&generics.ordered, |arg| { arg.substitute_helper(type_bindings, substitute_bound_typevars) }); - let associated_types = vecmap(associated_types, |arg| { + let named = vecmap(&generics.named, |arg| { let typ = arg.typ.substitute_helper(type_bindings, substitute_bound_typevars); NamedType { name: arg.name.clone(), typ } }); - Type::TraitAsType(*s, name.clone(), args, associated_types) + Type::TraitAsType(*s, name.clone(), TraitGenerics { ordered, named }) } Type::InfixExpr(lhs, op, rhs) => { let lhs = lhs.substitute_helper(type_bindings, substitute_bound_typevars); @@ -2142,9 +2124,9 @@ impl Type { Type::Struct(_, generic_args) | Type::Alias(_, generic_args) => { generic_args.iter().any(|arg| arg.occurs(target_id)) } - Type::TraitAsType(_, _, generic_args, associated_types) => { - generic_args.iter().any(|arg| arg.occurs(target_id)) - || associated_types.iter().any(|arg| arg.typ.occurs(target_id)) + Type::TraitAsType(_, _, args) => { + args.ordered.iter().any(|arg| arg.occurs(target_id)) + || args.named.iter().any(|arg| arg.typ.occurs(target_id)) } Type::Tuple(fields) => fields.iter().any(|field| field.occurs(target_id)), Type::NamedGeneric(type_var, _, _) | Type::TypeVariable(type_var, _) => { @@ -2221,13 +2203,13 @@ impl Type { MutableReference(element) => MutableReference(Box::new(element.follow_bindings())), - TraitAsType(s, name, args, associated_types) => { - let args = vecmap(args, |arg| arg.follow_bindings()); - let associated_types = vecmap(associated_types, |arg| NamedType { + TraitAsType(s, name, args) => { + let ordered = vecmap(&args.ordered, |arg| arg.follow_bindings()); + let named = vecmap(&args.named, |arg| NamedType { name: arg.name.clone(), typ: arg.typ.follow_bindings(), }); - TraitAsType(*s, name.clone(), args, associated_types) + TraitAsType(*s, name.clone(), TraitGenerics { ordered, named }) } InfixExpr(lhs, op, rhs) => { let lhs = lhs.follow_bindings(); @@ -2295,11 +2277,11 @@ impl Type { *self = binding; } } - Type::TraitAsType(_, _, generics, associated_types) => { - for generic in generics { + Type::TraitAsType(_, _, generics) => { + for generic in &generics.ordered { generic.replace_named_generics_with_type_variables(); } - for generic in associated_types { + for generic in &generics.named { generic.typ.replace_named_generics_with_type_variables(); } } @@ -2518,22 +2500,7 @@ impl std::fmt::Debug for Type { write!(f, "{}<{}>", alias.borrow(), args.join(", ")) } } - Type::TraitAsType(_id, name, generics, associated_types) => { - write!(f, "impl {}", name)?; - if !generics.is_empty() || !associated_types.is_empty() { - let mut generics = vecmap(generics, |arg| format!("{:?}", arg)).join(", "); - - if !generics.is_empty() { - generics += ", "; - } - - generics += - &vecmap(associated_types, |arg| format!("{} = {:?}", arg.name, arg.typ)) - .join(", "); - write!(f, "<{generics}>")?; - } - Ok(()) - } + Type::TraitAsType(_id, name, generics) => write!(f, "impl {}{:?}", name, generics), Type::Tuple(elements) => { let elements = vecmap(elements, |arg| format!("{:?}", arg)); write!(f, "({})", elements.join(", ")) diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 952aa736250..7e9fe2d588a 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -1357,9 +1357,14 @@ impl NodeInterner { object_type: &Type, trait_id: TraitId, trait_generics: &[Type], + trait_associated_types: &[NamedType], ) -> Result> { - let (impl_kind, bindings) = - self.try_lookup_trait_implementation(object_type, trait_id, trait_generics)?; + let (impl_kind, bindings) = self.try_lookup_trait_implementation( + object_type, + trait_id, + trait_generics, + trait_associated_types, + )?; Type::apply_type_bindings(bindings); Ok(impl_kind) @@ -1403,12 +1408,14 @@ impl NodeInterner { object_type: &Type, trait_id: TraitId, trait_generics: &[Type], + trait_associated_types: &[NamedType], ) -> Result<(TraitImplKind, TypeBindings), Vec> { let mut bindings = TypeBindings::new(); let impl_kind = self.lookup_trait_implementation_helper( object_type, trait_id, trait_generics, + trait_associated_types, &mut bindings, IMPL_SEARCH_RECURSION_LIMIT, )?; @@ -1425,6 +1432,7 @@ impl NodeInterner { object_type: &Type, trait_id: TraitId, trait_generics: &[Type], + trait_associated_types: &[NamedType], type_bindings: &mut TypeBindings, recursion_limit: u32, ) -> Result> { @@ -1433,7 +1441,7 @@ impl NodeInterner { object_type.clone(), trait_id, trait_generics.to_vec(), - Vec::new(), + trait_associated_types.to_vec(), Span::default(), ) }; @@ -1534,7 +1542,7 @@ impl NodeInterner { for constraint in where_clause { // Instantiation bindings are generally safe to force substitute into the same type. // This is needed here to undo any bindings done to trait methods by monomorphization. - // Otherwise, an impl for (A, B) could get narrowed to only an impl for e.g. (u8, u16). + // Otherwise, an impl for any (A, B) could get narrowed to only an impl for e.g. (u8, u16). let constraint_type = constraint.typ.force_substitute(instantiation_bindings).substitute(type_bindings); @@ -1542,12 +1550,18 @@ impl NodeInterner { generic.force_substitute(instantiation_bindings).substitute(type_bindings) }); + let trait_associated_types = vecmap(&constraint.associated_types, |generic| { + let typ = generic.typ.force_substitute(instantiation_bindings); + NamedType { name: generic.name.clone(), typ: typ.substitute(type_bindings) } + }); + // We can ignore any associated types on the constraint since those should not affect // which impl we choose. self.lookup_trait_implementation_helper( &constraint_type, constraint.trait_id, &trait_generics, + &trait_associated_types, // Use a fresh set of type bindings here since the constraint_type originates from // our impl list, which we don't want to bind to. type_bindings, @@ -1571,9 +1585,16 @@ impl NodeInterner { object_type: Type, trait_id: TraitId, trait_generics: Vec, + trait_associated_types: Vec, ) -> bool { // Make sure there are no overlapping impls - if self.try_lookup_trait_implementation(&object_type, trait_id, &trait_generics).is_ok() { + let existing = self.try_lookup_trait_implementation( + &object_type, + trait_id, + &trait_generics, + &trait_associated_types, + ); + if existing.is_ok() { return false; } @@ -1609,6 +1630,7 @@ impl NodeInterner { let instantiated_object_type = object_type.substitute(&substitutions); let trait_generics = &trait_impl.borrow().trait_generics; + let associated_types = self.get_associated_types_for_impl(impl_id); // Ignoring overlapping `TraitImplKind::Assumed` impls here is perfectly fine. // It should never happen since impls are defined at global scope, but even @@ -1618,6 +1640,7 @@ impl NodeInterner { &instantiated_object_type, trait_id, trait_generics, + associated_types, ) { let existing_impl = self.get_trait_implementation(existing); let existing_impl = existing_impl.borrow(); From a35d718cce27724507b3a9758e441a2581a5a393 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 13 Aug 2024 16:02:43 -0500 Subject: [PATCH 12/37] Fix interpreter builtins --- .../src/hir/comptime/interpreter/builtin.rs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs index 47caeec0ac4..b159cf5ac28 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs @@ -20,7 +20,10 @@ use crate::{ ExpressionKind, FunctionKind, FunctionReturnType, IntegerBitSize, UnresolvedType, UnresolvedTypeData, Visibility, }, - hir::comptime::{errors::IResult, value::add_token_spans, InterpreterError, Value}, + hir::{ + comptime::{errors::IResult, value::add_token_spans, InterpreterError, Value}, + type_check::generics::TraitGenerics, + }, hir_def::function::FunctionBody, macros_api::{ModuleDefId, NodeInterner, Signedness}, node_interner::DefinitionKind, @@ -361,7 +364,10 @@ fn quoted_as_trait_constraint( elaborator.resolve_trait_bound(&trait_bound, Type::Unit) }) .ok_or(InterpreterError::FailedToResolveTraitBound { trait_bound, location })?; - Ok(Value::TraitConstraint(bound.trait_id, bound.trait_generics)) + + let ordered = bound.trait_generics; + let named = bound.associated_types; + Ok(Value::TraitConstraint(bound.trait_id, TraitGenerics { ordered, named })) } // fn as_type(quoted: Quoted) -> Type @@ -518,7 +524,9 @@ fn type_implements( let typ = get_type(typ)?; let (trait_id, generics) = get_trait_constraint(constraint)?; - let implements = interner.try_lookup_trait_implementation(&typ, trait_id, &generics).is_ok(); + let implements = interner + .try_lookup_trait_implementation(&typ, trait_id, &generics.ordered, &generics.named) + .is_ok(); Ok(Value::Bool(implements)) } @@ -1022,12 +1030,11 @@ fn trait_def_as_trait_constraint( let argument = check_one_argument(arguments, location)?; let trait_id = get_trait_def(argument)?; - let the_trait = interner.get_trait(trait_id); - let trait_generics = vecmap(&the_trait.generics, |generic| { - Type::NamedGeneric(generic.type_var.clone(), generic.name.clone(), generic.kind.clone()) - }); + let constraint = interner.get_trait(trait_id).as_constraint(location.span); + let ordered = constraint.trait_generics; + let named = constraint.associated_types; - Ok(Value::TraitConstraint(trait_id, trait_generics)) + Ok(Value::TraitConstraint(trait_id, TraitGenerics { ordered, named })) } /// Creates a value that holds an `Option`. From e0a3d2bb7b41c5f58661b1c702250e040db00bc5 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Wed, 14 Aug 2024 15:12:39 -0500 Subject: [PATCH 13/37] Make type spans mandatory --- aztec_macros/src/transforms/functions.rs | 4 +- aztec_macros/src/transforms/note_interface.rs | 59 ++++----- aztec_macros/src/transforms/storage.rs | 2 +- aztec_macros/src/utils/ast_utils.rs | 7 +- compiler/noirc_frontend/src/ast/expression.rs | 8 +- compiler/noirc_frontend/src/ast/function.rs | 4 +- compiler/noirc_frontend/src/ast/mod.rs | 18 +-- compiler/noirc_frontend/src/ast/statement.rs | 6 +- compiler/noirc_frontend/src/debug/mod.rs | 6 +- .../src/elaborator/expressions.rs | 2 +- compiler/noirc_frontend/src/elaborator/mod.rs | 25 ++-- .../noirc_frontend/src/elaborator/patterns.rs | 10 +- .../src/elaborator/statements.rs | 2 +- .../src/elaborator/trait_impls.rs | 7 +- .../noirc_frontend/src/elaborator/types.rs | 122 +++++++++++------- .../src/hir/comptime/hir_to_display_ast.rs | 8 +- .../src/hir/comptime/interpreter/builtin.rs | 2 +- .../src/hir/def_collector/dc_mod.rs | 2 +- .../src/hir/type_check/errors.rs | 2 +- compiler/noirc_frontend/src/hir_def/expr.rs | 15 ++- compiler/noirc_frontend/src/hir_def/types.rs | 6 +- .../src/monomorphization/mod.rs | 15 ++- compiler/noirc_frontend/src/node_interner.rs | 83 ++++++++---- compiler/noirc_frontend/src/parser/parser.rs | 6 +- .../src/parser/parser/lambdas.rs | 10 +- .../noirc_frontend/src/parser/parser/types.rs | 2 +- tooling/lsp/src/requests/completion.rs | 6 +- tooling/lsp/src/requests/document_symbol.rs | 16 +-- tooling/lsp/src/requests/hover.rs | 6 +- tooling/nargo_fmt/src/rewrite/typ.rs | 4 +- tooling/nargo_fmt/src/visitor/item.rs | 8 +- 31 files changed, 258 insertions(+), 215 deletions(-) diff --git a/aztec_macros/src/transforms/functions.rs b/aztec_macros/src/transforms/functions.rs index 157ffe9cfbc..dcd4fdc76f6 100644 --- a/aztec_macros/src/transforms/functions.rs +++ b/aztec_macros/src/transforms/functions.rs @@ -396,7 +396,7 @@ fn serialize_to_hasher( Signedness::Unsigned, ast::IntegerBitSize::ThirtyTwo, ), - span: None, + span: Span::default(), }, hasher_name, )) @@ -595,7 +595,7 @@ fn abstract_return_values(func: &NoirFunction) -> Result>, serialize_to_hasher(&ident(return_value_name), ¤t_return_type, hasher_name) .ok_or_else(|| AztecMacroError::UnsupportedFunctionReturnType { typ: current_return_type.clone(), - span: func.return_type().span.unwrap_or_default(), + span: func.return_type().span, })?; replacement_statements.extend(serialization_statements); diff --git a/aztec_macros/src/transforms/note_interface.rs b/aztec_macros/src/transforms/note_interface.rs index 2df91210752..1cfa51b57a5 100644 --- a/aztec_macros/src/transforms/note_interface.rs +++ b/aztec_macros/src/transforms/note_interface.rs @@ -62,8 +62,9 @@ pub fn generate_note_interface_impl( note_struct.name.0.contents )), })?; - let note_interface_impl_span: Option = - if empty_spans { None } else { trait_impl.object_type.span }; + let note_interface_impl_span = + if empty_spans { Span::default() } else { trait_impl.object_type.span }; + // Look for the note struct implementation, generate a default one if it doesn't exist (in order to append methods to it) let existing_impl = module.impls.iter_mut().find(|r#impl| match &r#impl.object_type.typ { UnresolvedTypeData::Named(path, _, _) => path.last_ident().eq(¬e_struct.name), @@ -95,7 +96,7 @@ pub fn generate_note_interface_impl( Ok(val.to_string()) } _ => Err(AztecMacroError::CouldNotImplementNoteInterface { - span: trait_impl.object_type.span, + span: Some(trait_impl.object_type.span), secondary_message: Some(format!( "NoteInterface must be generic over NOTE_LEN and NOTE_BYTES_LEN: {}", note_type @@ -232,7 +233,7 @@ fn generate_note_to_be_bytes( note_type: &String, byte_length: &str, serialized_length: &str, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = format!( @@ -269,13 +270,13 @@ fn generate_note_to_be_bytes( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn to_be_bytes). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -283,7 +284,7 @@ fn generate_note_to_be_bytes( fn generate_note_get_header( note_type: &String, note_header_field_name: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = format!( @@ -301,13 +302,13 @@ fn generate_note_get_header( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn get_header). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -315,7 +316,7 @@ fn generate_note_get_header( fn generate_note_set_header( note_type: &String, note_header_field_name: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = format!( @@ -332,13 +333,13 @@ fn generate_note_set_header( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn set_header). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -347,7 +348,7 @@ fn generate_note_set_header( // of the conversion of the characters in the note's struct name to unsigned integers. fn generate_get_note_type_id( note_type_id: u32, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { // TODO(#7165): replace {} with dep::aztec::protocol_types::abis::note_selector::compute_note_selector(\"{}\") in the function source below @@ -366,13 +367,13 @@ fn generate_get_note_type_id( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn get_note_type_id). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -390,7 +391,7 @@ fn generate_note_properties_struct( note_type: &str, note_fields: &[(String, String)], note_header_field_name: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let struct_source = @@ -401,7 +402,7 @@ fn generate_note_properties_struct( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some(format!("Failed to parse Noir macro code (struct {}Properties). This is either a bug in the compiler or the Noir macro code", note_type)), - span: impl_span + span: Some(impl_span) }); } @@ -424,7 +425,7 @@ fn generate_note_deserialize_content( note_fields: &[(String, String)], note_serialize_len: &String, note_header_field_name: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = generate_note_deserialize_content_source( @@ -439,13 +440,13 @@ fn generate_note_deserialize_content( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn deserialize_content). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -462,7 +463,7 @@ fn generate_note_serialize_content( note_fields: &[(String, String)], note_serialize_len: &String, note_header_field_name: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = generate_note_serialize_content_source( @@ -477,13 +478,13 @@ fn generate_note_serialize_content( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn serialize_content). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -493,7 +494,7 @@ fn generate_note_properties_fn( note_type: &str, note_fields: &[(String, String)], note_header_field_name: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = @@ -503,12 +504,12 @@ fn generate_note_properties_fn( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn properties). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } @@ -520,7 +521,7 @@ fn generate_note_properties_fn( // fn generate_compute_note_content_hash( note_type: &String, - impl_span: Option, + impl_span: Span, empty_spans: bool, ) -> Result { let function_source = format!( @@ -536,12 +537,12 @@ fn generate_compute_note_content_hash( dbg!(errors); return Err(AztecMacroError::CouldNotImplementNoteInterface { secondary_message: Some("Failed to parse Noir macro code (fn compute_note_content_hash). This is either a bug in the compiler or the Noir macro code".to_string()), - span: impl_span + span: Some(impl_span) }); } let mut function_ast = function_ast.into_sorted(); let mut noir_fn = function_ast.functions.remove(0); - noir_fn.def.span = impl_span.unwrap_or_default(); + noir_fn.def.span = impl_span; noir_fn.def.visibility = ItemVisibility::Public; Ok(noir_fn) } diff --git a/aztec_macros/src/transforms/storage.rs b/aztec_macros/src/transforms/storage.rs index a47e4633c4b..7dd21f1a8ac 100644 --- a/aztec_macros/src/transforms/storage.rs +++ b/aztec_macros/src/transforms/storage.rs @@ -244,7 +244,7 @@ pub fn generate_storage_implementation( let storage_impl = TypeImpl { object_type: UnresolvedType { typ: UnresolvedTypeData::Named(chained_path!(storage_struct_name), generics, true), - span: Some(Span::default()), + span: Span::default(), }, type_span: Span::default(), generics: vec![generic_context_ident.into()], diff --git a/aztec_macros/src/utils/ast_utils.rs b/aztec_macros/src/utils/ast_utils.rs index 592e048cbdc..955e4111bb3 100644 --- a/aztec_macros/src/utils/ast_utils.rs +++ b/aztec_macros/src/utils/ast_utils.rs @@ -115,10 +115,7 @@ pub fn return_type(path: Path) -> FunctionReturnType { pub fn lambda(parameters: Vec<(Pattern, UnresolvedType)>, body: Expression) -> Expression { expression(ExpressionKind::Lambda(Box::new(Lambda { parameters, - return_type: UnresolvedType { - typ: UnresolvedTypeData::Unspecified, - span: Some(Span::default()), - }, + return_type: UnresolvedType { typ: UnresolvedTypeData::Unspecified, span: Span::default() }, body, }))) } @@ -179,7 +176,7 @@ pub fn cast(lhs: Expression, ty: UnresolvedTypeData) -> Expression { } pub fn make_type(typ: UnresolvedTypeData) -> UnresolvedType { - UnresolvedType { typ, span: Some(Span::default()) } + UnresolvedType { typ, span: Span::default() } } pub fn index_array(array: Ident, index: &str) -> Expression { diff --git a/compiler/noirc_frontend/src/ast/expression.rs b/compiler/noirc_frontend/src/ast/expression.rs index aab995c49a1..63835f5210d 100644 --- a/compiler/noirc_frontend/src/ast/expression.rs +++ b/compiler/noirc_frontend/src/ast/expression.rs @@ -68,9 +68,7 @@ impl UnresolvedGeneric { pub fn span(&self) -> Span { match self { UnresolvedGeneric::Variable(ident) => ident.0.span(), - UnresolvedGeneric::Numeric { ident, typ } => { - ident.0.span().merge(typ.span.unwrap_or_default()) - } + UnresolvedGeneric::Numeric { ident, typ } => ident.0.span().merge(typ.span), UnresolvedGeneric::Resolved(_, span) => *span, } } @@ -775,7 +773,7 @@ impl FunctionDefinition { visibility: Visibility::Private, pattern: Pattern::Identifier(ident.clone()), typ: unresolved_type.clone(), - span: ident.span().merge(unresolved_type.span.unwrap()), + span: ident.span().merge(unresolved_type.span), }) .collect(); @@ -832,7 +830,7 @@ impl FunctionReturnType { pub fn get_type(&self) -> Cow { match self { FunctionReturnType::Default(span) => { - Cow::Owned(UnresolvedType { typ: UnresolvedTypeData::Unit, span: Some(*span) }) + Cow::Owned(UnresolvedType { typ: UnresolvedTypeData::Unit, span: *span }) } FunctionReturnType::Ty(typ) => Cow::Borrowed(typ), } diff --git a/compiler/noirc_frontend/src/ast/function.rs b/compiler/noirc_frontend/src/ast/function.rs index 8acc068d86a..4f55e4c2c76 100644 --- a/compiler/noirc_frontend/src/ast/function.rs +++ b/compiler/noirc_frontend/src/ast/function.rs @@ -61,9 +61,7 @@ impl NoirFunction { pub fn return_type(&self) -> UnresolvedType { match &self.def.return_type { - FunctionReturnType::Default(_) => { - UnresolvedType::without_span(UnresolvedTypeData::Unit) - } + FunctionReturnType::Default(span) => UnresolvedTypeData::Unit.with_span(*span), FunctionReturnType::Ty(ty) => ty.clone(), } } diff --git a/compiler/noirc_frontend/src/ast/mod.rs b/compiler/noirc_frontend/src/ast/mod.rs index 55575840444..1a6ec6acac7 100644 --- a/compiler/noirc_frontend/src/ast/mod.rs +++ b/compiler/noirc_frontend/src/ast/mod.rs @@ -147,11 +147,7 @@ pub enum UnresolvedTypeData { #[derive(Debug, PartialEq, Eq, Clone, Hash)] pub struct UnresolvedType { pub typ: UnresolvedTypeData, - - // The span is None in the cases where the User omitted a type: - // fn Foo() {} --- return type is UnresolvedType::Unit without a span - // let x = 100; --- type is UnresolvedType::Unspecified without a span - pub span: Option, + pub span: Span, } /// An argument to a generic type or trait. @@ -223,7 +219,7 @@ pub enum UnresolvedTypeExpression { impl Recoverable for UnresolvedType { fn error(span: Span) -> Self { - UnresolvedType { typ: UnresolvedTypeData::Error, span: Some(span) } + UnresolvedType { typ: UnresolvedTypeData::Error, span } } } @@ -327,14 +323,6 @@ impl UnresolvedType { } } - pub fn without_span(typ: UnresolvedTypeData) -> UnresolvedType { - UnresolvedType { typ, span: None } - } - - pub fn unspecified() -> UnresolvedType { - UnresolvedType { typ: UnresolvedTypeData::Unspecified, span: None } - } - pub(crate) fn is_type_expression(&self) -> bool { matches!(&self.typ, UnresolvedTypeData::Expression(_)) } @@ -356,7 +344,7 @@ impl UnresolvedTypeData { } pub fn with_span(&self, span: Span) -> UnresolvedType { - UnresolvedType { typ: self.clone(), span: Some(span) } + UnresolvedType { typ: self.clone(), span } } } diff --git a/compiler/noirc_frontend/src/ast/statement.rs b/compiler/noirc_frontend/src/ast/statement.rs index 5d9a97fa6cf..c6ec85ab3f6 100644 --- a/compiler/noirc_frontend/src/ast/statement.rs +++ b/compiler/noirc_frontend/src/ast/statement.rs @@ -12,7 +12,7 @@ use super::{ }; use crate::elaborator::types::SELF_TYPE_NAME; use crate::lexer::token::SpannedToken; -use crate::macros_api::SecondaryAttribute; +use crate::macros_api::{SecondaryAttribute, UnresolvedTypeData}; use crate::parser::{ParserError, ParserErrorReason}; use crate::token::Token; @@ -670,7 +670,7 @@ impl ForRange { let let_array = Statement { kind: StatementKind::Let(LetStatement { pattern: Pattern::Identifier(array_ident.clone()), - r#type: UnresolvedType::unspecified(), + r#type: UnresolvedTypeData::Unspecified.with_span(Default::default()), expression: array, comptime: false, attributes: vec![], @@ -716,7 +716,7 @@ impl ForRange { let let_elem = Statement { kind: StatementKind::Let(LetStatement { pattern: Pattern::Identifier(identifier), - r#type: UnresolvedType::unspecified(), + r#type: UnresolvedTypeData::Unspecified.with_span(Default::default()), expression: Expression::new(loop_element, array_span), comptime: false, attributes: vec![], diff --git a/compiler/noirc_frontend/src/debug/mod.rs b/compiler/noirc_frontend/src/debug/mod.rs index 598ffed1433..cdb7ee94dfe 100644 --- a/compiler/noirc_frontend/src/debug/mod.rs +++ b/compiler/noirc_frontend/src/debug/mod.rs @@ -144,7 +144,7 @@ impl DebugInstrumenter { let save_ret_expr = ast::Statement { kind: ast::StatementKind::Let(ast::LetStatement { pattern: ast::Pattern::Identifier(ident("__debug_expr", ret_expr.span)), - r#type: ast::UnresolvedType::unspecified(), + r#type: ast::UnresolvedTypeData::Unspecified.with_span(Default::default()), expression: ret_expr.clone(), comptime: false, attributes: vec![], @@ -244,7 +244,7 @@ impl DebugInstrumenter { ast::Statement { kind: ast::StatementKind::Let(ast::LetStatement { pattern: ast::Pattern::Tuple(vars_pattern, let_stmt.pattern.span()), - r#type: ast::UnresolvedType::unspecified(), + r#type: ast::UnresolvedTypeData::Unspecified.with_span(Default::default()), comptime: false, expression: ast::Expression { kind: ast::ExpressionKind::Block(ast::BlockExpression { @@ -276,7 +276,7 @@ impl DebugInstrumenter { let let_kind = ast::StatementKind::Let(ast::LetStatement { pattern: ast::Pattern::Identifier(ident("__debug_expr", assign_stmt.expression.span)), - r#type: ast::UnresolvedType::unspecified(), + r#type: ast::UnresolvedTypeData::Unspecified.with_span(Default::default()), expression: assign_stmt.expression.clone(), comptime: false, attributes: vec![], diff --git a/compiler/noirc_frontend/src/elaborator/expressions.rs b/compiler/noirc_frontend/src/elaborator/expressions.rs index c136841bafa..321007c89c3 100644 --- a/compiler/noirc_frontend/src/elaborator/expressions.rs +++ b/compiler/noirc_frontend/src/elaborator/expressions.rs @@ -380,7 +380,7 @@ impl<'context> Elaborator<'context> { // so that the backend doesn't need to worry about methods // TODO: update object_type here? let ((function_id, function_name), function_call) = method_call.into_function_call( - &method_ref, + method_ref, object_type, is_macro_call, location, diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index a116e773bba..d5091f65311 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -489,6 +489,7 @@ impl<'context> Elaborator<'context> { &constraint.typ, constraint.trait_id, &constraint.trait_generics, + &constraint.associated_types, expr_id, span, ); @@ -756,8 +757,7 @@ impl<'context> Elaborator<'context> { lints::unnecessary_pub_argument(func, visibility, is_pub_allowed).map(Into::into) }); - let type_span = typ.span.unwrap_or_else(|| pattern.span()); - + let type_span = typ.span; let typ = match typ.typ { UnresolvedTypeData::TraitAsType(path, args) => { self.desugar_impl_trait_arg(path, args, &mut generics, &mut trait_constraints) @@ -927,8 +927,14 @@ impl<'context> Elaborator<'context> { let object = constraint.typ.clone(); let trait_id = constraint.trait_id; let generics = constraint.trait_generics.clone(); + let associated_types = constraint.associated_types.clone(); - if !self.interner.add_assumed_trait_implementation(object, trait_id, generics) { + if !self.interner.add_assumed_trait_implementation( + object, + trait_id, + generics, + associated_types, + ) { if let Some(the_trait) = self.interner.try_get_trait(trait_id) { let trait_name = the_trait.name.to_string(); let typ = constraint.typ.clone(); @@ -999,7 +1005,7 @@ impl<'context> Elaborator<'context> { let self_type_span = trait_impl.object_type.span; if matches!(self_type, Type::MutableReference(_)) { - let span = self_type_span.unwrap_or_else(|| trait_impl.trait_path.span()); + let span = self_type_span; self.push_err(DefCollectorErrorKind::MutableReferenceInTraitImpl { span }); } @@ -1010,12 +1016,7 @@ impl<'context> Elaborator<'context> { self.collect_trait_impl_methods(trait_id, trait_impl, &where_clause); - let span = trait_impl.object_type.span.unwrap_or_else(|| { - if self.interner.is_in_lsp_mode() { - return Default::default(); - } - unreachable!("All trait self types should have spans") - }); + let span = trait_impl.object_type.span; self.declare_methods_on_struct(true, &mut trait_impl.methods, span); let methods = trait_impl.methods.function_ids(); @@ -1046,7 +1047,7 @@ impl<'context> Elaborator<'context> { ) { self.push_err(DefCollectorErrorKind::OverlappingImpl { typ: self_type.clone(), - span: self_type_span.unwrap_or_else(|| trait_impl.trait_path.span()), + span: self_type_span, }); // The 'previous impl defined here' note must be a separate error currently @@ -1378,7 +1379,7 @@ impl<'context> Elaborator<'context> { .unwrap_or_default(); trait_impl.resolved_trait_generics = ordered_generics; - self.interner.set_associated_types_for_impl(impl_id, named_generics); + self.interner.set_associated_types_for_impl(impl_id, dbg!(named_generics)); let self_type = self.resolve_type(unresolved_type); self.self_type = Some(self_type.clone()); diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index 515de574610..8ceb1b3da10 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -7,7 +7,7 @@ use crate::{ hir::{ def_collector::dc_crate::CompilationError, resolution::errors::ResolverError, - type_check::{Source, TypeCheckError}, + type_check::{generics::TraitGenerics, Source, TypeCheckError}, }, hir_def::{ expr::{HirIdent, ImplKind}, @@ -642,10 +642,12 @@ impl<'context> Elaborator<'context> { if let ImplKind::TraitMethod(_, mut constraint, assumed) = ident.impl_kind { constraint.apply_bindings(&bindings); if assumed { - let trait_impl = TraitImplKind::Assumed { - object_type: constraint.typ, - trait_generics: constraint.trait_generics, + let trait_generics = TraitGenerics { + ordered: constraint.trait_generics, + named: constraint.associated_types, }; + let object_type = constraint.typ; + let trait_impl = TraitImplKind::Assumed { object_type, trait_generics }; self.interner.select_impl_for_expression(expr_id, trait_impl); } else { // Currently only one impl can be selected per expr_id, so this diff --git a/compiler/noirc_frontend/src/elaborator/statements.rs b/compiler/noirc_frontend/src/elaborator/statements.rs index 48380383eb0..56ff8b15192 100644 --- a/compiler/noirc_frontend/src/elaborator/statements.rs +++ b/compiler/noirc_frontend/src/elaborator/statements.rs @@ -424,7 +424,7 @@ impl<'context> Elaborator<'context> { // If we get here the type has no field named 'access.rhs'. // Now we specialize the error message based on whether we know the object type in question yet. if let Type::TypeVariable(..) = &lhs_type { - self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); + self.push_err(dbg!(TypeCheckError::TypeAnnotationsNeeded { span })); } else if lhs_type != Type::Error { self.push_err(TypeCheckError::AccessUnknownMember { lhs_type, diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index af4a23a72a4..b5b1c5a8a42 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -72,10 +72,7 @@ impl<'context> Elaborator<'context> { self.push_err(DefCollectorErrorKind::TraitMissingMethod { trait_name: self.interner.get_trait(trait_id).name.clone(), method_name: method.name.clone(), - trait_impl_span: trait_impl - .object_type - .span - .expect("type must have a span"), + trait_impl_span: trait_impl.object_type.span, }); } } else { @@ -221,7 +218,7 @@ impl<'context> Elaborator<'context> { let the_trait = self.interner.get_trait(trait_id); if self.crate_id != the_trait.crate_id && self.crate_id != object_crate { self.push_err(DefCollectorErrorKind::TraitImplOrphaned { - span: trait_impl.object_type.span.expect("object type must have a span"), + span: trait_impl.object_type.span, }); } } diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 7090d959aec..feca3266b4c 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -14,7 +14,10 @@ use crate::{ comptime::{Interpreter, Value}, def_map::ModuleDefId, resolution::errors::ResolverError, - type_check::{generics::Generic, NoMatchingImplFoundError, Source, TypeCheckError}, + type_check::{ + generics::{Generic, TraitGenerics}, + NoMatchingImplFoundError, Source, TypeCheckError, + }, }, hir_def::{ expr::{ @@ -46,9 +49,7 @@ impl<'context> Elaborator<'context> { let span = typ.span; let resolved_type = self.resolve_type_inner(typ, &Kind::Normal); if resolved_type.is_nested_slice() { - self.push_err(ResolverError::NestedSlices { - span: span.expect("Type should have span"), - }); + self.push_err(ResolverError::NestedSlices { span }); } resolved_type } @@ -118,7 +119,11 @@ impl<'context> Elaborator<'context> { } Quoted(quoted) => Type::Quoted(quoted), Unit => Type::Unit, - Unspecified => Type::Error, + Unspecified => { + let span = typ.span; + self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); + Type::Error + } Error => Type::Error, Named(path, args, _) => self.resolve_named_type(path, args), TraitAsType(path, args) => self.resolve_trait_as_type(path, args), @@ -129,12 +134,7 @@ impl<'context> Elaborator<'context> { Function(args, ret, env) => { let args = vecmap(args, |arg| self.resolve_type_inner(arg, kind)); let ret = Box::new(self.resolve_type_inner(*ret, kind)); - - // expect() here is valid, because the only places we don't have a span are omitted types - // e.g. a function without return type implicitly has a spanless UnresolvedType::Unit return type - // To get an invalid env type, the user must explicitly specify the type, which will have a span - let env_span = - env.span.expect("Unexpected missing span for closure environment type"); + let env_span = env.span; let env = Box::new(self.resolve_type_inner(*env, kind)); @@ -159,27 +159,24 @@ impl<'context> Elaborator<'context> { AsTraitPath(_) => todo!("Resolve AsTraitPath"), }; - if let Some(unresolved_span) = typ.span { - let location = Location::new(named_path_span.unwrap_or(unresolved_span), self.file); - - match resolved_type { - Type::Struct(ref struct_type, _) => { - // Record the location of the type reference - self.interner.push_type_ref_location(resolved_type.clone(), location); - - if !is_synthetic { - self.interner.add_struct_reference( - struct_type.borrow().id, - location, - is_self_type_name, - ); - } - } - Type::Alias(ref alias_type, _) => { - self.interner.add_alias_reference(alias_type.borrow().id, location); + let location = Location::new(named_path_span.unwrap_or(typ.span), self.file); + match resolved_type { + Type::Struct(ref struct_type, _) => { + // Record the location of the type reference + self.interner.push_type_ref_location(resolved_type.clone(), location); + + if !is_synthetic { + self.interner.add_struct_reference( + struct_type.borrow().id, + location, + is_self_type_name, + ); } - _ => (), } + Type::Alias(ref alias_type, _) => { + self.interner.add_alias_reference(alias_type.borrow().id, location); + } + _ => (), } // Check that any types with a type kind match the expected type kind supplied to this function @@ -197,10 +194,8 @@ impl<'context> Elaborator<'context> { // } if let Type::NamedGeneric(_, name, resolved_kind) = &resolved_type { if matches!(resolved_kind, Kind::Numeric { .. }) && matches!(kind, Kind::Normal) { - let expected_typ_err = ResolverError::NumericGenericUsedForType { - name: name.to_string(), - span: span.expect("Type should have span"), - }; + let expected_typ_err = + ResolverError::NumericGenericUsedForType { name: name.to_string(), span }; self.push_err(expected_typ_err); return Type::Error; } @@ -328,7 +323,8 @@ impl<'context> Elaborator<'context> { if let Some(id) = trait_as_type_info { let (ordered, named) = self.resolve_type_args(args, id, span); let name = self.interner.get_trait(id).name.to_string(); - Type::TraitAsType(id, Rc::new(name), ordered, named) + let generics = TraitGenerics { ordered, named }; + Type::TraitAsType(id, Rc::new(name), generics) } else { Type::Error } @@ -399,7 +395,9 @@ impl<'context> Elaborator<'context> { let expected = required_args.remove(index); seen_args.insert(name.0.contents.clone(), name.span()); + eprint!("Resolved {name}: {typ}"); let typ = self.resolve_type_inner(typ, &expected.kind); + eprintln!(" to {typ}"); resolved.push(NamedType { name, typ }); } @@ -1282,6 +1280,7 @@ impl<'context> Elaborator<'context> { // The type variable must be unbound at this point since follow_bindings was called Type::TypeVariable(_, TypeVariableKind::Normal) => { + eprintln!("Pushing error: don't know object type"); self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); None } @@ -1317,10 +1316,13 @@ impl<'context> Elaborator<'context> { if method.name.0.contents == method_name { let trait_method = TraitMethodId { trait_id: constraint.trait_id, method_index }; - return Some(HirMethodReference::TraitMethodId( - trait_method, - constraint.trait_generics.clone(), - )); + + let generics = TraitGenerics { + ordered: constraint.trait_generics.clone(), + named: constraint.associated_types.clone(), + }; + + return Some(HirMethodReference::TraitMethodId(trait_method, generics)); } } } @@ -1462,8 +1464,17 @@ impl<'context> Elaborator<'context> { let declared_return_type = meta.return_type(); let func_span = self.interner.expr_span(&body_id); // XXX: We could be more specific and return the span of the last stmt, however stmts do not have spans yet - if let Type::TraitAsType(trait_id, _, generics, _associated_types) = declared_return_type { - if self.interner.lookup_trait_implementation(&body_type, *trait_id, generics).is_err() { + if let Type::TraitAsType(trait_id, _, generics) = declared_return_type { + if self + .interner + .lookup_trait_implementation( + &body_type, + *trait_id, + &generics.ordered, + &generics.named, + ) + .is_err() + { self.push_err(TypeCheckError::TypeMismatchWithSource { expected: declared_return_type.clone(), actual: body_type, @@ -1514,14 +1525,35 @@ impl<'context> Elaborator<'context> { object_type: &Type, trait_id: TraitId, trait_generics: &[Type], + associated_types: &[NamedType], function_ident_id: ExprId, span: Span, ) { - match self.interner.lookup_trait_implementation(object_type, trait_id, trait_generics) { + let name = &self.interner.get_trait(trait_id).name.to_string(); + let t = vecmap(trait_generics, |t| format!("{t}")).join(", "); + let u = vecmap(associated_types, |n| format!("{} = {}", n.name, n.typ)).join(", "); + if name == "Serialize" { + eprintln!("Looking up {object_type}: {name}<{t}><{u}>"); + } + + match self.interner.lookup_trait_implementation( + object_type, + trait_id, + trait_generics, + associated_types, + ) { Ok(impl_kind) => { + let name = &self.interner.get_trait(trait_id).name.to_string(); + let t = vecmap(trait_generics, |t| format!("{t}")).join(", "); + let u = vecmap(associated_types, |n| format!("{} = {}", n.name, n.typ)).join(", "); + + if name == "Serialize" { + eprintln!(" {object_type}: {name}<{t}><{u}>"); + } self.interner.select_impl_for_expression(function_ident_id, impl_kind); } Err(erroring_constraints) => { + eprintln!("Pushing error!"); if erroring_constraints.is_empty() { self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); } else if let Some(error) = @@ -1589,11 +1621,11 @@ impl<'context> Elaborator<'context> { | Type::Quoted(_) | Type::Forall(_, _) => (), - Type::TraitAsType(_, _, args, associated_types) => { - for arg in args { + Type::TraitAsType(_, _, args) => { + for arg in &args.ordered { Self::find_numeric_generics_in_type(arg, found); } - for arg in associated_types { + for arg in &args.named { Self::find_numeric_generics_in_type(&arg.typ, found); } } diff --git a/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs b/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs index 2c6997c6a89..e76d0b7c1fa 100644 --- a/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs +++ b/compiler/noirc_frontend/src/hir/comptime/hir_to_display_ast.rs @@ -333,9 +333,9 @@ impl Type { } } } - Type::TraitAsType(_, name, generics, associated_types) => { - let ordered_args = vecmap(generics, |generic| generic.to_display_ast()); - let named_args = vecmap(associated_types, |named_type| { + Type::TraitAsType(_, name, generics) => { + let ordered_args = vecmap(&generics.ordered, |generic| generic.to_display_ast()); + let named_args = vecmap(&generics.named, |named_type| { (named_type.name.clone(), named_type.typ.to_display_ast()) }); let generics = GenericTypeArgs { ordered_args, named_args }; @@ -373,7 +373,7 @@ impl Type { } }; - UnresolvedType { typ, span: None } + UnresolvedType { typ, span: Span::default() } } /// Convert to AST for display (some details lost) diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs index b159cf5ac28..e6c502dcbf8 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs @@ -892,7 +892,7 @@ fn function_def_set_return_type( mutate_func_meta_type(interpreter.elaborator.interner, func_id, |func_meta| { func_meta.return_type = FunctionReturnType::Ty(UnresolvedType { typ: UnresolvedTypeData::Resolved(quoted_type_id), - span: Some(location.span), + span: location.span, }); replace_func_meta_return_type(&mut func_meta.typ, return_type); }); diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index c849fa74174..6b034f18262 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -811,7 +811,7 @@ impl<'a> ModCollector<'a> { UnresolvedTypeData::FieldElement => Type::FieldElement, UnresolvedTypeData::Integer(sign, bits) => Type::Integer(*sign, *bits), _ => { - let span = typ.span.expect("UnresolvedTypes should have spans"); + let span = typ.span; let error = ResolverError::AssociatedConstantsMustBeNumeric { span }; errors.push((error.into(), self.file_id)); Type::Error diff --git a/compiler/noirc_frontend/src/hir/type_check/errors.rs b/compiler/noirc_frontend/src/hir/type_check/errors.rs index ab1b440779e..017fe092e9c 100644 --- a/compiler/noirc_frontend/src/hir/type_check/errors.rs +++ b/compiler/noirc_frontend/src/hir/type_check/errors.rs @@ -303,7 +303,7 @@ impl<'a> From<&'a TypeCheckError> for Diagnostic { Source::Return(ret_ty, expr_span) => { let ret_ty_span = match ret_ty.clone() { FunctionReturnType::Default(span) => span, - FunctionReturnType::Ty(ty) => ty.span.unwrap(), + FunctionReturnType::Ty(ty) => ty.span, }; let mut diagnostic = Diagnostic::simple_error(format!("expected type {expected}, found type {actual}"), format!("expected {expected} because of return type"), ret_ty_span); diff --git a/compiler/noirc_frontend/src/hir_def/expr.rs b/compiler/noirc_frontend/src/hir_def/expr.rs index 7333774565b..7e0bc97a836 100644 --- a/compiler/noirc_frontend/src/hir_def/expr.rs +++ b/compiler/noirc_frontend/src/hir_def/expr.rs @@ -3,6 +3,7 @@ use fm::FileId; use noirc_errors::Location; use crate::ast::{BinaryOp, BinaryOpKind, Ident, UnaryOp}; +use crate::hir::type_check::generics::TraitGenerics; use crate::node_interner::{DefinitionId, ExprId, FuncId, NodeInterner, StmtId, TraitMethodId}; use crate::token::Tokens; use crate::Shared; @@ -198,7 +199,7 @@ pub enum HirMethodReference { /// Or a method can come from a Trait impl block, in which case /// the actual function called will depend on the instantiated type, /// which can be only known during monomorphization. - TraitMethodId(TraitMethodId, /*trait generics:*/ Vec), + TraitMethodId(TraitMethodId, TraitGenerics), } impl HirMethodCallExpression { @@ -207,7 +208,7 @@ impl HirMethodCallExpression { /// Returns ((func_var_id, func_var), call_expr) pub fn into_function_call( mut self, - method: &HirMethodReference, + method: HirMethodReference, object_type: Type, is_macro_call: bool, location: Location, @@ -218,18 +219,18 @@ impl HirMethodCallExpression { let (id, impl_kind) = match method { HirMethodReference::FuncId(func_id) => { - (interner.function_definition_id(*func_id), ImplKind::NotATraitMethod) + (interner.function_definition_id(func_id), ImplKind::NotATraitMethod) } HirMethodReference::TraitMethodId(method_id, generics) => { - let id = interner.trait_method_id(*method_id); + let id = interner.trait_method_id(method_id); let constraint = TraitConstraint { typ: object_type, trait_id: method_id.trait_id, - trait_generics: generics.clone(), - associated_types: Vec::new(), + trait_generics: generics.ordered, + associated_types: generics.named, span: location.span, }; - (id, ImplKind::TraitMethod(*method_id, constraint, false)) + (id, ImplKind::TraitMethod(method_id, constraint, false)) } }; let func_var = HirIdent { location, id, impl_kind }; diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 866cdfd2af7..33f2e3cd090 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -531,7 +531,7 @@ impl TypeVariable { }; if binding.occurs(id) { - Err(TypeCheckError::TypeAnnotationsNeeded { span }) + Err(dbg!(TypeCheckError::TypeAnnotationsNeeded { span })) } else { *self.1.borrow_mut() = TypeBinding::Bound(binding); Ok(()) @@ -2278,10 +2278,10 @@ impl Type { } } Type::TraitAsType(_, _, generics) => { - for generic in &generics.ordered { + for generic in &mut generics.ordered { generic.replace_named_generics_with_type_variables(); } - for generic in &generics.named { + for generic in &mut generics.named { generic.typ.replace_named_generics_with_type_variables(); } } diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index 5ac730db400..60f24cc5826 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -935,7 +935,9 @@ impl<'interner> Monomorphizer<'interner> { let element = Box::new(Self::convert_type(element.as_ref(), location)?); let length = match length.evaluate_to_u32() { Some(length) => length, - None => return Err(MonomorphizationError::TypeAnnotationsNeeded { location }), + None => { + return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) + } }; ast::Type::Array(length, element) } @@ -968,7 +970,9 @@ impl<'interner> Monomorphizer<'interner> { // and within a larger generic type. let default = match kind.default_type() { Some(typ) => typ, - None => return Err(MonomorphizationError::TypeAnnotationsNeeded { location }), + None => { + return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) + } }; let monomorphized_default = Self::convert_type(&default, location)?; @@ -1070,7 +1074,9 @@ impl<'interner> Monomorphizer<'interner> { // and within a larger generic type. let default = match kind.default_type() { Some(typ) => typ, - None => return Err(MonomorphizationError::TypeAnnotationsNeeded { location }), + None => { + return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) + } }; Self::check_type(&default, location) @@ -1937,7 +1943,8 @@ pub fn resolve_trait_method( match interner.lookup_trait_implementation( &object_type, method.trait_id, - &trait_generics, + &trait_generics.ordered, + &trait_generics.named, ) { Ok(TraitImplKind::Normal(impl_id)) => impl_id, Ok(TraitImplKind::Assumed { .. }) => { diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 7e9fe2d588a..63215a9bfe1 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -19,6 +19,7 @@ use crate::hir::comptime; use crate::hir::def_collector::dc_crate::CompilationError; use crate::hir::def_collector::dc_crate::{UnresolvedStruct, UnresolvedTrait, UnresolvedTypeAlias}; use crate::hir::def_map::{LocalModuleId, ModuleId}; +use crate::hir::type_check::generics::TraitGenerics; use crate::hir_def::traits::NamedType; use crate::macros_api::UnaryOp; use crate::QuotedType; @@ -307,7 +308,7 @@ pub enum TraitImplKind { /// /// The reference `Into::into(x)` would have inferred generics, but /// `x.into()` with a `X: Into` in scope would not. - trait_generics: Vec, + trait_generics: TraitGenerics, }, } @@ -1379,23 +1380,14 @@ impl NodeInterner { ) -> Vec<&TraitImplKind> { let trait_impl = self.trait_implementation_map.get(&trait_id); - trait_impl - .map(|trait_impl| { - trait_impl - .iter() - .filter_map(|(typ, impl_kind)| match &typ { - Type::Forall(_, typ) => { - if typ.deref() == object_type { - Some(impl_kind) - } else { - None - } - } - _ => None, - }) - .collect() - }) - .unwrap_or_default() + let trait_impl = trait_impl.map(|trait_impl| { + let impls = trait_impl.iter().filter_map(|(typ, impl_kind)| match &typ { + Type::Forall(_, typ) => (typ.deref() == object_type).then_some(impl_kind), + _ => None, + }); + impls.collect() + }); + trait_impl.unwrap_or_default() } /// Similar to `lookup_trait_implementation` but does not apply any type bindings on success. @@ -1453,8 +1445,20 @@ impl NodeInterner { let object_type = object_type.substitute(type_bindings); + let n = self.get_trait(trait_id).name.to_string(); + if n == "Serialize" { + let t = vecmap(trait_generics, |t| format!("{t:?}")).join(", "); + let n = + vecmap(trait_associated_types, |t| format!("{} = {:?}", t.name, t.typ)).join(", "); + eprintln!("? {object_type:?}: Serialize<{t}><{n}>"); + } + // If the object type isn't known, just return an error saying type annotations are needed. if object_type.is_bindable() { + let n = self.get_trait(trait_id).name.to_string(); + if n == "Serialize" { + eprintln!(" type is bindable"); + } return Err(Vec::new()); } @@ -1472,25 +1476,44 @@ impl NodeInterner { let mut fresh_bindings = type_bindings.clone(); - let mut check_trait_generics = |impl_generics: &[Type]| { - trait_generics.iter().zip(impl_generics).all(|(trait_generic, impl_generic2)| { - let impl_generic = impl_generic2.substitute(&instantiation_bindings); - trait_generic.try_unify(&impl_generic, &mut fresh_bindings).is_ok() - }) - }; + let mut check_trait_generics = + |impl_generics: &[Type], impl_associated_types: &[NamedType]| { + let n = self.get_trait(trait_id).name.to_string(); + if n == "Serialize" { + let t = vecmap(impl_generics, |t| format!("{t:?}")).join(", "); + let n = + vecmap(impl_associated_types, |t| format!("{} = {:?}", t.name, t.typ)) + .join(", "); + eprintln!(" ?? {object_type:?}: Serialize<{t}><{n}>"); + } + trait_generics.iter().zip(impl_generics).all(|(trait_generic, impl_generic)| { + let impl_generic = impl_generic.substitute(&instantiation_bindings); + trait_generic.try_unify(&impl_generic, &mut fresh_bindings).is_ok() + }) && trait_associated_types.iter().zip(impl_associated_types).all( + |(trait_generic, impl_generic)| { + let impl_generic = impl_generic.typ.substitute(&instantiation_bindings); + trait_generic.typ.try_unify(&impl_generic, &mut fresh_bindings).is_ok() + }, + ) + }; let generics_match = match impl_kind { TraitImplKind::Normal(id) => { let shared_impl = self.get_trait_implementation(*id); let shared_impl = shared_impl.borrow(); - check_trait_generics(&shared_impl.trait_generics) + let impl_associated_types = self.get_associated_types_for_impl(*id); + check_trait_generics(&shared_impl.trait_generics, impl_associated_types) } TraitImplKind::Assumed { trait_generics, .. } => { - check_trait_generics(trait_generics) + check_trait_generics(&trait_generics.ordered, &trait_generics.named) } }; if !generics_match { + let n = self.get_trait(trait_id).name.to_string(); + if n == "Serialize" { + eprintln!(" Generics don't match"); + } continue; } @@ -1513,6 +1536,10 @@ impl NodeInterner { } } + let n = self.get_trait(trait_id).name.to_string(); + if n == "Serialize" { + eprintln!(" selected"); + } matching_impls.push((impl_kind.clone(), fresh_bindings)); } } @@ -1599,6 +1626,8 @@ impl NodeInterner { } let entries = self.trait_implementation_map.entry(trait_id).or_default(); + let trait_generics = + TraitGenerics { ordered: trait_generics, named: trait_associated_types }; entries.push((object_type.clone(), TraitImplKind::Assumed { object_type, trait_generics })); true } @@ -1630,7 +1659,7 @@ impl NodeInterner { let instantiated_object_type = object_type.substitute(&substitutions); let trait_generics = &trait_impl.borrow().trait_generics; - let associated_types = self.get_associated_types_for_impl(impl_id); + let associated_types = dbg!(self.get_associated_types_for_impl(impl_id)); // Ignoring overlapping `TraitImplKind::Assumed` impls here is perfectly fine. // It should never happen since impls are defined at global scope, but even diff --git a/compiler/noirc_frontend/src/parser/parser.rs b/compiler/noirc_frontend/src/parser/parser.rs index a576d0b4686..df3edcaccce 100644 --- a/compiler/noirc_frontend/src/parser/parser.rs +++ b/compiler/noirc_frontend/src/parser/parser.rs @@ -409,9 +409,9 @@ fn check_statements_require_semicolon( /// Parse an optional ': type' fn optional_type_annotation<'a>() -> impl NoirParser + 'a { - ignore_then_commit(just(Token::Colon), parse_type()) - .or_not() - .map(|r#type| r#type.unwrap_or_else(UnresolvedType::unspecified)) + ignore_then_commit(just(Token::Colon), parse_type()).or_not().map_with_span(|r#type, span| { + r#type.unwrap_or(UnresolvedTypeData::Unspecified.with_span(span)) + }) } fn module_declaration() -> impl NoirParser { diff --git a/compiler/noirc_frontend/src/parser/parser/lambdas.rs b/compiler/noirc_frontend/src/parser/parser/lambdas.rs index 2b4a1d547c0..5ef0b918375 100644 --- a/compiler/noirc_frontend/src/parser/parser/lambdas.rs +++ b/compiler/noirc_frontend/src/parser/parser/lambdas.rs @@ -2,6 +2,7 @@ use chumsky::{primitive::just, Parser}; use super::{parse_type, pattern}; use crate::ast::{Expression, ExpressionKind, Lambda, Pattern, UnresolvedType}; +use crate::macros_api::UnresolvedTypeData; use crate::{ parser::{labels::ParsingRuleLabel, parameter_name_recovery, parameter_recovery, NoirParser}, token::Token, @@ -23,9 +24,10 @@ fn lambda_parameters() -> impl NoirParser> { let typ = parse_type().recover_via(parameter_recovery()); let typ = just(Token::Colon).ignore_then(typ); - let parameter = pattern() - .recover_via(parameter_name_recovery()) - .then(typ.or_not().map(|typ| typ.unwrap_or_else(UnresolvedType::unspecified))); + let parameter = + pattern().recover_via(parameter_name_recovery()).then(typ.or_not().map_with_span( + |typ, span| typ.unwrap_or(UnresolvedTypeData::Unspecified.with_span(span)), + )); parameter .separated_by(just(Token::Comma)) @@ -37,5 +39,5 @@ fn lambda_return_type() -> impl NoirParser { just(Token::Arrow) .ignore_then(parse_type()) .or_not() - .map(|ret| ret.unwrap_or_else(UnresolvedType::unspecified)) + .map_with_span(|ret, span| ret.unwrap_or(UnresolvedTypeData::Unspecified.with_span(span))) } diff --git a/compiler/noirc_frontend/src/parser/parser/types.rs b/compiler/noirc_frontend/src/parser/parser/types.rs index a3c57f3f72e..a217fd755af 100644 --- a/compiler/noirc_frontend/src/parser/parser/types.rs +++ b/compiler/noirc_frontend/src/parser/parser/types.rs @@ -65,7 +65,7 @@ pub(super) fn parenthesized_type( .delimited_by(just(Token::LeftParen), just(Token::RightParen)) .map_with_span(|typ, span| UnresolvedType { typ: UnresolvedTypeData::Parenthesized(Box::new(typ)), - span: span.into(), + span, }) } diff --git a/tooling/lsp/src/requests/completion.rs b/tooling/lsp/src/requests/completion.rs index bffff4b07a3..c0780aa0302 100644 --- a/tooling/lsp/src/requests/completion.rs +++ b/tooling/lsp/src/requests/completion.rs @@ -640,10 +640,8 @@ impl<'a> NodeFinder<'a> { } fn find_in_unresolved_type(&mut self, unresolved_type: &UnresolvedType) { - if let Some(span) = unresolved_type.span { - if !self.includes_span(span) { - return; - } + if !self.includes_span(unresolved_type.span) { + return; } match &unresolved_type.typ { diff --git a/tooling/lsp/src/requests/document_symbol.rs b/tooling/lsp/src/requests/document_symbol.rs index 73a2dd7935e..6bc7a663271 100644 --- a/tooling/lsp/src/requests/document_symbol.rs +++ b/tooling/lsp/src/requests/document_symbol.rs @@ -140,11 +140,7 @@ impl<'a> DocumentSymbolCollector<'a> { let mut children = Vec::new(); for (field_name, typ) in &noir_struct.fields { - let span = if let Some(typ) = typ.span { - Span::from(field_name.span().start()..typ.end()) - } else { - field_name.span() - }; + let span = Span::from(field_name.span().start()..typ.span.end()); let Some(field_location) = self.to_lsp_location(span) else { continue; @@ -238,9 +234,7 @@ impl<'a> DocumentSymbolCollector<'a> { span = Span::from(span.start()..return_type_span.end()); } FunctionReturnType::Ty(typ) => { - if let Some(type_span) = typ.span { - span = Span::from(span.start()..type_span.end()); - } + span = Span::from(span.start()..typ.span.end()); } } @@ -290,9 +284,7 @@ impl<'a> DocumentSymbolCollector<'a> { let mut span = name.span(); // If there's a type span, extend the span to include it - if let Some(type_span) = typ.span { - span = Span::from(span.start()..type_span.end()); - } + span = Span::from(span.start()..typ.span.end()); // If there's a default value, extend the span to include it if let Some(default_value) = default_value { @@ -326,7 +318,7 @@ impl<'a> DocumentSymbolCollector<'a> { return; }; - let span = if let Some(type_span) = typ.and_then(|typ| typ.span) { + let span = if let Some(type_span) = typ.map(|typ| typ.span) { Span::from(name.span().start()..type_span.end()) } else { name.span() diff --git a/tooling/lsp/src/requests/hover.rs b/tooling/lsp/src/requests/hover.rs index 1ace743d034..5c852e8e84c 100644 --- a/tooling/lsp/src/requests/hover.rs +++ b/tooling/lsp/src/requests/hover.rs @@ -421,13 +421,13 @@ impl<'a> TypeLinksGatherer<'a> { Type::TypeVariable(var, _) => { self.gather_type_variable_links(var); } - Type::TraitAsType(trait_id, _, generics, associated_types) => { + Type::TraitAsType(trait_id, _, generics) => { let some_trait = self.interner.get_trait(*trait_id); self.gather_trait_links(some_trait); - for generic in generics { + for generic in &generics.ordered { self.gather_type_links(generic); } - for named_type in associated_types { + for named_type in &generics.named { self.gather_type_links(&named_type.typ); } } diff --git a/tooling/nargo_fmt/src/rewrite/typ.rs b/tooling/nargo_fmt/src/rewrite/typ.rs index b586f32a6fe..32e485bd6ee 100644 --- a/tooling/nargo_fmt/src/rewrite/typ.rs +++ b/tooling/nargo_fmt/src/rewrite/typ.rs @@ -38,7 +38,7 @@ pub(crate) fn rewrite(visitor: &FmtVisitor, _shape: Shape, typ: UnresolvedType) } } UnresolvedTypeData::Function(args, return_type, env) => { - let env = if span_is_empty(env.span.unwrap()) { + let env = if span_is_empty(env.span) { "".into() } else { let ty = rewrite(visitor, _shape, *env); @@ -70,7 +70,7 @@ pub(crate) fn rewrite(visitor: &FmtVisitor, _shape: Shape, typ: UnresolvedType) | UnresolvedTypeData::String(_) | UnresolvedTypeData::FormatString(_, _) | UnresolvedTypeData::Quoted(_) - | UnresolvedTypeData::TraitAsType(_, _) => visitor.slice(typ.span.unwrap()).into(), + | UnresolvedTypeData::TraitAsType(_, _) => visitor.slice(typ.span).into(), UnresolvedTypeData::Error => unreachable!(), } } diff --git a/tooling/nargo_fmt/src/visitor/item.rs b/tooling/nargo_fmt/src/visitor/item.rs index 0c9f61a7d40..1b16d6366ae 100644 --- a/tooling/nargo_fmt/src/visitor/item.rs +++ b/tooling/nargo_fmt/src/visitor/item.rs @@ -108,14 +108,16 @@ impl super::FmtVisitor<'_> { fn format_return_type( &self, - return_type_span: Option, + span: Span, func: &NoirFunction, func_span: Span, params_end: u32, ) -> String { let mut result = String::new(); - if let Some(span) = return_type_span { + if span.start() == span.end() { + result.push_str(self.slice(params_end..func_span.start())); + } else { result.push_str(" -> "); let visibility = match func.def.return_visibility { @@ -135,8 +137,6 @@ impl super::FmtVisitor<'_> { if !slice.trim().is_empty() { result.push_str(slice); } - } else { - result.push_str(self.slice(params_end..func_span.start())); } result From 480a91d71ee8253ba3f35b96e38ca8a6edec1168 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Wed, 14 Aug 2024 16:11:10 -0500 Subject: [PATCH 14/37] Start trying to resolve AsTraitPaths --- aztec_macros/src/utils/parse_utils.rs | 5 ++ compiler/noirc_frontend/src/ast/mod.rs | 8 +++ compiler/noirc_frontend/src/elaborator/mod.rs | 2 +- .../src/elaborator/statements.rs | 39 +++++------- .../src/elaborator/trait_impls.rs | 14 ++++- .../noirc_frontend/src/elaborator/types.rs | 63 ++++++++++++++++--- 6 files changed, 99 insertions(+), 32 deletions(-) diff --git a/aztec_macros/src/utils/parse_utils.rs b/aztec_macros/src/utils/parse_utils.rs index 162f21338d9..2ab3993db68 100644 --- a/aztec_macros/src/utils/parse_utils.rs +++ b/aztec_macros/src/utils/parse_utils.rs @@ -549,5 +549,10 @@ fn empty_unresolved_type_expression(unresolved_type_expression: &mut UnresolvedT empty_unresolved_type_expression(rhs); } UnresolvedTypeExpression::Constant(_, _) => (), + UnresolvedTypeExpression::AsTraitPath(path) => { + empty_unresolved_type(&mut path.typ); + empty_path(&mut path.trait_path); + empty_ident(&mut path.impl_item); + } } } diff --git a/compiler/noirc_frontend/src/ast/mod.rs b/compiler/noirc_frontend/src/ast/mod.rs index 1a6ec6acac7..102e4a7978f 100644 --- a/compiler/noirc_frontend/src/ast/mod.rs +++ b/compiler/noirc_frontend/src/ast/mod.rs @@ -215,6 +215,7 @@ pub enum UnresolvedTypeExpression { Box, Span, ), + AsTraitPath(Box), } impl Recoverable for UnresolvedType { @@ -310,6 +311,7 @@ impl std::fmt::Display for UnresolvedTypeExpression { UnresolvedTypeExpression::BinaryOperation(lhs, op, rhs, _) => { write!(f, "({lhs} {op} {rhs})") } + UnresolvedTypeExpression::AsTraitPath(path) => write!(f, "{path}"), } } } @@ -381,6 +383,9 @@ impl UnresolvedTypeExpression { UnresolvedTypeExpression::Variable(path) => path.span(), UnresolvedTypeExpression::Constant(_, span) => *span, UnresolvedTypeExpression::BinaryOperation(_, _, _, span) => *span, + UnresolvedTypeExpression::AsTraitPath(path) => { + path.trait_path.span.merge(path.impl_item.span()) + } } } @@ -423,6 +428,9 @@ impl UnresolvedTypeExpression { }; Ok(UnresolvedTypeExpression::BinaryOperation(lhs, op, rhs, expr.span)) } + ExpressionKind::AsTraitPath(path) => { + Ok(UnresolvedTypeExpression::AsTraitPath(Box::new(path))) + } _ => Err(expr), } } diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index d5091f65311..c5df721b8e3 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -1365,7 +1365,7 @@ impl<'context> Elaborator<'context> { // Add each associated type to the list of named type arguments let mut trait_generics = trait_impl.trait_generics.clone(); - trait_generics.named_args.extend(Self::take_unresolved_associated_types(trait_impl)); + trait_generics.named_args.extend(self.take_unresolved_associated_types(trait_impl)); let impl_id = self.interner.next_trait_impl_id(); self.current_trait_impl = Some(impl_id); diff --git a/compiler/noirc_frontend/src/elaborator/statements.rs b/compiler/noirc_frontend/src/elaborator/statements.rs index 56ff8b15192..d8e925f581a 100644 --- a/compiler/noirc_frontend/src/elaborator/statements.rs +++ b/compiler/noirc_frontend/src/elaborator/statements.rs @@ -66,36 +66,31 @@ impl<'context> Elaborator<'context> { ) -> (HirStatement, Type) { let expr_span = let_stmt.expression.span; let (expression, expr_type) = self.elaborate_expression(let_stmt.expression); - let annotated_type = self.resolve_type(let_stmt.r#type); + let annotated_type = self.resolve_inferred_type(let_stmt.r#type); let definition = match global_id { None => DefinitionKind::Local(Some(expression)), Some(id) => DefinitionKind::Global(id), }; - // First check if the LHS is unspecified - // If so, then we give it the same type as the expression - let r#type = if annotated_type != Type::Error { - // Now check if LHS is the same type as the RHS - // Importantly, we do not coerce any types implicitly - self.unify_with_coercions(&expr_type, &annotated_type, expression, || { - TypeCheckError::TypeMismatch { - expected_typ: annotated_type.to_string(), - expr_typ: expr_type.to_string(), - expr_span, - } - }); - if annotated_type.is_integer() { - let errors = lints::overflowing_int(self.interner, &expression, &annotated_type); - for error in errors { - self.push_err(error); - } + // Now check if LHS is the same type as the RHS + // Importantly, we do not coerce any types implicitly + self.unify_with_coercions(&expr_type, &annotated_type, expression, || { + TypeCheckError::TypeMismatch { + expected_typ: annotated_type.to_string(), + expr_typ: expr_type.to_string(), + expr_span, } - annotated_type - } else { - expr_type - }; + }); + + if annotated_type.is_integer() { + let errors = lints::overflowing_int(self.interner, &expression, &annotated_type); + for error in errors { + self.push_err(error); + } + } + let r#type = annotated_type; let pattern = self.elaborate_pattern_and_store_ids( let_stmt.pattern, r#type.clone(), diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index b5b1c5a8a42..47550be0c43 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -1,7 +1,8 @@ use crate::{ + ast::UnresolvedTypeExpression, graph::CrateId, hir::def_collector::{dc_crate::UnresolvedTraitImpl, errors::DefCollectorErrorKind}, - macros_api::{Ident, UnresolvedType}, + macros_api::{Ident, UnresolvedType, UnresolvedTypeData}, node_interner::TraitImplId, ResolvedGeneric, }; @@ -224,10 +225,19 @@ impl<'context> Elaborator<'context> { } pub(super) fn take_unresolved_associated_types( + &mut self, trait_impl: &mut UnresolvedTraitImpl, ) -> Vec<(Ident, UnresolvedType)> { let mut associated_types = Vec::new(); - for (name, typ, _) in trait_impl.associated_constants.drain(..) { + for (name, _, expr) in trait_impl.associated_constants.drain(..) { + let span = expr.span; + let typ = match UnresolvedTypeExpression::from_expr(expr, span) { + Ok(expr) => UnresolvedTypeData::Expression(expr).with_span(span), + Err(error) => { + self.push_err(error); + UnresolvedTypeData::Error.with_span(span) + } + }; associated_types.push((name, typ)); } for (name, typ) in trait_impl.associated_types.drain(..) { diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index feca3266b4c..b1e5b260e92 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -7,8 +7,8 @@ use rustc_hash::FxHashMap as HashMap; use crate::{ ast::{ - BinaryOpKind, GenericTypeArgs, IntegerBitSize, UnresolvedGeneric, UnresolvedGenerics, - UnresolvedTypeExpression, + AsTraitPath, BinaryOpKind, GenericTypeArgs, IntegerBitSize, UnresolvedGeneric, + UnresolvedGenerics, UnresolvedTypeExpression, }, hir::{ comptime::{Interpreter, Value}, @@ -32,8 +32,8 @@ use crate::{ SecondaryAttribute, Signedness, UnaryOp, UnresolvedType, UnresolvedTypeData, }, node_interner::{ - DefinitionKind, DependencyId, ExprId, FuncId, GlobalId, TraitId, TraitImplKind, - TraitMethodId, + DefinitionKind, DependencyId, ExprId, FuncId, GlobalId, TraitId, TraitImplId, + TraitImplKind, TraitMethodId, }, Generics, Kind, ResolvedGeneric, Type, TypeBinding, TypeVariable, TypeVariableKind, }; @@ -156,7 +156,7 @@ impl<'context> Elaborator<'context> { } Parenthesized(typ) => self.resolve_type_inner(*typ, kind), Resolved(id) => self.interner.get_quoted_type(id).clone(), - AsTraitPath(_) => todo!("Resolve AsTraitPath"), + AsTraitPath(path) => self.resolve_as_trait_path(*path), }; let location = Location::new(named_path_span.unwrap_or(typ.span), self.file); @@ -395,9 +395,7 @@ impl<'context> Elaborator<'context> { let expected = required_args.remove(index); seen_args.insert(name.0.contents.clone(), name.span()); - eprint!("Resolved {name}: {typ}"); let typ = self.resolve_type_inner(typ, &expected.kind); - eprintln!(" to {typ}"); resolved.push(NamedType { name, typ }); } @@ -467,6 +465,57 @@ impl<'context> Elaborator<'context> { } } } + UnresolvedTypeExpression::AsTraitPath(path) => self.resolve_as_trait_path(*path), + } + } + + fn resolve_as_trait_path(&mut self, path: AsTraitPath) -> Type { + // TODO! Need to resolve typ, this should be a trait constraint not just a lookup + if path.trait_path.segments.len() == 1 && path.trait_path.first_name() == SELF_TYPE_NAME { + if let Some(impl_id) = self.current_trait_impl { + self.get_associated_type_from_trait_impl(path, impl_id) + } else if let Some(trait_id) = self.current_trait { + self.get_associated_type_from_trait(trait_id, &path.impl_item) + } else { + todo!("No Self in scope error"); + } + } else { + let Some(trait_id) = self.resolve_trait_by_path(path.trait_path) else { + // Error should already be pushed in the None case + return Type::Error; + }; + self.get_associated_type_from_trait(trait_id, &path.impl_item) + } + } + + /// Retrieves an associated type with the given name from the given trait. + /// If there is no such type, we push an error and return Type::Error. + fn get_associated_type_from_trait(&mut self, trait_id: TraitId, name: &Ident) -> Type { + let the_trait = self.interner.get_trait(trait_id); + match the_trait.get_associated_type(&name.0.contents) { + Some(generic) => generic.clone().as_named_generic(), + None => { + let name = name.clone(); + let item = the_trait.name.to_string(); + self.push_err(TypeCheckError::NoSuchNamedTypeArg { name, item }); + Type::Error + } + } + } + + fn get_associated_type_from_trait_impl( + &mut self, + path: AsTraitPath, + impl_id: TraitImplId, + ) -> Type { + match self.interner.find_associated_type_for_impl(impl_id, &path.impl_item.0.contents) { + Some(generic) => generic.clone(), + None => { + let name = path.impl_item.clone(); + let item = format!("<{} as {}>", path.typ, path.trait_path); + self.push_err(TypeCheckError::NoSuchNamedTypeArg { name, item }); + Type::Error + } } } From 2553e3143ca81fe95c9bae179e321b3b59fca7a3 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Thu, 15 Aug 2024 14:24:02 -0500 Subject: [PATCH 15/37] Get associated types mostly working --- compiler/noirc_frontend/src/ast/statement.rs | 5 +- compiler/noirc_frontend/src/elaborator/mod.rs | 2 +- .../noirc_frontend/src/elaborator/patterns.rs | 7 ++ .../src/elaborator/trait_impls.rs | 24 ++++++ .../noirc_frontend/src/elaborator/traits.rs | 9 +- .../noirc_frontend/src/elaborator/types.rs | 85 +++++++++---------- .../src/hir/def_collector/dc_mod.rs | 2 - compiler/noirc_frontend/src/hir_def/traits.rs | 4 + .../src/monomorphization/mod.rs | 1 + compiler/noirc_frontend/src/node_interner.rs | 19 +++-- .../noirc_frontend/src/parser/parser/path.rs | 8 +- 11 files changed, 107 insertions(+), 59 deletions(-) diff --git a/compiler/noirc_frontend/src/ast/statement.rs b/compiler/noirc_frontend/src/ast/statement.rs index c6ec85ab3f6..4105e0c3328 100644 --- a/compiler/noirc_frontend/src/ast/statement.rs +++ b/compiler/noirc_frontend/src/ast/statement.rs @@ -7,8 +7,8 @@ use iter_extended::vecmap; use noirc_errors::{Span, Spanned}; use super::{ - BlockExpression, Expression, ExpressionKind, IndexExpression, MemberAccessExpression, - MethodCallExpression, UnresolvedType, + BlockExpression, Expression, ExpressionKind, GenericTypeArgs, IndexExpression, + MemberAccessExpression, MethodCallExpression, UnresolvedType, }; use crate::elaborator::types::SELF_TYPE_NAME; use crate::lexer::token::SpannedToken; @@ -369,6 +369,7 @@ impl UseTree { pub struct AsTraitPath { pub typ: UnresolvedType, pub trait_path: Path, + pub trait_generics: GenericTypeArgs, pub impl_item: Ident, } diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index c5df721b8e3..241f748d6c3 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -1379,7 +1379,7 @@ impl<'context> Elaborator<'context> { .unwrap_or_default(); trait_impl.resolved_trait_generics = ordered_generics; - self.interner.set_associated_types_for_impl(impl_id, dbg!(named_generics)); + self.interner.set_associated_types_for_impl(impl_id, named_generics); let self_type = self.resolve_type(unresolved_type); self.self_type = Some(self_type.clone()); diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index 8ceb1b3da10..0676734144e 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -618,6 +618,13 @@ impl<'context> Elaborator<'context> { _ => 0, }); + if matches!(t, Type::Forall(..)) { + if let Some(d) = definition { + let n = &d.name; + eprintln!("{n}: {t:?}"); + } + } + let span = self.interner.expr_span(&expr_id); let location = self.interner.expr_location(&expr_id); diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index 47550be0c43..04e6474ec14 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -245,4 +245,28 @@ impl<'context> Elaborator<'context> { } associated_types } + + // Associated types aren't required to be specified in a trait constraint. + // If they aren't we have to implicitly add them and introduce a new generic + // into scope for them. + // pub(super) fn add_implicit_associated_types(&mut self) { + // // Add any associated types that weren't mentioend as implicit generics. + // if let Some(trait_id) = trait_impl.trait_id { + // let the_trait = self.interner.get_trait(trait_id); + // for associated_type in &the_trait.associated_types { + // if !associated_types.iter().any(|typ| typ.0.0.contents == *associated_type.name.as_ref()) { + // let name = Ident::new(associated_type.name.as_ref().clone(), associated_type.span); + // let type_var = TypeVariable::unbound(self.interner.next_type_variable_id()); + + // self.generics.push(ResolvedGeneric { + // name: associated_type.name.clone(), + // type_var, + // kind: associated_type.kind.clone(), + // span: trait_impl.trait_path.span, + // }); + // associated_types.push((name, Type::TypeVariable(type_var, TypeVariableKind::Normal))); + // } + // } + // } + // } } diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index 8c3e414a004..96c9cdd24da 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -32,6 +32,12 @@ impl<'context> Elaborator<'context> { &resolved_generics, ); + // Each associated type in this trait is also an implicit generic + for associated_type in &this.interner.get_trait(*trait_id).associated_types { + eprintln!("Pushing associated type generic {associated_type:?}"); + this.generics.push(associated_type.clone()); + } + let methods = this.resolve_trait_methods(*trait_id, unresolved_trait); this.interner.update_trait(*trait_id, |trait_def| { @@ -266,9 +272,10 @@ pub(crate) fn check_trait_impl_method_matches_declaration( ) in trait_fn_meta.direct_generics.iter().zip(&meta.direct_generics) { let arg = Type::NamedGeneric(impl_fn_generic.clone(), name.clone(), Kind::Normal); - bindings.insert(trait_fn_generic.id(), (trait_fn_generic.clone(), arg)); + bindings.insert(dbg!(trait_fn_generic.id()), (trait_fn_generic.clone(), arg)); } + eprintln!("Instantiating {:?} with bindings {:?}", trait_fn_meta.typ, bindings); let (declaration_type, _) = trait_fn_meta.typ.instantiate_with_bindings(bindings, interner); check_function_type_matches_expected_type( diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index b1e5b260e92..0c649910c22 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeMap, rc::Rc}; +use std::{borrow::Cow, collections::BTreeMap, rc::Rc}; use acvm::acir::AcirField; use iter_extended::vecmap; @@ -32,8 +32,8 @@ use crate::{ SecondaryAttribute, Signedness, UnaryOp, UnresolvedType, UnresolvedTypeData, }, node_interner::{ - DefinitionKind, DependencyId, ExprId, FuncId, GlobalId, TraitId, TraitImplId, - TraitImplKind, TraitMethodId, + DefinitionKind, DependencyId, ExprId, FuncId, GlobalId, TraitId, TraitImplKind, + TraitMethodId, }, Generics, Kind, ResolvedGeneric, Type, TypeBinding, TypeVariable, TypeVariableKind, }; @@ -470,35 +470,20 @@ impl<'context> Elaborator<'context> { } fn resolve_as_trait_path(&mut self, path: AsTraitPath) -> Type { - // TODO! Need to resolve typ, this should be a trait constraint not just a lookup - if path.trait_path.segments.len() == 1 && path.trait_path.first_name() == SELF_TYPE_NAME { - if let Some(impl_id) = self.current_trait_impl { - self.get_associated_type_from_trait_impl(path, impl_id) - } else if let Some(trait_id) = self.current_trait { - self.get_associated_type_from_trait(trait_id, &path.impl_item) - } else { - todo!("No Self in scope error"); - } - } else { - let Some(trait_id) = self.resolve_trait_by_path(path.trait_path) else { - // Error should already be pushed in the None case - return Type::Error; - }; - self.get_associated_type_from_trait(trait_id, &path.impl_item) - } - } + let span = path.trait_path.span; + let Some(trait_id) = self.resolve_trait_by_path(path.trait_path.clone()) else { + // Error should already be pushed in the None case + return Type::Error; + }; - /// Retrieves an associated type with the given name from the given trait. - /// If there is no such type, we push an error and return Type::Error. - fn get_associated_type_from_trait(&mut self, trait_id: TraitId, name: &Ident) -> Type { - let the_trait = self.interner.get_trait(trait_id); - match the_trait.get_associated_type(&name.0.contents) { - Some(generic) => generic.clone().as_named_generic(), - None => { - let name = name.clone(); - let item = the_trait.name.to_string(); - self.push_err(TypeCheckError::NoSuchNamedTypeArg { name, item }); - Type::Error + let (ordered, named) = self.resolve_type_args(path.trait_generics.clone(), trait_id, span); + let object_type = self.resolve_type(path.typ.clone()); + + match self.interner.lookup_trait_implementation(&object_type, trait_id, &ordered, &named) { + Ok(impl_kind) => self.get_associated_type_from_trait_impl(path, impl_kind), + Err(constraints) => { + self.push_trait_constraint_error(constraints, span); + return Type::Error; } } } @@ -506,10 +491,17 @@ impl<'context> Elaborator<'context> { fn get_associated_type_from_trait_impl( &mut self, path: AsTraitPath, - impl_id: TraitImplId, + impl_kind: TraitImplKind, ) -> Type { - match self.interner.find_associated_type_for_impl(impl_id, &path.impl_item.0.contents) { - Some(generic) => generic.clone(), + let associated_types = match impl_kind { + TraitImplKind::Assumed { trait_generics, .. } => Cow::Owned(trait_generics.named), + TraitImplKind::Normal(impl_id) => { + Cow::Borrowed(self.interner.get_associated_types_for_impl(impl_id)) + } + }; + + match associated_types.iter().find(|named| named.name == path.impl_item) { + Some(generic) => generic.typ.clone(), None => { let name = path.impl_item.clone(); let item = format!("<{} as {}>", path.typ, path.trait_path); @@ -1582,7 +1574,7 @@ impl<'context> Elaborator<'context> { let t = vecmap(trait_generics, |t| format!("{t}")).join(", "); let u = vecmap(associated_types, |n| format!("{} = {}", n.name, n.typ)).join(", "); if name == "Serialize" { - eprintln!("Looking up {object_type}: {name}<{t}><{u}>"); + eprintln!("Looking up {object_type}: Serialize<{t}><{u}>"); } match self.interner.lookup_trait_implementation( @@ -1597,23 +1589,26 @@ impl<'context> Elaborator<'context> { let u = vecmap(associated_types, |n| format!("{} = {}", n.name, n.typ)).join(", "); if name == "Serialize" { - eprintln!(" {object_type}: {name}<{t}><{u}>"); + eprintln!(" {object_type}: Serialize<{t}><{u}>"); } self.interner.select_impl_for_expression(function_ident_id, impl_kind); } - Err(erroring_constraints) => { - eprintln!("Pushing error!"); - if erroring_constraints.is_empty() { - self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); - } else if let Some(error) = - NoMatchingImplFoundError::new(self.interner, erroring_constraints, span) - { - self.push_err(TypeCheckError::NoMatchingImplFound(error)); - } + Err(constraints) => { + eprintln!("\n!! Error !!\n"); + self.push_trait_constraint_error(constraints, span) } } } + fn push_trait_constraint_error(&mut self, constraints: Vec, span: Span) { + if constraints.is_empty() { + self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); + } else if let Some(error) = NoMatchingImplFoundError::new(self.interner, constraints, span) + { + self.push_err(TypeCheckError::NoMatchingImplFound(error)); + } + } + pub fn add_existing_generics( &mut self, unresolved_generics: &UnresolvedGenerics, diff --git a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index 6b034f18262..23ae866fa2a 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -555,7 +555,6 @@ impl<'a> ModCollector<'a> { } } TraitItem::Type { name } => { - // TODO(nickysn or alexvitkov): implement context.def_interner.push_empty_type_alias and get an id, instead of using TypeAliasId::dummy_id() if let Err((first_def, second_def)) = self.def_collector.def_map.modules [trait_id.0.local_id.0] .declare_type_alias(name.clone(), TypeAliasId::dummy_id()) @@ -582,7 +581,6 @@ impl<'a> ModCollector<'a> { let resolved_generics = context.resolve_generics(&trait_definition.generics, &mut errors, self.file_id); - // And store the TraitId -> TraitType mapping somewhere it is reachable let unresolved = UnresolvedTrait { file_id: self.file_id, module_id: self.module_id, diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 6293840fd8a..5998fb3f3fb 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -123,6 +123,10 @@ impl TraitConstraint { for typ in &mut self.trait_generics { *typ = typ.substitute(type_bindings); } + + for named in &mut self.associated_types { + named.typ = named.typ.substitute(type_bindings); + } } } diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index 60f24cc5826..a8625924f69 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -1953,6 +1953,7 @@ pub fn resolve_trait_method( } Err(constraints) => { let location = interner.expr_location(&expr_id); + eprintln!("\n!!! Monomorphization error !!!\n"); if let Some(error) = NoMatchingImplFoundError::new(interner, constraints, location.span) { diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 63215a9bfe1..04da7cbe653 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -1484,15 +1484,23 @@ impl NodeInterner { let n = vecmap(impl_associated_types, |t| format!("{} = {:?}", t.name, t.typ)) .join(", "); - eprintln!(" ?? {object_type:?}: Serialize<{t}><{n}>"); + eprintln!(" ?? {existing_object_type:?}: Serialize<{t}><{n}>"); + eprintln!(" Instantiation bindings = {instantiation_bindings:?}"); } trait_generics.iter().zip(impl_generics).all(|(trait_generic, impl_generic)| { - let impl_generic = impl_generic.substitute(&instantiation_bindings); + let impl_generic = impl_generic.force_substitute(&instantiation_bindings); + eprintln!(" {:?} =? {:?}", trait_generic, impl_generic); trait_generic.try_unify(&impl_generic, &mut fresh_bindings).is_ok() }) && trait_associated_types.iter().zip(impl_associated_types).all( |(trait_generic, impl_generic)| { - let impl_generic = impl_generic.typ.substitute(&instantiation_bindings); - trait_generic.typ.try_unify(&impl_generic, &mut fresh_bindings).is_ok() + let impl_generic2 = + impl_generic.typ.force_substitute(&instantiation_bindings); + eprintln!( + " {:?} substituted is {:?}", + impl_generic.typ, impl_generic2 + ); + eprintln!(" {:?} =? {:?}", trait_generic.typ, impl_generic2); + trait_generic.typ.try_unify(&impl_generic2, &mut fresh_bindings).is_ok() }, ) }; @@ -1659,7 +1667,7 @@ impl NodeInterner { let instantiated_object_type = object_type.substitute(&substitutions); let trait_generics = &trait_impl.borrow().trait_generics; - let associated_types = dbg!(self.get_associated_types_for_impl(impl_id)); + let associated_types = self.get_associated_types_for_impl(impl_id); // Ignoring overlapping `TraitImplKind::Assumed` impls here is perfectly fine. // It should never happen since impls are defined at global scope, but even @@ -2100,6 +2108,7 @@ impl NodeInterner { for (trait_type, impl_type) in trait_associated_types.iter().zip(impl_associated_types) { let type_variable = trait_type.type_var.clone(); + eprintln!("Adding binding {:?} := {:?}", type_variable.id(), impl_type.typ); bindings.insert(type_variable.id(), (type_variable, impl_type.typ.clone())); } diff --git a/compiler/noirc_frontend/src/parser/parser/path.rs b/compiler/noirc_frontend/src/parser/parser/path.rs index ae3a1bc0b93..5ceecc2f57a 100644 --- a/compiler/noirc_frontend/src/parser/parser/path.rs +++ b/compiler/noirc_frontend/src/parser/parser/path.rs @@ -7,6 +7,7 @@ use chumsky::prelude::*; use super::keyword; use super::primitives::{ident, path_segment, path_segment_no_turbofish}; +use super::types::generic_type_args; pub(super) fn path<'a>( type_parser: impl NoirParser + 'a, @@ -54,14 +55,15 @@ pub(super) fn as_trait_path<'a>( just(Token::Less) .ignore_then(type_parser.clone()) .then_ignore(keyword(Keyword::As)) - .then(path(type_parser)) + .then(path(type_parser.clone())) + .then(generic_type_args(type_parser)) .then_ignore(just(Token::Greater)) .then_ignore(just(Token::DoubleColon)) .then(ident()) - .validate(|((typ, trait_path), impl_item), span, emit| { + .validate(|(((typ, trait_path), trait_generics), impl_item), span, emit| { let reason = ParserErrorReason::ExperimentalFeature("Fully qualified trait impl paths"); emit(ParserError::with_reason(reason, span)); - AsTraitPath { typ, trait_path, impl_item } + AsTraitPath { typ, trait_path, trait_generics, impl_item } }) } From ea4a31e60deac46d52851977d8c82ee7a37b7a4b Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Thu, 15 Aug 2024 16:49:08 -0500 Subject: [PATCH 16/37] Try to solve math --- compiler/noirc_frontend/src/hir_def/types.rs | 47 ++++++++++++++++ .../src/monomorphization/mod.rs | 1 + compiler/noirc_frontend/src/node_interner.rs | 54 +++++++++---------- 3 files changed, 74 insertions(+), 28 deletions(-) diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 33f2e3cd090..99abe577351 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -1611,6 +1611,16 @@ impl Type { } else { Err(UnificationError) } + } else if let InfixExpr(lhs, op, rhs) = other { + if let Some(inverse) = op.inverse() { + // Handle cases like `4 = a + b` by trying to solve to `a = 4 - b` + let new_type = InfixExpr(Box::new(Constant(*value)), inverse, rhs.clone()); + new_type.try_unify(lhs, bindings)?; + eprintln!("Unified {new_type:?} and {lhs:?}"); + Ok(()) + } else { + Err(UnificationError) + } } else { Err(UnificationError) } @@ -1644,6 +1654,11 @@ impl Type { let lhs = lhs.canonicalize(); let rhs = rhs.canonicalize(); + eprintln!("Canonicalizing {:?} {} {:?}", lhs, op, rhs); + + if let Some(result) = Self::try_simplify_addition(&lhs, op, &rhs) { + return result; + } if let Some(result) = Self::try_simplify_subtraction(&lhs, op, &rhs) { return result; @@ -1701,6 +1716,27 @@ impl Type { } } + /// Try to simplify an addition expression of `lhs + rhs`. + /// + /// - Simplifies `(a - b) + b` to `a`. + fn try_simplify_addition(lhs: &Type, op: BinaryTypeOperator, rhs: &Type) -> Option { + use BinaryTypeOperator::*; + match lhs { + Type::InfixExpr(l_lhs, l_op, l_rhs) => { + // Simplify `(N + 2) - 1` + if op == Addition && *l_op == Subtraction { + // TODO: Propagate type bindings. Can do in another PR, this one is large enough. + let unifies = dbg!(l_rhs).try_unify(dbg!(rhs), &mut TypeBindings::new()); + if unifies.is_ok() { + return Some(l_lhs.as_ref().clone()); + } + } + None + } + _ => None, + } + } + /// Try to simplify a subtraction expression of `lhs - rhs`. /// /// - Simplifies `(a + C1) - C2` to `a + (C1 - C2)` if C1 and C2 are constants. @@ -2371,6 +2407,17 @@ impl BinaryTypeOperator { fn is_commutative(self) -> bool { matches!(self, BinaryTypeOperator::Addition | BinaryTypeOperator::Multiplication) } + + /// Return the operator that will "undo" this operation if applied to the rhs + fn inverse(self) -> Option { + match self { + BinaryTypeOperator::Addition => Some(BinaryTypeOperator::Subtraction), + BinaryTypeOperator::Subtraction => Some(BinaryTypeOperator::Addition), + BinaryTypeOperator::Multiplication => Some(BinaryTypeOperator::Division), + BinaryTypeOperator::Division => Some(BinaryTypeOperator::Multiplication), + BinaryTypeOperator::Modulo => None, + } + } } impl TypeVariableKind { diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index a8625924f69..a77f4d5f074 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -936,6 +936,7 @@ impl<'interner> Monomorphizer<'interner> { let length = match length.evaluate_to_u32() { Some(length) => length, None => { + dbg!(length); return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) } }; diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 04da7cbe653..8f13bfbe59b 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -3,6 +3,7 @@ use std::fmt; use std::hash::Hash; use std::marker::Copy; use std::ops::Deref; +use std::sync::atomic::AtomicUsize; use fm::FileId; use iter_extended::vecmap; @@ -46,6 +47,8 @@ use crate::{Shared, TypeAlias, TypeBindings, TypeVariable, TypeVariableId, TypeV /// This is needed to stop recursing for cases such as `impl Foo for T where T: Eq` const IMPL_SEARCH_RECURSION_LIMIT: u32 = 10; +static INDENTATION: AtomicUsize = AtomicUsize::new(0); + #[derive(Debug)] pub struct ModuleAttributes { pub name: String, @@ -1445,26 +1448,26 @@ impl NodeInterner { let object_type = object_type.substitute(type_bindings); - let n = self.get_trait(trait_id).name.to_string(); - if n == "Serialize" { let t = vecmap(trait_generics, |t| format!("{t:?}")).join(", "); let n = vecmap(trait_associated_types, |t| format!("{} = {:?}", t.name, t.typ)).join(", "); - eprintln!("? {object_type:?}: Serialize<{t}><{n}>"); - } + + let i = INDENTATION.load(std::sync::atomic::Ordering::SeqCst); + let i = " ".repeat(i); + eprintln!("{i}? {object_type:?}: Serialize<{t}><{n}>"); // If the object type isn't known, just return an error saying type annotations are needed. if object_type.is_bindable() { - let n = self.get_trait(trait_id).name.to_string(); - if n == "Serialize" { - eprintln!(" type is bindable"); - } + eprintln!("{i}type is bindable"); return Err(Vec::new()); } let impls = self.trait_implementation_map.get(&trait_id).ok_or_else(|| vec![make_constraint()])?; + let i = INDENTATION.fetch_add(6, std::sync::atomic::Ordering::SeqCst); + let i = " ".repeat(i); + let mut matching_impls = Vec::new(); let mut where_clause_errors = Vec::new(); @@ -1478,28 +1481,24 @@ impl NodeInterner { let mut check_trait_generics = |impl_generics: &[Type], impl_associated_types: &[NamedType]| { - let n = self.get_trait(trait_id).name.to_string(); - if n == "Serialize" { let t = vecmap(impl_generics, |t| format!("{t:?}")).join(", "); let n = vecmap(impl_associated_types, |t| format!("{} = {:?}", t.name, t.typ)) .join(", "); - eprintln!(" ?? {existing_object_type:?}: Serialize<{t}><{n}>"); - eprintln!(" Instantiation bindings = {instantiation_bindings:?}"); - } + + eprintln!(" {i}?? {existing_object_type:?}: Serialize<{t}><{n}>"); + + eprintln!(" {i}Instantiation bindings = {instantiation_bindings:?}"); + trait_generics.iter().zip(impl_generics).all(|(trait_generic, impl_generic)| { let impl_generic = impl_generic.force_substitute(&instantiation_bindings); - eprintln!(" {:?} =? {:?}", trait_generic, impl_generic); + eprintln!(" {i}{:?} =? {:?}", trait_generic, impl_generic); trait_generic.try_unify(&impl_generic, &mut fresh_bindings).is_ok() }) && trait_associated_types.iter().zip(impl_associated_types).all( |(trait_generic, impl_generic)| { let impl_generic2 = impl_generic.typ.force_substitute(&instantiation_bindings); - eprintln!( - " {:?} substituted is {:?}", - impl_generic.typ, impl_generic2 - ); - eprintln!(" {:?} =? {:?}", trait_generic.typ, impl_generic2); + eprintln!(" {i}{:?} =? {:?}", trait_generic.typ, impl_generic2); trait_generic.typ.try_unify(&impl_generic2, &mut fresh_bindings).is_ok() }, ) @@ -1518,10 +1517,7 @@ impl NodeInterner { }; if !generics_match { - let n = self.get_trait(trait_id).name.to_string(); - if n == "Serialize" { - eprintln!(" Generics don't match"); - } + eprintln!(" {i}Generics don't match"); continue; } @@ -1536,6 +1532,7 @@ impl NodeInterner { &instantiation_bindings, recursion_limit, ) { + eprintln!(" {i}rejected, where clause can't validate"); // Only keep the first errors we get from a failing where clause if where_clause_errors.is_empty() { where_clause_errors.extend(errors); @@ -1544,14 +1541,15 @@ impl NodeInterner { } } - let n = self.get_trait(trait_id).name.to_string(); - if n == "Serialize" { - eprintln!(" selected"); - } + eprintln!(" {i}selected"); matching_impls.push((impl_kind.clone(), fresh_bindings)); + break; + } else { + eprintln!(" {i}rejected, object types don't match"); } } - + INDENTATION.fetch_sub(6, std::sync::atomic::Ordering::SeqCst); + if matching_impls.len() == 1 { let (impl_, fresh_bindings) = matching_impls.pop().unwrap(); *type_bindings = fresh_bindings; From cef42569ddc7d109665ed942e4e8ae9630cae382 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 10:08:24 -0500 Subject: [PATCH 17/37] Get Serialize working --- .../noirc_frontend/src/elaborator/patterns.rs | 7 ---- .../noirc_frontend/src/elaborator/traits.rs | 4 +-- .../noirc_frontend/src/elaborator/types.rs | 20 +---------- compiler/noirc_frontend/src/hir_def/types.rs | 20 +++++------ .../src/monomorphization/mod.rs | 14 ++------ compiler/noirc_frontend/src/node_interner.rs | 35 +------------------ 6 files changed, 15 insertions(+), 85 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index 0676734144e..8ceb1b3da10 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -618,13 +618,6 @@ impl<'context> Elaborator<'context> { _ => 0, }); - if matches!(t, Type::Forall(..)) { - if let Some(d) = definition { - let n = &d.name; - eprintln!("{n}: {t:?}"); - } - } - let span = self.interner.expr_span(&expr_id); let location = self.interner.expr_location(&expr_id); diff --git a/compiler/noirc_frontend/src/elaborator/traits.rs b/compiler/noirc_frontend/src/elaborator/traits.rs index 96c9cdd24da..d7d038ebd66 100644 --- a/compiler/noirc_frontend/src/elaborator/traits.rs +++ b/compiler/noirc_frontend/src/elaborator/traits.rs @@ -34,7 +34,6 @@ impl<'context> Elaborator<'context> { // Each associated type in this trait is also an implicit generic for associated_type in &this.interner.get_trait(*trait_id).associated_types { - eprintln!("Pushing associated type generic {associated_type:?}"); this.generics.push(associated_type.clone()); } @@ -272,10 +271,9 @@ pub(crate) fn check_trait_impl_method_matches_declaration( ) in trait_fn_meta.direct_generics.iter().zip(&meta.direct_generics) { let arg = Type::NamedGeneric(impl_fn_generic.clone(), name.clone(), Kind::Normal); - bindings.insert(dbg!(trait_fn_generic.id()), (trait_fn_generic.clone(), arg)); + bindings.insert(trait_fn_generic.id(), (trait_fn_generic.clone(), arg)); } - eprintln!("Instantiating {:?} with bindings {:?}", trait_fn_meta.typ, bindings); let (declaration_type, _) = trait_fn_meta.typ.instantiate_with_bindings(bindings, interner); check_function_type_matches_expected_type( diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 0c649910c22..716e0ab4bcf 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -1321,7 +1321,6 @@ impl<'context> Elaborator<'context> { // The type variable must be unbound at this point since follow_bindings was called Type::TypeVariable(_, TypeVariableKind::Normal) => { - eprintln!("Pushing error: don't know object type"); self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); None } @@ -1570,13 +1569,6 @@ impl<'context> Elaborator<'context> { function_ident_id: ExprId, span: Span, ) { - let name = &self.interner.get_trait(trait_id).name.to_string(); - let t = vecmap(trait_generics, |t| format!("{t}")).join(", "); - let u = vecmap(associated_types, |n| format!("{} = {}", n.name, n.typ)).join(", "); - if name == "Serialize" { - eprintln!("Looking up {object_type}: Serialize<{t}><{u}>"); - } - match self.interner.lookup_trait_implementation( object_type, trait_id, @@ -1584,19 +1576,9 @@ impl<'context> Elaborator<'context> { associated_types, ) { Ok(impl_kind) => { - let name = &self.interner.get_trait(trait_id).name.to_string(); - let t = vecmap(trait_generics, |t| format!("{t}")).join(", "); - let u = vecmap(associated_types, |n| format!("{} = {}", n.name, n.typ)).join(", "); - - if name == "Serialize" { - eprintln!(" {object_type}: Serialize<{t}><{u}>"); - } self.interner.select_impl_for_expression(function_ident_id, impl_kind); } - Err(constraints) => { - eprintln!("\n!! Error !!\n"); - self.push_trait_constraint_error(constraints, span) - } + Err(constraints) => self.push_trait_constraint_error(constraints, span), } } diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 99abe577351..7ef2289aea1 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -531,7 +531,7 @@ impl TypeVariable { }; if binding.occurs(id) { - Err(dbg!(TypeCheckError::TypeAnnotationsNeeded { span })) + Err(TypeCheckError::TypeAnnotationsNeeded { span }) } else { *self.1.borrow_mut() = TypeBinding::Bound(binding); Ok(()) @@ -1616,7 +1616,6 @@ impl Type { // Handle cases like `4 = a + b` by trying to solve to `a = 4 - b` let new_type = InfixExpr(Box::new(Constant(*value)), inverse, rhs.clone()); new_type.try_unify(lhs, bindings)?; - eprintln!("Unified {new_type:?} and {lhs:?}"); Ok(()) } else { Err(UnificationError) @@ -1648,14 +1647,14 @@ impl Type { pub fn canonicalize(&self) -> Type { match self.follow_bindings() { Type::InfixExpr(lhs, op, rhs) => { - if let Some(value) = self.evaluate_to_u32() { - return Type::Constant(value); + // evaluate_to_u32 also calls canonicalize so if we just called + // `self.evaluate_to_u32()` we'd get infinite recursion. + if let (Some(lhs), Some(rhs)) = (lhs.evaluate_to_u32(), rhs.evaluate_to_u32()) { + return Type::Constant(op.function(lhs, rhs)); } let lhs = lhs.canonicalize(); let rhs = rhs.canonicalize(); - eprintln!("Canonicalizing {:?} {} {:?}", lhs, op, rhs); - if let Some(result) = Self::try_simplify_addition(&lhs, op, &rhs) { return result; } @@ -1723,10 +1722,9 @@ impl Type { use BinaryTypeOperator::*; match lhs { Type::InfixExpr(l_lhs, l_op, l_rhs) => { - // Simplify `(N + 2) - 1` if op == Addition && *l_op == Subtraction { // TODO: Propagate type bindings. Can do in another PR, this one is large enough. - let unifies = dbg!(l_rhs).try_unify(dbg!(rhs), &mut TypeBindings::new()); + let unifies = l_rhs.try_unify(rhs, &mut TypeBindings::new()); if unifies.is_ok() { return Some(l_lhs.as_ref().clone()); } @@ -1856,10 +1854,10 @@ impl Type { } } - match self { - Type::TypeVariable(_, TypeVariableKind::Constant(size)) => Some(*size), + match self.canonicalize() { + Type::TypeVariable(_, TypeVariableKind::Constant(size)) => Some(size), Type::Array(len, _elem) => len.evaluate_to_u32(), - Type::Constant(x) => Some(*x), + Type::Constant(x) => Some(x), Type::InfixExpr(lhs, op, rhs) => { let lhs = lhs.evaluate_to_u32()?; let rhs = rhs.evaluate_to_u32()?; diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index a77f4d5f074..00f550c0ba5 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -935,10 +935,7 @@ impl<'interner> Monomorphizer<'interner> { let element = Box::new(Self::convert_type(element.as_ref(), location)?); let length = match length.evaluate_to_u32() { Some(length) => length, - None => { - dbg!(length); - return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) - } + None => return Err(MonomorphizationError::TypeAnnotationsNeeded { location }), }; ast::Type::Array(length, element) } @@ -971,9 +968,7 @@ impl<'interner> Monomorphizer<'interner> { // and within a larger generic type. let default = match kind.default_type() { Some(typ) => typ, - None => { - return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) - } + None => return Err(MonomorphizationError::TypeAnnotationsNeeded { location }), }; let monomorphized_default = Self::convert_type(&default, location)?; @@ -1075,9 +1070,7 @@ impl<'interner> Monomorphizer<'interner> { // and within a larger generic type. let default = match kind.default_type() { Some(typ) => typ, - None => { - return Err(dbg!(MonomorphizationError::TypeAnnotationsNeeded { location })) - } + None => return Err(MonomorphizationError::TypeAnnotationsNeeded { location }), }; Self::check_type(&default, location) @@ -1954,7 +1947,6 @@ pub fn resolve_trait_method( } Err(constraints) => { let location = interner.expr_location(&expr_id); - eprintln!("\n!!! Monomorphization error !!!\n"); if let Some(error) = NoMatchingImplFoundError::new(interner, constraints, location.span) { diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 8f13bfbe59b..a25b011f629 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -47,8 +47,6 @@ use crate::{Shared, TypeAlias, TypeBindings, TypeVariable, TypeVariableId, TypeV /// This is needed to stop recursing for cases such as `impl Foo for T where T: Eq` const IMPL_SEARCH_RECURSION_LIMIT: u32 = 10; -static INDENTATION: AtomicUsize = AtomicUsize::new(0); - #[derive(Debug)] pub struct ModuleAttributes { pub name: String, @@ -1448,26 +1446,14 @@ impl NodeInterner { let object_type = object_type.substitute(type_bindings); - let t = vecmap(trait_generics, |t| format!("{t:?}")).join(", "); - let n = - vecmap(trait_associated_types, |t| format!("{} = {:?}", t.name, t.typ)).join(", "); - - let i = INDENTATION.load(std::sync::atomic::Ordering::SeqCst); - let i = " ".repeat(i); - eprintln!("{i}? {object_type:?}: Serialize<{t}><{n}>"); - // If the object type isn't known, just return an error saying type annotations are needed. if object_type.is_bindable() { - eprintln!("{i}type is bindable"); return Err(Vec::new()); } let impls = self.trait_implementation_map.get(&trait_id).ok_or_else(|| vec![make_constraint()])?; - let i = INDENTATION.fetch_add(6, std::sync::atomic::Ordering::SeqCst); - let i = " ".repeat(i); - let mut matching_impls = Vec::new(); let mut where_clause_errors = Vec::new(); @@ -1481,24 +1467,13 @@ impl NodeInterner { let mut check_trait_generics = |impl_generics: &[Type], impl_associated_types: &[NamedType]| { - let t = vecmap(impl_generics, |t| format!("{t:?}")).join(", "); - let n = - vecmap(impl_associated_types, |t| format!("{} = {:?}", t.name, t.typ)) - .join(", "); - - eprintln!(" {i}?? {existing_object_type:?}: Serialize<{t}><{n}>"); - - eprintln!(" {i}Instantiation bindings = {instantiation_bindings:?}"); - trait_generics.iter().zip(impl_generics).all(|(trait_generic, impl_generic)| { let impl_generic = impl_generic.force_substitute(&instantiation_bindings); - eprintln!(" {i}{:?} =? {:?}", trait_generic, impl_generic); trait_generic.try_unify(&impl_generic, &mut fresh_bindings).is_ok() }) && trait_associated_types.iter().zip(impl_associated_types).all( |(trait_generic, impl_generic)| { let impl_generic2 = impl_generic.typ.force_substitute(&instantiation_bindings); - eprintln!(" {i}{:?} =? {:?}", trait_generic.typ, impl_generic2); trait_generic.typ.try_unify(&impl_generic2, &mut fresh_bindings).is_ok() }, ) @@ -1517,7 +1492,6 @@ impl NodeInterner { }; if !generics_match { - eprintln!(" {i}Generics don't match"); continue; } @@ -1532,7 +1506,6 @@ impl NodeInterner { &instantiation_bindings, recursion_limit, ) { - eprintln!(" {i}rejected, where clause can't validate"); // Only keep the first errors we get from a failing where clause if where_clause_errors.is_empty() { where_clause_errors.extend(errors); @@ -1541,15 +1514,10 @@ impl NodeInterner { } } - eprintln!(" {i}selected"); matching_impls.push((impl_kind.clone(), fresh_bindings)); - break; - } else { - eprintln!(" {i}rejected, object types don't match"); } } - INDENTATION.fetch_sub(6, std::sync::atomic::Ordering::SeqCst); - + if matching_impls.len() == 1 { let (impl_, fresh_bindings) = matching_impls.pop().unwrap(); *type_bindings = fresh_bindings; @@ -2106,7 +2074,6 @@ impl NodeInterner { for (trait_type, impl_type) in trait_associated_types.iter().zip(impl_associated_types) { let type_variable = trait_type.type_var.clone(); - eprintln!("Adding binding {:?} := {:?}", type_variable.id(), impl_type.typ); bindings.insert(type_variable.id(), (type_variable, impl_type.typ.clone())); } From f4b29a992295ef1f1b3ea3a0086b882d0768aebc Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 10:12:05 -0500 Subject: [PATCH 18/37] Add test programs --- .../associated_types/Nargo.toml | 7 +++ .../associated_types/src/main.nr | 28 +++++++++ .../serialize/Nargo.toml | 7 +++ .../serialize/src/main.nr | 59 +++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 test_programs/compile_success_empty/associated_types/Nargo.toml create mode 100644 test_programs/compile_success_empty/associated_types/src/main.nr create mode 100644 test_programs/compile_success_empty/serialize/Nargo.toml create mode 100644 test_programs/compile_success_empty/serialize/src/main.nr diff --git a/test_programs/compile_success_empty/associated_types/Nargo.toml b/test_programs/compile_success_empty/associated_types/Nargo.toml new file mode 100644 index 00000000000..99b8e1b2d47 --- /dev/null +++ b/test_programs/compile_success_empty/associated_types/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "associated_types" +type = "bin" +authors = [""] +compiler_version = ">=0.33.0" + +[dependencies] \ No newline at end of file diff --git a/test_programs/compile_success_empty/associated_types/src/main.nr b/test_programs/compile_success_empty/associated_types/src/main.nr new file mode 100644 index 00000000000..817d8cf8063 --- /dev/null +++ b/test_programs/compile_success_empty/associated_types/src/main.nr @@ -0,0 +1,28 @@ +trait Collection { + type Elem; + + fn cget(self, index: u32) -> Option; + + fn ctake(self, index: u32) -> Self::Elem { + self.cget(index).unwrap() + } +} + +impl Collection for [T; N] { + type Elem = T; + + fn cget(self, index: u32) -> Option { + if index < self.len() { + Option::some(self[index]) + } else { + Option::none() + } + } +} + +fn main() { + // Use zeroed here so that we don't help by adding another type constraint. + // We should know Elem = Field from the associated type alone. + let array = [1, 2, 3, 0, 5]; + assert_eq(array.ctake(3), std::unsafe::zeroed()); +} diff --git a/test_programs/compile_success_empty/serialize/Nargo.toml b/test_programs/compile_success_empty/serialize/Nargo.toml new file mode 100644 index 00000000000..2cf87765b8a --- /dev/null +++ b/test_programs/compile_success_empty/serialize/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "serialize" +type = "bin" +authors = [""] +compiler_version = ">=0.32.0" + +[dependencies] diff --git a/test_programs/compile_success_empty/serialize/src/main.nr b/test_programs/compile_success_empty/serialize/src/main.nr new file mode 100644 index 00000000000..8af82ccd6b1 --- /dev/null +++ b/test_programs/compile_success_empty/serialize/src/main.nr @@ -0,0 +1,59 @@ +trait Serialize { + let Size: u32; + + // Note that Rust disallows referencing constants here! + fn serialize(self) -> [Field; Self::Size]; +} + +impl Serialize for (A, B) where A: Serialize, B: Serialize { + // let Size = ::Size + ::Size; + let Size = AS + BS; + + fn serialize(self: Self) -> [Field; Self::Size] { + let mut array: [Field; Self::Size] = std::unsafe::zeroed(); + let a: [Field; AS] = self.0.serialize(); + let b: [Field; BS] = self.1.serialize(); + + for i in 0 .. a.len() { + array[i] = a[i]; + } + for i in 0 .. b.len() { + array[i + a.len()] = b[i]; + } + array + } +} + +impl Serialize for [T; N] where T: Serialize { + // let Size = ::Size * N; + let Size = TS * N; + + fn serialize(self: Self) -> [Field; Self::Size] { + let mut array: [Field; Self::Size] = std::unsafe::zeroed(); + let mut array_i = 0; + + for elem in self { + let elem_fields: [Field; TS] = elem.serialize(); + + for i in 0 .. elem_fields.len() { + array[array_i] = elem_fields[i]; + array_i += 1; + } + } + + array + } +} + +impl Serialize for Field { + let Size = 1; + + fn serialize(self) -> [Field; Self::Size] { + [self] + } +} + +fn main() { + let x = ((1, [2, 3, 4]), [5, 6, 7, 8]); + assert_eq(x.serialize().len(), 8); +} From 5dabf3c8738bbf1cc58dd08201fa9196d73126e6 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 11:05:10 -0500 Subject: [PATCH 19/37] Remove comment; fix bad merge --- .../src/elaborator/trait_impls.rs | 24 - tooling/lsp/src/requests/completion.rs | 930 ------------------ 2 files changed, 954 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index 04e6474ec14..47550be0c43 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -245,28 +245,4 @@ impl<'context> Elaborator<'context> { } associated_types } - - // Associated types aren't required to be specified in a trait constraint. - // If they aren't we have to implicitly add them and introduce a new generic - // into scope for them. - // pub(super) fn add_implicit_associated_types(&mut self) { - // // Add any associated types that weren't mentioend as implicit generics. - // if let Some(trait_id) = trait_impl.trait_id { - // let the_trait = self.interner.get_trait(trait_id); - // for associated_type in &the_trait.associated_types { - // if !associated_types.iter().any(|typ| typ.0.0.contents == *associated_type.name.as_ref()) { - // let name = Ident::new(associated_type.name.as_ref().clone(), associated_type.span); - // let type_var = TypeVariable::unbound(self.interner.next_type_variable_id()); - - // self.generics.push(ResolvedGeneric { - // name: associated_type.name.clone(), - // type_var, - // kind: associated_type.kind.clone(), - // span: trait_impl.trait_path.span, - // }); - // associated_types.push((name, Type::TypeVariable(type_var, TypeVariableKind::Normal))); - // } - // } - // } - // } } diff --git a/tooling/lsp/src/requests/completion.rs b/tooling/lsp/src/requests/completion.rs index 40dd71256c4..e39121c10fe 100644 --- a/tooling/lsp/src/requests/completion.rs +++ b/tooling/lsp/src/requests/completion.rs @@ -1129,933 +1129,3 @@ fn module_def_id_from_reference_id(reference_id: ReferenceId) -> Option None, } } - -#[cfg(test)] -mod completion_tests { - use crate::{ - notifications::on_did_open_text_document, - requests::completion::completion_items::{ - crate_completion_item, module_completion_item, simple_completion_item, - }, - test_utils, - }; - - use super::*; - use lsp_types::{ - DidOpenTextDocumentParams, PartialResultParams, Position, TextDocumentIdentifier, - TextDocumentItem, TextDocumentPositionParams, WorkDoneProgressParams, - }; - use tokio::test; - - async fn assert_completion(src: &str, expected: Vec) { - let (mut state, noir_text_document) = test_utils::init_lsp_server("document_symbol").await; - - let (line, column) = src - .lines() - .enumerate() - .find_map(|(line_index, line)| { - line.find(">|<").map(|char_index| (line_index, char_index)) - }) - .expect("Expected to find one >|< in the source code"); - - let src = src.replace(">|<", ""); - - on_did_open_text_document( - &mut state, - DidOpenTextDocumentParams { - text_document: TextDocumentItem { - uri: noir_text_document.clone(), - language_id: "noir".to_string(), - version: 0, - text: src.to_string(), - }, - }, - ); - - // Get inlay hints. These should now be relative to the changed text, - // not the saved file's text. - let response = on_completion_request( - &mut state, - CompletionParams { - text_document_position: TextDocumentPositionParams { - text_document: TextDocumentIdentifier { uri: noir_text_document }, - position: Position { line: line as u32, character: column as u32 }, - }, - work_done_progress_params: WorkDoneProgressParams { work_done_token: None }, - partial_result_params: PartialResultParams { partial_result_token: None }, - context: None, - }, - ) - .await - .expect("Could not execute on_completion_request") - .unwrap(); - - let CompletionResponse::Array(items) = response else { - panic!("Expected response to be CompletionResponse::Array"); - }; - - let mut items = items.clone(); - items.sort_by_key(|item| item.label.clone()); - - let mut expected = expected.clone(); - expected.sort_by_key(|item| item.label.clone()); - - if items != expected { - println!( - "Items: {:?}", - items.iter().map(|item| item.label.clone()).collect::>() - ); - println!( - "Expected: {:?}", - expected.iter().map(|item| item.label.clone()).collect::>() - ); - } - - assert_eq!(items, expected); - } - - #[test] - async fn test_use_first_segment() { - let src = r#" - mod foo {} - mod foobar {} - use f>|< - "#; - - assert_completion( - src, - vec![module_completion_item("foo"), module_completion_item("foobar")], - ) - .await; - } - - #[test] - async fn test_use_second_segment() { - let src = r#" - mod foo { - mod bar {} - mod baz {} - } - use foo::>|< - "#; - - assert_completion(src, vec![module_completion_item("bar"), module_completion_item("baz")]) - .await; - } - - #[test] - async fn test_use_second_segment_after_typing() { - let src = r#" - mod foo { - mod bar {} - mod brave {} - } - use foo::ba>|< - "#; - - assert_completion(src, vec![module_completion_item("bar")]).await; - } - - #[test] - async fn test_use_struct() { - let src = r#" - mod foo { - struct Foo {} - } - use foo::>|< - "#; - - assert_completion( - src, - vec![simple_completion_item( - "Foo", - CompletionItemKind::STRUCT, - Some("Foo".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_use_function() { - let src = r#" - mod foo { - fn bar(x: i32) -> u64 { 0 } - } - use foo::>|< - "#; - - assert_completion( - src, - vec![simple_completion_item( - "bar", - CompletionItemKind::FUNCTION, - Some("fn(i32) -> u64".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_use_after_crate_and_letter() { - // Prove that "std" shows up - let src = r#" - use s>|< - "#; - assert_completion(src, vec![crate_completion_item("std")]).await; - - // "std" doesn't show up anymore because of the "crate::" prefix - let src = r#" - mod something {} - use crate::s>|< - "#; - assert_completion(src, vec![module_completion_item("something")]).await; - } - - #[test] - async fn test_use_suggests_hardcoded_crate() { - let src = r#" - use c>|< - "#; - - assert_completion( - src, - vec![simple_completion_item("crate::", CompletionItemKind::KEYWORD, None)], - ) - .await; - } - - #[test] - async fn test_use_in_tree_after_letter() { - let src = r#" - mod foo { - mod bar {} - } - use foo::{b>|<} - "#; - - assert_completion(src, vec![module_completion_item("bar")]).await; - } - - #[test] - async fn test_use_in_tree_after_colons() { - let src = r#" - mod foo { - mod bar { - mod baz {} - } - } - use foo::{bar::>|<} - "#; - - assert_completion(src, vec![module_completion_item("baz")]).await; - } - - #[test] - async fn test_use_in_tree_after_colons_after_another_segment() { - let src = r#" - mod foo { - mod bar {} - mod qux {} - } - use foo::{bar, q>|<} - "#; - - assert_completion(src, vec![module_completion_item("qux")]).await; - } - - #[test] - async fn test_use_in_nested_module() { - let src = r#" - mod foo { - mod something {} - - use s>|< - } - "#; - - assert_completion( - src, - vec![ - module_completion_item("something"), - crate_completion_item("std"), - simple_completion_item("super::", CompletionItemKind::KEYWORD, None), - ], - ) - .await; - } - - #[test] - async fn test_use_after_super() { - let src = r#" - mod foo {} - - mod bar { - mod something {} - - use super::f>|< - } - "#; - - assert_completion(src, vec![module_completion_item("foo")]).await; - } - - #[test] - async fn test_use_after_crate_and_letter_nested_in_module() { - let src = r#" - mod something { - mod something_else {} - use crate::s>|< - } - - "#; - assert_completion(src, vec![module_completion_item("something")]).await; - } - - #[test] - async fn test_use_after_crate_segment_and_letter_nested_in_module() { - let src = r#" - mod something { - mod something_else {} - use crate::something::s>|< - } - - "#; - assert_completion(src, vec![module_completion_item("something_else")]).await; - } - - #[test] - async fn test_complete_path_shows_module() { - let src = r#" - mod foobar {} - - fn main() { - fo>|< - } - "#; - assert_completion(src, vec![module_completion_item("foobar")]).await; - } - - #[test] - async fn test_complete_path_after_colons_shows_submodule() { - let src = r#" - mod foo { - mod bar {} - } - - fn main() { - foo::>|< - } - "#; - assert_completion(src, vec![module_completion_item("bar")]).await; - } - - #[test] - async fn test_complete_path_after_colons_and_letter_shows_submodule() { - let src = r#" - mod foo { - mod bar {} - } - - fn main() { - foo::b>|< - } - "#; - assert_completion(src, vec![module_completion_item("bar")]).await; - } - - #[test] - async fn test_complete_path_with_local_variable() { - let src = r#" - fn main() { - let local = 1; - l>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "local", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_path_with_shadowed_local_variable() { - let src = r#" - fn main() { - let local = 1; - let local = true; - l>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "local", - CompletionItemKind::VARIABLE, - Some("bool".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_path_with_function_argument() { - let src = r#" - fn main(local: Field) { - l>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "local", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_function() { - let src = r#" - fn hello(x: i32, y: Field) { } - - fn main() { - h>|< - } - "#; - assert_completion( - src, - vec![snippet_completion_item( - "hello(…)", - CompletionItemKind::FUNCTION, - "hello(${1:x}, ${2:y})", - Some("fn(i32, Field)".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_builtin_functions() { - let src = r#" - fn main() { - a>|< - } - "#; - assert_completion( - src, - vec![ - snippet_completion_item( - "assert(…)", - CompletionItemKind::FUNCTION, - "assert(${1:predicate})", - Some("fn(T)".to_string()), - ), - snippet_completion_item( - "assert_constant(…)", - CompletionItemKind::FUNCTION, - "assert_constant(${1:x})", - Some("fn(T)".to_string()), - ), - snippet_completion_item( - "assert_eq(…)", - CompletionItemKind::FUNCTION, - "assert_eq(${1:lhs}, ${2:rhs})", - Some("fn(T, T)".to_string()), - ), - ], - ) - .await; - } - - #[test] - async fn test_complete_path_in_impl() { - let src = r#" - struct SomeStruct {} - - impl SomeStruct { - fn foo() { - S>|< - } - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "SomeStruct", - CompletionItemKind::STRUCT, - Some("SomeStruct".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_path_in_trait_impl() { - let src = r#" - struct SomeStruct {} - trait Trait {} - - impl Trait for SomeStruct { - fn foo() { - S>|< - } - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "SomeStruct", - CompletionItemKind::STRUCT, - Some("SomeStruct".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_path_with_for_argument() { - let src = r#" - fn main() { - for index in 0..10 { - i>|< - } - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "index", - CompletionItemKind::VARIABLE, - Some("u32".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_complete_path_with_lambda_argument() { - let src = r#" - fn lambda(f: fn(i32)) { } - - fn main() { - lambda(|var| v>|<) - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "var", - CompletionItemKind::VARIABLE, - Some("_".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_struct_field_type() { - let src = r#" - struct Something {} - - fn SomeFunction() {} - - struct Another { - some: So>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_function_parameter() { - let src = r#" - struct Something {} - - fn foo(x: So>|<) {} - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_function_return_type() { - let src = r#" - struct Something {} - - fn foo() -> So>|< {} - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_type_alias() { - let src = r#" - struct Something {} - - type Foo = So>|< - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_trait_function() { - let src = r#" - struct Something {} - - trait Trait { - fn foo(s: So>|<); - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_trait_function_return_type() { - let src = r#" - struct Something {} - - trait Trait { - fn foo() -> So>|<; - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_let_type() { - let src = r#" - struct Something {} - - fn main() { - let x: So>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_type_in_lambda_parameter() { - let src = r#" - struct Something {} - - fn main() { - foo(|s: So>|<| s) - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "Something", - CompletionItemKind::STRUCT, - Some("Something".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_builtin_types() { - let src = r#" - fn foo(x: i>|<) {} - "#; - assert_completion( - src, - vec![ - simple_completion_item("i8", CompletionItemKind::STRUCT, Some("i8".to_string())), - simple_completion_item("i16", CompletionItemKind::STRUCT, Some("i16".to_string())), - simple_completion_item("i32", CompletionItemKind::STRUCT, Some("i32".to_string())), - simple_completion_item("i64", CompletionItemKind::STRUCT, Some("i64".to_string())), - ], - ) - .await; - } - - #[test] - async fn test_suggest_true() { - let src = r#" - fn main() { - let x = t>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "true", - CompletionItemKind::KEYWORD, - Some("bool".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_regarding_if_scope() { - let src = r#" - fn main() { - let good = 1; - if true { - let great = 2; - g>|< - } else { - let greater = 3; - } - } - "#; - assert_completion( - src, - vec![ - simple_completion_item( - "good", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - ), - simple_completion_item( - "great", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - ), - ], - ) - .await; - - let src = r#" - fn main() { - let good = 1; - if true { - let great = 2; - } else { - let greater = 3; - g>|< - } - } - "#; - assert_completion( - src, - vec![ - simple_completion_item( - "good", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - ), - simple_completion_item( - "greater", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - ), - ], - ) - .await; - - let src = r#" - fn main() { - let good = 1; - if true { - let great = 2; - } else { - let greater = 3; - } - g>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "good", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_regarding_block_scope() { - let src = r#" - fn main() { - let good = 1; - { - let great = 2; - g>|< - } - } - "#; - assert_completion( - src, - vec![ - simple_completion_item( - "good", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - ), - simple_completion_item( - "great", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - ), - ], - ) - .await; - - let src = r#" - fn main() { - let good = 1; - { - let great = 2; - } - g>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item( - "good", - CompletionItemKind::VARIABLE, - Some("Field".to_string()), - )], - ) - .await; - } - - #[test] - async fn test_suggest_struct_type_parameter() { - let src = r#" - struct Foo { - context: C>|< - } - "#; - assert_completion( - src, - vec![simple_completion_item("Context", CompletionItemKind::TYPE_PARAMETER, None)], - ) - .await; - } - - #[test] - async fn test_suggest_impl_type_parameter() { - let src = r#" - struct Foo {} - - impl Foo { - fn foo() { - let x: TypeP>|< - } - } - "#; - assert_completion( - src, - vec![simple_completion_item("TypeParam", CompletionItemKind::TYPE_PARAMETER, None)], - ) - .await; - } - - #[test] - async fn test_suggest_trait_impl_type_parameter() { - let src = r#" - struct Foo {} - trait Trait {} - - impl Trait for Foo { - fn foo() { - let x: TypeP>|< - } - } - "#; - assert_completion( - src, - vec![simple_completion_item("TypeParam", CompletionItemKind::TYPE_PARAMETER, None)], - ) - .await; - } - - #[test] - async fn test_suggest_trait_function_type_parameter() { - let src = r#" - struct Foo {} - trait Trait { - fn foo() { - let x: TypeP>|< - } - } - "#; - assert_completion( - src, - vec![simple_completion_item("TypeParam", CompletionItemKind::TYPE_PARAMETER, None)], - ) - .await; - } - - #[test] - async fn test_suggest_function_type_parameters() { - let src = r#" - fn foo(x: C>|<) {} - "#; - assert_completion( - src, - vec![simple_completion_item("Context", CompletionItemKind::TYPE_PARAMETER, None)], - ) - .await; - } -} From a514799ecfc37b1b0fe42efd93501a4ae779ac36 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 11:36:26 -0500 Subject: [PATCH 20/37] Add location to panic --- compiler/noirc_frontend/src/monomorphization/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index ef98f37f50b..ba999776f99 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -1031,9 +1031,12 @@ impl<'interner> Monomorphizer<'interner> { HirType::Forall(_, _) | HirType::Constant(_) - | HirType::InfixExpr(..) - | HirType::Error => { - unreachable!("Unexpected type {} found", typ) + | HirType::InfixExpr(..) => { + unreachable!("Unexpected type {typ} found") + } + HirType::Error => { + let message = "Unexpected Type::Error found during monomorphization"; + return Err(MonomorphizationError::InternalError { message, location }); } HirType::Quoted(_) => unreachable!("Tried to translate Code type into runtime code"), }) From a2542fd10e484348fc594489e49c435e06cf1175 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 14:56:11 -0500 Subject: [PATCH 21/37] Fix let-inferred type issue --- compiler/noirc_frontend/src/elaborator/statements.rs | 2 +- compiler/noirc_frontend/src/hir_def/types.rs | 10 ++++++---- compiler/noirc_frontend/src/monomorphization/mod.rs | 4 +--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/statements.rs b/compiler/noirc_frontend/src/elaborator/statements.rs index d8e925f581a..c57fd701b37 100644 --- a/compiler/noirc_frontend/src/elaborator/statements.rs +++ b/compiler/noirc_frontend/src/elaborator/statements.rs @@ -419,7 +419,7 @@ impl<'context> Elaborator<'context> { // If we get here the type has no field named 'access.rhs'. // Now we specialize the error message based on whether we know the object type in question yet. if let Type::TypeVariable(..) = &lhs_type { - self.push_err(dbg!(TypeCheckError::TypeAnnotationsNeeded { span })); + self.push_err(TypeCheckError::TypeAnnotationsNeeded { span }); } else if lhs_type != Type::Error { self.push_err(TypeCheckError::AccessUnknownMember { lhs_type, diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index f3b6dd1e9c6..28b8a78cee3 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -1936,11 +1936,13 @@ impl Type { /// Retrieves the type of the given field name /// Panics if the type is not a struct or tuple. pub fn get_field_type(&self, field_name: &str) -> Option { - match self { - Type::Struct(def, args) => def.borrow().get_field(field_name, args).map(|(typ, _)| typ), + match self.follow_bindings() { + Type::Struct(def, args) => { + def.borrow().get_field(field_name, &args).map(|(typ, _)| typ) + } Type::Tuple(fields) => { - let mut fields = fields.iter().enumerate(); - fields.find(|(i, _)| i.to_string() == *field_name).map(|(_, typ)| typ).cloned() + let mut fields = fields.into_iter().enumerate(); + fields.find(|(i, _)| i.to_string() == *field_name).map(|(_, typ)| typ) } _ => None, } diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index ba999776f99..c45a759aab6 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -1029,9 +1029,7 @@ impl<'interner> Monomorphizer<'interner> { ast::Type::MutableReference(Box::new(element)) } - HirType::Forall(_, _) - | HirType::Constant(_) - | HirType::InfixExpr(..) => { + HirType::Forall(_, _) | HirType::Constant(_) | HirType::InfixExpr(..) => { unreachable!("Unexpected type {typ} found") } HirType::Error => { From c6d18291fcf98dda998ef4bade6a5c508601ec9c Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 15:02:45 -0500 Subject: [PATCH 22/37] Fix auto deref --- compiler/noirc_frontend/src/elaborator/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 9d985b1658b..1246236d046 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -750,7 +750,7 @@ impl<'context> Elaborator<'context> { /// Insert as many dereference operations as necessary to automatically dereference a method /// call object to its base value type T. pub(super) fn insert_auto_dereferences(&mut self, object: ExprId, typ: Type) -> (ExprId, Type) { - if let Type::MutableReference(element) = typ { + if let Type::MutableReference(element) = typ.follow_bindings() { let location = self.interner.id_location(object); let object = self.interner.push_expr(HirExpression::Prefix(HirPrefixExpression { From 98597e423fe7f085e5fb75bc7dba7de10e9be2f9 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 15:05:21 -0500 Subject: [PATCH 23/37] unsafe::zeroed -> mem::zeroed --- .../compile_success_empty/associated_types/src/main.nr | 2 +- test_programs/compile_success_empty/serialize/src/main.nr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test_programs/compile_success_empty/associated_types/src/main.nr b/test_programs/compile_success_empty/associated_types/src/main.nr index 817d8cf8063..dbc6a393ec9 100644 --- a/test_programs/compile_success_empty/associated_types/src/main.nr +++ b/test_programs/compile_success_empty/associated_types/src/main.nr @@ -24,5 +24,5 @@ fn main() { // Use zeroed here so that we don't help by adding another type constraint. // We should know Elem = Field from the associated type alone. let array = [1, 2, 3, 0, 5]; - assert_eq(array.ctake(3), std::unsafe::zeroed()); + assert_eq(array.ctake(3), std::mem::zeroed()); } diff --git a/test_programs/compile_success_empty/serialize/src/main.nr b/test_programs/compile_success_empty/serialize/src/main.nr index 8af82ccd6b1..617da0f73b1 100644 --- a/test_programs/compile_success_empty/serialize/src/main.nr +++ b/test_programs/compile_success_empty/serialize/src/main.nr @@ -10,7 +10,7 @@ impl Serialize for (A, B) where A: Serialize [Field; Self::Size] { - let mut array: [Field; Self::Size] = std::unsafe::zeroed(); + let mut array: [Field; Self::Size] = std::mem::zeroed(); let a: [Field; AS] = self.0.serialize(); let b: [Field; BS] = self.1.serialize(); @@ -29,7 +29,7 @@ impl Serialize for [T; N] where T: Serialize [Field; Self::Size] { - let mut array: [Field; Self::Size] = std::unsafe::zeroed(); + let mut array: [Field; Self::Size] = std::mem::zeroed(); let mut array_i = 0; for elem in self { From 3f3f050829fb2ee0c0563a34117e8c7bea48aaf5 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 15:23:33 -0500 Subject: [PATCH 24/37] Fix formatter --- tooling/nargo_fmt/src/visitor/item.rs | 44 +++++++++++++++------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/tooling/nargo_fmt/src/visitor/item.rs b/tooling/nargo_fmt/src/visitor/item.rs index 1b16d6366ae..66fa2ab181a 100644 --- a/tooling/nargo_fmt/src/visitor/item.rs +++ b/tooling/nargo_fmt/src/visitor/item.rs @@ -6,7 +6,7 @@ use crate::{ }, visitor::expr::{format_seq, NewlineMode}, }; -use noirc_frontend::ast::{NoirFunction, Visibility}; +use noirc_frontend::{ast::{NoirFunction, Visibility}, macros_api::UnresolvedTypeData}; use noirc_frontend::{ hir::resolution::errors::Span, parser::{Item, ItemKind}, @@ -115,27 +115,31 @@ impl super::FmtVisitor<'_> { ) -> String { let mut result = String::new(); - if span.start() == span.end() { - result.push_str(self.slice(params_end..func_span.start())); - } else { - result.push_str(" -> "); - - let visibility = match func.def.return_visibility { - Visibility::Public => "pub", - Visibility::ReturnData => "return_data", - Visibility::Private => "", - Visibility::CallData(_) => { - unreachable!("call_data cannot be used for return value") - } - }; - result.push_str(&append_space_if_nonempty(visibility.into())); + if func.return_type().typ != UnresolvedTypeData::Unit { + if span.start() == span.end() { + result.push_str(self.slice(params_end..func_span.start())); + } else { + result.push_str(" -> "); + + let visibility = match func.def.return_visibility { + Visibility::Public => "pub", + Visibility::ReturnData => "return_data", + Visibility::Private => "", + Visibility::CallData(_) => { + unreachable!("call_data cannot be used for return value") + } + }; + result.push_str(&append_space_if_nonempty(visibility.into())); - let typ = rewrite::typ(self, self.shape(), func.return_type()); - result.push_str(&typ); + let typ = rewrite::typ(self, self.shape(), func.return_type()); + result.push_str(&typ); - let slice = self.slice(span.end()..func_span.start()); - if !slice.trim().is_empty() { - result.push_str(slice); + dbg!(span); + dbg!(func_span); + let slice = self.slice(span.end()..func_span.start()); + if !slice.trim().is_empty() { + result.push_str(slice); + } } } From ff41698ad6b42f9c66e3a59fc31fdc5df8446b3c Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 15:26:04 -0500 Subject: [PATCH 25/37] Format the formatter --- tooling/nargo_fmt/src/visitor/item.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tooling/nargo_fmt/src/visitor/item.rs b/tooling/nargo_fmt/src/visitor/item.rs index 66fa2ab181a..acc94e5a86e 100644 --- a/tooling/nargo_fmt/src/visitor/item.rs +++ b/tooling/nargo_fmt/src/visitor/item.rs @@ -6,7 +6,10 @@ use crate::{ }, visitor::expr::{format_seq, NewlineMode}, }; -use noirc_frontend::{ast::{NoirFunction, Visibility}, macros_api::UnresolvedTypeData}; +use noirc_frontend::{ + ast::{NoirFunction, Visibility}, + macros_api::UnresolvedTypeData, +}; use noirc_frontend::{ hir::resolution::errors::Span, parser::{Item, ItemKind}, From 9b41358472229d7767d76a01c2c5875d5784f5fc Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 15:33:52 -0500 Subject: [PATCH 26/37] Remove dbg --- tooling/nargo_fmt/src/visitor/item.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tooling/nargo_fmt/src/visitor/item.rs b/tooling/nargo_fmt/src/visitor/item.rs index acc94e5a86e..827a708b003 100644 --- a/tooling/nargo_fmt/src/visitor/item.rs +++ b/tooling/nargo_fmt/src/visitor/item.rs @@ -137,8 +137,6 @@ impl super::FmtVisitor<'_> { let typ = rewrite::typ(self, self.shape(), func.return_type()); result.push_str(&typ); - dbg!(span); - dbg!(func_span); let slice = self.slice(span.end()..func_span.start()); if !slice.trim().is_empty() { result.push_str(slice); From 0721cb2461fc0e899719d697e690d04dfa76abb3 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Fri, 16 Aug 2024 15:45:14 -0500 Subject: [PATCH 27/37] Fix formatter again --- tooling/nargo_fmt/src/visitor/item.rs | 40 +++++++++++++-------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/tooling/nargo_fmt/src/visitor/item.rs b/tooling/nargo_fmt/src/visitor/item.rs index 827a708b003..94a32449ebe 100644 --- a/tooling/nargo_fmt/src/visitor/item.rs +++ b/tooling/nargo_fmt/src/visitor/item.rs @@ -118,29 +118,27 @@ impl super::FmtVisitor<'_> { ) -> String { let mut result = String::new(); - if func.return_type().typ != UnresolvedTypeData::Unit { - if span.start() == span.end() { - result.push_str(self.slice(params_end..func_span.start())); - } else { - result.push_str(" -> "); - - let visibility = match func.def.return_visibility { - Visibility::Public => "pub", - Visibility::ReturnData => "return_data", - Visibility::Private => "", - Visibility::CallData(_) => { - unreachable!("call_data cannot be used for return value") - } - }; - result.push_str(&append_space_if_nonempty(visibility.into())); + if func.return_type().typ == UnresolvedTypeData::Unit { + result.push_str(self.slice(params_end..func_span.start())); + } else { + result.push_str(" -> "); + + let visibility = match func.def.return_visibility { + Visibility::Public => "pub", + Visibility::ReturnData => "return_data", + Visibility::Private => "", + Visibility::CallData(_) => { + unreachable!("call_data cannot be used for return value") + } + }; + result.push_str(&append_space_if_nonempty(visibility.into())); - let typ = rewrite::typ(self, self.shape(), func.return_type()); - result.push_str(&typ); + let typ = rewrite::typ(self, self.shape(), func.return_type()); + result.push_str(&typ); - let slice = self.slice(span.end()..func_span.start()); - if !slice.trim().is_empty() { - result.push_str(slice); - } + let slice = self.slice(span.end()..func_span.start()); + if !slice.trim().is_empty() { + result.push_str(slice); } } From ca657122b98bf8ed8f291c7ab868518663123c6c Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Mon, 19 Aug 2024 10:09:41 -0500 Subject: [PATCH 28/37] Don't crash the linker --- compiler/noirc_frontend/src/monomorphization/mod.rs | 4 +--- compiler/noirc_frontend/src/parser/parser/types.rs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/noirc_frontend/src/monomorphization/mod.rs b/compiler/noirc_frontend/src/monomorphization/mod.rs index ba999776f99..c45a759aab6 100644 --- a/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -1029,9 +1029,7 @@ impl<'interner> Monomorphizer<'interner> { ast::Type::MutableReference(Box::new(element)) } - HirType::Forall(_, _) - | HirType::Constant(_) - | HirType::InfixExpr(..) => { + HirType::Forall(_, _) | HirType::Constant(_) | HirType::InfixExpr(..) => { unreachable!("Unexpected type {typ} found") } HirType::Error => { diff --git a/compiler/noirc_frontend/src/parser/parser/types.rs b/compiler/noirc_frontend/src/parser/parser/types.rs index f345629f6f9..233710f1ca2 100644 --- a/compiler/noirc_frontend/src/parser/parser/types.rs +++ b/compiler/noirc_frontend/src/parser/parser/types.rs @@ -234,8 +234,8 @@ pub(super) fn required_generic_type_args<'a>( // We need to parse named arguments first since otherwise when we see // `Foo = Bar`, just `Foo` is a valid type, and we'd parse an ordered // generic before erroring that an `=` is invalid after an ordered generic. - named_arg - .or(generic_type_arg.map(GenericTypeArg::Ordered)) + choice((named_arg, generic_type_arg.map(GenericTypeArg::Ordered))) + .boxed() // Without checking for a terminating ',' or '>' here we may incorrectly // parse a generic `N * 2` as just the type `N` then fail when there is no // separator afterward. Failing early here ensures we try the `type_expression` From d67a9f0a5d803ba014c4747b6df17e82c1b5598a Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Mon, 19 Aug 2024 13:30:32 -0300 Subject: [PATCH 29/37] Add a missing `follow_bindings` call --- tooling/lsp/src/requests/signature_help.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tooling/lsp/src/requests/signature_help.rs b/tooling/lsp/src/requests/signature_help.rs index c2c69185547..8aa74fe9900 100644 --- a/tooling/lsp/src/requests/signature_help.rs +++ b/tooling/lsp/src/requests/signature_help.rs @@ -146,6 +146,7 @@ impl<'a> SignatureFinder<'a> { // Otherwise, the call must be a reference to an fn type if let Some(mut typ) = self.interner.type_at_location(location) { + typ = typ.follow_bindings(); if let Type::Forall(_, forall_typ) = typ { typ = *forall_typ; } From 81c764e4b083c9b0a18c04b1b3e976c259486e94 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Mon, 19 Aug 2024 15:38:54 -0500 Subject: [PATCH 30/37] Add frontend tests --- compiler/noirc_frontend/src/ast/mod.rs | 2 +- compiler/noirc_frontend/src/tests.rs | 46 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/compiler/noirc_frontend/src/ast/mod.rs b/compiler/noirc_frontend/src/ast/mod.rs index 3afdace6789..6f6d5cbccdf 100644 --- a/compiler/noirc_frontend/src/ast/mod.rs +++ b/compiler/noirc_frontend/src/ast/mod.rs @@ -236,7 +236,7 @@ impl std::fmt::Display for GenericTypeArg { impl std::fmt::Display for GenericTypeArgs { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - if self.ordered_args.is_empty() && self.named_args.is_empty() { + if self.is_empty() { Ok(()) } else { let mut args = vecmap(&self.ordered_args, ToString::to_string).join(", "); diff --git a/compiler/noirc_frontend/src/tests.rs b/compiler/noirc_frontend/src/tests.rs index 18b00f907cd..d8cd8d1b7d5 100644 --- a/compiler/noirc_frontend/src/tests.rs +++ b/compiler/noirc_frontend/src/tests.rs @@ -3118,3 +3118,49 @@ fn trait_impl_for_a_type_that_implements_another_trait_with_another_impl_used() "#; assert_no_errors(src); } + +#[test] +fn impl_missing_associated_type() { + let src = r#" + trait Foo { + type Assoc; + } + + impl Foo for () {} + "#; + + let errors = get_program_errors(src); + assert_eq!(errors.len(), 1); + + assert!(matches!( + &errors[0].0, + CompilationError::TypeError(TypeCheckError::MissingNamedTypeArg { .. }) + )); +} + +#[test] +fn as_trait_path_syntax_resolves_outside_impl() { + let src = r#" + trait Foo { + type Assoc; + } + + struct Bar {} + + impl Foo for Bar { + type Assoc = i32; + } + + fn main() { + let _: i64 = 1 as ::Assoc; + } + "#; + + let errors = get_program_errors(src); + assert_eq!(dbg!(errors).len(), 2); + + assert!(matches!( + dbg!(&errors[0].0), + CompilationError::TypeError(TypeCheckError::OpCannotBeUsed { .. }) + )); +} From e174c7dc5b8b97e53fecd635f10fa9557a7ceaba Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 20 Aug 2024 12:53:57 -0500 Subject: [PATCH 31/37] Store TraitGenerics in a TraitConstraint --- .../src/elaborator/expressions.rs | 5 +- compiler/noirc_frontend/src/elaborator/mod.rs | 20 +++---- .../noirc_frontend/src/elaborator/patterns.rs | 25 ++------- .../src/elaborator/trait_impls.rs | 8 ++- .../noirc_frontend/src/elaborator/types.rs | 53 ++++++++++++++++--- .../src/hir/comptime/interpreter/builtin.rs | 13 ++--- .../noirc_frontend/src/hir/comptime/value.rs | 22 +------- .../src/hir/def_collector/errors.rs | 14 ++--- .../src/hir/type_check/errors.rs | 7 +-- .../src/hir/type_check/generics.rs | 13 ++++- compiler/noirc_frontend/src/hir_def/expr.rs | 5 +- compiler/noirc_frontend/src/hir_def/traits.rs | 30 ++++------- compiler/noirc_frontend/src/node_interner.rs | 26 +++++---- 13 files changed, 108 insertions(+), 133 deletions(-) diff --git a/compiler/noirc_frontend/src/elaborator/expressions.rs b/compiler/noirc_frontend/src/elaborator/expressions.rs index 4d8961a3d2c..cf0b4f4071a 100644 --- a/compiler/noirc_frontend/src/elaborator/expressions.rs +++ b/compiler/noirc_frontend/src/elaborator/expressions.rs @@ -11,7 +11,7 @@ use crate::{ hir::{ comptime::{self, InterpreterError}, resolution::errors::ResolverError, - type_check::TypeCheckError, + type_check::{generics::TraitGenerics, TypeCheckError}, }, hir_def::{ expr::{ @@ -620,8 +620,7 @@ impl<'context> Elaborator<'context> { let constraint = TraitConstraint { typ: operand_type.clone(), trait_id: trait_id.trait_id, - trait_generics: Vec::new(), - associated_types: Vec::new(), + trait_generics: TraitGenerics::default(), span, }; self.push_trait_constraint(constraint, expr_id); diff --git a/compiler/noirc_frontend/src/elaborator/mod.rs b/compiler/noirc_frontend/src/elaborator/mod.rs index 0b6d2cf4939..53b46536078 100644 --- a/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/compiler/noirc_frontend/src/elaborator/mod.rs @@ -13,7 +13,7 @@ use crate::{ def_map::DefMaps, resolution::{errors::ResolverError, path_resolver::PathResolver}, scope::ScopeForest as GenericScopeForest, - type_check::TypeCheckError, + type_check::{generics::TraitGenerics, TypeCheckError}, }, hir_def::{ expr::{HirCapturedVar, HirIdent}, @@ -490,8 +490,8 @@ impl<'context> Elaborator<'context> { self.verify_trait_constraint( &constraint.typ, constraint.trait_id, - &constraint.trait_generics, - &constraint.associated_types, + &constraint.trait_generics.ordered, + &constraint.trait_generics.named, expr_id, span, ); @@ -691,10 +691,10 @@ impl<'context> Elaborator<'context> { let trait_id = the_trait.id; let span = bound.trait_path.span; - let (trait_generics, associated_types) = - self.resolve_type_args(bound.trait_generics.clone(), trait_id, span); + let (ordered, named) = self.resolve_type_args(bound.trait_generics.clone(), trait_id, span); - Some(TraitConstraint { typ, trait_id, trait_generics, span, associated_types }) + let trait_generics = TraitGenerics { ordered, named }; + Some(TraitConstraint { typ, trait_id, trait_generics, span }) } /// Extract metadata from a NoirFunction @@ -934,14 +934,8 @@ impl<'context> Elaborator<'context> { let object = constraint.typ.clone(); let trait_id = constraint.trait_id; let generics = constraint.trait_generics.clone(); - let associated_types = constraint.associated_types.clone(); - if !self.interner.add_assumed_trait_implementation( - object, - trait_id, - generics, - associated_types, - ) { + if !self.interner.add_assumed_trait_implementation(object, trait_id, generics) { if let Some(the_trait) = self.interner.try_get_trait(trait_id) { let trait_name = the_trait.name.to_string(); let typ = constraint.typ.clone(); diff --git a/compiler/noirc_frontend/src/elaborator/patterns.rs b/compiler/noirc_frontend/src/elaborator/patterns.rs index 8ceb1b3da10..06c153d4c10 100644 --- a/compiler/noirc_frontend/src/elaborator/patterns.rs +++ b/compiler/noirc_frontend/src/elaborator/patterns.rs @@ -7,7 +7,7 @@ use crate::{ hir::{ def_collector::dc_crate::CompilationError, resolution::errors::ResolverError, - type_check::{generics::TraitGenerics, Source, TypeCheckError}, + type_check::{Source, TypeCheckError}, }, hir_def::{ expr::{HirIdent, ImplKind}, @@ -585,23 +585,7 @@ impl<'context> Elaborator<'context> { // will replace each trait generic with a fresh type variable, rather than // the type used in the trait constraint (if it exists). See #4088. if let ImplKind::TraitMethod(_, constraint, assumed) = &ident.impl_kind { - let the_trait = self.interner.get_trait(constraint.trait_id); - assert_eq!(the_trait.generics.len(), constraint.trait_generics.len()); - - for (param, arg) in the_trait.generics.iter().zip(&constraint.trait_generics) { - // Avoid binding t = t - if !arg.occurs(param.type_var.id()) { - bindings.insert(param.type_var.id(), (param.type_var.clone(), arg.clone())); - } - } - - // If the trait impl is already assumed to exist we should add any type bindings for `Self`. - // Otherwise `self` will be replaced with a fresh type variable, which will require the user - // to specify a redundant type annotation. - if *assumed { - let self_type = the_trait.self_type_typevar.clone(); - bindings.insert(self_type.id(), (self_type, constraint.typ.clone())); - } + self.bind_generics_from_trait_constraint(constraint, *assumed, &mut bindings); } // An identifiers type may be forall-quantified in the case of generic functions. @@ -642,10 +626,7 @@ impl<'context> Elaborator<'context> { if let ImplKind::TraitMethod(_, mut constraint, assumed) = ident.impl_kind { constraint.apply_bindings(&bindings); if assumed { - let trait_generics = TraitGenerics { - ordered: constraint.trait_generics, - named: constraint.associated_types, - }; + let trait_generics = constraint.trait_generics.clone(); let object_type = constraint.typ; let trait_impl = TraitImplKind::Assumed { object_type, trait_generics }; self.interner.select_impl_for_expression(expr_id, trait_impl); diff --git a/compiler/noirc_frontend/src/elaborator/trait_impls.rs b/compiler/noirc_frontend/src/elaborator/trait_impls.rs index 47550be0c43..aa7e1cb89c5 100644 --- a/compiler/noirc_frontend/src/elaborator/trait_impls.rs +++ b/compiler/noirc_frontend/src/elaborator/trait_impls.rs @@ -164,11 +164,9 @@ impl<'context> Elaborator<'context> { let mut substituted_method_ids = HashSet::default(); for method_constraint in method.trait_constraints.iter() { let substituted_constraint_type = method_constraint.typ.substitute(&bindings); - let substituted_trait_generics = method_constraint - .trait_generics - .iter() - .map(|generic| generic.substitute(&bindings)) - .collect::>(); + let substituted_trait_generics = + method_constraint.trait_generics.map(|generic| generic.substitute(&bindings)); + substituted_method_ids.insert(( substituted_constraint_type, method_constraint.trait_id, diff --git a/compiler/noirc_frontend/src/elaborator/types.rs b/compiler/noirc_frontend/src/elaborator/types.rs index 8df8ace42e5..dfd9c4eff78 100644 --- a/compiler/noirc_frontend/src/elaborator/types.rs +++ b/compiler/noirc_frontend/src/elaborator/types.rs @@ -35,7 +35,8 @@ use crate::{ DefinitionKind, DependencyId, ExprId, FuncId, GlobalId, TraitId, TraitImplKind, TraitMethodId, }, - Generics, Kind, ResolvedGeneric, Type, TypeBinding, TypeVariable, TypeVariableKind, + Generics, Kind, ResolvedGeneric, Type, TypeBinding, TypeBindings, TypeVariable, + TypeVariableKind, }; use super::{lints, Elaborator}; @@ -1368,11 +1369,7 @@ impl<'context> Elaborator<'context> { let trait_method = TraitMethodId { trait_id: constraint.trait_id, method_index }; - let generics = TraitGenerics { - ordered: constraint.trait_generics.clone(), - named: constraint.associated_types.clone(), - }; - + let generics = constraint.trait_generics.clone(); return Some(HirMethodReference::TraitMethodId(trait_method, generics)); } } @@ -1771,6 +1768,50 @@ impl<'context> Elaborator<'context> { } } } + + pub fn bind_generics_from_trait_constraint( + &mut self, + constraint: &TraitConstraint, + assumed: bool, + bindings: &mut TypeBindings, + ) { + let the_trait = self.interner.get_trait(constraint.trait_id); + assert_eq!(the_trait.generics.len(), constraint.trait_generics.ordered.len()); + + for (param, arg) in the_trait.generics.iter().zip(&constraint.trait_generics.ordered) { + // Avoid binding t = t + if !arg.occurs(param.type_var.id()) { + bindings.insert(param.type_var.id(), (param.type_var.clone(), arg.clone())); + } + } + + let mut associated_types = the_trait.associated_types.clone(); + assert_eq!(associated_types.len(), constraint.trait_generics.named.len()); + + for arg in &constraint.trait_generics.named { + let i = associated_types + .iter() + .position(|typ| *typ.name == arg.name.0.contents) + .unwrap_or_else(|| { + unreachable!("Expected to find associated type named {}", arg.name) + }); + + let param = associated_types.swap_remove(i); + + // Avoid binding t = t + if !arg.typ.occurs(param.type_var.id()) { + bindings.insert(param.type_var.id(), (param.type_var.clone(), arg.typ.clone())); + } + } + + // If the trait impl is already assumed to exist we should add any type bindings for `Self`. + // Otherwise `self` will be replaced with a fresh type variable, which will require the user + // to specify a redundant type annotation. + if assumed { + let self_type = the_trait.self_type_typevar.clone(); + bindings.insert(self_type.id(), (self_type, constraint.typ.clone())); + } + } } /// Gives an error if a user tries to create a mutable reference diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs index dfa49445483..4126ffc487d 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs @@ -20,10 +20,7 @@ use crate::{ ArrayLiteral, ExpressionKind, FunctionKind, FunctionReturnType, IntegerBitSize, Literal, UnaryOp, UnresolvedType, UnresolvedTypeData, Visibility, }, - hir::{ - comptime::{errors::IResult, value::add_token_spans, InterpreterError, Value}, - type_check::generics::TraitGenerics, - }, + hir::comptime::{errors::IResult, value::add_token_spans, InterpreterError, Value}, hir_def::function::FunctionBody, macros_api::{ModuleDefId, NodeInterner, Signedness}, node_interner::{DefinitionKind, TraitImplKind}, @@ -388,9 +385,7 @@ fn quoted_as_trait_constraint( }) .ok_or(InterpreterError::FailedToResolveTraitBound { trait_bound, location })?; - let ordered = bound.trait_generics; - let named = bound.associated_types; - Ok(Value::TraitConstraint(bound.trait_id, TraitGenerics { ordered, named })) + Ok(Value::TraitConstraint(bound.trait_id, bound.trait_generics)) } // fn as_type(quoted: Quoted) -> Type @@ -1371,10 +1366,8 @@ fn trait_def_as_trait_constraint( let trait_id = get_trait_def(argument)?; let constraint = interner.get_trait(trait_id).as_constraint(location.span); - let ordered = constraint.trait_generics; - let named = constraint.associated_types; - Ok(Value::TraitConstraint(trait_id, TraitGenerics { ordered, named })) + Ok(Value::TraitConstraint(trait_id, constraint.trait_generics)) } /// Creates a value that holds an `Option`. diff --git a/compiler/noirc_frontend/src/hir/comptime/value.rs b/compiler/noirc_frontend/src/hir/comptime/value.rs index bb0326d65ab..9b7f27cb40c 100644 --- a/compiler/noirc_frontend/src/hir/comptime/value.rs +++ b/compiler/noirc_frontend/src/hir/comptime/value.rs @@ -571,25 +571,5 @@ impl<'value, 'interner> Display for ValuePrinter<'value, 'interner> { fn display_trait_constraint(interner: &NodeInterner, trait_constraint: &TraitConstraint) -> String { let trait_ = interner.get_trait(trait_constraint.trait_id); - let mut result = format!("{}: {}", trait_constraint.typ, trait_.name); - - if !trait_constraint.trait_generics.is_empty() || !trait_constraint.associated_types.is_empty() - { - result += "<"; - result += &vecmap(&trait_constraint.trait_generics, ToString::to_string).join(", "); - - if !trait_constraint.trait_generics.is_empty() - && !trait_constraint.associated_types.is_empty() - { - result += ", "; - } - - result += &vecmap(&trait_constraint.associated_types, |named| { - format!("{} = {}", named.name, named.typ) - }) - .join(", "); - result += ">"; - } - - result + format!("{}: {}{}", trait_constraint.typ, trait_.name, trait_constraint.trait_generics) } diff --git a/compiler/noirc_frontend/src/hir/def_collector/errors.rs b/compiler/noirc_frontend/src/hir/def_collector/errors.rs index 9e9471c0cb3..e705d7b6fad 100644 --- a/compiler/noirc_frontend/src/hir/def_collector/errors.rs +++ b/compiler/noirc_frontend/src/hir/def_collector/errors.rs @@ -1,5 +1,6 @@ use crate::ast::{Ident, Path, UnresolvedTypeData}; use crate::hir::resolution::import::PathResolutionError; +use crate::hir::type_check::generics::TraitGenerics; use noirc_errors::CustomDiagnostic as Diagnostic; use noirc_errors::FileDiagnostic; @@ -76,7 +77,7 @@ pub enum DefCollectorErrorKind { ImplIsStricterThanTrait { constraint_typ: crate::Type, constraint_name: String, - constraint_generics: Vec, + constraint_generics: TraitGenerics, constraint_span: Span, trait_method_name: String, trait_method_span: Span, @@ -280,18 +281,11 @@ impl<'a> From<&'a DefCollectorErrorKind> for Diagnostic { ) } DefCollectorErrorKind::ImplIsStricterThanTrait { constraint_typ, constraint_name, constraint_generics, constraint_span, trait_method_name, trait_method_span } => { - let mut constraint_name_with_generics = constraint_name.to_owned(); - if !constraint_generics.is_empty() { - constraint_name_with_generics.push('<'); - for generic in constraint_generics.iter() { - constraint_name_with_generics.push_str(generic.to_string().as_str()); - } - constraint_name_with_generics.push('>'); - } + let constraint = format!("{}{}", constraint_name, constraint_generics); let mut diag = Diagnostic::simple_error( "impl has stricter requirements than trait".to_string(), - format!("impl has extra requirement `{constraint_typ}: {constraint_name_with_generics}`"), + format!("impl has extra requirement `{constraint_typ}: {constraint}`"), *constraint_span, ); diag.add_secondary(format!("definition of `{trait_method_name}` from trait"), *trait_method_span); diff --git a/compiler/noirc_frontend/src/hir/type_check/errors.rs b/compiler/noirc_frontend/src/hir/type_check/errors.rs index 2c0e44e199d..316f1579961 100644 --- a/compiler/noirc_frontend/src/hir/type_check/errors.rs +++ b/compiler/noirc_frontend/src/hir/type_check/errors.rs @@ -1,7 +1,6 @@ use std::rc::Rc; use acvm::FieldElement; -use iter_extended::vecmap; use noirc_errors::CustomDiagnostic as Diagnostic; use noirc_errors::Span; use thiserror::Error; @@ -427,11 +426,7 @@ impl NoMatchingImplFoundError { .into_iter() .map(|constraint| { let r#trait = interner.try_get_trait(constraint.trait_id)?; - let mut name = r#trait.name.to_string(); - if !constraint.trait_generics.is_empty() { - let generics = vecmap(&constraint.trait_generics, ToString::to_string); - name += &format!("<{}>", generics.join(", ")); - } + let name = format!("{}{}", r#trait.name, constraint.trait_generics); Some((constraint.typ, name)) }) .collect::>>()?; diff --git a/compiler/noirc_frontend/src/hir/type_check/generics.rs b/compiler/noirc_frontend/src/hir/type_check/generics.rs index 44dce9aafb6..379c53944e5 100644 --- a/compiler/noirc_frontend/src/hir/type_check/generics.rs +++ b/compiler/noirc_frontend/src/hir/type_check/generics.rs @@ -1,5 +1,7 @@ use std::cell::Ref; +use iter_extended::vecmap; + use crate::{ hir_def::traits::NamedType, macros_api::NodeInterner, @@ -97,12 +99,21 @@ impl Generic for Ref<'_, StructType> { /// TraitGenerics are different from regular generics in that they can /// also contain associated type arguments. -#[derive(PartialEq, Eq, Clone, Hash, Ord, PartialOrd)] +#[derive(Default, PartialEq, Eq, Clone, Hash, Ord, PartialOrd)] pub struct TraitGenerics { pub ordered: Vec, pub named: Vec, } +impl TraitGenerics { + pub fn map(&self, mut f: impl FnMut(&Type) -> Type) -> TraitGenerics { + let ordered = vecmap(&self.ordered, &mut f); + let named = + vecmap(&self.named, |named| NamedType { name: named.name.clone(), typ: f(&named.typ) }); + TraitGenerics { ordered, named } + } +} + impl std::fmt::Display for TraitGenerics { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fmt_trait_generics(self, f, false) diff --git a/compiler/noirc_frontend/src/hir_def/expr.rs b/compiler/noirc_frontend/src/hir_def/expr.rs index a57222e9ade..40c16d00356 100644 --- a/compiler/noirc_frontend/src/hir_def/expr.rs +++ b/compiler/noirc_frontend/src/hir_def/expr.rs @@ -222,13 +222,12 @@ impl HirMethodCallExpression { HirMethodReference::FuncId(func_id) => { (interner.function_definition_id(func_id), ImplKind::NotATraitMethod) } - HirMethodReference::TraitMethodId(method_id, generics) => { + HirMethodReference::TraitMethodId(method_id, trait_generics) => { let id = interner.trait_method_id(method_id); let constraint = TraitConstraint { typ: object_type, trait_id: method_id.trait_id, - trait_generics: generics.ordered, - associated_types: generics.named, + trait_generics, span: location.span, }; (id, ImplKind::TraitMethod(method_id, constraint, false)) diff --git a/compiler/noirc_frontend/src/hir_def/traits.rs b/compiler/noirc_frontend/src/hir_def/traits.rs index 13c5e226e23..0572ba403a1 100644 --- a/compiler/noirc_frontend/src/hir_def/traits.rs +++ b/compiler/noirc_frontend/src/hir_def/traits.rs @@ -2,6 +2,7 @@ use iter_extended::vecmap; use rustc_hash::FxHashMap as HashMap; use crate::ast::{Ident, NoirFunction}; +use crate::hir::type_check::generics::TraitGenerics; use crate::{ graph::CrateId, node_interner::{FuncId, TraitId, TraitMethodId}, @@ -101,30 +102,19 @@ pub struct TraitImpl { pub struct TraitConstraint { pub typ: Type, pub trait_id: TraitId, - pub trait_generics: Vec, - pub associated_types: Vec, + pub trait_generics: TraitGenerics, pub span: Span, } impl TraitConstraint { - pub fn new( - typ: Type, - trait_id: TraitId, - trait_generics: Vec, - associated_types: Vec, - span: Span, - ) -> Self { - Self { typ, trait_id, trait_generics, associated_types, span } - } - pub fn apply_bindings(&mut self, type_bindings: &TypeBindings) { self.typ = self.typ.substitute(type_bindings); - for typ in &mut self.trait_generics { + for typ in &mut self.trait_generics.ordered { *typ = typ.substitute(type_bindings); } - for named in &mut self.associated_types { + for named in &mut self.trait_generics.named { named.typ = named.typ.substitute(type_bindings); } } @@ -171,15 +161,17 @@ impl Trait { /// Returns a TraitConstraint for this trait using Self as the object /// type and the uninstantiated generics for any trait generics. pub fn as_constraint(&self, span: Span) -> TraitConstraint { + let ordered = vecmap(&self.generics, |generic| generic.clone().as_named_generic()); + let named = vecmap(&self.associated_types, |generic| { + let name = Ident::new(generic.name.to_string(), span); + NamedType { name, typ: generic.clone().as_named_generic() } + }); + TraitConstraint { typ: Type::TypeVariable(self.self_type_typevar.clone(), TypeVariableKind::Normal), - trait_generics: vecmap(&self.generics, |generic| generic.clone().as_named_generic()), + trait_generics: TraitGenerics { ordered, named }, trait_id: self.id, span, - associated_types: vecmap(&self.associated_types, |generic| { - let name = Ident::new(generic.name.to_string(), span); - NamedType { name, typ: generic.clone().as_named_generic() } - }), } } } diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 8143b67371b..a818ceb91bb 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -1453,13 +1453,14 @@ impl NodeInterner { recursion_limit: u32, ) -> Result> { let make_constraint = || { - TraitConstraint::new( - object_type.clone(), + let ordered = trait_generics.to_vec(); + let named = trait_associated_types.to_vec(); + TraitConstraint { + typ: object_type.clone(), trait_id, - trait_generics.to_vec(), - trait_associated_types.to_vec(), - Span::default(), - ) + trait_generics: TraitGenerics { ordered, named }, + span: Span::default(), + } }; // Prevent infinite recursion when looking for impls @@ -1570,11 +1571,11 @@ impl NodeInterner { let constraint_type = constraint.typ.force_substitute(instantiation_bindings).substitute(type_bindings); - let trait_generics = vecmap(&constraint.trait_generics, |generic| { + let trait_generics = vecmap(&constraint.trait_generics.ordered, |generic| { generic.force_substitute(instantiation_bindings).substitute(type_bindings) }); - let trait_associated_types = vecmap(&constraint.associated_types, |generic| { + let trait_associated_types = vecmap(&constraint.trait_generics.named, |generic| { let typ = generic.typ.force_substitute(instantiation_bindings); NamedType { name: generic.name.clone(), typ: typ.substitute(type_bindings) } }); @@ -1608,23 +1609,20 @@ impl NodeInterner { &mut self, object_type: Type, trait_id: TraitId, - trait_generics: Vec, - trait_associated_types: Vec, + trait_generics: TraitGenerics, ) -> bool { // Make sure there are no overlapping impls let existing = self.try_lookup_trait_implementation( &object_type, trait_id, - &trait_generics, - &trait_associated_types, + &trait_generics.ordered, + &trait_generics.named, ); if existing.is_ok() { return false; } let entries = self.trait_implementation_map.entry(trait_id).or_default(); - let trait_generics = - TraitGenerics { ordered: trait_generics, named: trait_associated_types }; entries.push((object_type.clone(), TraitImplKind::Assumed { object_type, trait_generics })); true } From 4471eea5abf7f169876c7fa34931c5b10168e053 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 20 Aug 2024 13:04:17 -0500 Subject: [PATCH 32/37] Type hints aren't needed! --- .../serialize/src/main.nr | 6 +- .../execution_success/regression_5027/ssa | 7510 +++++++++++++++++ .../regression_5027/ssa_master | 7510 +++++++++++++++++ 3 files changed, 15023 insertions(+), 3 deletions(-) create mode 100644 test_programs/execution_success/regression_5027/ssa create mode 100644 test_programs/execution_success/regression_5027/ssa_master diff --git a/test_programs/compile_success_empty/serialize/src/main.nr b/test_programs/compile_success_empty/serialize/src/main.nr index 617da0f73b1..79114c5b567 100644 --- a/test_programs/compile_success_empty/serialize/src/main.nr +++ b/test_programs/compile_success_empty/serialize/src/main.nr @@ -11,8 +11,8 @@ impl Serialize for (A, B) where A: Serialize [Field; Self::Size] { let mut array: [Field; Self::Size] = std::mem::zeroed(); - let a: [Field; AS] = self.0.serialize(); - let b: [Field; BS] = self.1.serialize(); + let a = self.0.serialize(); + let b = self.1.serialize(); for i in 0 .. a.len() { array[i] = a[i]; @@ -33,7 +33,7 @@ impl Serialize for [T; N] where T: Serialize Date: Tue, 20 Aug 2024 13:18:24 -0500 Subject: [PATCH 33/37] Fix lint --- .../noirc_frontend/src/elaborator/lints.rs | 4 +- .../execution_success/regression_5027/ssa | 7510 ----------------- .../regression_5027/ssa_master | 7510 ----------------- 3 files changed, 2 insertions(+), 15022 deletions(-) delete mode 100644 test_programs/execution_success/regression_5027/ssa delete mode 100644 test_programs/execution_success/regression_5027/ssa_master diff --git a/compiler/noirc_frontend/src/elaborator/lints.rs b/compiler/noirc_frontend/src/elaborator/lints.rs index a4140043ac1..78df10fa94c 100644 --- a/compiler/noirc_frontend/src/elaborator/lints.rs +++ b/compiler/noirc_frontend/src/elaborator/lints.rs @@ -236,9 +236,9 @@ pub(crate) fn overflowing_int( }, HirExpression::Prefix(expr) => { overflowing_int(interner, &expr.rhs, annotated_type); - if expr.operator == UnaryOp::Minus { + if expr.operator == UnaryOp::Minus && annotated_type.is_unsigned() { errors.push(TypeCheckError::InvalidUnaryOp { - kind: "annotated_type".to_string(), + kind: annotated_type.to_string(), span, }); } diff --git a/test_programs/execution_success/regression_5027/ssa b/test_programs/execution_success/regression_5027/ssa deleted file mode 100644 index 59d05155b01..00000000000 --- a/test_programs/execution_success/regression_5027/ssa +++ /dev/null @@ -1,7510 +0,0 @@ -After Array Set Optimizations: -acir(inline) fn main f0 { - b0(v0: [Field; 500], v1: [u1; 500], v2: [u64; 500]): - inc_rc v0 - v15507 = array_get v1, index u32 0 - enable_side_effects v15507 - v15508 = array_get v2, index u32 0 - v15509 = cast v15508 as u32 - v15510 = array_set v0, index v15509, value Field 0 - v15512 = not v15507 - v15513 = array_get v15510, index v15509 - v15514 = array_get v0, index v15509 - v15515 = cast v15507 as Field - v15516 = cast v15512 as Field - v15517 = mul v15515, v15513 - v15518 = mul v15516, v15514 - v15519 = add v15517, v15518 - v15520 = array_set mut v15510, index v15509, value v15519 - enable_side_effects u1 1 - v15521 = array_get v1, index u32 1 - enable_side_effects v15521 - v15522 = array_get v2, index u32 1 - v15523 = cast v15522 as u32 - v15524 = array_set v15520, index v15523, value Field 1 - v15526 = not v15521 - v15527 = array_get v15524, index v15523 - v15528 = array_get v15520, index v15523 - v15529 = cast v15521 as Field - v15530 = cast v15526 as Field - v15531 = mul v15529, v15527 - v15532 = mul v15530, v15528 - v15533 = add v15531, v15532 - v15534 = array_set mut v15524, index v15523, value v15533 - enable_side_effects u1 1 - v15535 = array_get v1, index u32 2 - enable_side_effects v15535 - v15536 = array_get v2, index u32 2 - v15537 = cast v15536 as u32 - v15538 = array_set v15534, index v15537, value Field 2 - v15540 = not v15535 - v15541 = array_get v15538, index v15537 - v15542 = array_get v15534, index v15537 - v15543 = cast v15535 as Field - v15544 = cast v15540 as Field - v15545 = mul v15543, v15541 - v15546 = mul v15544, v15542 - v15547 = add v15545, v15546 - v15548 = array_set mut v15538, index v15537, value v15547 - enable_side_effects u1 1 - v15549 = array_get v1, index u32 3 - enable_side_effects v15549 - v15550 = array_get v2, index u32 3 - v15551 = cast v15550 as u32 - v15552 = array_set v15548, index v15551, value Field 3 - v15554 = not v15549 - v15555 = array_get v15552, index v15551 - v15556 = array_get v15548, index v15551 - v15557 = cast v15549 as Field - v15558 = cast v15554 as Field - v15559 = mul v15557, v15555 - v15560 = mul v15558, v15556 - v15561 = add v15559, v15560 - v15562 = array_set mut v15552, index v15551, value v15561 - enable_side_effects u1 1 - v15563 = array_get v1, index u32 4 - enable_side_effects v15563 - v15564 = array_get v2, index u32 4 - v15565 = cast v15564 as u32 - v15566 = array_set v15562, index v15565, value Field 4 - v15568 = not v15563 - v15569 = array_get v15566, index v15565 - v15570 = array_get v15562, index v15565 - v15571 = cast v15563 as Field - v15572 = cast v15568 as Field - v15573 = mul v15571, v15569 - v15574 = mul v15572, v15570 - v15575 = add v15573, v15574 - v15576 = array_set mut v15566, index v15565, value v15575 - enable_side_effects u1 1 - v15577 = array_get v1, index u32 5 - enable_side_effects v15577 - v15578 = array_get v2, index u32 5 - v15579 = cast v15578 as u32 - v15580 = array_set v15576, index v15579, value Field 5 - v15582 = not v15577 - v15583 = array_get v15580, index v15579 - v15584 = array_get v15576, index v15579 - v15585 = cast v15577 as Field - v15586 = cast v15582 as Field - v15587 = mul v15585, v15583 - v15588 = mul v15586, v15584 - v15589 = add v15587, v15588 - v15590 = array_set mut v15580, index v15579, value v15589 - enable_side_effects u1 1 - v15591 = array_get v1, index u32 6 - enable_side_effects v15591 - v15592 = array_get v2, index u32 6 - v15593 = cast v15592 as u32 - v15594 = array_set v15590, index v15593, value Field 6 - v15596 = not v15591 - v15597 = array_get v15594, index v15593 - v15598 = array_get v15590, index v15593 - v15599 = cast v15591 as Field - v15600 = cast v15596 as Field - v15601 = mul v15599, v15597 - v15602 = mul v15600, v15598 - v15603 = add v15601, v15602 - v15604 = array_set mut v15594, index v15593, value v15603 - enable_side_effects u1 1 - v15605 = array_get v1, index u32 7 - enable_side_effects v15605 - v15606 = array_get v2, index u32 7 - v15607 = cast v15606 as u32 - v15608 = array_set v15604, index v15607, value Field 7 - v15610 = not v15605 - v15611 = array_get v15608, index v15607 - v15612 = array_get v15604, index v15607 - v15613 = cast v15605 as Field - v15614 = cast v15610 as Field - v15615 = mul v15613, v15611 - v15616 = mul v15614, v15612 - v15617 = add v15615, v15616 - v15618 = array_set mut v15608, index v15607, value v15617 - enable_side_effects u1 1 - v15619 = array_get v1, index u32 8 - enable_side_effects v15619 - v15620 = array_get v2, index u32 8 - v15621 = cast v15620 as u32 - v15622 = array_set v15618, index v15621, value Field 8 - v15624 = not v15619 - v15625 = array_get v15622, index v15621 - v15626 = array_get v15618, index v15621 - v15627 = cast v15619 as Field - v15628 = cast v15624 as Field - v15629 = mul v15627, v15625 - v15630 = mul v15628, v15626 - v15631 = add v15629, v15630 - v15632 = array_set mut v15622, index v15621, value v15631 - enable_side_effects u1 1 - v15633 = array_get v1, index u32 9 - enable_side_effects v15633 - v15634 = array_get v2, index u32 9 - v15635 = cast v15634 as u32 - v15636 = array_set v15632, index v15635, value Field 9 - v15638 = not v15633 - v15639 = array_get v15636, index v15635 - v15640 = array_get v15632, index v15635 - v15641 = cast v15633 as Field - v15642 = cast v15638 as Field - v15643 = mul v15641, v15639 - v15644 = mul v15642, v15640 - v15645 = add v15643, v15644 - v15646 = array_set mut v15636, index v15635, value v15645 - enable_side_effects u1 1 - v15647 = array_get v1, index u32 10 - enable_side_effects v15647 - v15648 = array_get v2, index u32 10 - v15649 = cast v15648 as u32 - v15650 = array_set v15646, index v15649, value Field 10 - v15652 = not v15647 - v15653 = array_get v15650, index v15649 - v15654 = array_get v15646, index v15649 - v15655 = cast v15647 as Field - v15656 = cast v15652 as Field - v15657 = mul v15655, v15653 - v15658 = mul v15656, v15654 - v15659 = add v15657, v15658 - v15660 = array_set mut v15650, index v15649, value v15659 - enable_side_effects u1 1 - v15661 = array_get v1, index u32 11 - enable_side_effects v15661 - v15662 = array_get v2, index u32 11 - v15663 = cast v15662 as u32 - v15664 = array_set v15660, index v15663, value Field 11 - v15666 = not v15661 - v15667 = array_get v15664, index v15663 - v15668 = array_get v15660, index v15663 - v15669 = cast v15661 as Field - v15670 = cast v15666 as Field - v15671 = mul v15669, v15667 - v15672 = mul v15670, v15668 - v15673 = add v15671, v15672 - v15674 = array_set mut v15664, index v15663, value v15673 - enable_side_effects u1 1 - v15675 = array_get v1, index u32 12 - enable_side_effects v15675 - v15676 = array_get v2, index u32 12 - v15677 = cast v15676 as u32 - v15678 = array_set v15674, index v15677, value Field 12 - v15680 = not v15675 - v15681 = array_get v15678, index v15677 - v15682 = array_get v15674, index v15677 - v15683 = cast v15675 as Field - v15684 = cast v15680 as Field - v15685 = mul v15683, v15681 - v15686 = mul v15684, v15682 - v15687 = add v15685, v15686 - v15688 = array_set mut v15678, index v15677, value v15687 - enable_side_effects u1 1 - v15689 = array_get v1, index u32 13 - enable_side_effects v15689 - v15690 = array_get v2, index u32 13 - v15691 = cast v15690 as u32 - v15692 = array_set v15688, index v15691, value Field 13 - v15694 = not v15689 - v15695 = array_get v15692, index v15691 - v15696 = array_get v15688, index v15691 - v15697 = cast v15689 as Field - v15698 = cast v15694 as Field - v15699 = mul v15697, v15695 - v15700 = mul v15698, v15696 - v15701 = add v15699, v15700 - v15702 = array_set mut v15692, index v15691, value v15701 - enable_side_effects u1 1 - v15703 = array_get v1, index u32 14 - enable_side_effects v15703 - v15704 = array_get v2, index u32 14 - v15705 = cast v15704 as u32 - v15706 = array_set v15702, index v15705, value Field 14 - v15708 = not v15703 - v15709 = array_get v15706, index v15705 - v15710 = array_get v15702, index v15705 - v15711 = cast v15703 as Field - v15712 = cast v15708 as Field - v15713 = mul v15711, v15709 - v15714 = mul v15712, v15710 - v15715 = add v15713, v15714 - v15716 = array_set mut v15706, index v15705, value v15715 - enable_side_effects u1 1 - v15717 = array_get v1, index u32 15 - enable_side_effects v15717 - v15718 = array_get v2, index u32 15 - v15719 = cast v15718 as u32 - v15720 = array_set v15716, index v15719, value Field 15 - v15722 = not v15717 - v15723 = array_get v15720, index v15719 - v15724 = array_get v15716, index v15719 - v15725 = cast v15717 as Field - v15726 = cast v15722 as Field - v15727 = mul v15725, v15723 - v15728 = mul v15726, v15724 - v15729 = add v15727, v15728 - v15730 = array_set mut v15720, index v15719, value v15729 - enable_side_effects u1 1 - v15731 = array_get v1, index u32 2⁴ - enable_side_effects v15731 - v15732 = array_get v2, index u32 2⁴ - v15733 = cast v15732 as u32 - v15734 = array_set v15730, index v15733, value Field 2⁴ - v15736 = not v15731 - v15737 = array_get v15734, index v15733 - v15738 = array_get v15730, index v15733 - v15739 = cast v15731 as Field - v15740 = cast v15736 as Field - v15741 = mul v15739, v15737 - v15742 = mul v15740, v15738 - v15743 = add v15741, v15742 - v15744 = array_set mut v15734, index v15733, value v15743 - enable_side_effects u1 1 - v15745 = array_get v1, index u32 17 - enable_side_effects v15745 - v15746 = array_get v2, index u32 17 - v15747 = cast v15746 as u32 - v15748 = array_set v15744, index v15747, value Field 17 - v15750 = not v15745 - v15751 = array_get v15748, index v15747 - v15752 = array_get v15744, index v15747 - v15753 = cast v15745 as Field - v15754 = cast v15750 as Field - v15755 = mul v15753, v15751 - v15756 = mul v15754, v15752 - v15757 = add v15755, v15756 - v15758 = array_set mut v15748, index v15747, value v15757 - enable_side_effects u1 1 - v15759 = array_get v1, index u32 18 - enable_side_effects v15759 - v15760 = array_get v2, index u32 18 - v15761 = cast v15760 as u32 - v15762 = array_set v15758, index v15761, value Field 18 - v15764 = not v15759 - v15765 = array_get v15762, index v15761 - v15766 = array_get v15758, index v15761 - v15767 = cast v15759 as Field - v15768 = cast v15764 as Field - v15769 = mul v15767, v15765 - v15770 = mul v15768, v15766 - v15771 = add v15769, v15770 - v15772 = array_set mut v15762, index v15761, value v15771 - enable_side_effects u1 1 - v15773 = array_get v1, index u32 19 - enable_side_effects v15773 - v15774 = array_get v2, index u32 19 - v15775 = cast v15774 as u32 - v15776 = array_set v15772, index v15775, value Field 19 - v15778 = not v15773 - v15779 = array_get v15776, index v15775 - v15780 = array_get v15772, index v15775 - v15781 = cast v15773 as Field - v15782 = cast v15778 as Field - v15783 = mul v15781, v15779 - v15784 = mul v15782, v15780 - v15785 = add v15783, v15784 - v15786 = array_set mut v15776, index v15775, value v15785 - enable_side_effects u1 1 - v15787 = array_get v1, index u32 20 - enable_side_effects v15787 - v15788 = array_get v2, index u32 20 - v15789 = cast v15788 as u32 - v15790 = array_set v15786, index v15789, value Field 20 - v15792 = not v15787 - v15793 = array_get v15790, index v15789 - v15794 = array_get v15786, index v15789 - v15795 = cast v15787 as Field - v15796 = cast v15792 as Field - v15797 = mul v15795, v15793 - v15798 = mul v15796, v15794 - v15799 = add v15797, v15798 - v15800 = array_set mut v15790, index v15789, value v15799 - enable_side_effects u1 1 - v15801 = array_get v1, index u32 21 - enable_side_effects v15801 - v15802 = array_get v2, index u32 21 - v15803 = cast v15802 as u32 - v15804 = array_set v15800, index v15803, value Field 21 - v15806 = not v15801 - v15807 = array_get v15804, index v15803 - v15808 = array_get v15800, index v15803 - v15809 = cast v15801 as Field - v15810 = cast v15806 as Field - v15811 = mul v15809, v15807 - v15812 = mul v15810, v15808 - v15813 = add v15811, v15812 - v15814 = array_set mut v15804, index v15803, value v15813 - enable_side_effects u1 1 - v15815 = array_get v1, index u32 22 - enable_side_effects v15815 - v15816 = array_get v2, index u32 22 - v15817 = cast v15816 as u32 - v15818 = array_set v15814, index v15817, value Field 22 - v15820 = not v15815 - v15821 = array_get v15818, index v15817 - v15822 = array_get v15814, index v15817 - v15823 = cast v15815 as Field - v15824 = cast v15820 as Field - v15825 = mul v15823, v15821 - v15826 = mul v15824, v15822 - v15827 = add v15825, v15826 - v15828 = array_set mut v15818, index v15817, value v15827 - enable_side_effects u1 1 - v15829 = array_get v1, index u32 23 - enable_side_effects v15829 - v15830 = array_get v2, index u32 23 - v15831 = cast v15830 as u32 - v15832 = array_set v15828, index v15831, value Field 23 - v15834 = not v15829 - v15835 = array_get v15832, index v15831 - v15836 = array_get v15828, index v15831 - v15837 = cast v15829 as Field - v15838 = cast v15834 as Field - v15839 = mul v15837, v15835 - v15840 = mul v15838, v15836 - v15841 = add v15839, v15840 - v15842 = array_set mut v15832, index v15831, value v15841 - enable_side_effects u1 1 - v15843 = array_get v1, index u32 24 - enable_side_effects v15843 - v15844 = array_get v2, index u32 24 - v15845 = cast v15844 as u32 - v15846 = array_set v15842, index v15845, value Field 24 - v15848 = not v15843 - v15849 = array_get v15846, index v15845 - v15850 = array_get v15842, index v15845 - v15851 = cast v15843 as Field - v15852 = cast v15848 as Field - v15853 = mul v15851, v15849 - v15854 = mul v15852, v15850 - v15855 = add v15853, v15854 - v15856 = array_set mut v15846, index v15845, value v15855 - enable_side_effects u1 1 - v15857 = array_get v1, index u32 25 - enable_side_effects v15857 - v15858 = array_get v2, index u32 25 - v15859 = cast v15858 as u32 - v15860 = array_set v15856, index v15859, value Field 25 - v15862 = not v15857 - v15863 = array_get v15860, index v15859 - v15864 = array_get v15856, index v15859 - v15865 = cast v15857 as Field - v15866 = cast v15862 as Field - v15867 = mul v15865, v15863 - v15868 = mul v15866, v15864 - v15869 = add v15867, v15868 - v15870 = array_set mut v15860, index v15859, value v15869 - enable_side_effects u1 1 - v15871 = array_get v1, index u32 26 - enable_side_effects v15871 - v15872 = array_get v2, index u32 26 - v15873 = cast v15872 as u32 - v15874 = array_set v15870, index v15873, value Field 26 - v15876 = not v15871 - v15877 = array_get v15874, index v15873 - v15878 = array_get v15870, index v15873 - v15879 = cast v15871 as Field - v15880 = cast v15876 as Field - v15881 = mul v15879, v15877 - v15882 = mul v15880, v15878 - v15883 = add v15881, v15882 - v15884 = array_set mut v15874, index v15873, value v15883 - enable_side_effects u1 1 - v15885 = array_get v1, index u32 27 - enable_side_effects v15885 - v15886 = array_get v2, index u32 27 - v15887 = cast v15886 as u32 - v15888 = array_set v15884, index v15887, value Field 27 - v15890 = not v15885 - v15891 = array_get v15888, index v15887 - v15892 = array_get v15884, index v15887 - v15893 = cast v15885 as Field - v15894 = cast v15890 as Field - v15895 = mul v15893, v15891 - v15896 = mul v15894, v15892 - v15897 = add v15895, v15896 - v15898 = array_set mut v15888, index v15887, value v15897 - enable_side_effects u1 1 - v15899 = array_get v1, index u32 28 - enable_side_effects v15899 - v15900 = array_get v2, index u32 28 - v15901 = cast v15900 as u32 - v15902 = array_set v15898, index v15901, value Field 28 - v15904 = not v15899 - v15905 = array_get v15902, index v15901 - v15906 = array_get v15898, index v15901 - v15907 = cast v15899 as Field - v15908 = cast v15904 as Field - v15909 = mul v15907, v15905 - v15910 = mul v15908, v15906 - v15911 = add v15909, v15910 - v15912 = array_set mut v15902, index v15901, value v15911 - enable_side_effects u1 1 - v15913 = array_get v1, index u32 29 - enable_side_effects v15913 - v15914 = array_get v2, index u32 29 - v15915 = cast v15914 as u32 - v15916 = array_set v15912, index v15915, value Field 29 - v15918 = not v15913 - v15919 = array_get v15916, index v15915 - v15920 = array_get v15912, index v15915 - v15921 = cast v15913 as Field - v15922 = cast v15918 as Field - v15923 = mul v15921, v15919 - v15924 = mul v15922, v15920 - v15925 = add v15923, v15924 - v15926 = array_set mut v15916, index v15915, value v15925 - enable_side_effects u1 1 - v15927 = array_get v1, index u32 30 - enable_side_effects v15927 - v15928 = array_get v2, index u32 30 - v15929 = cast v15928 as u32 - v15930 = array_set v15926, index v15929, value Field 30 - v15932 = not v15927 - v15933 = array_get v15930, index v15929 - v15934 = array_get v15926, index v15929 - v15935 = cast v15927 as Field - v15936 = cast v15932 as Field - v15937 = mul v15935, v15933 - v15938 = mul v15936, v15934 - v15939 = add v15937, v15938 - v15940 = array_set mut v15930, index v15929, value v15939 - enable_side_effects u1 1 - v15941 = array_get v1, index u32 31 - enable_side_effects v15941 - v15942 = array_get v2, index u32 31 - v15943 = cast v15942 as u32 - v15944 = array_set v15940, index v15943, value Field 31 - v15946 = not v15941 - v15947 = array_get v15944, index v15943 - v15948 = array_get v15940, index v15943 - v15949 = cast v15941 as Field - v15950 = cast v15946 as Field - v15951 = mul v15949, v15947 - v15952 = mul v15950, v15948 - v15953 = add v15951, v15952 - v15954 = array_set mut v15944, index v15943, value v15953 - enable_side_effects u1 1 - v15955 = array_get v1, index u32 2⁵ - enable_side_effects v15955 - v15956 = array_get v2, index u32 2⁵ - v15957 = cast v15956 as u32 - v15958 = array_set v15954, index v15957, value Field 2⁵ - v15960 = not v15955 - v15961 = array_get v15958, index v15957 - v15962 = array_get v15954, index v15957 - v15963 = cast v15955 as Field - v15964 = cast v15960 as Field - v15965 = mul v15963, v15961 - v15966 = mul v15964, v15962 - v15967 = add v15965, v15966 - v15968 = array_set mut v15958, index v15957, value v15967 - enable_side_effects u1 1 - v15969 = array_get v1, index u32 33 - enable_side_effects v15969 - v15970 = array_get v2, index u32 33 - v15971 = cast v15970 as u32 - v15972 = array_set v15968, index v15971, value Field 33 - v15974 = not v15969 - v15975 = array_get v15972, index v15971 - v15976 = array_get v15968, index v15971 - v15977 = cast v15969 as Field - v15978 = cast v15974 as Field - v15979 = mul v15977, v15975 - v15980 = mul v15978, v15976 - v15981 = add v15979, v15980 - v15982 = array_set mut v15972, index v15971, value v15981 - enable_side_effects u1 1 - v15983 = array_get v1, index u32 34 - enable_side_effects v15983 - v15984 = array_get v2, index u32 34 - v15985 = cast v15984 as u32 - v15986 = array_set v15982, index v15985, value Field 34 - v15988 = not v15983 - v15989 = array_get v15986, index v15985 - v15990 = array_get v15982, index v15985 - v15991 = cast v15983 as Field - v15992 = cast v15988 as Field - v15993 = mul v15991, v15989 - v15994 = mul v15992, v15990 - v15995 = add v15993, v15994 - v15996 = array_set mut v15986, index v15985, value v15995 - enable_side_effects u1 1 - v15997 = array_get v1, index u32 35 - enable_side_effects v15997 - v15998 = array_get v2, index u32 35 - v15999 = cast v15998 as u32 - v16000 = array_set v15996, index v15999, value Field 35 - v16002 = not v15997 - v16003 = array_get v16000, index v15999 - v16004 = array_get v15996, index v15999 - v16005 = cast v15997 as Field - v16006 = cast v16002 as Field - v16007 = mul v16005, v16003 - v16008 = mul v16006, v16004 - v16009 = add v16007, v16008 - v16010 = array_set mut v16000, index v15999, value v16009 - enable_side_effects u1 1 - v16011 = array_get v1, index u32 36 - enable_side_effects v16011 - v16012 = array_get v2, index u32 36 - v16013 = cast v16012 as u32 - v16014 = array_set v16010, index v16013, value Field 36 - v16016 = not v16011 - v16017 = array_get v16014, index v16013 - v16018 = array_get v16010, index v16013 - v16019 = cast v16011 as Field - v16020 = cast v16016 as Field - v16021 = mul v16019, v16017 - v16022 = mul v16020, v16018 - v16023 = add v16021, v16022 - v16024 = array_set mut v16014, index v16013, value v16023 - enable_side_effects u1 1 - v16025 = array_get v1, index u32 37 - enable_side_effects v16025 - v16026 = array_get v2, index u32 37 - v16027 = cast v16026 as u32 - v16028 = array_set v16024, index v16027, value Field 37 - v16030 = not v16025 - v16031 = array_get v16028, index v16027 - v16032 = array_get v16024, index v16027 - v16033 = cast v16025 as Field - v16034 = cast v16030 as Field - v16035 = mul v16033, v16031 - v16036 = mul v16034, v16032 - v16037 = add v16035, v16036 - v16038 = array_set mut v16028, index v16027, value v16037 - enable_side_effects u1 1 - v16039 = array_get v1, index u32 38 - enable_side_effects v16039 - v16040 = array_get v2, index u32 38 - v16041 = cast v16040 as u32 - v16042 = array_set v16038, index v16041, value Field 38 - v16044 = not v16039 - v16045 = array_get v16042, index v16041 - v16046 = array_get v16038, index v16041 - v16047 = cast v16039 as Field - v16048 = cast v16044 as Field - v16049 = mul v16047, v16045 - v16050 = mul v16048, v16046 - v16051 = add v16049, v16050 - v16052 = array_set mut v16042, index v16041, value v16051 - enable_side_effects u1 1 - v16053 = array_get v1, index u32 39 - enable_side_effects v16053 - v16054 = array_get v2, index u32 39 - v16055 = cast v16054 as u32 - v16056 = array_set v16052, index v16055, value Field 39 - v16058 = not v16053 - v16059 = array_get v16056, index v16055 - v16060 = array_get v16052, index v16055 - v16061 = cast v16053 as Field - v16062 = cast v16058 as Field - v16063 = mul v16061, v16059 - v16064 = mul v16062, v16060 - v16065 = add v16063, v16064 - v16066 = array_set mut v16056, index v16055, value v16065 - enable_side_effects u1 1 - v16067 = array_get v1, index u32 40 - enable_side_effects v16067 - v16068 = array_get v2, index u32 40 - v16069 = cast v16068 as u32 - v16070 = array_set v16066, index v16069, value Field 40 - v16072 = not v16067 - v16073 = array_get v16070, index v16069 - v16074 = array_get v16066, index v16069 - v16075 = cast v16067 as Field - v16076 = cast v16072 as Field - v16077 = mul v16075, v16073 - v16078 = mul v16076, v16074 - v16079 = add v16077, v16078 - v16080 = array_set mut v16070, index v16069, value v16079 - enable_side_effects u1 1 - v16081 = array_get v1, index u32 41 - enable_side_effects v16081 - v16082 = array_get v2, index u32 41 - v16083 = cast v16082 as u32 - v16084 = array_set v16080, index v16083, value Field 41 - v16086 = not v16081 - v16087 = array_get v16084, index v16083 - v16088 = array_get v16080, index v16083 - v16089 = cast v16081 as Field - v16090 = cast v16086 as Field - v16091 = mul v16089, v16087 - v16092 = mul v16090, v16088 - v16093 = add v16091, v16092 - v16094 = array_set mut v16084, index v16083, value v16093 - enable_side_effects u1 1 - v16095 = array_get v1, index u32 42 - enable_side_effects v16095 - v16096 = array_get v2, index u32 42 - v16097 = cast v16096 as u32 - v16098 = array_set v16094, index v16097, value Field 42 - v16100 = not v16095 - v16101 = array_get v16098, index v16097 - v16102 = array_get v16094, index v16097 - v16103 = cast v16095 as Field - v16104 = cast v16100 as Field - v16105 = mul v16103, v16101 - v16106 = mul v16104, v16102 - v16107 = add v16105, v16106 - v16108 = array_set mut v16098, index v16097, value v16107 - enable_side_effects u1 1 - v16109 = array_get v1, index u32 43 - enable_side_effects v16109 - v16110 = array_get v2, index u32 43 - v16111 = cast v16110 as u32 - v16112 = array_set v16108, index v16111, value Field 43 - v16114 = not v16109 - v16115 = array_get v16112, index v16111 - v16116 = array_get v16108, index v16111 - v16117 = cast v16109 as Field - v16118 = cast v16114 as Field - v16119 = mul v16117, v16115 - v16120 = mul v16118, v16116 - v16121 = add v16119, v16120 - v16122 = array_set mut v16112, index v16111, value v16121 - enable_side_effects u1 1 - v16123 = array_get v1, index u32 44 - enable_side_effects v16123 - v16124 = array_get v2, index u32 44 - v16125 = cast v16124 as u32 - v16126 = array_set v16122, index v16125, value Field 44 - v16128 = not v16123 - v16129 = array_get v16126, index v16125 - v16130 = array_get v16122, index v16125 - v16131 = cast v16123 as Field - v16132 = cast v16128 as Field - v16133 = mul v16131, v16129 - v16134 = mul v16132, v16130 - v16135 = add v16133, v16134 - v16136 = array_set mut v16126, index v16125, value v16135 - enable_side_effects u1 1 - v16137 = array_get v1, index u32 45 - enable_side_effects v16137 - v16138 = array_get v2, index u32 45 - v16139 = cast v16138 as u32 - v16140 = array_set v16136, index v16139, value Field 45 - v16142 = not v16137 - v16143 = array_get v16140, index v16139 - v16144 = array_get v16136, index v16139 - v16145 = cast v16137 as Field - v16146 = cast v16142 as Field - v16147 = mul v16145, v16143 - v16148 = mul v16146, v16144 - v16149 = add v16147, v16148 - v16150 = array_set mut v16140, index v16139, value v16149 - enable_side_effects u1 1 - v16151 = array_get v1, index u32 46 - enable_side_effects v16151 - v16152 = array_get v2, index u32 46 - v16153 = cast v16152 as u32 - v16154 = array_set v16150, index v16153, value Field 46 - v16156 = not v16151 - v16157 = array_get v16154, index v16153 - v16158 = array_get v16150, index v16153 - v16159 = cast v16151 as Field - v16160 = cast v16156 as Field - v16161 = mul v16159, v16157 - v16162 = mul v16160, v16158 - v16163 = add v16161, v16162 - v16164 = array_set mut v16154, index v16153, value v16163 - enable_side_effects u1 1 - v16165 = array_get v1, index u32 47 - enable_side_effects v16165 - v16166 = array_get v2, index u32 47 - v16167 = cast v16166 as u32 - v16168 = array_set v16164, index v16167, value Field 47 - v16170 = not v16165 - v16171 = array_get v16168, index v16167 - v16172 = array_get v16164, index v16167 - v16173 = cast v16165 as Field - v16174 = cast v16170 as Field - v16175 = mul v16173, v16171 - v16176 = mul v16174, v16172 - v16177 = add v16175, v16176 - v16178 = array_set mut v16168, index v16167, value v16177 - enable_side_effects u1 1 - v16179 = array_get v1, index u32 2⁴×3 - enable_side_effects v16179 - v16180 = array_get v2, index u32 2⁴×3 - v16181 = cast v16180 as u32 - v16182 = array_set v16178, index v16181, value Field 2⁴×3 - v16184 = not v16179 - v16185 = array_get v16182, index v16181 - v16186 = array_get v16178, index v16181 - v16187 = cast v16179 as Field - v16188 = cast v16184 as Field - v16189 = mul v16187, v16185 - v16190 = mul v16188, v16186 - v16191 = add v16189, v16190 - v16192 = array_set mut v16182, index v16181, value v16191 - enable_side_effects u1 1 - v16193 = array_get v1, index u32 49 - enable_side_effects v16193 - v16194 = array_get v2, index u32 49 - v16195 = cast v16194 as u32 - v16196 = array_set v16192, index v16195, value Field 49 - v16198 = not v16193 - v16199 = array_get v16196, index v16195 - v16200 = array_get v16192, index v16195 - v16201 = cast v16193 as Field - v16202 = cast v16198 as Field - v16203 = mul v16201, v16199 - v16204 = mul v16202, v16200 - v16205 = add v16203, v16204 - v16206 = array_set mut v16196, index v16195, value v16205 - enable_side_effects u1 1 - v16207 = array_get v1, index u32 50 - enable_side_effects v16207 - v16208 = array_get v2, index u32 50 - v16209 = cast v16208 as u32 - v16210 = array_set v16206, index v16209, value Field 50 - v16212 = not v16207 - v16213 = array_get v16210, index v16209 - v16214 = array_get v16206, index v16209 - v16215 = cast v16207 as Field - v16216 = cast v16212 as Field - v16217 = mul v16215, v16213 - v16218 = mul v16216, v16214 - v16219 = add v16217, v16218 - v16220 = array_set mut v16210, index v16209, value v16219 - enable_side_effects u1 1 - v16221 = array_get v1, index u32 51 - enable_side_effects v16221 - v16222 = array_get v2, index u32 51 - v16223 = cast v16222 as u32 - v16224 = array_set v16220, index v16223, value Field 51 - v16226 = not v16221 - v16227 = array_get v16224, index v16223 - v16228 = array_get v16220, index v16223 - v16229 = cast v16221 as Field - v16230 = cast v16226 as Field - v16231 = mul v16229, v16227 - v16232 = mul v16230, v16228 - v16233 = add v16231, v16232 - v16234 = array_set mut v16224, index v16223, value v16233 - enable_side_effects u1 1 - v16235 = array_get v1, index u32 52 - enable_side_effects v16235 - v16236 = array_get v2, index u32 52 - v16237 = cast v16236 as u32 - v16238 = array_set v16234, index v16237, value Field 52 - v16240 = not v16235 - v16241 = array_get v16238, index v16237 - v16242 = array_get v16234, index v16237 - v16243 = cast v16235 as Field - v16244 = cast v16240 as Field - v16245 = mul v16243, v16241 - v16246 = mul v16244, v16242 - v16247 = add v16245, v16246 - v16248 = array_set mut v16238, index v16237, value v16247 - enable_side_effects u1 1 - v16249 = array_get v1, index u32 53 - enable_side_effects v16249 - v16250 = array_get v2, index u32 53 - v16251 = cast v16250 as u32 - v16252 = array_set v16248, index v16251, value Field 53 - v16254 = not v16249 - v16255 = array_get v16252, index v16251 - v16256 = array_get v16248, index v16251 - v16257 = cast v16249 as Field - v16258 = cast v16254 as Field - v16259 = mul v16257, v16255 - v16260 = mul v16258, v16256 - v16261 = add v16259, v16260 - v16262 = array_set mut v16252, index v16251, value v16261 - enable_side_effects u1 1 - v16263 = array_get v1, index u32 54 - enable_side_effects v16263 - v16264 = array_get v2, index u32 54 - v16265 = cast v16264 as u32 - v16266 = array_set v16262, index v16265, value Field 54 - v16268 = not v16263 - v16269 = array_get v16266, index v16265 - v16270 = array_get v16262, index v16265 - v16271 = cast v16263 as Field - v16272 = cast v16268 as Field - v16273 = mul v16271, v16269 - v16274 = mul v16272, v16270 - v16275 = add v16273, v16274 - v16276 = array_set mut v16266, index v16265, value v16275 - enable_side_effects u1 1 - v16277 = array_get v1, index u32 55 - enable_side_effects v16277 - v16278 = array_get v2, index u32 55 - v16279 = cast v16278 as u32 - v16280 = array_set v16276, index v16279, value Field 55 - v16282 = not v16277 - v16283 = array_get v16280, index v16279 - v16284 = array_get v16276, index v16279 - v16285 = cast v16277 as Field - v16286 = cast v16282 as Field - v16287 = mul v16285, v16283 - v16288 = mul v16286, v16284 - v16289 = add v16287, v16288 - v16290 = array_set mut v16280, index v16279, value v16289 - enable_side_effects u1 1 - v16291 = array_get v1, index u32 56 - enable_side_effects v16291 - v16292 = array_get v2, index u32 56 - v16293 = cast v16292 as u32 - v16294 = array_set v16290, index v16293, value Field 56 - v16296 = not v16291 - v16297 = array_get v16294, index v16293 - v16298 = array_get v16290, index v16293 - v16299 = cast v16291 as Field - v16300 = cast v16296 as Field - v16301 = mul v16299, v16297 - v16302 = mul v16300, v16298 - v16303 = add v16301, v16302 - v16304 = array_set mut v16294, index v16293, value v16303 - enable_side_effects u1 1 - v16305 = array_get v1, index u32 57 - enable_side_effects v16305 - v16306 = array_get v2, index u32 57 - v16307 = cast v16306 as u32 - v16308 = array_set v16304, index v16307, value Field 57 - v16310 = not v16305 - v16311 = array_get v16308, index v16307 - v16312 = array_get v16304, index v16307 - v16313 = cast v16305 as Field - v16314 = cast v16310 as Field - v16315 = mul v16313, v16311 - v16316 = mul v16314, v16312 - v16317 = add v16315, v16316 - v16318 = array_set mut v16308, index v16307, value v16317 - enable_side_effects u1 1 - v16319 = array_get v1, index u32 58 - enable_side_effects v16319 - v16320 = array_get v2, index u32 58 - v16321 = cast v16320 as u32 - v16322 = array_set v16318, index v16321, value Field 58 - v16324 = not v16319 - v16325 = array_get v16322, index v16321 - v16326 = array_get v16318, index v16321 - v16327 = cast v16319 as Field - v16328 = cast v16324 as Field - v16329 = mul v16327, v16325 - v16330 = mul v16328, v16326 - v16331 = add v16329, v16330 - v16332 = array_set mut v16322, index v16321, value v16331 - enable_side_effects u1 1 - v16333 = array_get v1, index u32 59 - enable_side_effects v16333 - v16334 = array_get v2, index u32 59 - v16335 = cast v16334 as u32 - v16336 = array_set v16332, index v16335, value Field 59 - v16338 = not v16333 - v16339 = array_get v16336, index v16335 - v16340 = array_get v16332, index v16335 - v16341 = cast v16333 as Field - v16342 = cast v16338 as Field - v16343 = mul v16341, v16339 - v16344 = mul v16342, v16340 - v16345 = add v16343, v16344 - v16346 = array_set mut v16336, index v16335, value v16345 - enable_side_effects u1 1 - v16347 = array_get v1, index u32 60 - enable_side_effects v16347 - v16348 = array_get v2, index u32 60 - v16349 = cast v16348 as u32 - v16350 = array_set v16346, index v16349, value Field 60 - v16352 = not v16347 - v16353 = array_get v16350, index v16349 - v16354 = array_get v16346, index v16349 - v16355 = cast v16347 as Field - v16356 = cast v16352 as Field - v16357 = mul v16355, v16353 - v16358 = mul v16356, v16354 - v16359 = add v16357, v16358 - v16360 = array_set mut v16350, index v16349, value v16359 - enable_side_effects u1 1 - v16361 = array_get v1, index u32 61 - enable_side_effects v16361 - v16362 = array_get v2, index u32 61 - v16363 = cast v16362 as u32 - v16364 = array_set v16360, index v16363, value Field 61 - v16366 = not v16361 - v16367 = array_get v16364, index v16363 - v16368 = array_get v16360, index v16363 - v16369 = cast v16361 as Field - v16370 = cast v16366 as Field - v16371 = mul v16369, v16367 - v16372 = mul v16370, v16368 - v16373 = add v16371, v16372 - v16374 = array_set mut v16364, index v16363, value v16373 - enable_side_effects u1 1 - v16375 = array_get v1, index u32 62 - enable_side_effects v16375 - v16376 = array_get v2, index u32 62 - v16377 = cast v16376 as u32 - v16378 = array_set v16374, index v16377, value Field 62 - v16380 = not v16375 - v16381 = array_get v16378, index v16377 - v16382 = array_get v16374, index v16377 - v16383 = cast v16375 as Field - v16384 = cast v16380 as Field - v16385 = mul v16383, v16381 - v16386 = mul v16384, v16382 - v16387 = add v16385, v16386 - v16388 = array_set mut v16378, index v16377, value v16387 - enable_side_effects u1 1 - v16389 = array_get v1, index u32 63 - enable_side_effects v16389 - v16390 = array_get v2, index u32 63 - v16391 = cast v16390 as u32 - v16392 = array_set v16388, index v16391, value Field 63 - v16394 = not v16389 - v16395 = array_get v16392, index v16391 - v16396 = array_get v16388, index v16391 - v16397 = cast v16389 as Field - v16398 = cast v16394 as Field - v16399 = mul v16397, v16395 - v16400 = mul v16398, v16396 - v16401 = add v16399, v16400 - v16402 = array_set mut v16392, index v16391, value v16401 - enable_side_effects u1 1 - v16403 = array_get v1, index u32 2⁶ - enable_side_effects v16403 - v16404 = array_get v2, index u32 2⁶ - v16405 = cast v16404 as u32 - v16406 = array_set v16402, index v16405, value Field 2⁶ - v16408 = not v16403 - v16409 = array_get v16406, index v16405 - v16410 = array_get v16402, index v16405 - v16411 = cast v16403 as Field - v16412 = cast v16408 as Field - v16413 = mul v16411, v16409 - v16414 = mul v16412, v16410 - v16415 = add v16413, v16414 - v16416 = array_set mut v16406, index v16405, value v16415 - enable_side_effects u1 1 - v16417 = array_get v1, index u32 65 - enable_side_effects v16417 - v16418 = array_get v2, index u32 65 - v16419 = cast v16418 as u32 - v16420 = array_set v16416, index v16419, value Field 65 - v16422 = not v16417 - v16423 = array_get v16420, index v16419 - v16424 = array_get v16416, index v16419 - v16425 = cast v16417 as Field - v16426 = cast v16422 as Field - v16427 = mul v16425, v16423 - v16428 = mul v16426, v16424 - v16429 = add v16427, v16428 - v16430 = array_set mut v16420, index v16419, value v16429 - enable_side_effects u1 1 - v16431 = array_get v1, index u32 66 - enable_side_effects v16431 - v16432 = array_get v2, index u32 66 - v16433 = cast v16432 as u32 - v16434 = array_set v16430, index v16433, value Field 66 - v16436 = not v16431 - v16437 = array_get v16434, index v16433 - v16438 = array_get v16430, index v16433 - v16439 = cast v16431 as Field - v16440 = cast v16436 as Field - v16441 = mul v16439, v16437 - v16442 = mul v16440, v16438 - v16443 = add v16441, v16442 - v16444 = array_set mut v16434, index v16433, value v16443 - enable_side_effects u1 1 - v16445 = array_get v1, index u32 67 - enable_side_effects v16445 - v16446 = array_get v2, index u32 67 - v16447 = cast v16446 as u32 - v16448 = array_set v16444, index v16447, value Field 67 - v16450 = not v16445 - v16451 = array_get v16448, index v16447 - v16452 = array_get v16444, index v16447 - v16453 = cast v16445 as Field - v16454 = cast v16450 as Field - v16455 = mul v16453, v16451 - v16456 = mul v16454, v16452 - v16457 = add v16455, v16456 - v16458 = array_set mut v16448, index v16447, value v16457 - enable_side_effects u1 1 - v16459 = array_get v1, index u32 68 - enable_side_effects v16459 - v16460 = array_get v2, index u32 68 - v16461 = cast v16460 as u32 - v16462 = array_set v16458, index v16461, value Field 68 - v16464 = not v16459 - v16465 = array_get v16462, index v16461 - v16466 = array_get v16458, index v16461 - v16467 = cast v16459 as Field - v16468 = cast v16464 as Field - v16469 = mul v16467, v16465 - v16470 = mul v16468, v16466 - v16471 = add v16469, v16470 - v16472 = array_set mut v16462, index v16461, value v16471 - enable_side_effects u1 1 - v16473 = array_get v1, index u32 69 - enable_side_effects v16473 - v16474 = array_get v2, index u32 69 - v16475 = cast v16474 as u32 - v16476 = array_set v16472, index v16475, value Field 69 - v16478 = not v16473 - v16479 = array_get v16476, index v16475 - v16480 = array_get v16472, index v16475 - v16481 = cast v16473 as Field - v16482 = cast v16478 as Field - v16483 = mul v16481, v16479 - v16484 = mul v16482, v16480 - v16485 = add v16483, v16484 - v16486 = array_set mut v16476, index v16475, value v16485 - enable_side_effects u1 1 - v16487 = array_get v1, index u32 70 - enable_side_effects v16487 - v16488 = array_get v2, index u32 70 - v16489 = cast v16488 as u32 - v16490 = array_set v16486, index v16489, value Field 70 - v16492 = not v16487 - v16493 = array_get v16490, index v16489 - v16494 = array_get v16486, index v16489 - v16495 = cast v16487 as Field - v16496 = cast v16492 as Field - v16497 = mul v16495, v16493 - v16498 = mul v16496, v16494 - v16499 = add v16497, v16498 - v16500 = array_set mut v16490, index v16489, value v16499 - enable_side_effects u1 1 - v16501 = array_get v1, index u32 71 - enable_side_effects v16501 - v16502 = array_get v2, index u32 71 - v16503 = cast v16502 as u32 - v16504 = array_set v16500, index v16503, value Field 71 - v16506 = not v16501 - v16507 = array_get v16504, index v16503 - v16508 = array_get v16500, index v16503 - v16509 = cast v16501 as Field - v16510 = cast v16506 as Field - v16511 = mul v16509, v16507 - v16512 = mul v16510, v16508 - v16513 = add v16511, v16512 - v16514 = array_set mut v16504, index v16503, value v16513 - enable_side_effects u1 1 - v16515 = array_get v1, index u32 72 - enable_side_effects v16515 - v16516 = array_get v2, index u32 72 - v16517 = cast v16516 as u32 - v16518 = array_set v16514, index v16517, value Field 72 - v16520 = not v16515 - v16521 = array_get v16518, index v16517 - v16522 = array_get v16514, index v16517 - v16523 = cast v16515 as Field - v16524 = cast v16520 as Field - v16525 = mul v16523, v16521 - v16526 = mul v16524, v16522 - v16527 = add v16525, v16526 - v16528 = array_set mut v16518, index v16517, value v16527 - enable_side_effects u1 1 - v16529 = array_get v1, index u32 73 - enable_side_effects v16529 - v16530 = array_get v2, index u32 73 - v16531 = cast v16530 as u32 - v16532 = array_set v16528, index v16531, value Field 73 - v16534 = not v16529 - v16535 = array_get v16532, index v16531 - v16536 = array_get v16528, index v16531 - v16537 = cast v16529 as Field - v16538 = cast v16534 as Field - v16539 = mul v16537, v16535 - v16540 = mul v16538, v16536 - v16541 = add v16539, v16540 - v16542 = array_set mut v16532, index v16531, value v16541 - enable_side_effects u1 1 - v16543 = array_get v1, index u32 74 - enable_side_effects v16543 - v16544 = array_get v2, index u32 74 - v16545 = cast v16544 as u32 - v16546 = array_set v16542, index v16545, value Field 74 - v16548 = not v16543 - v16549 = array_get v16546, index v16545 - v16550 = array_get v16542, index v16545 - v16551 = cast v16543 as Field - v16552 = cast v16548 as Field - v16553 = mul v16551, v16549 - v16554 = mul v16552, v16550 - v16555 = add v16553, v16554 - v16556 = array_set mut v16546, index v16545, value v16555 - enable_side_effects u1 1 - v16557 = array_get v1, index u32 75 - enable_side_effects v16557 - v16558 = array_get v2, index u32 75 - v16559 = cast v16558 as u32 - v16560 = array_set v16556, index v16559, value Field 75 - v16562 = not v16557 - v16563 = array_get v16560, index v16559 - v16564 = array_get v16556, index v16559 - v16565 = cast v16557 as Field - v16566 = cast v16562 as Field - v16567 = mul v16565, v16563 - v16568 = mul v16566, v16564 - v16569 = add v16567, v16568 - v16570 = array_set mut v16560, index v16559, value v16569 - enable_side_effects u1 1 - v16571 = array_get v1, index u32 76 - enable_side_effects v16571 - v16572 = array_get v2, index u32 76 - v16573 = cast v16572 as u32 - v16574 = array_set v16570, index v16573, value Field 76 - v16576 = not v16571 - v16577 = array_get v16574, index v16573 - v16578 = array_get v16570, index v16573 - v16579 = cast v16571 as Field - v16580 = cast v16576 as Field - v16581 = mul v16579, v16577 - v16582 = mul v16580, v16578 - v16583 = add v16581, v16582 - v16584 = array_set mut v16574, index v16573, value v16583 - enable_side_effects u1 1 - v16585 = array_get v1, index u32 77 - enable_side_effects v16585 - v16586 = array_get v2, index u32 77 - v16587 = cast v16586 as u32 - v16588 = array_set v16584, index v16587, value Field 77 - v16590 = not v16585 - v16591 = array_get v16588, index v16587 - v16592 = array_get v16584, index v16587 - v16593 = cast v16585 as Field - v16594 = cast v16590 as Field - v16595 = mul v16593, v16591 - v16596 = mul v16594, v16592 - v16597 = add v16595, v16596 - v16598 = array_set mut v16588, index v16587, value v16597 - enable_side_effects u1 1 - v16599 = array_get v1, index u32 78 - enable_side_effects v16599 - v16600 = array_get v2, index u32 78 - v16601 = cast v16600 as u32 - v16602 = array_set v16598, index v16601, value Field 78 - v16604 = not v16599 - v16605 = array_get v16602, index v16601 - v16606 = array_get v16598, index v16601 - v16607 = cast v16599 as Field - v16608 = cast v16604 as Field - v16609 = mul v16607, v16605 - v16610 = mul v16608, v16606 - v16611 = add v16609, v16610 - v16612 = array_set mut v16602, index v16601, value v16611 - enable_side_effects u1 1 - v16613 = array_get v1, index u32 79 - enable_side_effects v16613 - v16614 = array_get v2, index u32 79 - v16615 = cast v16614 as u32 - v16616 = array_set v16612, index v16615, value Field 79 - v16618 = not v16613 - v16619 = array_get v16616, index v16615 - v16620 = array_get v16612, index v16615 - v16621 = cast v16613 as Field - v16622 = cast v16618 as Field - v16623 = mul v16621, v16619 - v16624 = mul v16622, v16620 - v16625 = add v16623, v16624 - v16626 = array_set mut v16616, index v16615, value v16625 - enable_side_effects u1 1 - v16627 = array_get v1, index u32 2⁴×5 - enable_side_effects v16627 - v16628 = array_get v2, index u32 2⁴×5 - v16629 = cast v16628 as u32 - v16630 = array_set v16626, index v16629, value Field 2⁴×5 - v16632 = not v16627 - v16633 = array_get v16630, index v16629 - v16634 = array_get v16626, index v16629 - v16635 = cast v16627 as Field - v16636 = cast v16632 as Field - v16637 = mul v16635, v16633 - v16638 = mul v16636, v16634 - v16639 = add v16637, v16638 - v16640 = array_set mut v16630, index v16629, value v16639 - enable_side_effects u1 1 - v16641 = array_get v1, index u32 81 - enable_side_effects v16641 - v16642 = array_get v2, index u32 81 - v16643 = cast v16642 as u32 - v16644 = array_set v16640, index v16643, value Field 81 - v16646 = not v16641 - v16647 = array_get v16644, index v16643 - v16648 = array_get v16640, index v16643 - v16649 = cast v16641 as Field - v16650 = cast v16646 as Field - v16651 = mul v16649, v16647 - v16652 = mul v16650, v16648 - v16653 = add v16651, v16652 - v16654 = array_set mut v16644, index v16643, value v16653 - enable_side_effects u1 1 - v16655 = array_get v1, index u32 82 - enable_side_effects v16655 - v16656 = array_get v2, index u32 82 - v16657 = cast v16656 as u32 - v16658 = array_set v16654, index v16657, value Field 82 - v16660 = not v16655 - v16661 = array_get v16658, index v16657 - v16662 = array_get v16654, index v16657 - v16663 = cast v16655 as Field - v16664 = cast v16660 as Field - v16665 = mul v16663, v16661 - v16666 = mul v16664, v16662 - v16667 = add v16665, v16666 - v16668 = array_set mut v16658, index v16657, value v16667 - enable_side_effects u1 1 - v16669 = array_get v1, index u32 83 - enable_side_effects v16669 - v16670 = array_get v2, index u32 83 - v16671 = cast v16670 as u32 - v16672 = array_set v16668, index v16671, value Field 83 - v16674 = not v16669 - v16675 = array_get v16672, index v16671 - v16676 = array_get v16668, index v16671 - v16677 = cast v16669 as Field - v16678 = cast v16674 as Field - v16679 = mul v16677, v16675 - v16680 = mul v16678, v16676 - v16681 = add v16679, v16680 - v16682 = array_set mut v16672, index v16671, value v16681 - enable_side_effects u1 1 - v16683 = array_get v1, index u32 84 - enable_side_effects v16683 - v16684 = array_get v2, index u32 84 - v16685 = cast v16684 as u32 - v16686 = array_set v16682, index v16685, value Field 84 - v16688 = not v16683 - v16689 = array_get v16686, index v16685 - v16690 = array_get v16682, index v16685 - v16691 = cast v16683 as Field - v16692 = cast v16688 as Field - v16693 = mul v16691, v16689 - v16694 = mul v16692, v16690 - v16695 = add v16693, v16694 - v16696 = array_set mut v16686, index v16685, value v16695 - enable_side_effects u1 1 - v16697 = array_get v1, index u32 85 - enable_side_effects v16697 - v16698 = array_get v2, index u32 85 - v16699 = cast v16698 as u32 - v16700 = array_set v16696, index v16699, value Field 85 - v16702 = not v16697 - v16703 = array_get v16700, index v16699 - v16704 = array_get v16696, index v16699 - v16705 = cast v16697 as Field - v16706 = cast v16702 as Field - v16707 = mul v16705, v16703 - v16708 = mul v16706, v16704 - v16709 = add v16707, v16708 - v16710 = array_set mut v16700, index v16699, value v16709 - enable_side_effects u1 1 - v16711 = array_get v1, index u32 86 - enable_side_effects v16711 - v16712 = array_get v2, index u32 86 - v16713 = cast v16712 as u32 - v16714 = array_set v16710, index v16713, value Field 86 - v16716 = not v16711 - v16717 = array_get v16714, index v16713 - v16718 = array_get v16710, index v16713 - v16719 = cast v16711 as Field - v16720 = cast v16716 as Field - v16721 = mul v16719, v16717 - v16722 = mul v16720, v16718 - v16723 = add v16721, v16722 - v16724 = array_set mut v16714, index v16713, value v16723 - enable_side_effects u1 1 - v16725 = array_get v1, index u32 87 - enable_side_effects v16725 - v16726 = array_get v2, index u32 87 - v16727 = cast v16726 as u32 - v16728 = array_set v16724, index v16727, value Field 87 - v16730 = not v16725 - v16731 = array_get v16728, index v16727 - v16732 = array_get v16724, index v16727 - v16733 = cast v16725 as Field - v16734 = cast v16730 as Field - v16735 = mul v16733, v16731 - v16736 = mul v16734, v16732 - v16737 = add v16735, v16736 - v16738 = array_set mut v16728, index v16727, value v16737 - enable_side_effects u1 1 - v16739 = array_get v1, index u32 88 - enable_side_effects v16739 - v16740 = array_get v2, index u32 88 - v16741 = cast v16740 as u32 - v16742 = array_set v16738, index v16741, value Field 88 - v16744 = not v16739 - v16745 = array_get v16742, index v16741 - v16746 = array_get v16738, index v16741 - v16747 = cast v16739 as Field - v16748 = cast v16744 as Field - v16749 = mul v16747, v16745 - v16750 = mul v16748, v16746 - v16751 = add v16749, v16750 - v16752 = array_set mut v16742, index v16741, value v16751 - enable_side_effects u1 1 - v16753 = array_get v1, index u32 89 - enable_side_effects v16753 - v16754 = array_get v2, index u32 89 - v16755 = cast v16754 as u32 - v16756 = array_set v16752, index v16755, value Field 89 - v16758 = not v16753 - v16759 = array_get v16756, index v16755 - v16760 = array_get v16752, index v16755 - v16761 = cast v16753 as Field - v16762 = cast v16758 as Field - v16763 = mul v16761, v16759 - v16764 = mul v16762, v16760 - v16765 = add v16763, v16764 - v16766 = array_set mut v16756, index v16755, value v16765 - enable_side_effects u1 1 - v16767 = array_get v1, index u32 90 - enable_side_effects v16767 - v16768 = array_get v2, index u32 90 - v16769 = cast v16768 as u32 - v16770 = array_set v16766, index v16769, value Field 90 - v16772 = not v16767 - v16773 = array_get v16770, index v16769 - v16774 = array_get v16766, index v16769 - v16775 = cast v16767 as Field - v16776 = cast v16772 as Field - v16777 = mul v16775, v16773 - v16778 = mul v16776, v16774 - v16779 = add v16777, v16778 - v16780 = array_set mut v16770, index v16769, value v16779 - enable_side_effects u1 1 - v16781 = array_get v1, index u32 91 - enable_side_effects v16781 - v16782 = array_get v2, index u32 91 - v16783 = cast v16782 as u32 - v16784 = array_set v16780, index v16783, value Field 91 - v16786 = not v16781 - v16787 = array_get v16784, index v16783 - v16788 = array_get v16780, index v16783 - v16789 = cast v16781 as Field - v16790 = cast v16786 as Field - v16791 = mul v16789, v16787 - v16792 = mul v16790, v16788 - v16793 = add v16791, v16792 - v16794 = array_set mut v16784, index v16783, value v16793 - enable_side_effects u1 1 - v16795 = array_get v1, index u32 92 - enable_side_effects v16795 - v16796 = array_get v2, index u32 92 - v16797 = cast v16796 as u32 - v16798 = array_set v16794, index v16797, value Field 92 - v16800 = not v16795 - v16801 = array_get v16798, index v16797 - v16802 = array_get v16794, index v16797 - v16803 = cast v16795 as Field - v16804 = cast v16800 as Field - v16805 = mul v16803, v16801 - v16806 = mul v16804, v16802 - v16807 = add v16805, v16806 - v16808 = array_set mut v16798, index v16797, value v16807 - enable_side_effects u1 1 - v16809 = array_get v1, index u32 93 - enable_side_effects v16809 - v16810 = array_get v2, index u32 93 - v16811 = cast v16810 as u32 - v16812 = array_set v16808, index v16811, value Field 93 - v16814 = not v16809 - v16815 = array_get v16812, index v16811 - v16816 = array_get v16808, index v16811 - v16817 = cast v16809 as Field - v16818 = cast v16814 as Field - v16819 = mul v16817, v16815 - v16820 = mul v16818, v16816 - v16821 = add v16819, v16820 - v16822 = array_set mut v16812, index v16811, value v16821 - enable_side_effects u1 1 - v16823 = array_get v1, index u32 94 - enable_side_effects v16823 - v16824 = array_get v2, index u32 94 - v16825 = cast v16824 as u32 - v16826 = array_set v16822, index v16825, value Field 94 - v16828 = not v16823 - v16829 = array_get v16826, index v16825 - v16830 = array_get v16822, index v16825 - v16831 = cast v16823 as Field - v16832 = cast v16828 as Field - v16833 = mul v16831, v16829 - v16834 = mul v16832, v16830 - v16835 = add v16833, v16834 - v16836 = array_set mut v16826, index v16825, value v16835 - enable_side_effects u1 1 - v16837 = array_get v1, index u32 95 - enable_side_effects v16837 - v16838 = array_get v2, index u32 95 - v16839 = cast v16838 as u32 - v16840 = array_set v16836, index v16839, value Field 95 - v16842 = not v16837 - v16843 = array_get v16840, index v16839 - v16844 = array_get v16836, index v16839 - v16845 = cast v16837 as Field - v16846 = cast v16842 as Field - v16847 = mul v16845, v16843 - v16848 = mul v16846, v16844 - v16849 = add v16847, v16848 - v16850 = array_set mut v16840, index v16839, value v16849 - enable_side_effects u1 1 - v16851 = array_get v1, index u32 2⁴×6 - enable_side_effects v16851 - v16852 = array_get v2, index u32 2⁴×6 - v16853 = cast v16852 as u32 - v16854 = array_set v16850, index v16853, value Field 2⁴×6 - v16856 = not v16851 - v16857 = array_get v16854, index v16853 - v16858 = array_get v16850, index v16853 - v16859 = cast v16851 as Field - v16860 = cast v16856 as Field - v16861 = mul v16859, v16857 - v16862 = mul v16860, v16858 - v16863 = add v16861, v16862 - v16864 = array_set mut v16854, index v16853, value v16863 - enable_side_effects u1 1 - v16865 = array_get v1, index u32 97 - enable_side_effects v16865 - v16866 = array_get v2, index u32 97 - v16867 = cast v16866 as u32 - v16868 = array_set v16864, index v16867, value Field 97 - v16870 = not v16865 - v16871 = array_get v16868, index v16867 - v16872 = array_get v16864, index v16867 - v16873 = cast v16865 as Field - v16874 = cast v16870 as Field - v16875 = mul v16873, v16871 - v16876 = mul v16874, v16872 - v16877 = add v16875, v16876 - v16878 = array_set mut v16868, index v16867, value v16877 - enable_side_effects u1 1 - v16879 = array_get v1, index u32 98 - enable_side_effects v16879 - v16880 = array_get v2, index u32 98 - v16881 = cast v16880 as u32 - v16882 = array_set v16878, index v16881, value Field 98 - v16884 = not v16879 - v16885 = array_get v16882, index v16881 - v16886 = array_get v16878, index v16881 - v16887 = cast v16879 as Field - v16888 = cast v16884 as Field - v16889 = mul v16887, v16885 - v16890 = mul v16888, v16886 - v16891 = add v16889, v16890 - v16892 = array_set mut v16882, index v16881, value v16891 - enable_side_effects u1 1 - v16893 = array_get v1, index u32 99 - enable_side_effects v16893 - v16894 = array_get v2, index u32 99 - v16895 = cast v16894 as u32 - v16896 = array_set v16892, index v16895, value Field 99 - v16898 = not v16893 - v16899 = array_get v16896, index v16895 - v16900 = array_get v16892, index v16895 - v16901 = cast v16893 as Field - v16902 = cast v16898 as Field - v16903 = mul v16901, v16899 - v16904 = mul v16902, v16900 - v16905 = add v16903, v16904 - v16906 = array_set mut v16896, index v16895, value v16905 - enable_side_effects u1 1 - v16907 = array_get v1, index u32 100 - enable_side_effects v16907 - v16908 = array_get v2, index u32 100 - v16909 = cast v16908 as u32 - v16910 = array_set v16906, index v16909, value Field 100 - v16912 = not v16907 - v16913 = array_get v16910, index v16909 - v16914 = array_get v16906, index v16909 - v16915 = cast v16907 as Field - v16916 = cast v16912 as Field - v16917 = mul v16915, v16913 - v16918 = mul v16916, v16914 - v16919 = add v16917, v16918 - v16920 = array_set mut v16910, index v16909, value v16919 - enable_side_effects u1 1 - v16921 = array_get v1, index u32 101 - enable_side_effects v16921 - v16922 = array_get v2, index u32 101 - v16923 = cast v16922 as u32 - v16924 = array_set v16920, index v16923, value Field 101 - v16926 = not v16921 - v16927 = array_get v16924, index v16923 - v16928 = array_get v16920, index v16923 - v16929 = cast v16921 as Field - v16930 = cast v16926 as Field - v16931 = mul v16929, v16927 - v16932 = mul v16930, v16928 - v16933 = add v16931, v16932 - v16934 = array_set mut v16924, index v16923, value v16933 - enable_side_effects u1 1 - v16935 = array_get v1, index u32 102 - enable_side_effects v16935 - v16936 = array_get v2, index u32 102 - v16937 = cast v16936 as u32 - v16938 = array_set v16934, index v16937, value Field 102 - v16940 = not v16935 - v16941 = array_get v16938, index v16937 - v16942 = array_get v16934, index v16937 - v16943 = cast v16935 as Field - v16944 = cast v16940 as Field - v16945 = mul v16943, v16941 - v16946 = mul v16944, v16942 - v16947 = add v16945, v16946 - v16948 = array_set mut v16938, index v16937, value v16947 - enable_side_effects u1 1 - v16949 = array_get v1, index u32 103 - enable_side_effects v16949 - v16950 = array_get v2, index u32 103 - v16951 = cast v16950 as u32 - v16952 = array_set v16948, index v16951, value Field 103 - v16954 = not v16949 - v16955 = array_get v16952, index v16951 - v16956 = array_get v16948, index v16951 - v16957 = cast v16949 as Field - v16958 = cast v16954 as Field - v16959 = mul v16957, v16955 - v16960 = mul v16958, v16956 - v16961 = add v16959, v16960 - v16962 = array_set mut v16952, index v16951, value v16961 - enable_side_effects u1 1 - v16963 = array_get v1, index u32 104 - enable_side_effects v16963 - v16964 = array_get v2, index u32 104 - v16965 = cast v16964 as u32 - v16966 = array_set v16962, index v16965, value Field 104 - v16968 = not v16963 - v16969 = array_get v16966, index v16965 - v16970 = array_get v16962, index v16965 - v16971 = cast v16963 as Field - v16972 = cast v16968 as Field - v16973 = mul v16971, v16969 - v16974 = mul v16972, v16970 - v16975 = add v16973, v16974 - v16976 = array_set mut v16966, index v16965, value v16975 - enable_side_effects u1 1 - v16977 = array_get v1, index u32 105 - enable_side_effects v16977 - v16978 = array_get v2, index u32 105 - v16979 = cast v16978 as u32 - v16980 = array_set v16976, index v16979, value Field 105 - v16982 = not v16977 - v16983 = array_get v16980, index v16979 - v16984 = array_get v16976, index v16979 - v16985 = cast v16977 as Field - v16986 = cast v16982 as Field - v16987 = mul v16985, v16983 - v16988 = mul v16986, v16984 - v16989 = add v16987, v16988 - v16990 = array_set mut v16980, index v16979, value v16989 - enable_side_effects u1 1 - v16991 = array_get v1, index u32 106 - enable_side_effects v16991 - v16992 = array_get v2, index u32 106 - v16993 = cast v16992 as u32 - v16994 = array_set v16990, index v16993, value Field 106 - v16996 = not v16991 - v16997 = array_get v16994, index v16993 - v16998 = array_get v16990, index v16993 - v16999 = cast v16991 as Field - v17000 = cast v16996 as Field - v17001 = mul v16999, v16997 - v17002 = mul v17000, v16998 - v17003 = add v17001, v17002 - v17004 = array_set mut v16994, index v16993, value v17003 - enable_side_effects u1 1 - v17005 = array_get v1, index u32 107 - enable_side_effects v17005 - v17006 = array_get v2, index u32 107 - v17007 = cast v17006 as u32 - v17008 = array_set v17004, index v17007, value Field 107 - v17010 = not v17005 - v17011 = array_get v17008, index v17007 - v17012 = array_get v17004, index v17007 - v17013 = cast v17005 as Field - v17014 = cast v17010 as Field - v17015 = mul v17013, v17011 - v17016 = mul v17014, v17012 - v17017 = add v17015, v17016 - v17018 = array_set mut v17008, index v17007, value v17017 - enable_side_effects u1 1 - v17019 = array_get v1, index u32 108 - enable_side_effects v17019 - v17020 = array_get v2, index u32 108 - v17021 = cast v17020 as u32 - v17022 = array_set v17018, index v17021, value Field 108 - v17024 = not v17019 - v17025 = array_get v17022, index v17021 - v17026 = array_get v17018, index v17021 - v17027 = cast v17019 as Field - v17028 = cast v17024 as Field - v17029 = mul v17027, v17025 - v17030 = mul v17028, v17026 - v17031 = add v17029, v17030 - v17032 = array_set mut v17022, index v17021, value v17031 - enable_side_effects u1 1 - v17033 = array_get v1, index u32 109 - enable_side_effects v17033 - v17034 = array_get v2, index u32 109 - v17035 = cast v17034 as u32 - v17036 = array_set v17032, index v17035, value Field 109 - v17038 = not v17033 - v17039 = array_get v17036, index v17035 - v17040 = array_get v17032, index v17035 - v17041 = cast v17033 as Field - v17042 = cast v17038 as Field - v17043 = mul v17041, v17039 - v17044 = mul v17042, v17040 - v17045 = add v17043, v17044 - v17046 = array_set mut v17036, index v17035, value v17045 - enable_side_effects u1 1 - v17047 = array_get v1, index u32 110 - enable_side_effects v17047 - v17048 = array_get v2, index u32 110 - v17049 = cast v17048 as u32 - v17050 = array_set v17046, index v17049, value Field 110 - v17052 = not v17047 - v17053 = array_get v17050, index v17049 - v17054 = array_get v17046, index v17049 - v17055 = cast v17047 as Field - v17056 = cast v17052 as Field - v17057 = mul v17055, v17053 - v17058 = mul v17056, v17054 - v17059 = add v17057, v17058 - v17060 = array_set mut v17050, index v17049, value v17059 - enable_side_effects u1 1 - v17061 = array_get v1, index u32 111 - enable_side_effects v17061 - v17062 = array_get v2, index u32 111 - v17063 = cast v17062 as u32 - v17064 = array_set v17060, index v17063, value Field 111 - v17066 = not v17061 - v17067 = array_get v17064, index v17063 - v17068 = array_get v17060, index v17063 - v17069 = cast v17061 as Field - v17070 = cast v17066 as Field - v17071 = mul v17069, v17067 - v17072 = mul v17070, v17068 - v17073 = add v17071, v17072 - v17074 = array_set mut v17064, index v17063, value v17073 - enable_side_effects u1 1 - v17075 = array_get v1, index u32 2⁴×7 - enable_side_effects v17075 - v17076 = array_get v2, index u32 2⁴×7 - v17077 = cast v17076 as u32 - v17078 = array_set v17074, index v17077, value Field 2⁴×7 - v17080 = not v17075 - v17081 = array_get v17078, index v17077 - v17082 = array_get v17074, index v17077 - v17083 = cast v17075 as Field - v17084 = cast v17080 as Field - v17085 = mul v17083, v17081 - v17086 = mul v17084, v17082 - v17087 = add v17085, v17086 - v17088 = array_set mut v17078, index v17077, value v17087 - enable_side_effects u1 1 - v17089 = array_get v1, index u32 113 - enable_side_effects v17089 - v17090 = array_get v2, index u32 113 - v17091 = cast v17090 as u32 - v17092 = array_set v17088, index v17091, value Field 113 - v17094 = not v17089 - v17095 = array_get v17092, index v17091 - v17096 = array_get v17088, index v17091 - v17097 = cast v17089 as Field - v17098 = cast v17094 as Field - v17099 = mul v17097, v17095 - v17100 = mul v17098, v17096 - v17101 = add v17099, v17100 - v17102 = array_set mut v17092, index v17091, value v17101 - enable_side_effects u1 1 - v17103 = array_get v1, index u32 114 - enable_side_effects v17103 - v17104 = array_get v2, index u32 114 - v17105 = cast v17104 as u32 - v17106 = array_set v17102, index v17105, value Field 114 - v17108 = not v17103 - v17109 = array_get v17106, index v17105 - v17110 = array_get v17102, index v17105 - v17111 = cast v17103 as Field - v17112 = cast v17108 as Field - v17113 = mul v17111, v17109 - v17114 = mul v17112, v17110 - v17115 = add v17113, v17114 - v17116 = array_set mut v17106, index v17105, value v17115 - enable_side_effects u1 1 - v17117 = array_get v1, index u32 115 - enable_side_effects v17117 - v17118 = array_get v2, index u32 115 - v17119 = cast v17118 as u32 - v17120 = array_set v17116, index v17119, value Field 115 - v17122 = not v17117 - v17123 = array_get v17120, index v17119 - v17124 = array_get v17116, index v17119 - v17125 = cast v17117 as Field - v17126 = cast v17122 as Field - v17127 = mul v17125, v17123 - v17128 = mul v17126, v17124 - v17129 = add v17127, v17128 - v17130 = array_set mut v17120, index v17119, value v17129 - enable_side_effects u1 1 - v17131 = array_get v1, index u32 116 - enable_side_effects v17131 - v17132 = array_get v2, index u32 116 - v17133 = cast v17132 as u32 - v17134 = array_set v17130, index v17133, value Field 116 - v17136 = not v17131 - v17137 = array_get v17134, index v17133 - v17138 = array_get v17130, index v17133 - v17139 = cast v17131 as Field - v17140 = cast v17136 as Field - v17141 = mul v17139, v17137 - v17142 = mul v17140, v17138 - v17143 = add v17141, v17142 - v17144 = array_set mut v17134, index v17133, value v17143 - enable_side_effects u1 1 - v17145 = array_get v1, index u32 117 - enable_side_effects v17145 - v17146 = array_get v2, index u32 117 - v17147 = cast v17146 as u32 - v17148 = array_set v17144, index v17147, value Field 117 - v17150 = not v17145 - v17151 = array_get v17148, index v17147 - v17152 = array_get v17144, index v17147 - v17153 = cast v17145 as Field - v17154 = cast v17150 as Field - v17155 = mul v17153, v17151 - v17156 = mul v17154, v17152 - v17157 = add v17155, v17156 - v17158 = array_set mut v17148, index v17147, value v17157 - enable_side_effects u1 1 - v17159 = array_get v1, index u32 118 - enable_side_effects v17159 - v17160 = array_get v2, index u32 118 - v17161 = cast v17160 as u32 - v17162 = array_set v17158, index v17161, value Field 118 - v17164 = not v17159 - v17165 = array_get v17162, index v17161 - v17166 = array_get v17158, index v17161 - v17167 = cast v17159 as Field - v17168 = cast v17164 as Field - v17169 = mul v17167, v17165 - v17170 = mul v17168, v17166 - v17171 = add v17169, v17170 - v17172 = array_set mut v17162, index v17161, value v17171 - enable_side_effects u1 1 - v17173 = array_get v1, index u32 119 - enable_side_effects v17173 - v17174 = array_get v2, index u32 119 - v17175 = cast v17174 as u32 - v17176 = array_set v17172, index v17175, value Field 119 - v17178 = not v17173 - v17179 = array_get v17176, index v17175 - v17180 = array_get v17172, index v17175 - v17181 = cast v17173 as Field - v17182 = cast v17178 as Field - v17183 = mul v17181, v17179 - v17184 = mul v17182, v17180 - v17185 = add v17183, v17184 - v17186 = array_set mut v17176, index v17175, value v17185 - enable_side_effects u1 1 - v17187 = array_get v1, index u32 120 - enable_side_effects v17187 - v17188 = array_get v2, index u32 120 - v17189 = cast v17188 as u32 - v17190 = array_set v17186, index v17189, value Field 120 - v17192 = not v17187 - v17193 = array_get v17190, index v17189 - v17194 = array_get v17186, index v17189 - v17195 = cast v17187 as Field - v17196 = cast v17192 as Field - v17197 = mul v17195, v17193 - v17198 = mul v17196, v17194 - v17199 = add v17197, v17198 - v17200 = array_set mut v17190, index v17189, value v17199 - enable_side_effects u1 1 - v17201 = array_get v1, index u32 121 - enable_side_effects v17201 - v17202 = array_get v2, index u32 121 - v17203 = cast v17202 as u32 - v17204 = array_set v17200, index v17203, value Field 121 - v17206 = not v17201 - v17207 = array_get v17204, index v17203 - v17208 = array_get v17200, index v17203 - v17209 = cast v17201 as Field - v17210 = cast v17206 as Field - v17211 = mul v17209, v17207 - v17212 = mul v17210, v17208 - v17213 = add v17211, v17212 - v17214 = array_set mut v17204, index v17203, value v17213 - enable_side_effects u1 1 - v17215 = array_get v1, index u32 122 - enable_side_effects v17215 - v17216 = array_get v2, index u32 122 - v17217 = cast v17216 as u32 - v17218 = array_set v17214, index v17217, value Field 122 - v17220 = not v17215 - v17221 = array_get v17218, index v17217 - v17222 = array_get v17214, index v17217 - v17223 = cast v17215 as Field - v17224 = cast v17220 as Field - v17225 = mul v17223, v17221 - v17226 = mul v17224, v17222 - v17227 = add v17225, v17226 - v17228 = array_set mut v17218, index v17217, value v17227 - enable_side_effects u1 1 - v17229 = array_get v1, index u32 123 - enable_side_effects v17229 - v17230 = array_get v2, index u32 123 - v17231 = cast v17230 as u32 - v17232 = array_set v17228, index v17231, value Field 123 - v17234 = not v17229 - v17235 = array_get v17232, index v17231 - v17236 = array_get v17228, index v17231 - v17237 = cast v17229 as Field - v17238 = cast v17234 as Field - v17239 = mul v17237, v17235 - v17240 = mul v17238, v17236 - v17241 = add v17239, v17240 - v17242 = array_set mut v17232, index v17231, value v17241 - enable_side_effects u1 1 - v17243 = array_get v1, index u32 124 - enable_side_effects v17243 - v17244 = array_get v2, index u32 124 - v17245 = cast v17244 as u32 - v17246 = array_set v17242, index v17245, value Field 124 - v17248 = not v17243 - v17249 = array_get v17246, index v17245 - v17250 = array_get v17242, index v17245 - v17251 = cast v17243 as Field - v17252 = cast v17248 as Field - v17253 = mul v17251, v17249 - v17254 = mul v17252, v17250 - v17255 = add v17253, v17254 - v17256 = array_set mut v17246, index v17245, value v17255 - enable_side_effects u1 1 - v17257 = array_get v1, index u32 125 - enable_side_effects v17257 - v17258 = array_get v2, index u32 125 - v17259 = cast v17258 as u32 - v17260 = array_set v17256, index v17259, value Field 125 - v17262 = not v17257 - v17263 = array_get v17260, index v17259 - v17264 = array_get v17256, index v17259 - v17265 = cast v17257 as Field - v17266 = cast v17262 as Field - v17267 = mul v17265, v17263 - v17268 = mul v17266, v17264 - v17269 = add v17267, v17268 - v17270 = array_set mut v17260, index v17259, value v17269 - enable_side_effects u1 1 - v17271 = array_get v1, index u32 126 - enable_side_effects v17271 - v17272 = array_get v2, index u32 126 - v17273 = cast v17272 as u32 - v17274 = array_set v17270, index v17273, value Field 126 - v17276 = not v17271 - v17277 = array_get v17274, index v17273 - v17278 = array_get v17270, index v17273 - v17279 = cast v17271 as Field - v17280 = cast v17276 as Field - v17281 = mul v17279, v17277 - v17282 = mul v17280, v17278 - v17283 = add v17281, v17282 - v17284 = array_set mut v17274, index v17273, value v17283 - enable_side_effects u1 1 - v17285 = array_get v1, index u32 127 - enable_side_effects v17285 - v17286 = array_get v2, index u32 127 - v17287 = cast v17286 as u32 - v17288 = array_set v17284, index v17287, value Field 127 - v17290 = not v17285 - v17291 = array_get v17288, index v17287 - v17292 = array_get v17284, index v17287 - v17293 = cast v17285 as Field - v17294 = cast v17290 as Field - v17295 = mul v17293, v17291 - v17296 = mul v17294, v17292 - v17297 = add v17295, v17296 - v17298 = array_set mut v17288, index v17287, value v17297 - enable_side_effects u1 1 - v17299 = array_get v1, index u32 2⁷ - enable_side_effects v17299 - v17300 = array_get v2, index u32 2⁷ - v17301 = cast v17300 as u32 - v17302 = array_set v17298, index v17301, value Field 2⁷ - v17304 = not v17299 - v17305 = array_get v17302, index v17301 - v17306 = array_get v17298, index v17301 - v17307 = cast v17299 as Field - v17308 = cast v17304 as Field - v17309 = mul v17307, v17305 - v17310 = mul v17308, v17306 - v17311 = add v17309, v17310 - v17312 = array_set mut v17302, index v17301, value v17311 - enable_side_effects u1 1 - v17313 = array_get v1, index u32 129 - enable_side_effects v17313 - v17314 = array_get v2, index u32 129 - v17315 = cast v17314 as u32 - v17316 = array_set v17312, index v17315, value Field 129 - v17318 = not v17313 - v17319 = array_get v17316, index v17315 - v17320 = array_get v17312, index v17315 - v17321 = cast v17313 as Field - v17322 = cast v17318 as Field - v17323 = mul v17321, v17319 - v17324 = mul v17322, v17320 - v17325 = add v17323, v17324 - v17326 = array_set mut v17316, index v17315, value v17325 - enable_side_effects u1 1 - v17327 = array_get v1, index u32 130 - enable_side_effects v17327 - v17328 = array_get v2, index u32 130 - v17329 = cast v17328 as u32 - v17330 = array_set v17326, index v17329, value Field 130 - v17332 = not v17327 - v17333 = array_get v17330, index v17329 - v17334 = array_get v17326, index v17329 - v17335 = cast v17327 as Field - v17336 = cast v17332 as Field - v17337 = mul v17335, v17333 - v17338 = mul v17336, v17334 - v17339 = add v17337, v17338 - v17340 = array_set mut v17330, index v17329, value v17339 - enable_side_effects u1 1 - v17341 = array_get v1, index u32 131 - enable_side_effects v17341 - v17342 = array_get v2, index u32 131 - v17343 = cast v17342 as u32 - v17344 = array_set v17340, index v17343, value Field 131 - v17346 = not v17341 - v17347 = array_get v17344, index v17343 - v17348 = array_get v17340, index v17343 - v17349 = cast v17341 as Field - v17350 = cast v17346 as Field - v17351 = mul v17349, v17347 - v17352 = mul v17350, v17348 - v17353 = add v17351, v17352 - v17354 = array_set mut v17344, index v17343, value v17353 - enable_side_effects u1 1 - v17355 = array_get v1, index u32 132 - enable_side_effects v17355 - v17356 = array_get v2, index u32 132 - v17357 = cast v17356 as u32 - v17358 = array_set v17354, index v17357, value Field 132 - v17360 = not v17355 - v17361 = array_get v17358, index v17357 - v17362 = array_get v17354, index v17357 - v17363 = cast v17355 as Field - v17364 = cast v17360 as Field - v17365 = mul v17363, v17361 - v17366 = mul v17364, v17362 - v17367 = add v17365, v17366 - v17368 = array_set mut v17358, index v17357, value v17367 - enable_side_effects u1 1 - v17369 = array_get v1, index u32 133 - enable_side_effects v17369 - v17370 = array_get v2, index u32 133 - v17371 = cast v17370 as u32 - v17372 = array_set v17368, index v17371, value Field 133 - v17374 = not v17369 - v17375 = array_get v17372, index v17371 - v17376 = array_get v17368, index v17371 - v17377 = cast v17369 as Field - v17378 = cast v17374 as Field - v17379 = mul v17377, v17375 - v17380 = mul v17378, v17376 - v17381 = add v17379, v17380 - v17382 = array_set mut v17372, index v17371, value v17381 - enable_side_effects u1 1 - v17383 = array_get v1, index u32 134 - enable_side_effects v17383 - v17384 = array_get v2, index u32 134 - v17385 = cast v17384 as u32 - v17386 = array_set v17382, index v17385, value Field 134 - v17388 = not v17383 - v17389 = array_get v17386, index v17385 - v17390 = array_get v17382, index v17385 - v17391 = cast v17383 as Field - v17392 = cast v17388 as Field - v17393 = mul v17391, v17389 - v17394 = mul v17392, v17390 - v17395 = add v17393, v17394 - v17396 = array_set mut v17386, index v17385, value v17395 - enable_side_effects u1 1 - v17397 = array_get v1, index u32 135 - enable_side_effects v17397 - v17398 = array_get v2, index u32 135 - v17399 = cast v17398 as u32 - v17400 = array_set v17396, index v17399, value Field 135 - v17402 = not v17397 - v17403 = array_get v17400, index v17399 - v17404 = array_get v17396, index v17399 - v17405 = cast v17397 as Field - v17406 = cast v17402 as Field - v17407 = mul v17405, v17403 - v17408 = mul v17406, v17404 - v17409 = add v17407, v17408 - v17410 = array_set mut v17400, index v17399, value v17409 - enable_side_effects u1 1 - v17411 = array_get v1, index u32 136 - enable_side_effects v17411 - v17412 = array_get v2, index u32 136 - v17413 = cast v17412 as u32 - v17414 = array_set v17410, index v17413, value Field 136 - v17416 = not v17411 - v17417 = array_get v17414, index v17413 - v17418 = array_get v17410, index v17413 - v17419 = cast v17411 as Field - v17420 = cast v17416 as Field - v17421 = mul v17419, v17417 - v17422 = mul v17420, v17418 - v17423 = add v17421, v17422 - v17424 = array_set mut v17414, index v17413, value v17423 - enable_side_effects u1 1 - v17425 = array_get v1, index u32 137 - enable_side_effects v17425 - v17426 = array_get v2, index u32 137 - v17427 = cast v17426 as u32 - v17428 = array_set v17424, index v17427, value Field 137 - v17430 = not v17425 - v17431 = array_get v17428, index v17427 - v17432 = array_get v17424, index v17427 - v17433 = cast v17425 as Field - v17434 = cast v17430 as Field - v17435 = mul v17433, v17431 - v17436 = mul v17434, v17432 - v17437 = add v17435, v17436 - v17438 = array_set mut v17428, index v17427, value v17437 - enable_side_effects u1 1 - v17439 = array_get v1, index u32 138 - enable_side_effects v17439 - v17440 = array_get v2, index u32 138 - v17441 = cast v17440 as u32 - v17442 = array_set v17438, index v17441, value Field 138 - v17444 = not v17439 - v17445 = array_get v17442, index v17441 - v17446 = array_get v17438, index v17441 - v17447 = cast v17439 as Field - v17448 = cast v17444 as Field - v17449 = mul v17447, v17445 - v17450 = mul v17448, v17446 - v17451 = add v17449, v17450 - v17452 = array_set mut v17442, index v17441, value v17451 - enable_side_effects u1 1 - v17453 = array_get v1, index u32 139 - enable_side_effects v17453 - v17454 = array_get v2, index u32 139 - v17455 = cast v17454 as u32 - v17456 = array_set v17452, index v17455, value Field 139 - v17458 = not v17453 - v17459 = array_get v17456, index v17455 - v17460 = array_get v17452, index v17455 - v17461 = cast v17453 as Field - v17462 = cast v17458 as Field - v17463 = mul v17461, v17459 - v17464 = mul v17462, v17460 - v17465 = add v17463, v17464 - v17466 = array_set mut v17456, index v17455, value v17465 - enable_side_effects u1 1 - v17467 = array_get v1, index u32 140 - enable_side_effects v17467 - v17468 = array_get v2, index u32 140 - v17469 = cast v17468 as u32 - v17470 = array_set v17466, index v17469, value Field 140 - v17472 = not v17467 - v17473 = array_get v17470, index v17469 - v17474 = array_get v17466, index v17469 - v17475 = cast v17467 as Field - v17476 = cast v17472 as Field - v17477 = mul v17475, v17473 - v17478 = mul v17476, v17474 - v17479 = add v17477, v17478 - v17480 = array_set mut v17470, index v17469, value v17479 - enable_side_effects u1 1 - v17481 = array_get v1, index u32 141 - enable_side_effects v17481 - v17482 = array_get v2, index u32 141 - v17483 = cast v17482 as u32 - v17484 = array_set v17480, index v17483, value Field 141 - v17486 = not v17481 - v17487 = array_get v17484, index v17483 - v17488 = array_get v17480, index v17483 - v17489 = cast v17481 as Field - v17490 = cast v17486 as Field - v17491 = mul v17489, v17487 - v17492 = mul v17490, v17488 - v17493 = add v17491, v17492 - v17494 = array_set mut v17484, index v17483, value v17493 - enable_side_effects u1 1 - v17495 = array_get v1, index u32 142 - enable_side_effects v17495 - v17496 = array_get v2, index u32 142 - v17497 = cast v17496 as u32 - v17498 = array_set v17494, index v17497, value Field 142 - v17500 = not v17495 - v17501 = array_get v17498, index v17497 - v17502 = array_get v17494, index v17497 - v17503 = cast v17495 as Field - v17504 = cast v17500 as Field - v17505 = mul v17503, v17501 - v17506 = mul v17504, v17502 - v17507 = add v17505, v17506 - v17508 = array_set mut v17498, index v17497, value v17507 - enable_side_effects u1 1 - v17509 = array_get v1, index u32 143 - enable_side_effects v17509 - v17510 = array_get v2, index u32 143 - v17511 = cast v17510 as u32 - v17512 = array_set v17508, index v17511, value Field 143 - v17514 = not v17509 - v17515 = array_get v17512, index v17511 - v17516 = array_get v17508, index v17511 - v17517 = cast v17509 as Field - v17518 = cast v17514 as Field - v17519 = mul v17517, v17515 - v17520 = mul v17518, v17516 - v17521 = add v17519, v17520 - v17522 = array_set mut v17512, index v17511, value v17521 - enable_side_effects u1 1 - v17523 = array_get v1, index u32 2⁴×9 - enable_side_effects v17523 - v17524 = array_get v2, index u32 2⁴×9 - v17525 = cast v17524 as u32 - v17526 = array_set v17522, index v17525, value Field 2⁴×9 - v17528 = not v17523 - v17529 = array_get v17526, index v17525 - v17530 = array_get v17522, index v17525 - v17531 = cast v17523 as Field - v17532 = cast v17528 as Field - v17533 = mul v17531, v17529 - v17534 = mul v17532, v17530 - v17535 = add v17533, v17534 - v17536 = array_set mut v17526, index v17525, value v17535 - enable_side_effects u1 1 - v17537 = array_get v1, index u32 145 - enable_side_effects v17537 - v17538 = array_get v2, index u32 145 - v17539 = cast v17538 as u32 - v17540 = array_set v17536, index v17539, value Field 145 - v17542 = not v17537 - v17543 = array_get v17540, index v17539 - v17544 = array_get v17536, index v17539 - v17545 = cast v17537 as Field - v17546 = cast v17542 as Field - v17547 = mul v17545, v17543 - v17548 = mul v17546, v17544 - v17549 = add v17547, v17548 - v17550 = array_set mut v17540, index v17539, value v17549 - enable_side_effects u1 1 - v17551 = array_get v1, index u32 146 - enable_side_effects v17551 - v17552 = array_get v2, index u32 146 - v17553 = cast v17552 as u32 - v17554 = array_set v17550, index v17553, value Field 146 - v17556 = not v17551 - v17557 = array_get v17554, index v17553 - v17558 = array_get v17550, index v17553 - v17559 = cast v17551 as Field - v17560 = cast v17556 as Field - v17561 = mul v17559, v17557 - v17562 = mul v17560, v17558 - v17563 = add v17561, v17562 - v17564 = array_set mut v17554, index v17553, value v17563 - enable_side_effects u1 1 - v17565 = array_get v1, index u32 147 - enable_side_effects v17565 - v17566 = array_get v2, index u32 147 - v17567 = cast v17566 as u32 - v17568 = array_set v17564, index v17567, value Field 147 - v17570 = not v17565 - v17571 = array_get v17568, index v17567 - v17572 = array_get v17564, index v17567 - v17573 = cast v17565 as Field - v17574 = cast v17570 as Field - v17575 = mul v17573, v17571 - v17576 = mul v17574, v17572 - v17577 = add v17575, v17576 - v17578 = array_set mut v17568, index v17567, value v17577 - enable_side_effects u1 1 - v17579 = array_get v1, index u32 148 - enable_side_effects v17579 - v17580 = array_get v2, index u32 148 - v17581 = cast v17580 as u32 - v17582 = array_set v17578, index v17581, value Field 148 - v17584 = not v17579 - v17585 = array_get v17582, index v17581 - v17586 = array_get v17578, index v17581 - v17587 = cast v17579 as Field - v17588 = cast v17584 as Field - v17589 = mul v17587, v17585 - v17590 = mul v17588, v17586 - v17591 = add v17589, v17590 - v17592 = array_set mut v17582, index v17581, value v17591 - enable_side_effects u1 1 - v17593 = array_get v1, index u32 149 - enable_side_effects v17593 - v17594 = array_get v2, index u32 149 - v17595 = cast v17594 as u32 - v17596 = array_set v17592, index v17595, value Field 149 - v17598 = not v17593 - v17599 = array_get v17596, index v17595 - v17600 = array_get v17592, index v17595 - v17601 = cast v17593 as Field - v17602 = cast v17598 as Field - v17603 = mul v17601, v17599 - v17604 = mul v17602, v17600 - v17605 = add v17603, v17604 - v17606 = array_set mut v17596, index v17595, value v17605 - enable_side_effects u1 1 - v17607 = array_get v1, index u32 150 - enable_side_effects v17607 - v17608 = array_get v2, index u32 150 - v17609 = cast v17608 as u32 - v17610 = array_set v17606, index v17609, value Field 150 - v17612 = not v17607 - v17613 = array_get v17610, index v17609 - v17614 = array_get v17606, index v17609 - v17615 = cast v17607 as Field - v17616 = cast v17612 as Field - v17617 = mul v17615, v17613 - v17618 = mul v17616, v17614 - v17619 = add v17617, v17618 - v17620 = array_set mut v17610, index v17609, value v17619 - enable_side_effects u1 1 - v17621 = array_get v1, index u32 151 - enable_side_effects v17621 - v17622 = array_get v2, index u32 151 - v17623 = cast v17622 as u32 - v17624 = array_set v17620, index v17623, value Field 151 - v17626 = not v17621 - v17627 = array_get v17624, index v17623 - v17628 = array_get v17620, index v17623 - v17629 = cast v17621 as Field - v17630 = cast v17626 as Field - v17631 = mul v17629, v17627 - v17632 = mul v17630, v17628 - v17633 = add v17631, v17632 - v17634 = array_set mut v17624, index v17623, value v17633 - enable_side_effects u1 1 - v17635 = array_get v1, index u32 152 - enable_side_effects v17635 - v17636 = array_get v2, index u32 152 - v17637 = cast v17636 as u32 - v17638 = array_set v17634, index v17637, value Field 152 - v17640 = not v17635 - v17641 = array_get v17638, index v17637 - v17642 = array_get v17634, index v17637 - v17643 = cast v17635 as Field - v17644 = cast v17640 as Field - v17645 = mul v17643, v17641 - v17646 = mul v17644, v17642 - v17647 = add v17645, v17646 - v17648 = array_set mut v17638, index v17637, value v17647 - enable_side_effects u1 1 - v17649 = array_get v1, index u32 153 - enable_side_effects v17649 - v17650 = array_get v2, index u32 153 - v17651 = cast v17650 as u32 - v17652 = array_set v17648, index v17651, value Field 153 - v17654 = not v17649 - v17655 = array_get v17652, index v17651 - v17656 = array_get v17648, index v17651 - v17657 = cast v17649 as Field - v17658 = cast v17654 as Field - v17659 = mul v17657, v17655 - v17660 = mul v17658, v17656 - v17661 = add v17659, v17660 - v17662 = array_set mut v17652, index v17651, value v17661 - enable_side_effects u1 1 - v17663 = array_get v1, index u32 154 - enable_side_effects v17663 - v17664 = array_get v2, index u32 154 - v17665 = cast v17664 as u32 - v17666 = array_set v17662, index v17665, value Field 154 - v17668 = not v17663 - v17669 = array_get v17666, index v17665 - v17670 = array_get v17662, index v17665 - v17671 = cast v17663 as Field - v17672 = cast v17668 as Field - v17673 = mul v17671, v17669 - v17674 = mul v17672, v17670 - v17675 = add v17673, v17674 - v17676 = array_set mut v17666, index v17665, value v17675 - enable_side_effects u1 1 - v17677 = array_get v1, index u32 155 - enable_side_effects v17677 - v17678 = array_get v2, index u32 155 - v17679 = cast v17678 as u32 - v17680 = array_set v17676, index v17679, value Field 155 - v17682 = not v17677 - v17683 = array_get v17680, index v17679 - v17684 = array_get v17676, index v17679 - v17685 = cast v17677 as Field - v17686 = cast v17682 as Field - v17687 = mul v17685, v17683 - v17688 = mul v17686, v17684 - v17689 = add v17687, v17688 - v17690 = array_set mut v17680, index v17679, value v17689 - enable_side_effects u1 1 - v17691 = array_get v1, index u32 156 - enable_side_effects v17691 - v17692 = array_get v2, index u32 156 - v17693 = cast v17692 as u32 - v17694 = array_set v17690, index v17693, value Field 156 - v17696 = not v17691 - v17697 = array_get v17694, index v17693 - v17698 = array_get v17690, index v17693 - v17699 = cast v17691 as Field - v17700 = cast v17696 as Field - v17701 = mul v17699, v17697 - v17702 = mul v17700, v17698 - v17703 = add v17701, v17702 - v17704 = array_set mut v17694, index v17693, value v17703 - enable_side_effects u1 1 - v17705 = array_get v1, index u32 157 - enable_side_effects v17705 - v17706 = array_get v2, index u32 157 - v17707 = cast v17706 as u32 - v17708 = array_set v17704, index v17707, value Field 157 - v17710 = not v17705 - v17711 = array_get v17708, index v17707 - v17712 = array_get v17704, index v17707 - v17713 = cast v17705 as Field - v17714 = cast v17710 as Field - v17715 = mul v17713, v17711 - v17716 = mul v17714, v17712 - v17717 = add v17715, v17716 - v17718 = array_set mut v17708, index v17707, value v17717 - enable_side_effects u1 1 - v17719 = array_get v1, index u32 158 - enable_side_effects v17719 - v17720 = array_get v2, index u32 158 - v17721 = cast v17720 as u32 - v17722 = array_set v17718, index v17721, value Field 158 - v17724 = not v17719 - v17725 = array_get v17722, index v17721 - v17726 = array_get v17718, index v17721 - v17727 = cast v17719 as Field - v17728 = cast v17724 as Field - v17729 = mul v17727, v17725 - v17730 = mul v17728, v17726 - v17731 = add v17729, v17730 - v17732 = array_set mut v17722, index v17721, value v17731 - enable_side_effects u1 1 - v17733 = array_get v1, index u32 159 - enable_side_effects v17733 - v17734 = array_get v2, index u32 159 - v17735 = cast v17734 as u32 - v17736 = array_set v17732, index v17735, value Field 159 - v17738 = not v17733 - v17739 = array_get v17736, index v17735 - v17740 = array_get v17732, index v17735 - v17741 = cast v17733 as Field - v17742 = cast v17738 as Field - v17743 = mul v17741, v17739 - v17744 = mul v17742, v17740 - v17745 = add v17743, v17744 - v17746 = array_set mut v17736, index v17735, value v17745 - enable_side_effects u1 1 - v17747 = array_get v1, index u32 2⁴×10 - enable_side_effects v17747 - v17748 = array_get v2, index u32 2⁴×10 - v17749 = cast v17748 as u32 - v17750 = array_set v17746, index v17749, value Field 2⁴×10 - v17752 = not v17747 - v17753 = array_get v17750, index v17749 - v17754 = array_get v17746, index v17749 - v17755 = cast v17747 as Field - v17756 = cast v17752 as Field - v17757 = mul v17755, v17753 - v17758 = mul v17756, v17754 - v17759 = add v17757, v17758 - v17760 = array_set mut v17750, index v17749, value v17759 - enable_side_effects u1 1 - v17761 = array_get v1, index u32 161 - enable_side_effects v17761 - v17762 = array_get v2, index u32 161 - v17763 = cast v17762 as u32 - v17764 = array_set v17760, index v17763, value Field 161 - v17766 = not v17761 - v17767 = array_get v17764, index v17763 - v17768 = array_get v17760, index v17763 - v17769 = cast v17761 as Field - v17770 = cast v17766 as Field - v17771 = mul v17769, v17767 - v17772 = mul v17770, v17768 - v17773 = add v17771, v17772 - v17774 = array_set mut v17764, index v17763, value v17773 - enable_side_effects u1 1 - v17775 = array_get v1, index u32 162 - enable_side_effects v17775 - v17776 = array_get v2, index u32 162 - v17777 = cast v17776 as u32 - v17778 = array_set v17774, index v17777, value Field 162 - v17780 = not v17775 - v17781 = array_get v17778, index v17777 - v17782 = array_get v17774, index v17777 - v17783 = cast v17775 as Field - v17784 = cast v17780 as Field - v17785 = mul v17783, v17781 - v17786 = mul v17784, v17782 - v17787 = add v17785, v17786 - v17788 = array_set mut v17778, index v17777, value v17787 - enable_side_effects u1 1 - v17789 = array_get v1, index u32 163 - enable_side_effects v17789 - v17790 = array_get v2, index u32 163 - v17791 = cast v17790 as u32 - v17792 = array_set v17788, index v17791, value Field 163 - v17794 = not v17789 - v17795 = array_get v17792, index v17791 - v17796 = array_get v17788, index v17791 - v17797 = cast v17789 as Field - v17798 = cast v17794 as Field - v17799 = mul v17797, v17795 - v17800 = mul v17798, v17796 - v17801 = add v17799, v17800 - v17802 = array_set mut v17792, index v17791, value v17801 - enable_side_effects u1 1 - v17803 = array_get v1, index u32 164 - enable_side_effects v17803 - v17804 = array_get v2, index u32 164 - v17805 = cast v17804 as u32 - v17806 = array_set v17802, index v17805, value Field 164 - v17808 = not v17803 - v17809 = array_get v17806, index v17805 - v17810 = array_get v17802, index v17805 - v17811 = cast v17803 as Field - v17812 = cast v17808 as Field - v17813 = mul v17811, v17809 - v17814 = mul v17812, v17810 - v17815 = add v17813, v17814 - v17816 = array_set mut v17806, index v17805, value v17815 - enable_side_effects u1 1 - v17817 = array_get v1, index u32 165 - enable_side_effects v17817 - v17818 = array_get v2, index u32 165 - v17819 = cast v17818 as u32 - v17820 = array_set v17816, index v17819, value Field 165 - v17822 = not v17817 - v17823 = array_get v17820, index v17819 - v17824 = array_get v17816, index v17819 - v17825 = cast v17817 as Field - v17826 = cast v17822 as Field - v17827 = mul v17825, v17823 - v17828 = mul v17826, v17824 - v17829 = add v17827, v17828 - v17830 = array_set mut v17820, index v17819, value v17829 - enable_side_effects u1 1 - v17831 = array_get v1, index u32 166 - enable_side_effects v17831 - v17832 = array_get v2, index u32 166 - v17833 = cast v17832 as u32 - v17834 = array_set v17830, index v17833, value Field 166 - v17836 = not v17831 - v17837 = array_get v17834, index v17833 - v17838 = array_get v17830, index v17833 - v17839 = cast v17831 as Field - v17840 = cast v17836 as Field - v17841 = mul v17839, v17837 - v17842 = mul v17840, v17838 - v17843 = add v17841, v17842 - v17844 = array_set mut v17834, index v17833, value v17843 - enable_side_effects u1 1 - v17845 = array_get v1, index u32 167 - enable_side_effects v17845 - v17846 = array_get v2, index u32 167 - v17847 = cast v17846 as u32 - v17848 = array_set v17844, index v17847, value Field 167 - v17850 = not v17845 - v17851 = array_get v17848, index v17847 - v17852 = array_get v17844, index v17847 - v17853 = cast v17845 as Field - v17854 = cast v17850 as Field - v17855 = mul v17853, v17851 - v17856 = mul v17854, v17852 - v17857 = add v17855, v17856 - v17858 = array_set mut v17848, index v17847, value v17857 - enable_side_effects u1 1 - v17859 = array_get v1, index u32 168 - enable_side_effects v17859 - v17860 = array_get v2, index u32 168 - v17861 = cast v17860 as u32 - v17862 = array_set v17858, index v17861, value Field 168 - v17864 = not v17859 - v17865 = array_get v17862, index v17861 - v17866 = array_get v17858, index v17861 - v17867 = cast v17859 as Field - v17868 = cast v17864 as Field - v17869 = mul v17867, v17865 - v17870 = mul v17868, v17866 - v17871 = add v17869, v17870 - v17872 = array_set mut v17862, index v17861, value v17871 - enable_side_effects u1 1 - v17873 = array_get v1, index u32 169 - enable_side_effects v17873 - v17874 = array_get v2, index u32 169 - v17875 = cast v17874 as u32 - v17876 = array_set v17872, index v17875, value Field 169 - v17878 = not v17873 - v17879 = array_get v17876, index v17875 - v17880 = array_get v17872, index v17875 - v17881 = cast v17873 as Field - v17882 = cast v17878 as Field - v17883 = mul v17881, v17879 - v17884 = mul v17882, v17880 - v17885 = add v17883, v17884 - v17886 = array_set mut v17876, index v17875, value v17885 - enable_side_effects u1 1 - v17887 = array_get v1, index u32 170 - enable_side_effects v17887 - v17888 = array_get v2, index u32 170 - v17889 = cast v17888 as u32 - v17890 = array_set v17886, index v17889, value Field 170 - v17892 = not v17887 - v17893 = array_get v17890, index v17889 - v17894 = array_get v17886, index v17889 - v17895 = cast v17887 as Field - v17896 = cast v17892 as Field - v17897 = mul v17895, v17893 - v17898 = mul v17896, v17894 - v17899 = add v17897, v17898 - v17900 = array_set mut v17890, index v17889, value v17899 - enable_side_effects u1 1 - v17901 = array_get v1, index u32 171 - enable_side_effects v17901 - v17902 = array_get v2, index u32 171 - v17903 = cast v17902 as u32 - v17904 = array_set v17900, index v17903, value Field 171 - v17906 = not v17901 - v17907 = array_get v17904, index v17903 - v17908 = array_get v17900, index v17903 - v17909 = cast v17901 as Field - v17910 = cast v17906 as Field - v17911 = mul v17909, v17907 - v17912 = mul v17910, v17908 - v17913 = add v17911, v17912 - v17914 = array_set mut v17904, index v17903, value v17913 - enable_side_effects u1 1 - v17915 = array_get v1, index u32 172 - enable_side_effects v17915 - v17916 = array_get v2, index u32 172 - v17917 = cast v17916 as u32 - v17918 = array_set v17914, index v17917, value Field 172 - v17920 = not v17915 - v17921 = array_get v17918, index v17917 - v17922 = array_get v17914, index v17917 - v17923 = cast v17915 as Field - v17924 = cast v17920 as Field - v17925 = mul v17923, v17921 - v17926 = mul v17924, v17922 - v17927 = add v17925, v17926 - v17928 = array_set mut v17918, index v17917, value v17927 - enable_side_effects u1 1 - v17929 = array_get v1, index u32 173 - enable_side_effects v17929 - v17930 = array_get v2, index u32 173 - v17931 = cast v17930 as u32 - v17932 = array_set v17928, index v17931, value Field 173 - v17934 = not v17929 - v17935 = array_get v17932, index v17931 - v17936 = array_get v17928, index v17931 - v17937 = cast v17929 as Field - v17938 = cast v17934 as Field - v17939 = mul v17937, v17935 - v17940 = mul v17938, v17936 - v17941 = add v17939, v17940 - v17942 = array_set mut v17932, index v17931, value v17941 - enable_side_effects u1 1 - v17943 = array_get v1, index u32 174 - enable_side_effects v17943 - v17944 = array_get v2, index u32 174 - v17945 = cast v17944 as u32 - v17946 = array_set v17942, index v17945, value Field 174 - v17948 = not v17943 - v17949 = array_get v17946, index v17945 - v17950 = array_get v17942, index v17945 - v17951 = cast v17943 as Field - v17952 = cast v17948 as Field - v17953 = mul v17951, v17949 - v17954 = mul v17952, v17950 - v17955 = add v17953, v17954 - v17956 = array_set mut v17946, index v17945, value v17955 - enable_side_effects u1 1 - v17957 = array_get v1, index u32 175 - enable_side_effects v17957 - v17958 = array_get v2, index u32 175 - v17959 = cast v17958 as u32 - v17960 = array_set v17956, index v17959, value Field 175 - v17962 = not v17957 - v17963 = array_get v17960, index v17959 - v17964 = array_get v17956, index v17959 - v17965 = cast v17957 as Field - v17966 = cast v17962 as Field - v17967 = mul v17965, v17963 - v17968 = mul v17966, v17964 - v17969 = add v17967, v17968 - v17970 = array_set mut v17960, index v17959, value v17969 - enable_side_effects u1 1 - v17971 = array_get v1, index u32 2⁴×11 - enable_side_effects v17971 - v17972 = array_get v2, index u32 2⁴×11 - v17973 = cast v17972 as u32 - v17974 = array_set v17970, index v17973, value Field 2⁴×11 - v17976 = not v17971 - v17977 = array_get v17974, index v17973 - v17978 = array_get v17970, index v17973 - v17979 = cast v17971 as Field - v17980 = cast v17976 as Field - v17981 = mul v17979, v17977 - v17982 = mul v17980, v17978 - v17983 = add v17981, v17982 - v17984 = array_set mut v17974, index v17973, value v17983 - enable_side_effects u1 1 - v17985 = array_get v1, index u32 177 - enable_side_effects v17985 - v17986 = array_get v2, index u32 177 - v17987 = cast v17986 as u32 - v17988 = array_set v17984, index v17987, value Field 177 - v17990 = not v17985 - v17991 = array_get v17988, index v17987 - v17992 = array_get v17984, index v17987 - v17993 = cast v17985 as Field - v17994 = cast v17990 as Field - v17995 = mul v17993, v17991 - v17996 = mul v17994, v17992 - v17997 = add v17995, v17996 - v17998 = array_set mut v17988, index v17987, value v17997 - enable_side_effects u1 1 - v17999 = array_get v1, index u32 178 - enable_side_effects v17999 - v18000 = array_get v2, index u32 178 - v18001 = cast v18000 as u32 - v18002 = array_set v17998, index v18001, value Field 178 - v18004 = not v17999 - v18005 = array_get v18002, index v18001 - v18006 = array_get v17998, index v18001 - v18007 = cast v17999 as Field - v18008 = cast v18004 as Field - v18009 = mul v18007, v18005 - v18010 = mul v18008, v18006 - v18011 = add v18009, v18010 - v18012 = array_set mut v18002, index v18001, value v18011 - enable_side_effects u1 1 - v18013 = array_get v1, index u32 179 - enable_side_effects v18013 - v18014 = array_get v2, index u32 179 - v18015 = cast v18014 as u32 - v18016 = array_set v18012, index v18015, value Field 179 - v18018 = not v18013 - v18019 = array_get v18016, index v18015 - v18020 = array_get v18012, index v18015 - v18021 = cast v18013 as Field - v18022 = cast v18018 as Field - v18023 = mul v18021, v18019 - v18024 = mul v18022, v18020 - v18025 = add v18023, v18024 - v18026 = array_set mut v18016, index v18015, value v18025 - enable_side_effects u1 1 - v18027 = array_get v1, index u32 180 - enable_side_effects v18027 - v18028 = array_get v2, index u32 180 - v18029 = cast v18028 as u32 - v18030 = array_set v18026, index v18029, value Field 180 - v18032 = not v18027 - v18033 = array_get v18030, index v18029 - v18034 = array_get v18026, index v18029 - v18035 = cast v18027 as Field - v18036 = cast v18032 as Field - v18037 = mul v18035, v18033 - v18038 = mul v18036, v18034 - v18039 = add v18037, v18038 - v18040 = array_set mut v18030, index v18029, value v18039 - enable_side_effects u1 1 - v18041 = array_get v1, index u32 181 - enable_side_effects v18041 - v18042 = array_get v2, index u32 181 - v18043 = cast v18042 as u32 - v18044 = array_set v18040, index v18043, value Field 181 - v18046 = not v18041 - v18047 = array_get v18044, index v18043 - v18048 = array_get v18040, index v18043 - v18049 = cast v18041 as Field - v18050 = cast v18046 as Field - v18051 = mul v18049, v18047 - v18052 = mul v18050, v18048 - v18053 = add v18051, v18052 - v18054 = array_set mut v18044, index v18043, value v18053 - enable_side_effects u1 1 - v18055 = array_get v1, index u32 182 - enable_side_effects v18055 - v18056 = array_get v2, index u32 182 - v18057 = cast v18056 as u32 - v18058 = array_set v18054, index v18057, value Field 182 - v18060 = not v18055 - v18061 = array_get v18058, index v18057 - v18062 = array_get v18054, index v18057 - v18063 = cast v18055 as Field - v18064 = cast v18060 as Field - v18065 = mul v18063, v18061 - v18066 = mul v18064, v18062 - v18067 = add v18065, v18066 - v18068 = array_set mut v18058, index v18057, value v18067 - enable_side_effects u1 1 - v18069 = array_get v1, index u32 183 - enable_side_effects v18069 - v18070 = array_get v2, index u32 183 - v18071 = cast v18070 as u32 - v18072 = array_set v18068, index v18071, value Field 183 - v18074 = not v18069 - v18075 = array_get v18072, index v18071 - v18076 = array_get v18068, index v18071 - v18077 = cast v18069 as Field - v18078 = cast v18074 as Field - v18079 = mul v18077, v18075 - v18080 = mul v18078, v18076 - v18081 = add v18079, v18080 - v18082 = array_set mut v18072, index v18071, value v18081 - enable_side_effects u1 1 - v18083 = array_get v1, index u32 184 - enable_side_effects v18083 - v18084 = array_get v2, index u32 184 - v18085 = cast v18084 as u32 - v18086 = array_set v18082, index v18085, value Field 184 - v18088 = not v18083 - v18089 = array_get v18086, index v18085 - v18090 = array_get v18082, index v18085 - v18091 = cast v18083 as Field - v18092 = cast v18088 as Field - v18093 = mul v18091, v18089 - v18094 = mul v18092, v18090 - v18095 = add v18093, v18094 - v18096 = array_set mut v18086, index v18085, value v18095 - enable_side_effects u1 1 - v18097 = array_get v1, index u32 185 - enable_side_effects v18097 - v18098 = array_get v2, index u32 185 - v18099 = cast v18098 as u32 - v18100 = array_set v18096, index v18099, value Field 185 - v18102 = not v18097 - v18103 = array_get v18100, index v18099 - v18104 = array_get v18096, index v18099 - v18105 = cast v18097 as Field - v18106 = cast v18102 as Field - v18107 = mul v18105, v18103 - v18108 = mul v18106, v18104 - v18109 = add v18107, v18108 - v18110 = array_set mut v18100, index v18099, value v18109 - enable_side_effects u1 1 - v18111 = array_get v1, index u32 186 - enable_side_effects v18111 - v18112 = array_get v2, index u32 186 - v18113 = cast v18112 as u32 - v18114 = array_set v18110, index v18113, value Field 186 - v18116 = not v18111 - v18117 = array_get v18114, index v18113 - v18118 = array_get v18110, index v18113 - v18119 = cast v18111 as Field - v18120 = cast v18116 as Field - v18121 = mul v18119, v18117 - v18122 = mul v18120, v18118 - v18123 = add v18121, v18122 - v18124 = array_set mut v18114, index v18113, value v18123 - enable_side_effects u1 1 - v18125 = array_get v1, index u32 187 - enable_side_effects v18125 - v18126 = array_get v2, index u32 187 - v18127 = cast v18126 as u32 - v18128 = array_set v18124, index v18127, value Field 187 - v18130 = not v18125 - v18131 = array_get v18128, index v18127 - v18132 = array_get v18124, index v18127 - v18133 = cast v18125 as Field - v18134 = cast v18130 as Field - v18135 = mul v18133, v18131 - v18136 = mul v18134, v18132 - v18137 = add v18135, v18136 - v18138 = array_set mut v18128, index v18127, value v18137 - enable_side_effects u1 1 - v18139 = array_get v1, index u32 188 - enable_side_effects v18139 - v18140 = array_get v2, index u32 188 - v18141 = cast v18140 as u32 - v18142 = array_set v18138, index v18141, value Field 188 - v18144 = not v18139 - v18145 = array_get v18142, index v18141 - v18146 = array_get v18138, index v18141 - v18147 = cast v18139 as Field - v18148 = cast v18144 as Field - v18149 = mul v18147, v18145 - v18150 = mul v18148, v18146 - v18151 = add v18149, v18150 - v18152 = array_set mut v18142, index v18141, value v18151 - enable_side_effects u1 1 - v18153 = array_get v1, index u32 189 - enable_side_effects v18153 - v18154 = array_get v2, index u32 189 - v18155 = cast v18154 as u32 - v18156 = array_set v18152, index v18155, value Field 189 - v18158 = not v18153 - v18159 = array_get v18156, index v18155 - v18160 = array_get v18152, index v18155 - v18161 = cast v18153 as Field - v18162 = cast v18158 as Field - v18163 = mul v18161, v18159 - v18164 = mul v18162, v18160 - v18165 = add v18163, v18164 - v18166 = array_set mut v18156, index v18155, value v18165 - enable_side_effects u1 1 - v18167 = array_get v1, index u32 190 - enable_side_effects v18167 - v18168 = array_get v2, index u32 190 - v18169 = cast v18168 as u32 - v18170 = array_set v18166, index v18169, value Field 190 - v18172 = not v18167 - v18173 = array_get v18170, index v18169 - v18174 = array_get v18166, index v18169 - v18175 = cast v18167 as Field - v18176 = cast v18172 as Field - v18177 = mul v18175, v18173 - v18178 = mul v18176, v18174 - v18179 = add v18177, v18178 - v18180 = array_set mut v18170, index v18169, value v18179 - enable_side_effects u1 1 - v18181 = array_get v1, index u32 191 - enable_side_effects v18181 - v18182 = array_get v2, index u32 191 - v18183 = cast v18182 as u32 - v18184 = array_set v18180, index v18183, value Field 191 - v18186 = not v18181 - v18187 = array_get v18184, index v18183 - v18188 = array_get v18180, index v18183 - v18189 = cast v18181 as Field - v18190 = cast v18186 as Field - v18191 = mul v18189, v18187 - v18192 = mul v18190, v18188 - v18193 = add v18191, v18192 - v18194 = array_set mut v18184, index v18183, value v18193 - enable_side_effects u1 1 - v18195 = array_get v1, index u32 2⁴×12 - enable_side_effects v18195 - v18196 = array_get v2, index u32 2⁴×12 - v18197 = cast v18196 as u32 - v18198 = array_set v18194, index v18197, value Field 2⁴×12 - v18200 = not v18195 - v18201 = array_get v18198, index v18197 - v18202 = array_get v18194, index v18197 - v18203 = cast v18195 as Field - v18204 = cast v18200 as Field - v18205 = mul v18203, v18201 - v18206 = mul v18204, v18202 - v18207 = add v18205, v18206 - v18208 = array_set mut v18198, index v18197, value v18207 - enable_side_effects u1 1 - v18209 = array_get v1, index u32 193 - enable_side_effects v18209 - v18210 = array_get v2, index u32 193 - v18211 = cast v18210 as u32 - v18212 = array_set v18208, index v18211, value Field 193 - v18214 = not v18209 - v18215 = array_get v18212, index v18211 - v18216 = array_get v18208, index v18211 - v18217 = cast v18209 as Field - v18218 = cast v18214 as Field - v18219 = mul v18217, v18215 - v18220 = mul v18218, v18216 - v18221 = add v18219, v18220 - v18222 = array_set mut v18212, index v18211, value v18221 - enable_side_effects u1 1 - v18223 = array_get v1, index u32 194 - enable_side_effects v18223 - v18224 = array_get v2, index u32 194 - v18225 = cast v18224 as u32 - v18226 = array_set v18222, index v18225, value Field 194 - v18228 = not v18223 - v18229 = array_get v18226, index v18225 - v18230 = array_get v18222, index v18225 - v18231 = cast v18223 as Field - v18232 = cast v18228 as Field - v18233 = mul v18231, v18229 - v18234 = mul v18232, v18230 - v18235 = add v18233, v18234 - v18236 = array_set mut v18226, index v18225, value v18235 - enable_side_effects u1 1 - v18237 = array_get v1, index u32 195 - enable_side_effects v18237 - v18238 = array_get v2, index u32 195 - v18239 = cast v18238 as u32 - v18240 = array_set v18236, index v18239, value Field 195 - v18242 = not v18237 - v18243 = array_get v18240, index v18239 - v18244 = array_get v18236, index v18239 - v18245 = cast v18237 as Field - v18246 = cast v18242 as Field - v18247 = mul v18245, v18243 - v18248 = mul v18246, v18244 - v18249 = add v18247, v18248 - v18250 = array_set mut v18240, index v18239, value v18249 - enable_side_effects u1 1 - v18251 = array_get v1, index u32 196 - enable_side_effects v18251 - v18252 = array_get v2, index u32 196 - v18253 = cast v18252 as u32 - v18254 = array_set v18250, index v18253, value Field 196 - v18256 = not v18251 - v18257 = array_get v18254, index v18253 - v18258 = array_get v18250, index v18253 - v18259 = cast v18251 as Field - v18260 = cast v18256 as Field - v18261 = mul v18259, v18257 - v18262 = mul v18260, v18258 - v18263 = add v18261, v18262 - v18264 = array_set mut v18254, index v18253, value v18263 - enable_side_effects u1 1 - v18265 = array_get v1, index u32 197 - enable_side_effects v18265 - v18266 = array_get v2, index u32 197 - v18267 = cast v18266 as u32 - v18268 = array_set v18264, index v18267, value Field 197 - v18270 = not v18265 - v18271 = array_get v18268, index v18267 - v18272 = array_get v18264, index v18267 - v18273 = cast v18265 as Field - v18274 = cast v18270 as Field - v18275 = mul v18273, v18271 - v18276 = mul v18274, v18272 - v18277 = add v18275, v18276 - v18278 = array_set mut v18268, index v18267, value v18277 - enable_side_effects u1 1 - v18279 = array_get v1, index u32 198 - enable_side_effects v18279 - v18280 = array_get v2, index u32 198 - v18281 = cast v18280 as u32 - v18282 = array_set v18278, index v18281, value Field 198 - v18284 = not v18279 - v18285 = array_get v18282, index v18281 - v18286 = array_get v18278, index v18281 - v18287 = cast v18279 as Field - v18288 = cast v18284 as Field - v18289 = mul v18287, v18285 - v18290 = mul v18288, v18286 - v18291 = add v18289, v18290 - v18292 = array_set mut v18282, index v18281, value v18291 - enable_side_effects u1 1 - v18293 = array_get v1, index u32 199 - enable_side_effects v18293 - v18294 = array_get v2, index u32 199 - v18295 = cast v18294 as u32 - v18296 = array_set v18292, index v18295, value Field 199 - v18298 = not v18293 - v18299 = array_get v18296, index v18295 - v18300 = array_get v18292, index v18295 - v18301 = cast v18293 as Field - v18302 = cast v18298 as Field - v18303 = mul v18301, v18299 - v18304 = mul v18302, v18300 - v18305 = add v18303, v18304 - v18306 = array_set mut v18296, index v18295, value v18305 - enable_side_effects u1 1 - v18307 = array_get v1, index u32 200 - enable_side_effects v18307 - v18308 = array_get v2, index u32 200 - v18309 = cast v18308 as u32 - v18310 = array_set v18306, index v18309, value Field 200 - v18312 = not v18307 - v18313 = array_get v18310, index v18309 - v18314 = array_get v18306, index v18309 - v18315 = cast v18307 as Field - v18316 = cast v18312 as Field - v18317 = mul v18315, v18313 - v18318 = mul v18316, v18314 - v18319 = add v18317, v18318 - v18320 = array_set mut v18310, index v18309, value v18319 - enable_side_effects u1 1 - v18321 = array_get v1, index u32 201 - enable_side_effects v18321 - v18322 = array_get v2, index u32 201 - v18323 = cast v18322 as u32 - v18324 = array_set v18320, index v18323, value Field 201 - v18326 = not v18321 - v18327 = array_get v18324, index v18323 - v18328 = array_get v18320, index v18323 - v18329 = cast v18321 as Field - v18330 = cast v18326 as Field - v18331 = mul v18329, v18327 - v18332 = mul v18330, v18328 - v18333 = add v18331, v18332 - v18334 = array_set mut v18324, index v18323, value v18333 - enable_side_effects u1 1 - v18335 = array_get v1, index u32 202 - enable_side_effects v18335 - v18336 = array_get v2, index u32 202 - v18337 = cast v18336 as u32 - v18338 = array_set v18334, index v18337, value Field 202 - v18340 = not v18335 - v18341 = array_get v18338, index v18337 - v18342 = array_get v18334, index v18337 - v18343 = cast v18335 as Field - v18344 = cast v18340 as Field - v18345 = mul v18343, v18341 - v18346 = mul v18344, v18342 - v18347 = add v18345, v18346 - v18348 = array_set mut v18338, index v18337, value v18347 - enable_side_effects u1 1 - v18349 = array_get v1, index u32 203 - enable_side_effects v18349 - v18350 = array_get v2, index u32 203 - v18351 = cast v18350 as u32 - v18352 = array_set v18348, index v18351, value Field 203 - v18354 = not v18349 - v18355 = array_get v18352, index v18351 - v18356 = array_get v18348, index v18351 - v18357 = cast v18349 as Field - v18358 = cast v18354 as Field - v18359 = mul v18357, v18355 - v18360 = mul v18358, v18356 - v18361 = add v18359, v18360 - v18362 = array_set mut v18352, index v18351, value v18361 - enable_side_effects u1 1 - v18363 = array_get v1, index u32 204 - enable_side_effects v18363 - v18364 = array_get v2, index u32 204 - v18365 = cast v18364 as u32 - v18366 = array_set v18362, index v18365, value Field 204 - v18368 = not v18363 - v18369 = array_get v18366, index v18365 - v18370 = array_get v18362, index v18365 - v18371 = cast v18363 as Field - v18372 = cast v18368 as Field - v18373 = mul v18371, v18369 - v18374 = mul v18372, v18370 - v18375 = add v18373, v18374 - v18376 = array_set mut v18366, index v18365, value v18375 - enable_side_effects u1 1 - v18377 = array_get v1, index u32 205 - enable_side_effects v18377 - v18378 = array_get v2, index u32 205 - v18379 = cast v18378 as u32 - v18380 = array_set v18376, index v18379, value Field 205 - v18382 = not v18377 - v18383 = array_get v18380, index v18379 - v18384 = array_get v18376, index v18379 - v18385 = cast v18377 as Field - v18386 = cast v18382 as Field - v18387 = mul v18385, v18383 - v18388 = mul v18386, v18384 - v18389 = add v18387, v18388 - v18390 = array_set mut v18380, index v18379, value v18389 - enable_side_effects u1 1 - v18391 = array_get v1, index u32 206 - enable_side_effects v18391 - v18392 = array_get v2, index u32 206 - v18393 = cast v18392 as u32 - v18394 = array_set v18390, index v18393, value Field 206 - v18396 = not v18391 - v18397 = array_get v18394, index v18393 - v18398 = array_get v18390, index v18393 - v18399 = cast v18391 as Field - v18400 = cast v18396 as Field - v18401 = mul v18399, v18397 - v18402 = mul v18400, v18398 - v18403 = add v18401, v18402 - v18404 = array_set mut v18394, index v18393, value v18403 - enable_side_effects u1 1 - v18405 = array_get v1, index u32 207 - enable_side_effects v18405 - v18406 = array_get v2, index u32 207 - v18407 = cast v18406 as u32 - v18408 = array_set v18404, index v18407, value Field 207 - v18410 = not v18405 - v18411 = array_get v18408, index v18407 - v18412 = array_get v18404, index v18407 - v18413 = cast v18405 as Field - v18414 = cast v18410 as Field - v18415 = mul v18413, v18411 - v18416 = mul v18414, v18412 - v18417 = add v18415, v18416 - v18418 = array_set mut v18408, index v18407, value v18417 - enable_side_effects u1 1 - v18419 = array_get v1, index u32 2⁴×13 - enable_side_effects v18419 - v18420 = array_get v2, index u32 2⁴×13 - v18421 = cast v18420 as u32 - v18422 = array_set v18418, index v18421, value Field 2⁴×13 - v18424 = not v18419 - v18425 = array_get v18422, index v18421 - v18426 = array_get v18418, index v18421 - v18427 = cast v18419 as Field - v18428 = cast v18424 as Field - v18429 = mul v18427, v18425 - v18430 = mul v18428, v18426 - v18431 = add v18429, v18430 - v18432 = array_set mut v18422, index v18421, value v18431 - enable_side_effects u1 1 - v18433 = array_get v1, index u32 209 - enable_side_effects v18433 - v18434 = array_get v2, index u32 209 - v18435 = cast v18434 as u32 - v18436 = array_set v18432, index v18435, value Field 209 - v18438 = not v18433 - v18439 = array_get v18436, index v18435 - v18440 = array_get v18432, index v18435 - v18441 = cast v18433 as Field - v18442 = cast v18438 as Field - v18443 = mul v18441, v18439 - v18444 = mul v18442, v18440 - v18445 = add v18443, v18444 - v18446 = array_set mut v18436, index v18435, value v18445 - enable_side_effects u1 1 - v18447 = array_get v1, index u32 210 - enable_side_effects v18447 - v18448 = array_get v2, index u32 210 - v18449 = cast v18448 as u32 - v18450 = array_set v18446, index v18449, value Field 210 - v18452 = not v18447 - v18453 = array_get v18450, index v18449 - v18454 = array_get v18446, index v18449 - v18455 = cast v18447 as Field - v18456 = cast v18452 as Field - v18457 = mul v18455, v18453 - v18458 = mul v18456, v18454 - v18459 = add v18457, v18458 - v18460 = array_set mut v18450, index v18449, value v18459 - enable_side_effects u1 1 - v18461 = array_get v1, index u32 211 - enable_side_effects v18461 - v18462 = array_get v2, index u32 211 - v18463 = cast v18462 as u32 - v18464 = array_set v18460, index v18463, value Field 211 - v18466 = not v18461 - v18467 = array_get v18464, index v18463 - v18468 = array_get v18460, index v18463 - v18469 = cast v18461 as Field - v18470 = cast v18466 as Field - v18471 = mul v18469, v18467 - v18472 = mul v18470, v18468 - v18473 = add v18471, v18472 - v18474 = array_set mut v18464, index v18463, value v18473 - enable_side_effects u1 1 - v18475 = array_get v1, index u32 212 - enable_side_effects v18475 - v18476 = array_get v2, index u32 212 - v18477 = cast v18476 as u32 - v18478 = array_set v18474, index v18477, value Field 212 - v18480 = not v18475 - v18481 = array_get v18478, index v18477 - v18482 = array_get v18474, index v18477 - v18483 = cast v18475 as Field - v18484 = cast v18480 as Field - v18485 = mul v18483, v18481 - v18486 = mul v18484, v18482 - v18487 = add v18485, v18486 - v18488 = array_set mut v18478, index v18477, value v18487 - enable_side_effects u1 1 - v18489 = array_get v1, index u32 213 - enable_side_effects v18489 - v18490 = array_get v2, index u32 213 - v18491 = cast v18490 as u32 - v18492 = array_set v18488, index v18491, value Field 213 - v18494 = not v18489 - v18495 = array_get v18492, index v18491 - v18496 = array_get v18488, index v18491 - v18497 = cast v18489 as Field - v18498 = cast v18494 as Field - v18499 = mul v18497, v18495 - v18500 = mul v18498, v18496 - v18501 = add v18499, v18500 - v18502 = array_set mut v18492, index v18491, value v18501 - enable_side_effects u1 1 - v18503 = array_get v1, index u32 214 - enable_side_effects v18503 - v18504 = array_get v2, index u32 214 - v18505 = cast v18504 as u32 - v18506 = array_set v18502, index v18505, value Field 214 - v18508 = not v18503 - v18509 = array_get v18506, index v18505 - v18510 = array_get v18502, index v18505 - v18511 = cast v18503 as Field - v18512 = cast v18508 as Field - v18513 = mul v18511, v18509 - v18514 = mul v18512, v18510 - v18515 = add v18513, v18514 - v18516 = array_set mut v18506, index v18505, value v18515 - enable_side_effects u1 1 - v18517 = array_get v1, index u32 215 - enable_side_effects v18517 - v18518 = array_get v2, index u32 215 - v18519 = cast v18518 as u32 - v18520 = array_set v18516, index v18519, value Field 215 - v18522 = not v18517 - v18523 = array_get v18520, index v18519 - v18524 = array_get v18516, index v18519 - v18525 = cast v18517 as Field - v18526 = cast v18522 as Field - v18527 = mul v18525, v18523 - v18528 = mul v18526, v18524 - v18529 = add v18527, v18528 - v18530 = array_set mut v18520, index v18519, value v18529 - enable_side_effects u1 1 - v18531 = array_get v1, index u32 216 - enable_side_effects v18531 - v18532 = array_get v2, index u32 216 - v18533 = cast v18532 as u32 - v18534 = array_set v18530, index v18533, value Field 216 - v18536 = not v18531 - v18537 = array_get v18534, index v18533 - v18538 = array_get v18530, index v18533 - v18539 = cast v18531 as Field - v18540 = cast v18536 as Field - v18541 = mul v18539, v18537 - v18542 = mul v18540, v18538 - v18543 = add v18541, v18542 - v18544 = array_set mut v18534, index v18533, value v18543 - enable_side_effects u1 1 - v18545 = array_get v1, index u32 217 - enable_side_effects v18545 - v18546 = array_get v2, index u32 217 - v18547 = cast v18546 as u32 - v18548 = array_set v18544, index v18547, value Field 217 - v18550 = not v18545 - v18551 = array_get v18548, index v18547 - v18552 = array_get v18544, index v18547 - v18553 = cast v18545 as Field - v18554 = cast v18550 as Field - v18555 = mul v18553, v18551 - v18556 = mul v18554, v18552 - v18557 = add v18555, v18556 - v18558 = array_set mut v18548, index v18547, value v18557 - enable_side_effects u1 1 - v18559 = array_get v1, index u32 218 - enable_side_effects v18559 - v18560 = array_get v2, index u32 218 - v18561 = cast v18560 as u32 - v18562 = array_set v18558, index v18561, value Field 218 - v18564 = not v18559 - v18565 = array_get v18562, index v18561 - v18566 = array_get v18558, index v18561 - v18567 = cast v18559 as Field - v18568 = cast v18564 as Field - v18569 = mul v18567, v18565 - v18570 = mul v18568, v18566 - v18571 = add v18569, v18570 - v18572 = array_set mut v18562, index v18561, value v18571 - enable_side_effects u1 1 - v18573 = array_get v1, index u32 219 - enable_side_effects v18573 - v18574 = array_get v2, index u32 219 - v18575 = cast v18574 as u32 - v18576 = array_set v18572, index v18575, value Field 219 - v18578 = not v18573 - v18579 = array_get v18576, index v18575 - v18580 = array_get v18572, index v18575 - v18581 = cast v18573 as Field - v18582 = cast v18578 as Field - v18583 = mul v18581, v18579 - v18584 = mul v18582, v18580 - v18585 = add v18583, v18584 - v18586 = array_set mut v18576, index v18575, value v18585 - enable_side_effects u1 1 - v18587 = array_get v1, index u32 220 - enable_side_effects v18587 - v18588 = array_get v2, index u32 220 - v18589 = cast v18588 as u32 - v18590 = array_set v18586, index v18589, value Field 220 - v18592 = not v18587 - v18593 = array_get v18590, index v18589 - v18594 = array_get v18586, index v18589 - v18595 = cast v18587 as Field - v18596 = cast v18592 as Field - v18597 = mul v18595, v18593 - v18598 = mul v18596, v18594 - v18599 = add v18597, v18598 - v18600 = array_set mut v18590, index v18589, value v18599 - enable_side_effects u1 1 - v18601 = array_get v1, index u32 221 - enable_side_effects v18601 - v18602 = array_get v2, index u32 221 - v18603 = cast v18602 as u32 - v18604 = array_set v18600, index v18603, value Field 221 - v18606 = not v18601 - v18607 = array_get v18604, index v18603 - v18608 = array_get v18600, index v18603 - v18609 = cast v18601 as Field - v18610 = cast v18606 as Field - v18611 = mul v18609, v18607 - v18612 = mul v18610, v18608 - v18613 = add v18611, v18612 - v18614 = array_set mut v18604, index v18603, value v18613 - enable_side_effects u1 1 - v18615 = array_get v1, index u32 222 - enable_side_effects v18615 - v18616 = array_get v2, index u32 222 - v18617 = cast v18616 as u32 - v18618 = array_set v18614, index v18617, value Field 222 - v18620 = not v18615 - v18621 = array_get v18618, index v18617 - v18622 = array_get v18614, index v18617 - v18623 = cast v18615 as Field - v18624 = cast v18620 as Field - v18625 = mul v18623, v18621 - v18626 = mul v18624, v18622 - v18627 = add v18625, v18626 - v18628 = array_set mut v18618, index v18617, value v18627 - enable_side_effects u1 1 - v18629 = array_get v1, index u32 223 - enable_side_effects v18629 - v18630 = array_get v2, index u32 223 - v18631 = cast v18630 as u32 - v18632 = array_set v18628, index v18631, value Field 223 - v18634 = not v18629 - v18635 = array_get v18632, index v18631 - v18636 = array_get v18628, index v18631 - v18637 = cast v18629 as Field - v18638 = cast v18634 as Field - v18639 = mul v18637, v18635 - v18640 = mul v18638, v18636 - v18641 = add v18639, v18640 - v18642 = array_set mut v18632, index v18631, value v18641 - enable_side_effects u1 1 - v18643 = array_get v1, index u32 2⁴×14 - enable_side_effects v18643 - v18644 = array_get v2, index u32 2⁴×14 - v18645 = cast v18644 as u32 - v18646 = array_set v18642, index v18645, value Field 2⁴×14 - v18648 = not v18643 - v18649 = array_get v18646, index v18645 - v18650 = array_get v18642, index v18645 - v18651 = cast v18643 as Field - v18652 = cast v18648 as Field - v18653 = mul v18651, v18649 - v18654 = mul v18652, v18650 - v18655 = add v18653, v18654 - v18656 = array_set mut v18646, index v18645, value v18655 - enable_side_effects u1 1 - v18657 = array_get v1, index u32 225 - enable_side_effects v18657 - v18658 = array_get v2, index u32 225 - v18659 = cast v18658 as u32 - v18660 = array_set v18656, index v18659, value Field 225 - v18662 = not v18657 - v18663 = array_get v18660, index v18659 - v18664 = array_get v18656, index v18659 - v18665 = cast v18657 as Field - v18666 = cast v18662 as Field - v18667 = mul v18665, v18663 - v18668 = mul v18666, v18664 - v18669 = add v18667, v18668 - v18670 = array_set mut v18660, index v18659, value v18669 - enable_side_effects u1 1 - v18671 = array_get v1, index u32 226 - enable_side_effects v18671 - v18672 = array_get v2, index u32 226 - v18673 = cast v18672 as u32 - v18674 = array_set v18670, index v18673, value Field 226 - v18676 = not v18671 - v18677 = array_get v18674, index v18673 - v18678 = array_get v18670, index v18673 - v18679 = cast v18671 as Field - v18680 = cast v18676 as Field - v18681 = mul v18679, v18677 - v18682 = mul v18680, v18678 - v18683 = add v18681, v18682 - v18684 = array_set mut v18674, index v18673, value v18683 - enable_side_effects u1 1 - v18685 = array_get v1, index u32 227 - enable_side_effects v18685 - v18686 = array_get v2, index u32 227 - v18687 = cast v18686 as u32 - v18688 = array_set v18684, index v18687, value Field 227 - v18690 = not v18685 - v18691 = array_get v18688, index v18687 - v18692 = array_get v18684, index v18687 - v18693 = cast v18685 as Field - v18694 = cast v18690 as Field - v18695 = mul v18693, v18691 - v18696 = mul v18694, v18692 - v18697 = add v18695, v18696 - v18698 = array_set mut v18688, index v18687, value v18697 - enable_side_effects u1 1 - v18699 = array_get v1, index u32 228 - enable_side_effects v18699 - v18700 = array_get v2, index u32 228 - v18701 = cast v18700 as u32 - v18702 = array_set v18698, index v18701, value Field 228 - v18704 = not v18699 - v18705 = array_get v18702, index v18701 - v18706 = array_get v18698, index v18701 - v18707 = cast v18699 as Field - v18708 = cast v18704 as Field - v18709 = mul v18707, v18705 - v18710 = mul v18708, v18706 - v18711 = add v18709, v18710 - v18712 = array_set mut v18702, index v18701, value v18711 - enable_side_effects u1 1 - v18713 = array_get v1, index u32 229 - enable_side_effects v18713 - v18714 = array_get v2, index u32 229 - v18715 = cast v18714 as u32 - v18716 = array_set v18712, index v18715, value Field 229 - v18718 = not v18713 - v18719 = array_get v18716, index v18715 - v18720 = array_get v18712, index v18715 - v18721 = cast v18713 as Field - v18722 = cast v18718 as Field - v18723 = mul v18721, v18719 - v18724 = mul v18722, v18720 - v18725 = add v18723, v18724 - v18726 = array_set mut v18716, index v18715, value v18725 - enable_side_effects u1 1 - v18727 = array_get v1, index u32 230 - enable_side_effects v18727 - v18728 = array_get v2, index u32 230 - v18729 = cast v18728 as u32 - v18730 = array_set v18726, index v18729, value Field 230 - v18732 = not v18727 - v18733 = array_get v18730, index v18729 - v18734 = array_get v18726, index v18729 - v18735 = cast v18727 as Field - v18736 = cast v18732 as Field - v18737 = mul v18735, v18733 - v18738 = mul v18736, v18734 - v18739 = add v18737, v18738 - v18740 = array_set mut v18730, index v18729, value v18739 - enable_side_effects u1 1 - v18741 = array_get v1, index u32 231 - enable_side_effects v18741 - v18742 = array_get v2, index u32 231 - v18743 = cast v18742 as u32 - v18744 = array_set v18740, index v18743, value Field 231 - v18746 = not v18741 - v18747 = array_get v18744, index v18743 - v18748 = array_get v18740, index v18743 - v18749 = cast v18741 as Field - v18750 = cast v18746 as Field - v18751 = mul v18749, v18747 - v18752 = mul v18750, v18748 - v18753 = add v18751, v18752 - v18754 = array_set mut v18744, index v18743, value v18753 - enable_side_effects u1 1 - v18755 = array_get v1, index u32 232 - enable_side_effects v18755 - v18756 = array_get v2, index u32 232 - v18757 = cast v18756 as u32 - v18758 = array_set v18754, index v18757, value Field 232 - v18760 = not v18755 - v18761 = array_get v18758, index v18757 - v18762 = array_get v18754, index v18757 - v18763 = cast v18755 as Field - v18764 = cast v18760 as Field - v18765 = mul v18763, v18761 - v18766 = mul v18764, v18762 - v18767 = add v18765, v18766 - v18768 = array_set mut v18758, index v18757, value v18767 - enable_side_effects u1 1 - v18769 = array_get v1, index u32 233 - enable_side_effects v18769 - v18770 = array_get v2, index u32 233 - v18771 = cast v18770 as u32 - v18772 = array_set v18768, index v18771, value Field 233 - v18774 = not v18769 - v18775 = array_get v18772, index v18771 - v18776 = array_get v18768, index v18771 - v18777 = cast v18769 as Field - v18778 = cast v18774 as Field - v18779 = mul v18777, v18775 - v18780 = mul v18778, v18776 - v18781 = add v18779, v18780 - v18782 = array_set mut v18772, index v18771, value v18781 - enable_side_effects u1 1 - v18783 = array_get v1, index u32 234 - enable_side_effects v18783 - v18784 = array_get v2, index u32 234 - v18785 = cast v18784 as u32 - v18786 = array_set v18782, index v18785, value Field 234 - v18788 = not v18783 - v18789 = array_get v18786, index v18785 - v18790 = array_get v18782, index v18785 - v18791 = cast v18783 as Field - v18792 = cast v18788 as Field - v18793 = mul v18791, v18789 - v18794 = mul v18792, v18790 - v18795 = add v18793, v18794 - v18796 = array_set mut v18786, index v18785, value v18795 - enable_side_effects u1 1 - v18797 = array_get v1, index u32 235 - enable_side_effects v18797 - v18798 = array_get v2, index u32 235 - v18799 = cast v18798 as u32 - v18800 = array_set v18796, index v18799, value Field 235 - v18802 = not v18797 - v18803 = array_get v18800, index v18799 - v18804 = array_get v18796, index v18799 - v18805 = cast v18797 as Field - v18806 = cast v18802 as Field - v18807 = mul v18805, v18803 - v18808 = mul v18806, v18804 - v18809 = add v18807, v18808 - v18810 = array_set mut v18800, index v18799, value v18809 - enable_side_effects u1 1 - v18811 = array_get v1, index u32 236 - enable_side_effects v18811 - v18812 = array_get v2, index u32 236 - v18813 = cast v18812 as u32 - v18814 = array_set v18810, index v18813, value Field 236 - v18816 = not v18811 - v18817 = array_get v18814, index v18813 - v18818 = array_get v18810, index v18813 - v18819 = cast v18811 as Field - v18820 = cast v18816 as Field - v18821 = mul v18819, v18817 - v18822 = mul v18820, v18818 - v18823 = add v18821, v18822 - v18824 = array_set mut v18814, index v18813, value v18823 - enable_side_effects u1 1 - v18825 = array_get v1, index u32 237 - enable_side_effects v18825 - v18826 = array_get v2, index u32 237 - v18827 = cast v18826 as u32 - v18828 = array_set v18824, index v18827, value Field 237 - v18830 = not v18825 - v18831 = array_get v18828, index v18827 - v18832 = array_get v18824, index v18827 - v18833 = cast v18825 as Field - v18834 = cast v18830 as Field - v18835 = mul v18833, v18831 - v18836 = mul v18834, v18832 - v18837 = add v18835, v18836 - v18838 = array_set mut v18828, index v18827, value v18837 - enable_side_effects u1 1 - v18839 = array_get v1, index u32 238 - enable_side_effects v18839 - v18840 = array_get v2, index u32 238 - v18841 = cast v18840 as u32 - v18842 = array_set v18838, index v18841, value Field 238 - v18844 = not v18839 - v18845 = array_get v18842, index v18841 - v18846 = array_get v18838, index v18841 - v18847 = cast v18839 as Field - v18848 = cast v18844 as Field - v18849 = mul v18847, v18845 - v18850 = mul v18848, v18846 - v18851 = add v18849, v18850 - v18852 = array_set mut v18842, index v18841, value v18851 - enable_side_effects u1 1 - v18853 = array_get v1, index u32 239 - enable_side_effects v18853 - v18854 = array_get v2, index u32 239 - v18855 = cast v18854 as u32 - v18856 = array_set v18852, index v18855, value Field 239 - v18858 = not v18853 - v18859 = array_get v18856, index v18855 - v18860 = array_get v18852, index v18855 - v18861 = cast v18853 as Field - v18862 = cast v18858 as Field - v18863 = mul v18861, v18859 - v18864 = mul v18862, v18860 - v18865 = add v18863, v18864 - v18866 = array_set mut v18856, index v18855, value v18865 - enable_side_effects u1 1 - v18867 = array_get v1, index u32 2⁴×15 - enable_side_effects v18867 - v18868 = array_get v2, index u32 2⁴×15 - v18869 = cast v18868 as u32 - v18870 = array_set v18866, index v18869, value Field 2⁴×15 - v18872 = not v18867 - v18873 = array_get v18870, index v18869 - v18874 = array_get v18866, index v18869 - v18875 = cast v18867 as Field - v18876 = cast v18872 as Field - v18877 = mul v18875, v18873 - v18878 = mul v18876, v18874 - v18879 = add v18877, v18878 - v18880 = array_set mut v18870, index v18869, value v18879 - enable_side_effects u1 1 - v18881 = array_get v1, index u32 241 - enable_side_effects v18881 - v18882 = array_get v2, index u32 241 - v18883 = cast v18882 as u32 - v18884 = array_set v18880, index v18883, value Field 241 - v18886 = not v18881 - v18887 = array_get v18884, index v18883 - v18888 = array_get v18880, index v18883 - v18889 = cast v18881 as Field - v18890 = cast v18886 as Field - v18891 = mul v18889, v18887 - v18892 = mul v18890, v18888 - v18893 = add v18891, v18892 - v18894 = array_set mut v18884, index v18883, value v18893 - enable_side_effects u1 1 - v18895 = array_get v1, index u32 242 - enable_side_effects v18895 - v18896 = array_get v2, index u32 242 - v18897 = cast v18896 as u32 - v18898 = array_set v18894, index v18897, value Field 242 - v18900 = not v18895 - v18901 = array_get v18898, index v18897 - v18902 = array_get v18894, index v18897 - v18903 = cast v18895 as Field - v18904 = cast v18900 as Field - v18905 = mul v18903, v18901 - v18906 = mul v18904, v18902 - v18907 = add v18905, v18906 - v18908 = array_set mut v18898, index v18897, value v18907 - enable_side_effects u1 1 - v18909 = array_get v1, index u32 243 - enable_side_effects v18909 - v18910 = array_get v2, index u32 243 - v18911 = cast v18910 as u32 - v18912 = array_set v18908, index v18911, value Field 243 - v18914 = not v18909 - v18915 = array_get v18912, index v18911 - v18916 = array_get v18908, index v18911 - v18917 = cast v18909 as Field - v18918 = cast v18914 as Field - v18919 = mul v18917, v18915 - v18920 = mul v18918, v18916 - v18921 = add v18919, v18920 - v18922 = array_set mut v18912, index v18911, value v18921 - enable_side_effects u1 1 - v18923 = array_get v1, index u32 244 - enable_side_effects v18923 - v18924 = array_get v2, index u32 244 - v18925 = cast v18924 as u32 - v18926 = array_set v18922, index v18925, value Field 244 - v18928 = not v18923 - v18929 = array_get v18926, index v18925 - v18930 = array_get v18922, index v18925 - v18931 = cast v18923 as Field - v18932 = cast v18928 as Field - v18933 = mul v18931, v18929 - v18934 = mul v18932, v18930 - v18935 = add v18933, v18934 - v18936 = array_set mut v18926, index v18925, value v18935 - enable_side_effects u1 1 - v18937 = array_get v1, index u32 245 - enable_side_effects v18937 - v18938 = array_get v2, index u32 245 - v18939 = cast v18938 as u32 - v18940 = array_set v18936, index v18939, value Field 245 - v18942 = not v18937 - v18943 = array_get v18940, index v18939 - v18944 = array_get v18936, index v18939 - v18945 = cast v18937 as Field - v18946 = cast v18942 as Field - v18947 = mul v18945, v18943 - v18948 = mul v18946, v18944 - v18949 = add v18947, v18948 - v18950 = array_set mut v18940, index v18939, value v18949 - enable_side_effects u1 1 - v18951 = array_get v1, index u32 246 - enable_side_effects v18951 - v18952 = array_get v2, index u32 246 - v18953 = cast v18952 as u32 - v18954 = array_set v18950, index v18953, value Field 246 - v18956 = not v18951 - v18957 = array_get v18954, index v18953 - v18958 = array_get v18950, index v18953 - v18959 = cast v18951 as Field - v18960 = cast v18956 as Field - v18961 = mul v18959, v18957 - v18962 = mul v18960, v18958 - v18963 = add v18961, v18962 - v18964 = array_set mut v18954, index v18953, value v18963 - enable_side_effects u1 1 - v18965 = array_get v1, index u32 247 - enable_side_effects v18965 - v18966 = array_get v2, index u32 247 - v18967 = cast v18966 as u32 - v18968 = array_set v18964, index v18967, value Field 247 - v18970 = not v18965 - v18971 = array_get v18968, index v18967 - v18972 = array_get v18964, index v18967 - v18973 = cast v18965 as Field - v18974 = cast v18970 as Field - v18975 = mul v18973, v18971 - v18976 = mul v18974, v18972 - v18977 = add v18975, v18976 - v18978 = array_set mut v18968, index v18967, value v18977 - enable_side_effects u1 1 - v18979 = array_get v1, index u32 248 - enable_side_effects v18979 - v18980 = array_get v2, index u32 248 - v18981 = cast v18980 as u32 - v18982 = array_set v18978, index v18981, value Field 248 - v18984 = not v18979 - v18985 = array_get v18982, index v18981 - v18986 = array_get v18978, index v18981 - v18987 = cast v18979 as Field - v18988 = cast v18984 as Field - v18989 = mul v18987, v18985 - v18990 = mul v18988, v18986 - v18991 = add v18989, v18990 - v18992 = array_set mut v18982, index v18981, value v18991 - enable_side_effects u1 1 - v18993 = array_get v1, index u32 249 - enable_side_effects v18993 - v18994 = array_get v2, index u32 249 - v18995 = cast v18994 as u32 - v18996 = array_set v18992, index v18995, value Field 249 - v18998 = not v18993 - v18999 = array_get v18996, index v18995 - v19000 = array_get v18992, index v18995 - v19001 = cast v18993 as Field - v19002 = cast v18998 as Field - v19003 = mul v19001, v18999 - v19004 = mul v19002, v19000 - v19005 = add v19003, v19004 - v19006 = array_set mut v18996, index v18995, value v19005 - enable_side_effects u1 1 - v19007 = array_get v1, index u32 250 - enable_side_effects v19007 - v19008 = array_get v2, index u32 250 - v19009 = cast v19008 as u32 - v19010 = array_set v19006, index v19009, value Field 250 - v19012 = not v19007 - v19013 = array_get v19010, index v19009 - v19014 = array_get v19006, index v19009 - v19015 = cast v19007 as Field - v19016 = cast v19012 as Field - v19017 = mul v19015, v19013 - v19018 = mul v19016, v19014 - v19019 = add v19017, v19018 - v19020 = array_set mut v19010, index v19009, value v19019 - enable_side_effects u1 1 - v19021 = array_get v1, index u32 251 - enable_side_effects v19021 - v19022 = array_get v2, index u32 251 - v19023 = cast v19022 as u32 - v19024 = array_set v19020, index v19023, value Field 251 - v19026 = not v19021 - v19027 = array_get v19024, index v19023 - v19028 = array_get v19020, index v19023 - v19029 = cast v19021 as Field - v19030 = cast v19026 as Field - v19031 = mul v19029, v19027 - v19032 = mul v19030, v19028 - v19033 = add v19031, v19032 - v19034 = array_set mut v19024, index v19023, value v19033 - enable_side_effects u1 1 - v19035 = array_get v1, index u32 252 - enable_side_effects v19035 - v19036 = array_get v2, index u32 252 - v19037 = cast v19036 as u32 - v19038 = array_set v19034, index v19037, value Field 252 - v19040 = not v19035 - v19041 = array_get v19038, index v19037 - v19042 = array_get v19034, index v19037 - v19043 = cast v19035 as Field - v19044 = cast v19040 as Field - v19045 = mul v19043, v19041 - v19046 = mul v19044, v19042 - v19047 = add v19045, v19046 - v19048 = array_set mut v19038, index v19037, value v19047 - enable_side_effects u1 1 - v19049 = array_get v1, index u32 253 - enable_side_effects v19049 - v19050 = array_get v2, index u32 253 - v19051 = cast v19050 as u32 - v19052 = array_set v19048, index v19051, value Field 253 - v19054 = not v19049 - v19055 = array_get v19052, index v19051 - v19056 = array_get v19048, index v19051 - v19057 = cast v19049 as Field - v19058 = cast v19054 as Field - v19059 = mul v19057, v19055 - v19060 = mul v19058, v19056 - v19061 = add v19059, v19060 - v19062 = array_set mut v19052, index v19051, value v19061 - enable_side_effects u1 1 - v19063 = array_get v1, index u32 254 - enable_side_effects v19063 - v19064 = array_get v2, index u32 254 - v19065 = cast v19064 as u32 - v19066 = array_set v19062, index v19065, value Field 254 - v19068 = not v19063 - v19069 = array_get v19066, index v19065 - v19070 = array_get v19062, index v19065 - v19071 = cast v19063 as Field - v19072 = cast v19068 as Field - v19073 = mul v19071, v19069 - v19074 = mul v19072, v19070 - v19075 = add v19073, v19074 - v19076 = array_set mut v19066, index v19065, value v19075 - enable_side_effects u1 1 - v19077 = array_get v1, index u32 255 - enable_side_effects v19077 - v19078 = array_get v2, index u32 255 - v19079 = cast v19078 as u32 - v19080 = array_set v19076, index v19079, value Field 255 - v19082 = not v19077 - v19083 = array_get v19080, index v19079 - v19084 = array_get v19076, index v19079 - v19085 = cast v19077 as Field - v19086 = cast v19082 as Field - v19087 = mul v19085, v19083 - v19088 = mul v19086, v19084 - v19089 = add v19087, v19088 - v19090 = array_set mut v19080, index v19079, value v19089 - enable_side_effects u1 1 - v19091 = array_get v1, index u32 2⁸ - enable_side_effects v19091 - v19092 = array_get v2, index u32 2⁸ - v19093 = cast v19092 as u32 - v19094 = array_set v19090, index v19093, value Field 2⁸ - v19096 = not v19091 - v19097 = array_get v19094, index v19093 - v19098 = array_get v19090, index v19093 - v19099 = cast v19091 as Field - v19100 = cast v19096 as Field - v19101 = mul v19099, v19097 - v19102 = mul v19100, v19098 - v19103 = add v19101, v19102 - v19104 = array_set mut v19094, index v19093, value v19103 - enable_side_effects u1 1 - v19105 = array_get v1, index u32 257 - enable_side_effects v19105 - v19106 = array_get v2, index u32 257 - v19107 = cast v19106 as u32 - v19108 = array_set v19104, index v19107, value Field 257 - v19110 = not v19105 - v19111 = array_get v19108, index v19107 - v19112 = array_get v19104, index v19107 - v19113 = cast v19105 as Field - v19114 = cast v19110 as Field - v19115 = mul v19113, v19111 - v19116 = mul v19114, v19112 - v19117 = add v19115, v19116 - v19118 = array_set mut v19108, index v19107, value v19117 - enable_side_effects u1 1 - v19119 = array_get v1, index u32 258 - enable_side_effects v19119 - v19120 = array_get v2, index u32 258 - v19121 = cast v19120 as u32 - v19122 = array_set v19118, index v19121, value Field 258 - v19124 = not v19119 - v19125 = array_get v19122, index v19121 - v19126 = array_get v19118, index v19121 - v19127 = cast v19119 as Field - v19128 = cast v19124 as Field - v19129 = mul v19127, v19125 - v19130 = mul v19128, v19126 - v19131 = add v19129, v19130 - v19132 = array_set mut v19122, index v19121, value v19131 - enable_side_effects u1 1 - v19133 = array_get v1, index u32 259 - enable_side_effects v19133 - v19134 = array_get v2, index u32 259 - v19135 = cast v19134 as u32 - v19136 = array_set v19132, index v19135, value Field 259 - v19138 = not v19133 - v19139 = array_get v19136, index v19135 - v19140 = array_get v19132, index v19135 - v19141 = cast v19133 as Field - v19142 = cast v19138 as Field - v19143 = mul v19141, v19139 - v19144 = mul v19142, v19140 - v19145 = add v19143, v19144 - v19146 = array_set mut v19136, index v19135, value v19145 - enable_side_effects u1 1 - v19147 = array_get v1, index u32 260 - enable_side_effects v19147 - v19148 = array_get v2, index u32 260 - v19149 = cast v19148 as u32 - v19150 = array_set v19146, index v19149, value Field 260 - v19152 = not v19147 - v19153 = array_get v19150, index v19149 - v19154 = array_get v19146, index v19149 - v19155 = cast v19147 as Field - v19156 = cast v19152 as Field - v19157 = mul v19155, v19153 - v19158 = mul v19156, v19154 - v19159 = add v19157, v19158 - v19160 = array_set mut v19150, index v19149, value v19159 - enable_side_effects u1 1 - v19161 = array_get v1, index u32 261 - enable_side_effects v19161 - v19162 = array_get v2, index u32 261 - v19163 = cast v19162 as u32 - v19164 = array_set v19160, index v19163, value Field 261 - v19166 = not v19161 - v19167 = array_get v19164, index v19163 - v19168 = array_get v19160, index v19163 - v19169 = cast v19161 as Field - v19170 = cast v19166 as Field - v19171 = mul v19169, v19167 - v19172 = mul v19170, v19168 - v19173 = add v19171, v19172 - v19174 = array_set mut v19164, index v19163, value v19173 - enable_side_effects u1 1 - v19175 = array_get v1, index u32 262 - enable_side_effects v19175 - v19176 = array_get v2, index u32 262 - v19177 = cast v19176 as u32 - v19178 = array_set v19174, index v19177, value Field 262 - v19180 = not v19175 - v19181 = array_get v19178, index v19177 - v19182 = array_get v19174, index v19177 - v19183 = cast v19175 as Field - v19184 = cast v19180 as Field - v19185 = mul v19183, v19181 - v19186 = mul v19184, v19182 - v19187 = add v19185, v19186 - v19188 = array_set mut v19178, index v19177, value v19187 - enable_side_effects u1 1 - v19189 = array_get v1, index u32 263 - enable_side_effects v19189 - v19190 = array_get v2, index u32 263 - v19191 = cast v19190 as u32 - v19192 = array_set v19188, index v19191, value Field 263 - v19194 = not v19189 - v19195 = array_get v19192, index v19191 - v19196 = array_get v19188, index v19191 - v19197 = cast v19189 as Field - v19198 = cast v19194 as Field - v19199 = mul v19197, v19195 - v19200 = mul v19198, v19196 - v19201 = add v19199, v19200 - v19202 = array_set mut v19192, index v19191, value v19201 - enable_side_effects u1 1 - v19203 = array_get v1, index u32 264 - enable_side_effects v19203 - v19204 = array_get v2, index u32 264 - v19205 = cast v19204 as u32 - v19206 = array_set v19202, index v19205, value Field 264 - v19208 = not v19203 - v19209 = array_get v19206, index v19205 - v19210 = array_get v19202, index v19205 - v19211 = cast v19203 as Field - v19212 = cast v19208 as Field - v19213 = mul v19211, v19209 - v19214 = mul v19212, v19210 - v19215 = add v19213, v19214 - v19216 = array_set mut v19206, index v19205, value v19215 - enable_side_effects u1 1 - v19217 = array_get v1, index u32 265 - enable_side_effects v19217 - v19218 = array_get v2, index u32 265 - v19219 = cast v19218 as u32 - v19220 = array_set v19216, index v19219, value Field 265 - v19222 = not v19217 - v19223 = array_get v19220, index v19219 - v19224 = array_get v19216, index v19219 - v19225 = cast v19217 as Field - v19226 = cast v19222 as Field - v19227 = mul v19225, v19223 - v19228 = mul v19226, v19224 - v19229 = add v19227, v19228 - v19230 = array_set mut v19220, index v19219, value v19229 - enable_side_effects u1 1 - v19231 = array_get v1, index u32 266 - enable_side_effects v19231 - v19232 = array_get v2, index u32 266 - v19233 = cast v19232 as u32 - v19234 = array_set v19230, index v19233, value Field 266 - v19236 = not v19231 - v19237 = array_get v19234, index v19233 - v19238 = array_get v19230, index v19233 - v19239 = cast v19231 as Field - v19240 = cast v19236 as Field - v19241 = mul v19239, v19237 - v19242 = mul v19240, v19238 - v19243 = add v19241, v19242 - v19244 = array_set mut v19234, index v19233, value v19243 - enable_side_effects u1 1 - v19245 = array_get v1, index u32 267 - enable_side_effects v19245 - v19246 = array_get v2, index u32 267 - v19247 = cast v19246 as u32 - v19248 = array_set v19244, index v19247, value Field 267 - v19250 = not v19245 - v19251 = array_get v19248, index v19247 - v19252 = array_get v19244, index v19247 - v19253 = cast v19245 as Field - v19254 = cast v19250 as Field - v19255 = mul v19253, v19251 - v19256 = mul v19254, v19252 - v19257 = add v19255, v19256 - v19258 = array_set mut v19248, index v19247, value v19257 - enable_side_effects u1 1 - v19259 = array_get v1, index u32 268 - enable_side_effects v19259 - v19260 = array_get v2, index u32 268 - v19261 = cast v19260 as u32 - v19262 = array_set v19258, index v19261, value Field 268 - v19264 = not v19259 - v19265 = array_get v19262, index v19261 - v19266 = array_get v19258, index v19261 - v19267 = cast v19259 as Field - v19268 = cast v19264 as Field - v19269 = mul v19267, v19265 - v19270 = mul v19268, v19266 - v19271 = add v19269, v19270 - v19272 = array_set mut v19262, index v19261, value v19271 - enable_side_effects u1 1 - v19273 = array_get v1, index u32 269 - enable_side_effects v19273 - v19274 = array_get v2, index u32 269 - v19275 = cast v19274 as u32 - v19276 = array_set v19272, index v19275, value Field 269 - v19278 = not v19273 - v19279 = array_get v19276, index v19275 - v19280 = array_get v19272, index v19275 - v19281 = cast v19273 as Field - v19282 = cast v19278 as Field - v19283 = mul v19281, v19279 - v19284 = mul v19282, v19280 - v19285 = add v19283, v19284 - v19286 = array_set mut v19276, index v19275, value v19285 - enable_side_effects u1 1 - v19287 = array_get v1, index u32 270 - enable_side_effects v19287 - v19288 = array_get v2, index u32 270 - v19289 = cast v19288 as u32 - v19290 = array_set v19286, index v19289, value Field 270 - v19292 = not v19287 - v19293 = array_get v19290, index v19289 - v19294 = array_get v19286, index v19289 - v19295 = cast v19287 as Field - v19296 = cast v19292 as Field - v19297 = mul v19295, v19293 - v19298 = mul v19296, v19294 - v19299 = add v19297, v19298 - v19300 = array_set mut v19290, index v19289, value v19299 - enable_side_effects u1 1 - v19301 = array_get v1, index u32 271 - enable_side_effects v19301 - v19302 = array_get v2, index u32 271 - v19303 = cast v19302 as u32 - v19304 = array_set v19300, index v19303, value Field 271 - v19306 = not v19301 - v19307 = array_get v19304, index v19303 - v19308 = array_get v19300, index v19303 - v19309 = cast v19301 as Field - v19310 = cast v19306 as Field - v19311 = mul v19309, v19307 - v19312 = mul v19310, v19308 - v19313 = add v19311, v19312 - v19314 = array_set mut v19304, index v19303, value v19313 - enable_side_effects u1 1 - v19315 = array_get v1, index u32 2⁴×17 - enable_side_effects v19315 - v19316 = array_get v2, index u32 2⁴×17 - v19317 = cast v19316 as u32 - v19318 = array_set v19314, index v19317, value Field 2⁴×17 - v19320 = not v19315 - v19321 = array_get v19318, index v19317 - v19322 = array_get v19314, index v19317 - v19323 = cast v19315 as Field - v19324 = cast v19320 as Field - v19325 = mul v19323, v19321 - v19326 = mul v19324, v19322 - v19327 = add v19325, v19326 - v19328 = array_set mut v19318, index v19317, value v19327 - enable_side_effects u1 1 - v19329 = array_get v1, index u32 273 - enable_side_effects v19329 - v19330 = array_get v2, index u32 273 - v19331 = cast v19330 as u32 - v19332 = array_set v19328, index v19331, value Field 273 - v19334 = not v19329 - v19335 = array_get v19332, index v19331 - v19336 = array_get v19328, index v19331 - v19337 = cast v19329 as Field - v19338 = cast v19334 as Field - v19339 = mul v19337, v19335 - v19340 = mul v19338, v19336 - v19341 = add v19339, v19340 - v19342 = array_set mut v19332, index v19331, value v19341 - enable_side_effects u1 1 - v19343 = array_get v1, index u32 274 - enable_side_effects v19343 - v19344 = array_get v2, index u32 274 - v19345 = cast v19344 as u32 - v19346 = array_set v19342, index v19345, value Field 274 - v19348 = not v19343 - v19349 = array_get v19346, index v19345 - v19350 = array_get v19342, index v19345 - v19351 = cast v19343 as Field - v19352 = cast v19348 as Field - v19353 = mul v19351, v19349 - v19354 = mul v19352, v19350 - v19355 = add v19353, v19354 - v19356 = array_set mut v19346, index v19345, value v19355 - enable_side_effects u1 1 - v19357 = array_get v1, index u32 275 - enable_side_effects v19357 - v19358 = array_get v2, index u32 275 - v19359 = cast v19358 as u32 - v19360 = array_set v19356, index v19359, value Field 275 - v19362 = not v19357 - v19363 = array_get v19360, index v19359 - v19364 = array_get v19356, index v19359 - v19365 = cast v19357 as Field - v19366 = cast v19362 as Field - v19367 = mul v19365, v19363 - v19368 = mul v19366, v19364 - v19369 = add v19367, v19368 - v19370 = array_set mut v19360, index v19359, value v19369 - enable_side_effects u1 1 - v19371 = array_get v1, index u32 276 - enable_side_effects v19371 - v19372 = array_get v2, index u32 276 - v19373 = cast v19372 as u32 - v19374 = array_set v19370, index v19373, value Field 276 - v19376 = not v19371 - v19377 = array_get v19374, index v19373 - v19378 = array_get v19370, index v19373 - v19379 = cast v19371 as Field - v19380 = cast v19376 as Field - v19381 = mul v19379, v19377 - v19382 = mul v19380, v19378 - v19383 = add v19381, v19382 - v19384 = array_set mut v19374, index v19373, value v19383 - enable_side_effects u1 1 - v19385 = array_get v1, index u32 277 - enable_side_effects v19385 - v19386 = array_get v2, index u32 277 - v19387 = cast v19386 as u32 - v19388 = array_set v19384, index v19387, value Field 277 - v19390 = not v19385 - v19391 = array_get v19388, index v19387 - v19392 = array_get v19384, index v19387 - v19393 = cast v19385 as Field - v19394 = cast v19390 as Field - v19395 = mul v19393, v19391 - v19396 = mul v19394, v19392 - v19397 = add v19395, v19396 - v19398 = array_set mut v19388, index v19387, value v19397 - enable_side_effects u1 1 - v19399 = array_get v1, index u32 278 - enable_side_effects v19399 - v19400 = array_get v2, index u32 278 - v19401 = cast v19400 as u32 - v19402 = array_set v19398, index v19401, value Field 278 - v19404 = not v19399 - v19405 = array_get v19402, index v19401 - v19406 = array_get v19398, index v19401 - v19407 = cast v19399 as Field - v19408 = cast v19404 as Field - v19409 = mul v19407, v19405 - v19410 = mul v19408, v19406 - v19411 = add v19409, v19410 - v19412 = array_set mut v19402, index v19401, value v19411 - enable_side_effects u1 1 - v19413 = array_get v1, index u32 279 - enable_side_effects v19413 - v19414 = array_get v2, index u32 279 - v19415 = cast v19414 as u32 - v19416 = array_set v19412, index v19415, value Field 279 - v19418 = not v19413 - v19419 = array_get v19416, index v19415 - v19420 = array_get v19412, index v19415 - v19421 = cast v19413 as Field - v19422 = cast v19418 as Field - v19423 = mul v19421, v19419 - v19424 = mul v19422, v19420 - v19425 = add v19423, v19424 - v19426 = array_set mut v19416, index v19415, value v19425 - enable_side_effects u1 1 - v19427 = array_get v1, index u32 280 - enable_side_effects v19427 - v19428 = array_get v2, index u32 280 - v19429 = cast v19428 as u32 - v19430 = array_set v19426, index v19429, value Field 280 - v19432 = not v19427 - v19433 = array_get v19430, index v19429 - v19434 = array_get v19426, index v19429 - v19435 = cast v19427 as Field - v19436 = cast v19432 as Field - v19437 = mul v19435, v19433 - v19438 = mul v19436, v19434 - v19439 = add v19437, v19438 - v19440 = array_set mut v19430, index v19429, value v19439 - enable_side_effects u1 1 - v19441 = array_get v1, index u32 281 - enable_side_effects v19441 - v19442 = array_get v2, index u32 281 - v19443 = cast v19442 as u32 - v19444 = array_set v19440, index v19443, value Field 281 - v19446 = not v19441 - v19447 = array_get v19444, index v19443 - v19448 = array_get v19440, index v19443 - v19449 = cast v19441 as Field - v19450 = cast v19446 as Field - v19451 = mul v19449, v19447 - v19452 = mul v19450, v19448 - v19453 = add v19451, v19452 - v19454 = array_set mut v19444, index v19443, value v19453 - enable_side_effects u1 1 - v19455 = array_get v1, index u32 282 - enable_side_effects v19455 - v19456 = array_get v2, index u32 282 - v19457 = cast v19456 as u32 - v19458 = array_set v19454, index v19457, value Field 282 - v19460 = not v19455 - v19461 = array_get v19458, index v19457 - v19462 = array_get v19454, index v19457 - v19463 = cast v19455 as Field - v19464 = cast v19460 as Field - v19465 = mul v19463, v19461 - v19466 = mul v19464, v19462 - v19467 = add v19465, v19466 - v19468 = array_set mut v19458, index v19457, value v19467 - enable_side_effects u1 1 - v19469 = array_get v1, index u32 283 - enable_side_effects v19469 - v19470 = array_get v2, index u32 283 - v19471 = cast v19470 as u32 - v19472 = array_set v19468, index v19471, value Field 283 - v19474 = not v19469 - v19475 = array_get v19472, index v19471 - v19476 = array_get v19468, index v19471 - v19477 = cast v19469 as Field - v19478 = cast v19474 as Field - v19479 = mul v19477, v19475 - v19480 = mul v19478, v19476 - v19481 = add v19479, v19480 - v19482 = array_set mut v19472, index v19471, value v19481 - enable_side_effects u1 1 - v19483 = array_get v1, index u32 284 - enable_side_effects v19483 - v19484 = array_get v2, index u32 284 - v19485 = cast v19484 as u32 - v19486 = array_set v19482, index v19485, value Field 284 - v19488 = not v19483 - v19489 = array_get v19486, index v19485 - v19490 = array_get v19482, index v19485 - v19491 = cast v19483 as Field - v19492 = cast v19488 as Field - v19493 = mul v19491, v19489 - v19494 = mul v19492, v19490 - v19495 = add v19493, v19494 - v19496 = array_set mut v19486, index v19485, value v19495 - enable_side_effects u1 1 - v19497 = array_get v1, index u32 285 - enable_side_effects v19497 - v19498 = array_get v2, index u32 285 - v19499 = cast v19498 as u32 - v19500 = array_set v19496, index v19499, value Field 285 - v19502 = not v19497 - v19503 = array_get v19500, index v19499 - v19504 = array_get v19496, index v19499 - v19505 = cast v19497 as Field - v19506 = cast v19502 as Field - v19507 = mul v19505, v19503 - v19508 = mul v19506, v19504 - v19509 = add v19507, v19508 - v19510 = array_set mut v19500, index v19499, value v19509 - enable_side_effects u1 1 - v19511 = array_get v1, index u32 286 - enable_side_effects v19511 - v19512 = array_get v2, index u32 286 - v19513 = cast v19512 as u32 - v19514 = array_set v19510, index v19513, value Field 286 - v19516 = not v19511 - v19517 = array_get v19514, index v19513 - v19518 = array_get v19510, index v19513 - v19519 = cast v19511 as Field - v19520 = cast v19516 as Field - v19521 = mul v19519, v19517 - v19522 = mul v19520, v19518 - v19523 = add v19521, v19522 - v19524 = array_set mut v19514, index v19513, value v19523 - enable_side_effects u1 1 - v19525 = array_get v1, index u32 287 - enable_side_effects v19525 - v19526 = array_get v2, index u32 287 - v19527 = cast v19526 as u32 - v19528 = array_set v19524, index v19527, value Field 287 - v19530 = not v19525 - v19531 = array_get v19528, index v19527 - v19532 = array_get v19524, index v19527 - v19533 = cast v19525 as Field - v19534 = cast v19530 as Field - v19535 = mul v19533, v19531 - v19536 = mul v19534, v19532 - v19537 = add v19535, v19536 - v19538 = array_set mut v19528, index v19527, value v19537 - enable_side_effects u1 1 - v19539 = array_get v1, index u32 2⁴×18 - enable_side_effects v19539 - v19540 = array_get v2, index u32 2⁴×18 - v19541 = cast v19540 as u32 - v19542 = array_set v19538, index v19541, value Field 2⁴×18 - v19544 = not v19539 - v19545 = array_get v19542, index v19541 - v19546 = array_get v19538, index v19541 - v19547 = cast v19539 as Field - v19548 = cast v19544 as Field - v19549 = mul v19547, v19545 - v19550 = mul v19548, v19546 - v19551 = add v19549, v19550 - v19552 = array_set mut v19542, index v19541, value v19551 - enable_side_effects u1 1 - v19553 = array_get v1, index u32 289 - enable_side_effects v19553 - v19554 = array_get v2, index u32 289 - v19555 = cast v19554 as u32 - v19556 = array_set v19552, index v19555, value Field 289 - v19558 = not v19553 - v19559 = array_get v19556, index v19555 - v19560 = array_get v19552, index v19555 - v19561 = cast v19553 as Field - v19562 = cast v19558 as Field - v19563 = mul v19561, v19559 - v19564 = mul v19562, v19560 - v19565 = add v19563, v19564 - v19566 = array_set mut v19556, index v19555, value v19565 - enable_side_effects u1 1 - v19567 = array_get v1, index u32 290 - enable_side_effects v19567 - v19568 = array_get v2, index u32 290 - v19569 = cast v19568 as u32 - v19570 = array_set v19566, index v19569, value Field 290 - v19572 = not v19567 - v19573 = array_get v19570, index v19569 - v19574 = array_get v19566, index v19569 - v19575 = cast v19567 as Field - v19576 = cast v19572 as Field - v19577 = mul v19575, v19573 - v19578 = mul v19576, v19574 - v19579 = add v19577, v19578 - v19580 = array_set mut v19570, index v19569, value v19579 - enable_side_effects u1 1 - v19581 = array_get v1, index u32 291 - enable_side_effects v19581 - v19582 = array_get v2, index u32 291 - v19583 = cast v19582 as u32 - v19584 = array_set v19580, index v19583, value Field 291 - v19586 = not v19581 - v19587 = array_get v19584, index v19583 - v19588 = array_get v19580, index v19583 - v19589 = cast v19581 as Field - v19590 = cast v19586 as Field - v19591 = mul v19589, v19587 - v19592 = mul v19590, v19588 - v19593 = add v19591, v19592 - v19594 = array_set mut v19584, index v19583, value v19593 - enable_side_effects u1 1 - v19595 = array_get v1, index u32 292 - enable_side_effects v19595 - v19596 = array_get v2, index u32 292 - v19597 = cast v19596 as u32 - v19598 = array_set v19594, index v19597, value Field 292 - v19600 = not v19595 - v19601 = array_get v19598, index v19597 - v19602 = array_get v19594, index v19597 - v19603 = cast v19595 as Field - v19604 = cast v19600 as Field - v19605 = mul v19603, v19601 - v19606 = mul v19604, v19602 - v19607 = add v19605, v19606 - v19608 = array_set mut v19598, index v19597, value v19607 - enable_side_effects u1 1 - v19609 = array_get v1, index u32 293 - enable_side_effects v19609 - v19610 = array_get v2, index u32 293 - v19611 = cast v19610 as u32 - v19612 = array_set v19608, index v19611, value Field 293 - v19614 = not v19609 - v19615 = array_get v19612, index v19611 - v19616 = array_get v19608, index v19611 - v19617 = cast v19609 as Field - v19618 = cast v19614 as Field - v19619 = mul v19617, v19615 - v19620 = mul v19618, v19616 - v19621 = add v19619, v19620 - v19622 = array_set mut v19612, index v19611, value v19621 - enable_side_effects u1 1 - v19623 = array_get v1, index u32 294 - enable_side_effects v19623 - v19624 = array_get v2, index u32 294 - v19625 = cast v19624 as u32 - v19626 = array_set v19622, index v19625, value Field 294 - v19628 = not v19623 - v19629 = array_get v19626, index v19625 - v19630 = array_get v19622, index v19625 - v19631 = cast v19623 as Field - v19632 = cast v19628 as Field - v19633 = mul v19631, v19629 - v19634 = mul v19632, v19630 - v19635 = add v19633, v19634 - v19636 = array_set mut v19626, index v19625, value v19635 - enable_side_effects u1 1 - v19637 = array_get v1, index u32 295 - enable_side_effects v19637 - v19638 = array_get v2, index u32 295 - v19639 = cast v19638 as u32 - v19640 = array_set v19636, index v19639, value Field 295 - v19642 = not v19637 - v19643 = array_get v19640, index v19639 - v19644 = array_get v19636, index v19639 - v19645 = cast v19637 as Field - v19646 = cast v19642 as Field - v19647 = mul v19645, v19643 - v19648 = mul v19646, v19644 - v19649 = add v19647, v19648 - v19650 = array_set mut v19640, index v19639, value v19649 - enable_side_effects u1 1 - v19651 = array_get v1, index u32 296 - enable_side_effects v19651 - v19652 = array_get v2, index u32 296 - v19653 = cast v19652 as u32 - v19654 = array_set v19650, index v19653, value Field 296 - v19656 = not v19651 - v19657 = array_get v19654, index v19653 - v19658 = array_get v19650, index v19653 - v19659 = cast v19651 as Field - v19660 = cast v19656 as Field - v19661 = mul v19659, v19657 - v19662 = mul v19660, v19658 - v19663 = add v19661, v19662 - v19664 = array_set mut v19654, index v19653, value v19663 - enable_side_effects u1 1 - v19665 = array_get v1, index u32 297 - enable_side_effects v19665 - v19666 = array_get v2, index u32 297 - v19667 = cast v19666 as u32 - v19668 = array_set v19664, index v19667, value Field 297 - v19670 = not v19665 - v19671 = array_get v19668, index v19667 - v19672 = array_get v19664, index v19667 - v19673 = cast v19665 as Field - v19674 = cast v19670 as Field - v19675 = mul v19673, v19671 - v19676 = mul v19674, v19672 - v19677 = add v19675, v19676 - v19678 = array_set mut v19668, index v19667, value v19677 - enable_side_effects u1 1 - v19679 = array_get v1, index u32 298 - enable_side_effects v19679 - v19680 = array_get v2, index u32 298 - v19681 = cast v19680 as u32 - v19682 = array_set v19678, index v19681, value Field 298 - v19684 = not v19679 - v19685 = array_get v19682, index v19681 - v19686 = array_get v19678, index v19681 - v19687 = cast v19679 as Field - v19688 = cast v19684 as Field - v19689 = mul v19687, v19685 - v19690 = mul v19688, v19686 - v19691 = add v19689, v19690 - v19692 = array_set mut v19682, index v19681, value v19691 - enable_side_effects u1 1 - v19693 = array_get v1, index u32 299 - enable_side_effects v19693 - v19694 = array_get v2, index u32 299 - v19695 = cast v19694 as u32 - v19696 = array_set v19692, index v19695, value Field 299 - v19698 = not v19693 - v19699 = array_get v19696, index v19695 - v19700 = array_get v19692, index v19695 - v19701 = cast v19693 as Field - v19702 = cast v19698 as Field - v19703 = mul v19701, v19699 - v19704 = mul v19702, v19700 - v19705 = add v19703, v19704 - v19706 = array_set mut v19696, index v19695, value v19705 - enable_side_effects u1 1 - v19707 = array_get v1, index u32 300 - enable_side_effects v19707 - v19708 = array_get v2, index u32 300 - v19709 = cast v19708 as u32 - v19710 = array_set v19706, index v19709, value Field 300 - v19712 = not v19707 - v19713 = array_get v19710, index v19709 - v19714 = array_get v19706, index v19709 - v19715 = cast v19707 as Field - v19716 = cast v19712 as Field - v19717 = mul v19715, v19713 - v19718 = mul v19716, v19714 - v19719 = add v19717, v19718 - v19720 = array_set mut v19710, index v19709, value v19719 - enable_side_effects u1 1 - v19721 = array_get v1, index u32 301 - enable_side_effects v19721 - v19722 = array_get v2, index u32 301 - v19723 = cast v19722 as u32 - v19724 = array_set v19720, index v19723, value Field 301 - v19726 = not v19721 - v19727 = array_get v19724, index v19723 - v19728 = array_get v19720, index v19723 - v19729 = cast v19721 as Field - v19730 = cast v19726 as Field - v19731 = mul v19729, v19727 - v19732 = mul v19730, v19728 - v19733 = add v19731, v19732 - v19734 = array_set mut v19724, index v19723, value v19733 - enable_side_effects u1 1 - v19735 = array_get v1, index u32 302 - enable_side_effects v19735 - v19736 = array_get v2, index u32 302 - v19737 = cast v19736 as u32 - v19738 = array_set v19734, index v19737, value Field 302 - v19740 = not v19735 - v19741 = array_get v19738, index v19737 - v19742 = array_get v19734, index v19737 - v19743 = cast v19735 as Field - v19744 = cast v19740 as Field - v19745 = mul v19743, v19741 - v19746 = mul v19744, v19742 - v19747 = add v19745, v19746 - v19748 = array_set mut v19738, index v19737, value v19747 - enable_side_effects u1 1 - v19749 = array_get v1, index u32 303 - enable_side_effects v19749 - v19750 = array_get v2, index u32 303 - v19751 = cast v19750 as u32 - v19752 = array_set v19748, index v19751, value Field 303 - v19754 = not v19749 - v19755 = array_get v19752, index v19751 - v19756 = array_get v19748, index v19751 - v19757 = cast v19749 as Field - v19758 = cast v19754 as Field - v19759 = mul v19757, v19755 - v19760 = mul v19758, v19756 - v19761 = add v19759, v19760 - v19762 = array_set mut v19752, index v19751, value v19761 - enable_side_effects u1 1 - v19763 = array_get v1, index u32 2⁴×19 - enable_side_effects v19763 - v19764 = array_get v2, index u32 2⁴×19 - v19765 = cast v19764 as u32 - v19766 = array_set v19762, index v19765, value Field 2⁴×19 - v19768 = not v19763 - v19769 = array_get v19766, index v19765 - v19770 = array_get v19762, index v19765 - v19771 = cast v19763 as Field - v19772 = cast v19768 as Field - v19773 = mul v19771, v19769 - v19774 = mul v19772, v19770 - v19775 = add v19773, v19774 - v19776 = array_set mut v19766, index v19765, value v19775 - enable_side_effects u1 1 - v19777 = array_get v1, index u32 305 - enable_side_effects v19777 - v19778 = array_get v2, index u32 305 - v19779 = cast v19778 as u32 - v19780 = array_set v19776, index v19779, value Field 305 - v19782 = not v19777 - v19783 = array_get v19780, index v19779 - v19784 = array_get v19776, index v19779 - v19785 = cast v19777 as Field - v19786 = cast v19782 as Field - v19787 = mul v19785, v19783 - v19788 = mul v19786, v19784 - v19789 = add v19787, v19788 - v19790 = array_set mut v19780, index v19779, value v19789 - enable_side_effects u1 1 - v19791 = array_get v1, index u32 306 - enable_side_effects v19791 - v19792 = array_get v2, index u32 306 - v19793 = cast v19792 as u32 - v19794 = array_set v19790, index v19793, value Field 306 - v19796 = not v19791 - v19797 = array_get v19794, index v19793 - v19798 = array_get v19790, index v19793 - v19799 = cast v19791 as Field - v19800 = cast v19796 as Field - v19801 = mul v19799, v19797 - v19802 = mul v19800, v19798 - v19803 = add v19801, v19802 - v19804 = array_set mut v19794, index v19793, value v19803 - enable_side_effects u1 1 - v19805 = array_get v1, index u32 307 - enable_side_effects v19805 - v19806 = array_get v2, index u32 307 - v19807 = cast v19806 as u32 - v19808 = array_set v19804, index v19807, value Field 307 - v19810 = not v19805 - v19811 = array_get v19808, index v19807 - v19812 = array_get v19804, index v19807 - v19813 = cast v19805 as Field - v19814 = cast v19810 as Field - v19815 = mul v19813, v19811 - v19816 = mul v19814, v19812 - v19817 = add v19815, v19816 - v19818 = array_set mut v19808, index v19807, value v19817 - enable_side_effects u1 1 - v19819 = array_get v1, index u32 308 - enable_side_effects v19819 - v19820 = array_get v2, index u32 308 - v19821 = cast v19820 as u32 - v19822 = array_set v19818, index v19821, value Field 308 - v19824 = not v19819 - v19825 = array_get v19822, index v19821 - v19826 = array_get v19818, index v19821 - v19827 = cast v19819 as Field - v19828 = cast v19824 as Field - v19829 = mul v19827, v19825 - v19830 = mul v19828, v19826 - v19831 = add v19829, v19830 - v19832 = array_set mut v19822, index v19821, value v19831 - enable_side_effects u1 1 - v19833 = array_get v1, index u32 309 - enable_side_effects v19833 - v19834 = array_get v2, index u32 309 - v19835 = cast v19834 as u32 - v19836 = array_set v19832, index v19835, value Field 309 - v19838 = not v19833 - v19839 = array_get v19836, index v19835 - v19840 = array_get v19832, index v19835 - v19841 = cast v19833 as Field - v19842 = cast v19838 as Field - v19843 = mul v19841, v19839 - v19844 = mul v19842, v19840 - v19845 = add v19843, v19844 - v19846 = array_set mut v19836, index v19835, value v19845 - enable_side_effects u1 1 - v19847 = array_get v1, index u32 310 - enable_side_effects v19847 - v19848 = array_get v2, index u32 310 - v19849 = cast v19848 as u32 - v19850 = array_set v19846, index v19849, value Field 310 - v19852 = not v19847 - v19853 = array_get v19850, index v19849 - v19854 = array_get v19846, index v19849 - v19855 = cast v19847 as Field - v19856 = cast v19852 as Field - v19857 = mul v19855, v19853 - v19858 = mul v19856, v19854 - v19859 = add v19857, v19858 - v19860 = array_set mut v19850, index v19849, value v19859 - enable_side_effects u1 1 - v19861 = array_get v1, index u32 311 - enable_side_effects v19861 - v19862 = array_get v2, index u32 311 - v19863 = cast v19862 as u32 - v19864 = array_set v19860, index v19863, value Field 311 - v19866 = not v19861 - v19867 = array_get v19864, index v19863 - v19868 = array_get v19860, index v19863 - v19869 = cast v19861 as Field - v19870 = cast v19866 as Field - v19871 = mul v19869, v19867 - v19872 = mul v19870, v19868 - v19873 = add v19871, v19872 - v19874 = array_set mut v19864, index v19863, value v19873 - enable_side_effects u1 1 - v19875 = array_get v1, index u32 312 - enable_side_effects v19875 - v19876 = array_get v2, index u32 312 - v19877 = cast v19876 as u32 - v19878 = array_set v19874, index v19877, value Field 312 - v19880 = not v19875 - v19881 = array_get v19878, index v19877 - v19882 = array_get v19874, index v19877 - v19883 = cast v19875 as Field - v19884 = cast v19880 as Field - v19885 = mul v19883, v19881 - v19886 = mul v19884, v19882 - v19887 = add v19885, v19886 - v19888 = array_set mut v19878, index v19877, value v19887 - enable_side_effects u1 1 - v19889 = array_get v1, index u32 313 - enable_side_effects v19889 - v19890 = array_get v2, index u32 313 - v19891 = cast v19890 as u32 - v19892 = array_set v19888, index v19891, value Field 313 - v19894 = not v19889 - v19895 = array_get v19892, index v19891 - v19896 = array_get v19888, index v19891 - v19897 = cast v19889 as Field - v19898 = cast v19894 as Field - v19899 = mul v19897, v19895 - v19900 = mul v19898, v19896 - v19901 = add v19899, v19900 - v19902 = array_set mut v19892, index v19891, value v19901 - enable_side_effects u1 1 - v19903 = array_get v1, index u32 314 - enable_side_effects v19903 - v19904 = array_get v2, index u32 314 - v19905 = cast v19904 as u32 - v19906 = array_set v19902, index v19905, value Field 314 - v19908 = not v19903 - v19909 = array_get v19906, index v19905 - v19910 = array_get v19902, index v19905 - v19911 = cast v19903 as Field - v19912 = cast v19908 as Field - v19913 = mul v19911, v19909 - v19914 = mul v19912, v19910 - v19915 = add v19913, v19914 - v19916 = array_set mut v19906, index v19905, value v19915 - enable_side_effects u1 1 - v19917 = array_get v1, index u32 315 - enable_side_effects v19917 - v19918 = array_get v2, index u32 315 - v19919 = cast v19918 as u32 - v19920 = array_set v19916, index v19919, value Field 315 - v19922 = not v19917 - v19923 = array_get v19920, index v19919 - v19924 = array_get v19916, index v19919 - v19925 = cast v19917 as Field - v19926 = cast v19922 as Field - v19927 = mul v19925, v19923 - v19928 = mul v19926, v19924 - v19929 = add v19927, v19928 - v19930 = array_set mut v19920, index v19919, value v19929 - enable_side_effects u1 1 - v19931 = array_get v1, index u32 316 - enable_side_effects v19931 - v19932 = array_get v2, index u32 316 - v19933 = cast v19932 as u32 - v19934 = array_set v19930, index v19933, value Field 316 - v19936 = not v19931 - v19937 = array_get v19934, index v19933 - v19938 = array_get v19930, index v19933 - v19939 = cast v19931 as Field - v19940 = cast v19936 as Field - v19941 = mul v19939, v19937 - v19942 = mul v19940, v19938 - v19943 = add v19941, v19942 - v19944 = array_set mut v19934, index v19933, value v19943 - enable_side_effects u1 1 - v19945 = array_get v1, index u32 317 - enable_side_effects v19945 - v19946 = array_get v2, index u32 317 - v19947 = cast v19946 as u32 - v19948 = array_set v19944, index v19947, value Field 317 - v19950 = not v19945 - v19951 = array_get v19948, index v19947 - v19952 = array_get v19944, index v19947 - v19953 = cast v19945 as Field - v19954 = cast v19950 as Field - v19955 = mul v19953, v19951 - v19956 = mul v19954, v19952 - v19957 = add v19955, v19956 - v19958 = array_set mut v19948, index v19947, value v19957 - enable_side_effects u1 1 - v19959 = array_get v1, index u32 318 - enable_side_effects v19959 - v19960 = array_get v2, index u32 318 - v19961 = cast v19960 as u32 - v19962 = array_set v19958, index v19961, value Field 318 - v19964 = not v19959 - v19965 = array_get v19962, index v19961 - v19966 = array_get v19958, index v19961 - v19967 = cast v19959 as Field - v19968 = cast v19964 as Field - v19969 = mul v19967, v19965 - v19970 = mul v19968, v19966 - v19971 = add v19969, v19970 - v19972 = array_set mut v19962, index v19961, value v19971 - enable_side_effects u1 1 - v19973 = array_get v1, index u32 319 - enable_side_effects v19973 - v19974 = array_get v2, index u32 319 - v19975 = cast v19974 as u32 - v19976 = array_set v19972, index v19975, value Field 319 - v19978 = not v19973 - v19979 = array_get v19976, index v19975 - v19980 = array_get v19972, index v19975 - v19981 = cast v19973 as Field - v19982 = cast v19978 as Field - v19983 = mul v19981, v19979 - v19984 = mul v19982, v19980 - v19985 = add v19983, v19984 - v19986 = array_set mut v19976, index v19975, value v19985 - enable_side_effects u1 1 - v19987 = array_get v1, index u32 2⁴×20 - enable_side_effects v19987 - v19988 = array_get v2, index u32 2⁴×20 - v19989 = cast v19988 as u32 - v19990 = array_set v19986, index v19989, value Field 2⁴×20 - v19992 = not v19987 - v19993 = array_get v19990, index v19989 - v19994 = array_get v19986, index v19989 - v19995 = cast v19987 as Field - v19996 = cast v19992 as Field - v19997 = mul v19995, v19993 - v19998 = mul v19996, v19994 - v19999 = add v19997, v19998 - v20000 = array_set mut v19990, index v19989, value v19999 - enable_side_effects u1 1 - v20001 = array_get v1, index u32 321 - enable_side_effects v20001 - v20002 = array_get v2, index u32 321 - v20003 = cast v20002 as u32 - v20004 = array_set v20000, index v20003, value Field 321 - v20006 = not v20001 - v20007 = array_get v20004, index v20003 - v20008 = array_get v20000, index v20003 - v20009 = cast v20001 as Field - v20010 = cast v20006 as Field - v20011 = mul v20009, v20007 - v20012 = mul v20010, v20008 - v20013 = add v20011, v20012 - v20014 = array_set mut v20004, index v20003, value v20013 - enable_side_effects u1 1 - v20015 = array_get v1, index u32 322 - enable_side_effects v20015 - v20016 = array_get v2, index u32 322 - v20017 = cast v20016 as u32 - v20018 = array_set v20014, index v20017, value Field 322 - v20020 = not v20015 - v20021 = array_get v20018, index v20017 - v20022 = array_get v20014, index v20017 - v20023 = cast v20015 as Field - v20024 = cast v20020 as Field - v20025 = mul v20023, v20021 - v20026 = mul v20024, v20022 - v20027 = add v20025, v20026 - v20028 = array_set mut v20018, index v20017, value v20027 - enable_side_effects u1 1 - v20029 = array_get v1, index u32 323 - enable_side_effects v20029 - v20030 = array_get v2, index u32 323 - v20031 = cast v20030 as u32 - v20032 = array_set v20028, index v20031, value Field 323 - v20034 = not v20029 - v20035 = array_get v20032, index v20031 - v20036 = array_get v20028, index v20031 - v20037 = cast v20029 as Field - v20038 = cast v20034 as Field - v20039 = mul v20037, v20035 - v20040 = mul v20038, v20036 - v20041 = add v20039, v20040 - v20042 = array_set mut v20032, index v20031, value v20041 - enable_side_effects u1 1 - v20043 = array_get v1, index u32 324 - enable_side_effects v20043 - v20044 = array_get v2, index u32 324 - v20045 = cast v20044 as u32 - v20046 = array_set v20042, index v20045, value Field 324 - v20048 = not v20043 - v20049 = array_get v20046, index v20045 - v20050 = array_get v20042, index v20045 - v20051 = cast v20043 as Field - v20052 = cast v20048 as Field - v20053 = mul v20051, v20049 - v20054 = mul v20052, v20050 - v20055 = add v20053, v20054 - v20056 = array_set mut v20046, index v20045, value v20055 - enable_side_effects u1 1 - v20057 = array_get v1, index u32 325 - enable_side_effects v20057 - v20058 = array_get v2, index u32 325 - v20059 = cast v20058 as u32 - v20060 = array_set v20056, index v20059, value Field 325 - v20062 = not v20057 - v20063 = array_get v20060, index v20059 - v20064 = array_get v20056, index v20059 - v20065 = cast v20057 as Field - v20066 = cast v20062 as Field - v20067 = mul v20065, v20063 - v20068 = mul v20066, v20064 - v20069 = add v20067, v20068 - v20070 = array_set mut v20060, index v20059, value v20069 - enable_side_effects u1 1 - v20071 = array_get v1, index u32 326 - enable_side_effects v20071 - v20072 = array_get v2, index u32 326 - v20073 = cast v20072 as u32 - v20074 = array_set v20070, index v20073, value Field 326 - v20076 = not v20071 - v20077 = array_get v20074, index v20073 - v20078 = array_get v20070, index v20073 - v20079 = cast v20071 as Field - v20080 = cast v20076 as Field - v20081 = mul v20079, v20077 - v20082 = mul v20080, v20078 - v20083 = add v20081, v20082 - v20084 = array_set mut v20074, index v20073, value v20083 - enable_side_effects u1 1 - v20085 = array_get v1, index u32 327 - enable_side_effects v20085 - v20086 = array_get v2, index u32 327 - v20087 = cast v20086 as u32 - v20088 = array_set v20084, index v20087, value Field 327 - v20090 = not v20085 - v20091 = array_get v20088, index v20087 - v20092 = array_get v20084, index v20087 - v20093 = cast v20085 as Field - v20094 = cast v20090 as Field - v20095 = mul v20093, v20091 - v20096 = mul v20094, v20092 - v20097 = add v20095, v20096 - v20098 = array_set mut v20088, index v20087, value v20097 - enable_side_effects u1 1 - v20099 = array_get v1, index u32 328 - enable_side_effects v20099 - v20100 = array_get v2, index u32 328 - v20101 = cast v20100 as u32 - v20102 = array_set v20098, index v20101, value Field 328 - v20104 = not v20099 - v20105 = array_get v20102, index v20101 - v20106 = array_get v20098, index v20101 - v20107 = cast v20099 as Field - v20108 = cast v20104 as Field - v20109 = mul v20107, v20105 - v20110 = mul v20108, v20106 - v20111 = add v20109, v20110 - v20112 = array_set mut v20102, index v20101, value v20111 - enable_side_effects u1 1 - v20113 = array_get v1, index u32 329 - enable_side_effects v20113 - v20114 = array_get v2, index u32 329 - v20115 = cast v20114 as u32 - v20116 = array_set v20112, index v20115, value Field 329 - v20118 = not v20113 - v20119 = array_get v20116, index v20115 - v20120 = array_get v20112, index v20115 - v20121 = cast v20113 as Field - v20122 = cast v20118 as Field - v20123 = mul v20121, v20119 - v20124 = mul v20122, v20120 - v20125 = add v20123, v20124 - v20126 = array_set mut v20116, index v20115, value v20125 - enable_side_effects u1 1 - v20127 = array_get v1, index u32 330 - enable_side_effects v20127 - v20128 = array_get v2, index u32 330 - v20129 = cast v20128 as u32 - v20130 = array_set v20126, index v20129, value Field 330 - v20132 = not v20127 - v20133 = array_get v20130, index v20129 - v20134 = array_get v20126, index v20129 - v20135 = cast v20127 as Field - v20136 = cast v20132 as Field - v20137 = mul v20135, v20133 - v20138 = mul v20136, v20134 - v20139 = add v20137, v20138 - v20140 = array_set mut v20130, index v20129, value v20139 - enable_side_effects u1 1 - v20141 = array_get v1, index u32 331 - enable_side_effects v20141 - v20142 = array_get v2, index u32 331 - v20143 = cast v20142 as u32 - v20144 = array_set v20140, index v20143, value Field 331 - v20146 = not v20141 - v20147 = array_get v20144, index v20143 - v20148 = array_get v20140, index v20143 - v20149 = cast v20141 as Field - v20150 = cast v20146 as Field - v20151 = mul v20149, v20147 - v20152 = mul v20150, v20148 - v20153 = add v20151, v20152 - v20154 = array_set mut v20144, index v20143, value v20153 - enable_side_effects u1 1 - v20155 = array_get v1, index u32 332 - enable_side_effects v20155 - v20156 = array_get v2, index u32 332 - v20157 = cast v20156 as u32 - v20158 = array_set v20154, index v20157, value Field 332 - v20160 = not v20155 - v20161 = array_get v20158, index v20157 - v20162 = array_get v20154, index v20157 - v20163 = cast v20155 as Field - v20164 = cast v20160 as Field - v20165 = mul v20163, v20161 - v20166 = mul v20164, v20162 - v20167 = add v20165, v20166 - v20168 = array_set mut v20158, index v20157, value v20167 - enable_side_effects u1 1 - v20169 = array_get v1, index u32 333 - enable_side_effects v20169 - v20170 = array_get v2, index u32 333 - v20171 = cast v20170 as u32 - v20172 = array_set v20168, index v20171, value Field 333 - v20174 = not v20169 - v20175 = array_get v20172, index v20171 - v20176 = array_get v20168, index v20171 - v20177 = cast v20169 as Field - v20178 = cast v20174 as Field - v20179 = mul v20177, v20175 - v20180 = mul v20178, v20176 - v20181 = add v20179, v20180 - v20182 = array_set mut v20172, index v20171, value v20181 - enable_side_effects u1 1 - v20183 = array_get v1, index u32 334 - enable_side_effects v20183 - v20184 = array_get v2, index u32 334 - v20185 = cast v20184 as u32 - v20186 = array_set v20182, index v20185, value Field 334 - v20188 = not v20183 - v20189 = array_get v20186, index v20185 - v20190 = array_get v20182, index v20185 - v20191 = cast v20183 as Field - v20192 = cast v20188 as Field - v20193 = mul v20191, v20189 - v20194 = mul v20192, v20190 - v20195 = add v20193, v20194 - v20196 = array_set mut v20186, index v20185, value v20195 - enable_side_effects u1 1 - v20197 = array_get v1, index u32 335 - enable_side_effects v20197 - v20198 = array_get v2, index u32 335 - v20199 = cast v20198 as u32 - v20200 = array_set v20196, index v20199, value Field 335 - v20202 = not v20197 - v20203 = array_get v20200, index v20199 - v20204 = array_get v20196, index v20199 - v20205 = cast v20197 as Field - v20206 = cast v20202 as Field - v20207 = mul v20205, v20203 - v20208 = mul v20206, v20204 - v20209 = add v20207, v20208 - v20210 = array_set mut v20200, index v20199, value v20209 - enable_side_effects u1 1 - v20211 = array_get v1, index u32 2⁴×21 - enable_side_effects v20211 - v20212 = array_get v2, index u32 2⁴×21 - v20213 = cast v20212 as u32 - v20214 = array_set v20210, index v20213, value Field 2⁴×21 - v20216 = not v20211 - v20217 = array_get v20214, index v20213 - v20218 = array_get v20210, index v20213 - v20219 = cast v20211 as Field - v20220 = cast v20216 as Field - v20221 = mul v20219, v20217 - v20222 = mul v20220, v20218 - v20223 = add v20221, v20222 - v20224 = array_set mut v20214, index v20213, value v20223 - enable_side_effects u1 1 - v20225 = array_get v1, index u32 337 - enable_side_effects v20225 - v20226 = array_get v2, index u32 337 - v20227 = cast v20226 as u32 - v20228 = array_set v20224, index v20227, value Field 337 - v20230 = not v20225 - v20231 = array_get v20228, index v20227 - v20232 = array_get v20224, index v20227 - v20233 = cast v20225 as Field - v20234 = cast v20230 as Field - v20235 = mul v20233, v20231 - v20236 = mul v20234, v20232 - v20237 = add v20235, v20236 - v20238 = array_set mut v20228, index v20227, value v20237 - enable_side_effects u1 1 - v20239 = array_get v1, index u32 338 - enable_side_effects v20239 - v20240 = array_get v2, index u32 338 - v20241 = cast v20240 as u32 - v20242 = array_set v20238, index v20241, value Field 338 - v20244 = not v20239 - v20245 = array_get v20242, index v20241 - v20246 = array_get v20238, index v20241 - v20247 = cast v20239 as Field - v20248 = cast v20244 as Field - v20249 = mul v20247, v20245 - v20250 = mul v20248, v20246 - v20251 = add v20249, v20250 - v20252 = array_set mut v20242, index v20241, value v20251 - enable_side_effects u1 1 - v20253 = array_get v1, index u32 339 - enable_side_effects v20253 - v20254 = array_get v2, index u32 339 - v20255 = cast v20254 as u32 - v20256 = array_set v20252, index v20255, value Field 339 - v20258 = not v20253 - v20259 = array_get v20256, index v20255 - v20260 = array_get v20252, index v20255 - v20261 = cast v20253 as Field - v20262 = cast v20258 as Field - v20263 = mul v20261, v20259 - v20264 = mul v20262, v20260 - v20265 = add v20263, v20264 - v20266 = array_set mut v20256, index v20255, value v20265 - enable_side_effects u1 1 - v20267 = array_get v1, index u32 340 - enable_side_effects v20267 - v20268 = array_get v2, index u32 340 - v20269 = cast v20268 as u32 - v20270 = array_set v20266, index v20269, value Field 340 - v20272 = not v20267 - v20273 = array_get v20270, index v20269 - v20274 = array_get v20266, index v20269 - v20275 = cast v20267 as Field - v20276 = cast v20272 as Field - v20277 = mul v20275, v20273 - v20278 = mul v20276, v20274 - v20279 = add v20277, v20278 - v20280 = array_set mut v20270, index v20269, value v20279 - enable_side_effects u1 1 - v20281 = array_get v1, index u32 341 - enable_side_effects v20281 - v20282 = array_get v2, index u32 341 - v20283 = cast v20282 as u32 - v20284 = array_set v20280, index v20283, value Field 341 - v20286 = not v20281 - v20287 = array_get v20284, index v20283 - v20288 = array_get v20280, index v20283 - v20289 = cast v20281 as Field - v20290 = cast v20286 as Field - v20291 = mul v20289, v20287 - v20292 = mul v20290, v20288 - v20293 = add v20291, v20292 - v20294 = array_set mut v20284, index v20283, value v20293 - enable_side_effects u1 1 - v20295 = array_get v1, index u32 342 - enable_side_effects v20295 - v20296 = array_get v2, index u32 342 - v20297 = cast v20296 as u32 - v20298 = array_set v20294, index v20297, value Field 342 - v20300 = not v20295 - v20301 = array_get v20298, index v20297 - v20302 = array_get v20294, index v20297 - v20303 = cast v20295 as Field - v20304 = cast v20300 as Field - v20305 = mul v20303, v20301 - v20306 = mul v20304, v20302 - v20307 = add v20305, v20306 - v20308 = array_set mut v20298, index v20297, value v20307 - enable_side_effects u1 1 - v20309 = array_get v1, index u32 343 - enable_side_effects v20309 - v20310 = array_get v2, index u32 343 - v20311 = cast v20310 as u32 - v20312 = array_set v20308, index v20311, value Field 343 - v20314 = not v20309 - v20315 = array_get v20312, index v20311 - v20316 = array_get v20308, index v20311 - v20317 = cast v20309 as Field - v20318 = cast v20314 as Field - v20319 = mul v20317, v20315 - v20320 = mul v20318, v20316 - v20321 = add v20319, v20320 - v20322 = array_set mut v20312, index v20311, value v20321 - enable_side_effects u1 1 - v20323 = array_get v1, index u32 344 - enable_side_effects v20323 - v20324 = array_get v2, index u32 344 - v20325 = cast v20324 as u32 - v20326 = array_set v20322, index v20325, value Field 344 - v20328 = not v20323 - v20329 = array_get v20326, index v20325 - v20330 = array_get v20322, index v20325 - v20331 = cast v20323 as Field - v20332 = cast v20328 as Field - v20333 = mul v20331, v20329 - v20334 = mul v20332, v20330 - v20335 = add v20333, v20334 - v20336 = array_set mut v20326, index v20325, value v20335 - enable_side_effects u1 1 - v20337 = array_get v1, index u32 345 - enable_side_effects v20337 - v20338 = array_get v2, index u32 345 - v20339 = cast v20338 as u32 - v20340 = array_set v20336, index v20339, value Field 345 - v20342 = not v20337 - v20343 = array_get v20340, index v20339 - v20344 = array_get v20336, index v20339 - v20345 = cast v20337 as Field - v20346 = cast v20342 as Field - v20347 = mul v20345, v20343 - v20348 = mul v20346, v20344 - v20349 = add v20347, v20348 - v20350 = array_set mut v20340, index v20339, value v20349 - enable_side_effects u1 1 - v20351 = array_get v1, index u32 346 - enable_side_effects v20351 - v20352 = array_get v2, index u32 346 - v20353 = cast v20352 as u32 - v20354 = array_set v20350, index v20353, value Field 346 - v20356 = not v20351 - v20357 = array_get v20354, index v20353 - v20358 = array_get v20350, index v20353 - v20359 = cast v20351 as Field - v20360 = cast v20356 as Field - v20361 = mul v20359, v20357 - v20362 = mul v20360, v20358 - v20363 = add v20361, v20362 - v20364 = array_set mut v20354, index v20353, value v20363 - enable_side_effects u1 1 - v20365 = array_get v1, index u32 347 - enable_side_effects v20365 - v20366 = array_get v2, index u32 347 - v20367 = cast v20366 as u32 - v20368 = array_set v20364, index v20367, value Field 347 - v20370 = not v20365 - v20371 = array_get v20368, index v20367 - v20372 = array_get v20364, index v20367 - v20373 = cast v20365 as Field - v20374 = cast v20370 as Field - v20375 = mul v20373, v20371 - v20376 = mul v20374, v20372 - v20377 = add v20375, v20376 - v20378 = array_set mut v20368, index v20367, value v20377 - enable_side_effects u1 1 - v20379 = array_get v1, index u32 348 - enable_side_effects v20379 - v20380 = array_get v2, index u32 348 - v20381 = cast v20380 as u32 - v20382 = array_set v20378, index v20381, value Field 348 - v20384 = not v20379 - v20385 = array_get v20382, index v20381 - v20386 = array_get v20378, index v20381 - v20387 = cast v20379 as Field - v20388 = cast v20384 as Field - v20389 = mul v20387, v20385 - v20390 = mul v20388, v20386 - v20391 = add v20389, v20390 - v20392 = array_set mut v20382, index v20381, value v20391 - enable_side_effects u1 1 - v20393 = array_get v1, index u32 349 - enable_side_effects v20393 - v20394 = array_get v2, index u32 349 - v20395 = cast v20394 as u32 - v20396 = array_set v20392, index v20395, value Field 349 - v20398 = not v20393 - v20399 = array_get v20396, index v20395 - v20400 = array_get v20392, index v20395 - v20401 = cast v20393 as Field - v20402 = cast v20398 as Field - v20403 = mul v20401, v20399 - v20404 = mul v20402, v20400 - v20405 = add v20403, v20404 - v20406 = array_set mut v20396, index v20395, value v20405 - enable_side_effects u1 1 - v20407 = array_get v1, index u32 350 - enable_side_effects v20407 - v20408 = array_get v2, index u32 350 - v20409 = cast v20408 as u32 - v20410 = array_set v20406, index v20409, value Field 350 - v20412 = not v20407 - v20413 = array_get v20410, index v20409 - v20414 = array_get v20406, index v20409 - v20415 = cast v20407 as Field - v20416 = cast v20412 as Field - v20417 = mul v20415, v20413 - v20418 = mul v20416, v20414 - v20419 = add v20417, v20418 - v20420 = array_set mut v20410, index v20409, value v20419 - enable_side_effects u1 1 - v20421 = array_get v1, index u32 351 - enable_side_effects v20421 - v20422 = array_get v2, index u32 351 - v20423 = cast v20422 as u32 - v20424 = array_set v20420, index v20423, value Field 351 - v20426 = not v20421 - v20427 = array_get v20424, index v20423 - v20428 = array_get v20420, index v20423 - v20429 = cast v20421 as Field - v20430 = cast v20426 as Field - v20431 = mul v20429, v20427 - v20432 = mul v20430, v20428 - v20433 = add v20431, v20432 - v20434 = array_set mut v20424, index v20423, value v20433 - enable_side_effects u1 1 - v20435 = array_get v1, index u32 2⁴×22 - enable_side_effects v20435 - v20436 = array_get v2, index u32 2⁴×22 - v20437 = cast v20436 as u32 - v20438 = array_set v20434, index v20437, value Field 2⁴×22 - v20440 = not v20435 - v20441 = array_get v20438, index v20437 - v20442 = array_get v20434, index v20437 - v20443 = cast v20435 as Field - v20444 = cast v20440 as Field - v20445 = mul v20443, v20441 - v20446 = mul v20444, v20442 - v20447 = add v20445, v20446 - v20448 = array_set mut v20438, index v20437, value v20447 - enable_side_effects u1 1 - v20449 = array_get v1, index u32 353 - enable_side_effects v20449 - v20450 = array_get v2, index u32 353 - v20451 = cast v20450 as u32 - v20452 = array_set v20448, index v20451, value Field 353 - v20454 = not v20449 - v20455 = array_get v20452, index v20451 - v20456 = array_get v20448, index v20451 - v20457 = cast v20449 as Field - v20458 = cast v20454 as Field - v20459 = mul v20457, v20455 - v20460 = mul v20458, v20456 - v20461 = add v20459, v20460 - v20462 = array_set mut v20452, index v20451, value v20461 - enable_side_effects u1 1 - v20463 = array_get v1, index u32 354 - enable_side_effects v20463 - v20464 = array_get v2, index u32 354 - v20465 = cast v20464 as u32 - v20466 = array_set v20462, index v20465, value Field 354 - v20468 = not v20463 - v20469 = array_get v20466, index v20465 - v20470 = array_get v20462, index v20465 - v20471 = cast v20463 as Field - v20472 = cast v20468 as Field - v20473 = mul v20471, v20469 - v20474 = mul v20472, v20470 - v20475 = add v20473, v20474 - v20476 = array_set mut v20466, index v20465, value v20475 - enable_side_effects u1 1 - v20477 = array_get v1, index u32 355 - enable_side_effects v20477 - v20478 = array_get v2, index u32 355 - v20479 = cast v20478 as u32 - v20480 = array_set v20476, index v20479, value Field 355 - v20482 = not v20477 - v20483 = array_get v20480, index v20479 - v20484 = array_get v20476, index v20479 - v20485 = cast v20477 as Field - v20486 = cast v20482 as Field - v20487 = mul v20485, v20483 - v20488 = mul v20486, v20484 - v20489 = add v20487, v20488 - v20490 = array_set mut v20480, index v20479, value v20489 - enable_side_effects u1 1 - v20491 = array_get v1, index u32 356 - enable_side_effects v20491 - v20492 = array_get v2, index u32 356 - v20493 = cast v20492 as u32 - v20494 = array_set v20490, index v20493, value Field 356 - v20496 = not v20491 - v20497 = array_get v20494, index v20493 - v20498 = array_get v20490, index v20493 - v20499 = cast v20491 as Field - v20500 = cast v20496 as Field - v20501 = mul v20499, v20497 - v20502 = mul v20500, v20498 - v20503 = add v20501, v20502 - v20504 = array_set mut v20494, index v20493, value v20503 - enable_side_effects u1 1 - v20505 = array_get v1, index u32 357 - enable_side_effects v20505 - v20506 = array_get v2, index u32 357 - v20507 = cast v20506 as u32 - v20508 = array_set v20504, index v20507, value Field 357 - v20510 = not v20505 - v20511 = array_get v20508, index v20507 - v20512 = array_get v20504, index v20507 - v20513 = cast v20505 as Field - v20514 = cast v20510 as Field - v20515 = mul v20513, v20511 - v20516 = mul v20514, v20512 - v20517 = add v20515, v20516 - v20518 = array_set mut v20508, index v20507, value v20517 - enable_side_effects u1 1 - v20519 = array_get v1, index u32 358 - enable_side_effects v20519 - v20520 = array_get v2, index u32 358 - v20521 = cast v20520 as u32 - v20522 = array_set v20518, index v20521, value Field 358 - v20524 = not v20519 - v20525 = array_get v20522, index v20521 - v20526 = array_get v20518, index v20521 - v20527 = cast v20519 as Field - v20528 = cast v20524 as Field - v20529 = mul v20527, v20525 - v20530 = mul v20528, v20526 - v20531 = add v20529, v20530 - v20532 = array_set mut v20522, index v20521, value v20531 - enable_side_effects u1 1 - v20533 = array_get v1, index u32 359 - enable_side_effects v20533 - v20534 = array_get v2, index u32 359 - v20535 = cast v20534 as u32 - v20536 = array_set v20532, index v20535, value Field 359 - v20538 = not v20533 - v20539 = array_get v20536, index v20535 - v20540 = array_get v20532, index v20535 - v20541 = cast v20533 as Field - v20542 = cast v20538 as Field - v20543 = mul v20541, v20539 - v20544 = mul v20542, v20540 - v20545 = add v20543, v20544 - v20546 = array_set mut v20536, index v20535, value v20545 - enable_side_effects u1 1 - v20547 = array_get v1, index u32 360 - enable_side_effects v20547 - v20548 = array_get v2, index u32 360 - v20549 = cast v20548 as u32 - v20550 = array_set v20546, index v20549, value Field 360 - v20552 = not v20547 - v20553 = array_get v20550, index v20549 - v20554 = array_get v20546, index v20549 - v20555 = cast v20547 as Field - v20556 = cast v20552 as Field - v20557 = mul v20555, v20553 - v20558 = mul v20556, v20554 - v20559 = add v20557, v20558 - v20560 = array_set mut v20550, index v20549, value v20559 - enable_side_effects u1 1 - v20561 = array_get v1, index u32 361 - enable_side_effects v20561 - v20562 = array_get v2, index u32 361 - v20563 = cast v20562 as u32 - v20564 = array_set v20560, index v20563, value Field 361 - v20566 = not v20561 - v20567 = array_get v20564, index v20563 - v20568 = array_get v20560, index v20563 - v20569 = cast v20561 as Field - v20570 = cast v20566 as Field - v20571 = mul v20569, v20567 - v20572 = mul v20570, v20568 - v20573 = add v20571, v20572 - v20574 = array_set mut v20564, index v20563, value v20573 - enable_side_effects u1 1 - v20575 = array_get v1, index u32 362 - enable_side_effects v20575 - v20576 = array_get v2, index u32 362 - v20577 = cast v20576 as u32 - v20578 = array_set v20574, index v20577, value Field 362 - v20580 = not v20575 - v20581 = array_get v20578, index v20577 - v20582 = array_get v20574, index v20577 - v20583 = cast v20575 as Field - v20584 = cast v20580 as Field - v20585 = mul v20583, v20581 - v20586 = mul v20584, v20582 - v20587 = add v20585, v20586 - v20588 = array_set mut v20578, index v20577, value v20587 - enable_side_effects u1 1 - v20589 = array_get v1, index u32 363 - enable_side_effects v20589 - v20590 = array_get v2, index u32 363 - v20591 = cast v20590 as u32 - v20592 = array_set v20588, index v20591, value Field 363 - v20594 = not v20589 - v20595 = array_get v20592, index v20591 - v20596 = array_get v20588, index v20591 - v20597 = cast v20589 as Field - v20598 = cast v20594 as Field - v20599 = mul v20597, v20595 - v20600 = mul v20598, v20596 - v20601 = add v20599, v20600 - v20602 = array_set mut v20592, index v20591, value v20601 - enable_side_effects u1 1 - v20603 = array_get v1, index u32 364 - enable_side_effects v20603 - v20604 = array_get v2, index u32 364 - v20605 = cast v20604 as u32 - v20606 = array_set v20602, index v20605, value Field 364 - v20608 = not v20603 - v20609 = array_get v20606, index v20605 - v20610 = array_get v20602, index v20605 - v20611 = cast v20603 as Field - v20612 = cast v20608 as Field - v20613 = mul v20611, v20609 - v20614 = mul v20612, v20610 - v20615 = add v20613, v20614 - v20616 = array_set mut v20606, index v20605, value v20615 - enable_side_effects u1 1 - v20617 = array_get v1, index u32 365 - enable_side_effects v20617 - v20618 = array_get v2, index u32 365 - v20619 = cast v20618 as u32 - v20620 = array_set v20616, index v20619, value Field 365 - v20622 = not v20617 - v20623 = array_get v20620, index v20619 - v20624 = array_get v20616, index v20619 - v20625 = cast v20617 as Field - v20626 = cast v20622 as Field - v20627 = mul v20625, v20623 - v20628 = mul v20626, v20624 - v20629 = add v20627, v20628 - v20630 = array_set mut v20620, index v20619, value v20629 - enable_side_effects u1 1 - v20631 = array_get v1, index u32 366 - enable_side_effects v20631 - v20632 = array_get v2, index u32 366 - v20633 = cast v20632 as u32 - v20634 = array_set v20630, index v20633, value Field 366 - v20636 = not v20631 - v20637 = array_get v20634, index v20633 - v20638 = array_get v20630, index v20633 - v20639 = cast v20631 as Field - v20640 = cast v20636 as Field - v20641 = mul v20639, v20637 - v20642 = mul v20640, v20638 - v20643 = add v20641, v20642 - v20644 = array_set mut v20634, index v20633, value v20643 - enable_side_effects u1 1 - v20645 = array_get v1, index u32 367 - enable_side_effects v20645 - v20646 = array_get v2, index u32 367 - v20647 = cast v20646 as u32 - v20648 = array_set v20644, index v20647, value Field 367 - v20650 = not v20645 - v20651 = array_get v20648, index v20647 - v20652 = array_get v20644, index v20647 - v20653 = cast v20645 as Field - v20654 = cast v20650 as Field - v20655 = mul v20653, v20651 - v20656 = mul v20654, v20652 - v20657 = add v20655, v20656 - v20658 = array_set mut v20648, index v20647, value v20657 - enable_side_effects u1 1 - v20659 = array_get v1, index u32 2⁴×23 - enable_side_effects v20659 - v20660 = array_get v2, index u32 2⁴×23 - v20661 = cast v20660 as u32 - v20662 = array_set v20658, index v20661, value Field 2⁴×23 - v20664 = not v20659 - v20665 = array_get v20662, index v20661 - v20666 = array_get v20658, index v20661 - v20667 = cast v20659 as Field - v20668 = cast v20664 as Field - v20669 = mul v20667, v20665 - v20670 = mul v20668, v20666 - v20671 = add v20669, v20670 - v20672 = array_set mut v20662, index v20661, value v20671 - enable_side_effects u1 1 - v20673 = array_get v1, index u32 369 - enable_side_effects v20673 - v20674 = array_get v2, index u32 369 - v20675 = cast v20674 as u32 - v20676 = array_set v20672, index v20675, value Field 369 - v20678 = not v20673 - v20679 = array_get v20676, index v20675 - v20680 = array_get v20672, index v20675 - v20681 = cast v20673 as Field - v20682 = cast v20678 as Field - v20683 = mul v20681, v20679 - v20684 = mul v20682, v20680 - v20685 = add v20683, v20684 - v20686 = array_set mut v20676, index v20675, value v20685 - enable_side_effects u1 1 - v20687 = array_get v1, index u32 370 - enable_side_effects v20687 - v20688 = array_get v2, index u32 370 - v20689 = cast v20688 as u32 - v20690 = array_set v20686, index v20689, value Field 370 - v20692 = not v20687 - v20693 = array_get v20690, index v20689 - v20694 = array_get v20686, index v20689 - v20695 = cast v20687 as Field - v20696 = cast v20692 as Field - v20697 = mul v20695, v20693 - v20698 = mul v20696, v20694 - v20699 = add v20697, v20698 - v20700 = array_set mut v20690, index v20689, value v20699 - enable_side_effects u1 1 - v20701 = array_get v1, index u32 371 - enable_side_effects v20701 - v20702 = array_get v2, index u32 371 - v20703 = cast v20702 as u32 - v20704 = array_set v20700, index v20703, value Field 371 - v20706 = not v20701 - v20707 = array_get v20704, index v20703 - v20708 = array_get v20700, index v20703 - v20709 = cast v20701 as Field - v20710 = cast v20706 as Field - v20711 = mul v20709, v20707 - v20712 = mul v20710, v20708 - v20713 = add v20711, v20712 - v20714 = array_set mut v20704, index v20703, value v20713 - enable_side_effects u1 1 - v20715 = array_get v1, index u32 372 - enable_side_effects v20715 - v20716 = array_get v2, index u32 372 - v20717 = cast v20716 as u32 - v20718 = array_set v20714, index v20717, value Field 372 - v20720 = not v20715 - v20721 = array_get v20718, index v20717 - v20722 = array_get v20714, index v20717 - v20723 = cast v20715 as Field - v20724 = cast v20720 as Field - v20725 = mul v20723, v20721 - v20726 = mul v20724, v20722 - v20727 = add v20725, v20726 - v20728 = array_set mut v20718, index v20717, value v20727 - enable_side_effects u1 1 - v20729 = array_get v1, index u32 373 - enable_side_effects v20729 - v20730 = array_get v2, index u32 373 - v20731 = cast v20730 as u32 - v20732 = array_set v20728, index v20731, value Field 373 - v20734 = not v20729 - v20735 = array_get v20732, index v20731 - v20736 = array_get v20728, index v20731 - v20737 = cast v20729 as Field - v20738 = cast v20734 as Field - v20739 = mul v20737, v20735 - v20740 = mul v20738, v20736 - v20741 = add v20739, v20740 - v20742 = array_set mut v20732, index v20731, value v20741 - enable_side_effects u1 1 - v20743 = array_get v1, index u32 374 - enable_side_effects v20743 - v20744 = array_get v2, index u32 374 - v20745 = cast v20744 as u32 - v20746 = array_set v20742, index v20745, value Field 374 - v20748 = not v20743 - v20749 = array_get v20746, index v20745 - v20750 = array_get v20742, index v20745 - v20751 = cast v20743 as Field - v20752 = cast v20748 as Field - v20753 = mul v20751, v20749 - v20754 = mul v20752, v20750 - v20755 = add v20753, v20754 - v20756 = array_set mut v20746, index v20745, value v20755 - enable_side_effects u1 1 - v20757 = array_get v1, index u32 375 - enable_side_effects v20757 - v20758 = array_get v2, index u32 375 - v20759 = cast v20758 as u32 - v20760 = array_set v20756, index v20759, value Field 375 - v20762 = not v20757 - v20763 = array_get v20760, index v20759 - v20764 = array_get v20756, index v20759 - v20765 = cast v20757 as Field - v20766 = cast v20762 as Field - v20767 = mul v20765, v20763 - v20768 = mul v20766, v20764 - v20769 = add v20767, v20768 - v20770 = array_set mut v20760, index v20759, value v20769 - enable_side_effects u1 1 - v20771 = array_get v1, index u32 376 - enable_side_effects v20771 - v20772 = array_get v2, index u32 376 - v20773 = cast v20772 as u32 - v20774 = array_set v20770, index v20773, value Field 376 - v20776 = not v20771 - v20777 = array_get v20774, index v20773 - v20778 = array_get v20770, index v20773 - v20779 = cast v20771 as Field - v20780 = cast v20776 as Field - v20781 = mul v20779, v20777 - v20782 = mul v20780, v20778 - v20783 = add v20781, v20782 - v20784 = array_set mut v20774, index v20773, value v20783 - enable_side_effects u1 1 - v20785 = array_get v1, index u32 377 - enable_side_effects v20785 - v20786 = array_get v2, index u32 377 - v20787 = cast v20786 as u32 - v20788 = array_set v20784, index v20787, value Field 377 - v20790 = not v20785 - v20791 = array_get v20788, index v20787 - v20792 = array_get v20784, index v20787 - v20793 = cast v20785 as Field - v20794 = cast v20790 as Field - v20795 = mul v20793, v20791 - v20796 = mul v20794, v20792 - v20797 = add v20795, v20796 - v20798 = array_set mut v20788, index v20787, value v20797 - enable_side_effects u1 1 - v20799 = array_get v1, index u32 378 - enable_side_effects v20799 - v20800 = array_get v2, index u32 378 - v20801 = cast v20800 as u32 - v20802 = array_set v20798, index v20801, value Field 378 - v20804 = not v20799 - v20805 = array_get v20802, index v20801 - v20806 = array_get v20798, index v20801 - v20807 = cast v20799 as Field - v20808 = cast v20804 as Field - v20809 = mul v20807, v20805 - v20810 = mul v20808, v20806 - v20811 = add v20809, v20810 - v20812 = array_set mut v20802, index v20801, value v20811 - enable_side_effects u1 1 - v20813 = array_get v1, index u32 379 - enable_side_effects v20813 - v20814 = array_get v2, index u32 379 - v20815 = cast v20814 as u32 - v20816 = array_set v20812, index v20815, value Field 379 - v20818 = not v20813 - v20819 = array_get v20816, index v20815 - v20820 = array_get v20812, index v20815 - v20821 = cast v20813 as Field - v20822 = cast v20818 as Field - v20823 = mul v20821, v20819 - v20824 = mul v20822, v20820 - v20825 = add v20823, v20824 - v20826 = array_set mut v20816, index v20815, value v20825 - enable_side_effects u1 1 - v20827 = array_get v1, index u32 380 - enable_side_effects v20827 - v20828 = array_get v2, index u32 380 - v20829 = cast v20828 as u32 - v20830 = array_set v20826, index v20829, value Field 380 - v20832 = not v20827 - v20833 = array_get v20830, index v20829 - v20834 = array_get v20826, index v20829 - v20835 = cast v20827 as Field - v20836 = cast v20832 as Field - v20837 = mul v20835, v20833 - v20838 = mul v20836, v20834 - v20839 = add v20837, v20838 - v20840 = array_set mut v20830, index v20829, value v20839 - enable_side_effects u1 1 - v20841 = array_get v1, index u32 381 - enable_side_effects v20841 - v20842 = array_get v2, index u32 381 - v20843 = cast v20842 as u32 - v20844 = array_set v20840, index v20843, value Field 381 - v20846 = not v20841 - v20847 = array_get v20844, index v20843 - v20848 = array_get v20840, index v20843 - v20849 = cast v20841 as Field - v20850 = cast v20846 as Field - v20851 = mul v20849, v20847 - v20852 = mul v20850, v20848 - v20853 = add v20851, v20852 - v20854 = array_set mut v20844, index v20843, value v20853 - enable_side_effects u1 1 - v20855 = array_get v1, index u32 382 - enable_side_effects v20855 - v20856 = array_get v2, index u32 382 - v20857 = cast v20856 as u32 - v20858 = array_set v20854, index v20857, value Field 382 - v20860 = not v20855 - v20861 = array_get v20858, index v20857 - v20862 = array_get v20854, index v20857 - v20863 = cast v20855 as Field - v20864 = cast v20860 as Field - v20865 = mul v20863, v20861 - v20866 = mul v20864, v20862 - v20867 = add v20865, v20866 - v20868 = array_set mut v20858, index v20857, value v20867 - enable_side_effects u1 1 - v20869 = array_get v1, index u32 383 - enable_side_effects v20869 - v20870 = array_get v2, index u32 383 - v20871 = cast v20870 as u32 - v20872 = array_set v20868, index v20871, value Field 383 - v20874 = not v20869 - v20875 = array_get v20872, index v20871 - v20876 = array_get v20868, index v20871 - v20877 = cast v20869 as Field - v20878 = cast v20874 as Field - v20879 = mul v20877, v20875 - v20880 = mul v20878, v20876 - v20881 = add v20879, v20880 - v20882 = array_set mut v20872, index v20871, value v20881 - enable_side_effects u1 1 - v20883 = array_get v1, index u32 2⁴×24 - enable_side_effects v20883 - v20884 = array_get v2, index u32 2⁴×24 - v20885 = cast v20884 as u32 - v20886 = array_set v20882, index v20885, value Field 2⁴×24 - v20888 = not v20883 - v20889 = array_get v20886, index v20885 - v20890 = array_get v20882, index v20885 - v20891 = cast v20883 as Field - v20892 = cast v20888 as Field - v20893 = mul v20891, v20889 - v20894 = mul v20892, v20890 - v20895 = add v20893, v20894 - v20896 = array_set mut v20886, index v20885, value v20895 - enable_side_effects u1 1 - v20897 = array_get v1, index u32 385 - enable_side_effects v20897 - v20898 = array_get v2, index u32 385 - v20899 = cast v20898 as u32 - v20900 = array_set v20896, index v20899, value Field 385 - v20902 = not v20897 - v20903 = array_get v20900, index v20899 - v20904 = array_get v20896, index v20899 - v20905 = cast v20897 as Field - v20906 = cast v20902 as Field - v20907 = mul v20905, v20903 - v20908 = mul v20906, v20904 - v20909 = add v20907, v20908 - v20910 = array_set mut v20900, index v20899, value v20909 - enable_side_effects u1 1 - v20911 = array_get v1, index u32 386 - enable_side_effects v20911 - v20912 = array_get v2, index u32 386 - v20913 = cast v20912 as u32 - v20914 = array_set v20910, index v20913, value Field 386 - v20916 = not v20911 - v20917 = array_get v20914, index v20913 - v20918 = array_get v20910, index v20913 - v20919 = cast v20911 as Field - v20920 = cast v20916 as Field - v20921 = mul v20919, v20917 - v20922 = mul v20920, v20918 - v20923 = add v20921, v20922 - v20924 = array_set mut v20914, index v20913, value v20923 - enable_side_effects u1 1 - v20925 = array_get v1, index u32 387 - enable_side_effects v20925 - v20926 = array_get v2, index u32 387 - v20927 = cast v20926 as u32 - v20928 = array_set v20924, index v20927, value Field 387 - v20930 = not v20925 - v20931 = array_get v20928, index v20927 - v20932 = array_get v20924, index v20927 - v20933 = cast v20925 as Field - v20934 = cast v20930 as Field - v20935 = mul v20933, v20931 - v20936 = mul v20934, v20932 - v20937 = add v20935, v20936 - v20938 = array_set mut v20928, index v20927, value v20937 - enable_side_effects u1 1 - v20939 = array_get v1, index u32 388 - enable_side_effects v20939 - v20940 = array_get v2, index u32 388 - v20941 = cast v20940 as u32 - v20942 = array_set v20938, index v20941, value Field 388 - v20944 = not v20939 - v20945 = array_get v20942, index v20941 - v20946 = array_get v20938, index v20941 - v20947 = cast v20939 as Field - v20948 = cast v20944 as Field - v20949 = mul v20947, v20945 - v20950 = mul v20948, v20946 - v20951 = add v20949, v20950 - v20952 = array_set mut v20942, index v20941, value v20951 - enable_side_effects u1 1 - v20953 = array_get v1, index u32 389 - enable_side_effects v20953 - v20954 = array_get v2, index u32 389 - v20955 = cast v20954 as u32 - v20956 = array_set v20952, index v20955, value Field 389 - v20958 = not v20953 - v20959 = array_get v20956, index v20955 - v20960 = array_get v20952, index v20955 - v20961 = cast v20953 as Field - v20962 = cast v20958 as Field - v20963 = mul v20961, v20959 - v20964 = mul v20962, v20960 - v20965 = add v20963, v20964 - v20966 = array_set mut v20956, index v20955, value v20965 - enable_side_effects u1 1 - v20967 = array_get v1, index u32 390 - enable_side_effects v20967 - v20968 = array_get v2, index u32 390 - v20969 = cast v20968 as u32 - v20970 = array_set v20966, index v20969, value Field 390 - v20972 = not v20967 - v20973 = array_get v20970, index v20969 - v20974 = array_get v20966, index v20969 - v20975 = cast v20967 as Field - v20976 = cast v20972 as Field - v20977 = mul v20975, v20973 - v20978 = mul v20976, v20974 - v20979 = add v20977, v20978 - v20980 = array_set mut v20970, index v20969, value v20979 - enable_side_effects u1 1 - v20981 = array_get v1, index u32 391 - enable_side_effects v20981 - v20982 = array_get v2, index u32 391 - v20983 = cast v20982 as u32 - v20984 = array_set v20980, index v20983, value Field 391 - v20986 = not v20981 - v20987 = array_get v20984, index v20983 - v20988 = array_get v20980, index v20983 - v20989 = cast v20981 as Field - v20990 = cast v20986 as Field - v20991 = mul v20989, v20987 - v20992 = mul v20990, v20988 - v20993 = add v20991, v20992 - v20994 = array_set mut v20984, index v20983, value v20993 - enable_side_effects u1 1 - v20995 = array_get v1, index u32 392 - enable_side_effects v20995 - v20996 = array_get v2, index u32 392 - v20997 = cast v20996 as u32 - v20998 = array_set v20994, index v20997, value Field 392 - v21000 = not v20995 - v21001 = array_get v20998, index v20997 - v21002 = array_get v20994, index v20997 - v21003 = cast v20995 as Field - v21004 = cast v21000 as Field - v21005 = mul v21003, v21001 - v21006 = mul v21004, v21002 - v21007 = add v21005, v21006 - v21008 = array_set mut v20998, index v20997, value v21007 - enable_side_effects u1 1 - v21009 = array_get v1, index u32 393 - enable_side_effects v21009 - v21010 = array_get v2, index u32 393 - v21011 = cast v21010 as u32 - v21012 = array_set v21008, index v21011, value Field 393 - v21014 = not v21009 - v21015 = array_get v21012, index v21011 - v21016 = array_get v21008, index v21011 - v21017 = cast v21009 as Field - v21018 = cast v21014 as Field - v21019 = mul v21017, v21015 - v21020 = mul v21018, v21016 - v21021 = add v21019, v21020 - v21022 = array_set mut v21012, index v21011, value v21021 - enable_side_effects u1 1 - v21023 = array_get v1, index u32 394 - enable_side_effects v21023 - v21024 = array_get v2, index u32 394 - v21025 = cast v21024 as u32 - v21026 = array_set v21022, index v21025, value Field 394 - v21028 = not v21023 - v21029 = array_get v21026, index v21025 - v21030 = array_get v21022, index v21025 - v21031 = cast v21023 as Field - v21032 = cast v21028 as Field - v21033 = mul v21031, v21029 - v21034 = mul v21032, v21030 - v21035 = add v21033, v21034 - v21036 = array_set mut v21026, index v21025, value v21035 - enable_side_effects u1 1 - v21037 = array_get v1, index u32 395 - enable_side_effects v21037 - v21038 = array_get v2, index u32 395 - v21039 = cast v21038 as u32 - v21040 = array_set v21036, index v21039, value Field 395 - v21042 = not v21037 - v21043 = array_get v21040, index v21039 - v21044 = array_get v21036, index v21039 - v21045 = cast v21037 as Field - v21046 = cast v21042 as Field - v21047 = mul v21045, v21043 - v21048 = mul v21046, v21044 - v21049 = add v21047, v21048 - v21050 = array_set mut v21040, index v21039, value v21049 - enable_side_effects u1 1 - v21051 = array_get v1, index u32 396 - enable_side_effects v21051 - v21052 = array_get v2, index u32 396 - v21053 = cast v21052 as u32 - v21054 = array_set v21050, index v21053, value Field 396 - v21056 = not v21051 - v21057 = array_get v21054, index v21053 - v21058 = array_get v21050, index v21053 - v21059 = cast v21051 as Field - v21060 = cast v21056 as Field - v21061 = mul v21059, v21057 - v21062 = mul v21060, v21058 - v21063 = add v21061, v21062 - v21064 = array_set mut v21054, index v21053, value v21063 - enable_side_effects u1 1 - v21065 = array_get v1, index u32 397 - enable_side_effects v21065 - v21066 = array_get v2, index u32 397 - v21067 = cast v21066 as u32 - v21068 = array_set v21064, index v21067, value Field 397 - v21070 = not v21065 - v21071 = array_get v21068, index v21067 - v21072 = array_get v21064, index v21067 - v21073 = cast v21065 as Field - v21074 = cast v21070 as Field - v21075 = mul v21073, v21071 - v21076 = mul v21074, v21072 - v21077 = add v21075, v21076 - v21078 = array_set mut v21068, index v21067, value v21077 - enable_side_effects u1 1 - v21079 = array_get v1, index u32 398 - enable_side_effects v21079 - v21080 = array_get v2, index u32 398 - v21081 = cast v21080 as u32 - v21082 = array_set v21078, index v21081, value Field 398 - v21084 = not v21079 - v21085 = array_get v21082, index v21081 - v21086 = array_get v21078, index v21081 - v21087 = cast v21079 as Field - v21088 = cast v21084 as Field - v21089 = mul v21087, v21085 - v21090 = mul v21088, v21086 - v21091 = add v21089, v21090 - v21092 = array_set mut v21082, index v21081, value v21091 - enable_side_effects u1 1 - v21093 = array_get v1, index u32 399 - enable_side_effects v21093 - v21094 = array_get v2, index u32 399 - v21095 = cast v21094 as u32 - v21096 = array_set v21092, index v21095, value Field 399 - v21098 = not v21093 - v21099 = array_get v21096, index v21095 - v21100 = array_get v21092, index v21095 - v21101 = cast v21093 as Field - v21102 = cast v21098 as Field - v21103 = mul v21101, v21099 - v21104 = mul v21102, v21100 - v21105 = add v21103, v21104 - v21106 = array_set mut v21096, index v21095, value v21105 - enable_side_effects u1 1 - v21107 = array_get v1, index u32 2⁴×25 - enable_side_effects v21107 - v21108 = array_get v2, index u32 2⁴×25 - v21109 = cast v21108 as u32 - v21110 = array_set v21106, index v21109, value Field 2⁴×25 - v21112 = not v21107 - v21113 = array_get v21110, index v21109 - v21114 = array_get v21106, index v21109 - v21115 = cast v21107 as Field - v21116 = cast v21112 as Field - v21117 = mul v21115, v21113 - v21118 = mul v21116, v21114 - v21119 = add v21117, v21118 - v21120 = array_set mut v21110, index v21109, value v21119 - enable_side_effects u1 1 - v21121 = array_get v1, index u32 401 - enable_side_effects v21121 - v21122 = array_get v2, index u32 401 - v21123 = cast v21122 as u32 - v21124 = array_set v21120, index v21123, value Field 401 - v21126 = not v21121 - v21127 = array_get v21124, index v21123 - v21128 = array_get v21120, index v21123 - v21129 = cast v21121 as Field - v21130 = cast v21126 as Field - v21131 = mul v21129, v21127 - v21132 = mul v21130, v21128 - v21133 = add v21131, v21132 - v21134 = array_set mut v21124, index v21123, value v21133 - enable_side_effects u1 1 - v21135 = array_get v1, index u32 402 - enable_side_effects v21135 - v21136 = array_get v2, index u32 402 - v21137 = cast v21136 as u32 - v21138 = array_set v21134, index v21137, value Field 402 - v21140 = not v21135 - v21141 = array_get v21138, index v21137 - v21142 = array_get v21134, index v21137 - v21143 = cast v21135 as Field - v21144 = cast v21140 as Field - v21145 = mul v21143, v21141 - v21146 = mul v21144, v21142 - v21147 = add v21145, v21146 - v21148 = array_set mut v21138, index v21137, value v21147 - enable_side_effects u1 1 - v21149 = array_get v1, index u32 403 - enable_side_effects v21149 - v21150 = array_get v2, index u32 403 - v21151 = cast v21150 as u32 - v21152 = array_set v21148, index v21151, value Field 403 - v21154 = not v21149 - v21155 = array_get v21152, index v21151 - v21156 = array_get v21148, index v21151 - v21157 = cast v21149 as Field - v21158 = cast v21154 as Field - v21159 = mul v21157, v21155 - v21160 = mul v21158, v21156 - v21161 = add v21159, v21160 - v21162 = array_set mut v21152, index v21151, value v21161 - enable_side_effects u1 1 - v21163 = array_get v1, index u32 404 - enable_side_effects v21163 - v21164 = array_get v2, index u32 404 - v21165 = cast v21164 as u32 - v21166 = array_set v21162, index v21165, value Field 404 - v21168 = not v21163 - v21169 = array_get v21166, index v21165 - v21170 = array_get v21162, index v21165 - v21171 = cast v21163 as Field - v21172 = cast v21168 as Field - v21173 = mul v21171, v21169 - v21174 = mul v21172, v21170 - v21175 = add v21173, v21174 - v21176 = array_set mut v21166, index v21165, value v21175 - enable_side_effects u1 1 - v21177 = array_get v1, index u32 405 - enable_side_effects v21177 - v21178 = array_get v2, index u32 405 - v21179 = cast v21178 as u32 - v21180 = array_set v21176, index v21179, value Field 405 - v21182 = not v21177 - v21183 = array_get v21180, index v21179 - v21184 = array_get v21176, index v21179 - v21185 = cast v21177 as Field - v21186 = cast v21182 as Field - v21187 = mul v21185, v21183 - v21188 = mul v21186, v21184 - v21189 = add v21187, v21188 - v21190 = array_set mut v21180, index v21179, value v21189 - enable_side_effects u1 1 - v21191 = array_get v1, index u32 406 - enable_side_effects v21191 - v21192 = array_get v2, index u32 406 - v21193 = cast v21192 as u32 - v21194 = array_set v21190, index v21193, value Field 406 - v21196 = not v21191 - v21197 = array_get v21194, index v21193 - v21198 = array_get v21190, index v21193 - v21199 = cast v21191 as Field - v21200 = cast v21196 as Field - v21201 = mul v21199, v21197 - v21202 = mul v21200, v21198 - v21203 = add v21201, v21202 - v21204 = array_set mut v21194, index v21193, value v21203 - enable_side_effects u1 1 - v21205 = array_get v1, index u32 407 - enable_side_effects v21205 - v21206 = array_get v2, index u32 407 - v21207 = cast v21206 as u32 - v21208 = array_set v21204, index v21207, value Field 407 - v21210 = not v21205 - v21211 = array_get v21208, index v21207 - v21212 = array_get v21204, index v21207 - v21213 = cast v21205 as Field - v21214 = cast v21210 as Field - v21215 = mul v21213, v21211 - v21216 = mul v21214, v21212 - v21217 = add v21215, v21216 - v21218 = array_set mut v21208, index v21207, value v21217 - enable_side_effects u1 1 - v21219 = array_get v1, index u32 408 - enable_side_effects v21219 - v21220 = array_get v2, index u32 408 - v21221 = cast v21220 as u32 - v21222 = array_set v21218, index v21221, value Field 408 - v21224 = not v21219 - v21225 = array_get v21222, index v21221 - v21226 = array_get v21218, index v21221 - v21227 = cast v21219 as Field - v21228 = cast v21224 as Field - v21229 = mul v21227, v21225 - v21230 = mul v21228, v21226 - v21231 = add v21229, v21230 - v21232 = array_set mut v21222, index v21221, value v21231 - enable_side_effects u1 1 - v21233 = array_get v1, index u32 409 - enable_side_effects v21233 - v21234 = array_get v2, index u32 409 - v21235 = cast v21234 as u32 - v21236 = array_set v21232, index v21235, value Field 409 - v21238 = not v21233 - v21239 = array_get v21236, index v21235 - v21240 = array_get v21232, index v21235 - v21241 = cast v21233 as Field - v21242 = cast v21238 as Field - v21243 = mul v21241, v21239 - v21244 = mul v21242, v21240 - v21245 = add v21243, v21244 - v21246 = array_set mut v21236, index v21235, value v21245 - enable_side_effects u1 1 - v21247 = array_get v1, index u32 410 - enable_side_effects v21247 - v21248 = array_get v2, index u32 410 - v21249 = cast v21248 as u32 - v21250 = array_set v21246, index v21249, value Field 410 - v21252 = not v21247 - v21253 = array_get v21250, index v21249 - v21254 = array_get v21246, index v21249 - v21255 = cast v21247 as Field - v21256 = cast v21252 as Field - v21257 = mul v21255, v21253 - v21258 = mul v21256, v21254 - v21259 = add v21257, v21258 - v21260 = array_set mut v21250, index v21249, value v21259 - enable_side_effects u1 1 - v21261 = array_get v1, index u32 411 - enable_side_effects v21261 - v21262 = array_get v2, index u32 411 - v21263 = cast v21262 as u32 - v21264 = array_set v21260, index v21263, value Field 411 - v21266 = not v21261 - v21267 = array_get v21264, index v21263 - v21268 = array_get v21260, index v21263 - v21269 = cast v21261 as Field - v21270 = cast v21266 as Field - v21271 = mul v21269, v21267 - v21272 = mul v21270, v21268 - v21273 = add v21271, v21272 - v21274 = array_set mut v21264, index v21263, value v21273 - enable_side_effects u1 1 - v21275 = array_get v1, index u32 412 - enable_side_effects v21275 - v21276 = array_get v2, index u32 412 - v21277 = cast v21276 as u32 - v21278 = array_set v21274, index v21277, value Field 412 - v21280 = not v21275 - v21281 = array_get v21278, index v21277 - v21282 = array_get v21274, index v21277 - v21283 = cast v21275 as Field - v21284 = cast v21280 as Field - v21285 = mul v21283, v21281 - v21286 = mul v21284, v21282 - v21287 = add v21285, v21286 - v21288 = array_set mut v21278, index v21277, value v21287 - enable_side_effects u1 1 - v21289 = array_get v1, index u32 413 - enable_side_effects v21289 - v21290 = array_get v2, index u32 413 - v21291 = cast v21290 as u32 - v21292 = array_set v21288, index v21291, value Field 413 - v21294 = not v21289 - v21295 = array_get v21292, index v21291 - v21296 = array_get v21288, index v21291 - v21297 = cast v21289 as Field - v21298 = cast v21294 as Field - v21299 = mul v21297, v21295 - v21300 = mul v21298, v21296 - v21301 = add v21299, v21300 - v21302 = array_set mut v21292, index v21291, value v21301 - enable_side_effects u1 1 - v21303 = array_get v1, index u32 414 - enable_side_effects v21303 - v21304 = array_get v2, index u32 414 - v21305 = cast v21304 as u32 - v21306 = array_set v21302, index v21305, value Field 414 - v21308 = not v21303 - v21309 = array_get v21306, index v21305 - v21310 = array_get v21302, index v21305 - v21311 = cast v21303 as Field - v21312 = cast v21308 as Field - v21313 = mul v21311, v21309 - v21314 = mul v21312, v21310 - v21315 = add v21313, v21314 - v21316 = array_set mut v21306, index v21305, value v21315 - enable_side_effects u1 1 - v21317 = array_get v1, index u32 415 - enable_side_effects v21317 - v21318 = array_get v2, index u32 415 - v21319 = cast v21318 as u32 - v21320 = array_set v21316, index v21319, value Field 415 - v21322 = not v21317 - v21323 = array_get v21320, index v21319 - v21324 = array_get v21316, index v21319 - v21325 = cast v21317 as Field - v21326 = cast v21322 as Field - v21327 = mul v21325, v21323 - v21328 = mul v21326, v21324 - v21329 = add v21327, v21328 - v21330 = array_set mut v21320, index v21319, value v21329 - enable_side_effects u1 1 - v21331 = array_get v1, index u32 2⁴×26 - enable_side_effects v21331 - v21332 = array_get v2, index u32 2⁴×26 - v21333 = cast v21332 as u32 - v21334 = array_set v21330, index v21333, value Field 2⁴×26 - v21336 = not v21331 - v21337 = array_get v21334, index v21333 - v21338 = array_get v21330, index v21333 - v21339 = cast v21331 as Field - v21340 = cast v21336 as Field - v21341 = mul v21339, v21337 - v21342 = mul v21340, v21338 - v21343 = add v21341, v21342 - v21344 = array_set mut v21334, index v21333, value v21343 - enable_side_effects u1 1 - v21345 = array_get v1, index u32 417 - enable_side_effects v21345 - v21346 = array_get v2, index u32 417 - v21347 = cast v21346 as u32 - v21348 = array_set v21344, index v21347, value Field 417 - v21350 = not v21345 - v21351 = array_get v21348, index v21347 - v21352 = array_get v21344, index v21347 - v21353 = cast v21345 as Field - v21354 = cast v21350 as Field - v21355 = mul v21353, v21351 - v21356 = mul v21354, v21352 - v21357 = add v21355, v21356 - v21358 = array_set mut v21348, index v21347, value v21357 - enable_side_effects u1 1 - v21359 = array_get v1, index u32 418 - enable_side_effects v21359 - v21360 = array_get v2, index u32 418 - v21361 = cast v21360 as u32 - v21362 = array_set v21358, index v21361, value Field 418 - v21364 = not v21359 - v21365 = array_get v21362, index v21361 - v21366 = array_get v21358, index v21361 - v21367 = cast v21359 as Field - v21368 = cast v21364 as Field - v21369 = mul v21367, v21365 - v21370 = mul v21368, v21366 - v21371 = add v21369, v21370 - v21372 = array_set mut v21362, index v21361, value v21371 - enable_side_effects u1 1 - v21373 = array_get v1, index u32 419 - enable_side_effects v21373 - v21374 = array_get v2, index u32 419 - v21375 = cast v21374 as u32 - v21376 = array_set v21372, index v21375, value Field 419 - v21378 = not v21373 - v21379 = array_get v21376, index v21375 - v21380 = array_get v21372, index v21375 - v21381 = cast v21373 as Field - v21382 = cast v21378 as Field - v21383 = mul v21381, v21379 - v21384 = mul v21382, v21380 - v21385 = add v21383, v21384 - v21386 = array_set mut v21376, index v21375, value v21385 - enable_side_effects u1 1 - v21387 = array_get v1, index u32 420 - enable_side_effects v21387 - v21388 = array_get v2, index u32 420 - v21389 = cast v21388 as u32 - v21390 = array_set v21386, index v21389, value Field 420 - v21392 = not v21387 - v21393 = array_get v21390, index v21389 - v21394 = array_get v21386, index v21389 - v21395 = cast v21387 as Field - v21396 = cast v21392 as Field - v21397 = mul v21395, v21393 - v21398 = mul v21396, v21394 - v21399 = add v21397, v21398 - v21400 = array_set mut v21390, index v21389, value v21399 - enable_side_effects u1 1 - v21401 = array_get v1, index u32 421 - enable_side_effects v21401 - v21402 = array_get v2, index u32 421 - v21403 = cast v21402 as u32 - v21404 = array_set v21400, index v21403, value Field 421 - v21406 = not v21401 - v21407 = array_get v21404, index v21403 - v21408 = array_get v21400, index v21403 - v21409 = cast v21401 as Field - v21410 = cast v21406 as Field - v21411 = mul v21409, v21407 - v21412 = mul v21410, v21408 - v21413 = add v21411, v21412 - v21414 = array_set mut v21404, index v21403, value v21413 - enable_side_effects u1 1 - v21415 = array_get v1, index u32 422 - enable_side_effects v21415 - v21416 = array_get v2, index u32 422 - v21417 = cast v21416 as u32 - v21418 = array_set v21414, index v21417, value Field 422 - v21420 = not v21415 - v21421 = array_get v21418, index v21417 - v21422 = array_get v21414, index v21417 - v21423 = cast v21415 as Field - v21424 = cast v21420 as Field - v21425 = mul v21423, v21421 - v21426 = mul v21424, v21422 - v21427 = add v21425, v21426 - v21428 = array_set mut v21418, index v21417, value v21427 - enable_side_effects u1 1 - v21429 = array_get v1, index u32 423 - enable_side_effects v21429 - v21430 = array_get v2, index u32 423 - v21431 = cast v21430 as u32 - v21432 = array_set v21428, index v21431, value Field 423 - v21434 = not v21429 - v21435 = array_get v21432, index v21431 - v21436 = array_get v21428, index v21431 - v21437 = cast v21429 as Field - v21438 = cast v21434 as Field - v21439 = mul v21437, v21435 - v21440 = mul v21438, v21436 - v21441 = add v21439, v21440 - v21442 = array_set mut v21432, index v21431, value v21441 - enable_side_effects u1 1 - v21443 = array_get v1, index u32 424 - enable_side_effects v21443 - v21444 = array_get v2, index u32 424 - v21445 = cast v21444 as u32 - v21446 = array_set v21442, index v21445, value Field 424 - v21448 = not v21443 - v21449 = array_get v21446, index v21445 - v21450 = array_get v21442, index v21445 - v21451 = cast v21443 as Field - v21452 = cast v21448 as Field - v21453 = mul v21451, v21449 - v21454 = mul v21452, v21450 - v21455 = add v21453, v21454 - v21456 = array_set mut v21446, index v21445, value v21455 - enable_side_effects u1 1 - v21457 = array_get v1, index u32 425 - enable_side_effects v21457 - v21458 = array_get v2, index u32 425 - v21459 = cast v21458 as u32 - v21460 = array_set v21456, index v21459, value Field 425 - v21462 = not v21457 - v21463 = array_get v21460, index v21459 - v21464 = array_get v21456, index v21459 - v21465 = cast v21457 as Field - v21466 = cast v21462 as Field - v21467 = mul v21465, v21463 - v21468 = mul v21466, v21464 - v21469 = add v21467, v21468 - v21470 = array_set mut v21460, index v21459, value v21469 - enable_side_effects u1 1 - v21471 = array_get v1, index u32 426 - enable_side_effects v21471 - v21472 = array_get v2, index u32 426 - v21473 = cast v21472 as u32 - v21474 = array_set v21470, index v21473, value Field 426 - v21476 = not v21471 - v21477 = array_get v21474, index v21473 - v21478 = array_get v21470, index v21473 - v21479 = cast v21471 as Field - v21480 = cast v21476 as Field - v21481 = mul v21479, v21477 - v21482 = mul v21480, v21478 - v21483 = add v21481, v21482 - v21484 = array_set mut v21474, index v21473, value v21483 - enable_side_effects u1 1 - v21485 = array_get v1, index u32 427 - enable_side_effects v21485 - v21486 = array_get v2, index u32 427 - v21487 = cast v21486 as u32 - v21488 = array_set v21484, index v21487, value Field 427 - v21490 = not v21485 - v21491 = array_get v21488, index v21487 - v21492 = array_get v21484, index v21487 - v21493 = cast v21485 as Field - v21494 = cast v21490 as Field - v21495 = mul v21493, v21491 - v21496 = mul v21494, v21492 - v21497 = add v21495, v21496 - v21498 = array_set mut v21488, index v21487, value v21497 - enable_side_effects u1 1 - v21499 = array_get v1, index u32 428 - enable_side_effects v21499 - v21500 = array_get v2, index u32 428 - v21501 = cast v21500 as u32 - v21502 = array_set v21498, index v21501, value Field 428 - v21504 = not v21499 - v21505 = array_get v21502, index v21501 - v21506 = array_get v21498, index v21501 - v21507 = cast v21499 as Field - v21508 = cast v21504 as Field - v21509 = mul v21507, v21505 - v21510 = mul v21508, v21506 - v21511 = add v21509, v21510 - v21512 = array_set mut v21502, index v21501, value v21511 - enable_side_effects u1 1 - v21513 = array_get v1, index u32 429 - enable_side_effects v21513 - v21514 = array_get v2, index u32 429 - v21515 = cast v21514 as u32 - v21516 = array_set v21512, index v21515, value Field 429 - v21518 = not v21513 - v21519 = array_get v21516, index v21515 - v21520 = array_get v21512, index v21515 - v21521 = cast v21513 as Field - v21522 = cast v21518 as Field - v21523 = mul v21521, v21519 - v21524 = mul v21522, v21520 - v21525 = add v21523, v21524 - v21526 = array_set mut v21516, index v21515, value v21525 - enable_side_effects u1 1 - v21527 = array_get v1, index u32 430 - enable_side_effects v21527 - v21528 = array_get v2, index u32 430 - v21529 = cast v21528 as u32 - v21530 = array_set v21526, index v21529, value Field 430 - v21532 = not v21527 - v21533 = array_get v21530, index v21529 - v21534 = array_get v21526, index v21529 - v21535 = cast v21527 as Field - v21536 = cast v21532 as Field - v21537 = mul v21535, v21533 - v21538 = mul v21536, v21534 - v21539 = add v21537, v21538 - v21540 = array_set mut v21530, index v21529, value v21539 - enable_side_effects u1 1 - v21541 = array_get v1, index u32 431 - enable_side_effects v21541 - v21542 = array_get v2, index u32 431 - v21543 = cast v21542 as u32 - v21544 = array_set v21540, index v21543, value Field 431 - v21546 = not v21541 - v21547 = array_get v21544, index v21543 - v21548 = array_get v21540, index v21543 - v21549 = cast v21541 as Field - v21550 = cast v21546 as Field - v21551 = mul v21549, v21547 - v21552 = mul v21550, v21548 - v21553 = add v21551, v21552 - v21554 = array_set mut v21544, index v21543, value v21553 - enable_side_effects u1 1 - v21555 = array_get v1, index u32 2⁴×27 - enable_side_effects v21555 - v21556 = array_get v2, index u32 2⁴×27 - v21557 = cast v21556 as u32 - v21558 = array_set v21554, index v21557, value Field 2⁴×27 - v21560 = not v21555 - v21561 = array_get v21558, index v21557 - v21562 = array_get v21554, index v21557 - v21563 = cast v21555 as Field - v21564 = cast v21560 as Field - v21565 = mul v21563, v21561 - v21566 = mul v21564, v21562 - v21567 = add v21565, v21566 - v21568 = array_set mut v21558, index v21557, value v21567 - enable_side_effects u1 1 - v21569 = array_get v1, index u32 433 - enable_side_effects v21569 - v21570 = array_get v2, index u32 433 - v21571 = cast v21570 as u32 - v21572 = array_set v21568, index v21571, value Field 433 - v21574 = not v21569 - v21575 = array_get v21572, index v21571 - v21576 = array_get v21568, index v21571 - v21577 = cast v21569 as Field - v21578 = cast v21574 as Field - v21579 = mul v21577, v21575 - v21580 = mul v21578, v21576 - v21581 = add v21579, v21580 - v21582 = array_set mut v21572, index v21571, value v21581 - enable_side_effects u1 1 - v21583 = array_get v1, index u32 434 - enable_side_effects v21583 - v21584 = array_get v2, index u32 434 - v21585 = cast v21584 as u32 - v21586 = array_set v21582, index v21585, value Field 434 - v21588 = not v21583 - v21589 = array_get v21586, index v21585 - v21590 = array_get v21582, index v21585 - v21591 = cast v21583 as Field - v21592 = cast v21588 as Field - v21593 = mul v21591, v21589 - v21594 = mul v21592, v21590 - v21595 = add v21593, v21594 - v21596 = array_set mut v21586, index v21585, value v21595 - enable_side_effects u1 1 - v21597 = array_get v1, index u32 435 - enable_side_effects v21597 - v21598 = array_get v2, index u32 435 - v21599 = cast v21598 as u32 - v21600 = array_set v21596, index v21599, value Field 435 - v21602 = not v21597 - v21603 = array_get v21600, index v21599 - v21604 = array_get v21596, index v21599 - v21605 = cast v21597 as Field - v21606 = cast v21602 as Field - v21607 = mul v21605, v21603 - v21608 = mul v21606, v21604 - v21609 = add v21607, v21608 - v21610 = array_set mut v21600, index v21599, value v21609 - enable_side_effects u1 1 - v21611 = array_get v1, index u32 436 - enable_side_effects v21611 - v21612 = array_get v2, index u32 436 - v21613 = cast v21612 as u32 - v21614 = array_set v21610, index v21613, value Field 436 - v21616 = not v21611 - v21617 = array_get v21614, index v21613 - v21618 = array_get v21610, index v21613 - v21619 = cast v21611 as Field - v21620 = cast v21616 as Field - v21621 = mul v21619, v21617 - v21622 = mul v21620, v21618 - v21623 = add v21621, v21622 - v21624 = array_set mut v21614, index v21613, value v21623 - enable_side_effects u1 1 - v21625 = array_get v1, index u32 437 - enable_side_effects v21625 - v21626 = array_get v2, index u32 437 - v21627 = cast v21626 as u32 - v21628 = array_set v21624, index v21627, value Field 437 - v21630 = not v21625 - v21631 = array_get v21628, index v21627 - v21632 = array_get v21624, index v21627 - v21633 = cast v21625 as Field - v21634 = cast v21630 as Field - v21635 = mul v21633, v21631 - v21636 = mul v21634, v21632 - v21637 = add v21635, v21636 - v21638 = array_set mut v21628, index v21627, value v21637 - enable_side_effects u1 1 - v21639 = array_get v1, index u32 438 - enable_side_effects v21639 - v21640 = array_get v2, index u32 438 - v21641 = cast v21640 as u32 - v21642 = array_set v21638, index v21641, value Field 438 - v21644 = not v21639 - v21645 = array_get v21642, index v21641 - v21646 = array_get v21638, index v21641 - v21647 = cast v21639 as Field - v21648 = cast v21644 as Field - v21649 = mul v21647, v21645 - v21650 = mul v21648, v21646 - v21651 = add v21649, v21650 - v21652 = array_set mut v21642, index v21641, value v21651 - enable_side_effects u1 1 - v21653 = array_get v1, index u32 439 - enable_side_effects v21653 - v21654 = array_get v2, index u32 439 - v21655 = cast v21654 as u32 - v21656 = array_set v21652, index v21655, value Field 439 - v21658 = not v21653 - v21659 = array_get v21656, index v21655 - v21660 = array_get v21652, index v21655 - v21661 = cast v21653 as Field - v21662 = cast v21658 as Field - v21663 = mul v21661, v21659 - v21664 = mul v21662, v21660 - v21665 = add v21663, v21664 - v21666 = array_set mut v21656, index v21655, value v21665 - enable_side_effects u1 1 - v21667 = array_get v1, index u32 440 - enable_side_effects v21667 - v21668 = array_get v2, index u32 440 - v21669 = cast v21668 as u32 - v21670 = array_set v21666, index v21669, value Field 440 - v21672 = not v21667 - v21673 = array_get v21670, index v21669 - v21674 = array_get v21666, index v21669 - v21675 = cast v21667 as Field - v21676 = cast v21672 as Field - v21677 = mul v21675, v21673 - v21678 = mul v21676, v21674 - v21679 = add v21677, v21678 - v21680 = array_set mut v21670, index v21669, value v21679 - enable_side_effects u1 1 - v21681 = array_get v1, index u32 441 - enable_side_effects v21681 - v21682 = array_get v2, index u32 441 - v21683 = cast v21682 as u32 - v21684 = array_set v21680, index v21683, value Field 441 - v21686 = not v21681 - v21687 = array_get v21684, index v21683 - v21688 = array_get v21680, index v21683 - v21689 = cast v21681 as Field - v21690 = cast v21686 as Field - v21691 = mul v21689, v21687 - v21692 = mul v21690, v21688 - v21693 = add v21691, v21692 - v21694 = array_set mut v21684, index v21683, value v21693 - enable_side_effects u1 1 - v21695 = array_get v1, index u32 442 - enable_side_effects v21695 - v21696 = array_get v2, index u32 442 - v21697 = cast v21696 as u32 - v21698 = array_set v21694, index v21697, value Field 442 - v21700 = not v21695 - v21701 = array_get v21698, index v21697 - v21702 = array_get v21694, index v21697 - v21703 = cast v21695 as Field - v21704 = cast v21700 as Field - v21705 = mul v21703, v21701 - v21706 = mul v21704, v21702 - v21707 = add v21705, v21706 - v21708 = array_set mut v21698, index v21697, value v21707 - enable_side_effects u1 1 - v21709 = array_get v1, index u32 443 - enable_side_effects v21709 - v21710 = array_get v2, index u32 443 - v21711 = cast v21710 as u32 - v21712 = array_set v21708, index v21711, value Field 443 - v21714 = not v21709 - v21715 = array_get v21712, index v21711 - v21716 = array_get v21708, index v21711 - v21717 = cast v21709 as Field - v21718 = cast v21714 as Field - v21719 = mul v21717, v21715 - v21720 = mul v21718, v21716 - v21721 = add v21719, v21720 - v21722 = array_set mut v21712, index v21711, value v21721 - enable_side_effects u1 1 - v21723 = array_get v1, index u32 444 - enable_side_effects v21723 - v21724 = array_get v2, index u32 444 - v21725 = cast v21724 as u32 - v21726 = array_set v21722, index v21725, value Field 444 - v21728 = not v21723 - v21729 = array_get v21726, index v21725 - v21730 = array_get v21722, index v21725 - v21731 = cast v21723 as Field - v21732 = cast v21728 as Field - v21733 = mul v21731, v21729 - v21734 = mul v21732, v21730 - v21735 = add v21733, v21734 - v21736 = array_set mut v21726, index v21725, value v21735 - enable_side_effects u1 1 - v21737 = array_get v1, index u32 445 - enable_side_effects v21737 - v21738 = array_get v2, index u32 445 - v21739 = cast v21738 as u32 - v21740 = array_set v21736, index v21739, value Field 445 - v21742 = not v21737 - v21743 = array_get v21740, index v21739 - v21744 = array_get v21736, index v21739 - v21745 = cast v21737 as Field - v21746 = cast v21742 as Field - v21747 = mul v21745, v21743 - v21748 = mul v21746, v21744 - v21749 = add v21747, v21748 - v21750 = array_set mut v21740, index v21739, value v21749 - enable_side_effects u1 1 - v21751 = array_get v1, index u32 446 - enable_side_effects v21751 - v21752 = array_get v2, index u32 446 - v21753 = cast v21752 as u32 - v21754 = array_set v21750, index v21753, value Field 446 - v21756 = not v21751 - v21757 = array_get v21754, index v21753 - v21758 = array_get v21750, index v21753 - v21759 = cast v21751 as Field - v21760 = cast v21756 as Field - v21761 = mul v21759, v21757 - v21762 = mul v21760, v21758 - v21763 = add v21761, v21762 - v21764 = array_set mut v21754, index v21753, value v21763 - enable_side_effects u1 1 - v21765 = array_get v1, index u32 447 - enable_side_effects v21765 - v21766 = array_get v2, index u32 447 - v21767 = cast v21766 as u32 - v21768 = array_set v21764, index v21767, value Field 447 - v21770 = not v21765 - v21771 = array_get v21768, index v21767 - v21772 = array_get v21764, index v21767 - v21773 = cast v21765 as Field - v21774 = cast v21770 as Field - v21775 = mul v21773, v21771 - v21776 = mul v21774, v21772 - v21777 = add v21775, v21776 - v21778 = array_set mut v21768, index v21767, value v21777 - enable_side_effects u1 1 - v21779 = array_get v1, index u32 2⁴×28 - enable_side_effects v21779 - v21780 = array_get v2, index u32 2⁴×28 - v21781 = cast v21780 as u32 - v21782 = array_set v21778, index v21781, value Field 2⁴×28 - v21784 = not v21779 - v21785 = array_get v21782, index v21781 - v21786 = array_get v21778, index v21781 - v21787 = cast v21779 as Field - v21788 = cast v21784 as Field - v21789 = mul v21787, v21785 - v21790 = mul v21788, v21786 - v21791 = add v21789, v21790 - v21792 = array_set mut v21782, index v21781, value v21791 - enable_side_effects u1 1 - v21793 = array_get v1, index u32 449 - enable_side_effects v21793 - v21794 = array_get v2, index u32 449 - v21795 = cast v21794 as u32 - v21796 = array_set v21792, index v21795, value Field 449 - v21798 = not v21793 - v21799 = array_get v21796, index v21795 - v21800 = array_get v21792, index v21795 - v21801 = cast v21793 as Field - v21802 = cast v21798 as Field - v21803 = mul v21801, v21799 - v21804 = mul v21802, v21800 - v21805 = add v21803, v21804 - v21806 = array_set mut v21796, index v21795, value v21805 - enable_side_effects u1 1 - v21807 = array_get v1, index u32 450 - enable_side_effects v21807 - v21808 = array_get v2, index u32 450 - v21809 = cast v21808 as u32 - v21810 = array_set v21806, index v21809, value Field 450 - v21812 = not v21807 - v21813 = array_get v21810, index v21809 - v21814 = array_get v21806, index v21809 - v21815 = cast v21807 as Field - v21816 = cast v21812 as Field - v21817 = mul v21815, v21813 - v21818 = mul v21816, v21814 - v21819 = add v21817, v21818 - v21820 = array_set mut v21810, index v21809, value v21819 - enable_side_effects u1 1 - v21821 = array_get v1, index u32 451 - enable_side_effects v21821 - v21822 = array_get v2, index u32 451 - v21823 = cast v21822 as u32 - v21824 = array_set v21820, index v21823, value Field 451 - v21826 = not v21821 - v21827 = array_get v21824, index v21823 - v21828 = array_get v21820, index v21823 - v21829 = cast v21821 as Field - v21830 = cast v21826 as Field - v21831 = mul v21829, v21827 - v21832 = mul v21830, v21828 - v21833 = add v21831, v21832 - v21834 = array_set mut v21824, index v21823, value v21833 - enable_side_effects u1 1 - v21835 = array_get v1, index u32 452 - enable_side_effects v21835 - v21836 = array_get v2, index u32 452 - v21837 = cast v21836 as u32 - v21838 = array_set v21834, index v21837, value Field 452 - v21840 = not v21835 - v21841 = array_get v21838, index v21837 - v21842 = array_get v21834, index v21837 - v21843 = cast v21835 as Field - v21844 = cast v21840 as Field - v21845 = mul v21843, v21841 - v21846 = mul v21844, v21842 - v21847 = add v21845, v21846 - v21848 = array_set mut v21838, index v21837, value v21847 - enable_side_effects u1 1 - v21849 = array_get v1, index u32 453 - enable_side_effects v21849 - v21850 = array_get v2, index u32 453 - v21851 = cast v21850 as u32 - v21852 = array_set v21848, index v21851, value Field 453 - v21854 = not v21849 - v21855 = array_get v21852, index v21851 - v21856 = array_get v21848, index v21851 - v21857 = cast v21849 as Field - v21858 = cast v21854 as Field - v21859 = mul v21857, v21855 - v21860 = mul v21858, v21856 - v21861 = add v21859, v21860 - v21862 = array_set mut v21852, index v21851, value v21861 - enable_side_effects u1 1 - v21863 = array_get v1, index u32 454 - enable_side_effects v21863 - v21864 = array_get v2, index u32 454 - v21865 = cast v21864 as u32 - v21866 = array_set v21862, index v21865, value Field 454 - v21868 = not v21863 - v21869 = array_get v21866, index v21865 - v21870 = array_get v21862, index v21865 - v21871 = cast v21863 as Field - v21872 = cast v21868 as Field - v21873 = mul v21871, v21869 - v21874 = mul v21872, v21870 - v21875 = add v21873, v21874 - v21876 = array_set mut v21866, index v21865, value v21875 - enable_side_effects u1 1 - v21877 = array_get v1, index u32 455 - enable_side_effects v21877 - v21878 = array_get v2, index u32 455 - v21879 = cast v21878 as u32 - v21880 = array_set v21876, index v21879, value Field 455 - v21882 = not v21877 - v21883 = array_get v21880, index v21879 - v21884 = array_get v21876, index v21879 - v21885 = cast v21877 as Field - v21886 = cast v21882 as Field - v21887 = mul v21885, v21883 - v21888 = mul v21886, v21884 - v21889 = add v21887, v21888 - v21890 = array_set mut v21880, index v21879, value v21889 - enable_side_effects u1 1 - v21891 = array_get v1, index u32 456 - enable_side_effects v21891 - v21892 = array_get v2, index u32 456 - v21893 = cast v21892 as u32 - v21894 = array_set v21890, index v21893, value Field 456 - v21896 = not v21891 - v21897 = array_get v21894, index v21893 - v21898 = array_get v21890, index v21893 - v21899 = cast v21891 as Field - v21900 = cast v21896 as Field - v21901 = mul v21899, v21897 - v21902 = mul v21900, v21898 - v21903 = add v21901, v21902 - v21904 = array_set mut v21894, index v21893, value v21903 - enable_side_effects u1 1 - v21905 = array_get v1, index u32 457 - enable_side_effects v21905 - v21906 = array_get v2, index u32 457 - v21907 = cast v21906 as u32 - v21908 = array_set v21904, index v21907, value Field 457 - v21910 = not v21905 - v21911 = array_get v21908, index v21907 - v21912 = array_get v21904, index v21907 - v21913 = cast v21905 as Field - v21914 = cast v21910 as Field - v21915 = mul v21913, v21911 - v21916 = mul v21914, v21912 - v21917 = add v21915, v21916 - v21918 = array_set mut v21908, index v21907, value v21917 - enable_side_effects u1 1 - v21919 = array_get v1, index u32 458 - enable_side_effects v21919 - v21920 = array_get v2, index u32 458 - v21921 = cast v21920 as u32 - v21922 = array_set v21918, index v21921, value Field 458 - v21924 = not v21919 - v21925 = array_get v21922, index v21921 - v21926 = array_get v21918, index v21921 - v21927 = cast v21919 as Field - v21928 = cast v21924 as Field - v21929 = mul v21927, v21925 - v21930 = mul v21928, v21926 - v21931 = add v21929, v21930 - v21932 = array_set mut v21922, index v21921, value v21931 - enable_side_effects u1 1 - v21933 = array_get v1, index u32 459 - enable_side_effects v21933 - v21934 = array_get v2, index u32 459 - v21935 = cast v21934 as u32 - v21936 = array_set v21932, index v21935, value Field 459 - v21938 = not v21933 - v21939 = array_get v21936, index v21935 - v21940 = array_get v21932, index v21935 - v21941 = cast v21933 as Field - v21942 = cast v21938 as Field - v21943 = mul v21941, v21939 - v21944 = mul v21942, v21940 - v21945 = add v21943, v21944 - v21946 = array_set mut v21936, index v21935, value v21945 - enable_side_effects u1 1 - v21947 = array_get v1, index u32 460 - enable_side_effects v21947 - v21948 = array_get v2, index u32 460 - v21949 = cast v21948 as u32 - v21950 = array_set v21946, index v21949, value Field 460 - v21952 = not v21947 - v21953 = array_get v21950, index v21949 - v21954 = array_get v21946, index v21949 - v21955 = cast v21947 as Field - v21956 = cast v21952 as Field - v21957 = mul v21955, v21953 - v21958 = mul v21956, v21954 - v21959 = add v21957, v21958 - v21960 = array_set mut v21950, index v21949, value v21959 - enable_side_effects u1 1 - v21961 = array_get v1, index u32 461 - enable_side_effects v21961 - v21962 = array_get v2, index u32 461 - v21963 = cast v21962 as u32 - v21964 = array_set v21960, index v21963, value Field 461 - v21966 = not v21961 - v21967 = array_get v21964, index v21963 - v21968 = array_get v21960, index v21963 - v21969 = cast v21961 as Field - v21970 = cast v21966 as Field - v21971 = mul v21969, v21967 - v21972 = mul v21970, v21968 - v21973 = add v21971, v21972 - v21974 = array_set mut v21964, index v21963, value v21973 - enable_side_effects u1 1 - v21975 = array_get v1, index u32 462 - enable_side_effects v21975 - v21976 = array_get v2, index u32 462 - v21977 = cast v21976 as u32 - v21978 = array_set v21974, index v21977, value Field 462 - v21980 = not v21975 - v21981 = array_get v21978, index v21977 - v21982 = array_get v21974, index v21977 - v21983 = cast v21975 as Field - v21984 = cast v21980 as Field - v21985 = mul v21983, v21981 - v21986 = mul v21984, v21982 - v21987 = add v21985, v21986 - v21988 = array_set mut v21978, index v21977, value v21987 - enable_side_effects u1 1 - v21989 = array_get v1, index u32 463 - enable_side_effects v21989 - v21990 = array_get v2, index u32 463 - v21991 = cast v21990 as u32 - v21992 = array_set v21988, index v21991, value Field 463 - v21994 = not v21989 - v21995 = array_get v21992, index v21991 - v21996 = array_get v21988, index v21991 - v21997 = cast v21989 as Field - v21998 = cast v21994 as Field - v21999 = mul v21997, v21995 - v22000 = mul v21998, v21996 - v22001 = add v21999, v22000 - v22002 = array_set mut v21992, index v21991, value v22001 - enable_side_effects u1 1 - v22003 = array_get v1, index u32 2⁴×29 - enable_side_effects v22003 - v22004 = array_get v2, index u32 2⁴×29 - v22005 = cast v22004 as u32 - v22006 = array_set v22002, index v22005, value Field 2⁴×29 - v22008 = not v22003 - v22009 = array_get v22006, index v22005 - v22010 = array_get v22002, index v22005 - v22011 = cast v22003 as Field - v22012 = cast v22008 as Field - v22013 = mul v22011, v22009 - v22014 = mul v22012, v22010 - v22015 = add v22013, v22014 - v22016 = array_set mut v22006, index v22005, value v22015 - enable_side_effects u1 1 - v22017 = array_get v1, index u32 465 - enable_side_effects v22017 - v22018 = array_get v2, index u32 465 - v22019 = cast v22018 as u32 - v22020 = array_set v22016, index v22019, value Field 465 - v22022 = not v22017 - v22023 = array_get v22020, index v22019 - v22024 = array_get v22016, index v22019 - v22025 = cast v22017 as Field - v22026 = cast v22022 as Field - v22027 = mul v22025, v22023 - v22028 = mul v22026, v22024 - v22029 = add v22027, v22028 - v22030 = array_set mut v22020, index v22019, value v22029 - enable_side_effects u1 1 - v22031 = array_get v1, index u32 466 - enable_side_effects v22031 - v22032 = array_get v2, index u32 466 - v22033 = cast v22032 as u32 - v22034 = array_set v22030, index v22033, value Field 466 - v22036 = not v22031 - v22037 = array_get v22034, index v22033 - v22038 = array_get v22030, index v22033 - v22039 = cast v22031 as Field - v22040 = cast v22036 as Field - v22041 = mul v22039, v22037 - v22042 = mul v22040, v22038 - v22043 = add v22041, v22042 - v22044 = array_set mut v22034, index v22033, value v22043 - enable_side_effects u1 1 - v22045 = array_get v1, index u32 467 - enable_side_effects v22045 - v22046 = array_get v2, index u32 467 - v22047 = cast v22046 as u32 - v22048 = array_set v22044, index v22047, value Field 467 - v22050 = not v22045 - v22051 = array_get v22048, index v22047 - v22052 = array_get v22044, index v22047 - v22053 = cast v22045 as Field - v22054 = cast v22050 as Field - v22055 = mul v22053, v22051 - v22056 = mul v22054, v22052 - v22057 = add v22055, v22056 - v22058 = array_set mut v22048, index v22047, value v22057 - enable_side_effects u1 1 - v22059 = array_get v1, index u32 468 - enable_side_effects v22059 - v22060 = array_get v2, index u32 468 - v22061 = cast v22060 as u32 - v22062 = array_set v22058, index v22061, value Field 468 - v22064 = not v22059 - v22065 = array_get v22062, index v22061 - v22066 = array_get v22058, index v22061 - v22067 = cast v22059 as Field - v22068 = cast v22064 as Field - v22069 = mul v22067, v22065 - v22070 = mul v22068, v22066 - v22071 = add v22069, v22070 - v22072 = array_set mut v22062, index v22061, value v22071 - enable_side_effects u1 1 - v22073 = array_get v1, index u32 469 - enable_side_effects v22073 - v22074 = array_get v2, index u32 469 - v22075 = cast v22074 as u32 - v22076 = array_set v22072, index v22075, value Field 469 - v22078 = not v22073 - v22079 = array_get v22076, index v22075 - v22080 = array_get v22072, index v22075 - v22081 = cast v22073 as Field - v22082 = cast v22078 as Field - v22083 = mul v22081, v22079 - v22084 = mul v22082, v22080 - v22085 = add v22083, v22084 - v22086 = array_set mut v22076, index v22075, value v22085 - enable_side_effects u1 1 - v22087 = array_get v1, index u32 470 - enable_side_effects v22087 - v22088 = array_get v2, index u32 470 - v22089 = cast v22088 as u32 - v22090 = array_set v22086, index v22089, value Field 470 - v22092 = not v22087 - v22093 = array_get v22090, index v22089 - v22094 = array_get v22086, index v22089 - v22095 = cast v22087 as Field - v22096 = cast v22092 as Field - v22097 = mul v22095, v22093 - v22098 = mul v22096, v22094 - v22099 = add v22097, v22098 - v22100 = array_set mut v22090, index v22089, value v22099 - enable_side_effects u1 1 - v22101 = array_get v1, index u32 471 - enable_side_effects v22101 - v22102 = array_get v2, index u32 471 - v22103 = cast v22102 as u32 - v22104 = array_set v22100, index v22103, value Field 471 - v22106 = not v22101 - v22107 = array_get v22104, index v22103 - v22108 = array_get v22100, index v22103 - v22109 = cast v22101 as Field - v22110 = cast v22106 as Field - v22111 = mul v22109, v22107 - v22112 = mul v22110, v22108 - v22113 = add v22111, v22112 - v22114 = array_set mut v22104, index v22103, value v22113 - enable_side_effects u1 1 - v22115 = array_get v1, index u32 472 - enable_side_effects v22115 - v22116 = array_get v2, index u32 472 - v22117 = cast v22116 as u32 - v22118 = array_set v22114, index v22117, value Field 472 - v22120 = not v22115 - v22121 = array_get v22118, index v22117 - v22122 = array_get v22114, index v22117 - v22123 = cast v22115 as Field - v22124 = cast v22120 as Field - v22125 = mul v22123, v22121 - v22126 = mul v22124, v22122 - v22127 = add v22125, v22126 - v22128 = array_set mut v22118, index v22117, value v22127 - enable_side_effects u1 1 - v22129 = array_get v1, index u32 473 - enable_side_effects v22129 - v22130 = array_get v2, index u32 473 - v22131 = cast v22130 as u32 - v22132 = array_set v22128, index v22131, value Field 473 - v22134 = not v22129 - v22135 = array_get v22132, index v22131 - v22136 = array_get v22128, index v22131 - v22137 = cast v22129 as Field - v22138 = cast v22134 as Field - v22139 = mul v22137, v22135 - v22140 = mul v22138, v22136 - v22141 = add v22139, v22140 - v22142 = array_set mut v22132, index v22131, value v22141 - enable_side_effects u1 1 - v22143 = array_get v1, index u32 474 - enable_side_effects v22143 - v22144 = array_get v2, index u32 474 - v22145 = cast v22144 as u32 - v22146 = array_set v22142, index v22145, value Field 474 - v22148 = not v22143 - v22149 = array_get v22146, index v22145 - v22150 = array_get v22142, index v22145 - v22151 = cast v22143 as Field - v22152 = cast v22148 as Field - v22153 = mul v22151, v22149 - v22154 = mul v22152, v22150 - v22155 = add v22153, v22154 - v22156 = array_set mut v22146, index v22145, value v22155 - enable_side_effects u1 1 - v22157 = array_get v1, index u32 475 - enable_side_effects v22157 - v22158 = array_get v2, index u32 475 - v22159 = cast v22158 as u32 - v22160 = array_set v22156, index v22159, value Field 475 - v22162 = not v22157 - v22163 = array_get v22160, index v22159 - v22164 = array_get v22156, index v22159 - v22165 = cast v22157 as Field - v22166 = cast v22162 as Field - v22167 = mul v22165, v22163 - v22168 = mul v22166, v22164 - v22169 = add v22167, v22168 - v22170 = array_set mut v22160, index v22159, value v22169 - enable_side_effects u1 1 - v22171 = array_get v1, index u32 476 - enable_side_effects v22171 - v22172 = array_get v2, index u32 476 - v22173 = cast v22172 as u32 - v22174 = array_set v22170, index v22173, value Field 476 - v22176 = not v22171 - v22177 = array_get v22174, index v22173 - v22178 = array_get v22170, index v22173 - v22179 = cast v22171 as Field - v22180 = cast v22176 as Field - v22181 = mul v22179, v22177 - v22182 = mul v22180, v22178 - v22183 = add v22181, v22182 - v22184 = array_set mut v22174, index v22173, value v22183 - enable_side_effects u1 1 - v22185 = array_get v1, index u32 477 - enable_side_effects v22185 - v22186 = array_get v2, index u32 477 - v22187 = cast v22186 as u32 - v22188 = array_set v22184, index v22187, value Field 477 - v22190 = not v22185 - v22191 = array_get v22188, index v22187 - v22192 = array_get v22184, index v22187 - v22193 = cast v22185 as Field - v22194 = cast v22190 as Field - v22195 = mul v22193, v22191 - v22196 = mul v22194, v22192 - v22197 = add v22195, v22196 - v22198 = array_set mut v22188, index v22187, value v22197 - enable_side_effects u1 1 - v22199 = array_get v1, index u32 478 - enable_side_effects v22199 - v22200 = array_get v2, index u32 478 - v22201 = cast v22200 as u32 - v22202 = array_set v22198, index v22201, value Field 478 - v22204 = not v22199 - v22205 = array_get v22202, index v22201 - v22206 = array_get v22198, index v22201 - v22207 = cast v22199 as Field - v22208 = cast v22204 as Field - v22209 = mul v22207, v22205 - v22210 = mul v22208, v22206 - v22211 = add v22209, v22210 - v22212 = array_set mut v22202, index v22201, value v22211 - enable_side_effects u1 1 - v22213 = array_get v1, index u32 479 - enable_side_effects v22213 - v22214 = array_get v2, index u32 479 - v22215 = cast v22214 as u32 - v22216 = array_set v22212, index v22215, value Field 479 - v22218 = not v22213 - v22219 = array_get v22216, index v22215 - v22220 = array_get v22212, index v22215 - v22221 = cast v22213 as Field - v22222 = cast v22218 as Field - v22223 = mul v22221, v22219 - v22224 = mul v22222, v22220 - v22225 = add v22223, v22224 - v22226 = array_set mut v22216, index v22215, value v22225 - enable_side_effects u1 1 - v22227 = array_get v1, index u32 2⁴×30 - enable_side_effects v22227 - v22228 = array_get v2, index u32 2⁴×30 - v22229 = cast v22228 as u32 - v22230 = array_set v22226, index v22229, value Field 2⁴×30 - v22232 = not v22227 - v22233 = array_get v22230, index v22229 - v22234 = array_get v22226, index v22229 - v22235 = cast v22227 as Field - v22236 = cast v22232 as Field - v22237 = mul v22235, v22233 - v22238 = mul v22236, v22234 - v22239 = add v22237, v22238 - v22240 = array_set mut v22230, index v22229, value v22239 - enable_side_effects u1 1 - v22241 = array_get v1, index u32 481 - enable_side_effects v22241 - v22242 = array_get v2, index u32 481 - v22243 = cast v22242 as u32 - v22244 = array_set v22240, index v22243, value Field 481 - v22246 = not v22241 - v22247 = array_get v22244, index v22243 - v22248 = array_get v22240, index v22243 - v22249 = cast v22241 as Field - v22250 = cast v22246 as Field - v22251 = mul v22249, v22247 - v22252 = mul v22250, v22248 - v22253 = add v22251, v22252 - v22254 = array_set mut v22244, index v22243, value v22253 - enable_side_effects u1 1 - v22255 = array_get v1, index u32 482 - enable_side_effects v22255 - v22256 = array_get v2, index u32 482 - v22257 = cast v22256 as u32 - v22258 = array_set v22254, index v22257, value Field 482 - v22260 = not v22255 - v22261 = array_get v22258, index v22257 - v22262 = array_get v22254, index v22257 - v22263 = cast v22255 as Field - v22264 = cast v22260 as Field - v22265 = mul v22263, v22261 - v22266 = mul v22264, v22262 - v22267 = add v22265, v22266 - v22268 = array_set mut v22258, index v22257, value v22267 - enable_side_effects u1 1 - v22269 = array_get v1, index u32 483 - enable_side_effects v22269 - v22270 = array_get v2, index u32 483 - v22271 = cast v22270 as u32 - v22272 = array_set v22268, index v22271, value Field 483 - v22274 = not v22269 - v22275 = array_get v22272, index v22271 - v22276 = array_get v22268, index v22271 - v22277 = cast v22269 as Field - v22278 = cast v22274 as Field - v22279 = mul v22277, v22275 - v22280 = mul v22278, v22276 - v22281 = add v22279, v22280 - v22282 = array_set mut v22272, index v22271, value v22281 - enable_side_effects u1 1 - v22283 = array_get v1, index u32 484 - enable_side_effects v22283 - v22284 = array_get v2, index u32 484 - v22285 = cast v22284 as u32 - v22286 = array_set v22282, index v22285, value Field 484 - v22288 = not v22283 - v22289 = array_get v22286, index v22285 - v22290 = array_get v22282, index v22285 - v22291 = cast v22283 as Field - v22292 = cast v22288 as Field - v22293 = mul v22291, v22289 - v22294 = mul v22292, v22290 - v22295 = add v22293, v22294 - v22296 = array_set mut v22286, index v22285, value v22295 - enable_side_effects u1 1 - v22297 = array_get v1, index u32 485 - enable_side_effects v22297 - v22298 = array_get v2, index u32 485 - v22299 = cast v22298 as u32 - v22300 = array_set v22296, index v22299, value Field 485 - v22302 = not v22297 - v22303 = array_get v22300, index v22299 - v22304 = array_get v22296, index v22299 - v22305 = cast v22297 as Field - v22306 = cast v22302 as Field - v22307 = mul v22305, v22303 - v22308 = mul v22306, v22304 - v22309 = add v22307, v22308 - v22310 = array_set mut v22300, index v22299, value v22309 - enable_side_effects u1 1 - v22311 = array_get v1, index u32 486 - enable_side_effects v22311 - v22312 = array_get v2, index u32 486 - v22313 = cast v22312 as u32 - v22314 = array_set v22310, index v22313, value Field 486 - v22316 = not v22311 - v22317 = array_get v22314, index v22313 - v22318 = array_get v22310, index v22313 - v22319 = cast v22311 as Field - v22320 = cast v22316 as Field - v22321 = mul v22319, v22317 - v22322 = mul v22320, v22318 - v22323 = add v22321, v22322 - v22324 = array_set mut v22314, index v22313, value v22323 - enable_side_effects u1 1 - v22325 = array_get v1, index u32 487 - enable_side_effects v22325 - v22326 = array_get v2, index u32 487 - v22327 = cast v22326 as u32 - v22328 = array_set v22324, index v22327, value Field 487 - v22330 = not v22325 - v22331 = array_get v22328, index v22327 - v22332 = array_get v22324, index v22327 - v22333 = cast v22325 as Field - v22334 = cast v22330 as Field - v22335 = mul v22333, v22331 - v22336 = mul v22334, v22332 - v22337 = add v22335, v22336 - v22338 = array_set mut v22328, index v22327, value v22337 - enable_side_effects u1 1 - v22339 = array_get v1, index u32 488 - enable_side_effects v22339 - v22340 = array_get v2, index u32 488 - v22341 = cast v22340 as u32 - v22342 = array_set v22338, index v22341, value Field 488 - v22344 = not v22339 - v22345 = array_get v22342, index v22341 - v22346 = array_get v22338, index v22341 - v22347 = cast v22339 as Field - v22348 = cast v22344 as Field - v22349 = mul v22347, v22345 - v22350 = mul v22348, v22346 - v22351 = add v22349, v22350 - v22352 = array_set mut v22342, index v22341, value v22351 - enable_side_effects u1 1 - v22353 = array_get v1, index u32 489 - enable_side_effects v22353 - v22354 = array_get v2, index u32 489 - v22355 = cast v22354 as u32 - v22356 = array_set v22352, index v22355, value Field 489 - v22358 = not v22353 - v22359 = array_get v22356, index v22355 - v22360 = array_get v22352, index v22355 - v22361 = cast v22353 as Field - v22362 = cast v22358 as Field - v22363 = mul v22361, v22359 - v22364 = mul v22362, v22360 - v22365 = add v22363, v22364 - v22366 = array_set mut v22356, index v22355, value v22365 - enable_side_effects u1 1 - v22367 = array_get v1, index u32 490 - enable_side_effects v22367 - v22368 = array_get v2, index u32 490 - v22369 = cast v22368 as u32 - v22370 = array_set v22366, index v22369, value Field 490 - v22372 = not v22367 - v22373 = array_get v22370, index v22369 - v22374 = array_get v22366, index v22369 - v22375 = cast v22367 as Field - v22376 = cast v22372 as Field - v22377 = mul v22375, v22373 - v22378 = mul v22376, v22374 - v22379 = add v22377, v22378 - v22380 = array_set mut v22370, index v22369, value v22379 - enable_side_effects u1 1 - v22381 = array_get v1, index u32 491 - enable_side_effects v22381 - v22382 = array_get v2, index u32 491 - v22383 = cast v22382 as u32 - v22384 = array_set v22380, index v22383, value Field 491 - v22386 = not v22381 - v22387 = array_get v22384, index v22383 - v22388 = array_get v22380, index v22383 - v22389 = cast v22381 as Field - v22390 = cast v22386 as Field - v22391 = mul v22389, v22387 - v22392 = mul v22390, v22388 - v22393 = add v22391, v22392 - v22394 = array_set mut v22384, index v22383, value v22393 - enable_side_effects u1 1 - v22395 = array_get v1, index u32 492 - enable_side_effects v22395 - v22396 = array_get v2, index u32 492 - v22397 = cast v22396 as u32 - v22398 = array_set v22394, index v22397, value Field 492 - v22400 = not v22395 - v22401 = array_get v22398, index v22397 - v22402 = array_get v22394, index v22397 - v22403 = cast v22395 as Field - v22404 = cast v22400 as Field - v22405 = mul v22403, v22401 - v22406 = mul v22404, v22402 - v22407 = add v22405, v22406 - v22408 = array_set mut v22398, index v22397, value v22407 - enable_side_effects u1 1 - v22409 = array_get v1, index u32 493 - enable_side_effects v22409 - v22410 = array_get v2, index u32 493 - v22411 = cast v22410 as u32 - v22412 = array_set v22408, index v22411, value Field 493 - v22414 = not v22409 - v22415 = array_get v22412, index v22411 - v22416 = array_get v22408, index v22411 - v22417 = cast v22409 as Field - v22418 = cast v22414 as Field - v22419 = mul v22417, v22415 - v22420 = mul v22418, v22416 - v22421 = add v22419, v22420 - v22422 = array_set mut v22412, index v22411, value v22421 - enable_side_effects u1 1 - v22423 = array_get v1, index u32 494 - enable_side_effects v22423 - v22424 = array_get v2, index u32 494 - v22425 = cast v22424 as u32 - v22426 = array_set v22422, index v22425, value Field 494 - v22428 = not v22423 - v22429 = array_get v22426, index v22425 - v22430 = array_get v22422, index v22425 - v22431 = cast v22423 as Field - v22432 = cast v22428 as Field - v22433 = mul v22431, v22429 - v22434 = mul v22432, v22430 - v22435 = add v22433, v22434 - v22436 = array_set mut v22426, index v22425, value v22435 - enable_side_effects u1 1 - v22437 = array_get v1, index u32 495 - enable_side_effects v22437 - v22438 = array_get v2, index u32 495 - v22439 = cast v22438 as u32 - v22440 = array_set v22436, index v22439, value Field 495 - v22442 = not v22437 - v22443 = array_get v22440, index v22439 - v22444 = array_get v22436, index v22439 - v22445 = cast v22437 as Field - v22446 = cast v22442 as Field - v22447 = mul v22445, v22443 - v22448 = mul v22446, v22444 - v22449 = add v22447, v22448 - v22450 = array_set mut v22440, index v22439, value v22449 - enable_side_effects u1 1 - v22451 = array_get v1, index u32 2⁴×31 - enable_side_effects v22451 - v22452 = array_get v2, index u32 2⁴×31 - v22453 = cast v22452 as u32 - v22454 = array_set v22450, index v22453, value Field 2⁴×31 - v22456 = not v22451 - v22457 = array_get v22454, index v22453 - v22458 = array_get v22450, index v22453 - v22459 = cast v22451 as Field - v22460 = cast v22456 as Field - v22461 = mul v22459, v22457 - v22462 = mul v22460, v22458 - v22463 = add v22461, v22462 - v22464 = array_set mut v22454, index v22453, value v22463 - enable_side_effects u1 1 - v22465 = array_get v1, index u32 497 - enable_side_effects v22465 - v22466 = array_get v2, index u32 497 - v22467 = cast v22466 as u32 - v22468 = array_set v22464, index v22467, value Field 497 - v22470 = not v22465 - v22471 = array_get v22468, index v22467 - v22472 = array_get v22464, index v22467 - v22473 = cast v22465 as Field - v22474 = cast v22470 as Field - v22475 = mul v22473, v22471 - v22476 = mul v22474, v22472 - v22477 = add v22475, v22476 - v22478 = array_set mut v22468, index v22467, value v22477 - enable_side_effects u1 1 - v22479 = array_get v1, index u32 498 - enable_side_effects v22479 - v22480 = array_get v2, index u32 498 - v22481 = cast v22480 as u32 - v22482 = array_set v22478, index v22481, value Field 498 - v22484 = not v22479 - v22485 = array_get v22482, index v22481 - v22486 = array_get v22478, index v22481 - v22487 = cast v22479 as Field - v22488 = cast v22484 as Field - v22489 = mul v22487, v22485 - v22490 = mul v22488, v22486 - v22491 = add v22489, v22490 - v22492 = array_set mut v22482, index v22481, value v22491 - enable_side_effects u1 1 - v22493 = array_get v1, index u32 499 - enable_side_effects v22493 - v22494 = array_get v2, index u32 499 - v22495 = cast v22494 as u32 - v22496 = array_set v22492, index v22495, value Field 499 - v22498 = not v22493 - v22499 = array_get v22496, index v22495 - v22500 = array_get v22492, index v22495 - v22501 = cast v22493 as Field - v22502 = cast v22498 as Field - v22503 = mul v22501, v22499 - v22504 = mul v22502, v22500 - v22505 = add v22503, v22504 - v22506 = array_set mut v22496, index v22495, value v22505 - enable_side_effects u1 1 - dec_rc v0 - return v22506 -} - -[regression_5027] Circuit witness successfully solved -[regression_5027] Circuit output: Vec([Field(498), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0)]) diff --git a/test_programs/execution_success/regression_5027/ssa_master b/test_programs/execution_success/regression_5027/ssa_master deleted file mode 100644 index 59d05155b01..00000000000 --- a/test_programs/execution_success/regression_5027/ssa_master +++ /dev/null @@ -1,7510 +0,0 @@ -After Array Set Optimizations: -acir(inline) fn main f0 { - b0(v0: [Field; 500], v1: [u1; 500], v2: [u64; 500]): - inc_rc v0 - v15507 = array_get v1, index u32 0 - enable_side_effects v15507 - v15508 = array_get v2, index u32 0 - v15509 = cast v15508 as u32 - v15510 = array_set v0, index v15509, value Field 0 - v15512 = not v15507 - v15513 = array_get v15510, index v15509 - v15514 = array_get v0, index v15509 - v15515 = cast v15507 as Field - v15516 = cast v15512 as Field - v15517 = mul v15515, v15513 - v15518 = mul v15516, v15514 - v15519 = add v15517, v15518 - v15520 = array_set mut v15510, index v15509, value v15519 - enable_side_effects u1 1 - v15521 = array_get v1, index u32 1 - enable_side_effects v15521 - v15522 = array_get v2, index u32 1 - v15523 = cast v15522 as u32 - v15524 = array_set v15520, index v15523, value Field 1 - v15526 = not v15521 - v15527 = array_get v15524, index v15523 - v15528 = array_get v15520, index v15523 - v15529 = cast v15521 as Field - v15530 = cast v15526 as Field - v15531 = mul v15529, v15527 - v15532 = mul v15530, v15528 - v15533 = add v15531, v15532 - v15534 = array_set mut v15524, index v15523, value v15533 - enable_side_effects u1 1 - v15535 = array_get v1, index u32 2 - enable_side_effects v15535 - v15536 = array_get v2, index u32 2 - v15537 = cast v15536 as u32 - v15538 = array_set v15534, index v15537, value Field 2 - v15540 = not v15535 - v15541 = array_get v15538, index v15537 - v15542 = array_get v15534, index v15537 - v15543 = cast v15535 as Field - v15544 = cast v15540 as Field - v15545 = mul v15543, v15541 - v15546 = mul v15544, v15542 - v15547 = add v15545, v15546 - v15548 = array_set mut v15538, index v15537, value v15547 - enable_side_effects u1 1 - v15549 = array_get v1, index u32 3 - enable_side_effects v15549 - v15550 = array_get v2, index u32 3 - v15551 = cast v15550 as u32 - v15552 = array_set v15548, index v15551, value Field 3 - v15554 = not v15549 - v15555 = array_get v15552, index v15551 - v15556 = array_get v15548, index v15551 - v15557 = cast v15549 as Field - v15558 = cast v15554 as Field - v15559 = mul v15557, v15555 - v15560 = mul v15558, v15556 - v15561 = add v15559, v15560 - v15562 = array_set mut v15552, index v15551, value v15561 - enable_side_effects u1 1 - v15563 = array_get v1, index u32 4 - enable_side_effects v15563 - v15564 = array_get v2, index u32 4 - v15565 = cast v15564 as u32 - v15566 = array_set v15562, index v15565, value Field 4 - v15568 = not v15563 - v15569 = array_get v15566, index v15565 - v15570 = array_get v15562, index v15565 - v15571 = cast v15563 as Field - v15572 = cast v15568 as Field - v15573 = mul v15571, v15569 - v15574 = mul v15572, v15570 - v15575 = add v15573, v15574 - v15576 = array_set mut v15566, index v15565, value v15575 - enable_side_effects u1 1 - v15577 = array_get v1, index u32 5 - enable_side_effects v15577 - v15578 = array_get v2, index u32 5 - v15579 = cast v15578 as u32 - v15580 = array_set v15576, index v15579, value Field 5 - v15582 = not v15577 - v15583 = array_get v15580, index v15579 - v15584 = array_get v15576, index v15579 - v15585 = cast v15577 as Field - v15586 = cast v15582 as Field - v15587 = mul v15585, v15583 - v15588 = mul v15586, v15584 - v15589 = add v15587, v15588 - v15590 = array_set mut v15580, index v15579, value v15589 - enable_side_effects u1 1 - v15591 = array_get v1, index u32 6 - enable_side_effects v15591 - v15592 = array_get v2, index u32 6 - v15593 = cast v15592 as u32 - v15594 = array_set v15590, index v15593, value Field 6 - v15596 = not v15591 - v15597 = array_get v15594, index v15593 - v15598 = array_get v15590, index v15593 - v15599 = cast v15591 as Field - v15600 = cast v15596 as Field - v15601 = mul v15599, v15597 - v15602 = mul v15600, v15598 - v15603 = add v15601, v15602 - v15604 = array_set mut v15594, index v15593, value v15603 - enable_side_effects u1 1 - v15605 = array_get v1, index u32 7 - enable_side_effects v15605 - v15606 = array_get v2, index u32 7 - v15607 = cast v15606 as u32 - v15608 = array_set v15604, index v15607, value Field 7 - v15610 = not v15605 - v15611 = array_get v15608, index v15607 - v15612 = array_get v15604, index v15607 - v15613 = cast v15605 as Field - v15614 = cast v15610 as Field - v15615 = mul v15613, v15611 - v15616 = mul v15614, v15612 - v15617 = add v15615, v15616 - v15618 = array_set mut v15608, index v15607, value v15617 - enable_side_effects u1 1 - v15619 = array_get v1, index u32 8 - enable_side_effects v15619 - v15620 = array_get v2, index u32 8 - v15621 = cast v15620 as u32 - v15622 = array_set v15618, index v15621, value Field 8 - v15624 = not v15619 - v15625 = array_get v15622, index v15621 - v15626 = array_get v15618, index v15621 - v15627 = cast v15619 as Field - v15628 = cast v15624 as Field - v15629 = mul v15627, v15625 - v15630 = mul v15628, v15626 - v15631 = add v15629, v15630 - v15632 = array_set mut v15622, index v15621, value v15631 - enable_side_effects u1 1 - v15633 = array_get v1, index u32 9 - enable_side_effects v15633 - v15634 = array_get v2, index u32 9 - v15635 = cast v15634 as u32 - v15636 = array_set v15632, index v15635, value Field 9 - v15638 = not v15633 - v15639 = array_get v15636, index v15635 - v15640 = array_get v15632, index v15635 - v15641 = cast v15633 as Field - v15642 = cast v15638 as Field - v15643 = mul v15641, v15639 - v15644 = mul v15642, v15640 - v15645 = add v15643, v15644 - v15646 = array_set mut v15636, index v15635, value v15645 - enable_side_effects u1 1 - v15647 = array_get v1, index u32 10 - enable_side_effects v15647 - v15648 = array_get v2, index u32 10 - v15649 = cast v15648 as u32 - v15650 = array_set v15646, index v15649, value Field 10 - v15652 = not v15647 - v15653 = array_get v15650, index v15649 - v15654 = array_get v15646, index v15649 - v15655 = cast v15647 as Field - v15656 = cast v15652 as Field - v15657 = mul v15655, v15653 - v15658 = mul v15656, v15654 - v15659 = add v15657, v15658 - v15660 = array_set mut v15650, index v15649, value v15659 - enable_side_effects u1 1 - v15661 = array_get v1, index u32 11 - enable_side_effects v15661 - v15662 = array_get v2, index u32 11 - v15663 = cast v15662 as u32 - v15664 = array_set v15660, index v15663, value Field 11 - v15666 = not v15661 - v15667 = array_get v15664, index v15663 - v15668 = array_get v15660, index v15663 - v15669 = cast v15661 as Field - v15670 = cast v15666 as Field - v15671 = mul v15669, v15667 - v15672 = mul v15670, v15668 - v15673 = add v15671, v15672 - v15674 = array_set mut v15664, index v15663, value v15673 - enable_side_effects u1 1 - v15675 = array_get v1, index u32 12 - enable_side_effects v15675 - v15676 = array_get v2, index u32 12 - v15677 = cast v15676 as u32 - v15678 = array_set v15674, index v15677, value Field 12 - v15680 = not v15675 - v15681 = array_get v15678, index v15677 - v15682 = array_get v15674, index v15677 - v15683 = cast v15675 as Field - v15684 = cast v15680 as Field - v15685 = mul v15683, v15681 - v15686 = mul v15684, v15682 - v15687 = add v15685, v15686 - v15688 = array_set mut v15678, index v15677, value v15687 - enable_side_effects u1 1 - v15689 = array_get v1, index u32 13 - enable_side_effects v15689 - v15690 = array_get v2, index u32 13 - v15691 = cast v15690 as u32 - v15692 = array_set v15688, index v15691, value Field 13 - v15694 = not v15689 - v15695 = array_get v15692, index v15691 - v15696 = array_get v15688, index v15691 - v15697 = cast v15689 as Field - v15698 = cast v15694 as Field - v15699 = mul v15697, v15695 - v15700 = mul v15698, v15696 - v15701 = add v15699, v15700 - v15702 = array_set mut v15692, index v15691, value v15701 - enable_side_effects u1 1 - v15703 = array_get v1, index u32 14 - enable_side_effects v15703 - v15704 = array_get v2, index u32 14 - v15705 = cast v15704 as u32 - v15706 = array_set v15702, index v15705, value Field 14 - v15708 = not v15703 - v15709 = array_get v15706, index v15705 - v15710 = array_get v15702, index v15705 - v15711 = cast v15703 as Field - v15712 = cast v15708 as Field - v15713 = mul v15711, v15709 - v15714 = mul v15712, v15710 - v15715 = add v15713, v15714 - v15716 = array_set mut v15706, index v15705, value v15715 - enable_side_effects u1 1 - v15717 = array_get v1, index u32 15 - enable_side_effects v15717 - v15718 = array_get v2, index u32 15 - v15719 = cast v15718 as u32 - v15720 = array_set v15716, index v15719, value Field 15 - v15722 = not v15717 - v15723 = array_get v15720, index v15719 - v15724 = array_get v15716, index v15719 - v15725 = cast v15717 as Field - v15726 = cast v15722 as Field - v15727 = mul v15725, v15723 - v15728 = mul v15726, v15724 - v15729 = add v15727, v15728 - v15730 = array_set mut v15720, index v15719, value v15729 - enable_side_effects u1 1 - v15731 = array_get v1, index u32 2⁴ - enable_side_effects v15731 - v15732 = array_get v2, index u32 2⁴ - v15733 = cast v15732 as u32 - v15734 = array_set v15730, index v15733, value Field 2⁴ - v15736 = not v15731 - v15737 = array_get v15734, index v15733 - v15738 = array_get v15730, index v15733 - v15739 = cast v15731 as Field - v15740 = cast v15736 as Field - v15741 = mul v15739, v15737 - v15742 = mul v15740, v15738 - v15743 = add v15741, v15742 - v15744 = array_set mut v15734, index v15733, value v15743 - enable_side_effects u1 1 - v15745 = array_get v1, index u32 17 - enable_side_effects v15745 - v15746 = array_get v2, index u32 17 - v15747 = cast v15746 as u32 - v15748 = array_set v15744, index v15747, value Field 17 - v15750 = not v15745 - v15751 = array_get v15748, index v15747 - v15752 = array_get v15744, index v15747 - v15753 = cast v15745 as Field - v15754 = cast v15750 as Field - v15755 = mul v15753, v15751 - v15756 = mul v15754, v15752 - v15757 = add v15755, v15756 - v15758 = array_set mut v15748, index v15747, value v15757 - enable_side_effects u1 1 - v15759 = array_get v1, index u32 18 - enable_side_effects v15759 - v15760 = array_get v2, index u32 18 - v15761 = cast v15760 as u32 - v15762 = array_set v15758, index v15761, value Field 18 - v15764 = not v15759 - v15765 = array_get v15762, index v15761 - v15766 = array_get v15758, index v15761 - v15767 = cast v15759 as Field - v15768 = cast v15764 as Field - v15769 = mul v15767, v15765 - v15770 = mul v15768, v15766 - v15771 = add v15769, v15770 - v15772 = array_set mut v15762, index v15761, value v15771 - enable_side_effects u1 1 - v15773 = array_get v1, index u32 19 - enable_side_effects v15773 - v15774 = array_get v2, index u32 19 - v15775 = cast v15774 as u32 - v15776 = array_set v15772, index v15775, value Field 19 - v15778 = not v15773 - v15779 = array_get v15776, index v15775 - v15780 = array_get v15772, index v15775 - v15781 = cast v15773 as Field - v15782 = cast v15778 as Field - v15783 = mul v15781, v15779 - v15784 = mul v15782, v15780 - v15785 = add v15783, v15784 - v15786 = array_set mut v15776, index v15775, value v15785 - enable_side_effects u1 1 - v15787 = array_get v1, index u32 20 - enable_side_effects v15787 - v15788 = array_get v2, index u32 20 - v15789 = cast v15788 as u32 - v15790 = array_set v15786, index v15789, value Field 20 - v15792 = not v15787 - v15793 = array_get v15790, index v15789 - v15794 = array_get v15786, index v15789 - v15795 = cast v15787 as Field - v15796 = cast v15792 as Field - v15797 = mul v15795, v15793 - v15798 = mul v15796, v15794 - v15799 = add v15797, v15798 - v15800 = array_set mut v15790, index v15789, value v15799 - enable_side_effects u1 1 - v15801 = array_get v1, index u32 21 - enable_side_effects v15801 - v15802 = array_get v2, index u32 21 - v15803 = cast v15802 as u32 - v15804 = array_set v15800, index v15803, value Field 21 - v15806 = not v15801 - v15807 = array_get v15804, index v15803 - v15808 = array_get v15800, index v15803 - v15809 = cast v15801 as Field - v15810 = cast v15806 as Field - v15811 = mul v15809, v15807 - v15812 = mul v15810, v15808 - v15813 = add v15811, v15812 - v15814 = array_set mut v15804, index v15803, value v15813 - enable_side_effects u1 1 - v15815 = array_get v1, index u32 22 - enable_side_effects v15815 - v15816 = array_get v2, index u32 22 - v15817 = cast v15816 as u32 - v15818 = array_set v15814, index v15817, value Field 22 - v15820 = not v15815 - v15821 = array_get v15818, index v15817 - v15822 = array_get v15814, index v15817 - v15823 = cast v15815 as Field - v15824 = cast v15820 as Field - v15825 = mul v15823, v15821 - v15826 = mul v15824, v15822 - v15827 = add v15825, v15826 - v15828 = array_set mut v15818, index v15817, value v15827 - enable_side_effects u1 1 - v15829 = array_get v1, index u32 23 - enable_side_effects v15829 - v15830 = array_get v2, index u32 23 - v15831 = cast v15830 as u32 - v15832 = array_set v15828, index v15831, value Field 23 - v15834 = not v15829 - v15835 = array_get v15832, index v15831 - v15836 = array_get v15828, index v15831 - v15837 = cast v15829 as Field - v15838 = cast v15834 as Field - v15839 = mul v15837, v15835 - v15840 = mul v15838, v15836 - v15841 = add v15839, v15840 - v15842 = array_set mut v15832, index v15831, value v15841 - enable_side_effects u1 1 - v15843 = array_get v1, index u32 24 - enable_side_effects v15843 - v15844 = array_get v2, index u32 24 - v15845 = cast v15844 as u32 - v15846 = array_set v15842, index v15845, value Field 24 - v15848 = not v15843 - v15849 = array_get v15846, index v15845 - v15850 = array_get v15842, index v15845 - v15851 = cast v15843 as Field - v15852 = cast v15848 as Field - v15853 = mul v15851, v15849 - v15854 = mul v15852, v15850 - v15855 = add v15853, v15854 - v15856 = array_set mut v15846, index v15845, value v15855 - enable_side_effects u1 1 - v15857 = array_get v1, index u32 25 - enable_side_effects v15857 - v15858 = array_get v2, index u32 25 - v15859 = cast v15858 as u32 - v15860 = array_set v15856, index v15859, value Field 25 - v15862 = not v15857 - v15863 = array_get v15860, index v15859 - v15864 = array_get v15856, index v15859 - v15865 = cast v15857 as Field - v15866 = cast v15862 as Field - v15867 = mul v15865, v15863 - v15868 = mul v15866, v15864 - v15869 = add v15867, v15868 - v15870 = array_set mut v15860, index v15859, value v15869 - enable_side_effects u1 1 - v15871 = array_get v1, index u32 26 - enable_side_effects v15871 - v15872 = array_get v2, index u32 26 - v15873 = cast v15872 as u32 - v15874 = array_set v15870, index v15873, value Field 26 - v15876 = not v15871 - v15877 = array_get v15874, index v15873 - v15878 = array_get v15870, index v15873 - v15879 = cast v15871 as Field - v15880 = cast v15876 as Field - v15881 = mul v15879, v15877 - v15882 = mul v15880, v15878 - v15883 = add v15881, v15882 - v15884 = array_set mut v15874, index v15873, value v15883 - enable_side_effects u1 1 - v15885 = array_get v1, index u32 27 - enable_side_effects v15885 - v15886 = array_get v2, index u32 27 - v15887 = cast v15886 as u32 - v15888 = array_set v15884, index v15887, value Field 27 - v15890 = not v15885 - v15891 = array_get v15888, index v15887 - v15892 = array_get v15884, index v15887 - v15893 = cast v15885 as Field - v15894 = cast v15890 as Field - v15895 = mul v15893, v15891 - v15896 = mul v15894, v15892 - v15897 = add v15895, v15896 - v15898 = array_set mut v15888, index v15887, value v15897 - enable_side_effects u1 1 - v15899 = array_get v1, index u32 28 - enable_side_effects v15899 - v15900 = array_get v2, index u32 28 - v15901 = cast v15900 as u32 - v15902 = array_set v15898, index v15901, value Field 28 - v15904 = not v15899 - v15905 = array_get v15902, index v15901 - v15906 = array_get v15898, index v15901 - v15907 = cast v15899 as Field - v15908 = cast v15904 as Field - v15909 = mul v15907, v15905 - v15910 = mul v15908, v15906 - v15911 = add v15909, v15910 - v15912 = array_set mut v15902, index v15901, value v15911 - enable_side_effects u1 1 - v15913 = array_get v1, index u32 29 - enable_side_effects v15913 - v15914 = array_get v2, index u32 29 - v15915 = cast v15914 as u32 - v15916 = array_set v15912, index v15915, value Field 29 - v15918 = not v15913 - v15919 = array_get v15916, index v15915 - v15920 = array_get v15912, index v15915 - v15921 = cast v15913 as Field - v15922 = cast v15918 as Field - v15923 = mul v15921, v15919 - v15924 = mul v15922, v15920 - v15925 = add v15923, v15924 - v15926 = array_set mut v15916, index v15915, value v15925 - enable_side_effects u1 1 - v15927 = array_get v1, index u32 30 - enable_side_effects v15927 - v15928 = array_get v2, index u32 30 - v15929 = cast v15928 as u32 - v15930 = array_set v15926, index v15929, value Field 30 - v15932 = not v15927 - v15933 = array_get v15930, index v15929 - v15934 = array_get v15926, index v15929 - v15935 = cast v15927 as Field - v15936 = cast v15932 as Field - v15937 = mul v15935, v15933 - v15938 = mul v15936, v15934 - v15939 = add v15937, v15938 - v15940 = array_set mut v15930, index v15929, value v15939 - enable_side_effects u1 1 - v15941 = array_get v1, index u32 31 - enable_side_effects v15941 - v15942 = array_get v2, index u32 31 - v15943 = cast v15942 as u32 - v15944 = array_set v15940, index v15943, value Field 31 - v15946 = not v15941 - v15947 = array_get v15944, index v15943 - v15948 = array_get v15940, index v15943 - v15949 = cast v15941 as Field - v15950 = cast v15946 as Field - v15951 = mul v15949, v15947 - v15952 = mul v15950, v15948 - v15953 = add v15951, v15952 - v15954 = array_set mut v15944, index v15943, value v15953 - enable_side_effects u1 1 - v15955 = array_get v1, index u32 2⁵ - enable_side_effects v15955 - v15956 = array_get v2, index u32 2⁵ - v15957 = cast v15956 as u32 - v15958 = array_set v15954, index v15957, value Field 2⁵ - v15960 = not v15955 - v15961 = array_get v15958, index v15957 - v15962 = array_get v15954, index v15957 - v15963 = cast v15955 as Field - v15964 = cast v15960 as Field - v15965 = mul v15963, v15961 - v15966 = mul v15964, v15962 - v15967 = add v15965, v15966 - v15968 = array_set mut v15958, index v15957, value v15967 - enable_side_effects u1 1 - v15969 = array_get v1, index u32 33 - enable_side_effects v15969 - v15970 = array_get v2, index u32 33 - v15971 = cast v15970 as u32 - v15972 = array_set v15968, index v15971, value Field 33 - v15974 = not v15969 - v15975 = array_get v15972, index v15971 - v15976 = array_get v15968, index v15971 - v15977 = cast v15969 as Field - v15978 = cast v15974 as Field - v15979 = mul v15977, v15975 - v15980 = mul v15978, v15976 - v15981 = add v15979, v15980 - v15982 = array_set mut v15972, index v15971, value v15981 - enable_side_effects u1 1 - v15983 = array_get v1, index u32 34 - enable_side_effects v15983 - v15984 = array_get v2, index u32 34 - v15985 = cast v15984 as u32 - v15986 = array_set v15982, index v15985, value Field 34 - v15988 = not v15983 - v15989 = array_get v15986, index v15985 - v15990 = array_get v15982, index v15985 - v15991 = cast v15983 as Field - v15992 = cast v15988 as Field - v15993 = mul v15991, v15989 - v15994 = mul v15992, v15990 - v15995 = add v15993, v15994 - v15996 = array_set mut v15986, index v15985, value v15995 - enable_side_effects u1 1 - v15997 = array_get v1, index u32 35 - enable_side_effects v15997 - v15998 = array_get v2, index u32 35 - v15999 = cast v15998 as u32 - v16000 = array_set v15996, index v15999, value Field 35 - v16002 = not v15997 - v16003 = array_get v16000, index v15999 - v16004 = array_get v15996, index v15999 - v16005 = cast v15997 as Field - v16006 = cast v16002 as Field - v16007 = mul v16005, v16003 - v16008 = mul v16006, v16004 - v16009 = add v16007, v16008 - v16010 = array_set mut v16000, index v15999, value v16009 - enable_side_effects u1 1 - v16011 = array_get v1, index u32 36 - enable_side_effects v16011 - v16012 = array_get v2, index u32 36 - v16013 = cast v16012 as u32 - v16014 = array_set v16010, index v16013, value Field 36 - v16016 = not v16011 - v16017 = array_get v16014, index v16013 - v16018 = array_get v16010, index v16013 - v16019 = cast v16011 as Field - v16020 = cast v16016 as Field - v16021 = mul v16019, v16017 - v16022 = mul v16020, v16018 - v16023 = add v16021, v16022 - v16024 = array_set mut v16014, index v16013, value v16023 - enable_side_effects u1 1 - v16025 = array_get v1, index u32 37 - enable_side_effects v16025 - v16026 = array_get v2, index u32 37 - v16027 = cast v16026 as u32 - v16028 = array_set v16024, index v16027, value Field 37 - v16030 = not v16025 - v16031 = array_get v16028, index v16027 - v16032 = array_get v16024, index v16027 - v16033 = cast v16025 as Field - v16034 = cast v16030 as Field - v16035 = mul v16033, v16031 - v16036 = mul v16034, v16032 - v16037 = add v16035, v16036 - v16038 = array_set mut v16028, index v16027, value v16037 - enable_side_effects u1 1 - v16039 = array_get v1, index u32 38 - enable_side_effects v16039 - v16040 = array_get v2, index u32 38 - v16041 = cast v16040 as u32 - v16042 = array_set v16038, index v16041, value Field 38 - v16044 = not v16039 - v16045 = array_get v16042, index v16041 - v16046 = array_get v16038, index v16041 - v16047 = cast v16039 as Field - v16048 = cast v16044 as Field - v16049 = mul v16047, v16045 - v16050 = mul v16048, v16046 - v16051 = add v16049, v16050 - v16052 = array_set mut v16042, index v16041, value v16051 - enable_side_effects u1 1 - v16053 = array_get v1, index u32 39 - enable_side_effects v16053 - v16054 = array_get v2, index u32 39 - v16055 = cast v16054 as u32 - v16056 = array_set v16052, index v16055, value Field 39 - v16058 = not v16053 - v16059 = array_get v16056, index v16055 - v16060 = array_get v16052, index v16055 - v16061 = cast v16053 as Field - v16062 = cast v16058 as Field - v16063 = mul v16061, v16059 - v16064 = mul v16062, v16060 - v16065 = add v16063, v16064 - v16066 = array_set mut v16056, index v16055, value v16065 - enable_side_effects u1 1 - v16067 = array_get v1, index u32 40 - enable_side_effects v16067 - v16068 = array_get v2, index u32 40 - v16069 = cast v16068 as u32 - v16070 = array_set v16066, index v16069, value Field 40 - v16072 = not v16067 - v16073 = array_get v16070, index v16069 - v16074 = array_get v16066, index v16069 - v16075 = cast v16067 as Field - v16076 = cast v16072 as Field - v16077 = mul v16075, v16073 - v16078 = mul v16076, v16074 - v16079 = add v16077, v16078 - v16080 = array_set mut v16070, index v16069, value v16079 - enable_side_effects u1 1 - v16081 = array_get v1, index u32 41 - enable_side_effects v16081 - v16082 = array_get v2, index u32 41 - v16083 = cast v16082 as u32 - v16084 = array_set v16080, index v16083, value Field 41 - v16086 = not v16081 - v16087 = array_get v16084, index v16083 - v16088 = array_get v16080, index v16083 - v16089 = cast v16081 as Field - v16090 = cast v16086 as Field - v16091 = mul v16089, v16087 - v16092 = mul v16090, v16088 - v16093 = add v16091, v16092 - v16094 = array_set mut v16084, index v16083, value v16093 - enable_side_effects u1 1 - v16095 = array_get v1, index u32 42 - enable_side_effects v16095 - v16096 = array_get v2, index u32 42 - v16097 = cast v16096 as u32 - v16098 = array_set v16094, index v16097, value Field 42 - v16100 = not v16095 - v16101 = array_get v16098, index v16097 - v16102 = array_get v16094, index v16097 - v16103 = cast v16095 as Field - v16104 = cast v16100 as Field - v16105 = mul v16103, v16101 - v16106 = mul v16104, v16102 - v16107 = add v16105, v16106 - v16108 = array_set mut v16098, index v16097, value v16107 - enable_side_effects u1 1 - v16109 = array_get v1, index u32 43 - enable_side_effects v16109 - v16110 = array_get v2, index u32 43 - v16111 = cast v16110 as u32 - v16112 = array_set v16108, index v16111, value Field 43 - v16114 = not v16109 - v16115 = array_get v16112, index v16111 - v16116 = array_get v16108, index v16111 - v16117 = cast v16109 as Field - v16118 = cast v16114 as Field - v16119 = mul v16117, v16115 - v16120 = mul v16118, v16116 - v16121 = add v16119, v16120 - v16122 = array_set mut v16112, index v16111, value v16121 - enable_side_effects u1 1 - v16123 = array_get v1, index u32 44 - enable_side_effects v16123 - v16124 = array_get v2, index u32 44 - v16125 = cast v16124 as u32 - v16126 = array_set v16122, index v16125, value Field 44 - v16128 = not v16123 - v16129 = array_get v16126, index v16125 - v16130 = array_get v16122, index v16125 - v16131 = cast v16123 as Field - v16132 = cast v16128 as Field - v16133 = mul v16131, v16129 - v16134 = mul v16132, v16130 - v16135 = add v16133, v16134 - v16136 = array_set mut v16126, index v16125, value v16135 - enable_side_effects u1 1 - v16137 = array_get v1, index u32 45 - enable_side_effects v16137 - v16138 = array_get v2, index u32 45 - v16139 = cast v16138 as u32 - v16140 = array_set v16136, index v16139, value Field 45 - v16142 = not v16137 - v16143 = array_get v16140, index v16139 - v16144 = array_get v16136, index v16139 - v16145 = cast v16137 as Field - v16146 = cast v16142 as Field - v16147 = mul v16145, v16143 - v16148 = mul v16146, v16144 - v16149 = add v16147, v16148 - v16150 = array_set mut v16140, index v16139, value v16149 - enable_side_effects u1 1 - v16151 = array_get v1, index u32 46 - enable_side_effects v16151 - v16152 = array_get v2, index u32 46 - v16153 = cast v16152 as u32 - v16154 = array_set v16150, index v16153, value Field 46 - v16156 = not v16151 - v16157 = array_get v16154, index v16153 - v16158 = array_get v16150, index v16153 - v16159 = cast v16151 as Field - v16160 = cast v16156 as Field - v16161 = mul v16159, v16157 - v16162 = mul v16160, v16158 - v16163 = add v16161, v16162 - v16164 = array_set mut v16154, index v16153, value v16163 - enable_side_effects u1 1 - v16165 = array_get v1, index u32 47 - enable_side_effects v16165 - v16166 = array_get v2, index u32 47 - v16167 = cast v16166 as u32 - v16168 = array_set v16164, index v16167, value Field 47 - v16170 = not v16165 - v16171 = array_get v16168, index v16167 - v16172 = array_get v16164, index v16167 - v16173 = cast v16165 as Field - v16174 = cast v16170 as Field - v16175 = mul v16173, v16171 - v16176 = mul v16174, v16172 - v16177 = add v16175, v16176 - v16178 = array_set mut v16168, index v16167, value v16177 - enable_side_effects u1 1 - v16179 = array_get v1, index u32 2⁴×3 - enable_side_effects v16179 - v16180 = array_get v2, index u32 2⁴×3 - v16181 = cast v16180 as u32 - v16182 = array_set v16178, index v16181, value Field 2⁴×3 - v16184 = not v16179 - v16185 = array_get v16182, index v16181 - v16186 = array_get v16178, index v16181 - v16187 = cast v16179 as Field - v16188 = cast v16184 as Field - v16189 = mul v16187, v16185 - v16190 = mul v16188, v16186 - v16191 = add v16189, v16190 - v16192 = array_set mut v16182, index v16181, value v16191 - enable_side_effects u1 1 - v16193 = array_get v1, index u32 49 - enable_side_effects v16193 - v16194 = array_get v2, index u32 49 - v16195 = cast v16194 as u32 - v16196 = array_set v16192, index v16195, value Field 49 - v16198 = not v16193 - v16199 = array_get v16196, index v16195 - v16200 = array_get v16192, index v16195 - v16201 = cast v16193 as Field - v16202 = cast v16198 as Field - v16203 = mul v16201, v16199 - v16204 = mul v16202, v16200 - v16205 = add v16203, v16204 - v16206 = array_set mut v16196, index v16195, value v16205 - enable_side_effects u1 1 - v16207 = array_get v1, index u32 50 - enable_side_effects v16207 - v16208 = array_get v2, index u32 50 - v16209 = cast v16208 as u32 - v16210 = array_set v16206, index v16209, value Field 50 - v16212 = not v16207 - v16213 = array_get v16210, index v16209 - v16214 = array_get v16206, index v16209 - v16215 = cast v16207 as Field - v16216 = cast v16212 as Field - v16217 = mul v16215, v16213 - v16218 = mul v16216, v16214 - v16219 = add v16217, v16218 - v16220 = array_set mut v16210, index v16209, value v16219 - enable_side_effects u1 1 - v16221 = array_get v1, index u32 51 - enable_side_effects v16221 - v16222 = array_get v2, index u32 51 - v16223 = cast v16222 as u32 - v16224 = array_set v16220, index v16223, value Field 51 - v16226 = not v16221 - v16227 = array_get v16224, index v16223 - v16228 = array_get v16220, index v16223 - v16229 = cast v16221 as Field - v16230 = cast v16226 as Field - v16231 = mul v16229, v16227 - v16232 = mul v16230, v16228 - v16233 = add v16231, v16232 - v16234 = array_set mut v16224, index v16223, value v16233 - enable_side_effects u1 1 - v16235 = array_get v1, index u32 52 - enable_side_effects v16235 - v16236 = array_get v2, index u32 52 - v16237 = cast v16236 as u32 - v16238 = array_set v16234, index v16237, value Field 52 - v16240 = not v16235 - v16241 = array_get v16238, index v16237 - v16242 = array_get v16234, index v16237 - v16243 = cast v16235 as Field - v16244 = cast v16240 as Field - v16245 = mul v16243, v16241 - v16246 = mul v16244, v16242 - v16247 = add v16245, v16246 - v16248 = array_set mut v16238, index v16237, value v16247 - enable_side_effects u1 1 - v16249 = array_get v1, index u32 53 - enable_side_effects v16249 - v16250 = array_get v2, index u32 53 - v16251 = cast v16250 as u32 - v16252 = array_set v16248, index v16251, value Field 53 - v16254 = not v16249 - v16255 = array_get v16252, index v16251 - v16256 = array_get v16248, index v16251 - v16257 = cast v16249 as Field - v16258 = cast v16254 as Field - v16259 = mul v16257, v16255 - v16260 = mul v16258, v16256 - v16261 = add v16259, v16260 - v16262 = array_set mut v16252, index v16251, value v16261 - enable_side_effects u1 1 - v16263 = array_get v1, index u32 54 - enable_side_effects v16263 - v16264 = array_get v2, index u32 54 - v16265 = cast v16264 as u32 - v16266 = array_set v16262, index v16265, value Field 54 - v16268 = not v16263 - v16269 = array_get v16266, index v16265 - v16270 = array_get v16262, index v16265 - v16271 = cast v16263 as Field - v16272 = cast v16268 as Field - v16273 = mul v16271, v16269 - v16274 = mul v16272, v16270 - v16275 = add v16273, v16274 - v16276 = array_set mut v16266, index v16265, value v16275 - enable_side_effects u1 1 - v16277 = array_get v1, index u32 55 - enable_side_effects v16277 - v16278 = array_get v2, index u32 55 - v16279 = cast v16278 as u32 - v16280 = array_set v16276, index v16279, value Field 55 - v16282 = not v16277 - v16283 = array_get v16280, index v16279 - v16284 = array_get v16276, index v16279 - v16285 = cast v16277 as Field - v16286 = cast v16282 as Field - v16287 = mul v16285, v16283 - v16288 = mul v16286, v16284 - v16289 = add v16287, v16288 - v16290 = array_set mut v16280, index v16279, value v16289 - enable_side_effects u1 1 - v16291 = array_get v1, index u32 56 - enable_side_effects v16291 - v16292 = array_get v2, index u32 56 - v16293 = cast v16292 as u32 - v16294 = array_set v16290, index v16293, value Field 56 - v16296 = not v16291 - v16297 = array_get v16294, index v16293 - v16298 = array_get v16290, index v16293 - v16299 = cast v16291 as Field - v16300 = cast v16296 as Field - v16301 = mul v16299, v16297 - v16302 = mul v16300, v16298 - v16303 = add v16301, v16302 - v16304 = array_set mut v16294, index v16293, value v16303 - enable_side_effects u1 1 - v16305 = array_get v1, index u32 57 - enable_side_effects v16305 - v16306 = array_get v2, index u32 57 - v16307 = cast v16306 as u32 - v16308 = array_set v16304, index v16307, value Field 57 - v16310 = not v16305 - v16311 = array_get v16308, index v16307 - v16312 = array_get v16304, index v16307 - v16313 = cast v16305 as Field - v16314 = cast v16310 as Field - v16315 = mul v16313, v16311 - v16316 = mul v16314, v16312 - v16317 = add v16315, v16316 - v16318 = array_set mut v16308, index v16307, value v16317 - enable_side_effects u1 1 - v16319 = array_get v1, index u32 58 - enable_side_effects v16319 - v16320 = array_get v2, index u32 58 - v16321 = cast v16320 as u32 - v16322 = array_set v16318, index v16321, value Field 58 - v16324 = not v16319 - v16325 = array_get v16322, index v16321 - v16326 = array_get v16318, index v16321 - v16327 = cast v16319 as Field - v16328 = cast v16324 as Field - v16329 = mul v16327, v16325 - v16330 = mul v16328, v16326 - v16331 = add v16329, v16330 - v16332 = array_set mut v16322, index v16321, value v16331 - enable_side_effects u1 1 - v16333 = array_get v1, index u32 59 - enable_side_effects v16333 - v16334 = array_get v2, index u32 59 - v16335 = cast v16334 as u32 - v16336 = array_set v16332, index v16335, value Field 59 - v16338 = not v16333 - v16339 = array_get v16336, index v16335 - v16340 = array_get v16332, index v16335 - v16341 = cast v16333 as Field - v16342 = cast v16338 as Field - v16343 = mul v16341, v16339 - v16344 = mul v16342, v16340 - v16345 = add v16343, v16344 - v16346 = array_set mut v16336, index v16335, value v16345 - enable_side_effects u1 1 - v16347 = array_get v1, index u32 60 - enable_side_effects v16347 - v16348 = array_get v2, index u32 60 - v16349 = cast v16348 as u32 - v16350 = array_set v16346, index v16349, value Field 60 - v16352 = not v16347 - v16353 = array_get v16350, index v16349 - v16354 = array_get v16346, index v16349 - v16355 = cast v16347 as Field - v16356 = cast v16352 as Field - v16357 = mul v16355, v16353 - v16358 = mul v16356, v16354 - v16359 = add v16357, v16358 - v16360 = array_set mut v16350, index v16349, value v16359 - enable_side_effects u1 1 - v16361 = array_get v1, index u32 61 - enable_side_effects v16361 - v16362 = array_get v2, index u32 61 - v16363 = cast v16362 as u32 - v16364 = array_set v16360, index v16363, value Field 61 - v16366 = not v16361 - v16367 = array_get v16364, index v16363 - v16368 = array_get v16360, index v16363 - v16369 = cast v16361 as Field - v16370 = cast v16366 as Field - v16371 = mul v16369, v16367 - v16372 = mul v16370, v16368 - v16373 = add v16371, v16372 - v16374 = array_set mut v16364, index v16363, value v16373 - enable_side_effects u1 1 - v16375 = array_get v1, index u32 62 - enable_side_effects v16375 - v16376 = array_get v2, index u32 62 - v16377 = cast v16376 as u32 - v16378 = array_set v16374, index v16377, value Field 62 - v16380 = not v16375 - v16381 = array_get v16378, index v16377 - v16382 = array_get v16374, index v16377 - v16383 = cast v16375 as Field - v16384 = cast v16380 as Field - v16385 = mul v16383, v16381 - v16386 = mul v16384, v16382 - v16387 = add v16385, v16386 - v16388 = array_set mut v16378, index v16377, value v16387 - enable_side_effects u1 1 - v16389 = array_get v1, index u32 63 - enable_side_effects v16389 - v16390 = array_get v2, index u32 63 - v16391 = cast v16390 as u32 - v16392 = array_set v16388, index v16391, value Field 63 - v16394 = not v16389 - v16395 = array_get v16392, index v16391 - v16396 = array_get v16388, index v16391 - v16397 = cast v16389 as Field - v16398 = cast v16394 as Field - v16399 = mul v16397, v16395 - v16400 = mul v16398, v16396 - v16401 = add v16399, v16400 - v16402 = array_set mut v16392, index v16391, value v16401 - enable_side_effects u1 1 - v16403 = array_get v1, index u32 2⁶ - enable_side_effects v16403 - v16404 = array_get v2, index u32 2⁶ - v16405 = cast v16404 as u32 - v16406 = array_set v16402, index v16405, value Field 2⁶ - v16408 = not v16403 - v16409 = array_get v16406, index v16405 - v16410 = array_get v16402, index v16405 - v16411 = cast v16403 as Field - v16412 = cast v16408 as Field - v16413 = mul v16411, v16409 - v16414 = mul v16412, v16410 - v16415 = add v16413, v16414 - v16416 = array_set mut v16406, index v16405, value v16415 - enable_side_effects u1 1 - v16417 = array_get v1, index u32 65 - enable_side_effects v16417 - v16418 = array_get v2, index u32 65 - v16419 = cast v16418 as u32 - v16420 = array_set v16416, index v16419, value Field 65 - v16422 = not v16417 - v16423 = array_get v16420, index v16419 - v16424 = array_get v16416, index v16419 - v16425 = cast v16417 as Field - v16426 = cast v16422 as Field - v16427 = mul v16425, v16423 - v16428 = mul v16426, v16424 - v16429 = add v16427, v16428 - v16430 = array_set mut v16420, index v16419, value v16429 - enable_side_effects u1 1 - v16431 = array_get v1, index u32 66 - enable_side_effects v16431 - v16432 = array_get v2, index u32 66 - v16433 = cast v16432 as u32 - v16434 = array_set v16430, index v16433, value Field 66 - v16436 = not v16431 - v16437 = array_get v16434, index v16433 - v16438 = array_get v16430, index v16433 - v16439 = cast v16431 as Field - v16440 = cast v16436 as Field - v16441 = mul v16439, v16437 - v16442 = mul v16440, v16438 - v16443 = add v16441, v16442 - v16444 = array_set mut v16434, index v16433, value v16443 - enable_side_effects u1 1 - v16445 = array_get v1, index u32 67 - enable_side_effects v16445 - v16446 = array_get v2, index u32 67 - v16447 = cast v16446 as u32 - v16448 = array_set v16444, index v16447, value Field 67 - v16450 = not v16445 - v16451 = array_get v16448, index v16447 - v16452 = array_get v16444, index v16447 - v16453 = cast v16445 as Field - v16454 = cast v16450 as Field - v16455 = mul v16453, v16451 - v16456 = mul v16454, v16452 - v16457 = add v16455, v16456 - v16458 = array_set mut v16448, index v16447, value v16457 - enable_side_effects u1 1 - v16459 = array_get v1, index u32 68 - enable_side_effects v16459 - v16460 = array_get v2, index u32 68 - v16461 = cast v16460 as u32 - v16462 = array_set v16458, index v16461, value Field 68 - v16464 = not v16459 - v16465 = array_get v16462, index v16461 - v16466 = array_get v16458, index v16461 - v16467 = cast v16459 as Field - v16468 = cast v16464 as Field - v16469 = mul v16467, v16465 - v16470 = mul v16468, v16466 - v16471 = add v16469, v16470 - v16472 = array_set mut v16462, index v16461, value v16471 - enable_side_effects u1 1 - v16473 = array_get v1, index u32 69 - enable_side_effects v16473 - v16474 = array_get v2, index u32 69 - v16475 = cast v16474 as u32 - v16476 = array_set v16472, index v16475, value Field 69 - v16478 = not v16473 - v16479 = array_get v16476, index v16475 - v16480 = array_get v16472, index v16475 - v16481 = cast v16473 as Field - v16482 = cast v16478 as Field - v16483 = mul v16481, v16479 - v16484 = mul v16482, v16480 - v16485 = add v16483, v16484 - v16486 = array_set mut v16476, index v16475, value v16485 - enable_side_effects u1 1 - v16487 = array_get v1, index u32 70 - enable_side_effects v16487 - v16488 = array_get v2, index u32 70 - v16489 = cast v16488 as u32 - v16490 = array_set v16486, index v16489, value Field 70 - v16492 = not v16487 - v16493 = array_get v16490, index v16489 - v16494 = array_get v16486, index v16489 - v16495 = cast v16487 as Field - v16496 = cast v16492 as Field - v16497 = mul v16495, v16493 - v16498 = mul v16496, v16494 - v16499 = add v16497, v16498 - v16500 = array_set mut v16490, index v16489, value v16499 - enable_side_effects u1 1 - v16501 = array_get v1, index u32 71 - enable_side_effects v16501 - v16502 = array_get v2, index u32 71 - v16503 = cast v16502 as u32 - v16504 = array_set v16500, index v16503, value Field 71 - v16506 = not v16501 - v16507 = array_get v16504, index v16503 - v16508 = array_get v16500, index v16503 - v16509 = cast v16501 as Field - v16510 = cast v16506 as Field - v16511 = mul v16509, v16507 - v16512 = mul v16510, v16508 - v16513 = add v16511, v16512 - v16514 = array_set mut v16504, index v16503, value v16513 - enable_side_effects u1 1 - v16515 = array_get v1, index u32 72 - enable_side_effects v16515 - v16516 = array_get v2, index u32 72 - v16517 = cast v16516 as u32 - v16518 = array_set v16514, index v16517, value Field 72 - v16520 = not v16515 - v16521 = array_get v16518, index v16517 - v16522 = array_get v16514, index v16517 - v16523 = cast v16515 as Field - v16524 = cast v16520 as Field - v16525 = mul v16523, v16521 - v16526 = mul v16524, v16522 - v16527 = add v16525, v16526 - v16528 = array_set mut v16518, index v16517, value v16527 - enable_side_effects u1 1 - v16529 = array_get v1, index u32 73 - enable_side_effects v16529 - v16530 = array_get v2, index u32 73 - v16531 = cast v16530 as u32 - v16532 = array_set v16528, index v16531, value Field 73 - v16534 = not v16529 - v16535 = array_get v16532, index v16531 - v16536 = array_get v16528, index v16531 - v16537 = cast v16529 as Field - v16538 = cast v16534 as Field - v16539 = mul v16537, v16535 - v16540 = mul v16538, v16536 - v16541 = add v16539, v16540 - v16542 = array_set mut v16532, index v16531, value v16541 - enable_side_effects u1 1 - v16543 = array_get v1, index u32 74 - enable_side_effects v16543 - v16544 = array_get v2, index u32 74 - v16545 = cast v16544 as u32 - v16546 = array_set v16542, index v16545, value Field 74 - v16548 = not v16543 - v16549 = array_get v16546, index v16545 - v16550 = array_get v16542, index v16545 - v16551 = cast v16543 as Field - v16552 = cast v16548 as Field - v16553 = mul v16551, v16549 - v16554 = mul v16552, v16550 - v16555 = add v16553, v16554 - v16556 = array_set mut v16546, index v16545, value v16555 - enable_side_effects u1 1 - v16557 = array_get v1, index u32 75 - enable_side_effects v16557 - v16558 = array_get v2, index u32 75 - v16559 = cast v16558 as u32 - v16560 = array_set v16556, index v16559, value Field 75 - v16562 = not v16557 - v16563 = array_get v16560, index v16559 - v16564 = array_get v16556, index v16559 - v16565 = cast v16557 as Field - v16566 = cast v16562 as Field - v16567 = mul v16565, v16563 - v16568 = mul v16566, v16564 - v16569 = add v16567, v16568 - v16570 = array_set mut v16560, index v16559, value v16569 - enable_side_effects u1 1 - v16571 = array_get v1, index u32 76 - enable_side_effects v16571 - v16572 = array_get v2, index u32 76 - v16573 = cast v16572 as u32 - v16574 = array_set v16570, index v16573, value Field 76 - v16576 = not v16571 - v16577 = array_get v16574, index v16573 - v16578 = array_get v16570, index v16573 - v16579 = cast v16571 as Field - v16580 = cast v16576 as Field - v16581 = mul v16579, v16577 - v16582 = mul v16580, v16578 - v16583 = add v16581, v16582 - v16584 = array_set mut v16574, index v16573, value v16583 - enable_side_effects u1 1 - v16585 = array_get v1, index u32 77 - enable_side_effects v16585 - v16586 = array_get v2, index u32 77 - v16587 = cast v16586 as u32 - v16588 = array_set v16584, index v16587, value Field 77 - v16590 = not v16585 - v16591 = array_get v16588, index v16587 - v16592 = array_get v16584, index v16587 - v16593 = cast v16585 as Field - v16594 = cast v16590 as Field - v16595 = mul v16593, v16591 - v16596 = mul v16594, v16592 - v16597 = add v16595, v16596 - v16598 = array_set mut v16588, index v16587, value v16597 - enable_side_effects u1 1 - v16599 = array_get v1, index u32 78 - enable_side_effects v16599 - v16600 = array_get v2, index u32 78 - v16601 = cast v16600 as u32 - v16602 = array_set v16598, index v16601, value Field 78 - v16604 = not v16599 - v16605 = array_get v16602, index v16601 - v16606 = array_get v16598, index v16601 - v16607 = cast v16599 as Field - v16608 = cast v16604 as Field - v16609 = mul v16607, v16605 - v16610 = mul v16608, v16606 - v16611 = add v16609, v16610 - v16612 = array_set mut v16602, index v16601, value v16611 - enable_side_effects u1 1 - v16613 = array_get v1, index u32 79 - enable_side_effects v16613 - v16614 = array_get v2, index u32 79 - v16615 = cast v16614 as u32 - v16616 = array_set v16612, index v16615, value Field 79 - v16618 = not v16613 - v16619 = array_get v16616, index v16615 - v16620 = array_get v16612, index v16615 - v16621 = cast v16613 as Field - v16622 = cast v16618 as Field - v16623 = mul v16621, v16619 - v16624 = mul v16622, v16620 - v16625 = add v16623, v16624 - v16626 = array_set mut v16616, index v16615, value v16625 - enable_side_effects u1 1 - v16627 = array_get v1, index u32 2⁴×5 - enable_side_effects v16627 - v16628 = array_get v2, index u32 2⁴×5 - v16629 = cast v16628 as u32 - v16630 = array_set v16626, index v16629, value Field 2⁴×5 - v16632 = not v16627 - v16633 = array_get v16630, index v16629 - v16634 = array_get v16626, index v16629 - v16635 = cast v16627 as Field - v16636 = cast v16632 as Field - v16637 = mul v16635, v16633 - v16638 = mul v16636, v16634 - v16639 = add v16637, v16638 - v16640 = array_set mut v16630, index v16629, value v16639 - enable_side_effects u1 1 - v16641 = array_get v1, index u32 81 - enable_side_effects v16641 - v16642 = array_get v2, index u32 81 - v16643 = cast v16642 as u32 - v16644 = array_set v16640, index v16643, value Field 81 - v16646 = not v16641 - v16647 = array_get v16644, index v16643 - v16648 = array_get v16640, index v16643 - v16649 = cast v16641 as Field - v16650 = cast v16646 as Field - v16651 = mul v16649, v16647 - v16652 = mul v16650, v16648 - v16653 = add v16651, v16652 - v16654 = array_set mut v16644, index v16643, value v16653 - enable_side_effects u1 1 - v16655 = array_get v1, index u32 82 - enable_side_effects v16655 - v16656 = array_get v2, index u32 82 - v16657 = cast v16656 as u32 - v16658 = array_set v16654, index v16657, value Field 82 - v16660 = not v16655 - v16661 = array_get v16658, index v16657 - v16662 = array_get v16654, index v16657 - v16663 = cast v16655 as Field - v16664 = cast v16660 as Field - v16665 = mul v16663, v16661 - v16666 = mul v16664, v16662 - v16667 = add v16665, v16666 - v16668 = array_set mut v16658, index v16657, value v16667 - enable_side_effects u1 1 - v16669 = array_get v1, index u32 83 - enable_side_effects v16669 - v16670 = array_get v2, index u32 83 - v16671 = cast v16670 as u32 - v16672 = array_set v16668, index v16671, value Field 83 - v16674 = not v16669 - v16675 = array_get v16672, index v16671 - v16676 = array_get v16668, index v16671 - v16677 = cast v16669 as Field - v16678 = cast v16674 as Field - v16679 = mul v16677, v16675 - v16680 = mul v16678, v16676 - v16681 = add v16679, v16680 - v16682 = array_set mut v16672, index v16671, value v16681 - enable_side_effects u1 1 - v16683 = array_get v1, index u32 84 - enable_side_effects v16683 - v16684 = array_get v2, index u32 84 - v16685 = cast v16684 as u32 - v16686 = array_set v16682, index v16685, value Field 84 - v16688 = not v16683 - v16689 = array_get v16686, index v16685 - v16690 = array_get v16682, index v16685 - v16691 = cast v16683 as Field - v16692 = cast v16688 as Field - v16693 = mul v16691, v16689 - v16694 = mul v16692, v16690 - v16695 = add v16693, v16694 - v16696 = array_set mut v16686, index v16685, value v16695 - enable_side_effects u1 1 - v16697 = array_get v1, index u32 85 - enable_side_effects v16697 - v16698 = array_get v2, index u32 85 - v16699 = cast v16698 as u32 - v16700 = array_set v16696, index v16699, value Field 85 - v16702 = not v16697 - v16703 = array_get v16700, index v16699 - v16704 = array_get v16696, index v16699 - v16705 = cast v16697 as Field - v16706 = cast v16702 as Field - v16707 = mul v16705, v16703 - v16708 = mul v16706, v16704 - v16709 = add v16707, v16708 - v16710 = array_set mut v16700, index v16699, value v16709 - enable_side_effects u1 1 - v16711 = array_get v1, index u32 86 - enable_side_effects v16711 - v16712 = array_get v2, index u32 86 - v16713 = cast v16712 as u32 - v16714 = array_set v16710, index v16713, value Field 86 - v16716 = not v16711 - v16717 = array_get v16714, index v16713 - v16718 = array_get v16710, index v16713 - v16719 = cast v16711 as Field - v16720 = cast v16716 as Field - v16721 = mul v16719, v16717 - v16722 = mul v16720, v16718 - v16723 = add v16721, v16722 - v16724 = array_set mut v16714, index v16713, value v16723 - enable_side_effects u1 1 - v16725 = array_get v1, index u32 87 - enable_side_effects v16725 - v16726 = array_get v2, index u32 87 - v16727 = cast v16726 as u32 - v16728 = array_set v16724, index v16727, value Field 87 - v16730 = not v16725 - v16731 = array_get v16728, index v16727 - v16732 = array_get v16724, index v16727 - v16733 = cast v16725 as Field - v16734 = cast v16730 as Field - v16735 = mul v16733, v16731 - v16736 = mul v16734, v16732 - v16737 = add v16735, v16736 - v16738 = array_set mut v16728, index v16727, value v16737 - enable_side_effects u1 1 - v16739 = array_get v1, index u32 88 - enable_side_effects v16739 - v16740 = array_get v2, index u32 88 - v16741 = cast v16740 as u32 - v16742 = array_set v16738, index v16741, value Field 88 - v16744 = not v16739 - v16745 = array_get v16742, index v16741 - v16746 = array_get v16738, index v16741 - v16747 = cast v16739 as Field - v16748 = cast v16744 as Field - v16749 = mul v16747, v16745 - v16750 = mul v16748, v16746 - v16751 = add v16749, v16750 - v16752 = array_set mut v16742, index v16741, value v16751 - enable_side_effects u1 1 - v16753 = array_get v1, index u32 89 - enable_side_effects v16753 - v16754 = array_get v2, index u32 89 - v16755 = cast v16754 as u32 - v16756 = array_set v16752, index v16755, value Field 89 - v16758 = not v16753 - v16759 = array_get v16756, index v16755 - v16760 = array_get v16752, index v16755 - v16761 = cast v16753 as Field - v16762 = cast v16758 as Field - v16763 = mul v16761, v16759 - v16764 = mul v16762, v16760 - v16765 = add v16763, v16764 - v16766 = array_set mut v16756, index v16755, value v16765 - enable_side_effects u1 1 - v16767 = array_get v1, index u32 90 - enable_side_effects v16767 - v16768 = array_get v2, index u32 90 - v16769 = cast v16768 as u32 - v16770 = array_set v16766, index v16769, value Field 90 - v16772 = not v16767 - v16773 = array_get v16770, index v16769 - v16774 = array_get v16766, index v16769 - v16775 = cast v16767 as Field - v16776 = cast v16772 as Field - v16777 = mul v16775, v16773 - v16778 = mul v16776, v16774 - v16779 = add v16777, v16778 - v16780 = array_set mut v16770, index v16769, value v16779 - enable_side_effects u1 1 - v16781 = array_get v1, index u32 91 - enable_side_effects v16781 - v16782 = array_get v2, index u32 91 - v16783 = cast v16782 as u32 - v16784 = array_set v16780, index v16783, value Field 91 - v16786 = not v16781 - v16787 = array_get v16784, index v16783 - v16788 = array_get v16780, index v16783 - v16789 = cast v16781 as Field - v16790 = cast v16786 as Field - v16791 = mul v16789, v16787 - v16792 = mul v16790, v16788 - v16793 = add v16791, v16792 - v16794 = array_set mut v16784, index v16783, value v16793 - enable_side_effects u1 1 - v16795 = array_get v1, index u32 92 - enable_side_effects v16795 - v16796 = array_get v2, index u32 92 - v16797 = cast v16796 as u32 - v16798 = array_set v16794, index v16797, value Field 92 - v16800 = not v16795 - v16801 = array_get v16798, index v16797 - v16802 = array_get v16794, index v16797 - v16803 = cast v16795 as Field - v16804 = cast v16800 as Field - v16805 = mul v16803, v16801 - v16806 = mul v16804, v16802 - v16807 = add v16805, v16806 - v16808 = array_set mut v16798, index v16797, value v16807 - enable_side_effects u1 1 - v16809 = array_get v1, index u32 93 - enable_side_effects v16809 - v16810 = array_get v2, index u32 93 - v16811 = cast v16810 as u32 - v16812 = array_set v16808, index v16811, value Field 93 - v16814 = not v16809 - v16815 = array_get v16812, index v16811 - v16816 = array_get v16808, index v16811 - v16817 = cast v16809 as Field - v16818 = cast v16814 as Field - v16819 = mul v16817, v16815 - v16820 = mul v16818, v16816 - v16821 = add v16819, v16820 - v16822 = array_set mut v16812, index v16811, value v16821 - enable_side_effects u1 1 - v16823 = array_get v1, index u32 94 - enable_side_effects v16823 - v16824 = array_get v2, index u32 94 - v16825 = cast v16824 as u32 - v16826 = array_set v16822, index v16825, value Field 94 - v16828 = not v16823 - v16829 = array_get v16826, index v16825 - v16830 = array_get v16822, index v16825 - v16831 = cast v16823 as Field - v16832 = cast v16828 as Field - v16833 = mul v16831, v16829 - v16834 = mul v16832, v16830 - v16835 = add v16833, v16834 - v16836 = array_set mut v16826, index v16825, value v16835 - enable_side_effects u1 1 - v16837 = array_get v1, index u32 95 - enable_side_effects v16837 - v16838 = array_get v2, index u32 95 - v16839 = cast v16838 as u32 - v16840 = array_set v16836, index v16839, value Field 95 - v16842 = not v16837 - v16843 = array_get v16840, index v16839 - v16844 = array_get v16836, index v16839 - v16845 = cast v16837 as Field - v16846 = cast v16842 as Field - v16847 = mul v16845, v16843 - v16848 = mul v16846, v16844 - v16849 = add v16847, v16848 - v16850 = array_set mut v16840, index v16839, value v16849 - enable_side_effects u1 1 - v16851 = array_get v1, index u32 2⁴×6 - enable_side_effects v16851 - v16852 = array_get v2, index u32 2⁴×6 - v16853 = cast v16852 as u32 - v16854 = array_set v16850, index v16853, value Field 2⁴×6 - v16856 = not v16851 - v16857 = array_get v16854, index v16853 - v16858 = array_get v16850, index v16853 - v16859 = cast v16851 as Field - v16860 = cast v16856 as Field - v16861 = mul v16859, v16857 - v16862 = mul v16860, v16858 - v16863 = add v16861, v16862 - v16864 = array_set mut v16854, index v16853, value v16863 - enable_side_effects u1 1 - v16865 = array_get v1, index u32 97 - enable_side_effects v16865 - v16866 = array_get v2, index u32 97 - v16867 = cast v16866 as u32 - v16868 = array_set v16864, index v16867, value Field 97 - v16870 = not v16865 - v16871 = array_get v16868, index v16867 - v16872 = array_get v16864, index v16867 - v16873 = cast v16865 as Field - v16874 = cast v16870 as Field - v16875 = mul v16873, v16871 - v16876 = mul v16874, v16872 - v16877 = add v16875, v16876 - v16878 = array_set mut v16868, index v16867, value v16877 - enable_side_effects u1 1 - v16879 = array_get v1, index u32 98 - enable_side_effects v16879 - v16880 = array_get v2, index u32 98 - v16881 = cast v16880 as u32 - v16882 = array_set v16878, index v16881, value Field 98 - v16884 = not v16879 - v16885 = array_get v16882, index v16881 - v16886 = array_get v16878, index v16881 - v16887 = cast v16879 as Field - v16888 = cast v16884 as Field - v16889 = mul v16887, v16885 - v16890 = mul v16888, v16886 - v16891 = add v16889, v16890 - v16892 = array_set mut v16882, index v16881, value v16891 - enable_side_effects u1 1 - v16893 = array_get v1, index u32 99 - enable_side_effects v16893 - v16894 = array_get v2, index u32 99 - v16895 = cast v16894 as u32 - v16896 = array_set v16892, index v16895, value Field 99 - v16898 = not v16893 - v16899 = array_get v16896, index v16895 - v16900 = array_get v16892, index v16895 - v16901 = cast v16893 as Field - v16902 = cast v16898 as Field - v16903 = mul v16901, v16899 - v16904 = mul v16902, v16900 - v16905 = add v16903, v16904 - v16906 = array_set mut v16896, index v16895, value v16905 - enable_side_effects u1 1 - v16907 = array_get v1, index u32 100 - enable_side_effects v16907 - v16908 = array_get v2, index u32 100 - v16909 = cast v16908 as u32 - v16910 = array_set v16906, index v16909, value Field 100 - v16912 = not v16907 - v16913 = array_get v16910, index v16909 - v16914 = array_get v16906, index v16909 - v16915 = cast v16907 as Field - v16916 = cast v16912 as Field - v16917 = mul v16915, v16913 - v16918 = mul v16916, v16914 - v16919 = add v16917, v16918 - v16920 = array_set mut v16910, index v16909, value v16919 - enable_side_effects u1 1 - v16921 = array_get v1, index u32 101 - enable_side_effects v16921 - v16922 = array_get v2, index u32 101 - v16923 = cast v16922 as u32 - v16924 = array_set v16920, index v16923, value Field 101 - v16926 = not v16921 - v16927 = array_get v16924, index v16923 - v16928 = array_get v16920, index v16923 - v16929 = cast v16921 as Field - v16930 = cast v16926 as Field - v16931 = mul v16929, v16927 - v16932 = mul v16930, v16928 - v16933 = add v16931, v16932 - v16934 = array_set mut v16924, index v16923, value v16933 - enable_side_effects u1 1 - v16935 = array_get v1, index u32 102 - enable_side_effects v16935 - v16936 = array_get v2, index u32 102 - v16937 = cast v16936 as u32 - v16938 = array_set v16934, index v16937, value Field 102 - v16940 = not v16935 - v16941 = array_get v16938, index v16937 - v16942 = array_get v16934, index v16937 - v16943 = cast v16935 as Field - v16944 = cast v16940 as Field - v16945 = mul v16943, v16941 - v16946 = mul v16944, v16942 - v16947 = add v16945, v16946 - v16948 = array_set mut v16938, index v16937, value v16947 - enable_side_effects u1 1 - v16949 = array_get v1, index u32 103 - enable_side_effects v16949 - v16950 = array_get v2, index u32 103 - v16951 = cast v16950 as u32 - v16952 = array_set v16948, index v16951, value Field 103 - v16954 = not v16949 - v16955 = array_get v16952, index v16951 - v16956 = array_get v16948, index v16951 - v16957 = cast v16949 as Field - v16958 = cast v16954 as Field - v16959 = mul v16957, v16955 - v16960 = mul v16958, v16956 - v16961 = add v16959, v16960 - v16962 = array_set mut v16952, index v16951, value v16961 - enable_side_effects u1 1 - v16963 = array_get v1, index u32 104 - enable_side_effects v16963 - v16964 = array_get v2, index u32 104 - v16965 = cast v16964 as u32 - v16966 = array_set v16962, index v16965, value Field 104 - v16968 = not v16963 - v16969 = array_get v16966, index v16965 - v16970 = array_get v16962, index v16965 - v16971 = cast v16963 as Field - v16972 = cast v16968 as Field - v16973 = mul v16971, v16969 - v16974 = mul v16972, v16970 - v16975 = add v16973, v16974 - v16976 = array_set mut v16966, index v16965, value v16975 - enable_side_effects u1 1 - v16977 = array_get v1, index u32 105 - enable_side_effects v16977 - v16978 = array_get v2, index u32 105 - v16979 = cast v16978 as u32 - v16980 = array_set v16976, index v16979, value Field 105 - v16982 = not v16977 - v16983 = array_get v16980, index v16979 - v16984 = array_get v16976, index v16979 - v16985 = cast v16977 as Field - v16986 = cast v16982 as Field - v16987 = mul v16985, v16983 - v16988 = mul v16986, v16984 - v16989 = add v16987, v16988 - v16990 = array_set mut v16980, index v16979, value v16989 - enable_side_effects u1 1 - v16991 = array_get v1, index u32 106 - enable_side_effects v16991 - v16992 = array_get v2, index u32 106 - v16993 = cast v16992 as u32 - v16994 = array_set v16990, index v16993, value Field 106 - v16996 = not v16991 - v16997 = array_get v16994, index v16993 - v16998 = array_get v16990, index v16993 - v16999 = cast v16991 as Field - v17000 = cast v16996 as Field - v17001 = mul v16999, v16997 - v17002 = mul v17000, v16998 - v17003 = add v17001, v17002 - v17004 = array_set mut v16994, index v16993, value v17003 - enable_side_effects u1 1 - v17005 = array_get v1, index u32 107 - enable_side_effects v17005 - v17006 = array_get v2, index u32 107 - v17007 = cast v17006 as u32 - v17008 = array_set v17004, index v17007, value Field 107 - v17010 = not v17005 - v17011 = array_get v17008, index v17007 - v17012 = array_get v17004, index v17007 - v17013 = cast v17005 as Field - v17014 = cast v17010 as Field - v17015 = mul v17013, v17011 - v17016 = mul v17014, v17012 - v17017 = add v17015, v17016 - v17018 = array_set mut v17008, index v17007, value v17017 - enable_side_effects u1 1 - v17019 = array_get v1, index u32 108 - enable_side_effects v17019 - v17020 = array_get v2, index u32 108 - v17021 = cast v17020 as u32 - v17022 = array_set v17018, index v17021, value Field 108 - v17024 = not v17019 - v17025 = array_get v17022, index v17021 - v17026 = array_get v17018, index v17021 - v17027 = cast v17019 as Field - v17028 = cast v17024 as Field - v17029 = mul v17027, v17025 - v17030 = mul v17028, v17026 - v17031 = add v17029, v17030 - v17032 = array_set mut v17022, index v17021, value v17031 - enable_side_effects u1 1 - v17033 = array_get v1, index u32 109 - enable_side_effects v17033 - v17034 = array_get v2, index u32 109 - v17035 = cast v17034 as u32 - v17036 = array_set v17032, index v17035, value Field 109 - v17038 = not v17033 - v17039 = array_get v17036, index v17035 - v17040 = array_get v17032, index v17035 - v17041 = cast v17033 as Field - v17042 = cast v17038 as Field - v17043 = mul v17041, v17039 - v17044 = mul v17042, v17040 - v17045 = add v17043, v17044 - v17046 = array_set mut v17036, index v17035, value v17045 - enable_side_effects u1 1 - v17047 = array_get v1, index u32 110 - enable_side_effects v17047 - v17048 = array_get v2, index u32 110 - v17049 = cast v17048 as u32 - v17050 = array_set v17046, index v17049, value Field 110 - v17052 = not v17047 - v17053 = array_get v17050, index v17049 - v17054 = array_get v17046, index v17049 - v17055 = cast v17047 as Field - v17056 = cast v17052 as Field - v17057 = mul v17055, v17053 - v17058 = mul v17056, v17054 - v17059 = add v17057, v17058 - v17060 = array_set mut v17050, index v17049, value v17059 - enable_side_effects u1 1 - v17061 = array_get v1, index u32 111 - enable_side_effects v17061 - v17062 = array_get v2, index u32 111 - v17063 = cast v17062 as u32 - v17064 = array_set v17060, index v17063, value Field 111 - v17066 = not v17061 - v17067 = array_get v17064, index v17063 - v17068 = array_get v17060, index v17063 - v17069 = cast v17061 as Field - v17070 = cast v17066 as Field - v17071 = mul v17069, v17067 - v17072 = mul v17070, v17068 - v17073 = add v17071, v17072 - v17074 = array_set mut v17064, index v17063, value v17073 - enable_side_effects u1 1 - v17075 = array_get v1, index u32 2⁴×7 - enable_side_effects v17075 - v17076 = array_get v2, index u32 2⁴×7 - v17077 = cast v17076 as u32 - v17078 = array_set v17074, index v17077, value Field 2⁴×7 - v17080 = not v17075 - v17081 = array_get v17078, index v17077 - v17082 = array_get v17074, index v17077 - v17083 = cast v17075 as Field - v17084 = cast v17080 as Field - v17085 = mul v17083, v17081 - v17086 = mul v17084, v17082 - v17087 = add v17085, v17086 - v17088 = array_set mut v17078, index v17077, value v17087 - enable_side_effects u1 1 - v17089 = array_get v1, index u32 113 - enable_side_effects v17089 - v17090 = array_get v2, index u32 113 - v17091 = cast v17090 as u32 - v17092 = array_set v17088, index v17091, value Field 113 - v17094 = not v17089 - v17095 = array_get v17092, index v17091 - v17096 = array_get v17088, index v17091 - v17097 = cast v17089 as Field - v17098 = cast v17094 as Field - v17099 = mul v17097, v17095 - v17100 = mul v17098, v17096 - v17101 = add v17099, v17100 - v17102 = array_set mut v17092, index v17091, value v17101 - enable_side_effects u1 1 - v17103 = array_get v1, index u32 114 - enable_side_effects v17103 - v17104 = array_get v2, index u32 114 - v17105 = cast v17104 as u32 - v17106 = array_set v17102, index v17105, value Field 114 - v17108 = not v17103 - v17109 = array_get v17106, index v17105 - v17110 = array_get v17102, index v17105 - v17111 = cast v17103 as Field - v17112 = cast v17108 as Field - v17113 = mul v17111, v17109 - v17114 = mul v17112, v17110 - v17115 = add v17113, v17114 - v17116 = array_set mut v17106, index v17105, value v17115 - enable_side_effects u1 1 - v17117 = array_get v1, index u32 115 - enable_side_effects v17117 - v17118 = array_get v2, index u32 115 - v17119 = cast v17118 as u32 - v17120 = array_set v17116, index v17119, value Field 115 - v17122 = not v17117 - v17123 = array_get v17120, index v17119 - v17124 = array_get v17116, index v17119 - v17125 = cast v17117 as Field - v17126 = cast v17122 as Field - v17127 = mul v17125, v17123 - v17128 = mul v17126, v17124 - v17129 = add v17127, v17128 - v17130 = array_set mut v17120, index v17119, value v17129 - enable_side_effects u1 1 - v17131 = array_get v1, index u32 116 - enable_side_effects v17131 - v17132 = array_get v2, index u32 116 - v17133 = cast v17132 as u32 - v17134 = array_set v17130, index v17133, value Field 116 - v17136 = not v17131 - v17137 = array_get v17134, index v17133 - v17138 = array_get v17130, index v17133 - v17139 = cast v17131 as Field - v17140 = cast v17136 as Field - v17141 = mul v17139, v17137 - v17142 = mul v17140, v17138 - v17143 = add v17141, v17142 - v17144 = array_set mut v17134, index v17133, value v17143 - enable_side_effects u1 1 - v17145 = array_get v1, index u32 117 - enable_side_effects v17145 - v17146 = array_get v2, index u32 117 - v17147 = cast v17146 as u32 - v17148 = array_set v17144, index v17147, value Field 117 - v17150 = not v17145 - v17151 = array_get v17148, index v17147 - v17152 = array_get v17144, index v17147 - v17153 = cast v17145 as Field - v17154 = cast v17150 as Field - v17155 = mul v17153, v17151 - v17156 = mul v17154, v17152 - v17157 = add v17155, v17156 - v17158 = array_set mut v17148, index v17147, value v17157 - enable_side_effects u1 1 - v17159 = array_get v1, index u32 118 - enable_side_effects v17159 - v17160 = array_get v2, index u32 118 - v17161 = cast v17160 as u32 - v17162 = array_set v17158, index v17161, value Field 118 - v17164 = not v17159 - v17165 = array_get v17162, index v17161 - v17166 = array_get v17158, index v17161 - v17167 = cast v17159 as Field - v17168 = cast v17164 as Field - v17169 = mul v17167, v17165 - v17170 = mul v17168, v17166 - v17171 = add v17169, v17170 - v17172 = array_set mut v17162, index v17161, value v17171 - enable_side_effects u1 1 - v17173 = array_get v1, index u32 119 - enable_side_effects v17173 - v17174 = array_get v2, index u32 119 - v17175 = cast v17174 as u32 - v17176 = array_set v17172, index v17175, value Field 119 - v17178 = not v17173 - v17179 = array_get v17176, index v17175 - v17180 = array_get v17172, index v17175 - v17181 = cast v17173 as Field - v17182 = cast v17178 as Field - v17183 = mul v17181, v17179 - v17184 = mul v17182, v17180 - v17185 = add v17183, v17184 - v17186 = array_set mut v17176, index v17175, value v17185 - enable_side_effects u1 1 - v17187 = array_get v1, index u32 120 - enable_side_effects v17187 - v17188 = array_get v2, index u32 120 - v17189 = cast v17188 as u32 - v17190 = array_set v17186, index v17189, value Field 120 - v17192 = not v17187 - v17193 = array_get v17190, index v17189 - v17194 = array_get v17186, index v17189 - v17195 = cast v17187 as Field - v17196 = cast v17192 as Field - v17197 = mul v17195, v17193 - v17198 = mul v17196, v17194 - v17199 = add v17197, v17198 - v17200 = array_set mut v17190, index v17189, value v17199 - enable_side_effects u1 1 - v17201 = array_get v1, index u32 121 - enable_side_effects v17201 - v17202 = array_get v2, index u32 121 - v17203 = cast v17202 as u32 - v17204 = array_set v17200, index v17203, value Field 121 - v17206 = not v17201 - v17207 = array_get v17204, index v17203 - v17208 = array_get v17200, index v17203 - v17209 = cast v17201 as Field - v17210 = cast v17206 as Field - v17211 = mul v17209, v17207 - v17212 = mul v17210, v17208 - v17213 = add v17211, v17212 - v17214 = array_set mut v17204, index v17203, value v17213 - enable_side_effects u1 1 - v17215 = array_get v1, index u32 122 - enable_side_effects v17215 - v17216 = array_get v2, index u32 122 - v17217 = cast v17216 as u32 - v17218 = array_set v17214, index v17217, value Field 122 - v17220 = not v17215 - v17221 = array_get v17218, index v17217 - v17222 = array_get v17214, index v17217 - v17223 = cast v17215 as Field - v17224 = cast v17220 as Field - v17225 = mul v17223, v17221 - v17226 = mul v17224, v17222 - v17227 = add v17225, v17226 - v17228 = array_set mut v17218, index v17217, value v17227 - enable_side_effects u1 1 - v17229 = array_get v1, index u32 123 - enable_side_effects v17229 - v17230 = array_get v2, index u32 123 - v17231 = cast v17230 as u32 - v17232 = array_set v17228, index v17231, value Field 123 - v17234 = not v17229 - v17235 = array_get v17232, index v17231 - v17236 = array_get v17228, index v17231 - v17237 = cast v17229 as Field - v17238 = cast v17234 as Field - v17239 = mul v17237, v17235 - v17240 = mul v17238, v17236 - v17241 = add v17239, v17240 - v17242 = array_set mut v17232, index v17231, value v17241 - enable_side_effects u1 1 - v17243 = array_get v1, index u32 124 - enable_side_effects v17243 - v17244 = array_get v2, index u32 124 - v17245 = cast v17244 as u32 - v17246 = array_set v17242, index v17245, value Field 124 - v17248 = not v17243 - v17249 = array_get v17246, index v17245 - v17250 = array_get v17242, index v17245 - v17251 = cast v17243 as Field - v17252 = cast v17248 as Field - v17253 = mul v17251, v17249 - v17254 = mul v17252, v17250 - v17255 = add v17253, v17254 - v17256 = array_set mut v17246, index v17245, value v17255 - enable_side_effects u1 1 - v17257 = array_get v1, index u32 125 - enable_side_effects v17257 - v17258 = array_get v2, index u32 125 - v17259 = cast v17258 as u32 - v17260 = array_set v17256, index v17259, value Field 125 - v17262 = not v17257 - v17263 = array_get v17260, index v17259 - v17264 = array_get v17256, index v17259 - v17265 = cast v17257 as Field - v17266 = cast v17262 as Field - v17267 = mul v17265, v17263 - v17268 = mul v17266, v17264 - v17269 = add v17267, v17268 - v17270 = array_set mut v17260, index v17259, value v17269 - enable_side_effects u1 1 - v17271 = array_get v1, index u32 126 - enable_side_effects v17271 - v17272 = array_get v2, index u32 126 - v17273 = cast v17272 as u32 - v17274 = array_set v17270, index v17273, value Field 126 - v17276 = not v17271 - v17277 = array_get v17274, index v17273 - v17278 = array_get v17270, index v17273 - v17279 = cast v17271 as Field - v17280 = cast v17276 as Field - v17281 = mul v17279, v17277 - v17282 = mul v17280, v17278 - v17283 = add v17281, v17282 - v17284 = array_set mut v17274, index v17273, value v17283 - enable_side_effects u1 1 - v17285 = array_get v1, index u32 127 - enable_side_effects v17285 - v17286 = array_get v2, index u32 127 - v17287 = cast v17286 as u32 - v17288 = array_set v17284, index v17287, value Field 127 - v17290 = not v17285 - v17291 = array_get v17288, index v17287 - v17292 = array_get v17284, index v17287 - v17293 = cast v17285 as Field - v17294 = cast v17290 as Field - v17295 = mul v17293, v17291 - v17296 = mul v17294, v17292 - v17297 = add v17295, v17296 - v17298 = array_set mut v17288, index v17287, value v17297 - enable_side_effects u1 1 - v17299 = array_get v1, index u32 2⁷ - enable_side_effects v17299 - v17300 = array_get v2, index u32 2⁷ - v17301 = cast v17300 as u32 - v17302 = array_set v17298, index v17301, value Field 2⁷ - v17304 = not v17299 - v17305 = array_get v17302, index v17301 - v17306 = array_get v17298, index v17301 - v17307 = cast v17299 as Field - v17308 = cast v17304 as Field - v17309 = mul v17307, v17305 - v17310 = mul v17308, v17306 - v17311 = add v17309, v17310 - v17312 = array_set mut v17302, index v17301, value v17311 - enable_side_effects u1 1 - v17313 = array_get v1, index u32 129 - enable_side_effects v17313 - v17314 = array_get v2, index u32 129 - v17315 = cast v17314 as u32 - v17316 = array_set v17312, index v17315, value Field 129 - v17318 = not v17313 - v17319 = array_get v17316, index v17315 - v17320 = array_get v17312, index v17315 - v17321 = cast v17313 as Field - v17322 = cast v17318 as Field - v17323 = mul v17321, v17319 - v17324 = mul v17322, v17320 - v17325 = add v17323, v17324 - v17326 = array_set mut v17316, index v17315, value v17325 - enable_side_effects u1 1 - v17327 = array_get v1, index u32 130 - enable_side_effects v17327 - v17328 = array_get v2, index u32 130 - v17329 = cast v17328 as u32 - v17330 = array_set v17326, index v17329, value Field 130 - v17332 = not v17327 - v17333 = array_get v17330, index v17329 - v17334 = array_get v17326, index v17329 - v17335 = cast v17327 as Field - v17336 = cast v17332 as Field - v17337 = mul v17335, v17333 - v17338 = mul v17336, v17334 - v17339 = add v17337, v17338 - v17340 = array_set mut v17330, index v17329, value v17339 - enable_side_effects u1 1 - v17341 = array_get v1, index u32 131 - enable_side_effects v17341 - v17342 = array_get v2, index u32 131 - v17343 = cast v17342 as u32 - v17344 = array_set v17340, index v17343, value Field 131 - v17346 = not v17341 - v17347 = array_get v17344, index v17343 - v17348 = array_get v17340, index v17343 - v17349 = cast v17341 as Field - v17350 = cast v17346 as Field - v17351 = mul v17349, v17347 - v17352 = mul v17350, v17348 - v17353 = add v17351, v17352 - v17354 = array_set mut v17344, index v17343, value v17353 - enable_side_effects u1 1 - v17355 = array_get v1, index u32 132 - enable_side_effects v17355 - v17356 = array_get v2, index u32 132 - v17357 = cast v17356 as u32 - v17358 = array_set v17354, index v17357, value Field 132 - v17360 = not v17355 - v17361 = array_get v17358, index v17357 - v17362 = array_get v17354, index v17357 - v17363 = cast v17355 as Field - v17364 = cast v17360 as Field - v17365 = mul v17363, v17361 - v17366 = mul v17364, v17362 - v17367 = add v17365, v17366 - v17368 = array_set mut v17358, index v17357, value v17367 - enable_side_effects u1 1 - v17369 = array_get v1, index u32 133 - enable_side_effects v17369 - v17370 = array_get v2, index u32 133 - v17371 = cast v17370 as u32 - v17372 = array_set v17368, index v17371, value Field 133 - v17374 = not v17369 - v17375 = array_get v17372, index v17371 - v17376 = array_get v17368, index v17371 - v17377 = cast v17369 as Field - v17378 = cast v17374 as Field - v17379 = mul v17377, v17375 - v17380 = mul v17378, v17376 - v17381 = add v17379, v17380 - v17382 = array_set mut v17372, index v17371, value v17381 - enable_side_effects u1 1 - v17383 = array_get v1, index u32 134 - enable_side_effects v17383 - v17384 = array_get v2, index u32 134 - v17385 = cast v17384 as u32 - v17386 = array_set v17382, index v17385, value Field 134 - v17388 = not v17383 - v17389 = array_get v17386, index v17385 - v17390 = array_get v17382, index v17385 - v17391 = cast v17383 as Field - v17392 = cast v17388 as Field - v17393 = mul v17391, v17389 - v17394 = mul v17392, v17390 - v17395 = add v17393, v17394 - v17396 = array_set mut v17386, index v17385, value v17395 - enable_side_effects u1 1 - v17397 = array_get v1, index u32 135 - enable_side_effects v17397 - v17398 = array_get v2, index u32 135 - v17399 = cast v17398 as u32 - v17400 = array_set v17396, index v17399, value Field 135 - v17402 = not v17397 - v17403 = array_get v17400, index v17399 - v17404 = array_get v17396, index v17399 - v17405 = cast v17397 as Field - v17406 = cast v17402 as Field - v17407 = mul v17405, v17403 - v17408 = mul v17406, v17404 - v17409 = add v17407, v17408 - v17410 = array_set mut v17400, index v17399, value v17409 - enable_side_effects u1 1 - v17411 = array_get v1, index u32 136 - enable_side_effects v17411 - v17412 = array_get v2, index u32 136 - v17413 = cast v17412 as u32 - v17414 = array_set v17410, index v17413, value Field 136 - v17416 = not v17411 - v17417 = array_get v17414, index v17413 - v17418 = array_get v17410, index v17413 - v17419 = cast v17411 as Field - v17420 = cast v17416 as Field - v17421 = mul v17419, v17417 - v17422 = mul v17420, v17418 - v17423 = add v17421, v17422 - v17424 = array_set mut v17414, index v17413, value v17423 - enable_side_effects u1 1 - v17425 = array_get v1, index u32 137 - enable_side_effects v17425 - v17426 = array_get v2, index u32 137 - v17427 = cast v17426 as u32 - v17428 = array_set v17424, index v17427, value Field 137 - v17430 = not v17425 - v17431 = array_get v17428, index v17427 - v17432 = array_get v17424, index v17427 - v17433 = cast v17425 as Field - v17434 = cast v17430 as Field - v17435 = mul v17433, v17431 - v17436 = mul v17434, v17432 - v17437 = add v17435, v17436 - v17438 = array_set mut v17428, index v17427, value v17437 - enable_side_effects u1 1 - v17439 = array_get v1, index u32 138 - enable_side_effects v17439 - v17440 = array_get v2, index u32 138 - v17441 = cast v17440 as u32 - v17442 = array_set v17438, index v17441, value Field 138 - v17444 = not v17439 - v17445 = array_get v17442, index v17441 - v17446 = array_get v17438, index v17441 - v17447 = cast v17439 as Field - v17448 = cast v17444 as Field - v17449 = mul v17447, v17445 - v17450 = mul v17448, v17446 - v17451 = add v17449, v17450 - v17452 = array_set mut v17442, index v17441, value v17451 - enable_side_effects u1 1 - v17453 = array_get v1, index u32 139 - enable_side_effects v17453 - v17454 = array_get v2, index u32 139 - v17455 = cast v17454 as u32 - v17456 = array_set v17452, index v17455, value Field 139 - v17458 = not v17453 - v17459 = array_get v17456, index v17455 - v17460 = array_get v17452, index v17455 - v17461 = cast v17453 as Field - v17462 = cast v17458 as Field - v17463 = mul v17461, v17459 - v17464 = mul v17462, v17460 - v17465 = add v17463, v17464 - v17466 = array_set mut v17456, index v17455, value v17465 - enable_side_effects u1 1 - v17467 = array_get v1, index u32 140 - enable_side_effects v17467 - v17468 = array_get v2, index u32 140 - v17469 = cast v17468 as u32 - v17470 = array_set v17466, index v17469, value Field 140 - v17472 = not v17467 - v17473 = array_get v17470, index v17469 - v17474 = array_get v17466, index v17469 - v17475 = cast v17467 as Field - v17476 = cast v17472 as Field - v17477 = mul v17475, v17473 - v17478 = mul v17476, v17474 - v17479 = add v17477, v17478 - v17480 = array_set mut v17470, index v17469, value v17479 - enable_side_effects u1 1 - v17481 = array_get v1, index u32 141 - enable_side_effects v17481 - v17482 = array_get v2, index u32 141 - v17483 = cast v17482 as u32 - v17484 = array_set v17480, index v17483, value Field 141 - v17486 = not v17481 - v17487 = array_get v17484, index v17483 - v17488 = array_get v17480, index v17483 - v17489 = cast v17481 as Field - v17490 = cast v17486 as Field - v17491 = mul v17489, v17487 - v17492 = mul v17490, v17488 - v17493 = add v17491, v17492 - v17494 = array_set mut v17484, index v17483, value v17493 - enable_side_effects u1 1 - v17495 = array_get v1, index u32 142 - enable_side_effects v17495 - v17496 = array_get v2, index u32 142 - v17497 = cast v17496 as u32 - v17498 = array_set v17494, index v17497, value Field 142 - v17500 = not v17495 - v17501 = array_get v17498, index v17497 - v17502 = array_get v17494, index v17497 - v17503 = cast v17495 as Field - v17504 = cast v17500 as Field - v17505 = mul v17503, v17501 - v17506 = mul v17504, v17502 - v17507 = add v17505, v17506 - v17508 = array_set mut v17498, index v17497, value v17507 - enable_side_effects u1 1 - v17509 = array_get v1, index u32 143 - enable_side_effects v17509 - v17510 = array_get v2, index u32 143 - v17511 = cast v17510 as u32 - v17512 = array_set v17508, index v17511, value Field 143 - v17514 = not v17509 - v17515 = array_get v17512, index v17511 - v17516 = array_get v17508, index v17511 - v17517 = cast v17509 as Field - v17518 = cast v17514 as Field - v17519 = mul v17517, v17515 - v17520 = mul v17518, v17516 - v17521 = add v17519, v17520 - v17522 = array_set mut v17512, index v17511, value v17521 - enable_side_effects u1 1 - v17523 = array_get v1, index u32 2⁴×9 - enable_side_effects v17523 - v17524 = array_get v2, index u32 2⁴×9 - v17525 = cast v17524 as u32 - v17526 = array_set v17522, index v17525, value Field 2⁴×9 - v17528 = not v17523 - v17529 = array_get v17526, index v17525 - v17530 = array_get v17522, index v17525 - v17531 = cast v17523 as Field - v17532 = cast v17528 as Field - v17533 = mul v17531, v17529 - v17534 = mul v17532, v17530 - v17535 = add v17533, v17534 - v17536 = array_set mut v17526, index v17525, value v17535 - enable_side_effects u1 1 - v17537 = array_get v1, index u32 145 - enable_side_effects v17537 - v17538 = array_get v2, index u32 145 - v17539 = cast v17538 as u32 - v17540 = array_set v17536, index v17539, value Field 145 - v17542 = not v17537 - v17543 = array_get v17540, index v17539 - v17544 = array_get v17536, index v17539 - v17545 = cast v17537 as Field - v17546 = cast v17542 as Field - v17547 = mul v17545, v17543 - v17548 = mul v17546, v17544 - v17549 = add v17547, v17548 - v17550 = array_set mut v17540, index v17539, value v17549 - enable_side_effects u1 1 - v17551 = array_get v1, index u32 146 - enable_side_effects v17551 - v17552 = array_get v2, index u32 146 - v17553 = cast v17552 as u32 - v17554 = array_set v17550, index v17553, value Field 146 - v17556 = not v17551 - v17557 = array_get v17554, index v17553 - v17558 = array_get v17550, index v17553 - v17559 = cast v17551 as Field - v17560 = cast v17556 as Field - v17561 = mul v17559, v17557 - v17562 = mul v17560, v17558 - v17563 = add v17561, v17562 - v17564 = array_set mut v17554, index v17553, value v17563 - enable_side_effects u1 1 - v17565 = array_get v1, index u32 147 - enable_side_effects v17565 - v17566 = array_get v2, index u32 147 - v17567 = cast v17566 as u32 - v17568 = array_set v17564, index v17567, value Field 147 - v17570 = not v17565 - v17571 = array_get v17568, index v17567 - v17572 = array_get v17564, index v17567 - v17573 = cast v17565 as Field - v17574 = cast v17570 as Field - v17575 = mul v17573, v17571 - v17576 = mul v17574, v17572 - v17577 = add v17575, v17576 - v17578 = array_set mut v17568, index v17567, value v17577 - enable_side_effects u1 1 - v17579 = array_get v1, index u32 148 - enable_side_effects v17579 - v17580 = array_get v2, index u32 148 - v17581 = cast v17580 as u32 - v17582 = array_set v17578, index v17581, value Field 148 - v17584 = not v17579 - v17585 = array_get v17582, index v17581 - v17586 = array_get v17578, index v17581 - v17587 = cast v17579 as Field - v17588 = cast v17584 as Field - v17589 = mul v17587, v17585 - v17590 = mul v17588, v17586 - v17591 = add v17589, v17590 - v17592 = array_set mut v17582, index v17581, value v17591 - enable_side_effects u1 1 - v17593 = array_get v1, index u32 149 - enable_side_effects v17593 - v17594 = array_get v2, index u32 149 - v17595 = cast v17594 as u32 - v17596 = array_set v17592, index v17595, value Field 149 - v17598 = not v17593 - v17599 = array_get v17596, index v17595 - v17600 = array_get v17592, index v17595 - v17601 = cast v17593 as Field - v17602 = cast v17598 as Field - v17603 = mul v17601, v17599 - v17604 = mul v17602, v17600 - v17605 = add v17603, v17604 - v17606 = array_set mut v17596, index v17595, value v17605 - enable_side_effects u1 1 - v17607 = array_get v1, index u32 150 - enable_side_effects v17607 - v17608 = array_get v2, index u32 150 - v17609 = cast v17608 as u32 - v17610 = array_set v17606, index v17609, value Field 150 - v17612 = not v17607 - v17613 = array_get v17610, index v17609 - v17614 = array_get v17606, index v17609 - v17615 = cast v17607 as Field - v17616 = cast v17612 as Field - v17617 = mul v17615, v17613 - v17618 = mul v17616, v17614 - v17619 = add v17617, v17618 - v17620 = array_set mut v17610, index v17609, value v17619 - enable_side_effects u1 1 - v17621 = array_get v1, index u32 151 - enable_side_effects v17621 - v17622 = array_get v2, index u32 151 - v17623 = cast v17622 as u32 - v17624 = array_set v17620, index v17623, value Field 151 - v17626 = not v17621 - v17627 = array_get v17624, index v17623 - v17628 = array_get v17620, index v17623 - v17629 = cast v17621 as Field - v17630 = cast v17626 as Field - v17631 = mul v17629, v17627 - v17632 = mul v17630, v17628 - v17633 = add v17631, v17632 - v17634 = array_set mut v17624, index v17623, value v17633 - enable_side_effects u1 1 - v17635 = array_get v1, index u32 152 - enable_side_effects v17635 - v17636 = array_get v2, index u32 152 - v17637 = cast v17636 as u32 - v17638 = array_set v17634, index v17637, value Field 152 - v17640 = not v17635 - v17641 = array_get v17638, index v17637 - v17642 = array_get v17634, index v17637 - v17643 = cast v17635 as Field - v17644 = cast v17640 as Field - v17645 = mul v17643, v17641 - v17646 = mul v17644, v17642 - v17647 = add v17645, v17646 - v17648 = array_set mut v17638, index v17637, value v17647 - enable_side_effects u1 1 - v17649 = array_get v1, index u32 153 - enable_side_effects v17649 - v17650 = array_get v2, index u32 153 - v17651 = cast v17650 as u32 - v17652 = array_set v17648, index v17651, value Field 153 - v17654 = not v17649 - v17655 = array_get v17652, index v17651 - v17656 = array_get v17648, index v17651 - v17657 = cast v17649 as Field - v17658 = cast v17654 as Field - v17659 = mul v17657, v17655 - v17660 = mul v17658, v17656 - v17661 = add v17659, v17660 - v17662 = array_set mut v17652, index v17651, value v17661 - enable_side_effects u1 1 - v17663 = array_get v1, index u32 154 - enable_side_effects v17663 - v17664 = array_get v2, index u32 154 - v17665 = cast v17664 as u32 - v17666 = array_set v17662, index v17665, value Field 154 - v17668 = not v17663 - v17669 = array_get v17666, index v17665 - v17670 = array_get v17662, index v17665 - v17671 = cast v17663 as Field - v17672 = cast v17668 as Field - v17673 = mul v17671, v17669 - v17674 = mul v17672, v17670 - v17675 = add v17673, v17674 - v17676 = array_set mut v17666, index v17665, value v17675 - enable_side_effects u1 1 - v17677 = array_get v1, index u32 155 - enable_side_effects v17677 - v17678 = array_get v2, index u32 155 - v17679 = cast v17678 as u32 - v17680 = array_set v17676, index v17679, value Field 155 - v17682 = not v17677 - v17683 = array_get v17680, index v17679 - v17684 = array_get v17676, index v17679 - v17685 = cast v17677 as Field - v17686 = cast v17682 as Field - v17687 = mul v17685, v17683 - v17688 = mul v17686, v17684 - v17689 = add v17687, v17688 - v17690 = array_set mut v17680, index v17679, value v17689 - enable_side_effects u1 1 - v17691 = array_get v1, index u32 156 - enable_side_effects v17691 - v17692 = array_get v2, index u32 156 - v17693 = cast v17692 as u32 - v17694 = array_set v17690, index v17693, value Field 156 - v17696 = not v17691 - v17697 = array_get v17694, index v17693 - v17698 = array_get v17690, index v17693 - v17699 = cast v17691 as Field - v17700 = cast v17696 as Field - v17701 = mul v17699, v17697 - v17702 = mul v17700, v17698 - v17703 = add v17701, v17702 - v17704 = array_set mut v17694, index v17693, value v17703 - enable_side_effects u1 1 - v17705 = array_get v1, index u32 157 - enable_side_effects v17705 - v17706 = array_get v2, index u32 157 - v17707 = cast v17706 as u32 - v17708 = array_set v17704, index v17707, value Field 157 - v17710 = not v17705 - v17711 = array_get v17708, index v17707 - v17712 = array_get v17704, index v17707 - v17713 = cast v17705 as Field - v17714 = cast v17710 as Field - v17715 = mul v17713, v17711 - v17716 = mul v17714, v17712 - v17717 = add v17715, v17716 - v17718 = array_set mut v17708, index v17707, value v17717 - enable_side_effects u1 1 - v17719 = array_get v1, index u32 158 - enable_side_effects v17719 - v17720 = array_get v2, index u32 158 - v17721 = cast v17720 as u32 - v17722 = array_set v17718, index v17721, value Field 158 - v17724 = not v17719 - v17725 = array_get v17722, index v17721 - v17726 = array_get v17718, index v17721 - v17727 = cast v17719 as Field - v17728 = cast v17724 as Field - v17729 = mul v17727, v17725 - v17730 = mul v17728, v17726 - v17731 = add v17729, v17730 - v17732 = array_set mut v17722, index v17721, value v17731 - enable_side_effects u1 1 - v17733 = array_get v1, index u32 159 - enable_side_effects v17733 - v17734 = array_get v2, index u32 159 - v17735 = cast v17734 as u32 - v17736 = array_set v17732, index v17735, value Field 159 - v17738 = not v17733 - v17739 = array_get v17736, index v17735 - v17740 = array_get v17732, index v17735 - v17741 = cast v17733 as Field - v17742 = cast v17738 as Field - v17743 = mul v17741, v17739 - v17744 = mul v17742, v17740 - v17745 = add v17743, v17744 - v17746 = array_set mut v17736, index v17735, value v17745 - enable_side_effects u1 1 - v17747 = array_get v1, index u32 2⁴×10 - enable_side_effects v17747 - v17748 = array_get v2, index u32 2⁴×10 - v17749 = cast v17748 as u32 - v17750 = array_set v17746, index v17749, value Field 2⁴×10 - v17752 = not v17747 - v17753 = array_get v17750, index v17749 - v17754 = array_get v17746, index v17749 - v17755 = cast v17747 as Field - v17756 = cast v17752 as Field - v17757 = mul v17755, v17753 - v17758 = mul v17756, v17754 - v17759 = add v17757, v17758 - v17760 = array_set mut v17750, index v17749, value v17759 - enable_side_effects u1 1 - v17761 = array_get v1, index u32 161 - enable_side_effects v17761 - v17762 = array_get v2, index u32 161 - v17763 = cast v17762 as u32 - v17764 = array_set v17760, index v17763, value Field 161 - v17766 = not v17761 - v17767 = array_get v17764, index v17763 - v17768 = array_get v17760, index v17763 - v17769 = cast v17761 as Field - v17770 = cast v17766 as Field - v17771 = mul v17769, v17767 - v17772 = mul v17770, v17768 - v17773 = add v17771, v17772 - v17774 = array_set mut v17764, index v17763, value v17773 - enable_side_effects u1 1 - v17775 = array_get v1, index u32 162 - enable_side_effects v17775 - v17776 = array_get v2, index u32 162 - v17777 = cast v17776 as u32 - v17778 = array_set v17774, index v17777, value Field 162 - v17780 = not v17775 - v17781 = array_get v17778, index v17777 - v17782 = array_get v17774, index v17777 - v17783 = cast v17775 as Field - v17784 = cast v17780 as Field - v17785 = mul v17783, v17781 - v17786 = mul v17784, v17782 - v17787 = add v17785, v17786 - v17788 = array_set mut v17778, index v17777, value v17787 - enable_side_effects u1 1 - v17789 = array_get v1, index u32 163 - enable_side_effects v17789 - v17790 = array_get v2, index u32 163 - v17791 = cast v17790 as u32 - v17792 = array_set v17788, index v17791, value Field 163 - v17794 = not v17789 - v17795 = array_get v17792, index v17791 - v17796 = array_get v17788, index v17791 - v17797 = cast v17789 as Field - v17798 = cast v17794 as Field - v17799 = mul v17797, v17795 - v17800 = mul v17798, v17796 - v17801 = add v17799, v17800 - v17802 = array_set mut v17792, index v17791, value v17801 - enable_side_effects u1 1 - v17803 = array_get v1, index u32 164 - enable_side_effects v17803 - v17804 = array_get v2, index u32 164 - v17805 = cast v17804 as u32 - v17806 = array_set v17802, index v17805, value Field 164 - v17808 = not v17803 - v17809 = array_get v17806, index v17805 - v17810 = array_get v17802, index v17805 - v17811 = cast v17803 as Field - v17812 = cast v17808 as Field - v17813 = mul v17811, v17809 - v17814 = mul v17812, v17810 - v17815 = add v17813, v17814 - v17816 = array_set mut v17806, index v17805, value v17815 - enable_side_effects u1 1 - v17817 = array_get v1, index u32 165 - enable_side_effects v17817 - v17818 = array_get v2, index u32 165 - v17819 = cast v17818 as u32 - v17820 = array_set v17816, index v17819, value Field 165 - v17822 = not v17817 - v17823 = array_get v17820, index v17819 - v17824 = array_get v17816, index v17819 - v17825 = cast v17817 as Field - v17826 = cast v17822 as Field - v17827 = mul v17825, v17823 - v17828 = mul v17826, v17824 - v17829 = add v17827, v17828 - v17830 = array_set mut v17820, index v17819, value v17829 - enable_side_effects u1 1 - v17831 = array_get v1, index u32 166 - enable_side_effects v17831 - v17832 = array_get v2, index u32 166 - v17833 = cast v17832 as u32 - v17834 = array_set v17830, index v17833, value Field 166 - v17836 = not v17831 - v17837 = array_get v17834, index v17833 - v17838 = array_get v17830, index v17833 - v17839 = cast v17831 as Field - v17840 = cast v17836 as Field - v17841 = mul v17839, v17837 - v17842 = mul v17840, v17838 - v17843 = add v17841, v17842 - v17844 = array_set mut v17834, index v17833, value v17843 - enable_side_effects u1 1 - v17845 = array_get v1, index u32 167 - enable_side_effects v17845 - v17846 = array_get v2, index u32 167 - v17847 = cast v17846 as u32 - v17848 = array_set v17844, index v17847, value Field 167 - v17850 = not v17845 - v17851 = array_get v17848, index v17847 - v17852 = array_get v17844, index v17847 - v17853 = cast v17845 as Field - v17854 = cast v17850 as Field - v17855 = mul v17853, v17851 - v17856 = mul v17854, v17852 - v17857 = add v17855, v17856 - v17858 = array_set mut v17848, index v17847, value v17857 - enable_side_effects u1 1 - v17859 = array_get v1, index u32 168 - enable_side_effects v17859 - v17860 = array_get v2, index u32 168 - v17861 = cast v17860 as u32 - v17862 = array_set v17858, index v17861, value Field 168 - v17864 = not v17859 - v17865 = array_get v17862, index v17861 - v17866 = array_get v17858, index v17861 - v17867 = cast v17859 as Field - v17868 = cast v17864 as Field - v17869 = mul v17867, v17865 - v17870 = mul v17868, v17866 - v17871 = add v17869, v17870 - v17872 = array_set mut v17862, index v17861, value v17871 - enable_side_effects u1 1 - v17873 = array_get v1, index u32 169 - enable_side_effects v17873 - v17874 = array_get v2, index u32 169 - v17875 = cast v17874 as u32 - v17876 = array_set v17872, index v17875, value Field 169 - v17878 = not v17873 - v17879 = array_get v17876, index v17875 - v17880 = array_get v17872, index v17875 - v17881 = cast v17873 as Field - v17882 = cast v17878 as Field - v17883 = mul v17881, v17879 - v17884 = mul v17882, v17880 - v17885 = add v17883, v17884 - v17886 = array_set mut v17876, index v17875, value v17885 - enable_side_effects u1 1 - v17887 = array_get v1, index u32 170 - enable_side_effects v17887 - v17888 = array_get v2, index u32 170 - v17889 = cast v17888 as u32 - v17890 = array_set v17886, index v17889, value Field 170 - v17892 = not v17887 - v17893 = array_get v17890, index v17889 - v17894 = array_get v17886, index v17889 - v17895 = cast v17887 as Field - v17896 = cast v17892 as Field - v17897 = mul v17895, v17893 - v17898 = mul v17896, v17894 - v17899 = add v17897, v17898 - v17900 = array_set mut v17890, index v17889, value v17899 - enable_side_effects u1 1 - v17901 = array_get v1, index u32 171 - enable_side_effects v17901 - v17902 = array_get v2, index u32 171 - v17903 = cast v17902 as u32 - v17904 = array_set v17900, index v17903, value Field 171 - v17906 = not v17901 - v17907 = array_get v17904, index v17903 - v17908 = array_get v17900, index v17903 - v17909 = cast v17901 as Field - v17910 = cast v17906 as Field - v17911 = mul v17909, v17907 - v17912 = mul v17910, v17908 - v17913 = add v17911, v17912 - v17914 = array_set mut v17904, index v17903, value v17913 - enable_side_effects u1 1 - v17915 = array_get v1, index u32 172 - enable_side_effects v17915 - v17916 = array_get v2, index u32 172 - v17917 = cast v17916 as u32 - v17918 = array_set v17914, index v17917, value Field 172 - v17920 = not v17915 - v17921 = array_get v17918, index v17917 - v17922 = array_get v17914, index v17917 - v17923 = cast v17915 as Field - v17924 = cast v17920 as Field - v17925 = mul v17923, v17921 - v17926 = mul v17924, v17922 - v17927 = add v17925, v17926 - v17928 = array_set mut v17918, index v17917, value v17927 - enable_side_effects u1 1 - v17929 = array_get v1, index u32 173 - enable_side_effects v17929 - v17930 = array_get v2, index u32 173 - v17931 = cast v17930 as u32 - v17932 = array_set v17928, index v17931, value Field 173 - v17934 = not v17929 - v17935 = array_get v17932, index v17931 - v17936 = array_get v17928, index v17931 - v17937 = cast v17929 as Field - v17938 = cast v17934 as Field - v17939 = mul v17937, v17935 - v17940 = mul v17938, v17936 - v17941 = add v17939, v17940 - v17942 = array_set mut v17932, index v17931, value v17941 - enable_side_effects u1 1 - v17943 = array_get v1, index u32 174 - enable_side_effects v17943 - v17944 = array_get v2, index u32 174 - v17945 = cast v17944 as u32 - v17946 = array_set v17942, index v17945, value Field 174 - v17948 = not v17943 - v17949 = array_get v17946, index v17945 - v17950 = array_get v17942, index v17945 - v17951 = cast v17943 as Field - v17952 = cast v17948 as Field - v17953 = mul v17951, v17949 - v17954 = mul v17952, v17950 - v17955 = add v17953, v17954 - v17956 = array_set mut v17946, index v17945, value v17955 - enable_side_effects u1 1 - v17957 = array_get v1, index u32 175 - enable_side_effects v17957 - v17958 = array_get v2, index u32 175 - v17959 = cast v17958 as u32 - v17960 = array_set v17956, index v17959, value Field 175 - v17962 = not v17957 - v17963 = array_get v17960, index v17959 - v17964 = array_get v17956, index v17959 - v17965 = cast v17957 as Field - v17966 = cast v17962 as Field - v17967 = mul v17965, v17963 - v17968 = mul v17966, v17964 - v17969 = add v17967, v17968 - v17970 = array_set mut v17960, index v17959, value v17969 - enable_side_effects u1 1 - v17971 = array_get v1, index u32 2⁴×11 - enable_side_effects v17971 - v17972 = array_get v2, index u32 2⁴×11 - v17973 = cast v17972 as u32 - v17974 = array_set v17970, index v17973, value Field 2⁴×11 - v17976 = not v17971 - v17977 = array_get v17974, index v17973 - v17978 = array_get v17970, index v17973 - v17979 = cast v17971 as Field - v17980 = cast v17976 as Field - v17981 = mul v17979, v17977 - v17982 = mul v17980, v17978 - v17983 = add v17981, v17982 - v17984 = array_set mut v17974, index v17973, value v17983 - enable_side_effects u1 1 - v17985 = array_get v1, index u32 177 - enable_side_effects v17985 - v17986 = array_get v2, index u32 177 - v17987 = cast v17986 as u32 - v17988 = array_set v17984, index v17987, value Field 177 - v17990 = not v17985 - v17991 = array_get v17988, index v17987 - v17992 = array_get v17984, index v17987 - v17993 = cast v17985 as Field - v17994 = cast v17990 as Field - v17995 = mul v17993, v17991 - v17996 = mul v17994, v17992 - v17997 = add v17995, v17996 - v17998 = array_set mut v17988, index v17987, value v17997 - enable_side_effects u1 1 - v17999 = array_get v1, index u32 178 - enable_side_effects v17999 - v18000 = array_get v2, index u32 178 - v18001 = cast v18000 as u32 - v18002 = array_set v17998, index v18001, value Field 178 - v18004 = not v17999 - v18005 = array_get v18002, index v18001 - v18006 = array_get v17998, index v18001 - v18007 = cast v17999 as Field - v18008 = cast v18004 as Field - v18009 = mul v18007, v18005 - v18010 = mul v18008, v18006 - v18011 = add v18009, v18010 - v18012 = array_set mut v18002, index v18001, value v18011 - enable_side_effects u1 1 - v18013 = array_get v1, index u32 179 - enable_side_effects v18013 - v18014 = array_get v2, index u32 179 - v18015 = cast v18014 as u32 - v18016 = array_set v18012, index v18015, value Field 179 - v18018 = not v18013 - v18019 = array_get v18016, index v18015 - v18020 = array_get v18012, index v18015 - v18021 = cast v18013 as Field - v18022 = cast v18018 as Field - v18023 = mul v18021, v18019 - v18024 = mul v18022, v18020 - v18025 = add v18023, v18024 - v18026 = array_set mut v18016, index v18015, value v18025 - enable_side_effects u1 1 - v18027 = array_get v1, index u32 180 - enable_side_effects v18027 - v18028 = array_get v2, index u32 180 - v18029 = cast v18028 as u32 - v18030 = array_set v18026, index v18029, value Field 180 - v18032 = not v18027 - v18033 = array_get v18030, index v18029 - v18034 = array_get v18026, index v18029 - v18035 = cast v18027 as Field - v18036 = cast v18032 as Field - v18037 = mul v18035, v18033 - v18038 = mul v18036, v18034 - v18039 = add v18037, v18038 - v18040 = array_set mut v18030, index v18029, value v18039 - enable_side_effects u1 1 - v18041 = array_get v1, index u32 181 - enable_side_effects v18041 - v18042 = array_get v2, index u32 181 - v18043 = cast v18042 as u32 - v18044 = array_set v18040, index v18043, value Field 181 - v18046 = not v18041 - v18047 = array_get v18044, index v18043 - v18048 = array_get v18040, index v18043 - v18049 = cast v18041 as Field - v18050 = cast v18046 as Field - v18051 = mul v18049, v18047 - v18052 = mul v18050, v18048 - v18053 = add v18051, v18052 - v18054 = array_set mut v18044, index v18043, value v18053 - enable_side_effects u1 1 - v18055 = array_get v1, index u32 182 - enable_side_effects v18055 - v18056 = array_get v2, index u32 182 - v18057 = cast v18056 as u32 - v18058 = array_set v18054, index v18057, value Field 182 - v18060 = not v18055 - v18061 = array_get v18058, index v18057 - v18062 = array_get v18054, index v18057 - v18063 = cast v18055 as Field - v18064 = cast v18060 as Field - v18065 = mul v18063, v18061 - v18066 = mul v18064, v18062 - v18067 = add v18065, v18066 - v18068 = array_set mut v18058, index v18057, value v18067 - enable_side_effects u1 1 - v18069 = array_get v1, index u32 183 - enable_side_effects v18069 - v18070 = array_get v2, index u32 183 - v18071 = cast v18070 as u32 - v18072 = array_set v18068, index v18071, value Field 183 - v18074 = not v18069 - v18075 = array_get v18072, index v18071 - v18076 = array_get v18068, index v18071 - v18077 = cast v18069 as Field - v18078 = cast v18074 as Field - v18079 = mul v18077, v18075 - v18080 = mul v18078, v18076 - v18081 = add v18079, v18080 - v18082 = array_set mut v18072, index v18071, value v18081 - enable_side_effects u1 1 - v18083 = array_get v1, index u32 184 - enable_side_effects v18083 - v18084 = array_get v2, index u32 184 - v18085 = cast v18084 as u32 - v18086 = array_set v18082, index v18085, value Field 184 - v18088 = not v18083 - v18089 = array_get v18086, index v18085 - v18090 = array_get v18082, index v18085 - v18091 = cast v18083 as Field - v18092 = cast v18088 as Field - v18093 = mul v18091, v18089 - v18094 = mul v18092, v18090 - v18095 = add v18093, v18094 - v18096 = array_set mut v18086, index v18085, value v18095 - enable_side_effects u1 1 - v18097 = array_get v1, index u32 185 - enable_side_effects v18097 - v18098 = array_get v2, index u32 185 - v18099 = cast v18098 as u32 - v18100 = array_set v18096, index v18099, value Field 185 - v18102 = not v18097 - v18103 = array_get v18100, index v18099 - v18104 = array_get v18096, index v18099 - v18105 = cast v18097 as Field - v18106 = cast v18102 as Field - v18107 = mul v18105, v18103 - v18108 = mul v18106, v18104 - v18109 = add v18107, v18108 - v18110 = array_set mut v18100, index v18099, value v18109 - enable_side_effects u1 1 - v18111 = array_get v1, index u32 186 - enable_side_effects v18111 - v18112 = array_get v2, index u32 186 - v18113 = cast v18112 as u32 - v18114 = array_set v18110, index v18113, value Field 186 - v18116 = not v18111 - v18117 = array_get v18114, index v18113 - v18118 = array_get v18110, index v18113 - v18119 = cast v18111 as Field - v18120 = cast v18116 as Field - v18121 = mul v18119, v18117 - v18122 = mul v18120, v18118 - v18123 = add v18121, v18122 - v18124 = array_set mut v18114, index v18113, value v18123 - enable_side_effects u1 1 - v18125 = array_get v1, index u32 187 - enable_side_effects v18125 - v18126 = array_get v2, index u32 187 - v18127 = cast v18126 as u32 - v18128 = array_set v18124, index v18127, value Field 187 - v18130 = not v18125 - v18131 = array_get v18128, index v18127 - v18132 = array_get v18124, index v18127 - v18133 = cast v18125 as Field - v18134 = cast v18130 as Field - v18135 = mul v18133, v18131 - v18136 = mul v18134, v18132 - v18137 = add v18135, v18136 - v18138 = array_set mut v18128, index v18127, value v18137 - enable_side_effects u1 1 - v18139 = array_get v1, index u32 188 - enable_side_effects v18139 - v18140 = array_get v2, index u32 188 - v18141 = cast v18140 as u32 - v18142 = array_set v18138, index v18141, value Field 188 - v18144 = not v18139 - v18145 = array_get v18142, index v18141 - v18146 = array_get v18138, index v18141 - v18147 = cast v18139 as Field - v18148 = cast v18144 as Field - v18149 = mul v18147, v18145 - v18150 = mul v18148, v18146 - v18151 = add v18149, v18150 - v18152 = array_set mut v18142, index v18141, value v18151 - enable_side_effects u1 1 - v18153 = array_get v1, index u32 189 - enable_side_effects v18153 - v18154 = array_get v2, index u32 189 - v18155 = cast v18154 as u32 - v18156 = array_set v18152, index v18155, value Field 189 - v18158 = not v18153 - v18159 = array_get v18156, index v18155 - v18160 = array_get v18152, index v18155 - v18161 = cast v18153 as Field - v18162 = cast v18158 as Field - v18163 = mul v18161, v18159 - v18164 = mul v18162, v18160 - v18165 = add v18163, v18164 - v18166 = array_set mut v18156, index v18155, value v18165 - enable_side_effects u1 1 - v18167 = array_get v1, index u32 190 - enable_side_effects v18167 - v18168 = array_get v2, index u32 190 - v18169 = cast v18168 as u32 - v18170 = array_set v18166, index v18169, value Field 190 - v18172 = not v18167 - v18173 = array_get v18170, index v18169 - v18174 = array_get v18166, index v18169 - v18175 = cast v18167 as Field - v18176 = cast v18172 as Field - v18177 = mul v18175, v18173 - v18178 = mul v18176, v18174 - v18179 = add v18177, v18178 - v18180 = array_set mut v18170, index v18169, value v18179 - enable_side_effects u1 1 - v18181 = array_get v1, index u32 191 - enable_side_effects v18181 - v18182 = array_get v2, index u32 191 - v18183 = cast v18182 as u32 - v18184 = array_set v18180, index v18183, value Field 191 - v18186 = not v18181 - v18187 = array_get v18184, index v18183 - v18188 = array_get v18180, index v18183 - v18189 = cast v18181 as Field - v18190 = cast v18186 as Field - v18191 = mul v18189, v18187 - v18192 = mul v18190, v18188 - v18193 = add v18191, v18192 - v18194 = array_set mut v18184, index v18183, value v18193 - enable_side_effects u1 1 - v18195 = array_get v1, index u32 2⁴×12 - enable_side_effects v18195 - v18196 = array_get v2, index u32 2⁴×12 - v18197 = cast v18196 as u32 - v18198 = array_set v18194, index v18197, value Field 2⁴×12 - v18200 = not v18195 - v18201 = array_get v18198, index v18197 - v18202 = array_get v18194, index v18197 - v18203 = cast v18195 as Field - v18204 = cast v18200 as Field - v18205 = mul v18203, v18201 - v18206 = mul v18204, v18202 - v18207 = add v18205, v18206 - v18208 = array_set mut v18198, index v18197, value v18207 - enable_side_effects u1 1 - v18209 = array_get v1, index u32 193 - enable_side_effects v18209 - v18210 = array_get v2, index u32 193 - v18211 = cast v18210 as u32 - v18212 = array_set v18208, index v18211, value Field 193 - v18214 = not v18209 - v18215 = array_get v18212, index v18211 - v18216 = array_get v18208, index v18211 - v18217 = cast v18209 as Field - v18218 = cast v18214 as Field - v18219 = mul v18217, v18215 - v18220 = mul v18218, v18216 - v18221 = add v18219, v18220 - v18222 = array_set mut v18212, index v18211, value v18221 - enable_side_effects u1 1 - v18223 = array_get v1, index u32 194 - enable_side_effects v18223 - v18224 = array_get v2, index u32 194 - v18225 = cast v18224 as u32 - v18226 = array_set v18222, index v18225, value Field 194 - v18228 = not v18223 - v18229 = array_get v18226, index v18225 - v18230 = array_get v18222, index v18225 - v18231 = cast v18223 as Field - v18232 = cast v18228 as Field - v18233 = mul v18231, v18229 - v18234 = mul v18232, v18230 - v18235 = add v18233, v18234 - v18236 = array_set mut v18226, index v18225, value v18235 - enable_side_effects u1 1 - v18237 = array_get v1, index u32 195 - enable_side_effects v18237 - v18238 = array_get v2, index u32 195 - v18239 = cast v18238 as u32 - v18240 = array_set v18236, index v18239, value Field 195 - v18242 = not v18237 - v18243 = array_get v18240, index v18239 - v18244 = array_get v18236, index v18239 - v18245 = cast v18237 as Field - v18246 = cast v18242 as Field - v18247 = mul v18245, v18243 - v18248 = mul v18246, v18244 - v18249 = add v18247, v18248 - v18250 = array_set mut v18240, index v18239, value v18249 - enable_side_effects u1 1 - v18251 = array_get v1, index u32 196 - enable_side_effects v18251 - v18252 = array_get v2, index u32 196 - v18253 = cast v18252 as u32 - v18254 = array_set v18250, index v18253, value Field 196 - v18256 = not v18251 - v18257 = array_get v18254, index v18253 - v18258 = array_get v18250, index v18253 - v18259 = cast v18251 as Field - v18260 = cast v18256 as Field - v18261 = mul v18259, v18257 - v18262 = mul v18260, v18258 - v18263 = add v18261, v18262 - v18264 = array_set mut v18254, index v18253, value v18263 - enable_side_effects u1 1 - v18265 = array_get v1, index u32 197 - enable_side_effects v18265 - v18266 = array_get v2, index u32 197 - v18267 = cast v18266 as u32 - v18268 = array_set v18264, index v18267, value Field 197 - v18270 = not v18265 - v18271 = array_get v18268, index v18267 - v18272 = array_get v18264, index v18267 - v18273 = cast v18265 as Field - v18274 = cast v18270 as Field - v18275 = mul v18273, v18271 - v18276 = mul v18274, v18272 - v18277 = add v18275, v18276 - v18278 = array_set mut v18268, index v18267, value v18277 - enable_side_effects u1 1 - v18279 = array_get v1, index u32 198 - enable_side_effects v18279 - v18280 = array_get v2, index u32 198 - v18281 = cast v18280 as u32 - v18282 = array_set v18278, index v18281, value Field 198 - v18284 = not v18279 - v18285 = array_get v18282, index v18281 - v18286 = array_get v18278, index v18281 - v18287 = cast v18279 as Field - v18288 = cast v18284 as Field - v18289 = mul v18287, v18285 - v18290 = mul v18288, v18286 - v18291 = add v18289, v18290 - v18292 = array_set mut v18282, index v18281, value v18291 - enable_side_effects u1 1 - v18293 = array_get v1, index u32 199 - enable_side_effects v18293 - v18294 = array_get v2, index u32 199 - v18295 = cast v18294 as u32 - v18296 = array_set v18292, index v18295, value Field 199 - v18298 = not v18293 - v18299 = array_get v18296, index v18295 - v18300 = array_get v18292, index v18295 - v18301 = cast v18293 as Field - v18302 = cast v18298 as Field - v18303 = mul v18301, v18299 - v18304 = mul v18302, v18300 - v18305 = add v18303, v18304 - v18306 = array_set mut v18296, index v18295, value v18305 - enable_side_effects u1 1 - v18307 = array_get v1, index u32 200 - enable_side_effects v18307 - v18308 = array_get v2, index u32 200 - v18309 = cast v18308 as u32 - v18310 = array_set v18306, index v18309, value Field 200 - v18312 = not v18307 - v18313 = array_get v18310, index v18309 - v18314 = array_get v18306, index v18309 - v18315 = cast v18307 as Field - v18316 = cast v18312 as Field - v18317 = mul v18315, v18313 - v18318 = mul v18316, v18314 - v18319 = add v18317, v18318 - v18320 = array_set mut v18310, index v18309, value v18319 - enable_side_effects u1 1 - v18321 = array_get v1, index u32 201 - enable_side_effects v18321 - v18322 = array_get v2, index u32 201 - v18323 = cast v18322 as u32 - v18324 = array_set v18320, index v18323, value Field 201 - v18326 = not v18321 - v18327 = array_get v18324, index v18323 - v18328 = array_get v18320, index v18323 - v18329 = cast v18321 as Field - v18330 = cast v18326 as Field - v18331 = mul v18329, v18327 - v18332 = mul v18330, v18328 - v18333 = add v18331, v18332 - v18334 = array_set mut v18324, index v18323, value v18333 - enable_side_effects u1 1 - v18335 = array_get v1, index u32 202 - enable_side_effects v18335 - v18336 = array_get v2, index u32 202 - v18337 = cast v18336 as u32 - v18338 = array_set v18334, index v18337, value Field 202 - v18340 = not v18335 - v18341 = array_get v18338, index v18337 - v18342 = array_get v18334, index v18337 - v18343 = cast v18335 as Field - v18344 = cast v18340 as Field - v18345 = mul v18343, v18341 - v18346 = mul v18344, v18342 - v18347 = add v18345, v18346 - v18348 = array_set mut v18338, index v18337, value v18347 - enable_side_effects u1 1 - v18349 = array_get v1, index u32 203 - enable_side_effects v18349 - v18350 = array_get v2, index u32 203 - v18351 = cast v18350 as u32 - v18352 = array_set v18348, index v18351, value Field 203 - v18354 = not v18349 - v18355 = array_get v18352, index v18351 - v18356 = array_get v18348, index v18351 - v18357 = cast v18349 as Field - v18358 = cast v18354 as Field - v18359 = mul v18357, v18355 - v18360 = mul v18358, v18356 - v18361 = add v18359, v18360 - v18362 = array_set mut v18352, index v18351, value v18361 - enable_side_effects u1 1 - v18363 = array_get v1, index u32 204 - enable_side_effects v18363 - v18364 = array_get v2, index u32 204 - v18365 = cast v18364 as u32 - v18366 = array_set v18362, index v18365, value Field 204 - v18368 = not v18363 - v18369 = array_get v18366, index v18365 - v18370 = array_get v18362, index v18365 - v18371 = cast v18363 as Field - v18372 = cast v18368 as Field - v18373 = mul v18371, v18369 - v18374 = mul v18372, v18370 - v18375 = add v18373, v18374 - v18376 = array_set mut v18366, index v18365, value v18375 - enable_side_effects u1 1 - v18377 = array_get v1, index u32 205 - enable_side_effects v18377 - v18378 = array_get v2, index u32 205 - v18379 = cast v18378 as u32 - v18380 = array_set v18376, index v18379, value Field 205 - v18382 = not v18377 - v18383 = array_get v18380, index v18379 - v18384 = array_get v18376, index v18379 - v18385 = cast v18377 as Field - v18386 = cast v18382 as Field - v18387 = mul v18385, v18383 - v18388 = mul v18386, v18384 - v18389 = add v18387, v18388 - v18390 = array_set mut v18380, index v18379, value v18389 - enable_side_effects u1 1 - v18391 = array_get v1, index u32 206 - enable_side_effects v18391 - v18392 = array_get v2, index u32 206 - v18393 = cast v18392 as u32 - v18394 = array_set v18390, index v18393, value Field 206 - v18396 = not v18391 - v18397 = array_get v18394, index v18393 - v18398 = array_get v18390, index v18393 - v18399 = cast v18391 as Field - v18400 = cast v18396 as Field - v18401 = mul v18399, v18397 - v18402 = mul v18400, v18398 - v18403 = add v18401, v18402 - v18404 = array_set mut v18394, index v18393, value v18403 - enable_side_effects u1 1 - v18405 = array_get v1, index u32 207 - enable_side_effects v18405 - v18406 = array_get v2, index u32 207 - v18407 = cast v18406 as u32 - v18408 = array_set v18404, index v18407, value Field 207 - v18410 = not v18405 - v18411 = array_get v18408, index v18407 - v18412 = array_get v18404, index v18407 - v18413 = cast v18405 as Field - v18414 = cast v18410 as Field - v18415 = mul v18413, v18411 - v18416 = mul v18414, v18412 - v18417 = add v18415, v18416 - v18418 = array_set mut v18408, index v18407, value v18417 - enable_side_effects u1 1 - v18419 = array_get v1, index u32 2⁴×13 - enable_side_effects v18419 - v18420 = array_get v2, index u32 2⁴×13 - v18421 = cast v18420 as u32 - v18422 = array_set v18418, index v18421, value Field 2⁴×13 - v18424 = not v18419 - v18425 = array_get v18422, index v18421 - v18426 = array_get v18418, index v18421 - v18427 = cast v18419 as Field - v18428 = cast v18424 as Field - v18429 = mul v18427, v18425 - v18430 = mul v18428, v18426 - v18431 = add v18429, v18430 - v18432 = array_set mut v18422, index v18421, value v18431 - enable_side_effects u1 1 - v18433 = array_get v1, index u32 209 - enable_side_effects v18433 - v18434 = array_get v2, index u32 209 - v18435 = cast v18434 as u32 - v18436 = array_set v18432, index v18435, value Field 209 - v18438 = not v18433 - v18439 = array_get v18436, index v18435 - v18440 = array_get v18432, index v18435 - v18441 = cast v18433 as Field - v18442 = cast v18438 as Field - v18443 = mul v18441, v18439 - v18444 = mul v18442, v18440 - v18445 = add v18443, v18444 - v18446 = array_set mut v18436, index v18435, value v18445 - enable_side_effects u1 1 - v18447 = array_get v1, index u32 210 - enable_side_effects v18447 - v18448 = array_get v2, index u32 210 - v18449 = cast v18448 as u32 - v18450 = array_set v18446, index v18449, value Field 210 - v18452 = not v18447 - v18453 = array_get v18450, index v18449 - v18454 = array_get v18446, index v18449 - v18455 = cast v18447 as Field - v18456 = cast v18452 as Field - v18457 = mul v18455, v18453 - v18458 = mul v18456, v18454 - v18459 = add v18457, v18458 - v18460 = array_set mut v18450, index v18449, value v18459 - enable_side_effects u1 1 - v18461 = array_get v1, index u32 211 - enable_side_effects v18461 - v18462 = array_get v2, index u32 211 - v18463 = cast v18462 as u32 - v18464 = array_set v18460, index v18463, value Field 211 - v18466 = not v18461 - v18467 = array_get v18464, index v18463 - v18468 = array_get v18460, index v18463 - v18469 = cast v18461 as Field - v18470 = cast v18466 as Field - v18471 = mul v18469, v18467 - v18472 = mul v18470, v18468 - v18473 = add v18471, v18472 - v18474 = array_set mut v18464, index v18463, value v18473 - enable_side_effects u1 1 - v18475 = array_get v1, index u32 212 - enable_side_effects v18475 - v18476 = array_get v2, index u32 212 - v18477 = cast v18476 as u32 - v18478 = array_set v18474, index v18477, value Field 212 - v18480 = not v18475 - v18481 = array_get v18478, index v18477 - v18482 = array_get v18474, index v18477 - v18483 = cast v18475 as Field - v18484 = cast v18480 as Field - v18485 = mul v18483, v18481 - v18486 = mul v18484, v18482 - v18487 = add v18485, v18486 - v18488 = array_set mut v18478, index v18477, value v18487 - enable_side_effects u1 1 - v18489 = array_get v1, index u32 213 - enable_side_effects v18489 - v18490 = array_get v2, index u32 213 - v18491 = cast v18490 as u32 - v18492 = array_set v18488, index v18491, value Field 213 - v18494 = not v18489 - v18495 = array_get v18492, index v18491 - v18496 = array_get v18488, index v18491 - v18497 = cast v18489 as Field - v18498 = cast v18494 as Field - v18499 = mul v18497, v18495 - v18500 = mul v18498, v18496 - v18501 = add v18499, v18500 - v18502 = array_set mut v18492, index v18491, value v18501 - enable_side_effects u1 1 - v18503 = array_get v1, index u32 214 - enable_side_effects v18503 - v18504 = array_get v2, index u32 214 - v18505 = cast v18504 as u32 - v18506 = array_set v18502, index v18505, value Field 214 - v18508 = not v18503 - v18509 = array_get v18506, index v18505 - v18510 = array_get v18502, index v18505 - v18511 = cast v18503 as Field - v18512 = cast v18508 as Field - v18513 = mul v18511, v18509 - v18514 = mul v18512, v18510 - v18515 = add v18513, v18514 - v18516 = array_set mut v18506, index v18505, value v18515 - enable_side_effects u1 1 - v18517 = array_get v1, index u32 215 - enable_side_effects v18517 - v18518 = array_get v2, index u32 215 - v18519 = cast v18518 as u32 - v18520 = array_set v18516, index v18519, value Field 215 - v18522 = not v18517 - v18523 = array_get v18520, index v18519 - v18524 = array_get v18516, index v18519 - v18525 = cast v18517 as Field - v18526 = cast v18522 as Field - v18527 = mul v18525, v18523 - v18528 = mul v18526, v18524 - v18529 = add v18527, v18528 - v18530 = array_set mut v18520, index v18519, value v18529 - enable_side_effects u1 1 - v18531 = array_get v1, index u32 216 - enable_side_effects v18531 - v18532 = array_get v2, index u32 216 - v18533 = cast v18532 as u32 - v18534 = array_set v18530, index v18533, value Field 216 - v18536 = not v18531 - v18537 = array_get v18534, index v18533 - v18538 = array_get v18530, index v18533 - v18539 = cast v18531 as Field - v18540 = cast v18536 as Field - v18541 = mul v18539, v18537 - v18542 = mul v18540, v18538 - v18543 = add v18541, v18542 - v18544 = array_set mut v18534, index v18533, value v18543 - enable_side_effects u1 1 - v18545 = array_get v1, index u32 217 - enable_side_effects v18545 - v18546 = array_get v2, index u32 217 - v18547 = cast v18546 as u32 - v18548 = array_set v18544, index v18547, value Field 217 - v18550 = not v18545 - v18551 = array_get v18548, index v18547 - v18552 = array_get v18544, index v18547 - v18553 = cast v18545 as Field - v18554 = cast v18550 as Field - v18555 = mul v18553, v18551 - v18556 = mul v18554, v18552 - v18557 = add v18555, v18556 - v18558 = array_set mut v18548, index v18547, value v18557 - enable_side_effects u1 1 - v18559 = array_get v1, index u32 218 - enable_side_effects v18559 - v18560 = array_get v2, index u32 218 - v18561 = cast v18560 as u32 - v18562 = array_set v18558, index v18561, value Field 218 - v18564 = not v18559 - v18565 = array_get v18562, index v18561 - v18566 = array_get v18558, index v18561 - v18567 = cast v18559 as Field - v18568 = cast v18564 as Field - v18569 = mul v18567, v18565 - v18570 = mul v18568, v18566 - v18571 = add v18569, v18570 - v18572 = array_set mut v18562, index v18561, value v18571 - enable_side_effects u1 1 - v18573 = array_get v1, index u32 219 - enable_side_effects v18573 - v18574 = array_get v2, index u32 219 - v18575 = cast v18574 as u32 - v18576 = array_set v18572, index v18575, value Field 219 - v18578 = not v18573 - v18579 = array_get v18576, index v18575 - v18580 = array_get v18572, index v18575 - v18581 = cast v18573 as Field - v18582 = cast v18578 as Field - v18583 = mul v18581, v18579 - v18584 = mul v18582, v18580 - v18585 = add v18583, v18584 - v18586 = array_set mut v18576, index v18575, value v18585 - enable_side_effects u1 1 - v18587 = array_get v1, index u32 220 - enable_side_effects v18587 - v18588 = array_get v2, index u32 220 - v18589 = cast v18588 as u32 - v18590 = array_set v18586, index v18589, value Field 220 - v18592 = not v18587 - v18593 = array_get v18590, index v18589 - v18594 = array_get v18586, index v18589 - v18595 = cast v18587 as Field - v18596 = cast v18592 as Field - v18597 = mul v18595, v18593 - v18598 = mul v18596, v18594 - v18599 = add v18597, v18598 - v18600 = array_set mut v18590, index v18589, value v18599 - enable_side_effects u1 1 - v18601 = array_get v1, index u32 221 - enable_side_effects v18601 - v18602 = array_get v2, index u32 221 - v18603 = cast v18602 as u32 - v18604 = array_set v18600, index v18603, value Field 221 - v18606 = not v18601 - v18607 = array_get v18604, index v18603 - v18608 = array_get v18600, index v18603 - v18609 = cast v18601 as Field - v18610 = cast v18606 as Field - v18611 = mul v18609, v18607 - v18612 = mul v18610, v18608 - v18613 = add v18611, v18612 - v18614 = array_set mut v18604, index v18603, value v18613 - enable_side_effects u1 1 - v18615 = array_get v1, index u32 222 - enable_side_effects v18615 - v18616 = array_get v2, index u32 222 - v18617 = cast v18616 as u32 - v18618 = array_set v18614, index v18617, value Field 222 - v18620 = not v18615 - v18621 = array_get v18618, index v18617 - v18622 = array_get v18614, index v18617 - v18623 = cast v18615 as Field - v18624 = cast v18620 as Field - v18625 = mul v18623, v18621 - v18626 = mul v18624, v18622 - v18627 = add v18625, v18626 - v18628 = array_set mut v18618, index v18617, value v18627 - enable_side_effects u1 1 - v18629 = array_get v1, index u32 223 - enable_side_effects v18629 - v18630 = array_get v2, index u32 223 - v18631 = cast v18630 as u32 - v18632 = array_set v18628, index v18631, value Field 223 - v18634 = not v18629 - v18635 = array_get v18632, index v18631 - v18636 = array_get v18628, index v18631 - v18637 = cast v18629 as Field - v18638 = cast v18634 as Field - v18639 = mul v18637, v18635 - v18640 = mul v18638, v18636 - v18641 = add v18639, v18640 - v18642 = array_set mut v18632, index v18631, value v18641 - enable_side_effects u1 1 - v18643 = array_get v1, index u32 2⁴×14 - enable_side_effects v18643 - v18644 = array_get v2, index u32 2⁴×14 - v18645 = cast v18644 as u32 - v18646 = array_set v18642, index v18645, value Field 2⁴×14 - v18648 = not v18643 - v18649 = array_get v18646, index v18645 - v18650 = array_get v18642, index v18645 - v18651 = cast v18643 as Field - v18652 = cast v18648 as Field - v18653 = mul v18651, v18649 - v18654 = mul v18652, v18650 - v18655 = add v18653, v18654 - v18656 = array_set mut v18646, index v18645, value v18655 - enable_side_effects u1 1 - v18657 = array_get v1, index u32 225 - enable_side_effects v18657 - v18658 = array_get v2, index u32 225 - v18659 = cast v18658 as u32 - v18660 = array_set v18656, index v18659, value Field 225 - v18662 = not v18657 - v18663 = array_get v18660, index v18659 - v18664 = array_get v18656, index v18659 - v18665 = cast v18657 as Field - v18666 = cast v18662 as Field - v18667 = mul v18665, v18663 - v18668 = mul v18666, v18664 - v18669 = add v18667, v18668 - v18670 = array_set mut v18660, index v18659, value v18669 - enable_side_effects u1 1 - v18671 = array_get v1, index u32 226 - enable_side_effects v18671 - v18672 = array_get v2, index u32 226 - v18673 = cast v18672 as u32 - v18674 = array_set v18670, index v18673, value Field 226 - v18676 = not v18671 - v18677 = array_get v18674, index v18673 - v18678 = array_get v18670, index v18673 - v18679 = cast v18671 as Field - v18680 = cast v18676 as Field - v18681 = mul v18679, v18677 - v18682 = mul v18680, v18678 - v18683 = add v18681, v18682 - v18684 = array_set mut v18674, index v18673, value v18683 - enable_side_effects u1 1 - v18685 = array_get v1, index u32 227 - enable_side_effects v18685 - v18686 = array_get v2, index u32 227 - v18687 = cast v18686 as u32 - v18688 = array_set v18684, index v18687, value Field 227 - v18690 = not v18685 - v18691 = array_get v18688, index v18687 - v18692 = array_get v18684, index v18687 - v18693 = cast v18685 as Field - v18694 = cast v18690 as Field - v18695 = mul v18693, v18691 - v18696 = mul v18694, v18692 - v18697 = add v18695, v18696 - v18698 = array_set mut v18688, index v18687, value v18697 - enable_side_effects u1 1 - v18699 = array_get v1, index u32 228 - enable_side_effects v18699 - v18700 = array_get v2, index u32 228 - v18701 = cast v18700 as u32 - v18702 = array_set v18698, index v18701, value Field 228 - v18704 = not v18699 - v18705 = array_get v18702, index v18701 - v18706 = array_get v18698, index v18701 - v18707 = cast v18699 as Field - v18708 = cast v18704 as Field - v18709 = mul v18707, v18705 - v18710 = mul v18708, v18706 - v18711 = add v18709, v18710 - v18712 = array_set mut v18702, index v18701, value v18711 - enable_side_effects u1 1 - v18713 = array_get v1, index u32 229 - enable_side_effects v18713 - v18714 = array_get v2, index u32 229 - v18715 = cast v18714 as u32 - v18716 = array_set v18712, index v18715, value Field 229 - v18718 = not v18713 - v18719 = array_get v18716, index v18715 - v18720 = array_get v18712, index v18715 - v18721 = cast v18713 as Field - v18722 = cast v18718 as Field - v18723 = mul v18721, v18719 - v18724 = mul v18722, v18720 - v18725 = add v18723, v18724 - v18726 = array_set mut v18716, index v18715, value v18725 - enable_side_effects u1 1 - v18727 = array_get v1, index u32 230 - enable_side_effects v18727 - v18728 = array_get v2, index u32 230 - v18729 = cast v18728 as u32 - v18730 = array_set v18726, index v18729, value Field 230 - v18732 = not v18727 - v18733 = array_get v18730, index v18729 - v18734 = array_get v18726, index v18729 - v18735 = cast v18727 as Field - v18736 = cast v18732 as Field - v18737 = mul v18735, v18733 - v18738 = mul v18736, v18734 - v18739 = add v18737, v18738 - v18740 = array_set mut v18730, index v18729, value v18739 - enable_side_effects u1 1 - v18741 = array_get v1, index u32 231 - enable_side_effects v18741 - v18742 = array_get v2, index u32 231 - v18743 = cast v18742 as u32 - v18744 = array_set v18740, index v18743, value Field 231 - v18746 = not v18741 - v18747 = array_get v18744, index v18743 - v18748 = array_get v18740, index v18743 - v18749 = cast v18741 as Field - v18750 = cast v18746 as Field - v18751 = mul v18749, v18747 - v18752 = mul v18750, v18748 - v18753 = add v18751, v18752 - v18754 = array_set mut v18744, index v18743, value v18753 - enable_side_effects u1 1 - v18755 = array_get v1, index u32 232 - enable_side_effects v18755 - v18756 = array_get v2, index u32 232 - v18757 = cast v18756 as u32 - v18758 = array_set v18754, index v18757, value Field 232 - v18760 = not v18755 - v18761 = array_get v18758, index v18757 - v18762 = array_get v18754, index v18757 - v18763 = cast v18755 as Field - v18764 = cast v18760 as Field - v18765 = mul v18763, v18761 - v18766 = mul v18764, v18762 - v18767 = add v18765, v18766 - v18768 = array_set mut v18758, index v18757, value v18767 - enable_side_effects u1 1 - v18769 = array_get v1, index u32 233 - enable_side_effects v18769 - v18770 = array_get v2, index u32 233 - v18771 = cast v18770 as u32 - v18772 = array_set v18768, index v18771, value Field 233 - v18774 = not v18769 - v18775 = array_get v18772, index v18771 - v18776 = array_get v18768, index v18771 - v18777 = cast v18769 as Field - v18778 = cast v18774 as Field - v18779 = mul v18777, v18775 - v18780 = mul v18778, v18776 - v18781 = add v18779, v18780 - v18782 = array_set mut v18772, index v18771, value v18781 - enable_side_effects u1 1 - v18783 = array_get v1, index u32 234 - enable_side_effects v18783 - v18784 = array_get v2, index u32 234 - v18785 = cast v18784 as u32 - v18786 = array_set v18782, index v18785, value Field 234 - v18788 = not v18783 - v18789 = array_get v18786, index v18785 - v18790 = array_get v18782, index v18785 - v18791 = cast v18783 as Field - v18792 = cast v18788 as Field - v18793 = mul v18791, v18789 - v18794 = mul v18792, v18790 - v18795 = add v18793, v18794 - v18796 = array_set mut v18786, index v18785, value v18795 - enable_side_effects u1 1 - v18797 = array_get v1, index u32 235 - enable_side_effects v18797 - v18798 = array_get v2, index u32 235 - v18799 = cast v18798 as u32 - v18800 = array_set v18796, index v18799, value Field 235 - v18802 = not v18797 - v18803 = array_get v18800, index v18799 - v18804 = array_get v18796, index v18799 - v18805 = cast v18797 as Field - v18806 = cast v18802 as Field - v18807 = mul v18805, v18803 - v18808 = mul v18806, v18804 - v18809 = add v18807, v18808 - v18810 = array_set mut v18800, index v18799, value v18809 - enable_side_effects u1 1 - v18811 = array_get v1, index u32 236 - enable_side_effects v18811 - v18812 = array_get v2, index u32 236 - v18813 = cast v18812 as u32 - v18814 = array_set v18810, index v18813, value Field 236 - v18816 = not v18811 - v18817 = array_get v18814, index v18813 - v18818 = array_get v18810, index v18813 - v18819 = cast v18811 as Field - v18820 = cast v18816 as Field - v18821 = mul v18819, v18817 - v18822 = mul v18820, v18818 - v18823 = add v18821, v18822 - v18824 = array_set mut v18814, index v18813, value v18823 - enable_side_effects u1 1 - v18825 = array_get v1, index u32 237 - enable_side_effects v18825 - v18826 = array_get v2, index u32 237 - v18827 = cast v18826 as u32 - v18828 = array_set v18824, index v18827, value Field 237 - v18830 = not v18825 - v18831 = array_get v18828, index v18827 - v18832 = array_get v18824, index v18827 - v18833 = cast v18825 as Field - v18834 = cast v18830 as Field - v18835 = mul v18833, v18831 - v18836 = mul v18834, v18832 - v18837 = add v18835, v18836 - v18838 = array_set mut v18828, index v18827, value v18837 - enable_side_effects u1 1 - v18839 = array_get v1, index u32 238 - enable_side_effects v18839 - v18840 = array_get v2, index u32 238 - v18841 = cast v18840 as u32 - v18842 = array_set v18838, index v18841, value Field 238 - v18844 = not v18839 - v18845 = array_get v18842, index v18841 - v18846 = array_get v18838, index v18841 - v18847 = cast v18839 as Field - v18848 = cast v18844 as Field - v18849 = mul v18847, v18845 - v18850 = mul v18848, v18846 - v18851 = add v18849, v18850 - v18852 = array_set mut v18842, index v18841, value v18851 - enable_side_effects u1 1 - v18853 = array_get v1, index u32 239 - enable_side_effects v18853 - v18854 = array_get v2, index u32 239 - v18855 = cast v18854 as u32 - v18856 = array_set v18852, index v18855, value Field 239 - v18858 = not v18853 - v18859 = array_get v18856, index v18855 - v18860 = array_get v18852, index v18855 - v18861 = cast v18853 as Field - v18862 = cast v18858 as Field - v18863 = mul v18861, v18859 - v18864 = mul v18862, v18860 - v18865 = add v18863, v18864 - v18866 = array_set mut v18856, index v18855, value v18865 - enable_side_effects u1 1 - v18867 = array_get v1, index u32 2⁴×15 - enable_side_effects v18867 - v18868 = array_get v2, index u32 2⁴×15 - v18869 = cast v18868 as u32 - v18870 = array_set v18866, index v18869, value Field 2⁴×15 - v18872 = not v18867 - v18873 = array_get v18870, index v18869 - v18874 = array_get v18866, index v18869 - v18875 = cast v18867 as Field - v18876 = cast v18872 as Field - v18877 = mul v18875, v18873 - v18878 = mul v18876, v18874 - v18879 = add v18877, v18878 - v18880 = array_set mut v18870, index v18869, value v18879 - enable_side_effects u1 1 - v18881 = array_get v1, index u32 241 - enable_side_effects v18881 - v18882 = array_get v2, index u32 241 - v18883 = cast v18882 as u32 - v18884 = array_set v18880, index v18883, value Field 241 - v18886 = not v18881 - v18887 = array_get v18884, index v18883 - v18888 = array_get v18880, index v18883 - v18889 = cast v18881 as Field - v18890 = cast v18886 as Field - v18891 = mul v18889, v18887 - v18892 = mul v18890, v18888 - v18893 = add v18891, v18892 - v18894 = array_set mut v18884, index v18883, value v18893 - enable_side_effects u1 1 - v18895 = array_get v1, index u32 242 - enable_side_effects v18895 - v18896 = array_get v2, index u32 242 - v18897 = cast v18896 as u32 - v18898 = array_set v18894, index v18897, value Field 242 - v18900 = not v18895 - v18901 = array_get v18898, index v18897 - v18902 = array_get v18894, index v18897 - v18903 = cast v18895 as Field - v18904 = cast v18900 as Field - v18905 = mul v18903, v18901 - v18906 = mul v18904, v18902 - v18907 = add v18905, v18906 - v18908 = array_set mut v18898, index v18897, value v18907 - enable_side_effects u1 1 - v18909 = array_get v1, index u32 243 - enable_side_effects v18909 - v18910 = array_get v2, index u32 243 - v18911 = cast v18910 as u32 - v18912 = array_set v18908, index v18911, value Field 243 - v18914 = not v18909 - v18915 = array_get v18912, index v18911 - v18916 = array_get v18908, index v18911 - v18917 = cast v18909 as Field - v18918 = cast v18914 as Field - v18919 = mul v18917, v18915 - v18920 = mul v18918, v18916 - v18921 = add v18919, v18920 - v18922 = array_set mut v18912, index v18911, value v18921 - enable_side_effects u1 1 - v18923 = array_get v1, index u32 244 - enable_side_effects v18923 - v18924 = array_get v2, index u32 244 - v18925 = cast v18924 as u32 - v18926 = array_set v18922, index v18925, value Field 244 - v18928 = not v18923 - v18929 = array_get v18926, index v18925 - v18930 = array_get v18922, index v18925 - v18931 = cast v18923 as Field - v18932 = cast v18928 as Field - v18933 = mul v18931, v18929 - v18934 = mul v18932, v18930 - v18935 = add v18933, v18934 - v18936 = array_set mut v18926, index v18925, value v18935 - enable_side_effects u1 1 - v18937 = array_get v1, index u32 245 - enable_side_effects v18937 - v18938 = array_get v2, index u32 245 - v18939 = cast v18938 as u32 - v18940 = array_set v18936, index v18939, value Field 245 - v18942 = not v18937 - v18943 = array_get v18940, index v18939 - v18944 = array_get v18936, index v18939 - v18945 = cast v18937 as Field - v18946 = cast v18942 as Field - v18947 = mul v18945, v18943 - v18948 = mul v18946, v18944 - v18949 = add v18947, v18948 - v18950 = array_set mut v18940, index v18939, value v18949 - enable_side_effects u1 1 - v18951 = array_get v1, index u32 246 - enable_side_effects v18951 - v18952 = array_get v2, index u32 246 - v18953 = cast v18952 as u32 - v18954 = array_set v18950, index v18953, value Field 246 - v18956 = not v18951 - v18957 = array_get v18954, index v18953 - v18958 = array_get v18950, index v18953 - v18959 = cast v18951 as Field - v18960 = cast v18956 as Field - v18961 = mul v18959, v18957 - v18962 = mul v18960, v18958 - v18963 = add v18961, v18962 - v18964 = array_set mut v18954, index v18953, value v18963 - enable_side_effects u1 1 - v18965 = array_get v1, index u32 247 - enable_side_effects v18965 - v18966 = array_get v2, index u32 247 - v18967 = cast v18966 as u32 - v18968 = array_set v18964, index v18967, value Field 247 - v18970 = not v18965 - v18971 = array_get v18968, index v18967 - v18972 = array_get v18964, index v18967 - v18973 = cast v18965 as Field - v18974 = cast v18970 as Field - v18975 = mul v18973, v18971 - v18976 = mul v18974, v18972 - v18977 = add v18975, v18976 - v18978 = array_set mut v18968, index v18967, value v18977 - enable_side_effects u1 1 - v18979 = array_get v1, index u32 248 - enable_side_effects v18979 - v18980 = array_get v2, index u32 248 - v18981 = cast v18980 as u32 - v18982 = array_set v18978, index v18981, value Field 248 - v18984 = not v18979 - v18985 = array_get v18982, index v18981 - v18986 = array_get v18978, index v18981 - v18987 = cast v18979 as Field - v18988 = cast v18984 as Field - v18989 = mul v18987, v18985 - v18990 = mul v18988, v18986 - v18991 = add v18989, v18990 - v18992 = array_set mut v18982, index v18981, value v18991 - enable_side_effects u1 1 - v18993 = array_get v1, index u32 249 - enable_side_effects v18993 - v18994 = array_get v2, index u32 249 - v18995 = cast v18994 as u32 - v18996 = array_set v18992, index v18995, value Field 249 - v18998 = not v18993 - v18999 = array_get v18996, index v18995 - v19000 = array_get v18992, index v18995 - v19001 = cast v18993 as Field - v19002 = cast v18998 as Field - v19003 = mul v19001, v18999 - v19004 = mul v19002, v19000 - v19005 = add v19003, v19004 - v19006 = array_set mut v18996, index v18995, value v19005 - enable_side_effects u1 1 - v19007 = array_get v1, index u32 250 - enable_side_effects v19007 - v19008 = array_get v2, index u32 250 - v19009 = cast v19008 as u32 - v19010 = array_set v19006, index v19009, value Field 250 - v19012 = not v19007 - v19013 = array_get v19010, index v19009 - v19014 = array_get v19006, index v19009 - v19015 = cast v19007 as Field - v19016 = cast v19012 as Field - v19017 = mul v19015, v19013 - v19018 = mul v19016, v19014 - v19019 = add v19017, v19018 - v19020 = array_set mut v19010, index v19009, value v19019 - enable_side_effects u1 1 - v19021 = array_get v1, index u32 251 - enable_side_effects v19021 - v19022 = array_get v2, index u32 251 - v19023 = cast v19022 as u32 - v19024 = array_set v19020, index v19023, value Field 251 - v19026 = not v19021 - v19027 = array_get v19024, index v19023 - v19028 = array_get v19020, index v19023 - v19029 = cast v19021 as Field - v19030 = cast v19026 as Field - v19031 = mul v19029, v19027 - v19032 = mul v19030, v19028 - v19033 = add v19031, v19032 - v19034 = array_set mut v19024, index v19023, value v19033 - enable_side_effects u1 1 - v19035 = array_get v1, index u32 252 - enable_side_effects v19035 - v19036 = array_get v2, index u32 252 - v19037 = cast v19036 as u32 - v19038 = array_set v19034, index v19037, value Field 252 - v19040 = not v19035 - v19041 = array_get v19038, index v19037 - v19042 = array_get v19034, index v19037 - v19043 = cast v19035 as Field - v19044 = cast v19040 as Field - v19045 = mul v19043, v19041 - v19046 = mul v19044, v19042 - v19047 = add v19045, v19046 - v19048 = array_set mut v19038, index v19037, value v19047 - enable_side_effects u1 1 - v19049 = array_get v1, index u32 253 - enable_side_effects v19049 - v19050 = array_get v2, index u32 253 - v19051 = cast v19050 as u32 - v19052 = array_set v19048, index v19051, value Field 253 - v19054 = not v19049 - v19055 = array_get v19052, index v19051 - v19056 = array_get v19048, index v19051 - v19057 = cast v19049 as Field - v19058 = cast v19054 as Field - v19059 = mul v19057, v19055 - v19060 = mul v19058, v19056 - v19061 = add v19059, v19060 - v19062 = array_set mut v19052, index v19051, value v19061 - enable_side_effects u1 1 - v19063 = array_get v1, index u32 254 - enable_side_effects v19063 - v19064 = array_get v2, index u32 254 - v19065 = cast v19064 as u32 - v19066 = array_set v19062, index v19065, value Field 254 - v19068 = not v19063 - v19069 = array_get v19066, index v19065 - v19070 = array_get v19062, index v19065 - v19071 = cast v19063 as Field - v19072 = cast v19068 as Field - v19073 = mul v19071, v19069 - v19074 = mul v19072, v19070 - v19075 = add v19073, v19074 - v19076 = array_set mut v19066, index v19065, value v19075 - enable_side_effects u1 1 - v19077 = array_get v1, index u32 255 - enable_side_effects v19077 - v19078 = array_get v2, index u32 255 - v19079 = cast v19078 as u32 - v19080 = array_set v19076, index v19079, value Field 255 - v19082 = not v19077 - v19083 = array_get v19080, index v19079 - v19084 = array_get v19076, index v19079 - v19085 = cast v19077 as Field - v19086 = cast v19082 as Field - v19087 = mul v19085, v19083 - v19088 = mul v19086, v19084 - v19089 = add v19087, v19088 - v19090 = array_set mut v19080, index v19079, value v19089 - enable_side_effects u1 1 - v19091 = array_get v1, index u32 2⁸ - enable_side_effects v19091 - v19092 = array_get v2, index u32 2⁸ - v19093 = cast v19092 as u32 - v19094 = array_set v19090, index v19093, value Field 2⁸ - v19096 = not v19091 - v19097 = array_get v19094, index v19093 - v19098 = array_get v19090, index v19093 - v19099 = cast v19091 as Field - v19100 = cast v19096 as Field - v19101 = mul v19099, v19097 - v19102 = mul v19100, v19098 - v19103 = add v19101, v19102 - v19104 = array_set mut v19094, index v19093, value v19103 - enable_side_effects u1 1 - v19105 = array_get v1, index u32 257 - enable_side_effects v19105 - v19106 = array_get v2, index u32 257 - v19107 = cast v19106 as u32 - v19108 = array_set v19104, index v19107, value Field 257 - v19110 = not v19105 - v19111 = array_get v19108, index v19107 - v19112 = array_get v19104, index v19107 - v19113 = cast v19105 as Field - v19114 = cast v19110 as Field - v19115 = mul v19113, v19111 - v19116 = mul v19114, v19112 - v19117 = add v19115, v19116 - v19118 = array_set mut v19108, index v19107, value v19117 - enable_side_effects u1 1 - v19119 = array_get v1, index u32 258 - enable_side_effects v19119 - v19120 = array_get v2, index u32 258 - v19121 = cast v19120 as u32 - v19122 = array_set v19118, index v19121, value Field 258 - v19124 = not v19119 - v19125 = array_get v19122, index v19121 - v19126 = array_get v19118, index v19121 - v19127 = cast v19119 as Field - v19128 = cast v19124 as Field - v19129 = mul v19127, v19125 - v19130 = mul v19128, v19126 - v19131 = add v19129, v19130 - v19132 = array_set mut v19122, index v19121, value v19131 - enable_side_effects u1 1 - v19133 = array_get v1, index u32 259 - enable_side_effects v19133 - v19134 = array_get v2, index u32 259 - v19135 = cast v19134 as u32 - v19136 = array_set v19132, index v19135, value Field 259 - v19138 = not v19133 - v19139 = array_get v19136, index v19135 - v19140 = array_get v19132, index v19135 - v19141 = cast v19133 as Field - v19142 = cast v19138 as Field - v19143 = mul v19141, v19139 - v19144 = mul v19142, v19140 - v19145 = add v19143, v19144 - v19146 = array_set mut v19136, index v19135, value v19145 - enable_side_effects u1 1 - v19147 = array_get v1, index u32 260 - enable_side_effects v19147 - v19148 = array_get v2, index u32 260 - v19149 = cast v19148 as u32 - v19150 = array_set v19146, index v19149, value Field 260 - v19152 = not v19147 - v19153 = array_get v19150, index v19149 - v19154 = array_get v19146, index v19149 - v19155 = cast v19147 as Field - v19156 = cast v19152 as Field - v19157 = mul v19155, v19153 - v19158 = mul v19156, v19154 - v19159 = add v19157, v19158 - v19160 = array_set mut v19150, index v19149, value v19159 - enable_side_effects u1 1 - v19161 = array_get v1, index u32 261 - enable_side_effects v19161 - v19162 = array_get v2, index u32 261 - v19163 = cast v19162 as u32 - v19164 = array_set v19160, index v19163, value Field 261 - v19166 = not v19161 - v19167 = array_get v19164, index v19163 - v19168 = array_get v19160, index v19163 - v19169 = cast v19161 as Field - v19170 = cast v19166 as Field - v19171 = mul v19169, v19167 - v19172 = mul v19170, v19168 - v19173 = add v19171, v19172 - v19174 = array_set mut v19164, index v19163, value v19173 - enable_side_effects u1 1 - v19175 = array_get v1, index u32 262 - enable_side_effects v19175 - v19176 = array_get v2, index u32 262 - v19177 = cast v19176 as u32 - v19178 = array_set v19174, index v19177, value Field 262 - v19180 = not v19175 - v19181 = array_get v19178, index v19177 - v19182 = array_get v19174, index v19177 - v19183 = cast v19175 as Field - v19184 = cast v19180 as Field - v19185 = mul v19183, v19181 - v19186 = mul v19184, v19182 - v19187 = add v19185, v19186 - v19188 = array_set mut v19178, index v19177, value v19187 - enable_side_effects u1 1 - v19189 = array_get v1, index u32 263 - enable_side_effects v19189 - v19190 = array_get v2, index u32 263 - v19191 = cast v19190 as u32 - v19192 = array_set v19188, index v19191, value Field 263 - v19194 = not v19189 - v19195 = array_get v19192, index v19191 - v19196 = array_get v19188, index v19191 - v19197 = cast v19189 as Field - v19198 = cast v19194 as Field - v19199 = mul v19197, v19195 - v19200 = mul v19198, v19196 - v19201 = add v19199, v19200 - v19202 = array_set mut v19192, index v19191, value v19201 - enable_side_effects u1 1 - v19203 = array_get v1, index u32 264 - enable_side_effects v19203 - v19204 = array_get v2, index u32 264 - v19205 = cast v19204 as u32 - v19206 = array_set v19202, index v19205, value Field 264 - v19208 = not v19203 - v19209 = array_get v19206, index v19205 - v19210 = array_get v19202, index v19205 - v19211 = cast v19203 as Field - v19212 = cast v19208 as Field - v19213 = mul v19211, v19209 - v19214 = mul v19212, v19210 - v19215 = add v19213, v19214 - v19216 = array_set mut v19206, index v19205, value v19215 - enable_side_effects u1 1 - v19217 = array_get v1, index u32 265 - enable_side_effects v19217 - v19218 = array_get v2, index u32 265 - v19219 = cast v19218 as u32 - v19220 = array_set v19216, index v19219, value Field 265 - v19222 = not v19217 - v19223 = array_get v19220, index v19219 - v19224 = array_get v19216, index v19219 - v19225 = cast v19217 as Field - v19226 = cast v19222 as Field - v19227 = mul v19225, v19223 - v19228 = mul v19226, v19224 - v19229 = add v19227, v19228 - v19230 = array_set mut v19220, index v19219, value v19229 - enable_side_effects u1 1 - v19231 = array_get v1, index u32 266 - enable_side_effects v19231 - v19232 = array_get v2, index u32 266 - v19233 = cast v19232 as u32 - v19234 = array_set v19230, index v19233, value Field 266 - v19236 = not v19231 - v19237 = array_get v19234, index v19233 - v19238 = array_get v19230, index v19233 - v19239 = cast v19231 as Field - v19240 = cast v19236 as Field - v19241 = mul v19239, v19237 - v19242 = mul v19240, v19238 - v19243 = add v19241, v19242 - v19244 = array_set mut v19234, index v19233, value v19243 - enable_side_effects u1 1 - v19245 = array_get v1, index u32 267 - enable_side_effects v19245 - v19246 = array_get v2, index u32 267 - v19247 = cast v19246 as u32 - v19248 = array_set v19244, index v19247, value Field 267 - v19250 = not v19245 - v19251 = array_get v19248, index v19247 - v19252 = array_get v19244, index v19247 - v19253 = cast v19245 as Field - v19254 = cast v19250 as Field - v19255 = mul v19253, v19251 - v19256 = mul v19254, v19252 - v19257 = add v19255, v19256 - v19258 = array_set mut v19248, index v19247, value v19257 - enable_side_effects u1 1 - v19259 = array_get v1, index u32 268 - enable_side_effects v19259 - v19260 = array_get v2, index u32 268 - v19261 = cast v19260 as u32 - v19262 = array_set v19258, index v19261, value Field 268 - v19264 = not v19259 - v19265 = array_get v19262, index v19261 - v19266 = array_get v19258, index v19261 - v19267 = cast v19259 as Field - v19268 = cast v19264 as Field - v19269 = mul v19267, v19265 - v19270 = mul v19268, v19266 - v19271 = add v19269, v19270 - v19272 = array_set mut v19262, index v19261, value v19271 - enable_side_effects u1 1 - v19273 = array_get v1, index u32 269 - enable_side_effects v19273 - v19274 = array_get v2, index u32 269 - v19275 = cast v19274 as u32 - v19276 = array_set v19272, index v19275, value Field 269 - v19278 = not v19273 - v19279 = array_get v19276, index v19275 - v19280 = array_get v19272, index v19275 - v19281 = cast v19273 as Field - v19282 = cast v19278 as Field - v19283 = mul v19281, v19279 - v19284 = mul v19282, v19280 - v19285 = add v19283, v19284 - v19286 = array_set mut v19276, index v19275, value v19285 - enable_side_effects u1 1 - v19287 = array_get v1, index u32 270 - enable_side_effects v19287 - v19288 = array_get v2, index u32 270 - v19289 = cast v19288 as u32 - v19290 = array_set v19286, index v19289, value Field 270 - v19292 = not v19287 - v19293 = array_get v19290, index v19289 - v19294 = array_get v19286, index v19289 - v19295 = cast v19287 as Field - v19296 = cast v19292 as Field - v19297 = mul v19295, v19293 - v19298 = mul v19296, v19294 - v19299 = add v19297, v19298 - v19300 = array_set mut v19290, index v19289, value v19299 - enable_side_effects u1 1 - v19301 = array_get v1, index u32 271 - enable_side_effects v19301 - v19302 = array_get v2, index u32 271 - v19303 = cast v19302 as u32 - v19304 = array_set v19300, index v19303, value Field 271 - v19306 = not v19301 - v19307 = array_get v19304, index v19303 - v19308 = array_get v19300, index v19303 - v19309 = cast v19301 as Field - v19310 = cast v19306 as Field - v19311 = mul v19309, v19307 - v19312 = mul v19310, v19308 - v19313 = add v19311, v19312 - v19314 = array_set mut v19304, index v19303, value v19313 - enable_side_effects u1 1 - v19315 = array_get v1, index u32 2⁴×17 - enable_side_effects v19315 - v19316 = array_get v2, index u32 2⁴×17 - v19317 = cast v19316 as u32 - v19318 = array_set v19314, index v19317, value Field 2⁴×17 - v19320 = not v19315 - v19321 = array_get v19318, index v19317 - v19322 = array_get v19314, index v19317 - v19323 = cast v19315 as Field - v19324 = cast v19320 as Field - v19325 = mul v19323, v19321 - v19326 = mul v19324, v19322 - v19327 = add v19325, v19326 - v19328 = array_set mut v19318, index v19317, value v19327 - enable_side_effects u1 1 - v19329 = array_get v1, index u32 273 - enable_side_effects v19329 - v19330 = array_get v2, index u32 273 - v19331 = cast v19330 as u32 - v19332 = array_set v19328, index v19331, value Field 273 - v19334 = not v19329 - v19335 = array_get v19332, index v19331 - v19336 = array_get v19328, index v19331 - v19337 = cast v19329 as Field - v19338 = cast v19334 as Field - v19339 = mul v19337, v19335 - v19340 = mul v19338, v19336 - v19341 = add v19339, v19340 - v19342 = array_set mut v19332, index v19331, value v19341 - enable_side_effects u1 1 - v19343 = array_get v1, index u32 274 - enable_side_effects v19343 - v19344 = array_get v2, index u32 274 - v19345 = cast v19344 as u32 - v19346 = array_set v19342, index v19345, value Field 274 - v19348 = not v19343 - v19349 = array_get v19346, index v19345 - v19350 = array_get v19342, index v19345 - v19351 = cast v19343 as Field - v19352 = cast v19348 as Field - v19353 = mul v19351, v19349 - v19354 = mul v19352, v19350 - v19355 = add v19353, v19354 - v19356 = array_set mut v19346, index v19345, value v19355 - enable_side_effects u1 1 - v19357 = array_get v1, index u32 275 - enable_side_effects v19357 - v19358 = array_get v2, index u32 275 - v19359 = cast v19358 as u32 - v19360 = array_set v19356, index v19359, value Field 275 - v19362 = not v19357 - v19363 = array_get v19360, index v19359 - v19364 = array_get v19356, index v19359 - v19365 = cast v19357 as Field - v19366 = cast v19362 as Field - v19367 = mul v19365, v19363 - v19368 = mul v19366, v19364 - v19369 = add v19367, v19368 - v19370 = array_set mut v19360, index v19359, value v19369 - enable_side_effects u1 1 - v19371 = array_get v1, index u32 276 - enable_side_effects v19371 - v19372 = array_get v2, index u32 276 - v19373 = cast v19372 as u32 - v19374 = array_set v19370, index v19373, value Field 276 - v19376 = not v19371 - v19377 = array_get v19374, index v19373 - v19378 = array_get v19370, index v19373 - v19379 = cast v19371 as Field - v19380 = cast v19376 as Field - v19381 = mul v19379, v19377 - v19382 = mul v19380, v19378 - v19383 = add v19381, v19382 - v19384 = array_set mut v19374, index v19373, value v19383 - enable_side_effects u1 1 - v19385 = array_get v1, index u32 277 - enable_side_effects v19385 - v19386 = array_get v2, index u32 277 - v19387 = cast v19386 as u32 - v19388 = array_set v19384, index v19387, value Field 277 - v19390 = not v19385 - v19391 = array_get v19388, index v19387 - v19392 = array_get v19384, index v19387 - v19393 = cast v19385 as Field - v19394 = cast v19390 as Field - v19395 = mul v19393, v19391 - v19396 = mul v19394, v19392 - v19397 = add v19395, v19396 - v19398 = array_set mut v19388, index v19387, value v19397 - enable_side_effects u1 1 - v19399 = array_get v1, index u32 278 - enable_side_effects v19399 - v19400 = array_get v2, index u32 278 - v19401 = cast v19400 as u32 - v19402 = array_set v19398, index v19401, value Field 278 - v19404 = not v19399 - v19405 = array_get v19402, index v19401 - v19406 = array_get v19398, index v19401 - v19407 = cast v19399 as Field - v19408 = cast v19404 as Field - v19409 = mul v19407, v19405 - v19410 = mul v19408, v19406 - v19411 = add v19409, v19410 - v19412 = array_set mut v19402, index v19401, value v19411 - enable_side_effects u1 1 - v19413 = array_get v1, index u32 279 - enable_side_effects v19413 - v19414 = array_get v2, index u32 279 - v19415 = cast v19414 as u32 - v19416 = array_set v19412, index v19415, value Field 279 - v19418 = not v19413 - v19419 = array_get v19416, index v19415 - v19420 = array_get v19412, index v19415 - v19421 = cast v19413 as Field - v19422 = cast v19418 as Field - v19423 = mul v19421, v19419 - v19424 = mul v19422, v19420 - v19425 = add v19423, v19424 - v19426 = array_set mut v19416, index v19415, value v19425 - enable_side_effects u1 1 - v19427 = array_get v1, index u32 280 - enable_side_effects v19427 - v19428 = array_get v2, index u32 280 - v19429 = cast v19428 as u32 - v19430 = array_set v19426, index v19429, value Field 280 - v19432 = not v19427 - v19433 = array_get v19430, index v19429 - v19434 = array_get v19426, index v19429 - v19435 = cast v19427 as Field - v19436 = cast v19432 as Field - v19437 = mul v19435, v19433 - v19438 = mul v19436, v19434 - v19439 = add v19437, v19438 - v19440 = array_set mut v19430, index v19429, value v19439 - enable_side_effects u1 1 - v19441 = array_get v1, index u32 281 - enable_side_effects v19441 - v19442 = array_get v2, index u32 281 - v19443 = cast v19442 as u32 - v19444 = array_set v19440, index v19443, value Field 281 - v19446 = not v19441 - v19447 = array_get v19444, index v19443 - v19448 = array_get v19440, index v19443 - v19449 = cast v19441 as Field - v19450 = cast v19446 as Field - v19451 = mul v19449, v19447 - v19452 = mul v19450, v19448 - v19453 = add v19451, v19452 - v19454 = array_set mut v19444, index v19443, value v19453 - enable_side_effects u1 1 - v19455 = array_get v1, index u32 282 - enable_side_effects v19455 - v19456 = array_get v2, index u32 282 - v19457 = cast v19456 as u32 - v19458 = array_set v19454, index v19457, value Field 282 - v19460 = not v19455 - v19461 = array_get v19458, index v19457 - v19462 = array_get v19454, index v19457 - v19463 = cast v19455 as Field - v19464 = cast v19460 as Field - v19465 = mul v19463, v19461 - v19466 = mul v19464, v19462 - v19467 = add v19465, v19466 - v19468 = array_set mut v19458, index v19457, value v19467 - enable_side_effects u1 1 - v19469 = array_get v1, index u32 283 - enable_side_effects v19469 - v19470 = array_get v2, index u32 283 - v19471 = cast v19470 as u32 - v19472 = array_set v19468, index v19471, value Field 283 - v19474 = not v19469 - v19475 = array_get v19472, index v19471 - v19476 = array_get v19468, index v19471 - v19477 = cast v19469 as Field - v19478 = cast v19474 as Field - v19479 = mul v19477, v19475 - v19480 = mul v19478, v19476 - v19481 = add v19479, v19480 - v19482 = array_set mut v19472, index v19471, value v19481 - enable_side_effects u1 1 - v19483 = array_get v1, index u32 284 - enable_side_effects v19483 - v19484 = array_get v2, index u32 284 - v19485 = cast v19484 as u32 - v19486 = array_set v19482, index v19485, value Field 284 - v19488 = not v19483 - v19489 = array_get v19486, index v19485 - v19490 = array_get v19482, index v19485 - v19491 = cast v19483 as Field - v19492 = cast v19488 as Field - v19493 = mul v19491, v19489 - v19494 = mul v19492, v19490 - v19495 = add v19493, v19494 - v19496 = array_set mut v19486, index v19485, value v19495 - enable_side_effects u1 1 - v19497 = array_get v1, index u32 285 - enable_side_effects v19497 - v19498 = array_get v2, index u32 285 - v19499 = cast v19498 as u32 - v19500 = array_set v19496, index v19499, value Field 285 - v19502 = not v19497 - v19503 = array_get v19500, index v19499 - v19504 = array_get v19496, index v19499 - v19505 = cast v19497 as Field - v19506 = cast v19502 as Field - v19507 = mul v19505, v19503 - v19508 = mul v19506, v19504 - v19509 = add v19507, v19508 - v19510 = array_set mut v19500, index v19499, value v19509 - enable_side_effects u1 1 - v19511 = array_get v1, index u32 286 - enable_side_effects v19511 - v19512 = array_get v2, index u32 286 - v19513 = cast v19512 as u32 - v19514 = array_set v19510, index v19513, value Field 286 - v19516 = not v19511 - v19517 = array_get v19514, index v19513 - v19518 = array_get v19510, index v19513 - v19519 = cast v19511 as Field - v19520 = cast v19516 as Field - v19521 = mul v19519, v19517 - v19522 = mul v19520, v19518 - v19523 = add v19521, v19522 - v19524 = array_set mut v19514, index v19513, value v19523 - enable_side_effects u1 1 - v19525 = array_get v1, index u32 287 - enable_side_effects v19525 - v19526 = array_get v2, index u32 287 - v19527 = cast v19526 as u32 - v19528 = array_set v19524, index v19527, value Field 287 - v19530 = not v19525 - v19531 = array_get v19528, index v19527 - v19532 = array_get v19524, index v19527 - v19533 = cast v19525 as Field - v19534 = cast v19530 as Field - v19535 = mul v19533, v19531 - v19536 = mul v19534, v19532 - v19537 = add v19535, v19536 - v19538 = array_set mut v19528, index v19527, value v19537 - enable_side_effects u1 1 - v19539 = array_get v1, index u32 2⁴×18 - enable_side_effects v19539 - v19540 = array_get v2, index u32 2⁴×18 - v19541 = cast v19540 as u32 - v19542 = array_set v19538, index v19541, value Field 2⁴×18 - v19544 = not v19539 - v19545 = array_get v19542, index v19541 - v19546 = array_get v19538, index v19541 - v19547 = cast v19539 as Field - v19548 = cast v19544 as Field - v19549 = mul v19547, v19545 - v19550 = mul v19548, v19546 - v19551 = add v19549, v19550 - v19552 = array_set mut v19542, index v19541, value v19551 - enable_side_effects u1 1 - v19553 = array_get v1, index u32 289 - enable_side_effects v19553 - v19554 = array_get v2, index u32 289 - v19555 = cast v19554 as u32 - v19556 = array_set v19552, index v19555, value Field 289 - v19558 = not v19553 - v19559 = array_get v19556, index v19555 - v19560 = array_get v19552, index v19555 - v19561 = cast v19553 as Field - v19562 = cast v19558 as Field - v19563 = mul v19561, v19559 - v19564 = mul v19562, v19560 - v19565 = add v19563, v19564 - v19566 = array_set mut v19556, index v19555, value v19565 - enable_side_effects u1 1 - v19567 = array_get v1, index u32 290 - enable_side_effects v19567 - v19568 = array_get v2, index u32 290 - v19569 = cast v19568 as u32 - v19570 = array_set v19566, index v19569, value Field 290 - v19572 = not v19567 - v19573 = array_get v19570, index v19569 - v19574 = array_get v19566, index v19569 - v19575 = cast v19567 as Field - v19576 = cast v19572 as Field - v19577 = mul v19575, v19573 - v19578 = mul v19576, v19574 - v19579 = add v19577, v19578 - v19580 = array_set mut v19570, index v19569, value v19579 - enable_side_effects u1 1 - v19581 = array_get v1, index u32 291 - enable_side_effects v19581 - v19582 = array_get v2, index u32 291 - v19583 = cast v19582 as u32 - v19584 = array_set v19580, index v19583, value Field 291 - v19586 = not v19581 - v19587 = array_get v19584, index v19583 - v19588 = array_get v19580, index v19583 - v19589 = cast v19581 as Field - v19590 = cast v19586 as Field - v19591 = mul v19589, v19587 - v19592 = mul v19590, v19588 - v19593 = add v19591, v19592 - v19594 = array_set mut v19584, index v19583, value v19593 - enable_side_effects u1 1 - v19595 = array_get v1, index u32 292 - enable_side_effects v19595 - v19596 = array_get v2, index u32 292 - v19597 = cast v19596 as u32 - v19598 = array_set v19594, index v19597, value Field 292 - v19600 = not v19595 - v19601 = array_get v19598, index v19597 - v19602 = array_get v19594, index v19597 - v19603 = cast v19595 as Field - v19604 = cast v19600 as Field - v19605 = mul v19603, v19601 - v19606 = mul v19604, v19602 - v19607 = add v19605, v19606 - v19608 = array_set mut v19598, index v19597, value v19607 - enable_side_effects u1 1 - v19609 = array_get v1, index u32 293 - enable_side_effects v19609 - v19610 = array_get v2, index u32 293 - v19611 = cast v19610 as u32 - v19612 = array_set v19608, index v19611, value Field 293 - v19614 = not v19609 - v19615 = array_get v19612, index v19611 - v19616 = array_get v19608, index v19611 - v19617 = cast v19609 as Field - v19618 = cast v19614 as Field - v19619 = mul v19617, v19615 - v19620 = mul v19618, v19616 - v19621 = add v19619, v19620 - v19622 = array_set mut v19612, index v19611, value v19621 - enable_side_effects u1 1 - v19623 = array_get v1, index u32 294 - enable_side_effects v19623 - v19624 = array_get v2, index u32 294 - v19625 = cast v19624 as u32 - v19626 = array_set v19622, index v19625, value Field 294 - v19628 = not v19623 - v19629 = array_get v19626, index v19625 - v19630 = array_get v19622, index v19625 - v19631 = cast v19623 as Field - v19632 = cast v19628 as Field - v19633 = mul v19631, v19629 - v19634 = mul v19632, v19630 - v19635 = add v19633, v19634 - v19636 = array_set mut v19626, index v19625, value v19635 - enable_side_effects u1 1 - v19637 = array_get v1, index u32 295 - enable_side_effects v19637 - v19638 = array_get v2, index u32 295 - v19639 = cast v19638 as u32 - v19640 = array_set v19636, index v19639, value Field 295 - v19642 = not v19637 - v19643 = array_get v19640, index v19639 - v19644 = array_get v19636, index v19639 - v19645 = cast v19637 as Field - v19646 = cast v19642 as Field - v19647 = mul v19645, v19643 - v19648 = mul v19646, v19644 - v19649 = add v19647, v19648 - v19650 = array_set mut v19640, index v19639, value v19649 - enable_side_effects u1 1 - v19651 = array_get v1, index u32 296 - enable_side_effects v19651 - v19652 = array_get v2, index u32 296 - v19653 = cast v19652 as u32 - v19654 = array_set v19650, index v19653, value Field 296 - v19656 = not v19651 - v19657 = array_get v19654, index v19653 - v19658 = array_get v19650, index v19653 - v19659 = cast v19651 as Field - v19660 = cast v19656 as Field - v19661 = mul v19659, v19657 - v19662 = mul v19660, v19658 - v19663 = add v19661, v19662 - v19664 = array_set mut v19654, index v19653, value v19663 - enable_side_effects u1 1 - v19665 = array_get v1, index u32 297 - enable_side_effects v19665 - v19666 = array_get v2, index u32 297 - v19667 = cast v19666 as u32 - v19668 = array_set v19664, index v19667, value Field 297 - v19670 = not v19665 - v19671 = array_get v19668, index v19667 - v19672 = array_get v19664, index v19667 - v19673 = cast v19665 as Field - v19674 = cast v19670 as Field - v19675 = mul v19673, v19671 - v19676 = mul v19674, v19672 - v19677 = add v19675, v19676 - v19678 = array_set mut v19668, index v19667, value v19677 - enable_side_effects u1 1 - v19679 = array_get v1, index u32 298 - enable_side_effects v19679 - v19680 = array_get v2, index u32 298 - v19681 = cast v19680 as u32 - v19682 = array_set v19678, index v19681, value Field 298 - v19684 = not v19679 - v19685 = array_get v19682, index v19681 - v19686 = array_get v19678, index v19681 - v19687 = cast v19679 as Field - v19688 = cast v19684 as Field - v19689 = mul v19687, v19685 - v19690 = mul v19688, v19686 - v19691 = add v19689, v19690 - v19692 = array_set mut v19682, index v19681, value v19691 - enable_side_effects u1 1 - v19693 = array_get v1, index u32 299 - enable_side_effects v19693 - v19694 = array_get v2, index u32 299 - v19695 = cast v19694 as u32 - v19696 = array_set v19692, index v19695, value Field 299 - v19698 = not v19693 - v19699 = array_get v19696, index v19695 - v19700 = array_get v19692, index v19695 - v19701 = cast v19693 as Field - v19702 = cast v19698 as Field - v19703 = mul v19701, v19699 - v19704 = mul v19702, v19700 - v19705 = add v19703, v19704 - v19706 = array_set mut v19696, index v19695, value v19705 - enable_side_effects u1 1 - v19707 = array_get v1, index u32 300 - enable_side_effects v19707 - v19708 = array_get v2, index u32 300 - v19709 = cast v19708 as u32 - v19710 = array_set v19706, index v19709, value Field 300 - v19712 = not v19707 - v19713 = array_get v19710, index v19709 - v19714 = array_get v19706, index v19709 - v19715 = cast v19707 as Field - v19716 = cast v19712 as Field - v19717 = mul v19715, v19713 - v19718 = mul v19716, v19714 - v19719 = add v19717, v19718 - v19720 = array_set mut v19710, index v19709, value v19719 - enable_side_effects u1 1 - v19721 = array_get v1, index u32 301 - enable_side_effects v19721 - v19722 = array_get v2, index u32 301 - v19723 = cast v19722 as u32 - v19724 = array_set v19720, index v19723, value Field 301 - v19726 = not v19721 - v19727 = array_get v19724, index v19723 - v19728 = array_get v19720, index v19723 - v19729 = cast v19721 as Field - v19730 = cast v19726 as Field - v19731 = mul v19729, v19727 - v19732 = mul v19730, v19728 - v19733 = add v19731, v19732 - v19734 = array_set mut v19724, index v19723, value v19733 - enable_side_effects u1 1 - v19735 = array_get v1, index u32 302 - enable_side_effects v19735 - v19736 = array_get v2, index u32 302 - v19737 = cast v19736 as u32 - v19738 = array_set v19734, index v19737, value Field 302 - v19740 = not v19735 - v19741 = array_get v19738, index v19737 - v19742 = array_get v19734, index v19737 - v19743 = cast v19735 as Field - v19744 = cast v19740 as Field - v19745 = mul v19743, v19741 - v19746 = mul v19744, v19742 - v19747 = add v19745, v19746 - v19748 = array_set mut v19738, index v19737, value v19747 - enable_side_effects u1 1 - v19749 = array_get v1, index u32 303 - enable_side_effects v19749 - v19750 = array_get v2, index u32 303 - v19751 = cast v19750 as u32 - v19752 = array_set v19748, index v19751, value Field 303 - v19754 = not v19749 - v19755 = array_get v19752, index v19751 - v19756 = array_get v19748, index v19751 - v19757 = cast v19749 as Field - v19758 = cast v19754 as Field - v19759 = mul v19757, v19755 - v19760 = mul v19758, v19756 - v19761 = add v19759, v19760 - v19762 = array_set mut v19752, index v19751, value v19761 - enable_side_effects u1 1 - v19763 = array_get v1, index u32 2⁴×19 - enable_side_effects v19763 - v19764 = array_get v2, index u32 2⁴×19 - v19765 = cast v19764 as u32 - v19766 = array_set v19762, index v19765, value Field 2⁴×19 - v19768 = not v19763 - v19769 = array_get v19766, index v19765 - v19770 = array_get v19762, index v19765 - v19771 = cast v19763 as Field - v19772 = cast v19768 as Field - v19773 = mul v19771, v19769 - v19774 = mul v19772, v19770 - v19775 = add v19773, v19774 - v19776 = array_set mut v19766, index v19765, value v19775 - enable_side_effects u1 1 - v19777 = array_get v1, index u32 305 - enable_side_effects v19777 - v19778 = array_get v2, index u32 305 - v19779 = cast v19778 as u32 - v19780 = array_set v19776, index v19779, value Field 305 - v19782 = not v19777 - v19783 = array_get v19780, index v19779 - v19784 = array_get v19776, index v19779 - v19785 = cast v19777 as Field - v19786 = cast v19782 as Field - v19787 = mul v19785, v19783 - v19788 = mul v19786, v19784 - v19789 = add v19787, v19788 - v19790 = array_set mut v19780, index v19779, value v19789 - enable_side_effects u1 1 - v19791 = array_get v1, index u32 306 - enable_side_effects v19791 - v19792 = array_get v2, index u32 306 - v19793 = cast v19792 as u32 - v19794 = array_set v19790, index v19793, value Field 306 - v19796 = not v19791 - v19797 = array_get v19794, index v19793 - v19798 = array_get v19790, index v19793 - v19799 = cast v19791 as Field - v19800 = cast v19796 as Field - v19801 = mul v19799, v19797 - v19802 = mul v19800, v19798 - v19803 = add v19801, v19802 - v19804 = array_set mut v19794, index v19793, value v19803 - enable_side_effects u1 1 - v19805 = array_get v1, index u32 307 - enable_side_effects v19805 - v19806 = array_get v2, index u32 307 - v19807 = cast v19806 as u32 - v19808 = array_set v19804, index v19807, value Field 307 - v19810 = not v19805 - v19811 = array_get v19808, index v19807 - v19812 = array_get v19804, index v19807 - v19813 = cast v19805 as Field - v19814 = cast v19810 as Field - v19815 = mul v19813, v19811 - v19816 = mul v19814, v19812 - v19817 = add v19815, v19816 - v19818 = array_set mut v19808, index v19807, value v19817 - enable_side_effects u1 1 - v19819 = array_get v1, index u32 308 - enable_side_effects v19819 - v19820 = array_get v2, index u32 308 - v19821 = cast v19820 as u32 - v19822 = array_set v19818, index v19821, value Field 308 - v19824 = not v19819 - v19825 = array_get v19822, index v19821 - v19826 = array_get v19818, index v19821 - v19827 = cast v19819 as Field - v19828 = cast v19824 as Field - v19829 = mul v19827, v19825 - v19830 = mul v19828, v19826 - v19831 = add v19829, v19830 - v19832 = array_set mut v19822, index v19821, value v19831 - enable_side_effects u1 1 - v19833 = array_get v1, index u32 309 - enable_side_effects v19833 - v19834 = array_get v2, index u32 309 - v19835 = cast v19834 as u32 - v19836 = array_set v19832, index v19835, value Field 309 - v19838 = not v19833 - v19839 = array_get v19836, index v19835 - v19840 = array_get v19832, index v19835 - v19841 = cast v19833 as Field - v19842 = cast v19838 as Field - v19843 = mul v19841, v19839 - v19844 = mul v19842, v19840 - v19845 = add v19843, v19844 - v19846 = array_set mut v19836, index v19835, value v19845 - enable_side_effects u1 1 - v19847 = array_get v1, index u32 310 - enable_side_effects v19847 - v19848 = array_get v2, index u32 310 - v19849 = cast v19848 as u32 - v19850 = array_set v19846, index v19849, value Field 310 - v19852 = not v19847 - v19853 = array_get v19850, index v19849 - v19854 = array_get v19846, index v19849 - v19855 = cast v19847 as Field - v19856 = cast v19852 as Field - v19857 = mul v19855, v19853 - v19858 = mul v19856, v19854 - v19859 = add v19857, v19858 - v19860 = array_set mut v19850, index v19849, value v19859 - enable_side_effects u1 1 - v19861 = array_get v1, index u32 311 - enable_side_effects v19861 - v19862 = array_get v2, index u32 311 - v19863 = cast v19862 as u32 - v19864 = array_set v19860, index v19863, value Field 311 - v19866 = not v19861 - v19867 = array_get v19864, index v19863 - v19868 = array_get v19860, index v19863 - v19869 = cast v19861 as Field - v19870 = cast v19866 as Field - v19871 = mul v19869, v19867 - v19872 = mul v19870, v19868 - v19873 = add v19871, v19872 - v19874 = array_set mut v19864, index v19863, value v19873 - enable_side_effects u1 1 - v19875 = array_get v1, index u32 312 - enable_side_effects v19875 - v19876 = array_get v2, index u32 312 - v19877 = cast v19876 as u32 - v19878 = array_set v19874, index v19877, value Field 312 - v19880 = not v19875 - v19881 = array_get v19878, index v19877 - v19882 = array_get v19874, index v19877 - v19883 = cast v19875 as Field - v19884 = cast v19880 as Field - v19885 = mul v19883, v19881 - v19886 = mul v19884, v19882 - v19887 = add v19885, v19886 - v19888 = array_set mut v19878, index v19877, value v19887 - enable_side_effects u1 1 - v19889 = array_get v1, index u32 313 - enable_side_effects v19889 - v19890 = array_get v2, index u32 313 - v19891 = cast v19890 as u32 - v19892 = array_set v19888, index v19891, value Field 313 - v19894 = not v19889 - v19895 = array_get v19892, index v19891 - v19896 = array_get v19888, index v19891 - v19897 = cast v19889 as Field - v19898 = cast v19894 as Field - v19899 = mul v19897, v19895 - v19900 = mul v19898, v19896 - v19901 = add v19899, v19900 - v19902 = array_set mut v19892, index v19891, value v19901 - enable_side_effects u1 1 - v19903 = array_get v1, index u32 314 - enable_side_effects v19903 - v19904 = array_get v2, index u32 314 - v19905 = cast v19904 as u32 - v19906 = array_set v19902, index v19905, value Field 314 - v19908 = not v19903 - v19909 = array_get v19906, index v19905 - v19910 = array_get v19902, index v19905 - v19911 = cast v19903 as Field - v19912 = cast v19908 as Field - v19913 = mul v19911, v19909 - v19914 = mul v19912, v19910 - v19915 = add v19913, v19914 - v19916 = array_set mut v19906, index v19905, value v19915 - enable_side_effects u1 1 - v19917 = array_get v1, index u32 315 - enable_side_effects v19917 - v19918 = array_get v2, index u32 315 - v19919 = cast v19918 as u32 - v19920 = array_set v19916, index v19919, value Field 315 - v19922 = not v19917 - v19923 = array_get v19920, index v19919 - v19924 = array_get v19916, index v19919 - v19925 = cast v19917 as Field - v19926 = cast v19922 as Field - v19927 = mul v19925, v19923 - v19928 = mul v19926, v19924 - v19929 = add v19927, v19928 - v19930 = array_set mut v19920, index v19919, value v19929 - enable_side_effects u1 1 - v19931 = array_get v1, index u32 316 - enable_side_effects v19931 - v19932 = array_get v2, index u32 316 - v19933 = cast v19932 as u32 - v19934 = array_set v19930, index v19933, value Field 316 - v19936 = not v19931 - v19937 = array_get v19934, index v19933 - v19938 = array_get v19930, index v19933 - v19939 = cast v19931 as Field - v19940 = cast v19936 as Field - v19941 = mul v19939, v19937 - v19942 = mul v19940, v19938 - v19943 = add v19941, v19942 - v19944 = array_set mut v19934, index v19933, value v19943 - enable_side_effects u1 1 - v19945 = array_get v1, index u32 317 - enable_side_effects v19945 - v19946 = array_get v2, index u32 317 - v19947 = cast v19946 as u32 - v19948 = array_set v19944, index v19947, value Field 317 - v19950 = not v19945 - v19951 = array_get v19948, index v19947 - v19952 = array_get v19944, index v19947 - v19953 = cast v19945 as Field - v19954 = cast v19950 as Field - v19955 = mul v19953, v19951 - v19956 = mul v19954, v19952 - v19957 = add v19955, v19956 - v19958 = array_set mut v19948, index v19947, value v19957 - enable_side_effects u1 1 - v19959 = array_get v1, index u32 318 - enable_side_effects v19959 - v19960 = array_get v2, index u32 318 - v19961 = cast v19960 as u32 - v19962 = array_set v19958, index v19961, value Field 318 - v19964 = not v19959 - v19965 = array_get v19962, index v19961 - v19966 = array_get v19958, index v19961 - v19967 = cast v19959 as Field - v19968 = cast v19964 as Field - v19969 = mul v19967, v19965 - v19970 = mul v19968, v19966 - v19971 = add v19969, v19970 - v19972 = array_set mut v19962, index v19961, value v19971 - enable_side_effects u1 1 - v19973 = array_get v1, index u32 319 - enable_side_effects v19973 - v19974 = array_get v2, index u32 319 - v19975 = cast v19974 as u32 - v19976 = array_set v19972, index v19975, value Field 319 - v19978 = not v19973 - v19979 = array_get v19976, index v19975 - v19980 = array_get v19972, index v19975 - v19981 = cast v19973 as Field - v19982 = cast v19978 as Field - v19983 = mul v19981, v19979 - v19984 = mul v19982, v19980 - v19985 = add v19983, v19984 - v19986 = array_set mut v19976, index v19975, value v19985 - enable_side_effects u1 1 - v19987 = array_get v1, index u32 2⁴×20 - enable_side_effects v19987 - v19988 = array_get v2, index u32 2⁴×20 - v19989 = cast v19988 as u32 - v19990 = array_set v19986, index v19989, value Field 2⁴×20 - v19992 = not v19987 - v19993 = array_get v19990, index v19989 - v19994 = array_get v19986, index v19989 - v19995 = cast v19987 as Field - v19996 = cast v19992 as Field - v19997 = mul v19995, v19993 - v19998 = mul v19996, v19994 - v19999 = add v19997, v19998 - v20000 = array_set mut v19990, index v19989, value v19999 - enable_side_effects u1 1 - v20001 = array_get v1, index u32 321 - enable_side_effects v20001 - v20002 = array_get v2, index u32 321 - v20003 = cast v20002 as u32 - v20004 = array_set v20000, index v20003, value Field 321 - v20006 = not v20001 - v20007 = array_get v20004, index v20003 - v20008 = array_get v20000, index v20003 - v20009 = cast v20001 as Field - v20010 = cast v20006 as Field - v20011 = mul v20009, v20007 - v20012 = mul v20010, v20008 - v20013 = add v20011, v20012 - v20014 = array_set mut v20004, index v20003, value v20013 - enable_side_effects u1 1 - v20015 = array_get v1, index u32 322 - enable_side_effects v20015 - v20016 = array_get v2, index u32 322 - v20017 = cast v20016 as u32 - v20018 = array_set v20014, index v20017, value Field 322 - v20020 = not v20015 - v20021 = array_get v20018, index v20017 - v20022 = array_get v20014, index v20017 - v20023 = cast v20015 as Field - v20024 = cast v20020 as Field - v20025 = mul v20023, v20021 - v20026 = mul v20024, v20022 - v20027 = add v20025, v20026 - v20028 = array_set mut v20018, index v20017, value v20027 - enable_side_effects u1 1 - v20029 = array_get v1, index u32 323 - enable_side_effects v20029 - v20030 = array_get v2, index u32 323 - v20031 = cast v20030 as u32 - v20032 = array_set v20028, index v20031, value Field 323 - v20034 = not v20029 - v20035 = array_get v20032, index v20031 - v20036 = array_get v20028, index v20031 - v20037 = cast v20029 as Field - v20038 = cast v20034 as Field - v20039 = mul v20037, v20035 - v20040 = mul v20038, v20036 - v20041 = add v20039, v20040 - v20042 = array_set mut v20032, index v20031, value v20041 - enable_side_effects u1 1 - v20043 = array_get v1, index u32 324 - enable_side_effects v20043 - v20044 = array_get v2, index u32 324 - v20045 = cast v20044 as u32 - v20046 = array_set v20042, index v20045, value Field 324 - v20048 = not v20043 - v20049 = array_get v20046, index v20045 - v20050 = array_get v20042, index v20045 - v20051 = cast v20043 as Field - v20052 = cast v20048 as Field - v20053 = mul v20051, v20049 - v20054 = mul v20052, v20050 - v20055 = add v20053, v20054 - v20056 = array_set mut v20046, index v20045, value v20055 - enable_side_effects u1 1 - v20057 = array_get v1, index u32 325 - enable_side_effects v20057 - v20058 = array_get v2, index u32 325 - v20059 = cast v20058 as u32 - v20060 = array_set v20056, index v20059, value Field 325 - v20062 = not v20057 - v20063 = array_get v20060, index v20059 - v20064 = array_get v20056, index v20059 - v20065 = cast v20057 as Field - v20066 = cast v20062 as Field - v20067 = mul v20065, v20063 - v20068 = mul v20066, v20064 - v20069 = add v20067, v20068 - v20070 = array_set mut v20060, index v20059, value v20069 - enable_side_effects u1 1 - v20071 = array_get v1, index u32 326 - enable_side_effects v20071 - v20072 = array_get v2, index u32 326 - v20073 = cast v20072 as u32 - v20074 = array_set v20070, index v20073, value Field 326 - v20076 = not v20071 - v20077 = array_get v20074, index v20073 - v20078 = array_get v20070, index v20073 - v20079 = cast v20071 as Field - v20080 = cast v20076 as Field - v20081 = mul v20079, v20077 - v20082 = mul v20080, v20078 - v20083 = add v20081, v20082 - v20084 = array_set mut v20074, index v20073, value v20083 - enable_side_effects u1 1 - v20085 = array_get v1, index u32 327 - enable_side_effects v20085 - v20086 = array_get v2, index u32 327 - v20087 = cast v20086 as u32 - v20088 = array_set v20084, index v20087, value Field 327 - v20090 = not v20085 - v20091 = array_get v20088, index v20087 - v20092 = array_get v20084, index v20087 - v20093 = cast v20085 as Field - v20094 = cast v20090 as Field - v20095 = mul v20093, v20091 - v20096 = mul v20094, v20092 - v20097 = add v20095, v20096 - v20098 = array_set mut v20088, index v20087, value v20097 - enable_side_effects u1 1 - v20099 = array_get v1, index u32 328 - enable_side_effects v20099 - v20100 = array_get v2, index u32 328 - v20101 = cast v20100 as u32 - v20102 = array_set v20098, index v20101, value Field 328 - v20104 = not v20099 - v20105 = array_get v20102, index v20101 - v20106 = array_get v20098, index v20101 - v20107 = cast v20099 as Field - v20108 = cast v20104 as Field - v20109 = mul v20107, v20105 - v20110 = mul v20108, v20106 - v20111 = add v20109, v20110 - v20112 = array_set mut v20102, index v20101, value v20111 - enable_side_effects u1 1 - v20113 = array_get v1, index u32 329 - enable_side_effects v20113 - v20114 = array_get v2, index u32 329 - v20115 = cast v20114 as u32 - v20116 = array_set v20112, index v20115, value Field 329 - v20118 = not v20113 - v20119 = array_get v20116, index v20115 - v20120 = array_get v20112, index v20115 - v20121 = cast v20113 as Field - v20122 = cast v20118 as Field - v20123 = mul v20121, v20119 - v20124 = mul v20122, v20120 - v20125 = add v20123, v20124 - v20126 = array_set mut v20116, index v20115, value v20125 - enable_side_effects u1 1 - v20127 = array_get v1, index u32 330 - enable_side_effects v20127 - v20128 = array_get v2, index u32 330 - v20129 = cast v20128 as u32 - v20130 = array_set v20126, index v20129, value Field 330 - v20132 = not v20127 - v20133 = array_get v20130, index v20129 - v20134 = array_get v20126, index v20129 - v20135 = cast v20127 as Field - v20136 = cast v20132 as Field - v20137 = mul v20135, v20133 - v20138 = mul v20136, v20134 - v20139 = add v20137, v20138 - v20140 = array_set mut v20130, index v20129, value v20139 - enable_side_effects u1 1 - v20141 = array_get v1, index u32 331 - enable_side_effects v20141 - v20142 = array_get v2, index u32 331 - v20143 = cast v20142 as u32 - v20144 = array_set v20140, index v20143, value Field 331 - v20146 = not v20141 - v20147 = array_get v20144, index v20143 - v20148 = array_get v20140, index v20143 - v20149 = cast v20141 as Field - v20150 = cast v20146 as Field - v20151 = mul v20149, v20147 - v20152 = mul v20150, v20148 - v20153 = add v20151, v20152 - v20154 = array_set mut v20144, index v20143, value v20153 - enable_side_effects u1 1 - v20155 = array_get v1, index u32 332 - enable_side_effects v20155 - v20156 = array_get v2, index u32 332 - v20157 = cast v20156 as u32 - v20158 = array_set v20154, index v20157, value Field 332 - v20160 = not v20155 - v20161 = array_get v20158, index v20157 - v20162 = array_get v20154, index v20157 - v20163 = cast v20155 as Field - v20164 = cast v20160 as Field - v20165 = mul v20163, v20161 - v20166 = mul v20164, v20162 - v20167 = add v20165, v20166 - v20168 = array_set mut v20158, index v20157, value v20167 - enable_side_effects u1 1 - v20169 = array_get v1, index u32 333 - enable_side_effects v20169 - v20170 = array_get v2, index u32 333 - v20171 = cast v20170 as u32 - v20172 = array_set v20168, index v20171, value Field 333 - v20174 = not v20169 - v20175 = array_get v20172, index v20171 - v20176 = array_get v20168, index v20171 - v20177 = cast v20169 as Field - v20178 = cast v20174 as Field - v20179 = mul v20177, v20175 - v20180 = mul v20178, v20176 - v20181 = add v20179, v20180 - v20182 = array_set mut v20172, index v20171, value v20181 - enable_side_effects u1 1 - v20183 = array_get v1, index u32 334 - enable_side_effects v20183 - v20184 = array_get v2, index u32 334 - v20185 = cast v20184 as u32 - v20186 = array_set v20182, index v20185, value Field 334 - v20188 = not v20183 - v20189 = array_get v20186, index v20185 - v20190 = array_get v20182, index v20185 - v20191 = cast v20183 as Field - v20192 = cast v20188 as Field - v20193 = mul v20191, v20189 - v20194 = mul v20192, v20190 - v20195 = add v20193, v20194 - v20196 = array_set mut v20186, index v20185, value v20195 - enable_side_effects u1 1 - v20197 = array_get v1, index u32 335 - enable_side_effects v20197 - v20198 = array_get v2, index u32 335 - v20199 = cast v20198 as u32 - v20200 = array_set v20196, index v20199, value Field 335 - v20202 = not v20197 - v20203 = array_get v20200, index v20199 - v20204 = array_get v20196, index v20199 - v20205 = cast v20197 as Field - v20206 = cast v20202 as Field - v20207 = mul v20205, v20203 - v20208 = mul v20206, v20204 - v20209 = add v20207, v20208 - v20210 = array_set mut v20200, index v20199, value v20209 - enable_side_effects u1 1 - v20211 = array_get v1, index u32 2⁴×21 - enable_side_effects v20211 - v20212 = array_get v2, index u32 2⁴×21 - v20213 = cast v20212 as u32 - v20214 = array_set v20210, index v20213, value Field 2⁴×21 - v20216 = not v20211 - v20217 = array_get v20214, index v20213 - v20218 = array_get v20210, index v20213 - v20219 = cast v20211 as Field - v20220 = cast v20216 as Field - v20221 = mul v20219, v20217 - v20222 = mul v20220, v20218 - v20223 = add v20221, v20222 - v20224 = array_set mut v20214, index v20213, value v20223 - enable_side_effects u1 1 - v20225 = array_get v1, index u32 337 - enable_side_effects v20225 - v20226 = array_get v2, index u32 337 - v20227 = cast v20226 as u32 - v20228 = array_set v20224, index v20227, value Field 337 - v20230 = not v20225 - v20231 = array_get v20228, index v20227 - v20232 = array_get v20224, index v20227 - v20233 = cast v20225 as Field - v20234 = cast v20230 as Field - v20235 = mul v20233, v20231 - v20236 = mul v20234, v20232 - v20237 = add v20235, v20236 - v20238 = array_set mut v20228, index v20227, value v20237 - enable_side_effects u1 1 - v20239 = array_get v1, index u32 338 - enable_side_effects v20239 - v20240 = array_get v2, index u32 338 - v20241 = cast v20240 as u32 - v20242 = array_set v20238, index v20241, value Field 338 - v20244 = not v20239 - v20245 = array_get v20242, index v20241 - v20246 = array_get v20238, index v20241 - v20247 = cast v20239 as Field - v20248 = cast v20244 as Field - v20249 = mul v20247, v20245 - v20250 = mul v20248, v20246 - v20251 = add v20249, v20250 - v20252 = array_set mut v20242, index v20241, value v20251 - enable_side_effects u1 1 - v20253 = array_get v1, index u32 339 - enable_side_effects v20253 - v20254 = array_get v2, index u32 339 - v20255 = cast v20254 as u32 - v20256 = array_set v20252, index v20255, value Field 339 - v20258 = not v20253 - v20259 = array_get v20256, index v20255 - v20260 = array_get v20252, index v20255 - v20261 = cast v20253 as Field - v20262 = cast v20258 as Field - v20263 = mul v20261, v20259 - v20264 = mul v20262, v20260 - v20265 = add v20263, v20264 - v20266 = array_set mut v20256, index v20255, value v20265 - enable_side_effects u1 1 - v20267 = array_get v1, index u32 340 - enable_side_effects v20267 - v20268 = array_get v2, index u32 340 - v20269 = cast v20268 as u32 - v20270 = array_set v20266, index v20269, value Field 340 - v20272 = not v20267 - v20273 = array_get v20270, index v20269 - v20274 = array_get v20266, index v20269 - v20275 = cast v20267 as Field - v20276 = cast v20272 as Field - v20277 = mul v20275, v20273 - v20278 = mul v20276, v20274 - v20279 = add v20277, v20278 - v20280 = array_set mut v20270, index v20269, value v20279 - enable_side_effects u1 1 - v20281 = array_get v1, index u32 341 - enable_side_effects v20281 - v20282 = array_get v2, index u32 341 - v20283 = cast v20282 as u32 - v20284 = array_set v20280, index v20283, value Field 341 - v20286 = not v20281 - v20287 = array_get v20284, index v20283 - v20288 = array_get v20280, index v20283 - v20289 = cast v20281 as Field - v20290 = cast v20286 as Field - v20291 = mul v20289, v20287 - v20292 = mul v20290, v20288 - v20293 = add v20291, v20292 - v20294 = array_set mut v20284, index v20283, value v20293 - enable_side_effects u1 1 - v20295 = array_get v1, index u32 342 - enable_side_effects v20295 - v20296 = array_get v2, index u32 342 - v20297 = cast v20296 as u32 - v20298 = array_set v20294, index v20297, value Field 342 - v20300 = not v20295 - v20301 = array_get v20298, index v20297 - v20302 = array_get v20294, index v20297 - v20303 = cast v20295 as Field - v20304 = cast v20300 as Field - v20305 = mul v20303, v20301 - v20306 = mul v20304, v20302 - v20307 = add v20305, v20306 - v20308 = array_set mut v20298, index v20297, value v20307 - enable_side_effects u1 1 - v20309 = array_get v1, index u32 343 - enable_side_effects v20309 - v20310 = array_get v2, index u32 343 - v20311 = cast v20310 as u32 - v20312 = array_set v20308, index v20311, value Field 343 - v20314 = not v20309 - v20315 = array_get v20312, index v20311 - v20316 = array_get v20308, index v20311 - v20317 = cast v20309 as Field - v20318 = cast v20314 as Field - v20319 = mul v20317, v20315 - v20320 = mul v20318, v20316 - v20321 = add v20319, v20320 - v20322 = array_set mut v20312, index v20311, value v20321 - enable_side_effects u1 1 - v20323 = array_get v1, index u32 344 - enable_side_effects v20323 - v20324 = array_get v2, index u32 344 - v20325 = cast v20324 as u32 - v20326 = array_set v20322, index v20325, value Field 344 - v20328 = not v20323 - v20329 = array_get v20326, index v20325 - v20330 = array_get v20322, index v20325 - v20331 = cast v20323 as Field - v20332 = cast v20328 as Field - v20333 = mul v20331, v20329 - v20334 = mul v20332, v20330 - v20335 = add v20333, v20334 - v20336 = array_set mut v20326, index v20325, value v20335 - enable_side_effects u1 1 - v20337 = array_get v1, index u32 345 - enable_side_effects v20337 - v20338 = array_get v2, index u32 345 - v20339 = cast v20338 as u32 - v20340 = array_set v20336, index v20339, value Field 345 - v20342 = not v20337 - v20343 = array_get v20340, index v20339 - v20344 = array_get v20336, index v20339 - v20345 = cast v20337 as Field - v20346 = cast v20342 as Field - v20347 = mul v20345, v20343 - v20348 = mul v20346, v20344 - v20349 = add v20347, v20348 - v20350 = array_set mut v20340, index v20339, value v20349 - enable_side_effects u1 1 - v20351 = array_get v1, index u32 346 - enable_side_effects v20351 - v20352 = array_get v2, index u32 346 - v20353 = cast v20352 as u32 - v20354 = array_set v20350, index v20353, value Field 346 - v20356 = not v20351 - v20357 = array_get v20354, index v20353 - v20358 = array_get v20350, index v20353 - v20359 = cast v20351 as Field - v20360 = cast v20356 as Field - v20361 = mul v20359, v20357 - v20362 = mul v20360, v20358 - v20363 = add v20361, v20362 - v20364 = array_set mut v20354, index v20353, value v20363 - enable_side_effects u1 1 - v20365 = array_get v1, index u32 347 - enable_side_effects v20365 - v20366 = array_get v2, index u32 347 - v20367 = cast v20366 as u32 - v20368 = array_set v20364, index v20367, value Field 347 - v20370 = not v20365 - v20371 = array_get v20368, index v20367 - v20372 = array_get v20364, index v20367 - v20373 = cast v20365 as Field - v20374 = cast v20370 as Field - v20375 = mul v20373, v20371 - v20376 = mul v20374, v20372 - v20377 = add v20375, v20376 - v20378 = array_set mut v20368, index v20367, value v20377 - enable_side_effects u1 1 - v20379 = array_get v1, index u32 348 - enable_side_effects v20379 - v20380 = array_get v2, index u32 348 - v20381 = cast v20380 as u32 - v20382 = array_set v20378, index v20381, value Field 348 - v20384 = not v20379 - v20385 = array_get v20382, index v20381 - v20386 = array_get v20378, index v20381 - v20387 = cast v20379 as Field - v20388 = cast v20384 as Field - v20389 = mul v20387, v20385 - v20390 = mul v20388, v20386 - v20391 = add v20389, v20390 - v20392 = array_set mut v20382, index v20381, value v20391 - enable_side_effects u1 1 - v20393 = array_get v1, index u32 349 - enable_side_effects v20393 - v20394 = array_get v2, index u32 349 - v20395 = cast v20394 as u32 - v20396 = array_set v20392, index v20395, value Field 349 - v20398 = not v20393 - v20399 = array_get v20396, index v20395 - v20400 = array_get v20392, index v20395 - v20401 = cast v20393 as Field - v20402 = cast v20398 as Field - v20403 = mul v20401, v20399 - v20404 = mul v20402, v20400 - v20405 = add v20403, v20404 - v20406 = array_set mut v20396, index v20395, value v20405 - enable_side_effects u1 1 - v20407 = array_get v1, index u32 350 - enable_side_effects v20407 - v20408 = array_get v2, index u32 350 - v20409 = cast v20408 as u32 - v20410 = array_set v20406, index v20409, value Field 350 - v20412 = not v20407 - v20413 = array_get v20410, index v20409 - v20414 = array_get v20406, index v20409 - v20415 = cast v20407 as Field - v20416 = cast v20412 as Field - v20417 = mul v20415, v20413 - v20418 = mul v20416, v20414 - v20419 = add v20417, v20418 - v20420 = array_set mut v20410, index v20409, value v20419 - enable_side_effects u1 1 - v20421 = array_get v1, index u32 351 - enable_side_effects v20421 - v20422 = array_get v2, index u32 351 - v20423 = cast v20422 as u32 - v20424 = array_set v20420, index v20423, value Field 351 - v20426 = not v20421 - v20427 = array_get v20424, index v20423 - v20428 = array_get v20420, index v20423 - v20429 = cast v20421 as Field - v20430 = cast v20426 as Field - v20431 = mul v20429, v20427 - v20432 = mul v20430, v20428 - v20433 = add v20431, v20432 - v20434 = array_set mut v20424, index v20423, value v20433 - enable_side_effects u1 1 - v20435 = array_get v1, index u32 2⁴×22 - enable_side_effects v20435 - v20436 = array_get v2, index u32 2⁴×22 - v20437 = cast v20436 as u32 - v20438 = array_set v20434, index v20437, value Field 2⁴×22 - v20440 = not v20435 - v20441 = array_get v20438, index v20437 - v20442 = array_get v20434, index v20437 - v20443 = cast v20435 as Field - v20444 = cast v20440 as Field - v20445 = mul v20443, v20441 - v20446 = mul v20444, v20442 - v20447 = add v20445, v20446 - v20448 = array_set mut v20438, index v20437, value v20447 - enable_side_effects u1 1 - v20449 = array_get v1, index u32 353 - enable_side_effects v20449 - v20450 = array_get v2, index u32 353 - v20451 = cast v20450 as u32 - v20452 = array_set v20448, index v20451, value Field 353 - v20454 = not v20449 - v20455 = array_get v20452, index v20451 - v20456 = array_get v20448, index v20451 - v20457 = cast v20449 as Field - v20458 = cast v20454 as Field - v20459 = mul v20457, v20455 - v20460 = mul v20458, v20456 - v20461 = add v20459, v20460 - v20462 = array_set mut v20452, index v20451, value v20461 - enable_side_effects u1 1 - v20463 = array_get v1, index u32 354 - enable_side_effects v20463 - v20464 = array_get v2, index u32 354 - v20465 = cast v20464 as u32 - v20466 = array_set v20462, index v20465, value Field 354 - v20468 = not v20463 - v20469 = array_get v20466, index v20465 - v20470 = array_get v20462, index v20465 - v20471 = cast v20463 as Field - v20472 = cast v20468 as Field - v20473 = mul v20471, v20469 - v20474 = mul v20472, v20470 - v20475 = add v20473, v20474 - v20476 = array_set mut v20466, index v20465, value v20475 - enable_side_effects u1 1 - v20477 = array_get v1, index u32 355 - enable_side_effects v20477 - v20478 = array_get v2, index u32 355 - v20479 = cast v20478 as u32 - v20480 = array_set v20476, index v20479, value Field 355 - v20482 = not v20477 - v20483 = array_get v20480, index v20479 - v20484 = array_get v20476, index v20479 - v20485 = cast v20477 as Field - v20486 = cast v20482 as Field - v20487 = mul v20485, v20483 - v20488 = mul v20486, v20484 - v20489 = add v20487, v20488 - v20490 = array_set mut v20480, index v20479, value v20489 - enable_side_effects u1 1 - v20491 = array_get v1, index u32 356 - enable_side_effects v20491 - v20492 = array_get v2, index u32 356 - v20493 = cast v20492 as u32 - v20494 = array_set v20490, index v20493, value Field 356 - v20496 = not v20491 - v20497 = array_get v20494, index v20493 - v20498 = array_get v20490, index v20493 - v20499 = cast v20491 as Field - v20500 = cast v20496 as Field - v20501 = mul v20499, v20497 - v20502 = mul v20500, v20498 - v20503 = add v20501, v20502 - v20504 = array_set mut v20494, index v20493, value v20503 - enable_side_effects u1 1 - v20505 = array_get v1, index u32 357 - enable_side_effects v20505 - v20506 = array_get v2, index u32 357 - v20507 = cast v20506 as u32 - v20508 = array_set v20504, index v20507, value Field 357 - v20510 = not v20505 - v20511 = array_get v20508, index v20507 - v20512 = array_get v20504, index v20507 - v20513 = cast v20505 as Field - v20514 = cast v20510 as Field - v20515 = mul v20513, v20511 - v20516 = mul v20514, v20512 - v20517 = add v20515, v20516 - v20518 = array_set mut v20508, index v20507, value v20517 - enable_side_effects u1 1 - v20519 = array_get v1, index u32 358 - enable_side_effects v20519 - v20520 = array_get v2, index u32 358 - v20521 = cast v20520 as u32 - v20522 = array_set v20518, index v20521, value Field 358 - v20524 = not v20519 - v20525 = array_get v20522, index v20521 - v20526 = array_get v20518, index v20521 - v20527 = cast v20519 as Field - v20528 = cast v20524 as Field - v20529 = mul v20527, v20525 - v20530 = mul v20528, v20526 - v20531 = add v20529, v20530 - v20532 = array_set mut v20522, index v20521, value v20531 - enable_side_effects u1 1 - v20533 = array_get v1, index u32 359 - enable_side_effects v20533 - v20534 = array_get v2, index u32 359 - v20535 = cast v20534 as u32 - v20536 = array_set v20532, index v20535, value Field 359 - v20538 = not v20533 - v20539 = array_get v20536, index v20535 - v20540 = array_get v20532, index v20535 - v20541 = cast v20533 as Field - v20542 = cast v20538 as Field - v20543 = mul v20541, v20539 - v20544 = mul v20542, v20540 - v20545 = add v20543, v20544 - v20546 = array_set mut v20536, index v20535, value v20545 - enable_side_effects u1 1 - v20547 = array_get v1, index u32 360 - enable_side_effects v20547 - v20548 = array_get v2, index u32 360 - v20549 = cast v20548 as u32 - v20550 = array_set v20546, index v20549, value Field 360 - v20552 = not v20547 - v20553 = array_get v20550, index v20549 - v20554 = array_get v20546, index v20549 - v20555 = cast v20547 as Field - v20556 = cast v20552 as Field - v20557 = mul v20555, v20553 - v20558 = mul v20556, v20554 - v20559 = add v20557, v20558 - v20560 = array_set mut v20550, index v20549, value v20559 - enable_side_effects u1 1 - v20561 = array_get v1, index u32 361 - enable_side_effects v20561 - v20562 = array_get v2, index u32 361 - v20563 = cast v20562 as u32 - v20564 = array_set v20560, index v20563, value Field 361 - v20566 = not v20561 - v20567 = array_get v20564, index v20563 - v20568 = array_get v20560, index v20563 - v20569 = cast v20561 as Field - v20570 = cast v20566 as Field - v20571 = mul v20569, v20567 - v20572 = mul v20570, v20568 - v20573 = add v20571, v20572 - v20574 = array_set mut v20564, index v20563, value v20573 - enable_side_effects u1 1 - v20575 = array_get v1, index u32 362 - enable_side_effects v20575 - v20576 = array_get v2, index u32 362 - v20577 = cast v20576 as u32 - v20578 = array_set v20574, index v20577, value Field 362 - v20580 = not v20575 - v20581 = array_get v20578, index v20577 - v20582 = array_get v20574, index v20577 - v20583 = cast v20575 as Field - v20584 = cast v20580 as Field - v20585 = mul v20583, v20581 - v20586 = mul v20584, v20582 - v20587 = add v20585, v20586 - v20588 = array_set mut v20578, index v20577, value v20587 - enable_side_effects u1 1 - v20589 = array_get v1, index u32 363 - enable_side_effects v20589 - v20590 = array_get v2, index u32 363 - v20591 = cast v20590 as u32 - v20592 = array_set v20588, index v20591, value Field 363 - v20594 = not v20589 - v20595 = array_get v20592, index v20591 - v20596 = array_get v20588, index v20591 - v20597 = cast v20589 as Field - v20598 = cast v20594 as Field - v20599 = mul v20597, v20595 - v20600 = mul v20598, v20596 - v20601 = add v20599, v20600 - v20602 = array_set mut v20592, index v20591, value v20601 - enable_side_effects u1 1 - v20603 = array_get v1, index u32 364 - enable_side_effects v20603 - v20604 = array_get v2, index u32 364 - v20605 = cast v20604 as u32 - v20606 = array_set v20602, index v20605, value Field 364 - v20608 = not v20603 - v20609 = array_get v20606, index v20605 - v20610 = array_get v20602, index v20605 - v20611 = cast v20603 as Field - v20612 = cast v20608 as Field - v20613 = mul v20611, v20609 - v20614 = mul v20612, v20610 - v20615 = add v20613, v20614 - v20616 = array_set mut v20606, index v20605, value v20615 - enable_side_effects u1 1 - v20617 = array_get v1, index u32 365 - enable_side_effects v20617 - v20618 = array_get v2, index u32 365 - v20619 = cast v20618 as u32 - v20620 = array_set v20616, index v20619, value Field 365 - v20622 = not v20617 - v20623 = array_get v20620, index v20619 - v20624 = array_get v20616, index v20619 - v20625 = cast v20617 as Field - v20626 = cast v20622 as Field - v20627 = mul v20625, v20623 - v20628 = mul v20626, v20624 - v20629 = add v20627, v20628 - v20630 = array_set mut v20620, index v20619, value v20629 - enable_side_effects u1 1 - v20631 = array_get v1, index u32 366 - enable_side_effects v20631 - v20632 = array_get v2, index u32 366 - v20633 = cast v20632 as u32 - v20634 = array_set v20630, index v20633, value Field 366 - v20636 = not v20631 - v20637 = array_get v20634, index v20633 - v20638 = array_get v20630, index v20633 - v20639 = cast v20631 as Field - v20640 = cast v20636 as Field - v20641 = mul v20639, v20637 - v20642 = mul v20640, v20638 - v20643 = add v20641, v20642 - v20644 = array_set mut v20634, index v20633, value v20643 - enable_side_effects u1 1 - v20645 = array_get v1, index u32 367 - enable_side_effects v20645 - v20646 = array_get v2, index u32 367 - v20647 = cast v20646 as u32 - v20648 = array_set v20644, index v20647, value Field 367 - v20650 = not v20645 - v20651 = array_get v20648, index v20647 - v20652 = array_get v20644, index v20647 - v20653 = cast v20645 as Field - v20654 = cast v20650 as Field - v20655 = mul v20653, v20651 - v20656 = mul v20654, v20652 - v20657 = add v20655, v20656 - v20658 = array_set mut v20648, index v20647, value v20657 - enable_side_effects u1 1 - v20659 = array_get v1, index u32 2⁴×23 - enable_side_effects v20659 - v20660 = array_get v2, index u32 2⁴×23 - v20661 = cast v20660 as u32 - v20662 = array_set v20658, index v20661, value Field 2⁴×23 - v20664 = not v20659 - v20665 = array_get v20662, index v20661 - v20666 = array_get v20658, index v20661 - v20667 = cast v20659 as Field - v20668 = cast v20664 as Field - v20669 = mul v20667, v20665 - v20670 = mul v20668, v20666 - v20671 = add v20669, v20670 - v20672 = array_set mut v20662, index v20661, value v20671 - enable_side_effects u1 1 - v20673 = array_get v1, index u32 369 - enable_side_effects v20673 - v20674 = array_get v2, index u32 369 - v20675 = cast v20674 as u32 - v20676 = array_set v20672, index v20675, value Field 369 - v20678 = not v20673 - v20679 = array_get v20676, index v20675 - v20680 = array_get v20672, index v20675 - v20681 = cast v20673 as Field - v20682 = cast v20678 as Field - v20683 = mul v20681, v20679 - v20684 = mul v20682, v20680 - v20685 = add v20683, v20684 - v20686 = array_set mut v20676, index v20675, value v20685 - enable_side_effects u1 1 - v20687 = array_get v1, index u32 370 - enable_side_effects v20687 - v20688 = array_get v2, index u32 370 - v20689 = cast v20688 as u32 - v20690 = array_set v20686, index v20689, value Field 370 - v20692 = not v20687 - v20693 = array_get v20690, index v20689 - v20694 = array_get v20686, index v20689 - v20695 = cast v20687 as Field - v20696 = cast v20692 as Field - v20697 = mul v20695, v20693 - v20698 = mul v20696, v20694 - v20699 = add v20697, v20698 - v20700 = array_set mut v20690, index v20689, value v20699 - enable_side_effects u1 1 - v20701 = array_get v1, index u32 371 - enable_side_effects v20701 - v20702 = array_get v2, index u32 371 - v20703 = cast v20702 as u32 - v20704 = array_set v20700, index v20703, value Field 371 - v20706 = not v20701 - v20707 = array_get v20704, index v20703 - v20708 = array_get v20700, index v20703 - v20709 = cast v20701 as Field - v20710 = cast v20706 as Field - v20711 = mul v20709, v20707 - v20712 = mul v20710, v20708 - v20713 = add v20711, v20712 - v20714 = array_set mut v20704, index v20703, value v20713 - enable_side_effects u1 1 - v20715 = array_get v1, index u32 372 - enable_side_effects v20715 - v20716 = array_get v2, index u32 372 - v20717 = cast v20716 as u32 - v20718 = array_set v20714, index v20717, value Field 372 - v20720 = not v20715 - v20721 = array_get v20718, index v20717 - v20722 = array_get v20714, index v20717 - v20723 = cast v20715 as Field - v20724 = cast v20720 as Field - v20725 = mul v20723, v20721 - v20726 = mul v20724, v20722 - v20727 = add v20725, v20726 - v20728 = array_set mut v20718, index v20717, value v20727 - enable_side_effects u1 1 - v20729 = array_get v1, index u32 373 - enable_side_effects v20729 - v20730 = array_get v2, index u32 373 - v20731 = cast v20730 as u32 - v20732 = array_set v20728, index v20731, value Field 373 - v20734 = not v20729 - v20735 = array_get v20732, index v20731 - v20736 = array_get v20728, index v20731 - v20737 = cast v20729 as Field - v20738 = cast v20734 as Field - v20739 = mul v20737, v20735 - v20740 = mul v20738, v20736 - v20741 = add v20739, v20740 - v20742 = array_set mut v20732, index v20731, value v20741 - enable_side_effects u1 1 - v20743 = array_get v1, index u32 374 - enable_side_effects v20743 - v20744 = array_get v2, index u32 374 - v20745 = cast v20744 as u32 - v20746 = array_set v20742, index v20745, value Field 374 - v20748 = not v20743 - v20749 = array_get v20746, index v20745 - v20750 = array_get v20742, index v20745 - v20751 = cast v20743 as Field - v20752 = cast v20748 as Field - v20753 = mul v20751, v20749 - v20754 = mul v20752, v20750 - v20755 = add v20753, v20754 - v20756 = array_set mut v20746, index v20745, value v20755 - enable_side_effects u1 1 - v20757 = array_get v1, index u32 375 - enable_side_effects v20757 - v20758 = array_get v2, index u32 375 - v20759 = cast v20758 as u32 - v20760 = array_set v20756, index v20759, value Field 375 - v20762 = not v20757 - v20763 = array_get v20760, index v20759 - v20764 = array_get v20756, index v20759 - v20765 = cast v20757 as Field - v20766 = cast v20762 as Field - v20767 = mul v20765, v20763 - v20768 = mul v20766, v20764 - v20769 = add v20767, v20768 - v20770 = array_set mut v20760, index v20759, value v20769 - enable_side_effects u1 1 - v20771 = array_get v1, index u32 376 - enable_side_effects v20771 - v20772 = array_get v2, index u32 376 - v20773 = cast v20772 as u32 - v20774 = array_set v20770, index v20773, value Field 376 - v20776 = not v20771 - v20777 = array_get v20774, index v20773 - v20778 = array_get v20770, index v20773 - v20779 = cast v20771 as Field - v20780 = cast v20776 as Field - v20781 = mul v20779, v20777 - v20782 = mul v20780, v20778 - v20783 = add v20781, v20782 - v20784 = array_set mut v20774, index v20773, value v20783 - enable_side_effects u1 1 - v20785 = array_get v1, index u32 377 - enable_side_effects v20785 - v20786 = array_get v2, index u32 377 - v20787 = cast v20786 as u32 - v20788 = array_set v20784, index v20787, value Field 377 - v20790 = not v20785 - v20791 = array_get v20788, index v20787 - v20792 = array_get v20784, index v20787 - v20793 = cast v20785 as Field - v20794 = cast v20790 as Field - v20795 = mul v20793, v20791 - v20796 = mul v20794, v20792 - v20797 = add v20795, v20796 - v20798 = array_set mut v20788, index v20787, value v20797 - enable_side_effects u1 1 - v20799 = array_get v1, index u32 378 - enable_side_effects v20799 - v20800 = array_get v2, index u32 378 - v20801 = cast v20800 as u32 - v20802 = array_set v20798, index v20801, value Field 378 - v20804 = not v20799 - v20805 = array_get v20802, index v20801 - v20806 = array_get v20798, index v20801 - v20807 = cast v20799 as Field - v20808 = cast v20804 as Field - v20809 = mul v20807, v20805 - v20810 = mul v20808, v20806 - v20811 = add v20809, v20810 - v20812 = array_set mut v20802, index v20801, value v20811 - enable_side_effects u1 1 - v20813 = array_get v1, index u32 379 - enable_side_effects v20813 - v20814 = array_get v2, index u32 379 - v20815 = cast v20814 as u32 - v20816 = array_set v20812, index v20815, value Field 379 - v20818 = not v20813 - v20819 = array_get v20816, index v20815 - v20820 = array_get v20812, index v20815 - v20821 = cast v20813 as Field - v20822 = cast v20818 as Field - v20823 = mul v20821, v20819 - v20824 = mul v20822, v20820 - v20825 = add v20823, v20824 - v20826 = array_set mut v20816, index v20815, value v20825 - enable_side_effects u1 1 - v20827 = array_get v1, index u32 380 - enable_side_effects v20827 - v20828 = array_get v2, index u32 380 - v20829 = cast v20828 as u32 - v20830 = array_set v20826, index v20829, value Field 380 - v20832 = not v20827 - v20833 = array_get v20830, index v20829 - v20834 = array_get v20826, index v20829 - v20835 = cast v20827 as Field - v20836 = cast v20832 as Field - v20837 = mul v20835, v20833 - v20838 = mul v20836, v20834 - v20839 = add v20837, v20838 - v20840 = array_set mut v20830, index v20829, value v20839 - enable_side_effects u1 1 - v20841 = array_get v1, index u32 381 - enable_side_effects v20841 - v20842 = array_get v2, index u32 381 - v20843 = cast v20842 as u32 - v20844 = array_set v20840, index v20843, value Field 381 - v20846 = not v20841 - v20847 = array_get v20844, index v20843 - v20848 = array_get v20840, index v20843 - v20849 = cast v20841 as Field - v20850 = cast v20846 as Field - v20851 = mul v20849, v20847 - v20852 = mul v20850, v20848 - v20853 = add v20851, v20852 - v20854 = array_set mut v20844, index v20843, value v20853 - enable_side_effects u1 1 - v20855 = array_get v1, index u32 382 - enable_side_effects v20855 - v20856 = array_get v2, index u32 382 - v20857 = cast v20856 as u32 - v20858 = array_set v20854, index v20857, value Field 382 - v20860 = not v20855 - v20861 = array_get v20858, index v20857 - v20862 = array_get v20854, index v20857 - v20863 = cast v20855 as Field - v20864 = cast v20860 as Field - v20865 = mul v20863, v20861 - v20866 = mul v20864, v20862 - v20867 = add v20865, v20866 - v20868 = array_set mut v20858, index v20857, value v20867 - enable_side_effects u1 1 - v20869 = array_get v1, index u32 383 - enable_side_effects v20869 - v20870 = array_get v2, index u32 383 - v20871 = cast v20870 as u32 - v20872 = array_set v20868, index v20871, value Field 383 - v20874 = not v20869 - v20875 = array_get v20872, index v20871 - v20876 = array_get v20868, index v20871 - v20877 = cast v20869 as Field - v20878 = cast v20874 as Field - v20879 = mul v20877, v20875 - v20880 = mul v20878, v20876 - v20881 = add v20879, v20880 - v20882 = array_set mut v20872, index v20871, value v20881 - enable_side_effects u1 1 - v20883 = array_get v1, index u32 2⁴×24 - enable_side_effects v20883 - v20884 = array_get v2, index u32 2⁴×24 - v20885 = cast v20884 as u32 - v20886 = array_set v20882, index v20885, value Field 2⁴×24 - v20888 = not v20883 - v20889 = array_get v20886, index v20885 - v20890 = array_get v20882, index v20885 - v20891 = cast v20883 as Field - v20892 = cast v20888 as Field - v20893 = mul v20891, v20889 - v20894 = mul v20892, v20890 - v20895 = add v20893, v20894 - v20896 = array_set mut v20886, index v20885, value v20895 - enable_side_effects u1 1 - v20897 = array_get v1, index u32 385 - enable_side_effects v20897 - v20898 = array_get v2, index u32 385 - v20899 = cast v20898 as u32 - v20900 = array_set v20896, index v20899, value Field 385 - v20902 = not v20897 - v20903 = array_get v20900, index v20899 - v20904 = array_get v20896, index v20899 - v20905 = cast v20897 as Field - v20906 = cast v20902 as Field - v20907 = mul v20905, v20903 - v20908 = mul v20906, v20904 - v20909 = add v20907, v20908 - v20910 = array_set mut v20900, index v20899, value v20909 - enable_side_effects u1 1 - v20911 = array_get v1, index u32 386 - enable_side_effects v20911 - v20912 = array_get v2, index u32 386 - v20913 = cast v20912 as u32 - v20914 = array_set v20910, index v20913, value Field 386 - v20916 = not v20911 - v20917 = array_get v20914, index v20913 - v20918 = array_get v20910, index v20913 - v20919 = cast v20911 as Field - v20920 = cast v20916 as Field - v20921 = mul v20919, v20917 - v20922 = mul v20920, v20918 - v20923 = add v20921, v20922 - v20924 = array_set mut v20914, index v20913, value v20923 - enable_side_effects u1 1 - v20925 = array_get v1, index u32 387 - enable_side_effects v20925 - v20926 = array_get v2, index u32 387 - v20927 = cast v20926 as u32 - v20928 = array_set v20924, index v20927, value Field 387 - v20930 = not v20925 - v20931 = array_get v20928, index v20927 - v20932 = array_get v20924, index v20927 - v20933 = cast v20925 as Field - v20934 = cast v20930 as Field - v20935 = mul v20933, v20931 - v20936 = mul v20934, v20932 - v20937 = add v20935, v20936 - v20938 = array_set mut v20928, index v20927, value v20937 - enable_side_effects u1 1 - v20939 = array_get v1, index u32 388 - enable_side_effects v20939 - v20940 = array_get v2, index u32 388 - v20941 = cast v20940 as u32 - v20942 = array_set v20938, index v20941, value Field 388 - v20944 = not v20939 - v20945 = array_get v20942, index v20941 - v20946 = array_get v20938, index v20941 - v20947 = cast v20939 as Field - v20948 = cast v20944 as Field - v20949 = mul v20947, v20945 - v20950 = mul v20948, v20946 - v20951 = add v20949, v20950 - v20952 = array_set mut v20942, index v20941, value v20951 - enable_side_effects u1 1 - v20953 = array_get v1, index u32 389 - enable_side_effects v20953 - v20954 = array_get v2, index u32 389 - v20955 = cast v20954 as u32 - v20956 = array_set v20952, index v20955, value Field 389 - v20958 = not v20953 - v20959 = array_get v20956, index v20955 - v20960 = array_get v20952, index v20955 - v20961 = cast v20953 as Field - v20962 = cast v20958 as Field - v20963 = mul v20961, v20959 - v20964 = mul v20962, v20960 - v20965 = add v20963, v20964 - v20966 = array_set mut v20956, index v20955, value v20965 - enable_side_effects u1 1 - v20967 = array_get v1, index u32 390 - enable_side_effects v20967 - v20968 = array_get v2, index u32 390 - v20969 = cast v20968 as u32 - v20970 = array_set v20966, index v20969, value Field 390 - v20972 = not v20967 - v20973 = array_get v20970, index v20969 - v20974 = array_get v20966, index v20969 - v20975 = cast v20967 as Field - v20976 = cast v20972 as Field - v20977 = mul v20975, v20973 - v20978 = mul v20976, v20974 - v20979 = add v20977, v20978 - v20980 = array_set mut v20970, index v20969, value v20979 - enable_side_effects u1 1 - v20981 = array_get v1, index u32 391 - enable_side_effects v20981 - v20982 = array_get v2, index u32 391 - v20983 = cast v20982 as u32 - v20984 = array_set v20980, index v20983, value Field 391 - v20986 = not v20981 - v20987 = array_get v20984, index v20983 - v20988 = array_get v20980, index v20983 - v20989 = cast v20981 as Field - v20990 = cast v20986 as Field - v20991 = mul v20989, v20987 - v20992 = mul v20990, v20988 - v20993 = add v20991, v20992 - v20994 = array_set mut v20984, index v20983, value v20993 - enable_side_effects u1 1 - v20995 = array_get v1, index u32 392 - enable_side_effects v20995 - v20996 = array_get v2, index u32 392 - v20997 = cast v20996 as u32 - v20998 = array_set v20994, index v20997, value Field 392 - v21000 = not v20995 - v21001 = array_get v20998, index v20997 - v21002 = array_get v20994, index v20997 - v21003 = cast v20995 as Field - v21004 = cast v21000 as Field - v21005 = mul v21003, v21001 - v21006 = mul v21004, v21002 - v21007 = add v21005, v21006 - v21008 = array_set mut v20998, index v20997, value v21007 - enable_side_effects u1 1 - v21009 = array_get v1, index u32 393 - enable_side_effects v21009 - v21010 = array_get v2, index u32 393 - v21011 = cast v21010 as u32 - v21012 = array_set v21008, index v21011, value Field 393 - v21014 = not v21009 - v21015 = array_get v21012, index v21011 - v21016 = array_get v21008, index v21011 - v21017 = cast v21009 as Field - v21018 = cast v21014 as Field - v21019 = mul v21017, v21015 - v21020 = mul v21018, v21016 - v21021 = add v21019, v21020 - v21022 = array_set mut v21012, index v21011, value v21021 - enable_side_effects u1 1 - v21023 = array_get v1, index u32 394 - enable_side_effects v21023 - v21024 = array_get v2, index u32 394 - v21025 = cast v21024 as u32 - v21026 = array_set v21022, index v21025, value Field 394 - v21028 = not v21023 - v21029 = array_get v21026, index v21025 - v21030 = array_get v21022, index v21025 - v21031 = cast v21023 as Field - v21032 = cast v21028 as Field - v21033 = mul v21031, v21029 - v21034 = mul v21032, v21030 - v21035 = add v21033, v21034 - v21036 = array_set mut v21026, index v21025, value v21035 - enable_side_effects u1 1 - v21037 = array_get v1, index u32 395 - enable_side_effects v21037 - v21038 = array_get v2, index u32 395 - v21039 = cast v21038 as u32 - v21040 = array_set v21036, index v21039, value Field 395 - v21042 = not v21037 - v21043 = array_get v21040, index v21039 - v21044 = array_get v21036, index v21039 - v21045 = cast v21037 as Field - v21046 = cast v21042 as Field - v21047 = mul v21045, v21043 - v21048 = mul v21046, v21044 - v21049 = add v21047, v21048 - v21050 = array_set mut v21040, index v21039, value v21049 - enable_side_effects u1 1 - v21051 = array_get v1, index u32 396 - enable_side_effects v21051 - v21052 = array_get v2, index u32 396 - v21053 = cast v21052 as u32 - v21054 = array_set v21050, index v21053, value Field 396 - v21056 = not v21051 - v21057 = array_get v21054, index v21053 - v21058 = array_get v21050, index v21053 - v21059 = cast v21051 as Field - v21060 = cast v21056 as Field - v21061 = mul v21059, v21057 - v21062 = mul v21060, v21058 - v21063 = add v21061, v21062 - v21064 = array_set mut v21054, index v21053, value v21063 - enable_side_effects u1 1 - v21065 = array_get v1, index u32 397 - enable_side_effects v21065 - v21066 = array_get v2, index u32 397 - v21067 = cast v21066 as u32 - v21068 = array_set v21064, index v21067, value Field 397 - v21070 = not v21065 - v21071 = array_get v21068, index v21067 - v21072 = array_get v21064, index v21067 - v21073 = cast v21065 as Field - v21074 = cast v21070 as Field - v21075 = mul v21073, v21071 - v21076 = mul v21074, v21072 - v21077 = add v21075, v21076 - v21078 = array_set mut v21068, index v21067, value v21077 - enable_side_effects u1 1 - v21079 = array_get v1, index u32 398 - enable_side_effects v21079 - v21080 = array_get v2, index u32 398 - v21081 = cast v21080 as u32 - v21082 = array_set v21078, index v21081, value Field 398 - v21084 = not v21079 - v21085 = array_get v21082, index v21081 - v21086 = array_get v21078, index v21081 - v21087 = cast v21079 as Field - v21088 = cast v21084 as Field - v21089 = mul v21087, v21085 - v21090 = mul v21088, v21086 - v21091 = add v21089, v21090 - v21092 = array_set mut v21082, index v21081, value v21091 - enable_side_effects u1 1 - v21093 = array_get v1, index u32 399 - enable_side_effects v21093 - v21094 = array_get v2, index u32 399 - v21095 = cast v21094 as u32 - v21096 = array_set v21092, index v21095, value Field 399 - v21098 = not v21093 - v21099 = array_get v21096, index v21095 - v21100 = array_get v21092, index v21095 - v21101 = cast v21093 as Field - v21102 = cast v21098 as Field - v21103 = mul v21101, v21099 - v21104 = mul v21102, v21100 - v21105 = add v21103, v21104 - v21106 = array_set mut v21096, index v21095, value v21105 - enable_side_effects u1 1 - v21107 = array_get v1, index u32 2⁴×25 - enable_side_effects v21107 - v21108 = array_get v2, index u32 2⁴×25 - v21109 = cast v21108 as u32 - v21110 = array_set v21106, index v21109, value Field 2⁴×25 - v21112 = not v21107 - v21113 = array_get v21110, index v21109 - v21114 = array_get v21106, index v21109 - v21115 = cast v21107 as Field - v21116 = cast v21112 as Field - v21117 = mul v21115, v21113 - v21118 = mul v21116, v21114 - v21119 = add v21117, v21118 - v21120 = array_set mut v21110, index v21109, value v21119 - enable_side_effects u1 1 - v21121 = array_get v1, index u32 401 - enable_side_effects v21121 - v21122 = array_get v2, index u32 401 - v21123 = cast v21122 as u32 - v21124 = array_set v21120, index v21123, value Field 401 - v21126 = not v21121 - v21127 = array_get v21124, index v21123 - v21128 = array_get v21120, index v21123 - v21129 = cast v21121 as Field - v21130 = cast v21126 as Field - v21131 = mul v21129, v21127 - v21132 = mul v21130, v21128 - v21133 = add v21131, v21132 - v21134 = array_set mut v21124, index v21123, value v21133 - enable_side_effects u1 1 - v21135 = array_get v1, index u32 402 - enable_side_effects v21135 - v21136 = array_get v2, index u32 402 - v21137 = cast v21136 as u32 - v21138 = array_set v21134, index v21137, value Field 402 - v21140 = not v21135 - v21141 = array_get v21138, index v21137 - v21142 = array_get v21134, index v21137 - v21143 = cast v21135 as Field - v21144 = cast v21140 as Field - v21145 = mul v21143, v21141 - v21146 = mul v21144, v21142 - v21147 = add v21145, v21146 - v21148 = array_set mut v21138, index v21137, value v21147 - enable_side_effects u1 1 - v21149 = array_get v1, index u32 403 - enable_side_effects v21149 - v21150 = array_get v2, index u32 403 - v21151 = cast v21150 as u32 - v21152 = array_set v21148, index v21151, value Field 403 - v21154 = not v21149 - v21155 = array_get v21152, index v21151 - v21156 = array_get v21148, index v21151 - v21157 = cast v21149 as Field - v21158 = cast v21154 as Field - v21159 = mul v21157, v21155 - v21160 = mul v21158, v21156 - v21161 = add v21159, v21160 - v21162 = array_set mut v21152, index v21151, value v21161 - enable_side_effects u1 1 - v21163 = array_get v1, index u32 404 - enable_side_effects v21163 - v21164 = array_get v2, index u32 404 - v21165 = cast v21164 as u32 - v21166 = array_set v21162, index v21165, value Field 404 - v21168 = not v21163 - v21169 = array_get v21166, index v21165 - v21170 = array_get v21162, index v21165 - v21171 = cast v21163 as Field - v21172 = cast v21168 as Field - v21173 = mul v21171, v21169 - v21174 = mul v21172, v21170 - v21175 = add v21173, v21174 - v21176 = array_set mut v21166, index v21165, value v21175 - enable_side_effects u1 1 - v21177 = array_get v1, index u32 405 - enable_side_effects v21177 - v21178 = array_get v2, index u32 405 - v21179 = cast v21178 as u32 - v21180 = array_set v21176, index v21179, value Field 405 - v21182 = not v21177 - v21183 = array_get v21180, index v21179 - v21184 = array_get v21176, index v21179 - v21185 = cast v21177 as Field - v21186 = cast v21182 as Field - v21187 = mul v21185, v21183 - v21188 = mul v21186, v21184 - v21189 = add v21187, v21188 - v21190 = array_set mut v21180, index v21179, value v21189 - enable_side_effects u1 1 - v21191 = array_get v1, index u32 406 - enable_side_effects v21191 - v21192 = array_get v2, index u32 406 - v21193 = cast v21192 as u32 - v21194 = array_set v21190, index v21193, value Field 406 - v21196 = not v21191 - v21197 = array_get v21194, index v21193 - v21198 = array_get v21190, index v21193 - v21199 = cast v21191 as Field - v21200 = cast v21196 as Field - v21201 = mul v21199, v21197 - v21202 = mul v21200, v21198 - v21203 = add v21201, v21202 - v21204 = array_set mut v21194, index v21193, value v21203 - enable_side_effects u1 1 - v21205 = array_get v1, index u32 407 - enable_side_effects v21205 - v21206 = array_get v2, index u32 407 - v21207 = cast v21206 as u32 - v21208 = array_set v21204, index v21207, value Field 407 - v21210 = not v21205 - v21211 = array_get v21208, index v21207 - v21212 = array_get v21204, index v21207 - v21213 = cast v21205 as Field - v21214 = cast v21210 as Field - v21215 = mul v21213, v21211 - v21216 = mul v21214, v21212 - v21217 = add v21215, v21216 - v21218 = array_set mut v21208, index v21207, value v21217 - enable_side_effects u1 1 - v21219 = array_get v1, index u32 408 - enable_side_effects v21219 - v21220 = array_get v2, index u32 408 - v21221 = cast v21220 as u32 - v21222 = array_set v21218, index v21221, value Field 408 - v21224 = not v21219 - v21225 = array_get v21222, index v21221 - v21226 = array_get v21218, index v21221 - v21227 = cast v21219 as Field - v21228 = cast v21224 as Field - v21229 = mul v21227, v21225 - v21230 = mul v21228, v21226 - v21231 = add v21229, v21230 - v21232 = array_set mut v21222, index v21221, value v21231 - enable_side_effects u1 1 - v21233 = array_get v1, index u32 409 - enable_side_effects v21233 - v21234 = array_get v2, index u32 409 - v21235 = cast v21234 as u32 - v21236 = array_set v21232, index v21235, value Field 409 - v21238 = not v21233 - v21239 = array_get v21236, index v21235 - v21240 = array_get v21232, index v21235 - v21241 = cast v21233 as Field - v21242 = cast v21238 as Field - v21243 = mul v21241, v21239 - v21244 = mul v21242, v21240 - v21245 = add v21243, v21244 - v21246 = array_set mut v21236, index v21235, value v21245 - enable_side_effects u1 1 - v21247 = array_get v1, index u32 410 - enable_side_effects v21247 - v21248 = array_get v2, index u32 410 - v21249 = cast v21248 as u32 - v21250 = array_set v21246, index v21249, value Field 410 - v21252 = not v21247 - v21253 = array_get v21250, index v21249 - v21254 = array_get v21246, index v21249 - v21255 = cast v21247 as Field - v21256 = cast v21252 as Field - v21257 = mul v21255, v21253 - v21258 = mul v21256, v21254 - v21259 = add v21257, v21258 - v21260 = array_set mut v21250, index v21249, value v21259 - enable_side_effects u1 1 - v21261 = array_get v1, index u32 411 - enable_side_effects v21261 - v21262 = array_get v2, index u32 411 - v21263 = cast v21262 as u32 - v21264 = array_set v21260, index v21263, value Field 411 - v21266 = not v21261 - v21267 = array_get v21264, index v21263 - v21268 = array_get v21260, index v21263 - v21269 = cast v21261 as Field - v21270 = cast v21266 as Field - v21271 = mul v21269, v21267 - v21272 = mul v21270, v21268 - v21273 = add v21271, v21272 - v21274 = array_set mut v21264, index v21263, value v21273 - enable_side_effects u1 1 - v21275 = array_get v1, index u32 412 - enable_side_effects v21275 - v21276 = array_get v2, index u32 412 - v21277 = cast v21276 as u32 - v21278 = array_set v21274, index v21277, value Field 412 - v21280 = not v21275 - v21281 = array_get v21278, index v21277 - v21282 = array_get v21274, index v21277 - v21283 = cast v21275 as Field - v21284 = cast v21280 as Field - v21285 = mul v21283, v21281 - v21286 = mul v21284, v21282 - v21287 = add v21285, v21286 - v21288 = array_set mut v21278, index v21277, value v21287 - enable_side_effects u1 1 - v21289 = array_get v1, index u32 413 - enable_side_effects v21289 - v21290 = array_get v2, index u32 413 - v21291 = cast v21290 as u32 - v21292 = array_set v21288, index v21291, value Field 413 - v21294 = not v21289 - v21295 = array_get v21292, index v21291 - v21296 = array_get v21288, index v21291 - v21297 = cast v21289 as Field - v21298 = cast v21294 as Field - v21299 = mul v21297, v21295 - v21300 = mul v21298, v21296 - v21301 = add v21299, v21300 - v21302 = array_set mut v21292, index v21291, value v21301 - enable_side_effects u1 1 - v21303 = array_get v1, index u32 414 - enable_side_effects v21303 - v21304 = array_get v2, index u32 414 - v21305 = cast v21304 as u32 - v21306 = array_set v21302, index v21305, value Field 414 - v21308 = not v21303 - v21309 = array_get v21306, index v21305 - v21310 = array_get v21302, index v21305 - v21311 = cast v21303 as Field - v21312 = cast v21308 as Field - v21313 = mul v21311, v21309 - v21314 = mul v21312, v21310 - v21315 = add v21313, v21314 - v21316 = array_set mut v21306, index v21305, value v21315 - enable_side_effects u1 1 - v21317 = array_get v1, index u32 415 - enable_side_effects v21317 - v21318 = array_get v2, index u32 415 - v21319 = cast v21318 as u32 - v21320 = array_set v21316, index v21319, value Field 415 - v21322 = not v21317 - v21323 = array_get v21320, index v21319 - v21324 = array_get v21316, index v21319 - v21325 = cast v21317 as Field - v21326 = cast v21322 as Field - v21327 = mul v21325, v21323 - v21328 = mul v21326, v21324 - v21329 = add v21327, v21328 - v21330 = array_set mut v21320, index v21319, value v21329 - enable_side_effects u1 1 - v21331 = array_get v1, index u32 2⁴×26 - enable_side_effects v21331 - v21332 = array_get v2, index u32 2⁴×26 - v21333 = cast v21332 as u32 - v21334 = array_set v21330, index v21333, value Field 2⁴×26 - v21336 = not v21331 - v21337 = array_get v21334, index v21333 - v21338 = array_get v21330, index v21333 - v21339 = cast v21331 as Field - v21340 = cast v21336 as Field - v21341 = mul v21339, v21337 - v21342 = mul v21340, v21338 - v21343 = add v21341, v21342 - v21344 = array_set mut v21334, index v21333, value v21343 - enable_side_effects u1 1 - v21345 = array_get v1, index u32 417 - enable_side_effects v21345 - v21346 = array_get v2, index u32 417 - v21347 = cast v21346 as u32 - v21348 = array_set v21344, index v21347, value Field 417 - v21350 = not v21345 - v21351 = array_get v21348, index v21347 - v21352 = array_get v21344, index v21347 - v21353 = cast v21345 as Field - v21354 = cast v21350 as Field - v21355 = mul v21353, v21351 - v21356 = mul v21354, v21352 - v21357 = add v21355, v21356 - v21358 = array_set mut v21348, index v21347, value v21357 - enable_side_effects u1 1 - v21359 = array_get v1, index u32 418 - enable_side_effects v21359 - v21360 = array_get v2, index u32 418 - v21361 = cast v21360 as u32 - v21362 = array_set v21358, index v21361, value Field 418 - v21364 = not v21359 - v21365 = array_get v21362, index v21361 - v21366 = array_get v21358, index v21361 - v21367 = cast v21359 as Field - v21368 = cast v21364 as Field - v21369 = mul v21367, v21365 - v21370 = mul v21368, v21366 - v21371 = add v21369, v21370 - v21372 = array_set mut v21362, index v21361, value v21371 - enable_side_effects u1 1 - v21373 = array_get v1, index u32 419 - enable_side_effects v21373 - v21374 = array_get v2, index u32 419 - v21375 = cast v21374 as u32 - v21376 = array_set v21372, index v21375, value Field 419 - v21378 = not v21373 - v21379 = array_get v21376, index v21375 - v21380 = array_get v21372, index v21375 - v21381 = cast v21373 as Field - v21382 = cast v21378 as Field - v21383 = mul v21381, v21379 - v21384 = mul v21382, v21380 - v21385 = add v21383, v21384 - v21386 = array_set mut v21376, index v21375, value v21385 - enable_side_effects u1 1 - v21387 = array_get v1, index u32 420 - enable_side_effects v21387 - v21388 = array_get v2, index u32 420 - v21389 = cast v21388 as u32 - v21390 = array_set v21386, index v21389, value Field 420 - v21392 = not v21387 - v21393 = array_get v21390, index v21389 - v21394 = array_get v21386, index v21389 - v21395 = cast v21387 as Field - v21396 = cast v21392 as Field - v21397 = mul v21395, v21393 - v21398 = mul v21396, v21394 - v21399 = add v21397, v21398 - v21400 = array_set mut v21390, index v21389, value v21399 - enable_side_effects u1 1 - v21401 = array_get v1, index u32 421 - enable_side_effects v21401 - v21402 = array_get v2, index u32 421 - v21403 = cast v21402 as u32 - v21404 = array_set v21400, index v21403, value Field 421 - v21406 = not v21401 - v21407 = array_get v21404, index v21403 - v21408 = array_get v21400, index v21403 - v21409 = cast v21401 as Field - v21410 = cast v21406 as Field - v21411 = mul v21409, v21407 - v21412 = mul v21410, v21408 - v21413 = add v21411, v21412 - v21414 = array_set mut v21404, index v21403, value v21413 - enable_side_effects u1 1 - v21415 = array_get v1, index u32 422 - enable_side_effects v21415 - v21416 = array_get v2, index u32 422 - v21417 = cast v21416 as u32 - v21418 = array_set v21414, index v21417, value Field 422 - v21420 = not v21415 - v21421 = array_get v21418, index v21417 - v21422 = array_get v21414, index v21417 - v21423 = cast v21415 as Field - v21424 = cast v21420 as Field - v21425 = mul v21423, v21421 - v21426 = mul v21424, v21422 - v21427 = add v21425, v21426 - v21428 = array_set mut v21418, index v21417, value v21427 - enable_side_effects u1 1 - v21429 = array_get v1, index u32 423 - enable_side_effects v21429 - v21430 = array_get v2, index u32 423 - v21431 = cast v21430 as u32 - v21432 = array_set v21428, index v21431, value Field 423 - v21434 = not v21429 - v21435 = array_get v21432, index v21431 - v21436 = array_get v21428, index v21431 - v21437 = cast v21429 as Field - v21438 = cast v21434 as Field - v21439 = mul v21437, v21435 - v21440 = mul v21438, v21436 - v21441 = add v21439, v21440 - v21442 = array_set mut v21432, index v21431, value v21441 - enable_side_effects u1 1 - v21443 = array_get v1, index u32 424 - enable_side_effects v21443 - v21444 = array_get v2, index u32 424 - v21445 = cast v21444 as u32 - v21446 = array_set v21442, index v21445, value Field 424 - v21448 = not v21443 - v21449 = array_get v21446, index v21445 - v21450 = array_get v21442, index v21445 - v21451 = cast v21443 as Field - v21452 = cast v21448 as Field - v21453 = mul v21451, v21449 - v21454 = mul v21452, v21450 - v21455 = add v21453, v21454 - v21456 = array_set mut v21446, index v21445, value v21455 - enable_side_effects u1 1 - v21457 = array_get v1, index u32 425 - enable_side_effects v21457 - v21458 = array_get v2, index u32 425 - v21459 = cast v21458 as u32 - v21460 = array_set v21456, index v21459, value Field 425 - v21462 = not v21457 - v21463 = array_get v21460, index v21459 - v21464 = array_get v21456, index v21459 - v21465 = cast v21457 as Field - v21466 = cast v21462 as Field - v21467 = mul v21465, v21463 - v21468 = mul v21466, v21464 - v21469 = add v21467, v21468 - v21470 = array_set mut v21460, index v21459, value v21469 - enable_side_effects u1 1 - v21471 = array_get v1, index u32 426 - enable_side_effects v21471 - v21472 = array_get v2, index u32 426 - v21473 = cast v21472 as u32 - v21474 = array_set v21470, index v21473, value Field 426 - v21476 = not v21471 - v21477 = array_get v21474, index v21473 - v21478 = array_get v21470, index v21473 - v21479 = cast v21471 as Field - v21480 = cast v21476 as Field - v21481 = mul v21479, v21477 - v21482 = mul v21480, v21478 - v21483 = add v21481, v21482 - v21484 = array_set mut v21474, index v21473, value v21483 - enable_side_effects u1 1 - v21485 = array_get v1, index u32 427 - enable_side_effects v21485 - v21486 = array_get v2, index u32 427 - v21487 = cast v21486 as u32 - v21488 = array_set v21484, index v21487, value Field 427 - v21490 = not v21485 - v21491 = array_get v21488, index v21487 - v21492 = array_get v21484, index v21487 - v21493 = cast v21485 as Field - v21494 = cast v21490 as Field - v21495 = mul v21493, v21491 - v21496 = mul v21494, v21492 - v21497 = add v21495, v21496 - v21498 = array_set mut v21488, index v21487, value v21497 - enable_side_effects u1 1 - v21499 = array_get v1, index u32 428 - enable_side_effects v21499 - v21500 = array_get v2, index u32 428 - v21501 = cast v21500 as u32 - v21502 = array_set v21498, index v21501, value Field 428 - v21504 = not v21499 - v21505 = array_get v21502, index v21501 - v21506 = array_get v21498, index v21501 - v21507 = cast v21499 as Field - v21508 = cast v21504 as Field - v21509 = mul v21507, v21505 - v21510 = mul v21508, v21506 - v21511 = add v21509, v21510 - v21512 = array_set mut v21502, index v21501, value v21511 - enable_side_effects u1 1 - v21513 = array_get v1, index u32 429 - enable_side_effects v21513 - v21514 = array_get v2, index u32 429 - v21515 = cast v21514 as u32 - v21516 = array_set v21512, index v21515, value Field 429 - v21518 = not v21513 - v21519 = array_get v21516, index v21515 - v21520 = array_get v21512, index v21515 - v21521 = cast v21513 as Field - v21522 = cast v21518 as Field - v21523 = mul v21521, v21519 - v21524 = mul v21522, v21520 - v21525 = add v21523, v21524 - v21526 = array_set mut v21516, index v21515, value v21525 - enable_side_effects u1 1 - v21527 = array_get v1, index u32 430 - enable_side_effects v21527 - v21528 = array_get v2, index u32 430 - v21529 = cast v21528 as u32 - v21530 = array_set v21526, index v21529, value Field 430 - v21532 = not v21527 - v21533 = array_get v21530, index v21529 - v21534 = array_get v21526, index v21529 - v21535 = cast v21527 as Field - v21536 = cast v21532 as Field - v21537 = mul v21535, v21533 - v21538 = mul v21536, v21534 - v21539 = add v21537, v21538 - v21540 = array_set mut v21530, index v21529, value v21539 - enable_side_effects u1 1 - v21541 = array_get v1, index u32 431 - enable_side_effects v21541 - v21542 = array_get v2, index u32 431 - v21543 = cast v21542 as u32 - v21544 = array_set v21540, index v21543, value Field 431 - v21546 = not v21541 - v21547 = array_get v21544, index v21543 - v21548 = array_get v21540, index v21543 - v21549 = cast v21541 as Field - v21550 = cast v21546 as Field - v21551 = mul v21549, v21547 - v21552 = mul v21550, v21548 - v21553 = add v21551, v21552 - v21554 = array_set mut v21544, index v21543, value v21553 - enable_side_effects u1 1 - v21555 = array_get v1, index u32 2⁴×27 - enable_side_effects v21555 - v21556 = array_get v2, index u32 2⁴×27 - v21557 = cast v21556 as u32 - v21558 = array_set v21554, index v21557, value Field 2⁴×27 - v21560 = not v21555 - v21561 = array_get v21558, index v21557 - v21562 = array_get v21554, index v21557 - v21563 = cast v21555 as Field - v21564 = cast v21560 as Field - v21565 = mul v21563, v21561 - v21566 = mul v21564, v21562 - v21567 = add v21565, v21566 - v21568 = array_set mut v21558, index v21557, value v21567 - enable_side_effects u1 1 - v21569 = array_get v1, index u32 433 - enable_side_effects v21569 - v21570 = array_get v2, index u32 433 - v21571 = cast v21570 as u32 - v21572 = array_set v21568, index v21571, value Field 433 - v21574 = not v21569 - v21575 = array_get v21572, index v21571 - v21576 = array_get v21568, index v21571 - v21577 = cast v21569 as Field - v21578 = cast v21574 as Field - v21579 = mul v21577, v21575 - v21580 = mul v21578, v21576 - v21581 = add v21579, v21580 - v21582 = array_set mut v21572, index v21571, value v21581 - enable_side_effects u1 1 - v21583 = array_get v1, index u32 434 - enable_side_effects v21583 - v21584 = array_get v2, index u32 434 - v21585 = cast v21584 as u32 - v21586 = array_set v21582, index v21585, value Field 434 - v21588 = not v21583 - v21589 = array_get v21586, index v21585 - v21590 = array_get v21582, index v21585 - v21591 = cast v21583 as Field - v21592 = cast v21588 as Field - v21593 = mul v21591, v21589 - v21594 = mul v21592, v21590 - v21595 = add v21593, v21594 - v21596 = array_set mut v21586, index v21585, value v21595 - enable_side_effects u1 1 - v21597 = array_get v1, index u32 435 - enable_side_effects v21597 - v21598 = array_get v2, index u32 435 - v21599 = cast v21598 as u32 - v21600 = array_set v21596, index v21599, value Field 435 - v21602 = not v21597 - v21603 = array_get v21600, index v21599 - v21604 = array_get v21596, index v21599 - v21605 = cast v21597 as Field - v21606 = cast v21602 as Field - v21607 = mul v21605, v21603 - v21608 = mul v21606, v21604 - v21609 = add v21607, v21608 - v21610 = array_set mut v21600, index v21599, value v21609 - enable_side_effects u1 1 - v21611 = array_get v1, index u32 436 - enable_side_effects v21611 - v21612 = array_get v2, index u32 436 - v21613 = cast v21612 as u32 - v21614 = array_set v21610, index v21613, value Field 436 - v21616 = not v21611 - v21617 = array_get v21614, index v21613 - v21618 = array_get v21610, index v21613 - v21619 = cast v21611 as Field - v21620 = cast v21616 as Field - v21621 = mul v21619, v21617 - v21622 = mul v21620, v21618 - v21623 = add v21621, v21622 - v21624 = array_set mut v21614, index v21613, value v21623 - enable_side_effects u1 1 - v21625 = array_get v1, index u32 437 - enable_side_effects v21625 - v21626 = array_get v2, index u32 437 - v21627 = cast v21626 as u32 - v21628 = array_set v21624, index v21627, value Field 437 - v21630 = not v21625 - v21631 = array_get v21628, index v21627 - v21632 = array_get v21624, index v21627 - v21633 = cast v21625 as Field - v21634 = cast v21630 as Field - v21635 = mul v21633, v21631 - v21636 = mul v21634, v21632 - v21637 = add v21635, v21636 - v21638 = array_set mut v21628, index v21627, value v21637 - enable_side_effects u1 1 - v21639 = array_get v1, index u32 438 - enable_side_effects v21639 - v21640 = array_get v2, index u32 438 - v21641 = cast v21640 as u32 - v21642 = array_set v21638, index v21641, value Field 438 - v21644 = not v21639 - v21645 = array_get v21642, index v21641 - v21646 = array_get v21638, index v21641 - v21647 = cast v21639 as Field - v21648 = cast v21644 as Field - v21649 = mul v21647, v21645 - v21650 = mul v21648, v21646 - v21651 = add v21649, v21650 - v21652 = array_set mut v21642, index v21641, value v21651 - enable_side_effects u1 1 - v21653 = array_get v1, index u32 439 - enable_side_effects v21653 - v21654 = array_get v2, index u32 439 - v21655 = cast v21654 as u32 - v21656 = array_set v21652, index v21655, value Field 439 - v21658 = not v21653 - v21659 = array_get v21656, index v21655 - v21660 = array_get v21652, index v21655 - v21661 = cast v21653 as Field - v21662 = cast v21658 as Field - v21663 = mul v21661, v21659 - v21664 = mul v21662, v21660 - v21665 = add v21663, v21664 - v21666 = array_set mut v21656, index v21655, value v21665 - enable_side_effects u1 1 - v21667 = array_get v1, index u32 440 - enable_side_effects v21667 - v21668 = array_get v2, index u32 440 - v21669 = cast v21668 as u32 - v21670 = array_set v21666, index v21669, value Field 440 - v21672 = not v21667 - v21673 = array_get v21670, index v21669 - v21674 = array_get v21666, index v21669 - v21675 = cast v21667 as Field - v21676 = cast v21672 as Field - v21677 = mul v21675, v21673 - v21678 = mul v21676, v21674 - v21679 = add v21677, v21678 - v21680 = array_set mut v21670, index v21669, value v21679 - enable_side_effects u1 1 - v21681 = array_get v1, index u32 441 - enable_side_effects v21681 - v21682 = array_get v2, index u32 441 - v21683 = cast v21682 as u32 - v21684 = array_set v21680, index v21683, value Field 441 - v21686 = not v21681 - v21687 = array_get v21684, index v21683 - v21688 = array_get v21680, index v21683 - v21689 = cast v21681 as Field - v21690 = cast v21686 as Field - v21691 = mul v21689, v21687 - v21692 = mul v21690, v21688 - v21693 = add v21691, v21692 - v21694 = array_set mut v21684, index v21683, value v21693 - enable_side_effects u1 1 - v21695 = array_get v1, index u32 442 - enable_side_effects v21695 - v21696 = array_get v2, index u32 442 - v21697 = cast v21696 as u32 - v21698 = array_set v21694, index v21697, value Field 442 - v21700 = not v21695 - v21701 = array_get v21698, index v21697 - v21702 = array_get v21694, index v21697 - v21703 = cast v21695 as Field - v21704 = cast v21700 as Field - v21705 = mul v21703, v21701 - v21706 = mul v21704, v21702 - v21707 = add v21705, v21706 - v21708 = array_set mut v21698, index v21697, value v21707 - enable_side_effects u1 1 - v21709 = array_get v1, index u32 443 - enable_side_effects v21709 - v21710 = array_get v2, index u32 443 - v21711 = cast v21710 as u32 - v21712 = array_set v21708, index v21711, value Field 443 - v21714 = not v21709 - v21715 = array_get v21712, index v21711 - v21716 = array_get v21708, index v21711 - v21717 = cast v21709 as Field - v21718 = cast v21714 as Field - v21719 = mul v21717, v21715 - v21720 = mul v21718, v21716 - v21721 = add v21719, v21720 - v21722 = array_set mut v21712, index v21711, value v21721 - enable_side_effects u1 1 - v21723 = array_get v1, index u32 444 - enable_side_effects v21723 - v21724 = array_get v2, index u32 444 - v21725 = cast v21724 as u32 - v21726 = array_set v21722, index v21725, value Field 444 - v21728 = not v21723 - v21729 = array_get v21726, index v21725 - v21730 = array_get v21722, index v21725 - v21731 = cast v21723 as Field - v21732 = cast v21728 as Field - v21733 = mul v21731, v21729 - v21734 = mul v21732, v21730 - v21735 = add v21733, v21734 - v21736 = array_set mut v21726, index v21725, value v21735 - enable_side_effects u1 1 - v21737 = array_get v1, index u32 445 - enable_side_effects v21737 - v21738 = array_get v2, index u32 445 - v21739 = cast v21738 as u32 - v21740 = array_set v21736, index v21739, value Field 445 - v21742 = not v21737 - v21743 = array_get v21740, index v21739 - v21744 = array_get v21736, index v21739 - v21745 = cast v21737 as Field - v21746 = cast v21742 as Field - v21747 = mul v21745, v21743 - v21748 = mul v21746, v21744 - v21749 = add v21747, v21748 - v21750 = array_set mut v21740, index v21739, value v21749 - enable_side_effects u1 1 - v21751 = array_get v1, index u32 446 - enable_side_effects v21751 - v21752 = array_get v2, index u32 446 - v21753 = cast v21752 as u32 - v21754 = array_set v21750, index v21753, value Field 446 - v21756 = not v21751 - v21757 = array_get v21754, index v21753 - v21758 = array_get v21750, index v21753 - v21759 = cast v21751 as Field - v21760 = cast v21756 as Field - v21761 = mul v21759, v21757 - v21762 = mul v21760, v21758 - v21763 = add v21761, v21762 - v21764 = array_set mut v21754, index v21753, value v21763 - enable_side_effects u1 1 - v21765 = array_get v1, index u32 447 - enable_side_effects v21765 - v21766 = array_get v2, index u32 447 - v21767 = cast v21766 as u32 - v21768 = array_set v21764, index v21767, value Field 447 - v21770 = not v21765 - v21771 = array_get v21768, index v21767 - v21772 = array_get v21764, index v21767 - v21773 = cast v21765 as Field - v21774 = cast v21770 as Field - v21775 = mul v21773, v21771 - v21776 = mul v21774, v21772 - v21777 = add v21775, v21776 - v21778 = array_set mut v21768, index v21767, value v21777 - enable_side_effects u1 1 - v21779 = array_get v1, index u32 2⁴×28 - enable_side_effects v21779 - v21780 = array_get v2, index u32 2⁴×28 - v21781 = cast v21780 as u32 - v21782 = array_set v21778, index v21781, value Field 2⁴×28 - v21784 = not v21779 - v21785 = array_get v21782, index v21781 - v21786 = array_get v21778, index v21781 - v21787 = cast v21779 as Field - v21788 = cast v21784 as Field - v21789 = mul v21787, v21785 - v21790 = mul v21788, v21786 - v21791 = add v21789, v21790 - v21792 = array_set mut v21782, index v21781, value v21791 - enable_side_effects u1 1 - v21793 = array_get v1, index u32 449 - enable_side_effects v21793 - v21794 = array_get v2, index u32 449 - v21795 = cast v21794 as u32 - v21796 = array_set v21792, index v21795, value Field 449 - v21798 = not v21793 - v21799 = array_get v21796, index v21795 - v21800 = array_get v21792, index v21795 - v21801 = cast v21793 as Field - v21802 = cast v21798 as Field - v21803 = mul v21801, v21799 - v21804 = mul v21802, v21800 - v21805 = add v21803, v21804 - v21806 = array_set mut v21796, index v21795, value v21805 - enable_side_effects u1 1 - v21807 = array_get v1, index u32 450 - enable_side_effects v21807 - v21808 = array_get v2, index u32 450 - v21809 = cast v21808 as u32 - v21810 = array_set v21806, index v21809, value Field 450 - v21812 = not v21807 - v21813 = array_get v21810, index v21809 - v21814 = array_get v21806, index v21809 - v21815 = cast v21807 as Field - v21816 = cast v21812 as Field - v21817 = mul v21815, v21813 - v21818 = mul v21816, v21814 - v21819 = add v21817, v21818 - v21820 = array_set mut v21810, index v21809, value v21819 - enable_side_effects u1 1 - v21821 = array_get v1, index u32 451 - enable_side_effects v21821 - v21822 = array_get v2, index u32 451 - v21823 = cast v21822 as u32 - v21824 = array_set v21820, index v21823, value Field 451 - v21826 = not v21821 - v21827 = array_get v21824, index v21823 - v21828 = array_get v21820, index v21823 - v21829 = cast v21821 as Field - v21830 = cast v21826 as Field - v21831 = mul v21829, v21827 - v21832 = mul v21830, v21828 - v21833 = add v21831, v21832 - v21834 = array_set mut v21824, index v21823, value v21833 - enable_side_effects u1 1 - v21835 = array_get v1, index u32 452 - enable_side_effects v21835 - v21836 = array_get v2, index u32 452 - v21837 = cast v21836 as u32 - v21838 = array_set v21834, index v21837, value Field 452 - v21840 = not v21835 - v21841 = array_get v21838, index v21837 - v21842 = array_get v21834, index v21837 - v21843 = cast v21835 as Field - v21844 = cast v21840 as Field - v21845 = mul v21843, v21841 - v21846 = mul v21844, v21842 - v21847 = add v21845, v21846 - v21848 = array_set mut v21838, index v21837, value v21847 - enable_side_effects u1 1 - v21849 = array_get v1, index u32 453 - enable_side_effects v21849 - v21850 = array_get v2, index u32 453 - v21851 = cast v21850 as u32 - v21852 = array_set v21848, index v21851, value Field 453 - v21854 = not v21849 - v21855 = array_get v21852, index v21851 - v21856 = array_get v21848, index v21851 - v21857 = cast v21849 as Field - v21858 = cast v21854 as Field - v21859 = mul v21857, v21855 - v21860 = mul v21858, v21856 - v21861 = add v21859, v21860 - v21862 = array_set mut v21852, index v21851, value v21861 - enable_side_effects u1 1 - v21863 = array_get v1, index u32 454 - enable_side_effects v21863 - v21864 = array_get v2, index u32 454 - v21865 = cast v21864 as u32 - v21866 = array_set v21862, index v21865, value Field 454 - v21868 = not v21863 - v21869 = array_get v21866, index v21865 - v21870 = array_get v21862, index v21865 - v21871 = cast v21863 as Field - v21872 = cast v21868 as Field - v21873 = mul v21871, v21869 - v21874 = mul v21872, v21870 - v21875 = add v21873, v21874 - v21876 = array_set mut v21866, index v21865, value v21875 - enable_side_effects u1 1 - v21877 = array_get v1, index u32 455 - enable_side_effects v21877 - v21878 = array_get v2, index u32 455 - v21879 = cast v21878 as u32 - v21880 = array_set v21876, index v21879, value Field 455 - v21882 = not v21877 - v21883 = array_get v21880, index v21879 - v21884 = array_get v21876, index v21879 - v21885 = cast v21877 as Field - v21886 = cast v21882 as Field - v21887 = mul v21885, v21883 - v21888 = mul v21886, v21884 - v21889 = add v21887, v21888 - v21890 = array_set mut v21880, index v21879, value v21889 - enable_side_effects u1 1 - v21891 = array_get v1, index u32 456 - enable_side_effects v21891 - v21892 = array_get v2, index u32 456 - v21893 = cast v21892 as u32 - v21894 = array_set v21890, index v21893, value Field 456 - v21896 = not v21891 - v21897 = array_get v21894, index v21893 - v21898 = array_get v21890, index v21893 - v21899 = cast v21891 as Field - v21900 = cast v21896 as Field - v21901 = mul v21899, v21897 - v21902 = mul v21900, v21898 - v21903 = add v21901, v21902 - v21904 = array_set mut v21894, index v21893, value v21903 - enable_side_effects u1 1 - v21905 = array_get v1, index u32 457 - enable_side_effects v21905 - v21906 = array_get v2, index u32 457 - v21907 = cast v21906 as u32 - v21908 = array_set v21904, index v21907, value Field 457 - v21910 = not v21905 - v21911 = array_get v21908, index v21907 - v21912 = array_get v21904, index v21907 - v21913 = cast v21905 as Field - v21914 = cast v21910 as Field - v21915 = mul v21913, v21911 - v21916 = mul v21914, v21912 - v21917 = add v21915, v21916 - v21918 = array_set mut v21908, index v21907, value v21917 - enable_side_effects u1 1 - v21919 = array_get v1, index u32 458 - enable_side_effects v21919 - v21920 = array_get v2, index u32 458 - v21921 = cast v21920 as u32 - v21922 = array_set v21918, index v21921, value Field 458 - v21924 = not v21919 - v21925 = array_get v21922, index v21921 - v21926 = array_get v21918, index v21921 - v21927 = cast v21919 as Field - v21928 = cast v21924 as Field - v21929 = mul v21927, v21925 - v21930 = mul v21928, v21926 - v21931 = add v21929, v21930 - v21932 = array_set mut v21922, index v21921, value v21931 - enable_side_effects u1 1 - v21933 = array_get v1, index u32 459 - enable_side_effects v21933 - v21934 = array_get v2, index u32 459 - v21935 = cast v21934 as u32 - v21936 = array_set v21932, index v21935, value Field 459 - v21938 = not v21933 - v21939 = array_get v21936, index v21935 - v21940 = array_get v21932, index v21935 - v21941 = cast v21933 as Field - v21942 = cast v21938 as Field - v21943 = mul v21941, v21939 - v21944 = mul v21942, v21940 - v21945 = add v21943, v21944 - v21946 = array_set mut v21936, index v21935, value v21945 - enable_side_effects u1 1 - v21947 = array_get v1, index u32 460 - enable_side_effects v21947 - v21948 = array_get v2, index u32 460 - v21949 = cast v21948 as u32 - v21950 = array_set v21946, index v21949, value Field 460 - v21952 = not v21947 - v21953 = array_get v21950, index v21949 - v21954 = array_get v21946, index v21949 - v21955 = cast v21947 as Field - v21956 = cast v21952 as Field - v21957 = mul v21955, v21953 - v21958 = mul v21956, v21954 - v21959 = add v21957, v21958 - v21960 = array_set mut v21950, index v21949, value v21959 - enable_side_effects u1 1 - v21961 = array_get v1, index u32 461 - enable_side_effects v21961 - v21962 = array_get v2, index u32 461 - v21963 = cast v21962 as u32 - v21964 = array_set v21960, index v21963, value Field 461 - v21966 = not v21961 - v21967 = array_get v21964, index v21963 - v21968 = array_get v21960, index v21963 - v21969 = cast v21961 as Field - v21970 = cast v21966 as Field - v21971 = mul v21969, v21967 - v21972 = mul v21970, v21968 - v21973 = add v21971, v21972 - v21974 = array_set mut v21964, index v21963, value v21973 - enable_side_effects u1 1 - v21975 = array_get v1, index u32 462 - enable_side_effects v21975 - v21976 = array_get v2, index u32 462 - v21977 = cast v21976 as u32 - v21978 = array_set v21974, index v21977, value Field 462 - v21980 = not v21975 - v21981 = array_get v21978, index v21977 - v21982 = array_get v21974, index v21977 - v21983 = cast v21975 as Field - v21984 = cast v21980 as Field - v21985 = mul v21983, v21981 - v21986 = mul v21984, v21982 - v21987 = add v21985, v21986 - v21988 = array_set mut v21978, index v21977, value v21987 - enable_side_effects u1 1 - v21989 = array_get v1, index u32 463 - enable_side_effects v21989 - v21990 = array_get v2, index u32 463 - v21991 = cast v21990 as u32 - v21992 = array_set v21988, index v21991, value Field 463 - v21994 = not v21989 - v21995 = array_get v21992, index v21991 - v21996 = array_get v21988, index v21991 - v21997 = cast v21989 as Field - v21998 = cast v21994 as Field - v21999 = mul v21997, v21995 - v22000 = mul v21998, v21996 - v22001 = add v21999, v22000 - v22002 = array_set mut v21992, index v21991, value v22001 - enable_side_effects u1 1 - v22003 = array_get v1, index u32 2⁴×29 - enable_side_effects v22003 - v22004 = array_get v2, index u32 2⁴×29 - v22005 = cast v22004 as u32 - v22006 = array_set v22002, index v22005, value Field 2⁴×29 - v22008 = not v22003 - v22009 = array_get v22006, index v22005 - v22010 = array_get v22002, index v22005 - v22011 = cast v22003 as Field - v22012 = cast v22008 as Field - v22013 = mul v22011, v22009 - v22014 = mul v22012, v22010 - v22015 = add v22013, v22014 - v22016 = array_set mut v22006, index v22005, value v22015 - enable_side_effects u1 1 - v22017 = array_get v1, index u32 465 - enable_side_effects v22017 - v22018 = array_get v2, index u32 465 - v22019 = cast v22018 as u32 - v22020 = array_set v22016, index v22019, value Field 465 - v22022 = not v22017 - v22023 = array_get v22020, index v22019 - v22024 = array_get v22016, index v22019 - v22025 = cast v22017 as Field - v22026 = cast v22022 as Field - v22027 = mul v22025, v22023 - v22028 = mul v22026, v22024 - v22029 = add v22027, v22028 - v22030 = array_set mut v22020, index v22019, value v22029 - enable_side_effects u1 1 - v22031 = array_get v1, index u32 466 - enable_side_effects v22031 - v22032 = array_get v2, index u32 466 - v22033 = cast v22032 as u32 - v22034 = array_set v22030, index v22033, value Field 466 - v22036 = not v22031 - v22037 = array_get v22034, index v22033 - v22038 = array_get v22030, index v22033 - v22039 = cast v22031 as Field - v22040 = cast v22036 as Field - v22041 = mul v22039, v22037 - v22042 = mul v22040, v22038 - v22043 = add v22041, v22042 - v22044 = array_set mut v22034, index v22033, value v22043 - enable_side_effects u1 1 - v22045 = array_get v1, index u32 467 - enable_side_effects v22045 - v22046 = array_get v2, index u32 467 - v22047 = cast v22046 as u32 - v22048 = array_set v22044, index v22047, value Field 467 - v22050 = not v22045 - v22051 = array_get v22048, index v22047 - v22052 = array_get v22044, index v22047 - v22053 = cast v22045 as Field - v22054 = cast v22050 as Field - v22055 = mul v22053, v22051 - v22056 = mul v22054, v22052 - v22057 = add v22055, v22056 - v22058 = array_set mut v22048, index v22047, value v22057 - enable_side_effects u1 1 - v22059 = array_get v1, index u32 468 - enable_side_effects v22059 - v22060 = array_get v2, index u32 468 - v22061 = cast v22060 as u32 - v22062 = array_set v22058, index v22061, value Field 468 - v22064 = not v22059 - v22065 = array_get v22062, index v22061 - v22066 = array_get v22058, index v22061 - v22067 = cast v22059 as Field - v22068 = cast v22064 as Field - v22069 = mul v22067, v22065 - v22070 = mul v22068, v22066 - v22071 = add v22069, v22070 - v22072 = array_set mut v22062, index v22061, value v22071 - enable_side_effects u1 1 - v22073 = array_get v1, index u32 469 - enable_side_effects v22073 - v22074 = array_get v2, index u32 469 - v22075 = cast v22074 as u32 - v22076 = array_set v22072, index v22075, value Field 469 - v22078 = not v22073 - v22079 = array_get v22076, index v22075 - v22080 = array_get v22072, index v22075 - v22081 = cast v22073 as Field - v22082 = cast v22078 as Field - v22083 = mul v22081, v22079 - v22084 = mul v22082, v22080 - v22085 = add v22083, v22084 - v22086 = array_set mut v22076, index v22075, value v22085 - enable_side_effects u1 1 - v22087 = array_get v1, index u32 470 - enable_side_effects v22087 - v22088 = array_get v2, index u32 470 - v22089 = cast v22088 as u32 - v22090 = array_set v22086, index v22089, value Field 470 - v22092 = not v22087 - v22093 = array_get v22090, index v22089 - v22094 = array_get v22086, index v22089 - v22095 = cast v22087 as Field - v22096 = cast v22092 as Field - v22097 = mul v22095, v22093 - v22098 = mul v22096, v22094 - v22099 = add v22097, v22098 - v22100 = array_set mut v22090, index v22089, value v22099 - enable_side_effects u1 1 - v22101 = array_get v1, index u32 471 - enable_side_effects v22101 - v22102 = array_get v2, index u32 471 - v22103 = cast v22102 as u32 - v22104 = array_set v22100, index v22103, value Field 471 - v22106 = not v22101 - v22107 = array_get v22104, index v22103 - v22108 = array_get v22100, index v22103 - v22109 = cast v22101 as Field - v22110 = cast v22106 as Field - v22111 = mul v22109, v22107 - v22112 = mul v22110, v22108 - v22113 = add v22111, v22112 - v22114 = array_set mut v22104, index v22103, value v22113 - enable_side_effects u1 1 - v22115 = array_get v1, index u32 472 - enable_side_effects v22115 - v22116 = array_get v2, index u32 472 - v22117 = cast v22116 as u32 - v22118 = array_set v22114, index v22117, value Field 472 - v22120 = not v22115 - v22121 = array_get v22118, index v22117 - v22122 = array_get v22114, index v22117 - v22123 = cast v22115 as Field - v22124 = cast v22120 as Field - v22125 = mul v22123, v22121 - v22126 = mul v22124, v22122 - v22127 = add v22125, v22126 - v22128 = array_set mut v22118, index v22117, value v22127 - enable_side_effects u1 1 - v22129 = array_get v1, index u32 473 - enable_side_effects v22129 - v22130 = array_get v2, index u32 473 - v22131 = cast v22130 as u32 - v22132 = array_set v22128, index v22131, value Field 473 - v22134 = not v22129 - v22135 = array_get v22132, index v22131 - v22136 = array_get v22128, index v22131 - v22137 = cast v22129 as Field - v22138 = cast v22134 as Field - v22139 = mul v22137, v22135 - v22140 = mul v22138, v22136 - v22141 = add v22139, v22140 - v22142 = array_set mut v22132, index v22131, value v22141 - enable_side_effects u1 1 - v22143 = array_get v1, index u32 474 - enable_side_effects v22143 - v22144 = array_get v2, index u32 474 - v22145 = cast v22144 as u32 - v22146 = array_set v22142, index v22145, value Field 474 - v22148 = not v22143 - v22149 = array_get v22146, index v22145 - v22150 = array_get v22142, index v22145 - v22151 = cast v22143 as Field - v22152 = cast v22148 as Field - v22153 = mul v22151, v22149 - v22154 = mul v22152, v22150 - v22155 = add v22153, v22154 - v22156 = array_set mut v22146, index v22145, value v22155 - enable_side_effects u1 1 - v22157 = array_get v1, index u32 475 - enable_side_effects v22157 - v22158 = array_get v2, index u32 475 - v22159 = cast v22158 as u32 - v22160 = array_set v22156, index v22159, value Field 475 - v22162 = not v22157 - v22163 = array_get v22160, index v22159 - v22164 = array_get v22156, index v22159 - v22165 = cast v22157 as Field - v22166 = cast v22162 as Field - v22167 = mul v22165, v22163 - v22168 = mul v22166, v22164 - v22169 = add v22167, v22168 - v22170 = array_set mut v22160, index v22159, value v22169 - enable_side_effects u1 1 - v22171 = array_get v1, index u32 476 - enable_side_effects v22171 - v22172 = array_get v2, index u32 476 - v22173 = cast v22172 as u32 - v22174 = array_set v22170, index v22173, value Field 476 - v22176 = not v22171 - v22177 = array_get v22174, index v22173 - v22178 = array_get v22170, index v22173 - v22179 = cast v22171 as Field - v22180 = cast v22176 as Field - v22181 = mul v22179, v22177 - v22182 = mul v22180, v22178 - v22183 = add v22181, v22182 - v22184 = array_set mut v22174, index v22173, value v22183 - enable_side_effects u1 1 - v22185 = array_get v1, index u32 477 - enable_side_effects v22185 - v22186 = array_get v2, index u32 477 - v22187 = cast v22186 as u32 - v22188 = array_set v22184, index v22187, value Field 477 - v22190 = not v22185 - v22191 = array_get v22188, index v22187 - v22192 = array_get v22184, index v22187 - v22193 = cast v22185 as Field - v22194 = cast v22190 as Field - v22195 = mul v22193, v22191 - v22196 = mul v22194, v22192 - v22197 = add v22195, v22196 - v22198 = array_set mut v22188, index v22187, value v22197 - enable_side_effects u1 1 - v22199 = array_get v1, index u32 478 - enable_side_effects v22199 - v22200 = array_get v2, index u32 478 - v22201 = cast v22200 as u32 - v22202 = array_set v22198, index v22201, value Field 478 - v22204 = not v22199 - v22205 = array_get v22202, index v22201 - v22206 = array_get v22198, index v22201 - v22207 = cast v22199 as Field - v22208 = cast v22204 as Field - v22209 = mul v22207, v22205 - v22210 = mul v22208, v22206 - v22211 = add v22209, v22210 - v22212 = array_set mut v22202, index v22201, value v22211 - enable_side_effects u1 1 - v22213 = array_get v1, index u32 479 - enable_side_effects v22213 - v22214 = array_get v2, index u32 479 - v22215 = cast v22214 as u32 - v22216 = array_set v22212, index v22215, value Field 479 - v22218 = not v22213 - v22219 = array_get v22216, index v22215 - v22220 = array_get v22212, index v22215 - v22221 = cast v22213 as Field - v22222 = cast v22218 as Field - v22223 = mul v22221, v22219 - v22224 = mul v22222, v22220 - v22225 = add v22223, v22224 - v22226 = array_set mut v22216, index v22215, value v22225 - enable_side_effects u1 1 - v22227 = array_get v1, index u32 2⁴×30 - enable_side_effects v22227 - v22228 = array_get v2, index u32 2⁴×30 - v22229 = cast v22228 as u32 - v22230 = array_set v22226, index v22229, value Field 2⁴×30 - v22232 = not v22227 - v22233 = array_get v22230, index v22229 - v22234 = array_get v22226, index v22229 - v22235 = cast v22227 as Field - v22236 = cast v22232 as Field - v22237 = mul v22235, v22233 - v22238 = mul v22236, v22234 - v22239 = add v22237, v22238 - v22240 = array_set mut v22230, index v22229, value v22239 - enable_side_effects u1 1 - v22241 = array_get v1, index u32 481 - enable_side_effects v22241 - v22242 = array_get v2, index u32 481 - v22243 = cast v22242 as u32 - v22244 = array_set v22240, index v22243, value Field 481 - v22246 = not v22241 - v22247 = array_get v22244, index v22243 - v22248 = array_get v22240, index v22243 - v22249 = cast v22241 as Field - v22250 = cast v22246 as Field - v22251 = mul v22249, v22247 - v22252 = mul v22250, v22248 - v22253 = add v22251, v22252 - v22254 = array_set mut v22244, index v22243, value v22253 - enable_side_effects u1 1 - v22255 = array_get v1, index u32 482 - enable_side_effects v22255 - v22256 = array_get v2, index u32 482 - v22257 = cast v22256 as u32 - v22258 = array_set v22254, index v22257, value Field 482 - v22260 = not v22255 - v22261 = array_get v22258, index v22257 - v22262 = array_get v22254, index v22257 - v22263 = cast v22255 as Field - v22264 = cast v22260 as Field - v22265 = mul v22263, v22261 - v22266 = mul v22264, v22262 - v22267 = add v22265, v22266 - v22268 = array_set mut v22258, index v22257, value v22267 - enable_side_effects u1 1 - v22269 = array_get v1, index u32 483 - enable_side_effects v22269 - v22270 = array_get v2, index u32 483 - v22271 = cast v22270 as u32 - v22272 = array_set v22268, index v22271, value Field 483 - v22274 = not v22269 - v22275 = array_get v22272, index v22271 - v22276 = array_get v22268, index v22271 - v22277 = cast v22269 as Field - v22278 = cast v22274 as Field - v22279 = mul v22277, v22275 - v22280 = mul v22278, v22276 - v22281 = add v22279, v22280 - v22282 = array_set mut v22272, index v22271, value v22281 - enable_side_effects u1 1 - v22283 = array_get v1, index u32 484 - enable_side_effects v22283 - v22284 = array_get v2, index u32 484 - v22285 = cast v22284 as u32 - v22286 = array_set v22282, index v22285, value Field 484 - v22288 = not v22283 - v22289 = array_get v22286, index v22285 - v22290 = array_get v22282, index v22285 - v22291 = cast v22283 as Field - v22292 = cast v22288 as Field - v22293 = mul v22291, v22289 - v22294 = mul v22292, v22290 - v22295 = add v22293, v22294 - v22296 = array_set mut v22286, index v22285, value v22295 - enable_side_effects u1 1 - v22297 = array_get v1, index u32 485 - enable_side_effects v22297 - v22298 = array_get v2, index u32 485 - v22299 = cast v22298 as u32 - v22300 = array_set v22296, index v22299, value Field 485 - v22302 = not v22297 - v22303 = array_get v22300, index v22299 - v22304 = array_get v22296, index v22299 - v22305 = cast v22297 as Field - v22306 = cast v22302 as Field - v22307 = mul v22305, v22303 - v22308 = mul v22306, v22304 - v22309 = add v22307, v22308 - v22310 = array_set mut v22300, index v22299, value v22309 - enable_side_effects u1 1 - v22311 = array_get v1, index u32 486 - enable_side_effects v22311 - v22312 = array_get v2, index u32 486 - v22313 = cast v22312 as u32 - v22314 = array_set v22310, index v22313, value Field 486 - v22316 = not v22311 - v22317 = array_get v22314, index v22313 - v22318 = array_get v22310, index v22313 - v22319 = cast v22311 as Field - v22320 = cast v22316 as Field - v22321 = mul v22319, v22317 - v22322 = mul v22320, v22318 - v22323 = add v22321, v22322 - v22324 = array_set mut v22314, index v22313, value v22323 - enable_side_effects u1 1 - v22325 = array_get v1, index u32 487 - enable_side_effects v22325 - v22326 = array_get v2, index u32 487 - v22327 = cast v22326 as u32 - v22328 = array_set v22324, index v22327, value Field 487 - v22330 = not v22325 - v22331 = array_get v22328, index v22327 - v22332 = array_get v22324, index v22327 - v22333 = cast v22325 as Field - v22334 = cast v22330 as Field - v22335 = mul v22333, v22331 - v22336 = mul v22334, v22332 - v22337 = add v22335, v22336 - v22338 = array_set mut v22328, index v22327, value v22337 - enable_side_effects u1 1 - v22339 = array_get v1, index u32 488 - enable_side_effects v22339 - v22340 = array_get v2, index u32 488 - v22341 = cast v22340 as u32 - v22342 = array_set v22338, index v22341, value Field 488 - v22344 = not v22339 - v22345 = array_get v22342, index v22341 - v22346 = array_get v22338, index v22341 - v22347 = cast v22339 as Field - v22348 = cast v22344 as Field - v22349 = mul v22347, v22345 - v22350 = mul v22348, v22346 - v22351 = add v22349, v22350 - v22352 = array_set mut v22342, index v22341, value v22351 - enable_side_effects u1 1 - v22353 = array_get v1, index u32 489 - enable_side_effects v22353 - v22354 = array_get v2, index u32 489 - v22355 = cast v22354 as u32 - v22356 = array_set v22352, index v22355, value Field 489 - v22358 = not v22353 - v22359 = array_get v22356, index v22355 - v22360 = array_get v22352, index v22355 - v22361 = cast v22353 as Field - v22362 = cast v22358 as Field - v22363 = mul v22361, v22359 - v22364 = mul v22362, v22360 - v22365 = add v22363, v22364 - v22366 = array_set mut v22356, index v22355, value v22365 - enable_side_effects u1 1 - v22367 = array_get v1, index u32 490 - enable_side_effects v22367 - v22368 = array_get v2, index u32 490 - v22369 = cast v22368 as u32 - v22370 = array_set v22366, index v22369, value Field 490 - v22372 = not v22367 - v22373 = array_get v22370, index v22369 - v22374 = array_get v22366, index v22369 - v22375 = cast v22367 as Field - v22376 = cast v22372 as Field - v22377 = mul v22375, v22373 - v22378 = mul v22376, v22374 - v22379 = add v22377, v22378 - v22380 = array_set mut v22370, index v22369, value v22379 - enable_side_effects u1 1 - v22381 = array_get v1, index u32 491 - enable_side_effects v22381 - v22382 = array_get v2, index u32 491 - v22383 = cast v22382 as u32 - v22384 = array_set v22380, index v22383, value Field 491 - v22386 = not v22381 - v22387 = array_get v22384, index v22383 - v22388 = array_get v22380, index v22383 - v22389 = cast v22381 as Field - v22390 = cast v22386 as Field - v22391 = mul v22389, v22387 - v22392 = mul v22390, v22388 - v22393 = add v22391, v22392 - v22394 = array_set mut v22384, index v22383, value v22393 - enable_side_effects u1 1 - v22395 = array_get v1, index u32 492 - enable_side_effects v22395 - v22396 = array_get v2, index u32 492 - v22397 = cast v22396 as u32 - v22398 = array_set v22394, index v22397, value Field 492 - v22400 = not v22395 - v22401 = array_get v22398, index v22397 - v22402 = array_get v22394, index v22397 - v22403 = cast v22395 as Field - v22404 = cast v22400 as Field - v22405 = mul v22403, v22401 - v22406 = mul v22404, v22402 - v22407 = add v22405, v22406 - v22408 = array_set mut v22398, index v22397, value v22407 - enable_side_effects u1 1 - v22409 = array_get v1, index u32 493 - enable_side_effects v22409 - v22410 = array_get v2, index u32 493 - v22411 = cast v22410 as u32 - v22412 = array_set v22408, index v22411, value Field 493 - v22414 = not v22409 - v22415 = array_get v22412, index v22411 - v22416 = array_get v22408, index v22411 - v22417 = cast v22409 as Field - v22418 = cast v22414 as Field - v22419 = mul v22417, v22415 - v22420 = mul v22418, v22416 - v22421 = add v22419, v22420 - v22422 = array_set mut v22412, index v22411, value v22421 - enable_side_effects u1 1 - v22423 = array_get v1, index u32 494 - enable_side_effects v22423 - v22424 = array_get v2, index u32 494 - v22425 = cast v22424 as u32 - v22426 = array_set v22422, index v22425, value Field 494 - v22428 = not v22423 - v22429 = array_get v22426, index v22425 - v22430 = array_get v22422, index v22425 - v22431 = cast v22423 as Field - v22432 = cast v22428 as Field - v22433 = mul v22431, v22429 - v22434 = mul v22432, v22430 - v22435 = add v22433, v22434 - v22436 = array_set mut v22426, index v22425, value v22435 - enable_side_effects u1 1 - v22437 = array_get v1, index u32 495 - enable_side_effects v22437 - v22438 = array_get v2, index u32 495 - v22439 = cast v22438 as u32 - v22440 = array_set v22436, index v22439, value Field 495 - v22442 = not v22437 - v22443 = array_get v22440, index v22439 - v22444 = array_get v22436, index v22439 - v22445 = cast v22437 as Field - v22446 = cast v22442 as Field - v22447 = mul v22445, v22443 - v22448 = mul v22446, v22444 - v22449 = add v22447, v22448 - v22450 = array_set mut v22440, index v22439, value v22449 - enable_side_effects u1 1 - v22451 = array_get v1, index u32 2⁴×31 - enable_side_effects v22451 - v22452 = array_get v2, index u32 2⁴×31 - v22453 = cast v22452 as u32 - v22454 = array_set v22450, index v22453, value Field 2⁴×31 - v22456 = not v22451 - v22457 = array_get v22454, index v22453 - v22458 = array_get v22450, index v22453 - v22459 = cast v22451 as Field - v22460 = cast v22456 as Field - v22461 = mul v22459, v22457 - v22462 = mul v22460, v22458 - v22463 = add v22461, v22462 - v22464 = array_set mut v22454, index v22453, value v22463 - enable_side_effects u1 1 - v22465 = array_get v1, index u32 497 - enable_side_effects v22465 - v22466 = array_get v2, index u32 497 - v22467 = cast v22466 as u32 - v22468 = array_set v22464, index v22467, value Field 497 - v22470 = not v22465 - v22471 = array_get v22468, index v22467 - v22472 = array_get v22464, index v22467 - v22473 = cast v22465 as Field - v22474 = cast v22470 as Field - v22475 = mul v22473, v22471 - v22476 = mul v22474, v22472 - v22477 = add v22475, v22476 - v22478 = array_set mut v22468, index v22467, value v22477 - enable_side_effects u1 1 - v22479 = array_get v1, index u32 498 - enable_side_effects v22479 - v22480 = array_get v2, index u32 498 - v22481 = cast v22480 as u32 - v22482 = array_set v22478, index v22481, value Field 498 - v22484 = not v22479 - v22485 = array_get v22482, index v22481 - v22486 = array_get v22478, index v22481 - v22487 = cast v22479 as Field - v22488 = cast v22484 as Field - v22489 = mul v22487, v22485 - v22490 = mul v22488, v22486 - v22491 = add v22489, v22490 - v22492 = array_set mut v22482, index v22481, value v22491 - enable_side_effects u1 1 - v22493 = array_get v1, index u32 499 - enable_side_effects v22493 - v22494 = array_get v2, index u32 499 - v22495 = cast v22494 as u32 - v22496 = array_set v22492, index v22495, value Field 499 - v22498 = not v22493 - v22499 = array_get v22496, index v22495 - v22500 = array_get v22492, index v22495 - v22501 = cast v22493 as Field - v22502 = cast v22498 as Field - v22503 = mul v22501, v22499 - v22504 = mul v22502, v22500 - v22505 = add v22503, v22504 - v22506 = array_set mut v22496, index v22495, value v22505 - enable_side_effects u1 1 - dec_rc v0 - return v22506 -} - -[regression_5027] Circuit witness successfully solved -[regression_5027] Circuit output: Vec([Field(498), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0), Field(0)]) From f444b58a95e649239c75f0f69a6bccbbc52386b4 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 20 Aug 2024 13:32:27 -0500 Subject: [PATCH 34/37] Fix tests, add another --- compiler/noirc_frontend/src/tests.rs | 45 +++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/compiler/noirc_frontend/src/tests.rs b/compiler/noirc_frontend/src/tests.rs index 23f2bad4ddd..cc4aae7f447 100644 --- a/compiler/noirc_frontend/src/tests.rs +++ b/compiler/noirc_frontend/src/tests.rs @@ -2227,7 +2227,7 @@ fn impl_stricter_than_trait_different_trait_generics() { { assert!(matches!(constraint_typ.to_string().as_str(), "A")); assert!(matches!(constraint_name.as_str(), "T2")); - assert!(matches!(constraint_generics[0].to_string().as_str(), "B")); + assert!(matches!(constraint_generics.ordered[0].to_string().as_str(), "B")); } else { panic!("Expected DefCollectorErrorKind::ImplIsStricterThanTrait but got {:?}", errors[0].0); } @@ -3144,15 +3144,46 @@ fn as_trait_path_syntax_resolves_outside_impl() { } fn main() { - let _: i64 = 1 as ::Assoc; + // AsTraitPath syntax is a bit silly when associated types + // are explicitly specified + let _: i64 = 1 as >::Assoc; } "#; let errors = get_program_errors(src); - assert_eq!(dbg!(errors).len(), 2); + assert_eq!(errors.len(), 1); - assert!(matches!( - dbg!(&errors[0].0), - CompilationError::TypeError(TypeCheckError::OpCannotBeUsed { .. }) - )); + use CompilationError::TypeError; + use TypeCheckError::TypeMismatch; + let TypeError(TypeMismatch { expected_typ, expr_typ, .. }) = errors[0].0.clone() else { + panic!("Expected TypeMismatch error, found {:?}", errors[0].0); + }; + + assert_eq!(expected_typ, "i64".to_string()); + assert_eq!(expr_typ, "i32".to_string()); +} + +#[test] +fn as_trait_path_syntax_no_impl() { + let src = r#" + trait Foo { + type Assoc; + } + + struct Bar {} + + impl Foo for Bar { + type Assoc = i32; + } + + fn main() { + let _: i64 = 1 as >::Assoc; + } + "#; + + let errors = get_program_errors(src); + assert_eq!(errors.len(), 1); + + use CompilationError::TypeError; + assert!(matches!(&errors[0].0, TypeError(TypeCheckError::NoMatchingImplFound { .. }))); } From b8042281d7c8bbec3666f52c54745f7080f5dd63 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 20 Aug 2024 13:49:47 -0500 Subject: [PATCH 35/37] Add docs --- docs/docs/noir/concepts/traits.md | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/docs/docs/noir/concepts/traits.md b/docs/docs/noir/concepts/traits.md index 51305b38c16..912a84a010c 100644 --- a/docs/docs/noir/concepts/traits.md +++ b/docs/docs/noir/concepts/traits.md @@ -225,6 +225,66 @@ fn main() { } ``` +### Associated Types and Constants + +Traits also support associated types and constaints which can be thought of as additional generics that are referred to by name. + +Here's an example of a trait with an associated type `Foo` and a constant `Bar`: + +```rust +trait MyTrait { + type Foo; + + let Bar: u32; +} +``` + +Now when we're implementing `MyTrait` we also have to provide values for `Foo` and `Bar`: + +```rust +impl MyTrait for Field { + type Foo = i32; + + let Bar: u32 = 11; +} +``` + +Since associated constants can also be used in a type position, its values are limited to only other +expression kinds allowed in numeric generics. + +Note that currently all associated types and constants must be explicitly specified in a trait constraint. +If we leave out any, we'll get an error that we're missing one: + +```rust +// Error! Constraint is missing associated constant for `Bar` +fn foo(x: T) where T: MyTrait { + ... +} +``` + +Because all associated types and constants must be explicitly specified, they are essentially named generics, +although this is set to change in the future. Future versions of Noir will allow users to elide associated types +in trait constraints similar to Rust. When this is done, you may still refer to their value with the `::AssociatedType` +syntax: + +```rust +// Only valid in future versions of Noir: +fn foo(x: T) where T: MyTrait { + let _: ::Foo = ...; +} +``` + +The type as trait syntax is possible in Noir today but is less useful when each type must be explicitly specified anyway: + +```rust +fn foo(x: T) where T: MyTrait { + // Works, but could just use F directly + let _: >::Foo = ...; + + let _: F = ...; +} +``` + ## Trait Methods With No `self` A trait can contain any number of methods, each of which have access to the `Self` type which represents each type From becadba83fbf1fe18aea8ee91989274ceecc12b2 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Tue, 20 Aug 2024 13:56:49 -0500 Subject: [PATCH 36/37] Remove experimental warnings --- compiler/noirc_frontend/src/parser/parser/path.rs | 9 +++++---- compiler/noirc_frontend/src/parser/parser/traits.rs | 13 ++++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/compiler/noirc_frontend/src/parser/parser/path.rs b/compiler/noirc_frontend/src/parser/parser/path.rs index 5ceecc2f57a..ea121c6f6db 100644 --- a/compiler/noirc_frontend/src/parser/parser/path.rs +++ b/compiler/noirc_frontend/src/parser/parser/path.rs @@ -60,10 +60,11 @@ pub(super) fn as_trait_path<'a>( .then_ignore(just(Token::Greater)) .then_ignore(just(Token::DoubleColon)) .then(ident()) - .validate(|(((typ, trait_path), trait_generics), impl_item), span, emit| { - let reason = ParserErrorReason::ExperimentalFeature("Fully qualified trait impl paths"); - emit(ParserError::with_reason(reason, span)); - AsTraitPath { typ, trait_path, trait_generics, impl_item } + .map(|(((typ, trait_path), trait_generics), impl_item)| AsTraitPath { + typ, + trait_path, + trait_generics, + impl_item, }) } diff --git a/compiler/noirc_frontend/src/parser/parser/traits.rs b/compiler/noirc_frontend/src/parser/parser/traits.rs index 0cf5e63f5f3..bf5a4b4d0b4 100644 --- a/compiler/noirc_frontend/src/parser/parser/traits.rs +++ b/compiler/noirc_frontend/src/parser/parser/traits.rs @@ -111,15 +111,10 @@ fn trait_function_declaration() -> impl NoirParser { /// trait_type_declaration: 'type' ident generics fn trait_type_declaration() -> impl NoirParser { - keyword(Keyword::Type).ignore_then(ident()).then_ignore(just(Token::Semicolon)).validate( - |name, span, emit| { - emit(ParserError::with_reason( - ParserErrorReason::ExperimentalFeature("Associated types"), - span, - )); - TraitItem::Type { name } - }, - ) + keyword(Keyword::Type) + .ignore_then(ident()) + .then_ignore(just(Token::Semicolon)) + .map(|name| TraitItem::Type { name }) } /// Parses a trait implementation, implementing a particular trait for a type. From 4bd91a17a5e06103aa1aeadecde4607de920f689 Mon Sep 17 00:00:00 2001 From: Jake Fecher Date: Thu, 22 Aug 2024 10:02:22 -0500 Subject: [PATCH 37/37] Limit max parallel threads --- test_programs/rebuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_programs/rebuild.sh b/test_programs/rebuild.sh index a70f69d531d..79adfc2d0df 100755 --- a/test_programs/rebuild.sh +++ b/test_programs/rebuild.sh @@ -60,6 +60,6 @@ for dir in $current_dir/benchmarks/*; do dirs_to_process+=("$dir") done -parallel -j0 process_dir {} "$current_dir" ::: ${dirs_to_process[@]} +parallel -j7 process_dir {} "$current_dir" ::: ${dirs_to_process[@]} echo "Rebuild Succeeded!"