mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-13 08:47:17 +03:00
Merge pull request #2112 from AleoHQ/feat/program-scope
Introduces `program` scope.
This commit is contained in:
commit
4256167bfe
@ -20,12 +20,12 @@ use leo_span::Span;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
/// An access expression to an circuit constant., e.g. `u8::MAX`.
|
||||
/// An access expression to an struct constant., e.g. `u8::MAX`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AssociatedConstant {
|
||||
/// The inner circuit type.
|
||||
/// The inner struct type.
|
||||
pub ty: Type,
|
||||
/// The circuit constant that is being accessed.
|
||||
/// The struct constant that is being accessed.
|
||||
pub name: Identifier,
|
||||
/// The span for the entire expression `Foo::bar()`.
|
||||
pub span: Span,
|
||||
|
@ -20,12 +20,12 @@ use leo_span::Span;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
/// An access expression to an associated function in a circuit, e.g.`Pedersen64::hash()`.
|
||||
/// An access expression to an associated function in a struct, e.g.`Pedersen64::hash()`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AssociatedFunction {
|
||||
/// The inner circuit type.
|
||||
/// The inner struct type.
|
||||
pub ty: Type,
|
||||
/// The static circuit member function that is being accessed.
|
||||
/// The static struct member function that is being accessed.
|
||||
pub name: Identifier,
|
||||
/// The arguments passed to the function `name`.
|
||||
pub args: Vec<Expression>,
|
||||
|
@ -20,12 +20,12 @@ use leo_span::Span;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
/// A circuit member access expression `inner.name` to some structure with *named members*.
|
||||
/// A struct member access expression `inner.name` to some structure with *named members*.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct MemberAccess {
|
||||
/// The inner circuit that is being accessed.
|
||||
/// The inner struct that is being accessed.
|
||||
pub inner: Box<Expression>,
|
||||
/// The name of the circuit member to access.
|
||||
/// The name of the struct member to access.
|
||||
pub name: Identifier,
|
||||
/// The span covering all of `inner.name`.
|
||||
pub span: Span,
|
||||
|
@ -1,71 +0,0 @@
|
||||
// Copyright (C) 2019-2022 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{Identifier, Type};
|
||||
use leo_span::Symbol;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
/// A member of a circuit definition.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum CircuitMember {
|
||||
// CAUTION: circuit constants are unstable for Leo testnet3.
|
||||
// /// A static constant in a circuit.
|
||||
// /// For example: `const foobar: u8 = 42;`.
|
||||
// CircuitConst(
|
||||
// /// The identifier of the constant.
|
||||
// Identifier,
|
||||
// /// The type the constant has.
|
||||
// Type,
|
||||
// /// The expression representing the constant's value.
|
||||
// /// Checked to be of the type above.
|
||||
// Expression,
|
||||
// ),
|
||||
/// A variable definition in a circuit;
|
||||
/// For example: `foobar: u8;`.
|
||||
CircuitVariable(
|
||||
/// The identifier of the constant.
|
||||
Identifier,
|
||||
/// The type the constant has.
|
||||
Type,
|
||||
),
|
||||
// CAUTION: circuit functions are unstable for Leo testnet3.
|
||||
// /// A function definition in a circuit.
|
||||
// /// For example: `function bar() -> u8 { return 2u8; }`.
|
||||
// CircuitFunction(
|
||||
// /// The function.
|
||||
// Box<Function>,
|
||||
// ),
|
||||
}
|
||||
|
||||
impl CircuitMember {
|
||||
/// Returns the name of the circuit member without span.
|
||||
pub fn name(&self) -> Symbol {
|
||||
match self {
|
||||
CircuitMember::CircuitVariable(ident, _type) => ident.name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CircuitMember {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
CircuitMember::CircuitVariable(ref identifier, ref type_) => write!(f, "{}: {}", identifier, type_),
|
||||
}
|
||||
}
|
||||
}
|
@ -25,5 +25,7 @@ pub use imported_modules::*;
|
||||
pub mod positive_number;
|
||||
pub use positive_number::*;
|
||||
|
||||
pub mod node;
|
||||
pub mod static_string;
|
||||
|
||||
pub use static_string::*;
|
||||
|
@ -27,11 +27,11 @@ pub enum AccessExpression {
|
||||
// Array(ArrayAccess),
|
||||
// /// An expression accessing a range of an array.
|
||||
// ArrayRange(ArrayRangeAccess),
|
||||
/// Access to an associated variable of a circuit e.g `u8::MAX`.
|
||||
/// Access to an associated variable of a struct e.g `u8::MAX`.
|
||||
AssociatedConstant(AssociatedConstant),
|
||||
/// Access to an associated function of a circuit e.g `Pedersen64::hash()`.
|
||||
/// Access to an associated function of a struct e.g `Pedersen64::hash()`.
|
||||
AssociatedFunction(AssociatedFunction),
|
||||
/// An expression accessing a field in a structure, e.g., `circuit_var.field`.
|
||||
/// An expression accessing a field in a structure, e.g., `struct_var.field`.
|
||||
Member(MemberAccess),
|
||||
/// Access to a tuple field using its position, e.g., `tuple.1`.
|
||||
Tuple(TupleAccess),
|
||||
|
@ -29,8 +29,8 @@ pub use binary::*;
|
||||
mod call;
|
||||
pub use call::*;
|
||||
|
||||
mod circuit_init;
|
||||
pub use circuit_init::*;
|
||||
mod struct_init;
|
||||
pub use struct_init::*;
|
||||
|
||||
mod err;
|
||||
pub use err::*;
|
||||
@ -50,14 +50,14 @@ pub use literal::*;
|
||||
/// Expression that evaluates to a value.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum Expression {
|
||||
/// A circuit access expression, e.g., `Foo.bar`.
|
||||
/// A struct access expression, e.g., `Foo.bar`.
|
||||
Access(AccessExpression),
|
||||
/// A binary expression, e.g., `42 + 24`.
|
||||
Binary(BinaryExpression),
|
||||
/// A call expression, e.g., `my_fun(args)`.
|
||||
Call(CallExpression),
|
||||
/// An expression constructing a circuit like `Foo { bar: 42, baz }`.
|
||||
Circuit(CircuitExpression),
|
||||
/// An expression constructing a struct like `Foo { bar: 42, baz }`.
|
||||
Struct(StructExpression),
|
||||
/// An expression of type "error".
|
||||
/// Will result in a compile error eventually.
|
||||
Err(ErrExpression),
|
||||
@ -80,7 +80,7 @@ impl Node for Expression {
|
||||
Access(n) => n.span(),
|
||||
Binary(n) => n.span(),
|
||||
Call(n) => n.span(),
|
||||
Circuit(n) => n.span(),
|
||||
Struct(n) => n.span(),
|
||||
Err(n) => n.span(),
|
||||
Identifier(n) => n.span(),
|
||||
Literal(n) => n.span(),
|
||||
@ -96,7 +96,7 @@ impl Node for Expression {
|
||||
Access(n) => n.set_span(span),
|
||||
Binary(n) => n.set_span(span),
|
||||
Call(n) => n.set_span(span),
|
||||
Circuit(n) => n.set_span(span),
|
||||
Struct(n) => n.set_span(span),
|
||||
Identifier(n) => n.set_span(span),
|
||||
Literal(n) => n.set_span(span),
|
||||
Err(n) => n.set_span(span),
|
||||
@ -114,7 +114,7 @@ impl fmt::Display for Expression {
|
||||
Access(n) => n.fmt(f),
|
||||
Binary(n) => n.fmt(f),
|
||||
Call(n) => n.fmt(f),
|
||||
Circuit(n) => n.fmt(f),
|
||||
Struct(n) => n.fmt(f),
|
||||
Err(n) => n.fmt(f),
|
||||
Identifier(n) => n.fmt(f),
|
||||
Literal(n) => n.fmt(f),
|
||||
|
@ -17,10 +17,10 @@
|
||||
use super::*;
|
||||
use leo_span::sym;
|
||||
|
||||
/// An initializer for a single field / variable of a circuit initializer expression.
|
||||
/// An initializer for a single field / variable of a struct initializer expression.
|
||||
/// That is, in `Foo { bar: 42, baz }`, this is either `bar: 42`, or `baz`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CircuitVariableInitializer {
|
||||
pub struct StructVariableInitializer {
|
||||
/// The name of the field / variable to be initialized.
|
||||
pub identifier: Identifier,
|
||||
/// The expression to initialize the field with.
|
||||
@ -28,7 +28,7 @@ pub struct CircuitVariableInitializer {
|
||||
pub expression: Option<Expression>,
|
||||
}
|
||||
|
||||
impl fmt::Display for CircuitVariableInitializer {
|
||||
impl fmt::Display for StructVariableInitializer {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if let Some(expr) = &self.expression {
|
||||
write!(f, "{}: {}", self.identifier, expr)
|
||||
@ -38,21 +38,21 @@ impl fmt::Display for CircuitVariableInitializer {
|
||||
}
|
||||
}
|
||||
|
||||
/// A circuit initialization expression, e.g., `Foo { bar: 42, baz }`.
|
||||
/// A struct initialization expression, e.g., `Foo { bar: 42, baz }`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CircuitExpression {
|
||||
pub struct StructExpression {
|
||||
/// The name of the structure type to initialize.
|
||||
pub name: Identifier,
|
||||
/// Initializer expressions for each of the fields in the circuit.
|
||||
/// Initializer expressions for each of the fields in the struct.
|
||||
///
|
||||
/// N.B. Any functions or member constants in the circuit definition
|
||||
/// N.B. Any functions or member constants in the struct definition
|
||||
/// are excluded from this list.
|
||||
pub members: Vec<CircuitVariableInitializer>,
|
||||
pub members: Vec<StructVariableInitializer>,
|
||||
/// A span from `name` to `}`.
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
impl CircuitExpression {
|
||||
impl StructExpression {
|
||||
/// Returns true if the record has all required fields and visibility.
|
||||
pub fn check_record(&self) -> bool {
|
||||
let has_member = |symbol| self.members.iter().any(|variable| variable.identifier.name == symbol);
|
||||
@ -60,7 +60,7 @@ impl CircuitExpression {
|
||||
has_member(sym::owner) && has_member(sym::gates) && has_member(sym::_nonce)
|
||||
}
|
||||
|
||||
/// Returns the circuit as a record interface with visibility.
|
||||
/// Returns the struct as a record interface with visibility.
|
||||
pub fn to_record_string(&self) -> String {
|
||||
format!(
|
||||
"{{{}}}",
|
||||
@ -80,7 +80,7 @@ impl CircuitExpression {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CircuitExpression {
|
||||
impl fmt::Display for StructExpression {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
@ -94,4 +94,4 @@ impl fmt::Display for CircuitExpression {
|
||||
}
|
||||
}
|
||||
|
||||
crate::simple_node_impl!(CircuitExpression);
|
||||
crate::simple_node_impl!(StructExpression);
|
28
compiler/ast/src/functions/call_type.rs
Normal file
28
compiler/ast/src/functions/call_type.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2019-2022 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// An enum declaring how the function is invoked.
|
||||
/// A transition function is permitted the ability to manipulate records.
|
||||
/// A regular function is not permitted to manipulate records.
|
||||
/// An inline function is directly copied at the call site.
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum CallType {
|
||||
Inline,
|
||||
Standard,
|
||||
Transition,
|
||||
}
|
@ -17,6 +17,9 @@
|
||||
pub mod annotation;
|
||||
pub use annotation::*;
|
||||
|
||||
pub mod call_type;
|
||||
pub use call_type::*;
|
||||
|
||||
pub mod external;
|
||||
pub use external::*;
|
||||
|
||||
@ -43,6 +46,8 @@ use std::fmt;
|
||||
pub struct Function {
|
||||
/// Annotations on the function.
|
||||
pub annotations: Vec<Annotation>,
|
||||
/// Is this function a transition, inlined, or a regular function?.
|
||||
pub call_type: CallType,
|
||||
/// The function identifier, e.g., `foo` in `function foo(...) { ... }`.
|
||||
pub identifier: Identifier,
|
||||
/// The function's input parameters.
|
||||
@ -69,8 +74,10 @@ impl Eq for Function {}
|
||||
|
||||
impl Function {
|
||||
/// Initialize a new function.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
annotations: Vec<Annotation>,
|
||||
call_type: CallType,
|
||||
identifier: Identifier,
|
||||
input: Vec<Input>,
|
||||
output: Vec<Output>,
|
||||
@ -92,6 +99,7 @@ impl Function {
|
||||
|
||||
Function {
|
||||
annotations,
|
||||
call_type,
|
||||
identifier,
|
||||
input,
|
||||
output,
|
||||
@ -115,7 +123,12 @@ impl Function {
|
||||
/// Private formatting method used for optimizing [fmt::Debug] and [fmt::Display] implementations.
|
||||
///
|
||||
fn format(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "function {}", self.identifier)?;
|
||||
match self.call_type {
|
||||
CallType::Inline => write!(f, "inline ")?,
|
||||
CallType::Standard => write!(f, "function ")?,
|
||||
CallType::Transition => write!(f, "transition ")?,
|
||||
}
|
||||
write!(f, "{}", self.identifier)?;
|
||||
|
||||
let parameters = self.input.iter().map(|x| x.to_string()).collect::<Vec<_>>().join(",");
|
||||
let returns = match self.output.len() {
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{normalize_json_value, remove_key_from_json, Circuit, Expression, Type};
|
||||
use crate::{normalize_json_value, remove_key_from_json, Expression, Struct, Type};
|
||||
|
||||
use super::*;
|
||||
use leo_errors::{AstError, Result};
|
||||
@ -41,7 +41,7 @@ pub struct InputAst {
|
||||
|
||||
impl InputAst {
|
||||
/// Returns all values of the input AST for execution with `leo run`.
|
||||
pub fn program_inputs(&self, program_name: &str, circuits: IndexMap<Symbol, Circuit>) -> Vec<String> {
|
||||
pub fn program_inputs(&self, program_name: &str, structs: IndexMap<Symbol, Struct>) -> Vec<String> {
|
||||
self.sections
|
||||
.iter()
|
||||
.filter(|section| section.name() == program_name)
|
||||
@ -49,18 +49,18 @@ impl InputAst {
|
||||
section.definitions.iter().map(|definition| match &definition.type_ {
|
||||
// Handle case where the input may be record.
|
||||
Type::Identifier(identifier) => {
|
||||
match circuits.get(&identifier.name) {
|
||||
match structs.get(&identifier.name) {
|
||||
// TODO: Better error handling.
|
||||
None => panic!(
|
||||
"Input error: A circuit or record declaration does not exist for {}.",
|
||||
"Input error: A struct or record declaration does not exist for {}.",
|
||||
identifier.name
|
||||
),
|
||||
Some(circuit) => match circuit.is_record {
|
||||
Some(struct_) => match struct_.is_record {
|
||||
false => definition.value.to_string(),
|
||||
true => match &definition.value {
|
||||
// Print out the record interface with visibility.
|
||||
Expression::Circuit(circuit_expression) => circuit_expression.to_record_string(),
|
||||
_ => panic!("Input error: Expected a circuit expression."),
|
||||
Expression::Struct(struct_expression) => struct_expression.to_record_string(),
|
||||
_ => panic!("Input error: Expected a struct expression."),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ extern crate core;
|
||||
pub mod access;
|
||||
pub use self::access::*;
|
||||
|
||||
pub mod circuit;
|
||||
pub use self::circuit::*;
|
||||
pub mod r#struct;
|
||||
pub use self::r#struct::*;
|
||||
|
||||
pub mod common;
|
||||
pub use self::common::*;
|
||||
@ -63,8 +63,7 @@ pub use self::types::*;
|
||||
pub mod value;
|
||||
pub use self::value::*;
|
||||
|
||||
mod node;
|
||||
pub use node::*;
|
||||
pub use common::node::*;
|
||||
|
||||
use leo_errors::{AstError, Result};
|
||||
|
||||
@ -74,7 +73,7 @@ use leo_errors::{AstError, Result};
|
||||
/// These data types form a tree that begins from a [`Program`] type root.
|
||||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
pub struct Ast {
|
||||
ast: Program,
|
||||
pub ast: Program,
|
||||
}
|
||||
|
||||
impl Ast {
|
||||
@ -83,18 +82,6 @@ impl Ast {
|
||||
Self { ast: program }
|
||||
}
|
||||
|
||||
/// Set the program name to the given string.
|
||||
pub fn set_program_name(mut self, name: String) -> Self {
|
||||
self.ast.name = name;
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the network name to the given string.
|
||||
pub fn set_network(mut self, network: String) -> Self {
|
||||
self.ast.network = network;
|
||||
self
|
||||
}
|
||||
|
||||
/// Returns a reference to the inner program AST representation.
|
||||
pub fn as_repr(&self) -> &Program {
|
||||
&self.ast
|
||||
|
@ -28,7 +28,7 @@ pub trait ExpressionConsumer {
|
||||
Expression::Access(access) => self.consume_access(access),
|
||||
Expression::Binary(binary) => self.consume_binary(binary),
|
||||
Expression::Call(call) => self.consume_call(call),
|
||||
Expression::Circuit(circuit) => self.consume_circuit_init(circuit),
|
||||
Expression::Struct(struct_) => self.consume_struct_init(struct_),
|
||||
Expression::Err(err) => self.consume_err(err),
|
||||
Expression::Identifier(identifier) => self.consume_identifier(identifier),
|
||||
Expression::Literal(value) => self.consume_literal(value),
|
||||
@ -44,7 +44,7 @@ pub trait ExpressionConsumer {
|
||||
|
||||
fn consume_call(&mut self, _input: CallExpression) -> Self::Output;
|
||||
|
||||
fn consume_circuit_init(&mut self, _input: CircuitExpression) -> Self::Output;
|
||||
fn consume_struct_init(&mut self, _input: StructExpression) -> Self::Output;
|
||||
|
||||
fn consume_err(&mut self, _input: ErrExpression) -> Self::Output {
|
||||
unreachable!("`ErrExpression`s should not be in the AST at this phase of compilation.")
|
||||
@ -108,11 +108,11 @@ pub trait FunctionConsumer {
|
||||
fn consume_function(&mut self, input: Function) -> Self::Output;
|
||||
}
|
||||
|
||||
/// A Consumer trait for circuits in the AST.
|
||||
pub trait CircuitConsumer {
|
||||
/// A Consumer trait for structs in the AST.
|
||||
pub trait StructConsumer {
|
||||
type Output;
|
||||
|
||||
fn consume_circuit(&mut self, input: Circuit) -> Self::Output;
|
||||
fn consume_struct(&mut self, input: Struct) -> Self::Output;
|
||||
}
|
||||
|
||||
/// A Consumer trait for imported programs in the AST.
|
||||
@ -129,6 +129,13 @@ pub trait MappingConsumer {
|
||||
fn consume_mapping(&mut self, input: Mapping) -> Self::Output;
|
||||
}
|
||||
|
||||
/// A Consumer trait for program scopes in the AST.
|
||||
pub trait ProgramScopeConsumer {
|
||||
type Output;
|
||||
|
||||
fn consume_program_scope(&mut self, input: ProgramScope) -> Self::Output;
|
||||
}
|
||||
|
||||
/// A Consumer trait for the program represented by the AST.
|
||||
pub trait ProgramConsumer {
|
||||
type Output;
|
||||
|
@ -29,7 +29,7 @@ pub trait ExpressionReconstructor {
|
||||
Expression::Access(access) => self.reconstruct_access(access),
|
||||
Expression::Binary(binary) => self.reconstruct_binary(binary),
|
||||
Expression::Call(call) => self.reconstruct_call(call),
|
||||
Expression::Circuit(circuit) => self.reconstruct_circuit_init(circuit),
|
||||
Expression::Struct(struct_) => self.reconstruct_struct_init(struct_),
|
||||
Expression::Err(err) => self.reconstruct_err(err),
|
||||
Expression::Identifier(identifier) => self.reconstruct_identifier(identifier),
|
||||
Expression::Literal(value) => self.reconstruct_literal(value),
|
||||
@ -98,8 +98,8 @@ pub trait ExpressionReconstructor {
|
||||
)
|
||||
}
|
||||
|
||||
fn reconstruct_circuit_init(&mut self, input: CircuitExpression) -> (Expression, Self::AdditionalOutput) {
|
||||
(Expression::Circuit(input), Default::default())
|
||||
fn reconstruct_struct_init(&mut self, input: StructExpression) -> (Expression, Self::AdditionalOutput) {
|
||||
(Expression::Struct(input), Default::default())
|
||||
}
|
||||
|
||||
fn reconstruct_err(&mut self, _input: ErrExpression) -> (Expression, Self::AdditionalOutput) {
|
||||
@ -312,14 +312,27 @@ pub trait StatementReconstructor: ExpressionReconstructor {
|
||||
pub trait ProgramReconstructor: StatementReconstructor {
|
||||
fn reconstruct_program(&mut self, input: Program) -> Program {
|
||||
Program {
|
||||
name: input.name,
|
||||
network: input.network,
|
||||
expected_input: input.expected_input,
|
||||
imports: input
|
||||
.imports
|
||||
.into_iter()
|
||||
.map(|(id, import)| (id, self.reconstruct_import(import)))
|
||||
.collect(),
|
||||
program_scopes: input
|
||||
.program_scopes
|
||||
.into_iter()
|
||||
.map(|(id, scope)| (id, self.reconstruct_program_scope(scope)))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
fn reconstruct_program_scope(&mut self, input: ProgramScope) -> ProgramScope {
|
||||
ProgramScope {
|
||||
program_id: input.program_id,
|
||||
structs: input
|
||||
.structs
|
||||
.into_iter()
|
||||
.map(|(i, c)| (i, self.reconstruct_struct(c)))
|
||||
.collect(),
|
||||
mappings: input
|
||||
.mappings
|
||||
.into_iter()
|
||||
@ -330,17 +343,14 @@ pub trait ProgramReconstructor: StatementReconstructor {
|
||||
.into_iter()
|
||||
.map(|(i, f)| (i, self.reconstruct_function(f)))
|
||||
.collect(),
|
||||
circuits: input
|
||||
.circuits
|
||||
.into_iter()
|
||||
.map(|(i, c)| (i, self.reconstruct_circuit(c)))
|
||||
.collect(),
|
||||
span: input.span,
|
||||
}
|
||||
}
|
||||
|
||||
fn reconstruct_function(&mut self, input: Function) -> Function {
|
||||
Function {
|
||||
annotations: input.annotations,
|
||||
call_type: input.call_type,
|
||||
identifier: input.identifier,
|
||||
input: input.input,
|
||||
output: input.output,
|
||||
@ -358,7 +368,7 @@ pub trait ProgramReconstructor: StatementReconstructor {
|
||||
}
|
||||
}
|
||||
|
||||
fn reconstruct_circuit(&mut self, input: Circuit) -> Circuit {
|
||||
fn reconstruct_struct(&mut self, input: Struct) -> Struct {
|
||||
input
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ pub trait ExpressionVisitor<'a> {
|
||||
Expression::Access(access) => self.visit_access(access, additional),
|
||||
Expression::Binary(binary) => self.visit_binary(binary, additional),
|
||||
Expression::Call(call) => self.visit_call(call, additional),
|
||||
Expression::Circuit(circuit) => self.visit_circuit_init(circuit, additional),
|
||||
Expression::Struct(struct_) => self.visit_struct_init(struct_, additional),
|
||||
Expression::Err(err) => self.visit_err(err, additional),
|
||||
Expression::Identifier(identifier) => self.visit_identifier(identifier, additional),
|
||||
Expression::Literal(literal) => self.visit_literal(literal, additional),
|
||||
@ -72,11 +72,7 @@ pub trait ExpressionVisitor<'a> {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
fn visit_circuit_init(
|
||||
&mut self,
|
||||
_input: &'a CircuitExpression,
|
||||
_additional: &Self::AdditionalInput,
|
||||
) -> Self::Output {
|
||||
fn visit_struct_init(&mut self, _input: &'a StructExpression, _additional: &Self::AdditionalInput) -> Self::Output {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
@ -200,9 +196,13 @@ pub trait ProgramVisitor<'a>: StatementVisitor<'a> {
|
||||
input.imports.values().for_each(|import| self.visit_import(import));
|
||||
|
||||
input
|
||||
.circuits
|
||||
.program_scopes
|
||||
.values()
|
||||
.for_each(|function| self.visit_circuit(function));
|
||||
.for_each(|scope| self.visit_program_scope(scope));
|
||||
}
|
||||
|
||||
fn visit_program_scope(&mut self, input: &'a ProgramScope) {
|
||||
input.structs.values().for_each(|function| self.visit_struct(function));
|
||||
|
||||
input.mappings.values().for_each(|mapping| self.visit_mapping(mapping));
|
||||
|
||||
@ -216,7 +216,7 @@ pub trait ProgramVisitor<'a>: StatementVisitor<'a> {
|
||||
self.visit_program(input)
|
||||
}
|
||||
|
||||
fn visit_circuit(&mut self, _input: &'a Circuit) {}
|
||||
fn visit_struct(&mut self, _input: &'a Struct) {}
|
||||
|
||||
fn visit_mapping(&mut self, _input: &'a Mapping) {}
|
||||
|
||||
|
@ -14,10 +14,15 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! A Leo program consists of import, circuit, and function definitions.
|
||||
//! Each defined type consists of ast statements and expressions.
|
||||
//! A Leo program consists of import statements and program scopes.
|
||||
|
||||
use crate::{Circuit, Function, FunctionInput, Identifier, Mapping};
|
||||
pub mod program_id;
|
||||
pub use program_id::*;
|
||||
|
||||
pub mod program_scope;
|
||||
pub use program_scope::*;
|
||||
|
||||
use crate::Identifier;
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -26,21 +31,10 @@ use std::fmt;
|
||||
/// Stores the Leo program abstract syntax tree.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Program {
|
||||
/// The name of the program.
|
||||
pub name: String,
|
||||
/// The network of the program.
|
||||
pub network: String,
|
||||
/// Expected main function inputs.
|
||||
/// Empty after parsing.
|
||||
pub expected_input: Vec<FunctionInput>,
|
||||
/// A map from import names to import definitions.
|
||||
pub imports: IndexMap<Identifier, Program>,
|
||||
/// A map from circuit names to circuit definitions.
|
||||
pub circuits: IndexMap<Identifier, Circuit>,
|
||||
/// A map from mapping names to mapping definitions.
|
||||
pub mappings: IndexMap<Identifier, Mapping>,
|
||||
/// A map from function names to function definitions.
|
||||
pub functions: IndexMap<Identifier, Function>,
|
||||
/// A map from program names to program scopes.
|
||||
pub program_scopes: IndexMap<ProgramId, ProgramScope>,
|
||||
}
|
||||
|
||||
impl fmt::Display for Program {
|
||||
@ -48,20 +42,11 @@ impl fmt::Display for Program {
|
||||
for (id, _import) in self.imports.iter() {
|
||||
writeln!(f, "import {}.leo;", id)?;
|
||||
}
|
||||
for (_, circuit) in self.circuits.iter() {
|
||||
circuit.fmt(f)?;
|
||||
for (_, program_scope) in self.program_scopes.iter() {
|
||||
program_scope.fmt(f)?;
|
||||
writeln!(f,)?;
|
||||
}
|
||||
for (_, mapping) in self.mappings.iter() {
|
||||
mapping.fmt(f)?;
|
||||
writeln!(f,)?;
|
||||
}
|
||||
for (_, function) in self.functions.iter() {
|
||||
function.fmt(f)?;
|
||||
writeln!(f,)?;
|
||||
}
|
||||
|
||||
write!(f, "")
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,13 +54,8 @@ impl Default for Program {
|
||||
/// Constructs an empty program node.
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
name: String::new(),
|
||||
network: String::new(),
|
||||
expected_input: vec![],
|
||||
imports: IndexMap::new(),
|
||||
circuits: IndexMap::new(),
|
||||
mappings: IndexMap::new(),
|
||||
functions: IndexMap::new(),
|
||||
program_scopes: IndexMap::new(),
|
||||
}
|
||||
}
|
||||
}
|
95
compiler/ast/src/program/program_id.rs
Normal file
95
compiler/ast/src/program/program_id.rs
Normal file
@ -0,0 +1,95 @@
|
||||
// Copyright (C) 2019-2022 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::Identifier;
|
||||
|
||||
use core::fmt;
|
||||
use serde::de::Visitor;
|
||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
/// An identifier for a program that is eventually deployed to the network.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
||||
pub struct ProgramId {
|
||||
/// The name of the program.
|
||||
pub name: Identifier,
|
||||
/// The network associated with the program.
|
||||
pub network: Identifier,
|
||||
}
|
||||
|
||||
impl fmt::Display for ProgramId {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}.{}", self.name, self.network)
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for ProgramId {
|
||||
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
// Converts an element that implements Serialize into a string.
|
||||
fn to_json_string<E: Serialize, Error: serde::ser::Error>(element: &E) -> Result<String, Error> {
|
||||
serde_json::to_string(&element).map_err(|e| Error::custom(e.to_string()))
|
||||
}
|
||||
|
||||
// Load the struct elements into a BTreeMap (to preserve serialized ordering of keys).
|
||||
let mut key: BTreeMap<String, String> = BTreeMap::new();
|
||||
key.insert("name".to_string(), self.name.to_string());
|
||||
key.insert("network".to_string(), to_json_string(&self.network)?);
|
||||
|
||||
// Convert the serialized object into a string for use as a key.
|
||||
serializer.serialize_str(&to_json_string(&key)?)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for ProgramId {
|
||||
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
||||
struct ProgramIdVisitor;
|
||||
|
||||
impl Visitor<'_> for ProgramIdVisitor {
|
||||
type Value = ProgramId;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("a string encoding the ast ProgramId struct")
|
||||
}
|
||||
|
||||
/// Implementation for recovering a string that serializes Identifier.
|
||||
fn visit_str<E: de::Error>(self, value: &str) -> Result<Self::Value, E> {
|
||||
// Converts a serialized string into an element that implements Deserialize.
|
||||
fn to_json_string<'a, D: Deserialize<'a>, Error: serde::de::Error>(
|
||||
serialized: &'a str,
|
||||
) -> Result<D, Error> {
|
||||
serde_json::from_str::<'a>(serialized).map_err(|e| Error::custom(e.to_string()))
|
||||
}
|
||||
|
||||
// Convert the serialized string into a BTreeMap to recover ProgramId.
|
||||
let key: BTreeMap<String, String> = to_json_string(value)?;
|
||||
|
||||
let name: Identifier = match key.get("name") {
|
||||
Some(name) => to_json_string(name)?,
|
||||
None => return Err(E::custom("missing 'name' in serialized ProgramId struct")),
|
||||
};
|
||||
|
||||
let network: Identifier = match key.get("network") {
|
||||
Some(network) => to_json_string(network)?,
|
||||
None => return Err(E::custom("missing 'network' in serialized ProgramId struct")),
|
||||
};
|
||||
|
||||
Ok(ProgramId { name, network })
|
||||
}
|
||||
}
|
||||
|
||||
deserializer.deserialize_str(ProgramIdVisitor)
|
||||
}
|
||||
}
|
55
compiler/ast/src/program/program_scope.rs
Normal file
55
compiler/ast/src/program/program_scope.rs
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2019-2022 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! A Leo program scope consists of struct, function, and mapping definitions.
|
||||
|
||||
use crate::{Function, Identifier, Mapping, ProgramId, Struct};
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use leo_span::Span;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
/// Stores the Leo program scope abstract syntax tree.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ProgramScope {
|
||||
/// The program id of the program scope.
|
||||
pub program_id: ProgramId,
|
||||
/// A map from struct names to struct definitions.
|
||||
pub structs: IndexMap<Identifier, Struct>,
|
||||
/// A map from mapping names to mapping definitions.
|
||||
pub mappings: IndexMap<Identifier, Mapping>,
|
||||
/// A map from function names to function definitions.
|
||||
pub functions: IndexMap<Identifier, Function>,
|
||||
/// The span associated with the program scope.
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
impl fmt::Display for ProgramScope {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
writeln!(f, "program {} {{", self.program_id)?;
|
||||
for (_, struct_) in self.structs.iter() {
|
||||
writeln!(f, " {}", struct_)?;
|
||||
}
|
||||
for (_, mapping) in self.mappings.iter() {
|
||||
writeln!(f, " {}", mapping)?;
|
||||
}
|
||||
for (_, function) in self.functions.iter() {
|
||||
writeln!(f, " {}", function)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
43
compiler/ast/src/struct/member.rs
Normal file
43
compiler/ast/src/struct/member.rs
Normal file
@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2019-2022 Aleo Systems Inc.
|
||||
// This file is part of the Leo library.
|
||||
|
||||
// The Leo library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// The Leo library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{Identifier, Type};
|
||||
use leo_span::Symbol;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
/// A member of a struct definition, e.g `foobar: u8`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct Member {
|
||||
/// The identifier of the member.
|
||||
pub identifier: Identifier,
|
||||
/// The type of the member.
|
||||
pub type_: Type,
|
||||
}
|
||||
|
||||
impl Member {
|
||||
/// Returns the name of the struct member without span.
|
||||
pub fn name(&self) -> Symbol {
|
||||
self.identifier.name
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Member {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}: {}", self.identifier, self.type_)
|
||||
}
|
||||
}
|
@ -14,8 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
pub mod circuit_member;
|
||||
pub use circuit_member::*;
|
||||
pub mod member;
|
||||
pub use member::*;
|
||||
|
||||
use crate::{Identifier, Node};
|
||||
use leo_span::{Span, Symbol};
|
||||
@ -23,49 +23,49 @@ use leo_span::{Span, Symbol};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
/// A circuit type definition, e.g., `circuit Foo { my_field: Bar }`.
|
||||
/// A struct type definition, e.g., `struct Foo { my_field: Bar }`.
|
||||
/// In some languages these are called `struct`s.
|
||||
///
|
||||
/// Type identity is decided by the full path including `circuit_name`,
|
||||
/// Type identity is decided by the full path including `struct_name`,
|
||||
/// as the record is nominal, not structural.
|
||||
/// The fields are named so `circuit Foo(u8, u16)` is not allowed.
|
||||
/// The fields are named so `struct Foo(u8, u16)` is not allowed.
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct Circuit {
|
||||
pub struct Struct {
|
||||
/// The name of the type in the type system in this module.
|
||||
pub identifier: Identifier,
|
||||
/// The fields, constant variables, and functions of this structure.
|
||||
pub members: Vec<CircuitMember>,
|
||||
pub members: Vec<Member>,
|
||||
/// Was this a `record Foo { ... }`?
|
||||
/// If so, it wasn't a circuit.
|
||||
/// If so, it wasn't a struct.
|
||||
pub is_record: bool,
|
||||
/// The entire span of the circuit definition.
|
||||
/// The entire span of the struct definition.
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
impl PartialEq for Circuit {
|
||||
impl PartialEq for Struct {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.identifier == other.identifier
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Circuit {}
|
||||
impl Eq for Struct {}
|
||||
|
||||
impl Circuit {
|
||||
/// Returns the circuit name as a Symbol.
|
||||
impl Struct {
|
||||
/// Returns the struct name as a Symbol.
|
||||
pub fn name(&self) -> Symbol {
|
||||
self.identifier.name
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Circuit {
|
||||
impl fmt::Debug for Struct {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Display>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Circuit {
|
||||
impl fmt::Display for Struct {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.write_str(if self.is_record { "record" } else { "circuit" })?;
|
||||
f.write_str(if self.is_record { "record" } else { "struct" })?;
|
||||
writeln!(f, " {} {{ ", self.identifier)?;
|
||||
for field in self.members.iter() {
|
||||
writeln!(f, " {}", field)?;
|
||||
@ -74,4 +74,4 @@ impl fmt::Display for Circuit {
|
||||
}
|
||||
}
|
||||
|
||||
crate::simple_node_impl!(Circuit);
|
||||
crate::simple_node_impl!(Struct);
|
@ -183,7 +183,7 @@ pub enum Value {
|
||||
Input(Type, Identifier),
|
||||
Address(String, Span),
|
||||
Boolean(bool, Span),
|
||||
Circuit(Identifier, IndexMap<Symbol, Value>),
|
||||
Struct(Identifier, IndexMap<Symbol, Value>),
|
||||
Field(String, Span),
|
||||
Group(Box<GroupLiteral>),
|
||||
I8(i8, Span),
|
||||
@ -728,7 +728,7 @@ impl Display for Value {
|
||||
match self {
|
||||
Input(type_, ident) => write!(f, "input var {}: {type_}", ident.name),
|
||||
Address(val, _) => write!(f, "{val}"),
|
||||
Circuit(val, _) => write!(f, "{}", val.name),
|
||||
Struct(val, _) => write!(f, "{}", val.name),
|
||||
Boolean(val, _) => write!(f, "{val}"),
|
||||
Field(val, _) => write!(f, "{val}"),
|
||||
Group(val) => write!(f, "{val}"),
|
||||
@ -845,7 +845,7 @@ impl From<&Value> for Type {
|
||||
Input(type_, _) => type_.clone(),
|
||||
Address(_, _) => Type::Address,
|
||||
Boolean(_, _) => Type::Boolean,
|
||||
Circuit(ident, _) => Type::Identifier(*ident),
|
||||
Struct(ident, _) => Type::Identifier(*ident),
|
||||
Field(_, _) => Type::Field,
|
||||
Group(_) => Type::Group,
|
||||
I8(_, _) => Type::Integer(IntegerType::I8),
|
||||
@ -899,7 +899,7 @@ impl From<Value> for Literal {
|
||||
Input(_, _) => todo!("We need to test if this is hittable"),
|
||||
Address(v, span) => Literal::Address(v, span),
|
||||
Boolean(v, span) => Literal::Boolean(v, span),
|
||||
Circuit(_ident, _values) => todo!("We need to test if this is hittable"),
|
||||
Struct(_ident, _values) => todo!("We need to test if this is hittable"),
|
||||
Field(v, span) => Literal::Field(v, span),
|
||||
Group(v) => Literal::Group(v),
|
||||
I8(v, span) => Literal::Integer(IntegerType::I8, v.to_string(), span),
|
||||
|
@ -95,9 +95,21 @@ impl<'a> Compiler<'a> {
|
||||
let prg_sf = with_session_globals(|s| s.source_map.new_source(program_string, name));
|
||||
|
||||
// Use the parser to construct the abstract syntax tree (ast).
|
||||
let mut ast: Ast = leo_parser::parse_ast(self.handler, &prg_sf.src, prg_sf.start_pos)?;
|
||||
ast = ast.set_program_name(self.program_name.clone());
|
||||
self.ast = ast.set_network(self.network.clone());
|
||||
self.ast = leo_parser::parse_ast(self.handler, &prg_sf.src, prg_sf.start_pos)?;
|
||||
|
||||
// If the program is imported, then check that the name of its program scope matches the file name.
|
||||
// Note that parsing enforces that there is exactly one program scope in a file.
|
||||
// TODO: Clean up check.
|
||||
let program_scope = self.ast.ast.program_scopes.values().next().unwrap();
|
||||
let program_scope_name = format!("{}", program_scope.program_id.name);
|
||||
if program_scope_name != self.program_name {
|
||||
return Err(CompilerError::program_scope_name_does_not_match(
|
||||
program_scope_name,
|
||||
self.program_name.clone(),
|
||||
program_scope.program_id.name.span,
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
if self.output_options.initial_ast {
|
||||
self.write_ast_to_json("initial_ast.json")?;
|
||||
|
@ -240,7 +240,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result<Va
|
||||
};
|
||||
|
||||
// Compile the program to bytecode.
|
||||
let program_name = format!("{}.aleo", parsed.program_name);
|
||||
let program_name = format!("{}.{}", parsed.program_name, parsed.network);
|
||||
let bytecode = handler.extend_if_error(compile_and_process(&mut parsed, handler))?;
|
||||
|
||||
// Run snarkvm package.
|
||||
|
@ -48,9 +48,9 @@ pub enum CoreInstruction {
|
||||
}
|
||||
|
||||
impl CoreInstruction {
|
||||
/// Returns a `CoreInstruction` from the given circuit and method symbols.
|
||||
pub fn from_symbols(circuit: Symbol, function: Symbol) -> Option<Self> {
|
||||
Some(match (circuit, function) {
|
||||
/// Returns a `CoreInstruction` from the given module and method symbols.
|
||||
pub fn from_symbols(module: Symbol, function: Symbol) -> Option<Self> {
|
||||
Some(match (module, function) {
|
||||
(sym::BHP256, sym::commit) => Self::BHP256Commit,
|
||||
(sym::BHP256, sym::hash) => Self::BHP256Hash,
|
||||
(sym::BHP512, sym::commit) => Self::BHP512Commit,
|
||||
@ -161,7 +161,7 @@ impl CoreInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
/// A core function of a core circuit, e.g. `hash` or `commit`
|
||||
/// A core function of a core struct, e.g. `hash` or `commit`
|
||||
/// Provides required type information to the type checker.
|
||||
trait CoreFunction {
|
||||
const NUM_ARGS: usize;
|
||||
|
@ -37,8 +37,8 @@ pub(crate) struct ParserContext<'a> {
|
||||
/// The previous token, i.e., if `p.tokens = ['3', *, '4']`,
|
||||
/// then after two `p.bump()`s, we'll have `p.token = '*'` and `p.prev_token = '3'`.
|
||||
pub(crate) prev_token: SpannedToken,
|
||||
/// true if parsing an expression for if and loop statements -- means circuit inits are not legal
|
||||
pub(crate) disallow_circuit_construction: bool,
|
||||
/// true if parsing an expression for if and loop statements -- means struct inits are not legal
|
||||
pub(crate) disallow_struct_construction: bool,
|
||||
/// true if parsing an identifier inside an input file.
|
||||
pub(crate) allow_identifier_underscores: bool,
|
||||
}
|
||||
@ -60,7 +60,7 @@ impl<'a> ParserContext<'a> {
|
||||
let token = SpannedToken::dummy();
|
||||
let mut p = Self {
|
||||
handler,
|
||||
disallow_circuit_construction: false,
|
||||
disallow_struct_construction: false,
|
||||
allow_identifier_underscores: false,
|
||||
prev_token: token.clone(),
|
||||
token,
|
||||
@ -177,7 +177,7 @@ impl<'a> ParserContext<'a> {
|
||||
}
|
||||
|
||||
/// Returns an unexpected error at the current token.
|
||||
fn unexpected<T>(&self, expected: impl Display) -> Result<T> {
|
||||
pub(super) fn unexpected<T>(&self, expected: impl Display) -> Result<T> {
|
||||
Err(ParserError::unexpected(&self.token.token, expected, self.token.span).into())
|
||||
}
|
||||
|
||||
|
@ -38,25 +38,25 @@ const INT_TYPES: &[Token] = &[
|
||||
|
||||
impl ParserContext<'_> {
|
||||
/// Returns an [`Expression`] AST node if the next token is an expression.
|
||||
/// Includes circuit init expressions.
|
||||
/// Includes struct init expressions.
|
||||
pub(crate) fn parse_expression(&mut self) -> Result<Expression> {
|
||||
// Store current parser state.
|
||||
let prior_fuzzy_state = self.disallow_circuit_construction;
|
||||
let prior_fuzzy_state = self.disallow_struct_construction;
|
||||
|
||||
// Allow circuit init expressions.
|
||||
self.disallow_circuit_construction = false;
|
||||
// Allow struct init expressions.
|
||||
self.disallow_struct_construction = false;
|
||||
|
||||
// Parse expression.
|
||||
let result = self.parse_conditional_expression();
|
||||
|
||||
// Restore prior parser state.
|
||||
self.disallow_circuit_construction = prior_fuzzy_state;
|
||||
self.disallow_struct_construction = prior_fuzzy_state;
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
/// Returns an [`Expression`] AST node if the next tokens represent
|
||||
/// a ternary expression. May or may not include circuit init expressions.
|
||||
/// a ternary expression. May or may not include struct init expressions.
|
||||
///
|
||||
/// Otherwise, tries to parse the next token using [`parse_boolean_or_expression`].
|
||||
pub(super) fn parse_conditional_expression(&mut self) -> Result<Expression> {
|
||||
@ -307,15 +307,15 @@ impl ParserContext<'_> {
|
||||
|
||||
/// Returns an [`Expression`] AST node if the next tokens represent a
|
||||
/// static access expression.
|
||||
fn parse_associated_access_expression(&mut self, circuit_name: Expression) -> Result<Expression> {
|
||||
// Parse circuit name expression into circuit type.
|
||||
let circuit_type = if let Expression::Identifier(ident) = circuit_name {
|
||||
fn parse_associated_access_expression(&mut self, module_name: Expression) -> Result<Expression> {
|
||||
// Parse struct name expression into struct type.
|
||||
let type_ = if let Expression::Identifier(ident) = module_name {
|
||||
Type::Identifier(ident)
|
||||
} else {
|
||||
return Err(ParserError::invalid_associated_access(&circuit_name, circuit_name.span()).into());
|
||||
return Err(ParserError::invalid_associated_access(&module_name, module_name.span()).into());
|
||||
};
|
||||
|
||||
// Parse the circuit member name (can be variable or function name).
|
||||
// Parse the struct member name (can be variable or function name).
|
||||
let member_name = self.expect_identifier()?;
|
||||
|
||||
// Check if there are arguments.
|
||||
@ -323,18 +323,18 @@ impl ParserContext<'_> {
|
||||
// Parse the arguments
|
||||
let (args, _, end) = self.parse_expr_tuple()?;
|
||||
|
||||
// Return the circuit function.
|
||||
// Return the struct function.
|
||||
AccessExpression::AssociatedFunction(AssociatedFunction {
|
||||
span: circuit_name.span() + end,
|
||||
ty: circuit_type,
|
||||
span: module_name.span() + end,
|
||||
ty: type_,
|
||||
name: member_name,
|
||||
args,
|
||||
})
|
||||
} else {
|
||||
// Return the circuit constant.
|
||||
// Return the struct constant.
|
||||
AccessExpression::AssociatedConstant(AssociatedConstant {
|
||||
span: circuit_name.span() + member_name.span(),
|
||||
ty: circuit_type,
|
||||
span: module_name.span() + member_name.span(),
|
||||
ty: type_,
|
||||
name: member_name,
|
||||
})
|
||||
}))
|
||||
@ -346,7 +346,7 @@ impl ParserContext<'_> {
|
||||
}
|
||||
|
||||
/// Returns an [`Expression`] AST node if the next tokens represent an
|
||||
/// array access, circuit member access, function call, or static function call expression.
|
||||
/// array access, struct member access, function call, or static function call expression.
|
||||
///
|
||||
/// Otherwise, tries to parse the next token using [`parse_primary_expression`].
|
||||
fn parse_postfix_expression(&mut self) -> Result<Expression> {
|
||||
@ -387,7 +387,7 @@ impl ParserContext<'_> {
|
||||
// Eat a method call on a type
|
||||
expr = self.parse_method_call_expression(expr, name)?
|
||||
} else {
|
||||
// Eat a circuit member access.
|
||||
// Eat a struct member access.
|
||||
expr = Expression::Access(AccessExpression::Member(MemberAccess {
|
||||
span: expr.span(),
|
||||
inner: Box::new(expr),
|
||||
@ -396,7 +396,7 @@ impl ParserContext<'_> {
|
||||
}
|
||||
}
|
||||
} else if self.eat(&Token::DoubleColon) {
|
||||
// Eat a core circuit constant or core circuit function call.
|
||||
// Eat a core struct constant or core struct function call.
|
||||
expr = self.parse_associated_access_expression(expr)?;
|
||||
} else if self.check(&Token::LeftParen) {
|
||||
// Parse a function call that's by itself.
|
||||
@ -494,9 +494,9 @@ impl ParserContext<'_> {
|
||||
Some(Ok(gt))
|
||||
}
|
||||
|
||||
fn parse_circuit_member(&mut self) -> Result<CircuitVariableInitializer> {
|
||||
fn parse_struct_member(&mut self) -> Result<StructVariableInitializer> {
|
||||
let identifier = if self.allow_identifier_underscores && self.eat(&Token::Underscore) {
|
||||
// Allow `_nonce` for circuit records.
|
||||
// Allow `_nonce` for struct records.
|
||||
let identifier_without_underscore = self.expect_identifier()?;
|
||||
Identifier::new(Symbol::intern(&format!("_{}", identifier_without_underscore.name)))
|
||||
} else {
|
||||
@ -504,24 +504,24 @@ impl ParserContext<'_> {
|
||||
};
|
||||
|
||||
let expression = if self.eat(&Token::Colon) {
|
||||
// Parse individual circuit variable declarations.
|
||||
// Parse individual struct variable declarations.
|
||||
Some(self.parse_expression()?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Ok(CircuitVariableInitializer { identifier, expression })
|
||||
Ok(StructVariableInitializer { identifier, expression })
|
||||
}
|
||||
|
||||
/// Returns an [`Expression`] AST node if the next tokens represent a
|
||||
/// circuit initialization expression.
|
||||
/// struct initialization expression.
|
||||
/// let foo = Foo { x: 1u8 };
|
||||
pub fn parse_circuit_init_expression(&mut self, identifier: Identifier) -> Result<Expression> {
|
||||
pub fn parse_struct_init_expression(&mut self, identifier: Identifier) -> Result<Expression> {
|
||||
let (members, _, end) = self.parse_list(Delimiter::Brace, Some(Token::Comma), |p| {
|
||||
p.parse_circuit_member().map(Some)
|
||||
p.parse_struct_member().map(Some)
|
||||
})?;
|
||||
|
||||
Ok(Expression::Circuit(CircuitExpression {
|
||||
Ok(Expression::Struct(StructExpression {
|
||||
span: identifier.span + end,
|
||||
name: identifier,
|
||||
members,
|
||||
@ -584,10 +584,10 @@ impl ParserContext<'_> {
|
||||
Token::StaticString(value) => Expression::Literal(Literal::String(value, span)),
|
||||
Token::Identifier(name) => {
|
||||
let ident = Identifier { name, span };
|
||||
if !self.disallow_circuit_construction && self.check(&Token::LeftCurly) {
|
||||
// Parse circuit and records inits as circuit expressions.
|
||||
// Enforce circuit or record type later at type checking.
|
||||
self.parse_circuit_init_expression(ident)?
|
||||
if !self.disallow_struct_construction && self.check(&Token::LeftCurly) {
|
||||
// Parse struct and records inits as struct expressions.
|
||||
// Enforce struct or record type later at type checking.
|
||||
self.parse_struct_init_expression(ident)?
|
||||
} else {
|
||||
Expression::Identifier(ident)
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ use crate::parse_ast;
|
||||
use leo_errors::{CompilerError, ParserError, ParserWarning, Result};
|
||||
use leo_span::source_map::FileName;
|
||||
use leo_span::symbol::with_session_globals;
|
||||
use leo_span::{sym, Symbol};
|
||||
|
||||
use std::fs;
|
||||
|
||||
@ -27,56 +26,47 @@ impl ParserContext<'_> {
|
||||
/// Returns a [`Program`] AST if all tokens can be consumed and represent a valid Leo program.
|
||||
pub fn parse_program(&mut self) -> Result<Program> {
|
||||
let mut imports = IndexMap::new();
|
||||
let mut functions = IndexMap::new();
|
||||
let mut circuits = IndexMap::new();
|
||||
let mut mappings = IndexMap::new();
|
||||
let mut program_scopes = IndexMap::new();
|
||||
|
||||
// TODO: Remove restrictions on multiple program scopes
|
||||
let mut parsed_program_scope = false;
|
||||
|
||||
// TODO: Condense logic
|
||||
while self.has_next() {
|
||||
match &self.token.token {
|
||||
Token::Import => {
|
||||
let (id, import) = self.parse_import()?;
|
||||
imports.insert(id, import);
|
||||
}
|
||||
Token::Circuit | Token::Record => {
|
||||
let (id, circuit) = self.parse_circuit()?;
|
||||
circuits.insert(id, circuit);
|
||||
Token::Program => {
|
||||
match parsed_program_scope {
|
||||
// Only one program scope is allowed per file.
|
||||
true => return Err(ParserError::only_one_program_scope_is_allowed(self.token.span).into()),
|
||||
false => {
|
||||
parsed_program_scope = true;
|
||||
let program_scope = self.parse_program_scope()?;
|
||||
program_scopes.insert(program_scope.program_id, program_scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
Token::Mapping => {
|
||||
let (id, mapping) = self.parse_mapping()?;
|
||||
mappings.insert(id, mapping);
|
||||
}
|
||||
Token::At => {
|
||||
let (id, function) = self.parse_function()?;
|
||||
functions.insert(id, function);
|
||||
}
|
||||
Token::Const if self.peek_is_function() => {
|
||||
let (id, function) = self.parse_function()?;
|
||||
functions.insert(id, function);
|
||||
}
|
||||
Token::Identifier(sym::test) => return Err(ParserError::test_function(self.token.span).into()),
|
||||
Token::Function => {
|
||||
let (id, function) = self.parse_function()?;
|
||||
functions.insert(id, function);
|
||||
}
|
||||
_ => return Err(Self::unexpected_item(&self.token).into()),
|
||||
_ => return Err(Self::unexpected_item(&self.token, &[Token::Import, Token::Program]).into()),
|
||||
}
|
||||
}
|
||||
|
||||
// Requires that at least one program scope is present.
|
||||
if !parsed_program_scope {
|
||||
return Err(ParserError::missing_program_scope(self.token.span).into());
|
||||
}
|
||||
|
||||
Ok(Program {
|
||||
name: String::new(),
|
||||
network: String::new(),
|
||||
expected_input: Vec::new(),
|
||||
imports,
|
||||
functions,
|
||||
circuits,
|
||||
mappings,
|
||||
program_scopes,
|
||||
})
|
||||
}
|
||||
|
||||
fn unexpected_item(token: &SpannedToken) -> ParserError {
|
||||
fn unexpected_item(token: &SpannedToken, expected: &[Token]) -> ParserError {
|
||||
ParserError::unexpected(
|
||||
&token.token,
|
||||
[Token::Function, Token::Circuit, Token::Identifier(sym::test)]
|
||||
expected
|
||||
.iter()
|
||||
.map(|x| format!("'{}'", x))
|
||||
.collect::<Vec<_>>()
|
||||
@ -131,40 +121,103 @@ impl ParserContext<'_> {
|
||||
Ok((import_name, program_ast.into_repr()))
|
||||
}
|
||||
|
||||
/// Returns a [`Vec<CircuitMember>`] AST node if the next tokens represent a circuit member variable
|
||||
/// or circuit member function or circuit member constant.
|
||||
fn parse_circuit_members(&mut self) -> Result<(Vec<CircuitMember>, Span)> {
|
||||
/// Parsers a program scope `program foo.aleo { ... }`.
|
||||
fn parse_program_scope(&mut self) -> Result<ProgramScope> {
|
||||
// Parse `program` keyword.
|
||||
let start = self.expect(&Token::Program)?;
|
||||
|
||||
// Parse the program name.
|
||||
let name = self.expect_identifier()?;
|
||||
|
||||
// Parse the program network.
|
||||
self.expect(&Token::Dot)?;
|
||||
let network = self.expect_identifier()?;
|
||||
|
||||
// Construct the program id.
|
||||
let program_id = ProgramId { name, network };
|
||||
|
||||
// Check that the program network is valid.
|
||||
if network.name != sym::aleo {
|
||||
return Err(ParserError::invalid_network(network.span).into());
|
||||
}
|
||||
|
||||
// Parse `{`.
|
||||
self.expect(&Token::LeftCurly)?;
|
||||
|
||||
// Parse the body of the program scope.
|
||||
let mut functions = IndexMap::new();
|
||||
let mut structs = IndexMap::new();
|
||||
let mut mappings = IndexMap::new();
|
||||
|
||||
while self.has_next() {
|
||||
match &self.token.token {
|
||||
Token::Struct | Token::Record => {
|
||||
let (id, struct_) = self.parse_struct()?;
|
||||
structs.insert(id, struct_);
|
||||
}
|
||||
Token::Mapping => {
|
||||
let (id, mapping) = self.parse_mapping()?;
|
||||
mappings.insert(id, mapping);
|
||||
}
|
||||
Token::At | Token::Function | Token::Transition => {
|
||||
let (id, function) = self.parse_function()?;
|
||||
functions.insert(id, function);
|
||||
}
|
||||
Token::Circuit => return Err(ParserError::circuit_is_deprecated(self.token.span).into()),
|
||||
Token::RightCurly => break,
|
||||
_ => {
|
||||
return Err(Self::unexpected_item(
|
||||
&self.token,
|
||||
&[
|
||||
Token::Struct,
|
||||
Token::Record,
|
||||
Token::Mapping,
|
||||
Token::At,
|
||||
Token::Function,
|
||||
Token::Transition,
|
||||
],
|
||||
)
|
||||
.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parse `}`.
|
||||
let end = self.expect(&Token::RightCurly)?;
|
||||
|
||||
Ok(ProgramScope {
|
||||
program_id,
|
||||
functions,
|
||||
structs,
|
||||
mappings,
|
||||
span: start + end,
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns a [`Vec<Member>`] AST node if the next tokens represent a struct member.
|
||||
fn parse_struct_members(&mut self) -> Result<(Vec<Member>, Span)> {
|
||||
let mut members = Vec::new();
|
||||
|
||||
let (mut semi_colons, mut commas) = (false, false);
|
||||
|
||||
while !self.check(&Token::RightCurly) {
|
||||
members.push(if self.peek_is_function() {
|
||||
// function
|
||||
self.parse_member_function_declaration()?
|
||||
} else if self.eat(&Token::Static) {
|
||||
// static const
|
||||
self.parse_const_member_variable_declaration()?
|
||||
} else {
|
||||
// variable
|
||||
let variable = self.parse_member_variable_declaration()?;
|
||||
let variable = self.parse_member_variable_declaration()?;
|
||||
|
||||
if self.eat(&Token::Semicolon) {
|
||||
if commas {
|
||||
self.emit_err(ParserError::mixed_commas_and_semicolons(self.token.span));
|
||||
}
|
||||
semi_colons = true;
|
||||
if self.eat(&Token::Semicolon) {
|
||||
if commas {
|
||||
self.emit_err(ParserError::mixed_commas_and_semicolons(self.token.span));
|
||||
}
|
||||
semi_colons = true;
|
||||
}
|
||||
|
||||
if self.eat(&Token::Comma) {
|
||||
if semi_colons {
|
||||
self.emit_err(ParserError::mixed_commas_and_semicolons(self.token.span));
|
||||
}
|
||||
commas = true;
|
||||
if self.eat(&Token::Comma) {
|
||||
if semi_colons {
|
||||
self.emit_err(ParserError::mixed_commas_and_semicolons(self.token.span));
|
||||
}
|
||||
commas = true;
|
||||
}
|
||||
|
||||
variable
|
||||
});
|
||||
members.push(variable);
|
||||
}
|
||||
let span = self.expect(&Token::RightCurly)?;
|
||||
|
||||
@ -180,57 +233,26 @@ impl ParserContext<'_> {
|
||||
Ok((name, type_))
|
||||
}
|
||||
|
||||
/// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member static constant.
|
||||
fn parse_const_member_variable_declaration(&mut self) -> Result<CircuitMember> {
|
||||
self.expect(&Token::Static)?;
|
||||
self.expect(&Token::Const)?;
|
||||
/// Returns a [`Member`] AST node if the next tokens represent a struct member variable.
|
||||
fn parse_member_variable_declaration(&mut self) -> Result<Member> {
|
||||
let (identifier, type_) = self.parse_typed_ident()?;
|
||||
|
||||
// `IDENT: TYPE = EXPR`:
|
||||
let (_name, _type_) = self.parse_typed_ident()?;
|
||||
self.expect(&Token::Assign)?;
|
||||
let expr = self.parse_expression()?;
|
||||
|
||||
self.expect(&Token::Semicolon)?;
|
||||
|
||||
// CAUTION: function members are unstable for testnet3.
|
||||
Err(ParserError::circuit_constants_unstable(expr.span()).into())
|
||||
|
||||
// Ok(CircuitMember::CircuitConst(name, type_, expr))
|
||||
Ok(Member { identifier, type_ })
|
||||
}
|
||||
|
||||
/// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member variable.
|
||||
fn parse_member_variable_declaration(&mut self) -> Result<CircuitMember> {
|
||||
let (name, type_) = self.parse_typed_ident()?;
|
||||
|
||||
Ok(CircuitMember::CircuitVariable(name, type_))
|
||||
}
|
||||
|
||||
/// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member function.
|
||||
fn parse_member_function_declaration(&mut self) -> Result<CircuitMember> {
|
||||
if self.peek_is_function() {
|
||||
// CAUTION: function members are unstable for testnet3.
|
||||
let function = self.parse_function()?;
|
||||
|
||||
Err(ParserError::circuit_functions_unstable(function.1.span()).into())
|
||||
// Ok(CircuitMember::CircuitFunction(Box::new(function.1)))
|
||||
} else {
|
||||
Err(Self::unexpected_item(&self.token).into())
|
||||
}
|
||||
}
|
||||
|
||||
/// Parses a circuit or record definition, e.g., `circuit Foo { ... }` or `record Foo { ... }`.
|
||||
pub(super) fn parse_circuit(&mut self) -> Result<(Identifier, Circuit)> {
|
||||
/// Parses a struct or record definition, e.g., `struct Foo { ... }` or `record Foo { ... }`.
|
||||
pub(super) fn parse_struct(&mut self) -> Result<(Identifier, Struct)> {
|
||||
let is_record = matches!(&self.token.token, Token::Record);
|
||||
let start = self.expect_any(&[Token::Circuit, Token::Record])?;
|
||||
let circuit_name = self.expect_identifier()?;
|
||||
let start = self.expect_any(&[Token::Struct, Token::Record])?;
|
||||
let struct_name = self.expect_identifier()?;
|
||||
|
||||
self.expect(&Token::LeftCurly)?;
|
||||
let (members, end) = self.parse_circuit_members()?;
|
||||
let (members, end) = self.parse_struct_members()?;
|
||||
|
||||
Ok((
|
||||
circuit_name,
|
||||
Circuit {
|
||||
identifier: circuit_name,
|
||||
struct_name,
|
||||
Struct {
|
||||
identifier: struct_name,
|
||||
members,
|
||||
is_record,
|
||||
span: start + end,
|
||||
@ -369,20 +391,17 @@ impl ParserContext<'_> {
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns `true` if the next token is Function or if it is a Const followed by Function.
|
||||
/// Returns `false` otherwise.
|
||||
fn peek_is_function(&self) -> bool {
|
||||
matches!(
|
||||
(&self.token.token, self.look_ahead(1, |t| &t.token)),
|
||||
(Token::Function, _) | (Token::Const, Token::Function)
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns an [`Annotation`] AST node if the next tokens represent an annotation.
|
||||
fn parse_annotation(&mut self) -> Result<Annotation> {
|
||||
// Parse the `@` symbol and identifier.
|
||||
let start = self.expect(&Token::At)?;
|
||||
let identifier = self.expect_identifier()?;
|
||||
let identifier = match self.token.token {
|
||||
Token::Program => Identifier {
|
||||
name: sym::program,
|
||||
span: self.expect(&Token::Program)?,
|
||||
},
|
||||
_ => self.expect_identifier()?,
|
||||
};
|
||||
let span = start + identifier.span;
|
||||
|
||||
// TODO: Verify that this check is sound.
|
||||
@ -397,14 +416,17 @@ impl ParserContext<'_> {
|
||||
/// and function definition.
|
||||
fn parse_function(&mut self) -> Result<(Identifier, Function)> {
|
||||
// TODO: Handle dangling annotations.
|
||||
// TODO: Handle duplicate annotations.
|
||||
// Parse annotations, if they exist.
|
||||
let mut annotations = Vec::new();
|
||||
while self.look_ahead(0, |t| &t.token) == &Token::At {
|
||||
annotations.push(self.parse_annotation()?)
|
||||
}
|
||||
// Parse `function IDENT`.
|
||||
let start = self.expect(&Token::Function)?;
|
||||
// Parse `<call_type> IDENT`, where `<call_type>` is `function` or `transition`.
|
||||
let (call_type, start) = match self.token.token {
|
||||
Token::Function => (CallType::Standard, self.expect(&Token::Function)?),
|
||||
Token::Transition => (CallType::Transition, self.expect(&Token::Transition)?),
|
||||
_ => self.unexpected("'function', 'transition'")?,
|
||||
};
|
||||
let name = self.expect_identifier()?;
|
||||
|
||||
// Parse parameters.
|
||||
@ -414,12 +436,12 @@ impl ParserContext<'_> {
|
||||
let output = match self.eat(&Token::Arrow) {
|
||||
false => vec![],
|
||||
true => {
|
||||
self.disallow_circuit_construction = true;
|
||||
self.disallow_struct_construction = true;
|
||||
let output = match self.peek_is_left_par() {
|
||||
true => self.parse_paren_comma_list(|p| p.parse_output().map(Some))?.0,
|
||||
false => vec![self.parse_output()?],
|
||||
};
|
||||
self.disallow_circuit_construction = false;
|
||||
self.disallow_struct_construction = false;
|
||||
output
|
||||
}
|
||||
};
|
||||
@ -444,12 +466,12 @@ impl ParserContext<'_> {
|
||||
let output = match self.eat(&Token::Arrow) {
|
||||
false => vec![],
|
||||
true => {
|
||||
self.disallow_circuit_construction = true;
|
||||
self.disallow_struct_construction = true;
|
||||
let output = match self.peek_is_left_par() {
|
||||
true => self.parse_paren_comma_list(|p| p.parse_output().map(Some))?.0,
|
||||
false => vec![self.parse_output()?],
|
||||
};
|
||||
self.disallow_circuit_construction = false;
|
||||
self.disallow_struct_construction = false;
|
||||
output
|
||||
}
|
||||
};
|
||||
@ -465,7 +487,9 @@ impl ParserContext<'_> {
|
||||
let span = start + block.span;
|
||||
Ok((
|
||||
name,
|
||||
Function::new(annotations, name, inputs, output, block, finalize, span),
|
||||
Function::new(annotations, call_type, name, inputs, output, block, finalize, span),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
use leo_span::{sym, Symbol};
|
||||
|
@ -177,9 +177,9 @@ impl ParserContext<'_> {
|
||||
/// Returns a [`ConditionalStatement`] AST node if the next tokens represent a conditional statement.
|
||||
fn parse_conditional_statement(&mut self) -> Result<ConditionalStatement> {
|
||||
let start = self.expect(&Token::If)?;
|
||||
self.disallow_circuit_construction = true;
|
||||
self.disallow_struct_construction = true;
|
||||
let expr = self.parse_conditional_expression()?;
|
||||
self.disallow_circuit_construction = false;
|
||||
self.disallow_struct_construction = false;
|
||||
let body = self.parse_block()?;
|
||||
let next = if self.eat(&Token::Else) {
|
||||
let s = self.parse_statement()?;
|
||||
@ -210,9 +210,9 @@ impl ParserContext<'_> {
|
||||
// Parse iteration range.
|
||||
let start = self.parse_expression()?;
|
||||
self.expect(&Token::DotDot)?;
|
||||
self.disallow_circuit_construction = true;
|
||||
self.disallow_struct_construction = true;
|
||||
let stop = self.parse_conditional_expression()?;
|
||||
self.disallow_circuit_construction = false;
|
||||
self.disallow_struct_construction = false;
|
||||
|
||||
let block = self.parse_block()?;
|
||||
|
||||
|
@ -420,12 +420,15 @@ impl Token {
|
||||
"let" => Token::Let,
|
||||
"leo" => Token::Leo,
|
||||
"mapping" => Token::Mapping,
|
||||
"program" => Token::Program,
|
||||
"public" => Token::Public,
|
||||
"record" => Token::Record,
|
||||
"return" => Token::Return,
|
||||
"scalar" => Token::Scalar,
|
||||
"self" => Token::SelfLower,
|
||||
"string" => Token::String,
|
||||
"struct" => Token::Struct,
|
||||
"transition" => Token::Transition,
|
||||
"true" => Token::True,
|
||||
"u8" => Token::U8,
|
||||
"u16" => Token::U16,
|
||||
|
@ -103,11 +103,14 @@ mod tests {
|
||||
input
|
||||
let
|
||||
mut
|
||||
program
|
||||
return
|
||||
scalar
|
||||
self
|
||||
string
|
||||
struct
|
||||
test
|
||||
transition
|
||||
true
|
||||
u128
|
||||
u64
|
||||
@ -158,7 +161,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
output,
|
||||
r#""test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" test_ident 12345 address async bool const else false field finalize for function group i128 i64 i32 i16 i8 if in input let mut return scalar self string test true u128 u64 u32 u16 u8 console ! != && ( ) * ** + , - -> => _ . .. / : ; < <= = == > >= [ ] { { } } || ? @ // test
|
||||
r#""test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" test_ident 12345 address async bool const else false field finalize for function group i128 i64 i32 i16 i8 if in input let mut program return scalar self string struct test transition true u128 u64 u32 u16 u8 console ! != && ( ) * ** + , - -> => _ . .. / : ; < <= = == > >= [ ] { { } } || ? @ // test
|
||||
/* test */ // "#
|
||||
);
|
||||
});
|
||||
|
@ -126,11 +126,14 @@ pub enum Token {
|
||||
Increment,
|
||||
Let,
|
||||
Mapping,
|
||||
Program,
|
||||
// For public inputs.
|
||||
Public,
|
||||
Return,
|
||||
SelfLower,
|
||||
Static,
|
||||
Struct,
|
||||
Transition,
|
||||
// For imports.
|
||||
Leo,
|
||||
|
||||
@ -146,7 +149,6 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Address,
|
||||
Token::Async,
|
||||
Token::Bool,
|
||||
Token::Circuit,
|
||||
Token::Console,
|
||||
Token::Const,
|
||||
Token::Constant,
|
||||
@ -169,6 +171,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Increment,
|
||||
Token::Let,
|
||||
Token::Mapping,
|
||||
Token::Program,
|
||||
Token::Public,
|
||||
Token::Record,
|
||||
Token::Return,
|
||||
@ -176,6 +179,8 @@ pub const KEYWORD_TOKENS: &[Token] = &[
|
||||
Token::Scalar,
|
||||
Token::Static,
|
||||
Token::String,
|
||||
Token::Struct,
|
||||
Token::Transition,
|
||||
Token::True,
|
||||
Token::U8,
|
||||
Token::U16,
|
||||
@ -196,7 +201,6 @@ impl Token {
|
||||
Token::Address => sym::address,
|
||||
Token::Async => sym::Async,
|
||||
Token::Bool => sym::bool,
|
||||
Token::Circuit => sym::circuit,
|
||||
Token::Console => sym::console,
|
||||
Token::Const => sym::Const,
|
||||
Token::Constant => sym::Constant,
|
||||
@ -220,6 +224,7 @@ impl Token {
|
||||
Token::Let => sym::Let,
|
||||
Token::Leo => sym::leo,
|
||||
Token::Mapping => sym::mapping,
|
||||
Token::Program => sym::program,
|
||||
Token::Public => sym::Public,
|
||||
Token::Record => sym::record,
|
||||
Token::Return => sym::Return,
|
||||
@ -227,6 +232,8 @@ impl Token {
|
||||
Token::SelfLower => sym::SelfLower,
|
||||
Token::Static => sym::Static,
|
||||
Token::String => sym::string,
|
||||
Token::Struct => sym::Struct,
|
||||
Token::Transition => sym::transition,
|
||||
Token::True => sym::True,
|
||||
Token::U8 => sym::u8,
|
||||
Token::U16 => sym::u16,
|
||||
@ -338,10 +345,13 @@ impl fmt::Display for Token {
|
||||
Increment => write!(f, "increment"),
|
||||
Let => write!(f, "let"),
|
||||
Mapping => write!(f, "mapping"),
|
||||
SelfLower => write!(f, "self"),
|
||||
Program => write!(f, "program"),
|
||||
Public => write!(f, "public"),
|
||||
Return => write!(f, "return"),
|
||||
SelfLower => write!(f, "self"),
|
||||
Static => write!(f, "static"),
|
||||
Struct => write!(f, "struct"),
|
||||
Transition => write!(f, "transition"),
|
||||
Leo => write!(f, "leo"),
|
||||
Eof => write!(f, "<eof>"),
|
||||
}
|
||||
|
@ -32,9 +32,8 @@ pub struct CodeGenerator<'a> {
|
||||
/// The first element of the tuple indicate whether the composite is a record or not.
|
||||
/// The second element of the tuple is a string modifier used for code generation.
|
||||
pub(crate) composite_mapping: IndexMap<&'a Symbol, (bool, String)>,
|
||||
/// Are we traversing a program function?
|
||||
/// A "program function" is a function that can be invoked by a user or another program.
|
||||
pub(crate) is_program_function: bool,
|
||||
/// Are we traversing a transition function?
|
||||
pub(crate) is_transition_function: bool,
|
||||
/// Are we traversing a finalize block?
|
||||
pub(crate) in_finalize: bool,
|
||||
}
|
||||
@ -49,7 +48,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
current_function: None,
|
||||
variable_mapping: IndexMap::new(),
|
||||
composite_mapping: IndexMap::new(),
|
||||
is_program_function: false,
|
||||
is_transition_function: false,
|
||||
in_finalize: false,
|
||||
}
|
||||
}
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
use crate::CodeGenerator;
|
||||
use leo_ast::{
|
||||
AccessExpression, AssociatedFunction, BinaryExpression, BinaryOperation, CallExpression, CircuitExpression,
|
||||
ErrExpression, Expression, Identifier, Literal, MemberAccess, TernaryExpression, TupleExpression, Type,
|
||||
UnaryExpression, UnaryOperation,
|
||||
AccessExpression, AssociatedFunction, BinaryExpression, BinaryOperation, CallExpression, ErrExpression, Expression,
|
||||
Identifier, Literal, MemberAccess, StructExpression, TernaryExpression, TupleExpression, Type, UnaryExpression,
|
||||
UnaryOperation,
|
||||
};
|
||||
use leo_span::sym;
|
||||
|
||||
@ -34,7 +34,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
Expression::Access(expr) => self.visit_access(expr),
|
||||
Expression::Binary(expr) => self.visit_binary(expr),
|
||||
Expression::Call(expr) => self.visit_call(expr),
|
||||
Expression::Circuit(expr) => self.visit_circuit_init(expr),
|
||||
Expression::Struct(expr) => self.visit_struct_init(expr),
|
||||
Expression::Err(expr) => self.visit_err(expr),
|
||||
Expression::Identifier(expr) => self.visit_identifier(expr),
|
||||
Expression::Literal(expr) => self.visit_value(expr),
|
||||
@ -160,8 +160,8 @@ impl<'a> CodeGenerator<'a> {
|
||||
(destination_register, instructions)
|
||||
}
|
||||
|
||||
fn visit_circuit_init(&mut self, input: &'a CircuitExpression) -> (String, String) {
|
||||
// Lookup circuit or record.
|
||||
fn visit_struct_init(&mut self, input: &'a StructExpression) -> (String, String) {
|
||||
// Lookup struct or record.
|
||||
let name = if let Some((is_record, type_)) = self.composite_mapping.get(&input.name.name) {
|
||||
if *is_record {
|
||||
// record.private;
|
||||
@ -176,9 +176,9 @@ impl<'a> CodeGenerator<'a> {
|
||||
|
||||
// Initialize instruction builder strings.
|
||||
let mut instructions = String::new();
|
||||
let mut circuit_init_instruction = String::from(" cast ");
|
||||
let mut struct_init_instruction = String::from(" cast ");
|
||||
|
||||
// Visit each circuit member and accumulate instructions from expressions.
|
||||
// Visit each struct member and accumulate instructions from expressions.
|
||||
for member in input.members.iter() {
|
||||
let operand = if let Some(expr) = member.expression.as_ref() {
|
||||
// Visit variable expression.
|
||||
@ -194,21 +194,21 @@ impl<'a> CodeGenerator<'a> {
|
||||
ident_operand
|
||||
};
|
||||
|
||||
// Push operand name to circuit init instruction.
|
||||
write!(circuit_init_instruction, "{} ", operand).expect("failed to write to string");
|
||||
// Push operand name to struct init instruction.
|
||||
write!(struct_init_instruction, "{} ", operand).expect("failed to write to string");
|
||||
}
|
||||
|
||||
// Push destination register to circuit init instruction.
|
||||
// Push destination register to struct init instruction.
|
||||
let destination_register = format!("r{}", self.next_register);
|
||||
writeln!(
|
||||
circuit_init_instruction,
|
||||
struct_init_instruction,
|
||||
"into {dest} as {name};",
|
||||
dest = destination_register,
|
||||
name = name,
|
||||
)
|
||||
.expect("failed to write to string");
|
||||
|
||||
instructions.push_str(&circuit_init_instruction);
|
||||
instructions.push_str(&struct_init_instruction);
|
||||
|
||||
// Increment the register counter.
|
||||
self.next_register += 1;
|
||||
@ -217,8 +217,8 @@ impl<'a> CodeGenerator<'a> {
|
||||
}
|
||||
|
||||
fn visit_member_access(&mut self, input: &'a MemberAccess) -> (String, String) {
|
||||
let (inner_circuit, _inner_instructions) = self.visit_expression(&input.inner);
|
||||
let member_access_instruction = format!("{}.{}", inner_circuit, input.name);
|
||||
let (inner_struct, _inner_instructions) = self.visit_expression(&input.inner);
|
||||
let member_access_instruction = format!("{}.{}", inner_struct, input.name);
|
||||
|
||||
(member_access_instruction, String::new())
|
||||
}
|
||||
@ -237,10 +237,10 @@ impl<'a> CodeGenerator<'a> {
|
||||
sym::Poseidon2 => "psd2",
|
||||
sym::Poseidon4 => "psd4",
|
||||
sym::Poseidon8 => "psd8",
|
||||
_ => unreachable!("All core circuit function calls should be known at this time."),
|
||||
_ => unreachable!("All core function calls should be known at this time."),
|
||||
}
|
||||
} else {
|
||||
unreachable!("All core circuits should be known at this time.")
|
||||
unreachable!("All core function should be known at this time.")
|
||||
};
|
||||
|
||||
// Construct associated function call.
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
use crate::CodeGenerator;
|
||||
|
||||
use leo_ast::{functions, Circuit, CircuitMember, Function, Identifier, Mapping, Mode, Program, Type};
|
||||
use leo_ast::{functions, CallType, Function, Identifier, Mapping, Mode, Program, ProgramScope, Struct, Type};
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use itertools::Itertools;
|
||||
@ -42,19 +42,23 @@ impl<'a> CodeGenerator<'a> {
|
||||
program_string.push('\n');
|
||||
}
|
||||
|
||||
// Retrieve the program scope.
|
||||
// Note that type checking guarantees that there is exactly one program scope.
|
||||
let program_scope: &ProgramScope = input.program_scopes.values().next().unwrap();
|
||||
|
||||
// Print the program id.
|
||||
writeln!(program_string, "program {}.{};", input.name, input.network)
|
||||
writeln!(program_string, "program {};", program_scope.program_id)
|
||||
.expect("Failed to write program id to string.");
|
||||
|
||||
// Newline separator.
|
||||
program_string.push('\n');
|
||||
|
||||
// Visit each `Circuit` or `Record` in the Leo AST and produce a Aleo interface instruction.
|
||||
// Visit each `Struct` or `Record` in the Leo AST and produce a Aleo interface instruction.
|
||||
program_string.push_str(
|
||||
&input
|
||||
.circuits
|
||||
&program_scope
|
||||
.structs
|
||||
.values()
|
||||
.map(|circuit| self.visit_circuit_or_record(circuit))
|
||||
.map(|struct_| self.visit_struct_or_record(struct_))
|
||||
.join("\n"),
|
||||
);
|
||||
|
||||
@ -63,7 +67,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
|
||||
// Visit each mapping in the Leo AST and produce an Aleo mapping declaration.
|
||||
program_string.push_str(
|
||||
&input
|
||||
&program_scope
|
||||
.mappings
|
||||
.values()
|
||||
.map(|mapping| self.visit_mapping(mapping))
|
||||
@ -75,17 +79,12 @@ impl<'a> CodeGenerator<'a> {
|
||||
let mut functions = String::new();
|
||||
|
||||
// Visit each `Function` in the Leo AST and produce Aleo instructions.
|
||||
input.functions.values().for_each(|function| {
|
||||
// If the function is annotated with `@program`, then it is a program function.
|
||||
for annotation in function.annotations.iter() {
|
||||
if annotation.identifier.name == sym::program {
|
||||
self.is_program_function = true;
|
||||
}
|
||||
}
|
||||
program_scope.functions.values().for_each(|function| {
|
||||
self.is_transition_function = matches!(function.call_type, CallType::Transition);
|
||||
|
||||
let function_string = self.visit_function(function);
|
||||
|
||||
if self.is_program_function {
|
||||
if self.is_transition_function {
|
||||
functions.push_str(&function_string);
|
||||
functions.push('\n');
|
||||
} else {
|
||||
@ -93,8 +92,8 @@ impl<'a> CodeGenerator<'a> {
|
||||
closures.push('\n');
|
||||
}
|
||||
|
||||
// Unset the `is_program_function` flag.
|
||||
self.is_program_function = false;
|
||||
// Unset the `is_transition_function` flag.
|
||||
self.is_transition_function = false;
|
||||
});
|
||||
|
||||
// Closures must precede functions in the Aleo program.
|
||||
@ -114,34 +113,30 @@ impl<'a> CodeGenerator<'a> {
|
||||
format!("import {}.aleo;", import_name)
|
||||
}
|
||||
|
||||
fn visit_circuit_or_record(&mut self, circuit: &'a Circuit) -> String {
|
||||
if circuit.is_record {
|
||||
self.visit_record(circuit)
|
||||
fn visit_struct_or_record(&mut self, struct_: &'a Struct) -> String {
|
||||
if struct_.is_record {
|
||||
self.visit_record(struct_)
|
||||
} else {
|
||||
self.visit_circuit(circuit)
|
||||
self.visit_struct(struct_)
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_circuit(&mut self, circuit: &'a Circuit) -> String {
|
||||
fn visit_struct(&mut self, struct_: &'a Struct) -> String {
|
||||
// Add private symbol to composite types.
|
||||
self.composite_mapping
|
||||
.insert(&circuit.identifier.name, (false, String::from("private"))); // todo: private by default here.
|
||||
.insert(&struct_.identifier.name, (false, String::from("private"))); // todo: private by default here.
|
||||
|
||||
let mut output_string = format!("interface {}:\n", circuit.identifier); // todo: check if this is safe from name conflicts.
|
||||
let mut output_string = format!("interface {}:\n", struct_.identifier); // todo: check if this is safe from name conflicts.
|
||||
|
||||
// Construct and append the record variables.
|
||||
for var in circuit.members.iter() {
|
||||
let (name, type_) = match var {
|
||||
CircuitMember::CircuitVariable(name, type_) => (name, type_),
|
||||
};
|
||||
|
||||
writeln!(output_string, " {} as {};", name, type_,).expect("failed to write to string");
|
||||
for var in struct_.members.iter() {
|
||||
writeln!(output_string, " {} as {};", var.identifier, var.type_,).expect("failed to write to string");
|
||||
}
|
||||
|
||||
output_string
|
||||
}
|
||||
|
||||
fn visit_record(&mut self, record: &'a Circuit) -> String {
|
||||
fn visit_record(&mut self, record: &'a Struct) -> String {
|
||||
// Add record symbol to composite types.
|
||||
let mut output_string = String::from("record");
|
||||
self.composite_mapping
|
||||
@ -150,14 +145,10 @@ impl<'a> CodeGenerator<'a> {
|
||||
|
||||
// Construct and append the record variables.
|
||||
for var in record.members.iter() {
|
||||
let (name, type_) = match var {
|
||||
CircuitMember::CircuitVariable(name, type_) => (name, type_),
|
||||
};
|
||||
|
||||
writeln!(
|
||||
output_string,
|
||||
" {} as {}.private;", // todo: CAUTION private record variables only.
|
||||
name, type_,
|
||||
var.identifier, var.type_,
|
||||
)
|
||||
.expect("failed to write to string");
|
||||
}
|
||||
@ -175,7 +166,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
|
||||
// Construct the header of the function.
|
||||
// If a function is a program function, generate an Aleo `function`, otherwise generate an Aleo `closure`.
|
||||
let mut function_string = match self.is_program_function {
|
||||
let mut function_string = match self.is_transition_function {
|
||||
true => format!("function {}:\n", function.identifier),
|
||||
false => format!("closure {}:\n", function.identifier),
|
||||
};
|
||||
@ -189,7 +180,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
functions::Input::Internal(input) => {
|
||||
self.variable_mapping
|
||||
.insert(&input.identifier.name, register_string.clone());
|
||||
let visibility = match (self.is_program_function, input.mode) {
|
||||
let visibility = match (self.is_transition_function, input.mode) {
|
||||
(true, Mode::None) => Mode::Private,
|
||||
_ => input.mode,
|
||||
};
|
||||
@ -234,7 +225,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
self.variable_mapping
|
||||
.insert(&input.identifier.name, register_string.clone());
|
||||
|
||||
let visibility = match (self.is_program_function, input.mode) {
|
||||
let visibility = match (self.is_transition_function, input.mode) {
|
||||
(true, Mode::None) => Mode::Public,
|
||||
_ => input.mode,
|
||||
};
|
||||
@ -270,12 +261,12 @@ impl<'a> CodeGenerator<'a> {
|
||||
Type::Mapping(_) | Type::Tuple(_) => unreachable!("Mappings cannot contain mappings or tuples."),
|
||||
Type::Identifier(identifier) => {
|
||||
// Lookup the type in the composite mapping.
|
||||
// Note that this unwrap is safe since all circuit and records have been added to the composite mapping.
|
||||
// Note that this unwrap is safe since all struct and records have been added to the composite mapping.
|
||||
let (is_record, _) = self.composite_mapping.get(&identifier.name).unwrap();
|
||||
match is_record {
|
||||
// If the type is a record, then declare the type as is.
|
||||
true => format!("{}.record", identifier),
|
||||
// If the type is a circuit, then add the public modifier.
|
||||
// If the type is a struct, then add the public modifier.
|
||||
false => format!("{}.public", identifier),
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
.map(|(operand, output)| {
|
||||
match output {
|
||||
Output::Internal(output) => {
|
||||
let visibility = if self.is_program_function {
|
||||
let visibility = if self.is_transition_function {
|
||||
match self.in_finalize {
|
||||
// If in finalize block, the default visibility is public.
|
||||
true => match output.mode {
|
||||
|
@ -18,8 +18,8 @@ use crate::Flattener;
|
||||
use itertools::Itertools;
|
||||
|
||||
use leo_ast::{
|
||||
AccessExpression, CircuitExpression, CircuitMember, CircuitVariableInitializer, Expression,
|
||||
ExpressionReconstructor, MemberAccess, Statement, TernaryExpression, TupleExpression,
|
||||
AccessExpression, Expression, ExpressionReconstructor, Member, MemberAccess, Statement, StructExpression,
|
||||
StructVariableInitializer, TernaryExpression, TupleExpression,
|
||||
};
|
||||
|
||||
// TODO: Clean up logic. To be done in a follow-up PR (feat/tuples)
|
||||
@ -27,7 +27,7 @@ use leo_ast::{
|
||||
impl ExpressionReconstructor for Flattener<'_> {
|
||||
type AdditionalOutput = Vec<Statement>;
|
||||
|
||||
/// Reconstructs ternary expressions over tuples and circuits, accumulating any statements that are generated.
|
||||
/// Reconstructs ternary expressions over tuples and structs, accumulating any statements that are generated.
|
||||
/// This is necessary because Aleo instructions does not support ternary expressions over composite data types.
|
||||
/// For example, the ternary expression `cond ? (a, b) : (c, d)` is flattened into the following:
|
||||
/// ```leo
|
||||
@ -35,7 +35,7 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
/// let var$1 = cond ? b : d;
|
||||
/// (var$0, var$1)
|
||||
/// ```
|
||||
/// For circuits, the ternary expression `cond ? a : b`, where `a` and `b` are both circuits `Foo { bar: u8, baz: u8 }`, is flattened into the following:
|
||||
/// For structs, the ternary expression `cond ? a : b`, where `a` and `b` are both structs `Foo { bar: u8, baz: u8 }`, is flattened into the following:
|
||||
/// ```leo
|
||||
/// let var$0 = cond ? a.bar : b.bar;
|
||||
/// let var$1 = cond ? a.baz : b.baz;
|
||||
@ -85,41 +85,41 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
});
|
||||
(tuple, statements)
|
||||
}
|
||||
// If both expressions are access expressions which themselves are circuits, construct ternary expression for nested circuit member.
|
||||
// If both expressions are access expressions which themselves are structs, construct ternary expression for nested struct member.
|
||||
(
|
||||
Expression::Access(AccessExpression::Member(first)),
|
||||
Expression::Access(AccessExpression::Member(second)),
|
||||
) => {
|
||||
// Lookup the circuit symbols associated with the expressions.
|
||||
// Lookup the struct symbols associated with the expressions.
|
||||
// TODO: Remove clones
|
||||
let first_circuit_symbol =
|
||||
self.lookup_circuit_symbol(&Expression::Access(AccessExpression::Member(first.clone())));
|
||||
let second_circuit_symbol =
|
||||
self.lookup_circuit_symbol(&Expression::Access(AccessExpression::Member(second.clone())));
|
||||
let first_struct_symbol =
|
||||
self.lookup_struct_symbol(&Expression::Access(AccessExpression::Member(first.clone())));
|
||||
let second_struct_symbol =
|
||||
self.lookup_struct_symbol(&Expression::Access(AccessExpression::Member(second.clone())));
|
||||
|
||||
match (first_circuit_symbol, second_circuit_symbol) {
|
||||
(Some(first_circuit_symbol), Some(second_circuit_symbol)) => {
|
||||
let first_member_circuit = self.symbol_table.lookup_circuit(first_circuit_symbol).unwrap();
|
||||
let second_member_circuit = self.symbol_table.lookup_circuit(second_circuit_symbol).unwrap();
|
||||
match (first_struct_symbol, second_struct_symbol) {
|
||||
(Some(first_struct_symbol), Some(second_struct_symbol)) => {
|
||||
let first_member_struct = self.symbol_table.lookup_struct(first_struct_symbol).unwrap();
|
||||
let second_member_struct = self.symbol_table.lookup_struct(second_struct_symbol).unwrap();
|
||||
// Note that type checking guarantees that both expressions have the same same type. This is a sanity check.
|
||||
assert_eq!(first_member_circuit, second_member_circuit);
|
||||
assert_eq!(first_member_struct, second_member_struct);
|
||||
|
||||
// For each circuit member, construct a new ternary expression.
|
||||
let members = first_member_circuit
|
||||
// For each struct member, construct a new ternary expression.
|
||||
let members = first_member_struct
|
||||
.members
|
||||
.iter()
|
||||
.map(|CircuitMember::CircuitVariable(id, _)| {
|
||||
// Construct a new ternary expression for the circuit member.
|
||||
.map(|Member { identifier, .. }| {
|
||||
// Construct a new ternary expression for the struct member.
|
||||
let (expression, stmts) = self.reconstruct_ternary(TernaryExpression {
|
||||
condition: input.condition.clone(),
|
||||
if_true: Box::new(Expression::Access(AccessExpression::Member(MemberAccess {
|
||||
inner: Box::new(Expression::Access(AccessExpression::Member(first.clone()))),
|
||||
name: *id,
|
||||
name: *identifier,
|
||||
span: Default::default(),
|
||||
}))),
|
||||
if_false: Box::new(Expression::Access(AccessExpression::Member(MemberAccess {
|
||||
inner: Box::new(Expression::Access(AccessExpression::Member(second.clone()))),
|
||||
name: *id,
|
||||
name: *identifier,
|
||||
span: Default::default(),
|
||||
}))),
|
||||
span: Default::default(),
|
||||
@ -128,19 +128,19 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
// Accumulate any statements generated.
|
||||
statements.extend(stmts);
|
||||
|
||||
// Create and accumulate an intermediate assignment statement for the ternary expression corresponding to the circuit member.
|
||||
// Create and accumulate an intermediate assignment statement for the ternary expression corresponding to the struct member.
|
||||
let (identifier, statement) = self.unique_simple_assign_statement(expression);
|
||||
statements.push(statement);
|
||||
|
||||
CircuitVariableInitializer {
|
||||
identifier: *id,
|
||||
StructVariableInitializer {
|
||||
identifier,
|
||||
expression: Some(Expression::Identifier(identifier)),
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
let (expr, stmts) = self.reconstruct_circuit_init(CircuitExpression {
|
||||
name: first_member_circuit.identifier,
|
||||
let (expr, stmts) = self.reconstruct_struct_init(StructExpression {
|
||||
name: first_member_struct.identifier,
|
||||
members,
|
||||
span: Default::default(),
|
||||
});
|
||||
@ -148,12 +148,12 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
// Accumulate any statements generated.
|
||||
statements.extend(stmts);
|
||||
|
||||
// Create a new assignment statement for the circuit expression.
|
||||
// Create a new assignment statement for the struct expression.
|
||||
let (identifier, statement) = self.unique_simple_assign_statement(expr);
|
||||
|
||||
// Mark the lhs of the assignment as a circuit.
|
||||
self.circuits
|
||||
.insert(identifier.name, first_member_circuit.identifier.name);
|
||||
// Mark the lhs of the assignment as a struct.
|
||||
self.structs
|
||||
.insert(identifier.name, first_member_struct.identifier.name);
|
||||
|
||||
statements.push(statement);
|
||||
|
||||
@ -185,37 +185,37 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
}
|
||||
}
|
||||
}
|
||||
// If both expressions are identifiers which are circuits, construct ternary expression for each of the members and a circuit expression for the result.
|
||||
// If both expressions are identifiers which are structs, construct ternary expression for each of the members and a struct expression for the result.
|
||||
(Expression::Identifier(first), Expression::Identifier(second))
|
||||
if self.circuits.contains_key(&first.name) && self.circuits.contains_key(&second.name) =>
|
||||
if self.structs.contains_key(&first.name) && self.structs.contains_key(&second.name) =>
|
||||
{
|
||||
let first_circuit = self
|
||||
let first_struct = self
|
||||
.symbol_table
|
||||
.lookup_circuit(*self.circuits.get(&first.name).unwrap())
|
||||
.lookup_struct(*self.structs.get(&first.name).unwrap())
|
||||
.unwrap();
|
||||
let second_circuit = self
|
||||
let second_struct = self
|
||||
.symbol_table
|
||||
.lookup_circuit(*self.circuits.get(&second.name).unwrap())
|
||||
.lookup_struct(*self.structs.get(&second.name).unwrap())
|
||||
.unwrap();
|
||||
// Note that type checking guarantees that both expressions have the same same type. This is a sanity check.
|
||||
assert_eq!(first_circuit, second_circuit);
|
||||
assert_eq!(first_struct, second_struct);
|
||||
|
||||
// For each circuit member, construct a new ternary expression.
|
||||
let members = first_circuit
|
||||
// For each struct member, construct a new ternary expression.
|
||||
let members = first_struct
|
||||
.members
|
||||
.iter()
|
||||
.map(|CircuitMember::CircuitVariable(id, _)| {
|
||||
// Construct a new ternary expression for the circuit member.
|
||||
.map(|Member { identifier, .. }| {
|
||||
// Construct a new ternary expression for the struct member.
|
||||
let (expression, stmts) = self.reconstruct_ternary(TernaryExpression {
|
||||
condition: input.condition.clone(),
|
||||
if_true: Box::new(Expression::Access(AccessExpression::Member(MemberAccess {
|
||||
inner: Box::new(Expression::Identifier(first)),
|
||||
name: *id,
|
||||
name: *identifier,
|
||||
span: Default::default(),
|
||||
}))),
|
||||
if_false: Box::new(Expression::Access(AccessExpression::Member(MemberAccess {
|
||||
inner: Box::new(Expression::Identifier(second)),
|
||||
name: *id,
|
||||
name: *identifier,
|
||||
span: Default::default(),
|
||||
}))),
|
||||
span: Default::default(),
|
||||
@ -224,19 +224,19 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
// Accumulate any statements generated.
|
||||
statements.extend(stmts);
|
||||
|
||||
// Create and accumulate an intermediate assignment statement for the ternary expression corresponding to the circuit member.
|
||||
// Create and accumulate an intermediate assignment statement for the ternary expression corresponding to the struct member.
|
||||
let (identifier, statement) = self.unique_simple_assign_statement(expression);
|
||||
statements.push(statement);
|
||||
|
||||
CircuitVariableInitializer {
|
||||
identifier: *id,
|
||||
StructVariableInitializer {
|
||||
identifier,
|
||||
expression: Some(Expression::Identifier(identifier)),
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
let (expr, stmts) = self.reconstruct_circuit_init(CircuitExpression {
|
||||
name: first_circuit.identifier,
|
||||
let (expr, stmts) = self.reconstruct_struct_init(StructExpression {
|
||||
name: first_struct.identifier,
|
||||
members,
|
||||
span: Default::default(),
|
||||
});
|
||||
@ -244,11 +244,11 @@ impl ExpressionReconstructor for Flattener<'_> {
|
||||
// Accumulate any statements generated.
|
||||
statements.extend(stmts);
|
||||
|
||||
// Create a new assignment statement for the circuit expression.
|
||||
// Create a new assignment statement for the struct expression.
|
||||
let (identifier, statement) = self.unique_simple_assign_statement(expr);
|
||||
|
||||
// Mark the lhs of the assignment as a circuit.
|
||||
self.circuits.insert(identifier.name, first_circuit.identifier.name);
|
||||
// Mark the lhs of the assignment as a struct.
|
||||
self.structs.insert(identifier.name, first_struct.identifier.name);
|
||||
|
||||
statements.push(statement);
|
||||
|
||||
|
@ -27,11 +27,11 @@ impl ProgramReconstructor for Flattener<'_> {
|
||||
// First, flatten the finalize block. This allows us to initialize self.finalizes correctly.
|
||||
// Note that this is safe since the finalize block is independent of the function body.
|
||||
let finalize = function.finalize.map(|finalize| {
|
||||
// Initialize `self.circuits` with the finalize's input as necessary.
|
||||
self.circuits = Default::default();
|
||||
// Initialize `self.structs` with the finalize's input as necessary.
|
||||
self.structs = Default::default();
|
||||
for input in &finalize.input {
|
||||
if let Type::Identifier(circuit_name) = input.type_() {
|
||||
self.circuits.insert(input.identifier().name, circuit_name.name);
|
||||
if let Type::Identifier(struct_name) = input.type_() {
|
||||
self.structs.insert(input.identifier().name, struct_name.name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,11 +68,11 @@ impl ProgramReconstructor for Flattener<'_> {
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize `self.circuits` with the function's input as necessary.
|
||||
self.circuits = Default::default();
|
||||
// Initialize `self.structs` with the function's input as necessary.
|
||||
self.structs = Default::default();
|
||||
for input in &function.input {
|
||||
if let Type::Identifier(circuit_name) = input.type_() {
|
||||
self.circuits.insert(input.identifier().name, circuit_name.name);
|
||||
if let Type::Identifier(struct_name) = input.type_() {
|
||||
self.structs.insert(input.identifier().name, struct_name.name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,6 +131,7 @@ impl ProgramReconstructor for Flattener<'_> {
|
||||
|
||||
Function {
|
||||
annotations: function.annotations,
|
||||
call_type: function.call_type,
|
||||
identifier: function.identifier,
|
||||
input: function.input,
|
||||
output: function.output,
|
||||
|
@ -24,8 +24,8 @@ use leo_ast::{
|
||||
|
||||
impl StatementReconstructor for Flattener<'_> {
|
||||
/// Flattens an assign statement, if necessary.
|
||||
/// Marks variables as circuits as necessary.
|
||||
/// Note that new statements are only produced if the right hand side is a ternary expression over circuits.
|
||||
/// Marks variables as structs as necessary.
|
||||
/// Note that new statements are only produced if the right hand side is a ternary expression over structs.
|
||||
/// Otherwise, the statement is returned as is.
|
||||
fn reconstruct_assign(&mut self, assign: AssignStatement) -> (Statement, Self::AdditionalOutput) {
|
||||
let lhs = match assign.place {
|
||||
@ -40,8 +40,8 @@ impl StatementReconstructor for Flattener<'_> {
|
||||
value => (value, Default::default()),
|
||||
};
|
||||
|
||||
// Update the `self.circuits` if the rhs is a circuit.
|
||||
self.update_circuits(&lhs, &value);
|
||||
// Update the `self.structs` if the rhs is a struct.
|
||||
self.update_structs(&lhs, &value);
|
||||
|
||||
(
|
||||
Statement::Assign(Box::new(AssignStatement {
|
||||
|
@ -17,8 +17,7 @@
|
||||
use crate::{Assigner, SymbolTable};
|
||||
|
||||
use leo_ast::{
|
||||
AccessExpression, CircuitMember, Expression, ExpressionReconstructor, Identifier, Statement, TernaryExpression,
|
||||
Type,
|
||||
AccessExpression, Expression, ExpressionReconstructor, Identifier, Member, Statement, TernaryExpression, Type,
|
||||
};
|
||||
use leo_span::Symbol;
|
||||
|
||||
@ -26,12 +25,12 @@ use indexmap::IndexMap;
|
||||
|
||||
pub struct Flattener<'a> {
|
||||
/// The symbol table associated with the program.
|
||||
/// This table is used to lookup circuit definitions, when they are folded.
|
||||
/// This table is used to lookup struct definitions, when they are folded.
|
||||
pub(crate) symbol_table: &'a SymbolTable,
|
||||
/// An struct used to construct (unique) assignment statements.
|
||||
pub(crate) assigner: Assigner,
|
||||
/// The set of variables that are circuits.
|
||||
pub(crate) circuits: IndexMap<Symbol, Symbol>,
|
||||
/// The set of variables that are structs.
|
||||
pub(crate) structs: IndexMap<Symbol, Symbol>,
|
||||
/// A stack of condition `Expression`s visited up to the current point in the AST.
|
||||
pub(crate) condition_stack: Vec<Expression>,
|
||||
/// A list containing tuples of guards and expressions associated `ReturnStatement`s.
|
||||
@ -51,7 +50,7 @@ impl<'a> Flattener<'a> {
|
||||
Self {
|
||||
symbol_table,
|
||||
assigner,
|
||||
circuits: IndexMap::new(),
|
||||
structs: IndexMap::new(),
|
||||
condition_stack: Vec::new(),
|
||||
returns: Vec::new(),
|
||||
finalizes: Vec::new(),
|
||||
@ -119,20 +118,20 @@ impl<'a> Flattener<'a> {
|
||||
(expression, statements)
|
||||
}
|
||||
|
||||
/// Looks up the name of the circuit associated with an identifier or access expression, if it exists.
|
||||
pub(crate) fn lookup_circuit_symbol(&self, expression: &Expression) -> Option<Symbol> {
|
||||
/// Looks up the name of the struct associated with an identifier or access expression, if it exists.
|
||||
pub(crate) fn lookup_struct_symbol(&self, expression: &Expression) -> Option<Symbol> {
|
||||
match expression {
|
||||
Expression::Identifier(identifier) => self.circuits.get(&identifier.name).copied(),
|
||||
Expression::Identifier(identifier) => self.structs.get(&identifier.name).copied(),
|
||||
Expression::Access(AccessExpression::Member(access)) => {
|
||||
// The inner expression of an access expression is either an identifier or another access expression.
|
||||
let name = self.lookup_circuit_symbol(&access.inner).unwrap();
|
||||
let circuit = self.symbol_table.lookup_circuit(name).unwrap();
|
||||
let CircuitMember::CircuitVariable(_, member_type) = circuit
|
||||
let name = self.lookup_struct_symbol(&access.inner).unwrap();
|
||||
let struct_ = self.symbol_table.lookup_struct(name).unwrap();
|
||||
let Member { type_, .. } = struct_
|
||||
.members
|
||||
.iter()
|
||||
.find(|member| member.name() == access.name.name)
|
||||
.unwrap();
|
||||
match member_type {
|
||||
match type_ {
|
||||
Type::Identifier(identifier) => Some(identifier.name),
|
||||
_ => None,
|
||||
}
|
||||
@ -141,38 +140,38 @@ impl<'a> Flattener<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Updates `self.circuits` for new assignment statements.
|
||||
/// Updates `self.structs` for new assignment statements.
|
||||
/// Expects the left hand side of the assignment to be an identifier.
|
||||
pub(crate) fn update_circuits(&mut self, lhs: &Identifier, rhs: &Expression) {
|
||||
pub(crate) fn update_structs(&mut self, lhs: &Identifier, rhs: &Expression) {
|
||||
match rhs {
|
||||
Expression::Circuit(rhs) => {
|
||||
self.circuits.insert(lhs.name, rhs.name.name);
|
||||
Expression::Struct(rhs) => {
|
||||
self.structs.insert(lhs.name, rhs.name.name);
|
||||
}
|
||||
// If the rhs of the assignment is an identifier that is a circuit, add it to `self.circuits`.
|
||||
Expression::Identifier(rhs) if self.circuits.contains_key(&rhs.name) => {
|
||||
// If the rhs of the assignment is an identifier that is a struct, add it to `self.structs`.
|
||||
Expression::Identifier(rhs) if self.structs.contains_key(&rhs.name) => {
|
||||
// Note that this unwrap is safe because we just checked that the key exists.
|
||||
self.circuits.insert(lhs.name, *self.circuits.get(&rhs.name).unwrap());
|
||||
self.structs.insert(lhs.name, *self.structs.get(&rhs.name).unwrap());
|
||||
}
|
||||
// Otherwise, do nothing.
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper around `assigner.unique_simple_assign_statement` that updates `self.circuits`.
|
||||
/// A wrapper around `assigner.unique_simple_assign_statement` that updates `self.structs`.
|
||||
pub(crate) fn unique_simple_assign_statement(&mut self, expr: Expression) -> (Identifier, Statement) {
|
||||
let (place, statement) = self.assigner.unique_simple_assign_statement(expr);
|
||||
match &statement {
|
||||
Statement::Assign(assign) => {
|
||||
self.update_circuits(&place, &assign.value);
|
||||
self.update_structs(&place, &assign.value);
|
||||
}
|
||||
_ => unreachable!("`assigner.unique_simple_assign_statement` always returns an assignment statement."),
|
||||
}
|
||||
(place, statement)
|
||||
}
|
||||
|
||||
/// A wrapper around `assigner.simple_assign_statement` that updates `self.circuits`.
|
||||
/// A wrapper around `assigner.simple_assign_statement` that updates `self.structs`.
|
||||
pub(crate) fn simple_assign_statement(&mut self, lhs: Identifier, rhs: Expression) -> Statement {
|
||||
self.update_circuits(&lhs, &rhs);
|
||||
self.update_structs(&lhs, &rhs);
|
||||
self.assigner.simple_assign_statement(lhs, rhs)
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ impl ProgramReconstructor for Unroller<'_> {
|
||||
// Reconstruct the function block.
|
||||
let reconstructed_function = Function {
|
||||
annotations: function.annotations,
|
||||
call_type: function.call_type,
|
||||
identifier: function.identifier,
|
||||
input: function.input,
|
||||
output: function.output,
|
||||
|
@ -17,9 +17,9 @@
|
||||
use crate::StaticSingleAssigner;
|
||||
|
||||
use leo_ast::{
|
||||
AccessExpression, AssociatedFunction, BinaryExpression, CallExpression, CircuitExpression,
|
||||
CircuitVariableInitializer, Expression, ExpressionConsumer, Identifier, Literal, MemberAccess, Statement,
|
||||
TernaryExpression, TupleAccess, TupleExpression, UnaryExpression,
|
||||
AccessExpression, AssociatedFunction, BinaryExpression, CallExpression, Expression, ExpressionConsumer, Identifier,
|
||||
Literal, MemberAccess, Statement, StructExpression, StructVariableInitializer, TernaryExpression, TupleAccess,
|
||||
TupleExpression, UnaryExpression,
|
||||
};
|
||||
use leo_span::sym;
|
||||
|
||||
@ -141,8 +141,8 @@ impl ExpressionConsumer for StaticSingleAssigner {
|
||||
(Expression::Identifier(place), statements)
|
||||
}
|
||||
|
||||
/// Consumes a circuit initialization expression with renamed variables, accumulating any statements that are generated.
|
||||
fn consume_circuit_init(&mut self, input: CircuitExpression) -> Self::Output {
|
||||
/// Consumes a struct initialization expression with renamed variables, accumulating any statements that are generated.
|
||||
fn consume_struct_init(&mut self, input: StructExpression) -> Self::Output {
|
||||
let mut statements = Vec::new();
|
||||
|
||||
// Process the members, accumulating any statements produced.
|
||||
@ -151,10 +151,10 @@ impl ExpressionConsumer for StaticSingleAssigner {
|
||||
.into_iter()
|
||||
.map(|arg| {
|
||||
let (expression, mut stmts) = match &arg.expression.is_some() {
|
||||
// If the expression is None, then `arg` is a `CircuitVariableInitializer` of the form `<id>,`.
|
||||
// If the expression is None, then `arg` is a `StructVariableInitializer` of the form `<id>,`.
|
||||
// In this case, we must consume the identifier and produce an initializer of the form `<id>: <renamed_id>`.
|
||||
false => self.consume_identifier(arg.identifier),
|
||||
// If expression is `Some(..)`, then `arg is a `CircuitVariableInitializer` of the form `<id>: <expr>,`.
|
||||
// If expression is `Some(..)`, then `arg is a `StructVariableInitializer` of the form `<id>: <expr>,`.
|
||||
// In this case, we must consume the expression.
|
||||
true => self.consume_expression(arg.expression.unwrap()),
|
||||
};
|
||||
@ -162,17 +162,17 @@ impl ExpressionConsumer for StaticSingleAssigner {
|
||||
statements.append(&mut stmts);
|
||||
|
||||
// Return the new member.
|
||||
CircuitVariableInitializer {
|
||||
StructVariableInitializer {
|
||||
identifier: arg.identifier,
|
||||
expression: Some(expression),
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
// Construct and accumulate a new assignment statement for the circuit expression.
|
||||
// Construct and accumulate a new assignment statement for the struct expression.
|
||||
let (place, statement) = self
|
||||
.assigner
|
||||
.unique_simple_assign_statement(Expression::Circuit(CircuitExpression {
|
||||
.unique_simple_assign_statement(Expression::Struct(StructExpression {
|
||||
name: input.name,
|
||||
span: input.span,
|
||||
members,
|
||||
|
@ -16,7 +16,10 @@
|
||||
|
||||
use crate::StaticSingleAssigner;
|
||||
|
||||
use leo_ast::{Block, Finalize, Function, FunctionConsumer, Program, ProgramConsumer, StatementConsumer};
|
||||
use leo_ast::{
|
||||
Block, Finalize, Function, FunctionConsumer, Program, ProgramConsumer, ProgramScope, ProgramScopeConsumer,
|
||||
StatementConsumer,
|
||||
};
|
||||
|
||||
impl FunctionConsumer for StaticSingleAssigner {
|
||||
type Output = Function;
|
||||
@ -72,6 +75,7 @@ impl FunctionConsumer for StaticSingleAssigner {
|
||||
|
||||
Function {
|
||||
annotations: function.annotations,
|
||||
call_type: function.call_type,
|
||||
identifier: function.identifier,
|
||||
input: function.input,
|
||||
output: function.output,
|
||||
@ -83,27 +87,39 @@ impl FunctionConsumer for StaticSingleAssigner {
|
||||
}
|
||||
}
|
||||
|
||||
impl ProgramConsumer for StaticSingleAssigner {
|
||||
type Output = Program;
|
||||
impl ProgramScopeConsumer for StaticSingleAssigner {
|
||||
type Output = ProgramScope;
|
||||
|
||||
fn consume_program(&mut self, input: Program) -> Self::Output {
|
||||
Program {
|
||||
name: input.name,
|
||||
network: input.network,
|
||||
expected_input: input.expected_input,
|
||||
// TODO: Do inputs need to be processed? They are not processed in the existing compiler.
|
||||
imports: input
|
||||
.imports
|
||||
.into_iter()
|
||||
.map(|(name, import)| (name, self.consume_program(import)))
|
||||
.collect(),
|
||||
fn consume_program_scope(&mut self, input: ProgramScope) -> Self::Output {
|
||||
ProgramScope {
|
||||
program_id: input.program_id,
|
||||
structs: input.structs,
|
||||
mappings: input.mappings,
|
||||
functions: input
|
||||
.functions
|
||||
.into_iter()
|
||||
.map(|(i, f)| (i, self.consume_function(f)))
|
||||
.collect(),
|
||||
circuits: input.circuits,
|
||||
mappings: input.mappings,
|
||||
span: input.span,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ProgramConsumer for StaticSingleAssigner {
|
||||
type Output = Program;
|
||||
|
||||
fn consume_program(&mut self, input: Program) -> Self::Output {
|
||||
Program {
|
||||
imports: input
|
||||
.imports
|
||||
.into_iter()
|
||||
.map(|(name, import)| (name, self.consume_program(import)))
|
||||
.collect(),
|
||||
program_scopes: input
|
||||
.program_scopes
|
||||
.into_iter()
|
||||
.map(|(name, scope)| (name, self.consume_program_scope(scope)))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ use leo_errors::emitter::Handler;
|
||||
use crate::{SymbolTable, VariableSymbol, VariableType};
|
||||
|
||||
/// A compiler pass during which the `SymbolTable` is created.
|
||||
/// Note that this pass only creates the initial entries for functions and circuits.
|
||||
/// Note that this pass only creates the initial entries for functions, structs, and records.
|
||||
/// The table is populated further during the type checking pass.
|
||||
pub struct CreateSymbolTable<'a> {
|
||||
/// The `SymbolTable` constructed by this compiler pass.
|
||||
@ -50,8 +50,8 @@ impl<'a> ProgramVisitor<'a> for CreateSymbolTable<'a> {
|
||||
self.visit_program(input)
|
||||
}
|
||||
|
||||
fn visit_circuit(&mut self, input: &'a Circuit) {
|
||||
if let Err(err) = self.symbol_table.insert_circuit(input.name(), input) {
|
||||
fn visit_struct(&mut self, input: &'a Struct) {
|
||||
if let Err(err) = self.symbol_table.insert_struct(input.name(), input) {
|
||||
self.handler.emit_err(err);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use leo_ast::{Function, Input, Type};
|
||||
use leo_ast::{CallType, Function, Input, Type};
|
||||
use leo_span::Span;
|
||||
|
||||
use crate::SymbolTable;
|
||||
@ -35,6 +35,8 @@ pub struct FunctionSymbol {
|
||||
pub(crate) id: usize,
|
||||
/// The output type of the function.
|
||||
pub(crate) output_type: Type,
|
||||
/// Is this function a transition, inlined, or a regular function?.
|
||||
pub call_type: CallType,
|
||||
/// The `Span` associated with the function.
|
||||
pub(crate) span: Span,
|
||||
/// The inputs to the function.
|
||||
@ -48,6 +50,7 @@ impl SymbolTable {
|
||||
FunctionSymbol {
|
||||
id,
|
||||
output_type: func.output_type.clone(),
|
||||
call_type: func.call_type,
|
||||
span: func.span,
|
||||
input: func.input.clone(),
|
||||
finalize: func.finalize.as_ref().map(|finalize| FinalizeData {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
use std::cell::RefCell;
|
||||
|
||||
use leo_ast::{Circuit, Function};
|
||||
use leo_ast::{Function, Struct};
|
||||
use leo_errors::{AstError, Result};
|
||||
use leo_span::{Span, Symbol};
|
||||
|
||||
@ -32,9 +32,9 @@ pub struct SymbolTable {
|
||||
/// Functions represents the name of each function mapped to the AST's function definition.
|
||||
/// This field is populated at a first pass.
|
||||
pub functions: IndexMap<Symbol, FunctionSymbol>,
|
||||
/// Maps circuit names to circuit definitions.
|
||||
/// Maps struct names to struct definitions.
|
||||
/// This field is populated at a first pass.
|
||||
pub circuits: IndexMap<Symbol, Circuit>,
|
||||
pub structs: IndexMap<Symbol, Struct>,
|
||||
/// The variables defined in a scope.
|
||||
/// This field is populated as necessary.
|
||||
pub(crate) variables: IndexMap<Symbol, VariableSymbol>,
|
||||
@ -52,10 +52,10 @@ impl SymbolTable {
|
||||
Err(AstError::shadowed_variable(symbol, span).into())
|
||||
} else if self.functions.contains_key(&symbol) {
|
||||
Err(AstError::shadowed_function(symbol, span).into())
|
||||
} else if let Some(existing) = self.circuits.get(&symbol) {
|
||||
} else if let Some(existing) = self.structs.get(&symbol) {
|
||||
match existing.is_record {
|
||||
true => Err(AstError::shadowed_record(symbol, span).into()),
|
||||
false => Err(AstError::shadowed_circuit(symbol, span).into()),
|
||||
false => Err(AstError::shadowed_struct(symbol, span).into()),
|
||||
}
|
||||
} else if let Some(parent) = self.parent.as_ref() {
|
||||
parent.check_shadowing(symbol, span)
|
||||
@ -81,10 +81,10 @@ impl SymbolTable {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Inserts a circuit into the symbol table.
|
||||
pub fn insert_circuit(&mut self, symbol: Symbol, insert: &Circuit) -> Result<()> {
|
||||
/// Inserts a struct into the symbol table.
|
||||
pub fn insert_struct(&mut self, symbol: Symbol, insert: &Struct) -> Result<()> {
|
||||
self.check_shadowing(symbol, insert.span)?;
|
||||
self.circuits.insert(symbol, insert.clone());
|
||||
self.structs.insert(symbol, insert.clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -112,12 +112,12 @@ impl SymbolTable {
|
||||
}
|
||||
}
|
||||
|
||||
/// Attempts to lookup a circuit in the symbol table.
|
||||
pub fn lookup_circuit(&self, symbol: Symbol) -> Option<&Circuit> {
|
||||
if let Some(circ) = self.circuits.get(&symbol) {
|
||||
Some(circ)
|
||||
/// Attempts to lookup a struct in the symbol table.
|
||||
pub fn lookup_struct(&self, symbol: Symbol) -> Option<&Struct> {
|
||||
if let Some(struct_) = self.structs.get(&symbol) {
|
||||
Some(struct_)
|
||||
} else if let Some(parent) = self.parent.as_ref() {
|
||||
parent.lookup_circuit(symbol)
|
||||
parent.lookup_struct(symbol)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -47,8 +47,8 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
fn visit_access(&mut self, input: &'a AccessExpression, expected: &Self::AdditionalInput) -> Self::Output {
|
||||
match input {
|
||||
AccessExpression::AssociatedFunction(access) => {
|
||||
// Check core circuit name and function.
|
||||
if let Some(core_instruction) = self.check_core_circuit_call(&access.ty, &access.name) {
|
||||
// Check core struct name and function.
|
||||
if let Some(core_instruction) = self.check_core_function_call(&access.ty, &access.name) {
|
||||
// Check num input arguments.
|
||||
if core_instruction.num_args() != access.args.len() {
|
||||
// TODO: Better error messages.
|
||||
@ -88,7 +88,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
// Check return type.
|
||||
return Some(self.assert_and_return_type(core_instruction.return_type(), expected, access.span()));
|
||||
} else {
|
||||
self.emit_err(TypeCheckerError::invalid_core_circuit_call(access, access.span()));
|
||||
self.emit_err(TypeCheckerError::invalid_core_function_call(access, access.span()));
|
||||
}
|
||||
}
|
||||
AccessExpression::Tuple(access) => {
|
||||
@ -121,7 +121,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
self.emit_err(TypeCheckerError::type_should_be(type_, "tuple", access.span()));
|
||||
}
|
||||
}
|
||||
self.emit_err(TypeCheckerError::invalid_core_circuit_call(access, access.span()));
|
||||
self.emit_err(TypeCheckerError::invalid_core_function_call(access, access.span()));
|
||||
}
|
||||
}
|
||||
AccessExpression::Member(access) => {
|
||||
@ -134,25 +134,21 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
// Check that the type of `inner` in `inner.name` is a circuit.
|
||||
// Check that the type of `inner` in `inner.name` is a struct.
|
||||
match self.visit_expression(&access.inner, &None) {
|
||||
Some(Type::Identifier(identifier)) => {
|
||||
// Retrieve the circuit definition associated with `identifier`.
|
||||
let circ = self.symbol_table.borrow().lookup_circuit(identifier.name).cloned();
|
||||
if let Some(circ) = circ {
|
||||
// Check that `access.name` is a member of the circuit.
|
||||
match circ
|
||||
.members
|
||||
.iter()
|
||||
.find(|circuit_member| circuit_member.name() == access.name.name)
|
||||
{
|
||||
// Case where `access.name` is a member of the circuit.
|
||||
Some(CircuitMember::CircuitVariable(_, type_)) => return Some(type_.clone()),
|
||||
// Case where `access.name` is not a member of the circuit.
|
||||
// Retrieve the struct definition associated with `identifier`.
|
||||
let struct_ = self.symbol_table.borrow().lookup_struct(identifier.name).cloned();
|
||||
if let Some(struct_) = struct_ {
|
||||
// Check that `access.name` is a member of the struct.
|
||||
match struct_.members.iter().find(|member| member.name() == access.name.name) {
|
||||
// Case where `access.name` is a member of the struct.
|
||||
Some(Member { type_, .. }) => return Some(type_.clone()),
|
||||
// Case where `access.name` is not a member of the struct.
|
||||
None => {
|
||||
self.emit_err(TypeCheckerError::invalid_circuit_variable(
|
||||
self.emit_err(TypeCheckerError::invalid_struct_variable(
|
||||
access.name,
|
||||
&circ,
|
||||
&struct_,
|
||||
access.name.span(),
|
||||
));
|
||||
}
|
||||
@ -162,7 +158,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
}
|
||||
}
|
||||
Some(type_) => {
|
||||
self.emit_err(TypeCheckerError::type_should_be(type_, "circuit", access.inner.span()));
|
||||
self.emit_err(TypeCheckerError::type_should_be(type_, "struct", access.inner.span()));
|
||||
}
|
||||
None => {
|
||||
self.emit_err(TypeCheckerError::could_not_determine_type(
|
||||
@ -435,11 +431,29 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
|
||||
fn visit_call(&mut self, input: &'a CallExpression, expected: &Self::AdditionalInput) -> Self::Output {
|
||||
match &*input.function {
|
||||
// Note that the parser guarantees that `input.function` is always an identifier.
|
||||
Expression::Identifier(ident) => {
|
||||
// Note: The function symbol lookup is performed outside of the `if let Some(func) ...` block to avoid a RefCell lifetime bug in Rust.
|
||||
// Do not move it into the `if let Some(func) ...` block or it will keep `self.symbol_table` alive for the entire block and will be very memory inefficient!
|
||||
let func = self.symbol_table.borrow().lookup_fn_symbol(ident.name).cloned();
|
||||
|
||||
if let Some(func) = func {
|
||||
// Check that the call is valid.
|
||||
match self.is_transition_function {
|
||||
// If the function is not a transition function, it cannot call any other functions.
|
||||
false => {
|
||||
self.emit_err(TypeCheckerError::cannot_invoke_call_from_standard_function(input.span));
|
||||
}
|
||||
// If the function is a transition function, then check that the call is not to another local transition function.
|
||||
true => {
|
||||
if matches!(func.call_type, CallType::Transition) && input.external.is_none() {
|
||||
self.emit_err(TypeCheckerError::cannot_invoke_call_to_local_transition_function(
|
||||
input.span,
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let ret = self.assert_and_return_type(func.output_type, expected, func.span);
|
||||
|
||||
// Check number of function arguments.
|
||||
@ -465,48 +479,49 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
|
||||
None
|
||||
}
|
||||
}
|
||||
// TODO: Is this case sufficient?
|
||||
expr => self.visit_expression(expr, expected),
|
||||
_ => unreachable!("Parser guarantees that `input.function` is always an identifier."),
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_circuit_init(&mut self, input: &'a CircuitExpression, additional: &Self::AdditionalInput) -> Self::Output {
|
||||
let circ = self.symbol_table.borrow().lookup_circuit(input.name.name).cloned();
|
||||
if let Some(circ) = circ {
|
||||
// Check circuit type name.
|
||||
let ret = self.check_expected_circuit(circ.identifier, additional, input.name.span());
|
||||
fn visit_struct_init(&mut self, input: &'a StructExpression, additional: &Self::AdditionalInput) -> Self::Output {
|
||||
let struct_ = self.symbol_table.borrow().lookup_struct(input.name.name).cloned();
|
||||
if let Some(struct_) = struct_ {
|
||||
// Check struct type name.
|
||||
let ret = self.check_expected_struct(struct_.identifier, additional, input.name.span());
|
||||
|
||||
// Check number of circuit members.
|
||||
if circ.members.len() != input.members.len() {
|
||||
self.emit_err(TypeCheckerError::incorrect_num_circuit_members(
|
||||
circ.members.len(),
|
||||
// Check number of struct members.
|
||||
if struct_.members.len() != input.members.len() {
|
||||
self.emit_err(TypeCheckerError::incorrect_num_struct_members(
|
||||
struct_.members.len(),
|
||||
input.members.len(),
|
||||
input.span(),
|
||||
));
|
||||
}
|
||||
|
||||
// Check circuit member types.
|
||||
circ.members
|
||||
.iter()
|
||||
.for_each(|CircuitMember::CircuitVariable(name, ty)| {
|
||||
// Lookup circuit variable name.
|
||||
if let Some(actual) = input.members.iter().find(|member| member.identifier.name == name.name) {
|
||||
if let Some(expr) = &actual.expression {
|
||||
self.visit_expression(expr, &Some(ty.clone()));
|
||||
}
|
||||
} else {
|
||||
self.emit_err(TypeCheckerError::missing_circuit_member(
|
||||
circ.identifier,
|
||||
name,
|
||||
input.span(),
|
||||
));
|
||||
};
|
||||
});
|
||||
// Check struct member types.
|
||||
struct_.members.iter().for_each(|Member { identifier, type_ }| {
|
||||
// Lookup struct variable name.
|
||||
if let Some(actual) = input
|
||||
.members
|
||||
.iter()
|
||||
.find(|member| member.identifier.name == identifier.name)
|
||||
{
|
||||
if let Some(expr) = &actual.expression {
|
||||
self.visit_expression(expr, &Some(type_.clone()));
|
||||
}
|
||||
} else {
|
||||
self.emit_err(TypeCheckerError::missing_struct_member(
|
||||
struct_.identifier,
|
||||
identifier,
|
||||
input.span(),
|
||||
));
|
||||
};
|
||||
});
|
||||
|
||||
Some(ret)
|
||||
} else {
|
||||
self.emit_err(TypeCheckerError::unknown_sym(
|
||||
"circuit",
|
||||
"struct",
|
||||
input.name.name,
|
||||
input.name.span(),
|
||||
));
|
||||
|
@ -26,23 +26,19 @@ use std::collections::HashSet;
|
||||
// TODO: Generally, cleanup tyc logic.
|
||||
|
||||
impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
fn visit_circuit(&mut self, input: &'a Circuit) {
|
||||
// Check for conflicting circuit/record member names.
|
||||
fn visit_struct(&mut self, input: &'a Struct) {
|
||||
// Check for conflicting struct/record member names.
|
||||
let mut used = HashSet::new();
|
||||
if !input
|
||||
.members
|
||||
.iter()
|
||||
.all(|CircuitMember::CircuitVariable(ident, type_)| {
|
||||
// TODO: Better spans.
|
||||
// Check that the member types are valid.
|
||||
self.assert_type_is_valid(input.span, type_);
|
||||
used.insert(ident.name)
|
||||
})
|
||||
{
|
||||
if !input.members.iter().all(|Member { identifier, type_ }| {
|
||||
// TODO: Better spans.
|
||||
// Check that the member types are valid.
|
||||
self.assert_type_is_valid(input.span, type_);
|
||||
used.insert(identifier.name)
|
||||
}) {
|
||||
self.emit_err(if input.is_record {
|
||||
TypeCheckerError::duplicate_record_variable(input.name(), input.span())
|
||||
} else {
|
||||
TypeCheckerError::duplicate_circuit_member(input.name(), input.span())
|
||||
TypeCheckerError::duplicate_struct_member(input.name(), input.span())
|
||||
});
|
||||
}
|
||||
|
||||
@ -51,7 +47,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
let check_has_field = |need, expected_ty: Type| match input
|
||||
.members
|
||||
.iter()
|
||||
.find_map(|CircuitMember::CircuitVariable(v, t)| (v.name == need).then_some((v, t)))
|
||||
.find_map(|Member { identifier, type_ }| (identifier.name == need).then_some((identifier, type_)))
|
||||
{
|
||||
Some((_, actual_ty)) if expected_ty.eq_flat(actual_ty) => {} // All good, found + right type!
|
||||
Some((field, _)) => {
|
||||
@ -73,11 +69,11 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
check_has_field(sym::gates, Type::Integer(IntegerType::U64));
|
||||
}
|
||||
|
||||
for CircuitMember::CircuitVariable(v, type_) in input.members.iter() {
|
||||
for Member { identifier, type_ } in input.members.iter() {
|
||||
// Ensure there are no tuple typed members.
|
||||
self.assert_not_tuple(v.span, type_);
|
||||
self.assert_not_tuple(identifier.span, type_);
|
||||
// Ensure that there are no record members.
|
||||
self.assert_member_is_not_record(v.span, input.identifier.name, type_);
|
||||
self.assert_member_is_not_record(identifier.span, input.identifier.name, type_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,14 +101,13 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
|
||||
fn visit_function(&mut self, function: &'a Function) {
|
||||
// Check that the function's annotations are valid.
|
||||
// Note that Leo does not natively support any specific annotations.
|
||||
for annotation in function.annotations.iter() {
|
||||
match annotation.identifier.name {
|
||||
// Set `is_program_function` to true if the corresponding annotation is found.
|
||||
sym::program => self.is_program_function = true,
|
||||
_ => self.emit_err(TypeCheckerError::unknown_annotation(annotation, annotation.span)),
|
||||
}
|
||||
self.emit_err(TypeCheckerError::unknown_annotation(annotation, annotation.span))
|
||||
}
|
||||
|
||||
self.is_transition_function = matches!(function.call_type, CallType::Transition);
|
||||
|
||||
// Lookup function metadata in the symbol table.
|
||||
// Note that this unwrap is safe since function metadata is stored in a prior pass.
|
||||
let function_index = self
|
||||
@ -143,14 +138,14 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
self.assert_type_is_valid(input_var.span(), &input_var.type_());
|
||||
self.assert_not_tuple(input_var.span(), &input_var.type_());
|
||||
|
||||
match self.is_program_function {
|
||||
// If the function is a program function, then check that the parameter mode is not a constant.
|
||||
match self.is_transition_function {
|
||||
// If the function is a transition function, then check that the parameter mode is not a constant.
|
||||
true if input_var.mode() == Mode::Const => self.emit_err(
|
||||
TypeCheckerError::program_function_inputs_cannot_be_const(input_var.span()),
|
||||
TypeCheckerError::transition_function_inputs_cannot_be_const(input_var.span()),
|
||||
),
|
||||
// If the function is not a program function, then check that the parameters do not have an associated mode.
|
||||
false if input_var.mode() != Mode::None => self.emit_err(
|
||||
TypeCheckerError::helper_function_inputs_cannot_have_modes(input_var.span()),
|
||||
TypeCheckerError::regular_function_inputs_cannot_have_modes(input_var.span()),
|
||||
),
|
||||
_ => {} // Do nothing.
|
||||
}
|
||||
@ -210,9 +205,9 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
// The function;s finalize block does not have a finalize statement.
|
||||
self.has_finalize = false;
|
||||
|
||||
// Check that the function is a program function.
|
||||
if !self.is_program_function {
|
||||
self.emit_err(TypeCheckerError::only_program_functions_can_have_finalize(
|
||||
// Check that the function is a transition function.
|
||||
if !self.is_transition_function {
|
||||
self.emit_err(TypeCheckerError::only_transition_functions_can_have_finalize(
|
||||
finalize.span,
|
||||
));
|
||||
}
|
||||
@ -289,7 +284,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
// Exit the function's scope.
|
||||
self.exit_scope(function_index);
|
||||
|
||||
// Unset `is_program_function` flag.
|
||||
self.is_program_function = false;
|
||||
// Unset `is_transition_function` flag.
|
||||
self.is_transition_function = false;
|
||||
}
|
||||
}
|
||||
|
@ -35,9 +35,8 @@ pub struct TypeChecker<'a> {
|
||||
pub(crate) has_return: bool,
|
||||
/// Whether or not the function that we are currently traversing has a finalize statement.
|
||||
pub(crate) has_finalize: bool,
|
||||
/// Whether or not we are currently traversing a program function.
|
||||
/// A "program function" is a function that can be invoked by a user or another program.
|
||||
pub(crate) is_program_function: bool,
|
||||
/// Whether or not we are currently traversing a transition function.
|
||||
pub(crate) is_transition_function: bool,
|
||||
/// Whether or not we are currently traversing a finalize block.
|
||||
pub(crate) is_finalize: bool,
|
||||
}
|
||||
@ -89,7 +88,7 @@ impl<'a> TypeChecker<'a> {
|
||||
/// Returns a new type checker given a symbol table and error handler.
|
||||
pub fn new(symbol_table: SymbolTable, handler: &'a Handler) -> Self {
|
||||
Self {
|
||||
is_program_function: false,
|
||||
is_transition_function: false,
|
||||
symbol_table: RefCell::new(symbol_table),
|
||||
handler,
|
||||
function: None,
|
||||
@ -322,35 +321,35 @@ impl<'a> TypeChecker<'a> {
|
||||
)
|
||||
}
|
||||
|
||||
/// Emits an error if the `circuit` is not a core library circuit.
|
||||
/// Emits an error if the `function` is not supported by the circuit.
|
||||
pub(crate) fn check_core_circuit_call(&self, circuit: &Type, function: &Identifier) -> Option<CoreInstruction> {
|
||||
if let Type::Identifier(ident) = circuit {
|
||||
// Lookup core circuit
|
||||
/// Emits an error if the `struct` is not a core library struct.
|
||||
/// Emits an error if the `function` is not supported by the struct.
|
||||
pub(crate) fn check_core_function_call(&self, struct_: &Type, function: &Identifier) -> Option<CoreInstruction> {
|
||||
if let Type::Identifier(ident) = struct_ {
|
||||
// Lookup core struct
|
||||
match CoreInstruction::from_symbols(ident.name, function.name) {
|
||||
None => {
|
||||
// Not a core library circuit.
|
||||
self.emit_err(TypeCheckerError::invalid_core_instruction(
|
||||
// Not a core library struct.
|
||||
self.emit_err(TypeCheckerError::invalid_core_function(
|
||||
ident.name,
|
||||
function.name,
|
||||
ident.span(),
|
||||
));
|
||||
}
|
||||
Some(core_circuit) => return Some(core_circuit),
|
||||
Some(core_instruction) => return Some(core_instruction),
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// Returns the `circuit` type and emits an error if the `expected` type does not match.
|
||||
pub(crate) fn check_expected_circuit(&mut self, circuit: Identifier, expected: &Option<Type>, span: Span) -> Type {
|
||||
/// Returns the `struct` type and emits an error if the `expected` type does not match.
|
||||
pub(crate) fn check_expected_struct(&mut self, struct_: Identifier, expected: &Option<Type>, span: Span) -> Type {
|
||||
if let Some(Type::Identifier(expected)) = expected {
|
||||
if !circuit.matches(expected) {
|
||||
self.emit_err(TypeCheckerError::type_should_be(circuit.name, expected.name, span));
|
||||
if !struct_.matches(expected) {
|
||||
self.emit_err(TypeCheckerError::type_should_be(struct_.name, expected.name, span));
|
||||
}
|
||||
}
|
||||
|
||||
Type::Identifier(circuit)
|
||||
Type::Identifier(struct_)
|
||||
}
|
||||
|
||||
/// Emits an error if the type is a tuple.
|
||||
@ -360,17 +359,17 @@ impl<'a> TypeChecker<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Emits an error if the circuit member is a record type.
|
||||
/// Emits an error if the struct member is a record type.
|
||||
pub(crate) fn assert_member_is_not_record(&self, span: Span, parent: Symbol, type_: &Type) {
|
||||
match type_ {
|
||||
Type::Identifier(identifier)
|
||||
if self
|
||||
.symbol_table
|
||||
.borrow()
|
||||
.lookup_circuit(identifier.name)
|
||||
.map_or(false, |circuit| circuit.is_record) =>
|
||||
.lookup_struct(identifier.name)
|
||||
.map_or(false, |struct_| struct_.is_record) =>
|
||||
{
|
||||
self.emit_err(TypeCheckerError::circuit_or_record_cannot_contain_record(
|
||||
self.emit_err(TypeCheckerError::struct_or_record_cannot_contain_record(
|
||||
parent,
|
||||
identifier.name,
|
||||
span,
|
||||
@ -389,7 +388,7 @@ impl<'a> TypeChecker<'a> {
|
||||
pub(crate) fn assert_type_is_valid(&self, span: Span, type_: &Type) {
|
||||
match type_ {
|
||||
// Check that the named composite type has been defined.
|
||||
Type::Identifier(identifier) if self.symbol_table.borrow().lookup_circuit(identifier.name).is_none() => {
|
||||
Type::Identifier(identifier) if self.symbol_table.borrow().lookup_struct(identifier.name).is_none() => {
|
||||
self.emit_err(TypeCheckerError::undefined_type(identifier.name, span));
|
||||
}
|
||||
// Check that the constituent types of the tuple are valid.
|
||||
|
@ -138,7 +138,7 @@ symbols! {
|
||||
sub_wrapped,
|
||||
xor,
|
||||
|
||||
// core circuits
|
||||
// core functions
|
||||
BHP256,
|
||||
BHP512,
|
||||
BHP768,
|
||||
@ -215,8 +215,10 @@ symbols! {
|
||||
std,
|
||||
Struct: "struct",
|
||||
test,
|
||||
transition,
|
||||
Type: "type",
|
||||
|
||||
aleo,
|
||||
public,
|
||||
private,
|
||||
owner,
|
||||
|
@ -98,11 +98,11 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when a user shadows a circuit.
|
||||
/// For when a user shadows a struct.
|
||||
@formatted
|
||||
shadowed_circuit {
|
||||
args: (circ: impl Display),
|
||||
msg: format!("circuit `{circ}` shadowed by"),
|
||||
shadowed_struct {
|
||||
args: (struct_: impl Display),
|
||||
msg: format!("struct `{struct_}` shadowed by"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when a user tries to assign to a circuit static member.
|
||||
/// For when a user tries to assign to a struct static member.
|
||||
@formatted
|
||||
illegal_static_member_assignment {
|
||||
args: (member: impl Display),
|
||||
@ -56,4 +56,18 @@ create_messages!(
|
||||
msg: format!("Failed to open current working directory. Error: {err}"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
program_name_should_match_file_name {
|
||||
args: (program_name: impl Display, file_name: impl Display),
|
||||
msg: format!("Program name `{program_name}` should match file name `{file_name}`"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
program_scope_name_does_not_match {
|
||||
args: (program_scope_name: impl Display, file_name: impl Display),
|
||||
msg: format!("The program scope name `{program_scope_name}` must match `{file_name}`."),
|
||||
help: None,
|
||||
}
|
||||
);
|
||||
|
@ -59,11 +59,11 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when reading the circuit file failed.
|
||||
/// For when reading the struct file failed.
|
||||
@backtraced
|
||||
failed_to_read_circuit_file {
|
||||
args: (path: impl Debug),
|
||||
msg: format!("Cannot read circuit file from the provided file path - {:?}", path),
|
||||
msg: format!("Cannot read struct file from the provided file path - {:?}", path),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@ -99,11 +99,11 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when the circuit file has an IO error.
|
||||
/// For when the struct file has an IO error.
|
||||
@backtraced
|
||||
io_error_circuit_file {
|
||||
args: (error: impl ErrorArg),
|
||||
msg: format!("IO error circuit file from the provided file path - {}", error),
|
||||
msg: format!("IO error struct file from the provided file path - {}", error),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@ -123,11 +123,11 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when removing the circuit file failed.
|
||||
/// For when removing the struct file failed.
|
||||
@backtraced
|
||||
failed_to_remove_circuit_file {
|
||||
args: (path: impl Debug),
|
||||
msg: format!("failed removing circuit file from the provided file path - {:?}", path),
|
||||
msg: format!("failed removing struct file from the provided file path - {:?}", path),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@ -291,4 +291,18 @@ create_messages!(
|
||||
msg: format!("Failed to remove aleo file: {}.", error),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@backtraced
|
||||
empty_source_directory {
|
||||
args: (),
|
||||
msg: "The `src/` directory is empty.".to_string(),
|
||||
help: Some("Add a `main.leo` file to the `src/` directory.".to_string()),
|
||||
}
|
||||
|
||||
@backtraced
|
||||
source_directory_can_contain_only_one_file {
|
||||
args: (),
|
||||
msg: "The `src/` directory can contain only one file and must be named `main.leo`.".to_string(),
|
||||
help: None,
|
||||
}
|
||||
);
|
||||
|
@ -72,11 +72,11 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when the parser encountered a mix of commas and semi-colons in circuit member variables.
|
||||
/// For when the parser encountered a mix of commas and semi-colons in struct member variables.
|
||||
@formatted
|
||||
mixed_commas_and_semicolons {
|
||||
args: (),
|
||||
msg: "Cannot mix use of commas and semi-colons for circuit member variable declarations.",
|
||||
msg: "Cannot mix use of commas and semi-colons for struct member variable declarations.",
|
||||
help: None,
|
||||
}
|
||||
|
||||
@ -120,14 +120,6 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when the parser encountered a deprecated `test function`.
|
||||
@formatted
|
||||
test_function {
|
||||
args: (),
|
||||
msg: "\"test function...\" is deprecated. Did you mean @test annotation?",
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// When more input was expected but not found.
|
||||
@backtraced
|
||||
lexer_empty_input {
|
||||
@ -224,27 +216,11 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Circuit functions are unstable in testnet3.
|
||||
@formatted
|
||||
circuit_functions_unstable {
|
||||
args: (),
|
||||
msg: "Circuit functions are currently an unstable feature and are disabled in Leo for testnet3.",
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Circuit constants are unstable in testnet3.
|
||||
@formatted
|
||||
circuit_constants_unstable {
|
||||
args: (),
|
||||
msg: "Circuit constants are currently an unstable feature and are disabled in Leo for testnet3.",
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
invalid_associated_access {
|
||||
args: (name: impl Display),
|
||||
msg: format!("Invalid associated access call to circuit {name}."),
|
||||
help: Some("Double colon `::` syntax is only supported for core circuits in Leo for testnet3.".to_string()),
|
||||
msg: format!("Invalid associated access call to struct {name}."),
|
||||
help: Some("Double colon `::` syntax is only supported for core functions in Leo for testnet3.".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
@ -267,4 +243,32 @@ create_messages!(
|
||||
msg: "A finalize statement must be preceded by the `async` keyword.",
|
||||
help: Some("Add the `async` keyword before the `finalize` keyword.".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
circuit_is_deprecated {
|
||||
args: (),
|
||||
msg: "The keyword `circuit` is deprecated.",
|
||||
help: Some("Use `struct` instead.".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
only_one_program_scope_is_allowed {
|
||||
args: (),
|
||||
msg: "Only one program scope is allowed in a Leo file.",
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
missing_program_scope {
|
||||
args: (),
|
||||
msg: "Missing a program scope in a Leo file.",
|
||||
help: Some("Add a program scope of the form: `program <name>.aleo { ... }` to the Leo file.".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
invalid_network {
|
||||
args: (),
|
||||
msg: "Invalid network identifier. The only supported identifier is `aleo`.",
|
||||
help: None,
|
||||
}
|
||||
);
|
||||
|
@ -111,17 +111,17 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when an invalid core instruction is used.
|
||||
/// For when an invalid core function is used.
|
||||
@formatted
|
||||
invalid_core_instruction {
|
||||
args: (circuit: impl Display, function: impl Display),
|
||||
invalid_core_function {
|
||||
args: (struct_: impl Display, function: impl Display),
|
||||
msg: format!(
|
||||
"The instruction {circuit}::{function} is not a valid core instruction.",
|
||||
"The instruction {struct_}::{function} is not a valid core function.",
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when a circuit is created with the same name as a core type.
|
||||
/// For when a struct is created with the same name as a core type.
|
||||
@formatted
|
||||
core_type_name_conflict {
|
||||
args: (type_: impl Display),
|
||||
@ -141,42 +141,42 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when the user tries initialize a circuit with the incorrect number of args.
|
||||
/// For when the user tries initialize a struct with the incorrect number of args.
|
||||
@formatted
|
||||
incorrect_num_circuit_members {
|
||||
incorrect_num_struct_members {
|
||||
args: (expected: impl Display, received: impl Display),
|
||||
msg: format!(
|
||||
"Circuit expected `{expected}` members, but got `{received}`",
|
||||
"Struct expected `{expected}` members, but got `{received}`",
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when the user is missing a circuit member during initialization.
|
||||
/// For when the user is missing a struct member during initialization.
|
||||
@formatted
|
||||
missing_circuit_member {
|
||||
args: (circuit: impl Display, member: impl Display),
|
||||
missing_struct_member {
|
||||
args: (struct_: impl Display, member: impl Display),
|
||||
msg: format!(
|
||||
"Circuit initialization expression for `{circuit}` is missing member `{member}`.",
|
||||
"Struct initialization expression for `{struct_}` is missing member `{member}`.",
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// An invalid access call is made e.g., `bool::MAX`
|
||||
@formatted
|
||||
invalid_core_circuit_call {
|
||||
invalid_core_function_call {
|
||||
args: (expr: impl Display),
|
||||
msg: format!(
|
||||
"{expr} is not a valid core circuit call."
|
||||
"{expr} is not a valid core function call."
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Attempted to define more that one circuit member with the same name.
|
||||
/// Attempted to define more that one struct member with the same name.
|
||||
@formatted
|
||||
duplicate_circuit_member {
|
||||
args: (circuit: impl Display),
|
||||
duplicate_struct_member {
|
||||
args: (struct_: impl Display),
|
||||
msg: format!(
|
||||
"Circuit {circuit} defined with more than one member with the same name."
|
||||
"Struct {struct_} defined with more than one member with the same name."
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
@ -191,7 +191,7 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Attempted to access an invalid circuit.
|
||||
/// Attempted to access an invalid struct.
|
||||
@formatted
|
||||
undefined_type {
|
||||
args: (type_: impl Display),
|
||||
@ -201,12 +201,12 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Attempted to access an invalid circuit variable.
|
||||
/// Attempted to access an invalid struct variable.
|
||||
@formatted
|
||||
invalid_circuit_variable {
|
||||
args: (variable: impl Display, circuit: impl Display),
|
||||
invalid_struct_variable {
|
||||
args: (variable: impl Display, struct_: impl Display),
|
||||
msg: format!(
|
||||
"Circuit variable {variable} is not a member of circuit {circuit}."
|
||||
"Variable {variable} is not a member of struct {struct_}."
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
@ -279,20 +279,20 @@ create_messages!(
|
||||
unknown_annotation {
|
||||
args: (annotation: impl Display),
|
||||
msg: format!("Unknown annotation: `{annotation}`."),
|
||||
help: Some("Use a valid annotation. The Leo compiler supports: `@program`".to_string()),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
helper_function_inputs_cannot_have_modes {
|
||||
regular_function_inputs_cannot_have_modes {
|
||||
args: (),
|
||||
msg: format!("Helper functions cannot have modes associated with their inputs."),
|
||||
help: Some("Consider removing the mode or adding a `@program` annotation to the function.".to_string()),
|
||||
msg: format!("Standard functions cannot have modes associated with their inputs."),
|
||||
help: Some("Consider removing the mode or using the keyword `transition` instead of `function`.".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
circuit_or_record_cannot_contain_record {
|
||||
struct_or_record_cannot_contain_record {
|
||||
args: (parent: impl Display, child: impl Display),
|
||||
msg: format!("A circuit or record cannot contain another record."),
|
||||
msg: format!("A struct or record cannot contain another record."),
|
||||
help: Some(format!("Remove the record `{child}` from `{parent}`.")),
|
||||
}
|
||||
|
||||
@ -304,10 +304,10 @@ create_messages!(
|
||||
}
|
||||
|
||||
@formatted
|
||||
only_program_functions_can_have_finalize {
|
||||
only_transition_functions_can_have_finalize {
|
||||
args: (),
|
||||
msg: format!("Only program functions can have a `finalize` block."),
|
||||
help: Some("Remove the `finalize` block or add a `@program` annotation to the function.".to_string()),
|
||||
msg: format!("Only transition functions can have a `finalize` block."),
|
||||
help: Some("Remove the `finalize` block or use the keyword `transition` instead of `function`.".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
@ -367,9 +367,9 @@ create_messages!(
|
||||
}
|
||||
|
||||
@formatted
|
||||
program_function_inputs_cannot_be_const {
|
||||
transition_function_inputs_cannot_be_const {
|
||||
args: (),
|
||||
msg: format!("Program functions cannot have constant inputs."),
|
||||
msg: format!("Transition functions cannot have constant inputs."),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@ -409,4 +409,18 @@ create_messages!(
|
||||
msg: format!("Invalid type `{type_}`"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
cannot_invoke_call_from_standard_function {
|
||||
args: (),
|
||||
msg: format!("Cannot call another function from a standard function."),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
cannot_invoke_call_to_local_transition_function {
|
||||
args: (),
|
||||
msg: format!("Cannot call a local transition function from a transition function."),
|
||||
help: None,
|
||||
}
|
||||
);
|
||||
|
@ -4,10 +4,10 @@ This directory includes the following Leo code examples:
|
||||
|
||||
1. Hello World -> Basic Sum of two u32
|
||||
2. Groups -> Basic operations over groups
|
||||
3. Core -> Core circuits functions over a field type
|
||||
3. Core -> Core functions over a field type
|
||||
4. Bubblesort -> Sorting algorithms over a tuple
|
||||
5. Import point -> Import code from an other file
|
||||
6. Message -> Initialization of a circuit type
|
||||
5. Import point -> Import code from another file
|
||||
6. Message -> Initialization of a struct
|
||||
7. Token -> Record example
|
||||
|
||||
## Build Guide
|
||||
@ -16,7 +16,7 @@ To compile each example, run:
|
||||
```bash
|
||||
leo build
|
||||
```
|
||||
When you run this command for the first time the snarkvm parameters (universal setup) will be downloaded, these are necessary to run the circuits.
|
||||
When you run this command for the first time the snarkvm parameters (universal setup) will be downloaded, these are necessary to run the programs.
|
||||
|
||||
To run each program, run:
|
||||
```bash
|
||||
|
@ -1,70 +1,70 @@
|
||||
// A bid in an auction.
|
||||
// - `owner` : The address of the account that owns the record associated with this bid.
|
||||
// This is separate from the address of the account that placed the bid.
|
||||
// - `gates` : The value associated with the record (always zero).
|
||||
// - `bidder` : The address of the account that placed the bid.
|
||||
// - `amount` : The amount of the bid.
|
||||
// - `is_winner` : Whether the bid is the winning bid.
|
||||
record Bid {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
bidder: address,
|
||||
amount: u64,
|
||||
is_winner: bool,
|
||||
}
|
||||
program auction.aleo {
|
||||
// A bid in an auction.
|
||||
// - `owner` : The address of the account that owns the record associated with this bid.
|
||||
// This is separate from the address of the account that placed the bid.
|
||||
// - `gates` : The value associated with the record (always zero).
|
||||
// - `bidder` : The address of the account that placed the bid.
|
||||
// - `amount` : The amount of the bid.
|
||||
// - `is_winner` : Whether the bid is the winning bid.
|
||||
record Bid {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
bidder: address,
|
||||
amount: u64,
|
||||
is_winner: bool,
|
||||
}
|
||||
|
||||
// Returns a new bid.
|
||||
// - `bidder` : The address of the account that placed the bid.
|
||||
// - `amount` : The amount of the bid.
|
||||
// Requires that `bidder` matches the function caller.
|
||||
// The owner of the record is set to the entity responsible for running the auction (auction runner).
|
||||
// The address of the auction runner is aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.
|
||||
@program
|
||||
function place_bid(bidder: address, amount: u64) -> Bid {
|
||||
// Ensure the caller is the auction bidder.
|
||||
console.assert_eq(self.caller, bidder);
|
||||
// Return a new 'Bid' record for the auction bidder.
|
||||
return Bid {
|
||||
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
|
||||
gates: 0u64,
|
||||
bidder: bidder,
|
||||
amount: amount,
|
||||
is_winner: false,
|
||||
};
|
||||
}
|
||||
// Returns a new bid.
|
||||
// - `bidder` : The address of the account that placed the bid.
|
||||
// - `amount` : The amount of the bid.
|
||||
// Requires that `bidder` matches the function caller.
|
||||
// The owner of the record is set to the entity responsible for running the auction (auction runner).
|
||||
// The address of the auction runner is aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.
|
||||
transition place_bid(bidder: address, amount: u64) -> Bid {
|
||||
// Ensure the caller is the auction bidder.
|
||||
console.assert_eq(self.caller, bidder);
|
||||
// Return a new 'Bid' record for the auction bidder.
|
||||
return Bid {
|
||||
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
|
||||
gates: 0u64,
|
||||
bidder: bidder,
|
||||
amount: amount,
|
||||
is_winner: false,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the winning bid.
|
||||
// - `first` : The first bid.
|
||||
// - `second` : The second bid.
|
||||
// Requires that the function caller is the auction runner.
|
||||
// Assumes that the function is invoked only after the bidding period has ended.
|
||||
// In the event of a tie, the first bid is selected.
|
||||
@program
|
||||
function resolve(first: Bid, second: Bid) -> Bid {
|
||||
// Ensure the caller is the auctioneer.
|
||||
console.assert_eq(self.caller, aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh);
|
||||
// Resolve the winner of the auction.
|
||||
if (first.amount >= second.amount) {
|
||||
return first;
|
||||
} else {
|
||||
return second;
|
||||
// Returns the winning bid.
|
||||
// - `first` : The first bid.
|
||||
// - `second` : The second bid.
|
||||
// Requires that the function caller is the auction runner.
|
||||
// Assumes that the function is invoked only after the bidding period has ended.
|
||||
// In the event of a tie, the first bid is selected.
|
||||
transition resolve(first: Bid, second: Bid) -> Bid {
|
||||
// Ensure the caller is the auctioneer.
|
||||
console.assert_eq(self.caller, aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh);
|
||||
// Resolve the winner of the auction.
|
||||
if (first.amount >= second.amount) {
|
||||
return first;
|
||||
} else {
|
||||
return second;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns ownership of the bid to bidder.
|
||||
// - `bid` : The winning bid.
|
||||
// Requires that the function caller is the auction runner.
|
||||
// Assumes that the function is invoked only after all bids have been resolved.
|
||||
transition finish(bid: Bid) -> Bid {
|
||||
// Ensure the caller is the auctioneer.
|
||||
console.assert_eq(self.caller, aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh);
|
||||
// Return 'is_winner' as 'true' in the winning 'Bid'.
|
||||
return Bid {
|
||||
owner: bid.bidder,
|
||||
gates: bid.gates,
|
||||
bidder: bid.bidder,
|
||||
amount: bid.amount,
|
||||
is_winner: true,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Returns ownership of the bid to bidder.
|
||||
// - `bid` : The winning bid.
|
||||
// Requires that the function caller is the auction runner.
|
||||
// Assumes that the function is invoked only after all bids have been resolved.
|
||||
@program
|
||||
function finish(bid: Bid) -> Bid {
|
||||
// Ensure the caller is the auctioneer.
|
||||
console.assert_eq(self.caller, aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh);
|
||||
// Return 'is_winner' as 'true' in the winning 'Bid'.
|
||||
return Bid {
|
||||
owner: bid.bidder,
|
||||
gates: bid.gates,
|
||||
bidder: bid.bidder,
|
||||
amount: bid.amount,
|
||||
is_winner: true,
|
||||
};
|
||||
}
|
||||
|
@ -1,107 +1,103 @@
|
||||
// A token, issued by a bank.
|
||||
// - 'owner' : The address of the account that owns the record associated with this token.
|
||||
// - 'gates' : The value associated with the record (always zero).
|
||||
// - 'amount' : The amount of tokens owned by the account.
|
||||
record Token {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
amount: u64,
|
||||
}
|
||||
|
||||
// An on-chain mapping, storing the amount of tokens owned by each account
|
||||
// The account is stored as a to preserve user privacy.
|
||||
mapping balances: field => u64;
|
||||
|
||||
// Returns a new Token.
|
||||
// - `owner` : The address of the account to issue the token to.
|
||||
// - `amount`: The amount of tokens to issue.
|
||||
// Requires that the function caller is the bank.
|
||||
// The bank's address is aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a.
|
||||
@program
|
||||
function issue(owner: address, amount: u64) -> Token {
|
||||
console.assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
|
||||
return Token {
|
||||
owner: owner,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
}
|
||||
|
||||
// Deposits some amount of money into the bank.
|
||||
// Returns a new Token with the remaining amount of money.
|
||||
// - `token` : A record containing tokens to deposit.
|
||||
// - `amount`: The amount of tokens to deposit.
|
||||
@program
|
||||
function deposit(token: Token, amount: u64) -> Token {
|
||||
let difference: u64 = token.amount - amount;
|
||||
|
||||
let remaining: Token = Token {
|
||||
owner: token.owner,
|
||||
gates: token.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Compute the hash of the token owner.
|
||||
let hash: field = BHP256::hash(token.owner);
|
||||
|
||||
async finalize(hash, amount);
|
||||
|
||||
return remaining;
|
||||
}
|
||||
|
||||
// Updates on-chain state by the amount of tokens deposited.
|
||||
// - `hash` : The hash of the token owner.
|
||||
// - `amount`: The amount of tokens that were deposited.
|
||||
finalize deposit(hash: field, amount: u64) {
|
||||
increment(balances, hash, amount);
|
||||
}
|
||||
|
||||
// Returns a new Token containing the amount of money withdrawn.
|
||||
// - `recipient`: The address of the account to withdraw the tokens to.
|
||||
// - `amount` : The amount of tokens to withdraw.
|
||||
// - `rate` : The compound interest rate.
|
||||
// - `periods` : The number of periods to compound the interest over.
|
||||
// Requires that the function caller is the bank.
|
||||
@program
|
||||
function withdraw(recipient: address, amount: u64, rate: u64, periods: u64) -> Token {
|
||||
console.assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
|
||||
let hash: field = BHP256::hash(recipient);
|
||||
|
||||
let total: u64 = calculate_interest(amount, rate, periods);
|
||||
|
||||
let token: Token = Token {
|
||||
owner: recipient,
|
||||
gates: 0u64,
|
||||
amount: total,
|
||||
};
|
||||
|
||||
async finalize(hash, amount);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
// Updates on-chain state by the amount of tokens withdrawn.
|
||||
// - `hash` : The hash of the token owner.
|
||||
// - `amount`: The amount of tokens that were withdrawn.
|
||||
finalize withdraw(hash: field, amount: u64) {
|
||||
decrement(balances, hash, amount);
|
||||
}
|
||||
|
||||
// Returns the total amount of tokens after compounding interest.
|
||||
// - `principal`: The amount of tokens to compound interest over.
|
||||
// - `rate` : The compound interest rate.
|
||||
// - `periods` : The number of periods to compound the interest over.
|
||||
function calculate_interest(principal: u64, rate: u64, periods: u64) -> u64 {
|
||||
let amount: u64 = principal;
|
||||
|
||||
for i:u64 in 0u64..100u64 {
|
||||
if i < periods {
|
||||
amount += (amount * rate) / 10000u64;
|
||||
}
|
||||
program basic_bank.aleo {
|
||||
// A token, issued by a bank.
|
||||
// - 'owner' : The address of the account that owns the record associated with this token.
|
||||
// - 'gates' : The value associated with the record (always zero).
|
||||
// - 'amount' : The amount of tokens owned by the account.
|
||||
record Token {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
amount: u64,
|
||||
}
|
||||
|
||||
return amount;
|
||||
// An on-chain mapping, storing the amount of tokens owned by each account
|
||||
// The account is stored as a to preserve user privacy.
|
||||
mapping balances: field => u64;
|
||||
|
||||
// Returns a new Token.
|
||||
// - `owner` : The address of the account to issue the token to.
|
||||
// - `amount`: The amount of tokens to issue.
|
||||
// Requires that the function caller is the bank.
|
||||
// The bank's address is aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a.
|
||||
transition issue(owner: address, amount: u64) -> Token {
|
||||
console.assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
|
||||
return Token {
|
||||
owner: owner,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
}
|
||||
|
||||
// Deposits some amount of money into the bank.
|
||||
// Returns a new Token with the remaining amount of money.
|
||||
// - `token` : A record containing tokens to deposit.
|
||||
// - `amount`: The amount of tokens to deposit.
|
||||
transition deposit(token: Token, amount: u64) -> Token {
|
||||
let difference: u64 = token.amount - amount;
|
||||
|
||||
let remaining: Token = Token {
|
||||
owner: token.owner,
|
||||
gates: token.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Compute the hash of the token owner.
|
||||
let hash: field = BHP256::hash(token.owner);
|
||||
|
||||
async finalize(hash, amount);
|
||||
|
||||
return remaining;
|
||||
}
|
||||
|
||||
// Updates on-chain state by the amount of tokens deposited.
|
||||
// - `hash` : The hash of the token owner.
|
||||
// - `amount`: The amount of tokens that were deposited.
|
||||
finalize deposit(hash: field, amount: u64) {
|
||||
increment(balances, hash, amount);
|
||||
}
|
||||
|
||||
// Returns a new Token containing the amount of money withdrawn.
|
||||
// - `recipient`: The address of the account to withdraw the tokens to.
|
||||
// - `amount` : The amount of tokens to withdraw.
|
||||
// - `rate` : The compound interest rate.
|
||||
// - `periods` : The number of periods to compound the interest over.
|
||||
// Requires that the function caller is the bank.
|
||||
transition withdraw(recipient: address, amount: u64, rate: u64, periods: u64) -> Token {
|
||||
console.assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
|
||||
let hash: field = BHP256::hash(recipient);
|
||||
|
||||
let total: u64 = calculate_interest(amount, rate, periods);
|
||||
|
||||
let token: Token = Token {
|
||||
owner: recipient,
|
||||
gates: 0u64,
|
||||
amount: total,
|
||||
};
|
||||
|
||||
async finalize(hash, amount);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
// Updates on-chain state by the amount of tokens withdrawn.
|
||||
// - `hash` : The hash of the token owner.
|
||||
// - `amount`: The amount of tokens that were withdrawn.
|
||||
finalize withdraw(hash: field, amount: u64) {
|
||||
decrement(balances, hash, amount);
|
||||
}
|
||||
|
||||
// Returns the total amount of tokens after compounding interest.
|
||||
// - `principal`: The amount of tokens to compound interest over.
|
||||
// - `rate` : The compound interest rate.
|
||||
// - `periods` : The number of periods to compound the interest over.
|
||||
function calculate_interest(principal: u64, rate: u64, periods: u64) -> u64 {
|
||||
let amount: u64 = principal;
|
||||
|
||||
for i:u64 in 0u64..100u64 {
|
||||
if i < periods {
|
||||
amount += (amount * rate) / 10000u64;
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,117 +1,115 @@
|
||||
// Battleship boards are represented by 8x8 squares.
|
||||
// A u64 is all that is required to represent a hit or a miss on a single board.
|
||||
// Starting from the top row, left to right, a hit is 1 and a miss is 0.
|
||||
// A first move resulting in a hit in row 1, column 3 would be:
|
||||
// 00100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|
||||
// A second u64 is needed to represent which squares have been played, with 1s being played squares and 0s being
|
||||
// unplayed squares.
|
||||
record board_state {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
// The hits and misses registered on the opponent's board.
|
||||
hits_and_misses: u64,
|
||||
// The squares that have been played on the opponent's board.
|
||||
played_tiles: u64,
|
||||
// The ship bitstring representing all ship positions on your own board
|
||||
ships: u64,
|
||||
player_1: address,
|
||||
player_2: address,
|
||||
game_started: bool,
|
||||
}
|
||||
|
||||
// Returns a new board_state.
|
||||
@program
|
||||
function new_board_state(
|
||||
ships: u64,
|
||||
opponent: address,
|
||||
) -> board_state {
|
||||
return board_state {
|
||||
owner: self.caller,
|
||||
gates: 0u64,
|
||||
hits_and_misses: 0u64,
|
||||
played_tiles: 0u64,
|
||||
ships,
|
||||
player_1: self.caller,
|
||||
player_2: opponent,
|
||||
game_started: false,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a new board state that has been started.
|
||||
// Fails if this board has been started before.
|
||||
@program
|
||||
function start_board(
|
||||
// The record of the board to start. A board can only be started once.
|
||||
board: board_state,
|
||||
) -> board_state {
|
||||
// Ensure this board hasn't been used to start a game before.
|
||||
console.assert(!board.game_started);
|
||||
|
||||
return board_state {
|
||||
owner: board.owner,
|
||||
gates: board.gates,
|
||||
hits_and_misses: board.hits_and_misses,
|
||||
played_tiles: board.played_tiles,
|
||||
ships: board.ships,
|
||||
player_1: board.player_1,
|
||||
player_2: board.player_2,
|
||||
game_started: true,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a new board state record that includes all the played tiles.
|
||||
// Fails if r1 has been played before.
|
||||
@program
|
||||
function update_played_tiles(
|
||||
// The record of the board to update.
|
||||
board: board_state,
|
||||
// The u64 equivalent of a bitstring fire coordinate to send to the opponent.
|
||||
shoot: u64,
|
||||
) -> board_state {
|
||||
// Need to make sure r1 is a valid move. Only one bit of r1 should be flipped.
|
||||
let flip_bit: u64 = shoot - 1u64;
|
||||
// bitwise and operation
|
||||
let check_move: u64 = shoot & flip_bit;
|
||||
console.assert_eq(check_move, 0u64);
|
||||
|
||||
// Need to make sure r1 is a valid move given the played_tiles. no bits should overlap.
|
||||
let check_tiles: u64 = shoot & board.played_tiles;
|
||||
console.assert_eq(check_tiles, 0u64);
|
||||
|
||||
// Update played tiles.
|
||||
let played_tiles: u64 = board.played_tiles | shoot;
|
||||
|
||||
return board_state {
|
||||
owner: board.owner,
|
||||
gates: board.gates,
|
||||
hits_and_misses: board.hits_and_misses,
|
||||
played_tiles,
|
||||
ships: board.ships,
|
||||
player_1: board.player_1,
|
||||
player_2: board.player_2,
|
||||
game_started: board.game_started,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a new board state record that includes all the hits and misses.
|
||||
@program
|
||||
function update_hits_and_misses(
|
||||
// The record of the board to update.
|
||||
board: board_state,
|
||||
// The u64 equivalent of a bitstring of whether this player's previous move was a hit or miss.
|
||||
hit_or_miss: u64,
|
||||
) -> board_state {
|
||||
// Update hits and misses.
|
||||
let hits_and_misses: u64 = board.hits_and_misses | hit_or_miss;
|
||||
|
||||
return board_state {
|
||||
owner: board.owner,
|
||||
gates: board.gates,
|
||||
hits_and_misses,
|
||||
played_tiles: board.played_tiles,
|
||||
ships: board.ships,
|
||||
player_1: board.player_1,
|
||||
player_2: board.player_2,
|
||||
game_started: board.game_started,
|
||||
};
|
||||
program board.aleo {
|
||||
// Battleship boards are represented by 8x8 squares.
|
||||
// A u64 is all that is required to represent a hit or a miss on a single board.
|
||||
// Starting from the top row, left to right, a hit is 1 and a miss is 0.
|
||||
// A first move resulting in a hit in row 1, column 3 would be:
|
||||
// 00100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|
||||
// A second u64 is needed to represent which squares have been played, with 1s being played squares and 0s being
|
||||
// unplayed squares.
|
||||
record board_state {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
// The hits and misses registered on the opponent's board.
|
||||
hits_and_misses: u64,
|
||||
// The squares that have been played on the opponent's board.
|
||||
played_tiles: u64,
|
||||
// The ship bitstring representing all ship positions on your own board
|
||||
ships: u64,
|
||||
player_1: address,
|
||||
player_2: address,
|
||||
game_started: bool,
|
||||
}
|
||||
|
||||
// Returns a new board_state.
|
||||
transition new_board_state(
|
||||
ships: u64,
|
||||
opponent: address,
|
||||
) -> board_state {
|
||||
return board_state {
|
||||
owner: self.caller,
|
||||
gates: 0u64,
|
||||
hits_and_misses: 0u64,
|
||||
played_tiles: 0u64,
|
||||
ships,
|
||||
player_1: self.caller,
|
||||
player_2: opponent,
|
||||
game_started: false,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a new board state that has been started.
|
||||
// Fails if this board has been started before.
|
||||
transition start_board(
|
||||
// The record of the board to start. A board can only be started once.
|
||||
board: board_state,
|
||||
) -> board_state {
|
||||
// Ensure this board hasn't been used to start a game before.
|
||||
console.assert(!board.game_started);
|
||||
|
||||
return board_state {
|
||||
owner: board.owner,
|
||||
gates: board.gates,
|
||||
hits_and_misses: board.hits_and_misses,
|
||||
played_tiles: board.played_tiles,
|
||||
ships: board.ships,
|
||||
player_1: board.player_1,
|
||||
player_2: board.player_2,
|
||||
game_started: true,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a new board state record that includes all the played tiles.
|
||||
// Fails if r1 has been played before.
|
||||
transition update_played_tiles(
|
||||
// The record of the board to update.
|
||||
board: board_state,
|
||||
// The u64 equivalent of a bitstring fire coordinate to send to the opponent.
|
||||
shoot: u64,
|
||||
) -> board_state {
|
||||
// Need to make sure r1 is a valid move. Only one bit of r1 should be flipped.
|
||||
let flip_bit: u64 = shoot - 1u64;
|
||||
// bitwise and operation
|
||||
let check_move: u64 = shoot & flip_bit;
|
||||
console.assert_eq(check_move, 0u64);
|
||||
|
||||
// Need to make sure r1 is a valid move given the played_tiles. no bits should overlap.
|
||||
let check_tiles: u64 = shoot & board.played_tiles;
|
||||
console.assert_eq(check_tiles, 0u64);
|
||||
|
||||
// Update played tiles.
|
||||
let played_tiles: u64 = board.played_tiles | shoot;
|
||||
|
||||
return board_state {
|
||||
owner: board.owner,
|
||||
gates: board.gates,
|
||||
hits_and_misses: board.hits_and_misses,
|
||||
played_tiles,
|
||||
ships: board.ships,
|
||||
player_1: board.player_1,
|
||||
player_2: board.player_2,
|
||||
game_started: board.game_started,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a new board state record that includes all the hits and misses.
|
||||
transition update_hits_and_misses(
|
||||
// The record of the board to update.
|
||||
board: board_state,
|
||||
// The u64 equivalent of a bitstring of whether this player's previous move was a hit or miss.
|
||||
hit_or_miss: u64,
|
||||
) -> board_state {
|
||||
// Update hits and misses.
|
||||
let hits_and_misses: u64 = board.hits_and_misses | hit_or_miss;
|
||||
|
||||
return board_state {
|
||||
owner: board.owner,
|
||||
gates: board.gates,
|
||||
hits_and_misses,
|
||||
played_tiles: board.played_tiles,
|
||||
ships: board.ships,
|
||||
player_1: board.player_1,
|
||||
player_2: board.player_2,
|
||||
game_started: board.game_started,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,48 +1,49 @@
|
||||
record move {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
incoming_fire_coordinate: u64,
|
||||
player_1: address,
|
||||
player_2: address,
|
||||
// One flipped bit indicates a hit. No flipped bits indicates a miss.
|
||||
prev_hit_or_miss: u64,
|
||||
program move.aleo {
|
||||
record move {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
incoming_fire_coordinate: u64,
|
||||
player_1: address,
|
||||
player_2: address,
|
||||
// One flipped bit indicates a hit. No flipped bits indicates a miss.
|
||||
prev_hit_or_miss: u64,
|
||||
}
|
||||
|
||||
// Returns new move record owned by the opponent.
|
||||
transition create_move(
|
||||
// The move record created by the opponent.
|
||||
move_record: move,
|
||||
// The u64 representation of incoming_fire_coordinate, the bitstring fire coordinate to send to the opponent.
|
||||
incoming_fire_coordinate: u64,
|
||||
// The u64 representation of prev_hit_or_miss, this player's previous fire coordinate as a hit or miss.
|
||||
prev_hit_or_miss: u64,
|
||||
) -> move {
|
||||
// A new move record should be created and owned by the opponent.
|
||||
let one_is_owner: bool = move_record.player_1 == move_record.owner;
|
||||
let opponent: address = one_is_owner ? move_record.player_2 : move_record.player_1;
|
||||
|
||||
return move {
|
||||
owner: opponent,
|
||||
gates: move_record.gates,
|
||||
incoming_fire_coordinate,
|
||||
player_1: move_record.player_2,
|
||||
player_2: move_record.player_1,
|
||||
prev_hit_or_miss,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the move record owned by the opponent.
|
||||
// Note, this move record contains dummy fire coordinates and previous hit or miss.
|
||||
transition start_game(player_2: address) -> move {
|
||||
return move {
|
||||
owner: player_2,
|
||||
gates: 0u64,
|
||||
incoming_fire_coordinate: 0u64,
|
||||
player_1: self.caller,
|
||||
player_2: player_2,
|
||||
prev_hit_or_miss: 0u64,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Returns new move record owned by the opponent.
|
||||
@program
|
||||
function create_move(
|
||||
// The move record created by the opponent.
|
||||
move_record: move,
|
||||
// The u64 representation of incoming_fire_coordinate, the bitstring fire coordinate to send to the opponent.
|
||||
incoming_fire_coordinate: u64,
|
||||
// The u64 representation of prev_hit_or_miss, this player's previous fire coordinate as a hit or miss.
|
||||
prev_hit_or_miss: u64,
|
||||
) -> move {
|
||||
// A new move record should be created and owned by the opponent.
|
||||
let one_is_owner: bool = move_record.player_1 == move_record.owner;
|
||||
let opponent: address = one_is_owner ? move_record.player_2 : move_record.player_1;
|
||||
|
||||
return move {
|
||||
owner: opponent,
|
||||
gates: move_record.gates,
|
||||
incoming_fire_coordinate,
|
||||
player_1: move_record.player_2,
|
||||
player_2: move_record.player_1,
|
||||
prev_hit_or_miss,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the move record owned by the opponent.
|
||||
// Note, this move record contains dummy fire coordinates and previous hit or miss.
|
||||
@program
|
||||
function start_game(player_2: address) -> move {
|
||||
return move {
|
||||
owner: player_2,
|
||||
gates: 0u64,
|
||||
incoming_fire_coordinate: 0u64,
|
||||
player_1: self.caller,
|
||||
player_2: player_2,
|
||||
prev_hit_or_miss: 0u64,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,125 +1,125 @@
|
||||
// Returns the number of flipped bits.
|
||||
// E.g. 17870283321406128128u64, in binary 11111000 00000000 00000000 00000000 00000000 00000000 00000000 00000000,
|
||||
// returns 5u64;
|
||||
function bitcount(bits: u64) -> u64 {
|
||||
let r1: u64 = bits / 2u64;
|
||||
let r2: u64 = bits / 4u64;
|
||||
let r3: u64 = bits / 8u64;
|
||||
program verify.aleo {
|
||||
// Returns the number of flipped bits.
|
||||
// E.g. 17870283321406128128u64, in binary 11111000 00000000 00000000 00000000 00000000 00000000 00000000 00000000,
|
||||
// returns 5u64;
|
||||
function bitcount(bits: u64) -> u64 {
|
||||
let r1: u64 = bits / 2u64;
|
||||
let r2: u64 = bits / 4u64;
|
||||
let r3: u64 = bits / 8u64;
|
||||
|
||||
let r4: u64 = r1 & 8608480567731124087u64;
|
||||
let r5: u64 = r2 & 3689348814741910323u64;
|
||||
let r6: u64 = r3 & 1229782938247303441u64;
|
||||
let r4: u64 = r1 & 8608480567731124087u64;
|
||||
let r5: u64 = r2 & 3689348814741910323u64;
|
||||
let r6: u64 = r3 & 1229782938247303441u64;
|
||||
|
||||
let r7: u64 = bits - r4 - r5 - r6;
|
||||
let r7: u64 = bits - r4 - r5 - r6;
|
||||
|
||||
let r8: u64 = r7 / 16u64;
|
||||
let r9: u64 = r7 + r8;
|
||||
let r10: u64 = r9 & 1085102592571150095u64;
|
||||
let r11: u64 = r10 % 255u64;
|
||||
let r8: u64 = r7 / 16u64;
|
||||
let r9: u64 = r7 + r8;
|
||||
let r10: u64 = r9 & 1085102592571150095u64;
|
||||
let r11: u64 = r10 % 255u64;
|
||||
|
||||
return r11;
|
||||
return r11;
|
||||
}
|
||||
|
||||
// Returns boolean of whether all the flipped bits in location are "adjacent". Horizontally, this means all flipped bits are
|
||||
// directly next to each other (111). Vertically, this means all flipped bits are separated by 7 unflipped bits
|
||||
// (10000000100000001).
|
||||
function adjacency_check(
|
||||
// The u64 representation of a ship's placement in an 8x8 grid.
|
||||
ship: u64,
|
||||
// The u64 representation of a ship's bitstring, either horizontally or vertically.
|
||||
// E.g. a ship of length 3's bit string horizontally would be: 000111 = 7u64. Vertically, the bit string would be:
|
||||
// 10000000100000001 = 65793u64.
|
||||
orientation: u64,
|
||||
) -> bool {
|
||||
// This may result in 0.
|
||||
let division: u64 = ship / orientation;
|
||||
|
||||
// subtracting 1 from 0 will cause an underflow, so we should check for this edge case.
|
||||
let is_eq: bool = division == 0u64;
|
||||
|
||||
// if the above division resulted in 0, we know the adjacency check should return false.
|
||||
// Setting to r4 to 3 (11) will guarantee failure here.
|
||||
let ternary: u64 = is_eq ? 3u64 : division;
|
||||
let subtraction: u64 = ternary - 1u64;
|
||||
let and: u64 = subtraction & ternary;
|
||||
|
||||
let bits_are_adjacent: bool = and == 0u64;
|
||||
|
||||
return bits_are_adjacent;
|
||||
}
|
||||
|
||||
// Returns boolean of whether adjacent flipped bits don't split a row of size 8.
|
||||
// E.g. 111000000 has adjacent flipped bits but splits a row: 00000001 11000000
|
||||
function horizontal_check(
|
||||
// The u64 representation of a ship's placement in an 8x8 grid.
|
||||
ship: u64,
|
||||
// The u64 representation of a ship's bitstring horizontally.
|
||||
horizontal: u64,
|
||||
) -> bool {
|
||||
let remainder: u64 = ship % 255u64;
|
||||
// This may result in 0.
|
||||
let division: u64 = remainder / horizontal;
|
||||
|
||||
// Subtracting 1 from 0 will cause an underflow.
|
||||
let is_eq: bool = division == 0u64;
|
||||
|
||||
// Setting to 3 will guarantee failure.
|
||||
let ternary: u64 = is_eq ? 3u64 : division;
|
||||
let subtraction: u64 = ternary - 1u64;
|
||||
let and: u64 = subtraction & ternary;
|
||||
|
||||
let bits_split_row: bool = and == 0u64;
|
||||
|
||||
return bits_split_row;
|
||||
}
|
||||
|
||||
// Returns `true` if the ship placement is valid.
|
||||
transition validate_ship(
|
||||
// The u64 representation of a ship's placement in an 8x8 grid.
|
||||
ship: u64,
|
||||
// The length of the placed ship.
|
||||
length: u64,
|
||||
// The u64 equivalent of a ship's horizontal bitstring representation.
|
||||
horizontal: u64,
|
||||
// The u64 equivalent of a ship's vertical bitstring representation.
|
||||
vertical: u64,
|
||||
) -> bool {
|
||||
// Check bitcount -- all other validations depend on the bitcount being correct.
|
||||
let num_bits: u64 = bitcount(ship);
|
||||
console.assert_eq(num_bits, length);
|
||||
|
||||
// Check horizontal bits of ship.
|
||||
let is_adjacent: bool = adjacency_check(ship, horizontal); // True if bits are adjacent horizontally.
|
||||
let is_horizontal: bool = horizontal_check(ship, horizontal); // True if those horizontal bits are not split across rows.
|
||||
let valid_horizontal: bool = is_adjacent && is_horizontal; // True if bits are adjacent horizontally and not split across rows.
|
||||
|
||||
// Check vertical bits of ship.
|
||||
let valid_vertical: bool = adjacency_check(ship, vertical); // True if bits are adjacent vertically.
|
||||
|
||||
let ship_is_valid: bool = valid_horizontal || valid_vertical; // Ship is valid if it is vertically or horizontally valid.
|
||||
|
||||
return ship_is_valid;
|
||||
}
|
||||
|
||||
// Returns the u64 representation of all the ships' placements in an 8x8 grid. This function will fail
|
||||
// if any of the ship placements overlap each other.
|
||||
transition create_board(
|
||||
// The u64 representation of a carrier's placement in an 8x8 grid. Length = 5.
|
||||
carrier: u64,
|
||||
// The u64 representation of a battleship's placement in an 8x8 grid. Length = 4.
|
||||
battleship: u64,
|
||||
// The u64 representation of a cruiser's placement in an 8x8 grid. Length = 3.
|
||||
cruiser: u64,
|
||||
// The u64 representation of a destroyer's placement in an 8x8 grid. Length = 2.
|
||||
destroyer: u64,
|
||||
) -> u64 {
|
||||
// Bitwise combine the ship placements together
|
||||
let ships: u64 = carrier | battleship | cruiser | destroyer;
|
||||
|
||||
let num_bits: u64 = bitcount(ships);
|
||||
console.assert_eq(num_bits, 14u64); // Given 4 individually-valid ships, a valid combination should yield exactly 14 flipped bits.
|
||||
|
||||
return ships;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns boolean of whether all the flipped bits in location are "adjacent". Horizontally, this means all flipped bits are
|
||||
// directly next to each other (111). Vertically, this means all flipped bits are separated by 7 unflipped bits
|
||||
// (10000000100000001).
|
||||
function adjacency_check(
|
||||
// The u64 representation of a ship's placement in an 8x8 grid.
|
||||
ship: u64,
|
||||
// The u64 representation of a ship's bitstring, either horizontally or vertically.
|
||||
// E.g. a ship of length 3's bit string horizontally would be: 000111 = 7u64. Vertically, the bit string would be:
|
||||
// 10000000100000001 = 65793u64.
|
||||
orientation: u64,
|
||||
) -> bool {
|
||||
// This may result in 0.
|
||||
let division: u64 = ship / orientation;
|
||||
|
||||
// subtracting 1 from 0 will cause an underflow, so we should check for this edge case.
|
||||
let is_eq: bool = division == 0u64;
|
||||
|
||||
// if the above division resulted in 0, we know the adjacency check should return false.
|
||||
// Setting to r4 to 3 (11) will guarantee failure here.
|
||||
let ternary: u64 = is_eq ? 3u64 : division;
|
||||
let subtraction: u64 = ternary - 1u64;
|
||||
let and: u64 = subtraction & ternary;
|
||||
|
||||
let bits_are_adjacent: bool = and == 0u64;
|
||||
|
||||
return bits_are_adjacent;
|
||||
}
|
||||
|
||||
// Returns boolean of whether adjacent flipped bits don't split a row of size 8.
|
||||
// E.g. 111000000 has adjacent flipped bits but splits a row: 00000001 11000000
|
||||
function horizontal_check(
|
||||
// The u64 representation of a ship's placement in an 8x8 grid.
|
||||
ship: u64,
|
||||
// The u64 representation of a ship's bitstring horizontally.
|
||||
horizontal: u64,
|
||||
) -> bool {
|
||||
let remainder: u64 = ship % 255u64;
|
||||
// This may result in 0.
|
||||
let division: u64 = remainder / horizontal;
|
||||
|
||||
// Subtracting 1 from 0 will cause an underflow.
|
||||
let is_eq: bool = division == 0u64;
|
||||
|
||||
// Setting to 3 will guarantee failure.
|
||||
let ternary: u64 = is_eq ? 3u64 : division;
|
||||
let subtraction: u64 = ternary - 1u64;
|
||||
let and: u64 = subtraction & ternary;
|
||||
|
||||
let bits_split_row: bool = and == 0u64;
|
||||
|
||||
return bits_split_row;
|
||||
}
|
||||
|
||||
// Returns `true` if the ship placement is valid.
|
||||
@program
|
||||
function validate_ship(
|
||||
// The u64 representation of a ship's placement in an 8x8 grid.
|
||||
ship: u64,
|
||||
// The length of the placed ship.
|
||||
length: u64,
|
||||
// The u64 equivalent of a ship's horizontal bitstring representation.
|
||||
horizontal: u64,
|
||||
// The u64 equivalent of a ship's vertical bitstring representation.
|
||||
vertical: u64,
|
||||
) -> bool {
|
||||
// Check bitcount -- all other validations depend on the bitcount being correct.
|
||||
let num_bits: u64 = bitcount(ship);
|
||||
console.assert_eq(num_bits, length);
|
||||
|
||||
// Check horizontal bits of ship.
|
||||
let is_adjacent: bool = adjacency_check(ship, horizontal); // True if bits are adjacent horizontally.
|
||||
let is_horizontal: bool = horizontal_check(ship, horizontal); // True if those horizontal bits are not split across rows.
|
||||
let valid_horizontal: bool = is_adjacent && is_horizontal; // True if bits are adjacent horizontally and not split across rows.
|
||||
|
||||
// Check vertical bits of ship.
|
||||
let valid_vertical: bool = adjacency_check(ship, vertical); // True if bits are adjacent vertically.
|
||||
|
||||
let ship_is_valid: bool = valid_horizontal || valid_vertical; // Ship is valid if it is vertically or horizontally valid.
|
||||
|
||||
return ship_is_valid;
|
||||
}
|
||||
|
||||
// Returns the u64 representation of all the ships' placements in an 8x8 grid. This function will fail
|
||||
// if any of the ship placements overlap each other.
|
||||
@program
|
||||
function create_board(
|
||||
// The u64 representation of a carrier's placement in an 8x8 grid. Length = 5.
|
||||
carrier: u64,
|
||||
// The u64 representation of a battleship's placement in an 8x8 grid. Length = 4.
|
||||
battleship: u64,
|
||||
// The u64 representation of a cruiser's placement in an 8x8 grid. Length = 3.
|
||||
cruiser: u64,
|
||||
// The u64 representation of a destroyer's placement in an 8x8 grid. Length = 2.
|
||||
destroyer: u64,
|
||||
) -> u64 {
|
||||
// Bitwise combine the ship placements together
|
||||
let ships: u64 = carrier | battleship | cruiser | destroyer;
|
||||
|
||||
let num_bits: u64 = bitcount(ships);
|
||||
console.assert_eq(num_bits, 14u64); // Given 4 individually-valid ships, a valid combination should yield exactly 14 flipped bits.
|
||||
|
||||
return ships;
|
||||
}
|
@ -1,106 +1,105 @@
|
||||
// The 'battleship.leo' program.
|
||||
import board.leo;
|
||||
import move.leo;
|
||||
import verify.leo;
|
||||
|
||||
// Returns a new record representing a new game of battleship.
|
||||
@program
|
||||
function initialize_board(
|
||||
// The u64 representation of a carrier's placement in an 8x8 grid. Length = 5.
|
||||
carrier: u64,
|
||||
// The u64 representation of a battleship's placement in an 8x8 grid. Length = 4.
|
||||
battleship: u64,
|
||||
// The u64 representation of a cruiser's placement in an 8x8 grid. Length = 3.
|
||||
cruiser: u64,
|
||||
// The u64 representation of a destroyer's placement in an 8x8 grid. Length = 2.
|
||||
destroyer: u64,
|
||||
// The address of the opponent.
|
||||
player: address,
|
||||
) -> board.leo/board_state.record {
|
||||
// Verify that each individual ship placement bitstring is valid.
|
||||
let valid_carrier: bool = verify.leo/validate_ship(carrier, 5u64, 31u64, 4311810305u64);
|
||||
console.assert(valid_carrier);
|
||||
// The 'battleship.leo' program.
|
||||
program battleship.aleo {
|
||||
// Returns a new record representing a new game of battleship.
|
||||
transition initialize_board(
|
||||
// The u64 representation of a carrier's placement in an 8x8 grid. Length = 5.
|
||||
carrier: u64,
|
||||
// The u64 representation of a battleship's placement in an 8x8 grid. Length = 4.
|
||||
battleship: u64,
|
||||
// The u64 representation of a cruiser's placement in an 8x8 grid. Length = 3.
|
||||
cruiser: u64,
|
||||
// The u64 representation of a destroyer's placement in an 8x8 grid. Length = 2.
|
||||
destroyer: u64,
|
||||
// The address of the opponent.
|
||||
player: address,
|
||||
) -> board.leo/board_state.record {
|
||||
// Verify that each individual ship placement bitstring is valid.
|
||||
let valid_carrier: bool = verify.leo/validate_ship(carrier, 5u64, 31u64, 4311810305u64);
|
||||
console.assert(valid_carrier);
|
||||
|
||||
let valid_battleship: bool = verify.leo/validate_ship(battleship, 4u64, 15u64, 16843009u64);
|
||||
console.assert(valid_battleship);
|
||||
let valid_battleship: bool = verify.leo/validate_ship(battleship, 4u64, 15u64, 16843009u64);
|
||||
console.assert(valid_battleship);
|
||||
|
||||
let valid_cruiser: bool = verify.leo/validate_ship(cruiser, 3u64, 7u64, 65793u64);
|
||||
console.assert(valid_cruiser);
|
||||
let valid_cruiser: bool = verify.leo/validate_ship(cruiser, 3u64, 7u64, 65793u64);
|
||||
console.assert(valid_cruiser);
|
||||
|
||||
let valid_destroyer: bool = verify.leo/validate_ship(destroyer, 2u64, 3u64, 257u64);
|
||||
console.assert(valid_destroyer);
|
||||
let valid_destroyer: bool = verify.leo/validate_ship(destroyer, 2u64, 3u64, 257u64);
|
||||
console.assert(valid_destroyer);
|
||||
|
||||
// Create the board with all the ship placements combined.
|
||||
let board: u64 = verify.leo/create_board(carrier, battleship, cruiser, destroyer);
|
||||
// Create the board with all the ship placements combined.
|
||||
let board: u64 = verify.leo/create_board(carrier, battleship, cruiser, destroyer);
|
||||
|
||||
// Initialize the board state record.
|
||||
let state: board_state = board.leo/new_board_state(board, player);
|
||||
// Initialize the board state record.
|
||||
let state: board_state = board.leo/new_board_state(board, player);
|
||||
|
||||
return state;
|
||||
return state;
|
||||
}
|
||||
|
||||
// Returns an updated board state record that has been started. This board cannot be used to start any other games.
|
||||
// Returns a dummy move record owned by the opponent.
|
||||
// This function commits a given board to a game with an opponent and creates the initial dummy move.
|
||||
transition offer_battleship(
|
||||
// The board record to start a game with.
|
||||
board: board.leo/board_state.record,
|
||||
) -> (board.leo/board_state.record, move.leo/move.record) {
|
||||
let state: board_state = board.leo/start_board(board);
|
||||
let dummy: move = move.leo/start_game(board.player_2);
|
||||
|
||||
return (state, dummy);
|
||||
}
|
||||
|
||||
// Returns updated board_state.record that has been started and can no longer be used to join or start new games.
|
||||
// Returns dummy move record owned by the opponent.
|
||||
transition start_battleship(
|
||||
// The board record to play the game with.
|
||||
board: board.leo/board_state.record,
|
||||
// The move record to play to begin the game. This should be the dummy move record created from offer_battleship.
|
||||
move_start: move.leo/move.record,
|
||||
) -> (board.leo/board_state.record, move.leo/move.record) {
|
||||
// Validate that the move players and board players match each other.
|
||||
console.assert_eq(board.player_1, move_start.player_2);
|
||||
console.assert_eq(board.player_2, move_start.player_1);
|
||||
|
||||
let state: board_state = board.leo/start_board(board);
|
||||
let dummy: move = move.leo/start_game(board.player_2);
|
||||
|
||||
return (state, dummy);
|
||||
}
|
||||
|
||||
// Returns updated board record.
|
||||
// Returns new move record owned by opponent.
|
||||
transition play(
|
||||
// The board record to update.
|
||||
board: board.leo/board_state.record,
|
||||
// The incoming move from the opponent.
|
||||
move_incoming: move.leo/move.record,
|
||||
// The u64 equivalent of the bitwise representation of the next coordinate to play on the opponent's board.
|
||||
shoot: u64,
|
||||
) -> (board.leo/board_state.record, move.leo/move.record) {
|
||||
// Verify the board has been started. This prevents players from starting a game and then creating
|
||||
// a brand new board to play with.
|
||||
console.assert(board.game_started);
|
||||
|
||||
// Validate that the move players and board players match each other.
|
||||
console.assert_eq(board.player_1, move_incoming.player_2);
|
||||
console.assert_eq(board.player_2, move_incoming.player_1);
|
||||
|
||||
// Play coordinate on own board. Will fail if not a valid move.
|
||||
let hit_or_miss: board_state = board.leo/update_played_tiles(board, shoot);
|
||||
|
||||
// Update own board with result of last shot.
|
||||
let next_board: board_state = board.leo/update_hits_and_misses(hit_or_miss, move_incoming.prev_hit_or_miss);
|
||||
|
||||
// Assess whether incoming fire coordinate is a hit.
|
||||
let is_hit: u64 = move_incoming.incoming_fire_coordinate & board.ships;
|
||||
|
||||
let next_move: move = move.leo/create_move(move_incoming, shoot, is_hit);
|
||||
|
||||
return (next_board, next_move);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns an updated board state record that has been started. This board cannot be used to start any other games.
|
||||
// Returns a dummy move record owned by the opponent.
|
||||
// This function commits a given board to a game with an opponent and creates the initial dummy move.
|
||||
@program
|
||||
function offer_battleship(
|
||||
// The board record to start a game with.
|
||||
board: board.leo/board_state.record,
|
||||
) -> (board.leo/board_state.record, move.leo/move.record) {
|
||||
let state: board_state = board.leo/start_board(board);
|
||||
let dummy: move = move.leo/start_game(board.player_2);
|
||||
|
||||
return (state, dummy);
|
||||
}
|
||||
|
||||
// Returns updated board_state.record that has been started and can no longer be used to join or start new games.
|
||||
// Returns dummy move record owned by the opponent.
|
||||
@program
|
||||
function start_battleship(
|
||||
// The board record to play the game with.
|
||||
board: board.leo/board_state.record,
|
||||
// The move record to play to begin the game. This should be the dummy move record created from offer_battleship.
|
||||
move_start: move.leo/move.record,
|
||||
) -> (board.leo/board_state.record, move.leo/move.record) {
|
||||
// Validate that the move players and board players match each other.
|
||||
console.assert_eq(board.player_1, move_start.player_2);
|
||||
console.assert_eq(board.player_2, move_start.player_1);
|
||||
|
||||
let state: board_state = board.leo/start_board(board);
|
||||
let dummy: move = move.leo/start_game(board.player_2);
|
||||
|
||||
return (state, dummy);
|
||||
}
|
||||
|
||||
// Returns updated board record.
|
||||
// Returns new move record owned by opponent.
|
||||
@program
|
||||
function play(
|
||||
// The board record to update.
|
||||
board: board.leo/board_state.record,
|
||||
// The incoming move from the opponent.
|
||||
move_incoming: move.leo/move.record,
|
||||
// The u64 equivalent of the bitwise representation of the next coordinate to play on the opponent's board.
|
||||
shoot: u64,
|
||||
) -> (board.leo/board_state.record, move.leo/move.record) {
|
||||
// Verify the board has been started. This prevents players from starting a game and then creating
|
||||
// a brand new board to play with.
|
||||
console.assert(board.game_started);
|
||||
|
||||
// Validate that the move players and board players match each other.
|
||||
console.assert_eq(board.player_1, move_incoming.player_2);
|
||||
console.assert_eq(board.player_2, move_incoming.player_1);
|
||||
|
||||
// Play coordinate on own board. Will fail if not a valid move.
|
||||
let hit_or_miss: board_state = board.leo/update_played_tiles(board, shoot);
|
||||
|
||||
// Update own board with result of last shot.
|
||||
let next_board: board_state = board.leo/update_hits_and_misses(hit_or_miss, move_incoming.prev_hit_or_miss);
|
||||
|
||||
// Assess whether incoming fire coordinate is a hit.
|
||||
let is_hit: u64 = move_incoming.incoming_fire_coordinate & board.ships;
|
||||
|
||||
let next_move: move = move.leo/create_move(move_incoming, shoot, is_hit);
|
||||
|
||||
return (next_board, next_move);
|
||||
}
|
@ -1,286 +1,287 @@
|
||||
// Executes the bubble sorting algorithm.
|
||||
// The original algorithm is given below.
|
||||
//
|
||||
// for i in 0..7 {
|
||||
// for j in 0..7-i {
|
||||
// // Move the smaller elements forward
|
||||
// if arr[j+1] < arr[j] {
|
||||
// // Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
// let swap = arr[j];
|
||||
// arr[j] = arr[j+1];
|
||||
// arr[j+1] = swap;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Note that the implementation below uses tuples instead of arrays.
|
||||
// The implementation also manually unrolls the loop.
|
||||
program bubblesort.aleo {
|
||||
// Executes the bubble sorting algorithm.
|
||||
// The original algorithm is given below.
|
||||
//
|
||||
// for i in 0..7 {
|
||||
// for j in 0..7-i {
|
||||
// // Move the smaller elements forward
|
||||
// if arr[j+1] < arr[j] {
|
||||
// // Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
// let swap = arr[j];
|
||||
// arr[j] = arr[j+1];
|
||||
// arr[j+1] = swap;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Note that the implementation below uses tuples instead of arrays.
|
||||
// The implementation also manually unrolls the loop.
|
||||
|
||||
@program
|
||||
function bubble_sort(
|
||||
arr0: u32,
|
||||
arr1: u32,
|
||||
arr2: u32,
|
||||
arr3: u32,
|
||||
arr4: u32,
|
||||
arr5: u32,
|
||||
arr6: u32,
|
||||
arr7: u32,
|
||||
) -> (u32, u32, u32, u32, u32, u32, u32, u32) {
|
||||
transition bubble_sort(
|
||||
arr0: u32,
|
||||
arr1: u32,
|
||||
arr2: u32,
|
||||
arr3: u32,
|
||||
arr4: u32,
|
||||
arr5: u32,
|
||||
arr6: u32,
|
||||
arr7: u32,
|
||||
) -> (u32, u32, u32, u32, u32, u32, u32, u32) {
|
||||
|
||||
// Unroll the loops.
|
||||
// Unroll the loops.
|
||||
|
||||
// (i, j) = (0, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
// (i, j) = (0, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 4).
|
||||
// Move the smaller elements forward.
|
||||
if arr5 < arr4 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr4;
|
||||
arr4 = arr5;
|
||||
arr5 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 5).
|
||||
// Move the smaller elements forward.
|
||||
if arr6 < arr5 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr5;
|
||||
arr5 = arr6;
|
||||
arr6 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 6).
|
||||
// Move the smaller elements forward.
|
||||
if arr7 < arr6 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr6;
|
||||
arr6 = arr7;
|
||||
arr7 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 4).
|
||||
// Move the smaller elements forward.
|
||||
if arr5 < arr4 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr4;
|
||||
arr4 = arr5;
|
||||
arr5 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 5).
|
||||
// Move the smaller elements forward.
|
||||
if arr6 < arr5 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr5;
|
||||
arr5 = arr6;
|
||||
arr6 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 4).
|
||||
// Move the smaller elements forward.
|
||||
if arr5 < arr4 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr4;
|
||||
arr4 = arr5;
|
||||
arr5 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (4, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (4, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (4, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (5, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (5, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (6, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
return (arr0, arr1, arr2, arr3, arr4, arr5, arr6, arr7);
|
||||
}
|
||||
|
||||
// (i, j) = (0, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 4).
|
||||
// Move the smaller elements forward.
|
||||
if arr5 < arr4 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr4;
|
||||
arr4 = arr5;
|
||||
arr5 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 5).
|
||||
// Move the smaller elements forward.
|
||||
if arr6 < arr5 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr5;
|
||||
arr5 = arr6;
|
||||
arr6 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (0, 6).
|
||||
// Move the smaller elements forward.
|
||||
if arr7 < arr6 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr6;
|
||||
arr6 = arr7;
|
||||
arr7 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 4).
|
||||
// Move the smaller elements forward.
|
||||
if arr5 < arr4 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr4;
|
||||
arr4 = arr5;
|
||||
arr5 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (1, 5).
|
||||
// Move the smaller elements forward.
|
||||
if arr6 < arr5 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr5;
|
||||
arr5 = arr6;
|
||||
arr6 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (2, 4).
|
||||
// Move the smaller elements forward.
|
||||
if arr5 < arr4 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr4;
|
||||
arr4 = arr5;
|
||||
arr5 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (3, 3).
|
||||
// Move the smaller elements forward.
|
||||
if arr4 < arr3 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr3;
|
||||
arr3 = arr4;
|
||||
arr4 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (4, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (4, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (4, 2).
|
||||
// Move the smaller elements forward.
|
||||
if arr3 < arr2 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr2;
|
||||
arr2 = arr3;
|
||||
arr3 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (5, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (5, 1).
|
||||
// Move the smaller elements forward.
|
||||
if arr2 < arr1 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr1;
|
||||
arr1 = arr2;
|
||||
arr2 = temp;
|
||||
}
|
||||
|
||||
// (i, j) = (6, 0).
|
||||
// Move the smaller elements forward.
|
||||
if arr1 < arr0 {
|
||||
// Swap the elements at indexes ‘j‘ and ‘j+1‘
|
||||
let temp: u32 = arr0;
|
||||
arr0 = arr1;
|
||||
arr1 = temp;
|
||||
}
|
||||
|
||||
return (arr0, arr1, arr2, arr3, arr4, arr5, arr6, arr7);
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
// This function takes as input a field `a` and calls several core circuit functions.
|
||||
// Core circuit functions are built-in to the Leo language and call handwritten, optimized circuits in the AVM.
|
||||
// To call a core circuit function, use the correct capitalized circuit identifier followed by two colons
|
||||
// and then the function. Example: `Pedersen64::hash()`.
|
||||
@program
|
||||
function main(a: field) -> field {
|
||||
let b: field = BHP256::hash(a);
|
||||
let c: field = Poseidon2::hash(b);
|
||||
let d: field = BHP256::commit(c, 1scalar);
|
||||
return d;
|
||||
program core.aleo {
|
||||
// This function takes as input a field `a` and calls several core functions.
|
||||
// Core functions are built-in to the Leo language and call handwritten, optimized circuits in the AVM.
|
||||
// To call a core function, use the correct capitalized identifier followed by two colons
|
||||
// and then the function name. Example: `Pedersen64::hash()`.
|
||||
transition main(a: field) -> field {
|
||||
let b: field = BHP256::hash(a);
|
||||
let c: field = Poseidon2::hash(b);
|
||||
let d: field = BHP256::commit(c, 1scalar);
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,16 @@
|
||||
// This function takes a group coordinate as input `a` and performs several operations which should output the `0group`.
|
||||
// Note that the operations can be called as associated functions on the `a` variable.
|
||||
program groups.aleo {
|
||||
// This function takes a group coordinate as input `a` and performs several operations which should output the `0group`.
|
||||
// Note that the operations can be called as associated functions on the `a` variable.
|
||||
|
||||
@program
|
||||
function main(a: group) -> group {
|
||||
// unary
|
||||
let e: group = a.double(); // 2a
|
||||
let g: group = e.neg(); // -2a
|
||||
|
||||
// binary
|
||||
let j: group = (a * 2scalar).add(g);
|
||||
transition main(a: group) -> group {
|
||||
// unary
|
||||
let e: group = a.double(); // 2a
|
||||
let g: group = e.neg(); // -2a
|
||||
|
||||
return j;
|
||||
// binary
|
||||
let j: group = (a * 2scalar).add(g);
|
||||
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,53 +1,54 @@
|
||||
// The 'ntzdebruijn' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-26
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
if x == 0u32 {return 32u8;}
|
||||
// 0x04D7651F = 81224991
|
||||
x = (x & 0u32.sub_wrapped(x)).mul_wrapped(81224991u32);
|
||||
let i: u32 = x >> 27u8;
|
||||
return deBruijnTableLookup(i);
|
||||
}
|
||||
|
||||
// { 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26,
|
||||
// 31,23,18, 5,21, 9,15,11, 30,17, 8,14,29,13,28,27};
|
||||
|
||||
function deBruijnTableLookup(i: u32) -> u8 {
|
||||
|
||||
if i == 0u32 {return 0u8;} else
|
||||
if i == 1u32 {return 1u8;} else
|
||||
if i == 2u32 {return 2u8;} else
|
||||
if i == 3u32 {return 24u8;} else
|
||||
if i == 4u32 {return 3u8;} else
|
||||
if i == 5u32 {return 19u8;} else
|
||||
if i == 6u32 {return 6u8;} else
|
||||
if i == 7u32 {return 25u8;} else
|
||||
|
||||
if i == 8u32 {return 22u8;} else
|
||||
if i == 9u32 {return 4u8;} else
|
||||
if i == 10u32 {return 20u8;} else
|
||||
if i == 11u32 {return 10u8;} else
|
||||
if i == 12u32 {return 16u8;} else
|
||||
if i == 13u32 {return 7u8;} else
|
||||
if i == 14u32 {return 12u8;} else
|
||||
if i == 15u32 {return 26u8;} else
|
||||
|
||||
if i == 16u32 {return 31u8;} else
|
||||
if i == 17u32 {return 23u8;} else
|
||||
if i == 18u32 {return 18u8;} else
|
||||
if i == 19u32 {return 5u8;} else
|
||||
if i == 20u32 {return 21u8;} else
|
||||
if i == 21u32 {return 9u8;} else
|
||||
if i == 22u32 {return 15u8;} else
|
||||
if i == 23u32 {return 11u8;} else
|
||||
|
||||
if i == 24u32 {return 30u8;} else
|
||||
if i == 25u32 {return 17u8;} else
|
||||
if i == 26u32 {return 8u8;} else
|
||||
if i == 27u32 {return 14u8;} else
|
||||
if i == 28u32 {return 29u8;} else
|
||||
if i == 29u32 {return 13u8;} else
|
||||
if i == 30u32 {return 28u8;} else
|
||||
if i == 31u32 {return 27u8;} else
|
||||
{return 0u8;} // unused
|
||||
program ntzdebrujin.aleo {
|
||||
// The 'ntzdebruijn' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-26
|
||||
transition main(public x: u32) -> u8 {
|
||||
if x == 0u32 {return 32u8;}
|
||||
// 0x04D7651F = 81224991
|
||||
x = (x & 0u32.sub_wrapped(x)).mul_wrapped(81224991u32);
|
||||
let i: u32 = x >> 27u8;
|
||||
return deBruijnTableLookup(i);
|
||||
}
|
||||
|
||||
// { 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26,
|
||||
// 31,23,18, 5,21, 9,15,11, 30,17, 8,14,29,13,28,27};
|
||||
|
||||
function deBruijnTableLookup(i: u32) -> u8 {
|
||||
|
||||
if i == 0u32 {return 0u8;} else
|
||||
if i == 1u32 {return 1u8;} else
|
||||
if i == 2u32 {return 2u8;} else
|
||||
if i == 3u32 {return 24u8;} else
|
||||
if i == 4u32 {return 3u8;} else
|
||||
if i == 5u32 {return 19u8;} else
|
||||
if i == 6u32 {return 6u8;} else
|
||||
if i == 7u32 {return 25u8;} else
|
||||
|
||||
if i == 8u32 {return 22u8;} else
|
||||
if i == 9u32 {return 4u8;} else
|
||||
if i == 10u32 {return 20u8;} else
|
||||
if i == 11u32 {return 10u8;} else
|
||||
if i == 12u32 {return 16u8;} else
|
||||
if i == 13u32 {return 7u8;} else
|
||||
if i == 14u32 {return 12u8;} else
|
||||
if i == 15u32 {return 26u8;} else
|
||||
|
||||
if i == 16u32 {return 31u8;} else
|
||||
if i == 17u32 {return 23u8;} else
|
||||
if i == 18u32 {return 18u8;} else
|
||||
if i == 19u32 {return 5u8;} else
|
||||
if i == 20u32 {return 21u8;} else
|
||||
if i == 21u32 {return 9u8;} else
|
||||
if i == 22u32 {return 15u8;} else
|
||||
if i == 23u32 {return 11u8;} else
|
||||
|
||||
if i == 24u32 {return 30u8;} else
|
||||
if i == 25u32 {return 17u8;} else
|
||||
if i == 26u32 {return 8u8;} else
|
||||
if i == 27u32 {return 14u8;} else
|
||||
if i == 28u32 {return 29u8;} else
|
||||
if i == 29u32 {return 13u8;} else
|
||||
if i == 30u32 {return 28u8;} else
|
||||
if i == 31u32 {return 27u8;} else
|
||||
{return 0u8;} // unused
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,19 @@
|
||||
// The 'ntzgaudet' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-24
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
let y: u32 = x & 0u32.sub_wrapped(x); // Isolate rightmost 1-bit
|
||||
let bz: u8 = (y != 0u32) ? 0u8 : 1u8;
|
||||
// 0x0000FFFF = 65535
|
||||
let b4: u8 = (y & 65535u32 != 0u32) ? 0u8 : 16u8;
|
||||
// 0x00FF00FF = 16711935
|
||||
let b3: u8 = (y & 16711935u32 != 0u32) ? 0u8 : 8u8;
|
||||
// 0x0F0F0F0F = 252645135
|
||||
let b2: u8 = (y & 252645135u32 != 0u32) ? 0u8 : 4u8;
|
||||
// 0x33333333 = 858993459
|
||||
let b1: u8 = (y & 858993459u32 != 0u32) ? 0u8 : 2u8;
|
||||
// 0x55555555 = 1431655765
|
||||
let b0: u8 = (y & 1431655765u32 != 0u32) ? 0u8 : 1u8;
|
||||
return bz + b4 + b3 + b2 + b1 + b0;
|
||||
program ntzgaudet.aleo {
|
||||
// The 'ntzgaudet' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-24
|
||||
transition main(public x: u32) -> u8 {
|
||||
let y: u32 = x & 0u32.sub_wrapped(x); // Isolate rightmost 1-bit
|
||||
let bz: u8 = (y != 0u32) ? 0u8 : 1u8;
|
||||
// 0x0000FFFF = 65535
|
||||
let b4: u8 = (y & 65535u32 != 0u32) ? 0u8 : 16u8;
|
||||
// 0x00FF00FF = 16711935
|
||||
let b3: u8 = (y & 16711935u32 != 0u32) ? 0u8 : 8u8;
|
||||
// 0x0F0F0F0F = 252645135
|
||||
let b2: u8 = (y & 252645135u32 != 0u32) ? 0u8 : 4u8;
|
||||
// 0x33333333 = 858993459
|
||||
let b1: u8 = (y & 858993459u32 != 0u32) ? 0u8 : 2u8;
|
||||
// 0x55555555 = 1431655765
|
||||
let b0: u8 = (y & 1431655765u32 != 0u32) ? 0u8 : 1u8;
|
||||
return bz + b4 + b3 + b2 + b1 + b0;
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
// The 'ntzloops' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-23
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
x = !x & x.sub_wrapped(1u32);
|
||||
let n: u8 = 0u8;
|
||||
for i:u8 in 0u8..32u8 {
|
||||
if x != 0u32 {
|
||||
n += 1u8;
|
||||
x = x >> 1u8;
|
||||
program ntzloops.aleo {
|
||||
// The 'ntzloops' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-23
|
||||
transition main(public x: u32) -> u8 {
|
||||
x = !x & x.sub_wrapped(1u32);
|
||||
let n: u8 = 0u8;
|
||||
for i:u8 in 0u8..32u8 {
|
||||
if x != 0u32 {
|
||||
n += 1u8;
|
||||
x = x >> 1u8;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
@ -1,16 +1,17 @@
|
||||
// The 'ntzmasks' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-20
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
if (x == 0u32) {return 32u8;}
|
||||
let n: u8 = 1u8;
|
||||
// x >>= 16u8 wasn't working, and I don't want to use
|
||||
// to u32 as a shift operand, so I do x = x >> 16u8
|
||||
if ((x & 65535u32) == 0u32) {n += 16u8; x = x >> 16u8;}
|
||||
if ((x & 255u32) == 0u32) {n += 8u8; x = x >> 8u8;}
|
||||
if ((x & 15u32) == 0u32) {n += 4u8; x = x >> 4u8;}
|
||||
if ((x & 3u32) == 0u32) {n += 2u8; x = x >> 2u8;}
|
||||
// can't do `return n - (x & 1u32);` because no typecasts, so:
|
||||
if ((x & 1u32) == 1u32) {n -= 1u8;}
|
||||
return n;
|
||||
program ntzmasks.aleo {
|
||||
// The 'ntzmasks' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-20
|
||||
transition main(public x: u32) -> u8 {
|
||||
if (x == 0u32) {return 32u8;}
|
||||
let n: u8 = 1u8;
|
||||
// x >>= 16u8 wasn't working, and I don't want to use
|
||||
// to u32 as a shift operand, so I do x = x >> 16u8
|
||||
if ((x & 65535u32) == 0u32) {n += 16u8; x = x >> 16u8;}
|
||||
if ((x & 255u32) == 0u32) {n += 8u8; x = x >> 8u8;}
|
||||
if ((x & 15u32) == 0u32) {n += 4u8; x = x >> 4u8;}
|
||||
if ((x & 3u32) == 0u32) {n += 2u8; x = x >> 2u8;}
|
||||
// can't do `return n - (x & 1u32);` because no typecasts, so:
|
||||
if ((x & 1u32) == 1u32) {n -= 1u8;}
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
@ -1,59 +1,60 @@
|
||||
// The 'ntzreisers' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-27
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
x = (x & 0u32.sub_wrapped(x)).rem_wrapped(37u32);
|
||||
return reisersTableLookup(x);
|
||||
}
|
||||
|
||||
// There are 37 entries here
|
||||
// {32, 0, 1, 26, 2, 23, 27,
|
||||
// u, 3, 16, 24, 30, 28, 11, u, 13, 4,
|
||||
// 7, 17, u, 25, 22, 31, 15, 29, 10, 12,
|
||||
// 6, u, 21, 14, 9, 5, 20, 8, 19, 18};
|
||||
|
||||
function reisersTableLookup(i: u32) -> u8 {
|
||||
|
||||
if i == 0u32 {return 32u8;} else
|
||||
if i == 1u32 {return 0u8;} else
|
||||
if i == 2u32 {return 1u8;} else
|
||||
if i == 3u32 {return 26u8;} else
|
||||
if i == 4u32 {return 2u8;} else
|
||||
if i == 5u32 {return 23u8;} else
|
||||
if i == 6u32 {return 27u8;} else
|
||||
|
||||
if i == 7u32 {return 0u8;} else // unused
|
||||
if i == 8u32 {return 3u8;} else
|
||||
if i == 9u32 {return 16u8;} else
|
||||
if i == 10u32 {return 24u8;} else
|
||||
if i == 11u32 {return 30u8;} else
|
||||
if i == 12u32 {return 28u8;} else
|
||||
if i == 13u32 {return 11u8;} else
|
||||
if i == 14u32 {return 0u8;} else // unused
|
||||
if i == 15u32 {return 13u8;} else
|
||||
if i == 16u32 {return 4u8;} else
|
||||
|
||||
if i == 17u32 {return 7u8;} else
|
||||
if i == 18u32 {return 17u8;} else
|
||||
if i == 19u32 {return 0u8;} else // unused
|
||||
if i == 20u32 {return 25u8;} else
|
||||
if i == 21u32 {return 22u8;} else
|
||||
if i == 22u32 {return 31u8;} else
|
||||
if i == 23u32 {return 15u8;} else
|
||||
if i == 24u32 {return 29u8;} else
|
||||
if i == 25u32 {return 10u8;} else
|
||||
if i == 26u32 {return 12u8;} else
|
||||
|
||||
if i == 27u32 {return 6u8;} else
|
||||
if i == 28u32 {return 0u8;} else // unused
|
||||
if i == 29u32 {return 21u8;} else
|
||||
if i == 30u32 {return 14u8;} else
|
||||
if i == 31u32 {return 9u8;} else
|
||||
if i == 32u32 {return 5u8;} else
|
||||
if i == 33u32 {return 20u8;} else
|
||||
if i == 34u32 {return 8u8;} else
|
||||
if i == 35u32 {return 19u8;} else
|
||||
if i == 36u32 {return 18u8;} else
|
||||
|
||||
{return 0u8;} // unused
|
||||
program ntzreisers.aleo {
|
||||
// The 'ntzreisers' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-27
|
||||
transition main(public x: u32) -> u8 {
|
||||
x = (x & 0u32.sub_wrapped(x)).rem_wrapped(37u32);
|
||||
return reisersTableLookup(x);
|
||||
}
|
||||
|
||||
// There are 37 entries here
|
||||
// {32, 0, 1, 26, 2, 23, 27,
|
||||
// u, 3, 16, 24, 30, 28, 11, u, 13, 4,
|
||||
// 7, 17, u, 25, 22, 31, 15, 29, 10, 12,
|
||||
// 6, u, 21, 14, 9, 5, 20, 8, 19, 18};
|
||||
|
||||
function reisersTableLookup(i: u32) -> u8 {
|
||||
|
||||
if i == 0u32 {return 32u8;} else
|
||||
if i == 1u32 {return 0u8;} else
|
||||
if i == 2u32 {return 1u8;} else
|
||||
if i == 3u32 {return 26u8;} else
|
||||
if i == 4u32 {return 2u8;} else
|
||||
if i == 5u32 {return 23u8;} else
|
||||
if i == 6u32 {return 27u8;} else
|
||||
|
||||
if i == 7u32 {return 0u8;} else // unused
|
||||
if i == 8u32 {return 3u8;} else
|
||||
if i == 9u32 {return 16u8;} else
|
||||
if i == 10u32 {return 24u8;} else
|
||||
if i == 11u32 {return 30u8;} else
|
||||
if i == 12u32 {return 28u8;} else
|
||||
if i == 13u32 {return 11u8;} else
|
||||
if i == 14u32 {return 0u8;} else // unused
|
||||
if i == 15u32 {return 13u8;} else
|
||||
if i == 16u32 {return 4u8;} else
|
||||
|
||||
if i == 17u32 {return 7u8;} else
|
||||
if i == 18u32 {return 17u8;} else
|
||||
if i == 19u32 {return 0u8;} else // unused
|
||||
if i == 20u32 {return 25u8;} else
|
||||
if i == 21u32 {return 22u8;} else
|
||||
if i == 22u32 {return 31u8;} else
|
||||
if i == 23u32 {return 15u8;} else
|
||||
if i == 24u32 {return 29u8;} else
|
||||
if i == 25u32 {return 10u8;} else
|
||||
if i == 26u32 {return 12u8;} else
|
||||
|
||||
if i == 27u32 {return 6u8;} else
|
||||
if i == 28u32 {return 0u8;} else // unused
|
||||
if i == 29u32 {return 21u8;} else
|
||||
if i == 30u32 {return 14u8;} else
|
||||
if i == 31u32 {return 9u8;} else
|
||||
if i == 32u32 {return 5u8;} else
|
||||
if i == 33u32 {return 20u8;} else
|
||||
if i == 34u32 {return 8u8;} else
|
||||
if i == 35u32 {return 19u8;} else
|
||||
if i == 36u32 {return 18u8;} else
|
||||
|
||||
{return 0u8;} // unused
|
||||
}
|
||||
}
|
||||
|
@ -1,91 +1,92 @@
|
||||
// The 'nztseals' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-25
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
// 0x0450FBAF = 72416175
|
||||
x = (x & 0u32.sub_wrapped(x)).mul_wrapped(72416175u32);
|
||||
return sealsTableLookup(x >> 26u8);
|
||||
}
|
||||
|
||||
// Right now we do not have any structure that allows
|
||||
// computable indexing, so simulate that with a function.
|
||||
// {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14,
|
||||
// 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15,
|
||||
// 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26,
|
||||
// 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u};
|
||||
|
||||
function sealsTableLookup(i: u32) -> u8 {
|
||||
|
||||
if i == 0u32 {return 32u8;} else
|
||||
if i == 1u32 {return 0u8;} else
|
||||
if i == 2u32 {return 1u8;} else
|
||||
if i == 3u32 {return 12u8;} else
|
||||
if i == 4u32 {return 2u8;} else
|
||||
if i == 5u32 {return 6u8;} else
|
||||
if i == 6u32 {return 0u8;} else // unused
|
||||
if i == 7u32 {return 13u8;} else
|
||||
|
||||
if i == 8u32 {return 3u8;} else
|
||||
if i == 9u32 {return 0u8;} else // unused
|
||||
if i == 10u32 {return 7u8;} else
|
||||
if i == 11u32 {return 0u8;} else // unused
|
||||
if i == 12u32 {return 0u8;} else // unused
|
||||
if i == 13u32 {return 0u8;} else // unused
|
||||
if i == 14u32 {return 0u8;} else // unused
|
||||
if i == 15u32 {return 14u8;} else
|
||||
|
||||
if i == 16u32 {return 10u8;} else
|
||||
if i == 17u32 {return 4u8;} else
|
||||
if i == 18u32 {return 0u8;} else // unused
|
||||
if i == 19u32 {return 0u8;} else // unused
|
||||
if i == 20u32 {return 8u8;} else
|
||||
if i == 21u32 {return 0u8;} else // unused
|
||||
if i == 22u32 {return 0u8;} else // unused
|
||||
if i == 23u32 {return 25u8;} else
|
||||
|
||||
if i == 24u32 {return 0u8;} else // unused
|
||||
if i == 25u32 {return 0u8;} else // unused
|
||||
if i == 26u32 {return 0u8;} else // unused
|
||||
if i == 27u32 {return 0u8;} else // unused
|
||||
if i == 28u32 {return 0u8;} else // unused
|
||||
if i == 29u32 {return 21u8;} else
|
||||
if i == 30u32 {return 27u8;} else
|
||||
if i == 31u32 {return 15u8;} else
|
||||
|
||||
if i == 32u32 {return 31u8;} else
|
||||
if i == 33u32 {return 11u8;} else
|
||||
if i == 34u32 {return 5u8;} else
|
||||
if i == 35u32 {return 0u8;} else // unused
|
||||
if i == 36u32 {return 0u8;} else // unused
|
||||
if i == 37u32 {return 0u8;} else // unused
|
||||
if i == 38u32 {return 0u8;} else // unused
|
||||
if i == 39u32 {return 0u8;} else // unused
|
||||
|
||||
if i == 40u32 {return 9u8;} else
|
||||
if i == 41u32 {return 0u8;} else // unused
|
||||
if i == 42u32 {return 0u8;} else // unused
|
||||
if i == 43u32 {return 24u8;} else
|
||||
if i == 44u32 {return 0u8;} else // unused
|
||||
if i == 45u32 {return 0u8;} else // unused
|
||||
if i == 46u32 {return 20u8;} else
|
||||
if i == 47u32 {return 26u8;} else
|
||||
|
||||
if i == 48u32 {return 30u8;} else
|
||||
if i == 49u32 {return 0u8;} else // unused
|
||||
if i == 50u32 {return 0u8;} else // unused
|
||||
if i == 51u32 {return 0u8;} else // unused
|
||||
if i == 52u32 {return 0u8;} else // unused
|
||||
if i == 53u32 {return 23u8;} else
|
||||
if i == 54u32 {return 0u8;} else // unused
|
||||
if i == 55u32 {return 19u8;} else
|
||||
|
||||
if i == 56u32 {return 29u8;} else
|
||||
if i == 57u32 {return 0u8;} else // unused
|
||||
if i == 58u32 {return 22u8;} else
|
||||
if i == 59u32 {return 18u8;} else
|
||||
if i == 60u32 {return 28u8;} else
|
||||
if i == 61u32 {return 17u8;} else
|
||||
if i == 62u32 {return 16u8;} else
|
||||
if i == 63u32 {return 0u8;} else // unused
|
||||
{return 0u8;} // unused
|
||||
program ntzseals.aleo {
|
||||
// The 'nztseals' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-25
|
||||
transition main(public x: u32) -> u8 {
|
||||
// 0x0450FBAF = 72416175
|
||||
x = (x & 0u32.sub_wrapped(x)).mul_wrapped(72416175u32);
|
||||
return sealsTableLookup(x >> 26u8);
|
||||
}
|
||||
|
||||
// Right now we do not have any structure that allows
|
||||
// computable indexing, so simulate that with a function.
|
||||
// {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14,
|
||||
// 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15,
|
||||
// 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26,
|
||||
// 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u};
|
||||
|
||||
function sealsTableLookup(i: u32) -> u8 {
|
||||
|
||||
if i == 0u32 {return 32u8;} else
|
||||
if i == 1u32 {return 0u8;} else
|
||||
if i == 2u32 {return 1u8;} else
|
||||
if i == 3u32 {return 12u8;} else
|
||||
if i == 4u32 {return 2u8;} else
|
||||
if i == 5u32 {return 6u8;} else
|
||||
if i == 6u32 {return 0u8;} else // unused
|
||||
if i == 7u32 {return 13u8;} else
|
||||
|
||||
if i == 8u32 {return 3u8;} else
|
||||
if i == 9u32 {return 0u8;} else // unused
|
||||
if i == 10u32 {return 7u8;} else
|
||||
if i == 11u32 {return 0u8;} else // unused
|
||||
if i == 12u32 {return 0u8;} else // unused
|
||||
if i == 13u32 {return 0u8;} else // unused
|
||||
if i == 14u32 {return 0u8;} else // unused
|
||||
if i == 15u32 {return 14u8;} else
|
||||
|
||||
if i == 16u32 {return 10u8;} else
|
||||
if i == 17u32 {return 4u8;} else
|
||||
if i == 18u32 {return 0u8;} else // unused
|
||||
if i == 19u32 {return 0u8;} else // unused
|
||||
if i == 20u32 {return 8u8;} else
|
||||
if i == 21u32 {return 0u8;} else // unused
|
||||
if i == 22u32 {return 0u8;} else // unused
|
||||
if i == 23u32 {return 25u8;} else
|
||||
|
||||
if i == 24u32 {return 0u8;} else // unused
|
||||
if i == 25u32 {return 0u8;} else // unused
|
||||
if i == 26u32 {return 0u8;} else // unused
|
||||
if i == 27u32 {return 0u8;} else // unused
|
||||
if i == 28u32 {return 0u8;} else // unused
|
||||
if i == 29u32 {return 21u8;} else
|
||||
if i == 30u32 {return 27u8;} else
|
||||
if i == 31u32 {return 15u8;} else
|
||||
|
||||
if i == 32u32 {return 31u8;} else
|
||||
if i == 33u32 {return 11u8;} else
|
||||
if i == 34u32 {return 5u8;} else
|
||||
if i == 35u32 {return 0u8;} else // unused
|
||||
if i == 36u32 {return 0u8;} else // unused
|
||||
if i == 37u32 {return 0u8;} else // unused
|
||||
if i == 38u32 {return 0u8;} else // unused
|
||||
if i == 39u32 {return 0u8;} else // unused
|
||||
|
||||
if i == 40u32 {return 9u8;} else
|
||||
if i == 41u32 {return 0u8;} else // unused
|
||||
if i == 42u32 {return 0u8;} else // unused
|
||||
if i == 43u32 {return 24u8;} else
|
||||
if i == 44u32 {return 0u8;} else // unused
|
||||
if i == 45u32 {return 0u8;} else // unused
|
||||
if i == 46u32 {return 20u8;} else
|
||||
if i == 47u32 {return 26u8;} else
|
||||
|
||||
if i == 48u32 {return 30u8;} else
|
||||
if i == 49u32 {return 0u8;} else // unused
|
||||
if i == 50u32 {return 0u8;} else // unused
|
||||
if i == 51u32 {return 0u8;} else // unused
|
||||
if i == 52u32 {return 0u8;} else // unused
|
||||
if i == 53u32 {return 23u8;} else
|
||||
if i == 54u32 {return 0u8;} else // unused
|
||||
if i == 55u32 {return 19u8;} else
|
||||
|
||||
if i == 56u32 {return 29u8;} else
|
||||
if i == 57u32 {return 0u8;} else // unused
|
||||
if i == 58u32 {return 22u8;} else
|
||||
if i == 59u32 {return 18u8;} else
|
||||
if i == 60u32 {return 28u8;} else
|
||||
if i == 61u32 {return 17u8;} else
|
||||
if i == 62u32 {return 16u8;} else
|
||||
if i == 63u32 {return 0u8;} else // unused
|
||||
{return 0u8;} // unused
|
||||
}
|
||||
}
|
||||
|
@ -1,75 +1,76 @@
|
||||
// The 'ntzsearchtree' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-22,
|
||||
// expanded to a 32-bit version.
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
if (x & 65535u32 != 0u32) {
|
||||
if (x & 255u32 != 0u32) {
|
||||
if (x & 15u32 != 0u32) {
|
||||
if (x & 3u32 != 0u32) {
|
||||
if (x & 1u32 != 0u32) {return 0u8;}
|
||||
else {return 1u8;} }
|
||||
else {
|
||||
if (x & 4u32 != 0u32) {return 2u8;}
|
||||
else {return 3u8;} } }
|
||||
else { // low 4 bits are 0 but low 8 bits are not zero
|
||||
if (x & 48u32 != 0u32) { // 48 = 0011 0000
|
||||
if (x & 16u32 != 0u32) {return 4u8;}
|
||||
else {return 5u8;} }
|
||||
else {if (x & 64u32 != 0u32) {return 6u8;}
|
||||
else {return 7u8;} } } }
|
||||
else { // low 8 bits are 0 but low 16 bits are not zero
|
||||
// 3840 = 00001111 00000000
|
||||
if (x & 3840u32 != 0u32) {
|
||||
// 768 = 00000011 00000000
|
||||
if (x & 768u32 != 0u32) {
|
||||
if (x & 256u32 != 0u32) {return 8u8;}
|
||||
else {return 9u8;} }
|
||||
else { // 1024 = 00000100 00000000
|
||||
if (x & 1024u32 != 0u32) {return 10u8;}
|
||||
else {return 11u8;} } }
|
||||
else { // low 12 bits are 0 but low 16 bits are not zero
|
||||
// 12288 = 0011 0000 0000 0000
|
||||
if (x & 12288u32 != 0u32) {
|
||||
// 4096 = 0001 0000 0000 0000
|
||||
if (x & 4096u32 != 0u32) {return 12u8;}
|
||||
else {return 13u8;} }
|
||||
else { // low 14 bits are 0 but low 16 bits are not zero
|
||||
// 16384 = 0100 0000 0000 0000
|
||||
if (x & 16384u32 != 0u32) {return 14u8;}
|
||||
else {return 15u8;} } } } }
|
||||
else { // low 16 bits are zero, now look at high 16 bits
|
||||
// Simply by multiplying the previous constants by 65536
|
||||
if (x & (255u32 * 65536u32) != 0u32) {
|
||||
if (x & (15u32 * 65536u32) != 0u32) {
|
||||
if (x & (3u32 * 65536u32) != 0u32) {
|
||||
if (x & (1u32 * 65536u32) != 0u32) {return 16u8;}
|
||||
else {return 17u8;} }
|
||||
else {
|
||||
if (x & (4u32 * 65536u32) != 0u32) {return 18u8;}
|
||||
else {return 19u8;} } }
|
||||
else {
|
||||
if (x & (48u32 * 65536u32) != 0u32) {
|
||||
if (x & (16u32 * 65536u32) != 0u32) {return 20u8;}
|
||||
else {return 21u8;} }
|
||||
else {
|
||||
if (x & (64u32 * 65536u32) != 0u32) {return 22u8;}
|
||||
else {return 23u8;} } } }
|
||||
else {
|
||||
if (x & (3840u32 * 65536u32) != 0u32) {
|
||||
if (x & (768u32 * 65536u32) != 0u32) {
|
||||
if (x & (256u32 * 65536u32) != 0u32) {return 24u8;}
|
||||
else {return 25u8;} }
|
||||
else {
|
||||
if (x & (1024u32 * 65536u32) != 0u32) {return 26u8;}
|
||||
else {return 27u8;} } }
|
||||
else {
|
||||
if (x & (12288u32 * 65536u32) != 0u32) {
|
||||
if (x & (4096u32 * 65536u32) != 0u32) {return 28u8;}
|
||||
else {return 29u8;} }
|
||||
else {
|
||||
if (x & (16384u32 * 65536u32) != 0u32) {return 30u8;}
|
||||
program ntzsearchtree.aleo {
|
||||
// The 'ntzsearchtree' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-22,
|
||||
// expanded to a 32-bit version.
|
||||
transition main(public x: u32) -> u8 {
|
||||
if (x & 65535u32 != 0u32) {
|
||||
if (x & 255u32 != 0u32) {
|
||||
if (x & 15u32 != 0u32) {
|
||||
if (x & 3u32 != 0u32) {
|
||||
if (x & 1u32 != 0u32) {return 0u8;}
|
||||
else {return 1u8;} }
|
||||
else {
|
||||
if (x != 0u32) {return 31u8;}
|
||||
else {return 32u8;} } } } } }
|
||||
if (x & 4u32 != 0u32) {return 2u8;}
|
||||
else {return 3u8;} } }
|
||||
else { // low 4 bits are 0 but low 8 bits are not zero
|
||||
if (x & 48u32 != 0u32) { // 48 = 0011 0000
|
||||
if (x & 16u32 != 0u32) {return 4u8;}
|
||||
else {return 5u8;} }
|
||||
else {if (x & 64u32 != 0u32) {return 6u8;}
|
||||
else {return 7u8;} } } }
|
||||
else { // low 8 bits are 0 but low 16 bits are not zero
|
||||
// 3840 = 00001111 00000000
|
||||
if (x & 3840u32 != 0u32) {
|
||||
// 768 = 00000011 00000000
|
||||
if (x & 768u32 != 0u32) {
|
||||
if (x & 256u32 != 0u32) {return 8u8;}
|
||||
else {return 9u8;} }
|
||||
else { // 1024 = 00000100 00000000
|
||||
if (x & 1024u32 != 0u32) {return 10u8;}
|
||||
else {return 11u8;} } }
|
||||
else { // low 12 bits are 0 but low 16 bits are not zero
|
||||
// 12288 = 0011 0000 0000 0000
|
||||
if (x & 12288u32 != 0u32) {
|
||||
// 4096 = 0001 0000 0000 0000
|
||||
if (x & 4096u32 != 0u32) {return 12u8;}
|
||||
else {return 13u8;} }
|
||||
else { // low 14 bits are 0 but low 16 bits are not zero
|
||||
// 16384 = 0100 0000 0000 0000
|
||||
if (x & 16384u32 != 0u32) {return 14u8;}
|
||||
else {return 15u8;} } } } }
|
||||
else { // low 16 bits are zero, now look at high 16 bits
|
||||
// Simply by multiplying the previous constants by 65536
|
||||
if (x & (255u32 * 65536u32) != 0u32) {
|
||||
if (x & (15u32 * 65536u32) != 0u32) {
|
||||
if (x & (3u32 * 65536u32) != 0u32) {
|
||||
if (x & (1u32 * 65536u32) != 0u32) {return 16u8;}
|
||||
else {return 17u8;} }
|
||||
else {
|
||||
if (x & (4u32 * 65536u32) != 0u32) {return 18u8;}
|
||||
else {return 19u8;} } }
|
||||
else {
|
||||
if (x & (48u32 * 65536u32) != 0u32) {
|
||||
if (x & (16u32 * 65536u32) != 0u32) {return 20u8;}
|
||||
else {return 21u8;} }
|
||||
else {
|
||||
if (x & (64u32 * 65536u32) != 0u32) {return 22u8;}
|
||||
else {return 23u8;} } } }
|
||||
else {
|
||||
if (x & (3840u32 * 65536u32) != 0u32) {
|
||||
if (x & (768u32 * 65536u32) != 0u32) {
|
||||
if (x & (256u32 * 65536u32) != 0u32) {return 24u8;}
|
||||
else {return 25u8;} }
|
||||
else {
|
||||
if (x & (1024u32 * 65536u32) != 0u32) {return 26u8;}
|
||||
else {return 27u8;} } }
|
||||
else {
|
||||
if (x & (12288u32 * 65536u32) != 0u32) {
|
||||
if (x & (4096u32 * 65536u32) != 0u32) {return 28u8;}
|
||||
else {return 29u8;} }
|
||||
else {
|
||||
if (x & (16384u32 * 65536u32) != 0u32) {return 30u8;}
|
||||
else {
|
||||
if (x != 0u32) {return 31u8;}
|
||||
else {return 32u8;} } } } } }
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
// The 'ntzsmallvals' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-21
|
||||
@program
|
||||
function main(public x: u32) -> u8 {
|
||||
if (x == 0u32) {return 32u8;}
|
||||
let n: u8 = 31u8;
|
||||
let y: u32 = x.shl_wrapped(16u8); if (y != 0u32) {n = n - 16u8; x = y;}
|
||||
y = x.shl_wrapped(8u8); if (y != 0u32) {n = n - 8u8; x = y;}
|
||||
y = x.shl_wrapped(4u8); if (y != 0u32) {n = n - 4u8; x = y;}
|
||||
y = x.shl_wrapped(2u8); if (y != 0u32) {n = n - 2u8; x = y;}
|
||||
y = x.shl_wrapped(1u8); if (y != 0u32) {n = n - 1u8;}
|
||||
return n;
|
||||
program ntzsmallvals.aleo {
|
||||
// The 'ntzsmallvals' main function.
|
||||
// From Hacker's Delight 2nd ed. figure 5-21
|
||||
transition main(public x: u32) -> u8 {
|
||||
if (x == 0u32) {return 32u8;}
|
||||
let n: u8 = 31u8;
|
||||
let y: u32 = x.shl_wrapped(16u8); if (y != 0u32) {n = n - 16u8; x = y;}
|
||||
y = x.shl_wrapped(8u8); if (y != 0u32) {n = n - 8u8; x = y;}
|
||||
y = x.shl_wrapped(4u8); if (y != 0u32) {n = n - 4u8; x = y;}
|
||||
y = x.shl_wrapped(2u8); if (y != 0u32) {n = n - 2u8; x = y;}
|
||||
y = x.shl_wrapped(1u8); if (y != 0u32) {n = n - 1u8;}
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
// The 'helloworld' main function.
|
||||
@program
|
||||
function main(public a: u32, b: u32) -> u32 {
|
||||
return a + b;
|
||||
program helloworld.aleo {
|
||||
// The 'helloworld' main function.
|
||||
transition main(public a: u32, b: u32) -> u32 {
|
||||
return a + b;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,37 +1,37 @@
|
||||
// This function calculates the interest accrued
|
||||
// over ten iterations for some `capital` and `rate`.
|
||||
@program
|
||||
function fixed_iteration_interest(capital: u32, public rate: u32) -> u32 {
|
||||
let amount: u32 = capital;
|
||||
program interest.aleo {
|
||||
// This function calculates the interest accrued
|
||||
// over ten iterations for some `capital` and `rate`.
|
||||
transition fixed_iteration_interest(capital: u32, public rate: u32) -> u32 {
|
||||
let amount: u32 = capital;
|
||||
|
||||
// Accrue for exactly 10 iterations.
|
||||
for i:u8 in 0u8..10u8 {
|
||||
// Note that the added amount is rounded down.
|
||||
amount += (amount * rate) / 100u32;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
||||
// This function calculates the interest accrued
|
||||
// over a variable number of iterations (max 50) for some `capital` and `rate`.
|
||||
@program
|
||||
function bounded_iteration_interest(capital: u32,
|
||||
public rate: u32,
|
||||
iterations: u8) -> u32 {
|
||||
console.assert(iterations <= 50u8);
|
||||
let amount: u32 = capital;
|
||||
|
||||
// Accrue for up to 50 iterations.
|
||||
for i:u8 in 0u8..50u8 {
|
||||
if i < iterations {
|
||||
// Accrue for exactly 10 iterations.
|
||||
for i:u8 in 0u8..10u8 {
|
||||
// Note that the added amount is rounded down.
|
||||
amount += (amount * rate) / 100u32;
|
||||
|
||||
} // Skip the remaining iterations.
|
||||
if i == 40u8 {
|
||||
return amount;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
||||
// This function calculates the interest accrued
|
||||
// over a variable number of iterations (max 50) for some `capital` and `rate`.
|
||||
transition bounded_iteration_interest(capital: u32,
|
||||
public rate: u32,
|
||||
iterations: u8) -> u32 {
|
||||
console.assert(iterations <= 50u8);
|
||||
let amount: u32 = capital;
|
||||
|
||||
// Accrue for up to 50 iterations.
|
||||
for i:u8 in 0u8..50u8 {
|
||||
if i < iterations {
|
||||
// Note that the added amount is rounded down.
|
||||
amount += (amount * rate) / 100u32;
|
||||
|
||||
} // Skip the remaining iterations.
|
||||
if i == 40u8 {
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Leo message circuit
|
||||
A basic example showing how to declare a circuit in the Leo language.
|
||||
# Leo message struct
|
||||
A basic example showing how to declare a struct in the Leo language.
|
||||
|
||||
## Build Guide
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// The program input for message/src/main.leo
|
||||
// To pass "m" into the "main" function we
|
||||
// 1. Define the "Message" type.
|
||||
// 2. Use brackets `{ }` to enclose the circuit members.
|
||||
// 3. Define each circuit member `name : value`.
|
||||
// 2. Use brackets `{ }` to enclose the struct members.
|
||||
// 3. Define each struct member `name : value`.
|
||||
[main]
|
||||
m: Message = Message { first: 2field, second: 3field };
|
||||
|
@ -1,28 +1,27 @@
|
||||
// This example demonstrates the definition and initialization of a "circuit" type in Leo.
|
||||
// Circuit types are similar to composite types in other languages such as "struct".
|
||||
// This example demonstrates the definition and initialization of a "struct" in Leo.
|
||||
program message.aleo {
|
||||
// The "Message" struct.
|
||||
struct Message {
|
||||
// A struct member named "first" with type "field".
|
||||
first: field,
|
||||
// A struct member named "second" with type "field".
|
||||
second: field,
|
||||
}
|
||||
|
||||
// The "Message" circuit type.
|
||||
circuit Message {
|
||||
// A circuit member named "first" with type "field".
|
||||
first: field,
|
||||
// A circuit member named "second" with type "field".
|
||||
second: field,
|
||||
}
|
||||
|
||||
// The "main" function of this Leo program takes a "Message" circuit type as input.
|
||||
// To see how to input variable "m" is passed in open up `inputs/message.in`.
|
||||
@program
|
||||
function main(m: Message) -> field {
|
||||
|
||||
// 1. Define the "Message" type.
|
||||
// 2. Use brackets `{ }` to enclose the circuit members.
|
||||
// 3. Define each circuit member `name : value`.
|
||||
let m1: Message = Message {
|
||||
first: m.first,
|
||||
second: m.second,
|
||||
};
|
||||
|
||||
// Access the members of a circuit with dot syntax.
|
||||
// `circuit_name.member`
|
||||
return m1.first + m1.second;
|
||||
// The "main" function of this Leo program takes a "Message" struct type as input.
|
||||
// To see how to input variable "m" is passed in open up `inputs/message.in`.
|
||||
transition main(m: Message) -> field {
|
||||
|
||||
// 1. Define the "Message" type.
|
||||
// 2. Use brackets `{ }` to enclose the struct members.
|
||||
// 3. Define each struct member `name : value`.
|
||||
let m1: Message = Message {
|
||||
first: m.first,
|
||||
second: m.second,
|
||||
};
|
||||
|
||||
// Access the members of a struct with dot syntax.
|
||||
// `struct_name.member`
|
||||
return m1.first + m1.second;
|
||||
}
|
||||
}
|
||||
|
@ -1,51 +1,50 @@
|
||||
// This example demonstrates an example of a minting and transferring a token in Leo.
|
||||
program simple_token.aleo {
|
||||
// The `Token` record datatype.
|
||||
record Token {
|
||||
// The token owner.
|
||||
owner: address,
|
||||
// The Aleo balance (in gates).
|
||||
gates: u64,
|
||||
// The token amount.
|
||||
amount: u64,
|
||||
}
|
||||
|
||||
// The `Token` record datatype.
|
||||
record Token {
|
||||
// The token owner.
|
||||
owner: address,
|
||||
// The Aleo balance (in gates).
|
||||
gates: u64,
|
||||
// The token amount.
|
||||
amount: u64,
|
||||
}
|
||||
|
||||
// The `mint` function initializes a new record with the
|
||||
// specified number of tokens assigned to the specified receiver.
|
||||
@program
|
||||
function mint(owner: address, amount: u64) -> Token {
|
||||
return Token {
|
||||
owner: owner,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
}
|
||||
|
||||
// The `transfer` function sends the specified number of tokens
|
||||
// to the receiver from the provided token record.
|
||||
@program
|
||||
function transfer(token: Token, to: address, amount: u64) -> (Token, Token) {
|
||||
|
||||
// Checks the given token record has sufficient balance.
|
||||
// This `sub` operation is safe, and the proof will fail
|
||||
// if an overflow occurs.
|
||||
// `difference` holds the change amount to be returned to sender.
|
||||
let difference: u64 = token.amount - amount;
|
||||
|
||||
// Produce a token record with the change amount for the sender.
|
||||
let remaining: Token = Token {
|
||||
owner: token.owner,
|
||||
gates: token.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Produce a token record for the specified receiver.
|
||||
let transferred: Token = Token {
|
||||
owner: to,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
|
||||
// Output the sender's change record and the receiver's record.
|
||||
return (remaining, transferred);
|
||||
// The `mint` function initializes a new record with the
|
||||
// specified number of tokens assigned to the specified receiver.
|
||||
transition mint(owner: address, amount: u64) -> Token {
|
||||
return Token {
|
||||
owner: owner,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
}
|
||||
|
||||
// The `transfer` function sends the specified number of tokens
|
||||
// to the receiver from the provided token record.
|
||||
transition transfer(token: Token, to: address, amount: u64) -> (Token, Token) {
|
||||
|
||||
// Checks the given token record has sufficient balance.
|
||||
// This `sub` operation is safe, and the proof will fail
|
||||
// if an overflow occurs.
|
||||
// `difference` holds the change amount to be returned to sender.
|
||||
let difference: u64 = token.amount - amount;
|
||||
|
||||
// Produce a token record with the change amount for the sender.
|
||||
let remaining: Token = Token {
|
||||
owner: token.owner,
|
||||
gates: token.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Produce a token record for the specified receiver.
|
||||
let transferred: Token = Token {
|
||||
owner: to,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
|
||||
// Output the sender's change record and the receiver's record.
|
||||
return (remaining, transferred);
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,12 @@ A standard game of Tic-Tac-Toe in Leo.
|
||||
❌ ❕ ❌ ❕ ⭕
|
||||
|
||||
## Representing State
|
||||
Leo allows users to define composite data types with the `circuit` keyword.
|
||||
The game board is represented by a circuit called `Board`, which contains three `Row`s.
|
||||
Leo allows users to define composite data types with the `struct` keyword.
|
||||
The game board is represented by a struct called `Board`, which contains three `Row`s.
|
||||
An alternative representation would be to use an array, however, these are not yet supported in Leo.
|
||||
|
||||
## Language Features
|
||||
- `circuit` declarations
|
||||
- `struct` declarations
|
||||
- conditional statements
|
||||
- early termination. Leo allows users to return from a function early using the `return` keyword.
|
||||
|
||||
|
@ -1,111 +1,111 @@
|
||||
// A row in a tic tac toe board.
|
||||
// - `c1` : The first entry in the row.
|
||||
// - `c2` : The second entry in the row.
|
||||
// - `c3` : The third entry in the row.
|
||||
// A valid entry is either 0, 1, or 2, where 0 is empty, 1 corresponds to player 1, and 2 corresponds to player 2.
|
||||
// Any other values are invalid.
|
||||
circuit Row {
|
||||
c1: u8,
|
||||
c2: u8,
|
||||
c3: u8
|
||||
}
|
||||
|
||||
// A tic tac toe board.
|
||||
// - `r1` : The first row in the board.
|
||||
// - `r2` : The second row in the board.
|
||||
// - `r3` : The third row in the board.
|
||||
circuit Board {
|
||||
r1: Row,
|
||||
r2: Row,
|
||||
r3: Row,
|
||||
}
|
||||
|
||||
// Returns an empty board.
|
||||
@program
|
||||
function new() -> Board {
|
||||
return Board {
|
||||
r1: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
|
||||
r2: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
|
||||
r3: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
|
||||
};
|
||||
}
|
||||
|
||||
// Returns `true` if there exists a row, column, or diagonal with all entries occupied by the same player.
|
||||
// - `b` : A tic tac toe board.
|
||||
// - `p` : A number corresponding to a player.
|
||||
function check_for_win(b: Board, p: u8) -> bool {
|
||||
return
|
||||
(b.r1.c1 == p && b.r1.c2 == p && b.r1.c3 == p) || // row 1
|
||||
(b.r2.c1 == p && b.r2.c2 == p && b.r2.c3 == p) || // row 2
|
||||
(b.r3.c1 == p && b.r3.c3 == p && b.r3.c3 == p) || // row 3
|
||||
(b.r1.c1 == p && b.r2.c1 == p && b.r3.c1 == p) || // column 1
|
||||
(b.r1.c2 == p && b.r2.c3 == p && b.r3.c2 == p) || // column 2
|
||||
(b.r1.c3 == p && b.r2.c3 == p && b.r3.c3 == p) || // column 3
|
||||
(b.r1.c1 == p && b.r2.c2 == p && b.r3.c3 == p) || // diagonal
|
||||
(b.r1.c3 == p && b.r2.c2 == p && b.r3.c1 == p); // other diagonal
|
||||
}
|
||||
|
||||
// Returns an updated tic tac toe board with a move made by a player.
|
||||
// Returns a `u8` corresponding to the player who won the game, or 0 if no one has won yet.
|
||||
// - `player` : A number corresponding to a player.
|
||||
// - `row` : The row of the move.
|
||||
// - `col` : The column of the move.
|
||||
// - `board` : A tic tac toe board.
|
||||
// Assumes that `player` is either 1 or 2.
|
||||
// Assumes that `row` and `col` are valid indices into the board.
|
||||
// If an entry is already occupied, the move is invalid and the board is returned unchanged.
|
||||
@program
|
||||
function make_move(player: u8, row: u8, col: u8, board: Board) -> (Board, u8) {
|
||||
// Check that inputs are valid.
|
||||
console.assert(player == 1u8 || player == 2u8);
|
||||
console.assert(1u8 <= row && row <= 3u8);
|
||||
console.assert(1u8 <= col && col <= 3u8);
|
||||
|
||||
// Unpack the entries in the board into variables.
|
||||
let r1c1: u8 = board.r1.c1;
|
||||
let r1c2: u8 = board.r1.c2;
|
||||
let r1c3: u8 = board.r1.c3;
|
||||
let r2c1: u8 = board.r2.c1;
|
||||
let r2c2: u8 = board.r2.c2;
|
||||
let r2c3: u8 = board.r2.c3;
|
||||
let r3c1: u8 = board.r3.c1;
|
||||
let r3c2: u8 = board.r3.c2;
|
||||
let r3c3: u8 = board.r3.c3;
|
||||
|
||||
// Update the appropriate entry with the given move.
|
||||
if row == 1u8 && col == 1u8 && r1c1 == 0u8 {
|
||||
r1c1 = player;
|
||||
} else if row == 1u8 && col == 2u8 && r1c2 == 0u8 {
|
||||
r1c2 = player;
|
||||
} else if row == 1u8 && col == 3u8 && r1c3 == 0u8 {
|
||||
r1c3 = player;
|
||||
} else if row == 2u8 && col == 1u8 && r2c1 == 0u8 {
|
||||
r2c1 = player;
|
||||
} else if row == 2u8 && col == 2u8 && r2c2 == 0u8 {
|
||||
r2c2 = player;
|
||||
} else if row == 2u8 && col == 3u8 && r2c3 == 0u8 {
|
||||
r2c3 = player;
|
||||
} else if row == 3u8 && col == 1u8 && r3c1 == 0u8 {
|
||||
r3c1 = player;
|
||||
} else if row == 3u8 && col == 2u8 && r3c2 == 0u8 {
|
||||
r3c2 = player;
|
||||
} else if row == 3u8 && col == 3u8 && r3c3 == 0u8 {
|
||||
r3c3 = player;
|
||||
program tictactoe.aleo {
|
||||
// A row in a tic tac toe board.
|
||||
// - `c1` : The first entry in the row.
|
||||
// - `c2` : The second entry in the row.
|
||||
// - `c3` : The third entry in the row.
|
||||
// A valid entry is either 0, 1, or 2, where 0 is empty, 1 corresponds to player 1, and 2 corresponds to player 2.
|
||||
// Any other values are invalid.
|
||||
struct Row {
|
||||
c1: u8,
|
||||
c2: u8,
|
||||
c3: u8
|
||||
}
|
||||
|
||||
// Construct the updated game board.
|
||||
let updated: Board = Board {
|
||||
r1: Row { c1: r1c1, c2: r1c2, c3: r1c3 },
|
||||
r2: Row { c1: r2c1, c2: r2c2, c3: r2c3 },
|
||||
r3: Row { c1: r3c1, c2: r2c2, c3: r2c3 },
|
||||
};
|
||||
// A tic tac toe board.
|
||||
// - `r1` : The first row in the board.
|
||||
// - `r2` : The second row in the board.
|
||||
// - `r3` : The third row in the board.
|
||||
struct Board {
|
||||
r1: Row,
|
||||
r2: Row,
|
||||
r3: Row,
|
||||
}
|
||||
|
||||
// Check if the game is over.
|
||||
if check_for_win(updated, 1u8) {
|
||||
return (updated, 1u8);
|
||||
} else if check_for_win(updated, 2u8) {
|
||||
return (updated, 2u8);
|
||||
} else {
|
||||
return (updated, 0u8);
|
||||
// Returns an empty board.
|
||||
transition new() -> Board {
|
||||
return Board {
|
||||
r1: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
|
||||
r2: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
|
||||
r3: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
|
||||
};
|
||||
}
|
||||
|
||||
// Returns `true` if there exists a row, column, or diagonal with all entries occupied by the same player.
|
||||
// - `b` : A tic tac toe board.
|
||||
// - `p` : A number corresponding to a player.
|
||||
function check_for_win(b: Board, p: u8) -> bool {
|
||||
return
|
||||
(b.r1.c1 == p && b.r1.c2 == p && b.r1.c3 == p) || // row 1
|
||||
(b.r2.c1 == p && b.r2.c2 == p && b.r2.c3 == p) || // row 2
|
||||
(b.r3.c1 == p && b.r3.c3 == p && b.r3.c3 == p) || // row 3
|
||||
(b.r1.c1 == p && b.r2.c1 == p && b.r3.c1 == p) || // column 1
|
||||
(b.r1.c2 == p && b.r2.c3 == p && b.r3.c2 == p) || // column 2
|
||||
(b.r1.c3 == p && b.r2.c3 == p && b.r3.c3 == p) || // column 3
|
||||
(b.r1.c1 == p && b.r2.c2 == p && b.r3.c3 == p) || // diagonal
|
||||
(b.r1.c3 == p && b.r2.c2 == p && b.r3.c1 == p); // other diagonal
|
||||
}
|
||||
|
||||
// Returns an updated tic tac toe board with a move made by a player.
|
||||
// Returns a `u8` corresponding to the player who won the game, or 0 if no one has won yet.
|
||||
// - `player` : A number corresponding to a player.
|
||||
// - `row` : The row of the move.
|
||||
// - `col` : The column of the move.
|
||||
// - `board` : A tic tac toe board.
|
||||
// Assumes that `player` is either 1 or 2.
|
||||
// Assumes that `row` and `col` are valid indices into the board.
|
||||
// If an entry is already occupied, the move is invalid and the board is returned unchanged.
|
||||
transition make_move(player: u8, row: u8, col: u8, board: Board) -> (Board, u8) {
|
||||
// Check that inputs are valid.
|
||||
console.assert(player == 1u8 || player == 2u8);
|
||||
console.assert(1u8 <= row && row <= 3u8);
|
||||
console.assert(1u8 <= col && col <= 3u8);
|
||||
|
||||
// Unpack the entries in the board into variables.
|
||||
let r1c1: u8 = board.r1.c1;
|
||||
let r1c2: u8 = board.r1.c2;
|
||||
let r1c3: u8 = board.r1.c3;
|
||||
let r2c1: u8 = board.r2.c1;
|
||||
let r2c2: u8 = board.r2.c2;
|
||||
let r2c3: u8 = board.r2.c3;
|
||||
let r3c1: u8 = board.r3.c1;
|
||||
let r3c2: u8 = board.r3.c2;
|
||||
let r3c3: u8 = board.r3.c3;
|
||||
|
||||
// Update the appropriate entry with the given move.
|
||||
if row == 1u8 && col == 1u8 && r1c1 == 0u8 {
|
||||
r1c1 = player;
|
||||
} else if row == 1u8 && col == 2u8 && r1c2 == 0u8 {
|
||||
r1c2 = player;
|
||||
} else if row == 1u8 && col == 3u8 && r1c3 == 0u8 {
|
||||
r1c3 = player;
|
||||
} else if row == 2u8 && col == 1u8 && r2c1 == 0u8 {
|
||||
r2c1 = player;
|
||||
} else if row == 2u8 && col == 2u8 && r2c2 == 0u8 {
|
||||
r2c2 = player;
|
||||
} else if row == 2u8 && col == 3u8 && r2c3 == 0u8 {
|
||||
r2c3 = player;
|
||||
} else if row == 3u8 && col == 1u8 && r3c1 == 0u8 {
|
||||
r3c1 = player;
|
||||
} else if row == 3u8 && col == 2u8 && r3c2 == 0u8 {
|
||||
r3c2 = player;
|
||||
} else if row == 3u8 && col == 3u8 && r3c3 == 0u8 {
|
||||
r3c3 = player;
|
||||
}
|
||||
|
||||
// Construct the updated game board.
|
||||
let updated: Board = Board {
|
||||
r1: Row { c1: r1c1, c2: r1c2, c3: r1c3 },
|
||||
r2: Row { c1: r2c1, c2: r2c2, c3: r2c3 },
|
||||
r3: Row { c1: r3c1, c2: r2c2, c3: r2c3 },
|
||||
};
|
||||
|
||||
// Check if the game is over.
|
||||
if check_for_win(updated, 1u8) {
|
||||
return (updated, 1u8);
|
||||
} else if check_for_win(updated, 2u8) {
|
||||
return (updated, 2u8);
|
||||
} else {
|
||||
return (updated, 0u8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
program token.aleo;
|
||||
program token.aleo
|
||||
|
||||
record token:
|
||||
owner as address.private;
|
||||
|
@ -1,137 +1,134 @@
|
||||
// On-chain storage of an `account` map, with `address` as the key,
|
||||
// and `u64` as the value.
|
||||
mapping account: address => u64;
|
||||
program token.aleo {
|
||||
// On-chain storage of an `account` map, with `address` as the key,
|
||||
// and `u64` as the value.
|
||||
mapping account: address => u64;
|
||||
|
||||
record token {
|
||||
// The token owner.
|
||||
owner: address,
|
||||
// The Aleo balance (in gates).
|
||||
gates: u64,
|
||||
// The token amount.
|
||||
amount: u64,
|
||||
}
|
||||
|
||||
/* Mint */
|
||||
|
||||
// The function `mint_public` issues the specified token amount for the token receiver publicly on the network.
|
||||
transition mint_public(public receiver: address, public amount: u64) {
|
||||
// Mint the tokens publicly by invoking the computation on-chain.
|
||||
async finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public(public receiver: address, public amount: u64) {
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `mint_public` is reverted.
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
// The function `mint_private` initializes a new record with the specified amount of tokens for the receiver.
|
||||
transition mint_private(receiver: address, amount: u64) -> token {
|
||||
return token {
|
||||
owner: receiver,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
}
|
||||
|
||||
/* Transfer */
|
||||
transition transfer_public(public receiver: address, public amount: u64) {
|
||||
// Transfer the tokens publicly, by invoking the computation on-chain.
|
||||
async finalize(self.caller, receiver, amount);
|
||||
}
|
||||
|
||||
finalize transfer_public(public sender: address, public receiver: address, public amount: u64) {
|
||||
// Decrements `account[sender]` by `amount`.
|
||||
// If `account[sender]` does not exist, it will be created.
|
||||
// If `account[sender] - amount` underflows, `transfer_public` is reverted.
|
||||
decrement(account, sender, amount);
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `transfer_public` is reverted.
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
// The function `transfer_private` sends the specified token amount to the token receiver from the specified token record.
|
||||
transition transfer_private(sender: token, receiver: address, amount: u64) -> (token, token) {
|
||||
// Checks the given token record has sufficient balance.
|
||||
// This `sub` operation is safe, and the proof will fail if an overflow occurs.
|
||||
// `difference` holds the change amount to be returned to sender.
|
||||
let difference: u64 = sender.amount - amount;
|
||||
|
||||
// Produce a token record with the change amount for the sender.
|
||||
let remaining: token = token {
|
||||
owner: sender.owner,
|
||||
gates: sender.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Produce a token record for the specified receiver.
|
||||
let transferred: token = token {
|
||||
owner: receiver,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
|
||||
// Output the sender's change record and the receiver's record.
|
||||
return (remaining, transferred);
|
||||
}
|
||||
|
||||
// The function `transfer_private_to_public` turns a specified token amount from a token record into public tokens for the specified receiver.
|
||||
// This function preserves privacy for the sender's record, however it publicly reveals the token receiver and the token amount.
|
||||
transition transfer_private_to_public(sender: token, public receiver: address, public amount: u64) -> token {
|
||||
// Checks the given token record has a sufficient token amount.
|
||||
// This `sub` operation is safe, and the proof will fail if an underflow occurs.
|
||||
// `difference` holds the change amount for the caller.
|
||||
let difference: u64 = sender.amount - amount;
|
||||
|
||||
// Produces a token record with the change amount for the caller.
|
||||
let remaining: token = token {
|
||||
owner: sender.owner,
|
||||
gates: sender.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Increment the token amount publicly for the token receiver.
|
||||
async finalize(receiver, amount);
|
||||
|
||||
// Output the sender's change record.
|
||||
return remaining;
|
||||
}
|
||||
|
||||
finalize transfer_private_to_public(public receiver: address, public amount: u64) {
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `transfer_private_to_public` is reverted.
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
// The function `transfer_public_to_private` turns a specified token amount from `account` into a token record for the specified receiver.
|
||||
// This function preserves privacy for the receiver's record, however it publicly reveals the caller and the specified token amount.
|
||||
transition transfer_public_to_private(public receiver: address, public amount: u64) -> token {
|
||||
// Produces a token record for the token receiver.
|
||||
let transferred: token = token {
|
||||
owner: receiver,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
|
||||
// Decrement the token amount of the caller publicly.
|
||||
async finalize(self.caller, amount);
|
||||
|
||||
// Output the receiver's record.
|
||||
return transferred;
|
||||
}
|
||||
|
||||
finalize transfer_public_to_private(public sender: address, public amount: u64) {
|
||||
// Decrements `account[sender]` by `amount`.
|
||||
// If `account[sender]` does not exist, it will be created.
|
||||
// If `account[sender] - amount` underflows, `transfer_public_to_private` is reverted.
|
||||
decrement(account, sender, amount);
|
||||
}
|
||||
|
||||
record token {
|
||||
// The token owner.
|
||||
owner: address,
|
||||
// The Aleo balance (in gates).
|
||||
gates: u64,
|
||||
// The token amount.
|
||||
amount: u64,
|
||||
}
|
||||
|
||||
/* Mint */
|
||||
|
||||
// The function `mint_public` issues the specified token amount for the token receiver publicly on the network.
|
||||
@program
|
||||
function mint_public(public receiver: address, public amount: u64) {
|
||||
// Mint the tokens publicly by invoking the computation on-chain.
|
||||
async finalize(receiver, amount);
|
||||
}
|
||||
|
||||
finalize mint_public(public receiver: address, public amount: u64) {
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `mint_public` is reverted.
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
// The function `mint_private` initializes a new record with the specified amount of tokens for the receiver.
|
||||
@program
|
||||
function mint_private(receiver: address, amount: u64) -> token {
|
||||
return token {
|
||||
owner: receiver,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
}
|
||||
|
||||
/* Transfer */
|
||||
@program
|
||||
function transfer_public(public receiver: address, public amount: u64) {
|
||||
// Transfer the tokens publicly, by invoking the computation on-chain.
|
||||
async finalize(self.caller, receiver, amount);
|
||||
}
|
||||
|
||||
finalize transfer_public(public sender: address, public receiver: address, public amount: u64) {
|
||||
// Decrements `account[sender]` by `amount`.
|
||||
// If `account[sender]` does not exist, it will be created.
|
||||
// If `account[sender] - amount` underflows, `transfer_public` is reverted.
|
||||
decrement(account, sender, amount);
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `transfer_public` is reverted.
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
// The function `transfer_private` sends the specified token amount to the token receiver from the specified token record.
|
||||
@program
|
||||
function transfer_private(sender: token, receiver: address, amount: u64) -> (token, token) {
|
||||
// Checks the given token record has sufficient balance.
|
||||
// This `sub` operation is safe, and the proof will fail if an overflow occurs.
|
||||
// `difference` holds the change amount to be returned to sender.
|
||||
let difference: u64 = sender.amount - amount;
|
||||
|
||||
// Produce a token record with the change amount for the sender.
|
||||
let remaining: token = token {
|
||||
owner: sender.owner,
|
||||
gates: sender.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Produce a token record for the specified receiver.
|
||||
let transferred: token = token {
|
||||
owner: receiver,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
|
||||
// Output the sender's change record and the receiver's record.
|
||||
return (remaining, transferred);
|
||||
}
|
||||
|
||||
// The function `transfer_private_to_public` turns a specified token amount from a token record into public tokens for the specified receiver.
|
||||
// This function preserves privacy for the sender's record, however it publicly reveals the token receiver and the token amount.
|
||||
@program
|
||||
function transfer_private_to_public(sender: token, public receiver: address, public amount: u64) -> token {
|
||||
// Checks the given token record has a sufficient token amount.
|
||||
// This `sub` operation is safe, and the proof will fail if an underflow occurs.
|
||||
// `difference` holds the change amount for the caller.
|
||||
let difference: u64 = sender.amount - amount;
|
||||
|
||||
// Produces a token record with the change amount for the caller.
|
||||
let remaining: token = token {
|
||||
owner: sender.owner,
|
||||
gates: sender.gates,
|
||||
amount: difference,
|
||||
};
|
||||
|
||||
// Increment the token amount publicly for the token receiver.
|
||||
async finalize(receiver, amount);
|
||||
|
||||
// Output the sender's change record.
|
||||
return remaining;
|
||||
}
|
||||
|
||||
finalize transfer_private_to_public(public receiver: address, public amount: u64) {
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `transfer_private_to_public` is reverted.
|
||||
increment(account, receiver, amount);
|
||||
}
|
||||
|
||||
// The function `transfer_public_to_private` turns a specified token amount from `account` into a token record for the specified receiver.
|
||||
// This function preserves privacy for the receiver's record, however it publicly reveals the caller and the specified token amount.
|
||||
@program
|
||||
function transfer_public_to_private(public receiver: address, public amount: u64) -> token {
|
||||
// Produces a token record for the token receiver.
|
||||
let transferred: token = token {
|
||||
owner: receiver,
|
||||
gates: 0u64,
|
||||
amount: amount,
|
||||
};
|
||||
|
||||
// Decrement the token amount of the caller publicly.
|
||||
async finalize(self.caller, amount);
|
||||
|
||||
// Output the receiver's record.
|
||||
return transferred;
|
||||
}
|
||||
|
||||
finalize transfer_public_to_private(public sender: address, public amount: u64) {
|
||||
// Decrements `account[sender]` by `amount`.
|
||||
// If `account[sender]` does not exist, it will be created.
|
||||
// If `account[sender] - amount` underflows, `transfer_public_to_private` is reverted.
|
||||
decrement(account, sender, amount);
|
||||
}
|
||||
|
@ -1,27 +1,28 @@
|
||||
// This function calculates the number of powers of two ("twoadicity")
|
||||
// in the prime factorization of the input number `n`.
|
||||
@program
|
||||
function main(public n: field) -> u8 {
|
||||
let remaining_n: field = n;
|
||||
let powers_of_two: u8 = 0u8;
|
||||
// Since field ints are 253 bits or fewer, any number in the field
|
||||
// will have at most 252 powers of two in its prime factoring.
|
||||
for i:u8 in 0u8..252u8 {
|
||||
if is_even_and_nonzero(remaining_n) {
|
||||
remaining_n = remaining_n / 2field;
|
||||
powers_of_two = powers_of_two + 1u8;
|
||||
program twoadicity.aleo {
|
||||
// This function calculates the number of powers of two ("twoadicity")
|
||||
// in the prime factorization of the input number `n`.
|
||||
transition main(public n: field) -> u8 {
|
||||
let remaining_n: field = n;
|
||||
let powers_of_two: u8 = 0u8;
|
||||
// Since field ints are 253 bits or fewer, any number in the field
|
||||
// will have at most 252 powers of two in its prime factoring.
|
||||
for i:u8 in 0u8..252u8 {
|
||||
if is_even_and_nonzero(remaining_n) {
|
||||
remaining_n = remaining_n / 2field;
|
||||
powers_of_two = powers_of_two + 1u8;
|
||||
}
|
||||
}
|
||||
return powers_of_two;
|
||||
}
|
||||
return powers_of_two;
|
||||
}
|
||||
|
||||
/* We define the is_even predicate on fields as follows.
|
||||
If n is even and nonzero, clearly n/2 < n.
|
||||
If n is odd, n-p is a field-equivalent negative number that is even, and
|
||||
(n-p)/2 is a field-equivalent negative number closer to 0, greater than n-p.
|
||||
If we add p to both of these negative numbers, we have
|
||||
n/2 = (n-p)/2 + p = (n+p)/2 is greater than n and still less than p.
|
||||
*/
|
||||
function is_even_and_nonzero (n: field) -> bool {
|
||||
return n / 2field < n;
|
||||
/* We define the is_even predicate on fields as follows.
|
||||
If n is even and nonzero, clearly n/2 < n.
|
||||
If n is odd, n-p is a field-equivalent negative number that is even, and
|
||||
(n-p)/2 is a field-equivalent negative number closer to 0, greater than n-p.
|
||||
If we add p to both of these negative numbers, we have
|
||||
n/2 = (n-p)/2 + p = (n+p)/2 is greater than n and still less than p.
|
||||
*/
|
||||
function is_even_and_nonzero (n: field) -> bool {
|
||||
return n / 2field < n;
|
||||
}
|
||||
}
|
||||
|
@ -1,100 +1,97 @@
|
||||
// The 'vote.leo' program.
|
||||
program vote.aleo {
|
||||
// Proposal details
|
||||
struct ProposalInfo {
|
||||
title: field,
|
||||
content: field,
|
||||
proposer: address,
|
||||
}
|
||||
|
||||
// Proposal details
|
||||
circuit ProposalInfo {
|
||||
title: field,
|
||||
content: field,
|
||||
proposer: address,
|
||||
}
|
||||
|
||||
// Proposal record records proposal info publicly
|
||||
record Proposal {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
id: field,
|
||||
info: ProposalInfo,
|
||||
}
|
||||
|
||||
// Save proposal info in public storage.
|
||||
mapping proposals: field => ProposalInfo;
|
||||
|
||||
// Privacy tickets to vote
|
||||
record Ticket {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
pid: field,
|
||||
}
|
||||
|
||||
// Count the total tickets issued for each proposal
|
||||
mapping tickets: field => u64;
|
||||
|
||||
mapping agree_votes: field => u64;
|
||||
|
||||
mapping disagree_votes: field => u64;
|
||||
|
||||
// Propose a new proposal to vote on.
|
||||
@program
|
||||
function propose(public info: ProposalInfo) -> Proposal {
|
||||
// Authenticate proposer.
|
||||
console.assert_eq(self.caller, info.proposer);
|
||||
|
||||
// Generate a new proposal id.
|
||||
let id: field = BHP256::hash(info.title);
|
||||
|
||||
// Finalize the proposal id.
|
||||
async finalize(id);
|
||||
|
||||
// Return a new record for the proposal.
|
||||
return Proposal {
|
||||
owner: self.caller,
|
||||
gates: 0u64,
|
||||
id,
|
||||
info,
|
||||
};
|
||||
}
|
||||
// Create a new proposal in the "tickets" mapping.
|
||||
finalize propose(public id: field) {
|
||||
increment(tickets, id, 0u64);
|
||||
}
|
||||
|
||||
// Create a new ticket to vote with.
|
||||
@program
|
||||
function new_ticket(
|
||||
public pid: field,
|
||||
public voter: address,
|
||||
) -> Ticket {
|
||||
// Finalize the proposal id for the ticket.
|
||||
async finalize(pid);
|
||||
|
||||
return Ticket {
|
||||
owner: voter,
|
||||
gates: 0u64,
|
||||
pid,
|
||||
};
|
||||
}
|
||||
// Create a new ticket on a proposal in the "tickets" mapping.
|
||||
finalize new_ticket(public pid: field) {
|
||||
increment(tickets, pid, 1u64);
|
||||
}
|
||||
|
||||
// Vote privately to agree with a proposal.
|
||||
@program
|
||||
function agree(ticket: Ticket) {
|
||||
// Finalize this vote.
|
||||
async finalize(ticket.pid);
|
||||
}
|
||||
finalize agree(public pid: field) {
|
||||
// Publicly increment the number of agree votes.
|
||||
increment(agree_votes, pid, 1u64);
|
||||
}
|
||||
|
||||
// Vote privately to disagree with a proposal.
|
||||
@program
|
||||
function disagree(ticket: Ticket) {
|
||||
// Finalize this vote.
|
||||
async finalize(ticket.pid);
|
||||
}
|
||||
finalize disagree(pid: field) {
|
||||
// Publicly increment the number of disagree votes.
|
||||
increment(disagree_votes, pid, 1u64);
|
||||
// Proposal record records proposal info publicly
|
||||
record Proposal {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
id: field,
|
||||
info: ProposalInfo,
|
||||
}
|
||||
|
||||
// Save proposal info in public storage.
|
||||
mapping proposals: field => ProposalInfo;
|
||||
|
||||
// Privacy tickets to vote
|
||||
record Ticket {
|
||||
owner: address,
|
||||
gates: u64,
|
||||
pid: field,
|
||||
}
|
||||
|
||||
// Count the total tickets issued for each proposal
|
||||
mapping tickets: field => u64;
|
||||
|
||||
mapping agree_votes: field => u64;
|
||||
|
||||
mapping disagree_votes: field => u64;
|
||||
|
||||
// Propose a new proposal to vote on.
|
||||
transition propose(public info: ProposalInfo) -> Proposal {
|
||||
// Authenticate proposer.
|
||||
console.assert_eq(self.caller, info.proposer);
|
||||
|
||||
// Generate a new proposal id.
|
||||
let id: field = BHP256::hash(info.title);
|
||||
|
||||
// Finalize the proposal id.
|
||||
async finalize(id);
|
||||
|
||||
// Return a new record for the proposal.
|
||||
return Proposal {
|
||||
owner: self.caller,
|
||||
gates: 0u64,
|
||||
id,
|
||||
info,
|
||||
};
|
||||
}
|
||||
// Create a new proposal in the "tickets" mapping.
|
||||
finalize propose(public id: field) {
|
||||
increment(tickets, id, 0u64);
|
||||
}
|
||||
|
||||
// Create a new ticket to vote with.
|
||||
transition new_ticket(
|
||||
public pid: field,
|
||||
public voter: address,
|
||||
) -> Ticket {
|
||||
// Finalize the proposal id for the ticket.
|
||||
async finalize(pid);
|
||||
|
||||
return Ticket {
|
||||
owner: voter,
|
||||
gates: 0u64,
|
||||
pid,
|
||||
};
|
||||
}
|
||||
// Create a new ticket on a proposal in the "tickets" mapping.
|
||||
finalize new_ticket(public pid: field) {
|
||||
increment(tickets, pid, 1u64);
|
||||
}
|
||||
|
||||
// Vote privately to agree with a proposal.
|
||||
transition agree(ticket: Ticket) {
|
||||
// Finalize this vote.
|
||||
async finalize(ticket.pid);
|
||||
}
|
||||
finalize agree(public pid: field) {
|
||||
// Publicly increment the number of agree votes.
|
||||
increment(agree_votes, pid, 1u64);
|
||||
}
|
||||
|
||||
// Vote privately to disagree with a proposal.
|
||||
transition disagree(ticket: Ticket) {
|
||||
// Finalize this vote.
|
||||
async finalize(ticket.pid);
|
||||
}
|
||||
finalize disagree(pid: field) {
|
||||
// Publicly increment the number of disagree votes.
|
||||
increment(disagree_votes, pid, 1u64);
|
||||
}
|
||||
}
|
||||
|
@ -17,10 +17,10 @@
|
||||
use crate::commands::ALEO_CLI_COMMAND;
|
||||
use crate::{commands::Command, context::Context};
|
||||
|
||||
use leo_ast::Circuit;
|
||||
use leo_ast::Struct;
|
||||
use leo_compiler::{Compiler, InputAst, OutputOptions};
|
||||
use leo_errors::{CliError, CompilerError, PackageError, Result};
|
||||
use leo_package::source::{SourceDirectory, MAIN_FILENAME};
|
||||
use leo_package::source::SourceDirectory;
|
||||
use leo_package::{inputs::InputFile, outputs::OutputsDirectory};
|
||||
use leo_span::symbol::with_session_globals;
|
||||
|
||||
@ -28,6 +28,7 @@ use aleo::commands::Build as AleoBuild;
|
||||
|
||||
use clap::StructOpt;
|
||||
use indexmap::IndexMap;
|
||||
use snarkvm::prelude::{ProgramID, Testnet3};
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
@ -90,7 +91,7 @@ pub struct Build {
|
||||
|
||||
impl Command for Build {
|
||||
type Input = ();
|
||||
type Output = (Option<InputAst>, IndexMap<Symbol, Circuit>);
|
||||
type Output = (Option<InputAst>, IndexMap<Symbol, Struct>);
|
||||
|
||||
fn log_span(&self) -> Span {
|
||||
tracing::span!(tracing::Level::INFO, "Leo")
|
||||
@ -104,8 +105,9 @@ impl Command for Build {
|
||||
// Get the package path.
|
||||
let package_path = context.dir()?;
|
||||
|
||||
// Get the program name.
|
||||
let package_name = context.open_manifest()?.program_id().name().to_string();
|
||||
// Get the program id.
|
||||
let manifest = context.open_manifest()?;
|
||||
let program_id = manifest.program_id();
|
||||
|
||||
// Create the outputs directory.
|
||||
let outputs_directory = OutputsDirectory::create(&package_path)?;
|
||||
@ -119,19 +121,23 @@ impl Command for Build {
|
||||
// Fetch paths to all .leo files in the source directory.
|
||||
let source_files = SourceDirectory::files(&package_path)?;
|
||||
|
||||
// Store all circuits declarations made in the source files.
|
||||
let mut circuits = IndexMap::new();
|
||||
// Check the source files.
|
||||
SourceDirectory::check_files(&source_files)?;
|
||||
|
||||
// Store all struct declarations made in the source files.
|
||||
let mut structs = IndexMap::new();
|
||||
|
||||
// Compile all .leo files into .aleo files.
|
||||
for file_path in source_files.into_iter() {
|
||||
circuits.extend(compile_leo_file(
|
||||
structs.extend(compile_leo_file(
|
||||
file_path,
|
||||
&package_path,
|
||||
&package_name,
|
||||
program_id,
|
||||
&outputs_directory,
|
||||
&build_directory,
|
||||
&handler,
|
||||
self.compiler_options.clone(),
|
||||
false,
|
||||
)?);
|
||||
}
|
||||
|
||||
@ -144,20 +150,21 @@ impl Command for Build {
|
||||
|
||||
// Compile all .leo files into .aleo files.
|
||||
for file_path in import_files.into_iter() {
|
||||
circuits.extend(compile_leo_file(
|
||||
structs.extend(compile_leo_file(
|
||||
file_path,
|
||||
&package_path,
|
||||
&package_name,
|
||||
program_id,
|
||||
&outputs_directory,
|
||||
&build_imports_directory,
|
||||
&handler,
|
||||
self.compiler_options.clone(),
|
||||
true,
|
||||
)?);
|
||||
}
|
||||
}
|
||||
|
||||
// Load the input file at `package_name.in`
|
||||
let input_file_path = InputFile::new(&package_name).setup_file_path(&package_path);
|
||||
let input_file_path = InputFile::new(&manifest.program_id().name().to_string()).setup_file_path(&package_path);
|
||||
|
||||
// Parse the input file.
|
||||
let input_ast = if input_file_path.exists() {
|
||||
@ -188,84 +195,57 @@ impl Command for Build {
|
||||
// Log the result of the build
|
||||
tracing::info!("{}", result);
|
||||
|
||||
Ok((input_ast, circuits))
|
||||
Ok((input_ast, structs))
|
||||
}
|
||||
}
|
||||
|
||||
/// Compiles a Leo file in the `src/` directory.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn compile_leo_file(
|
||||
file_path: PathBuf,
|
||||
_package_path: &Path,
|
||||
package_name: &String,
|
||||
program_id: &ProgramID<Testnet3>,
|
||||
outputs: &Path,
|
||||
build: &Path,
|
||||
handler: &Handler,
|
||||
options: BuildOptions,
|
||||
) -> Result<IndexMap<Symbol, Circuit>> {
|
||||
is_import: bool,
|
||||
) -> Result<IndexMap<Symbol, Struct>> {
|
||||
// Construct the Leo file name with extension `foo.leo`.
|
||||
let file_name = file_path
|
||||
.file_name()
|
||||
.and_then(|name| name.to_str())
|
||||
.ok_or_else(PackageError::failed_to_get_file_name)?;
|
||||
|
||||
// Construct program name from file_path name `foo`.
|
||||
let program_name = file_name
|
||||
.strip_suffix(".leo")
|
||||
.ok_or_else(PackageError::failed_to_get_file_name)?;
|
||||
|
||||
// Construct program id header for aleo file.
|
||||
// Do not create a program with main.aleo as the ID.
|
||||
let program_id_name = if file_name.eq(MAIN_FILENAME) {
|
||||
package_name
|
||||
} else {
|
||||
program_name
|
||||
// If the program is an import, construct program name from file_path
|
||||
// Otherwise, use the program_id found in `package.json`.
|
||||
let program_name = match is_import {
|
||||
false => program_id.name().to_string(),
|
||||
true => file_name
|
||||
.strip_suffix(".leo")
|
||||
.ok_or_else(PackageError::failed_to_get_file_name)?
|
||||
.to_string(),
|
||||
};
|
||||
|
||||
// Create the path to the Aleo file.
|
||||
let mut aleo_file_path = build.to_path_buf();
|
||||
aleo_file_path.push(match is_import {
|
||||
true => format!("{}.{}", program_name, program_id.network()),
|
||||
false => format!("main.{}", program_id.network()),
|
||||
});
|
||||
|
||||
// Create a new instance of the Leo compiler.
|
||||
let mut program = Compiler::new(
|
||||
program_id_name.to_string(),
|
||||
String::from("aleo"), // todo: fetch this from Network::Testnet3
|
||||
let mut compiler = Compiler::new(
|
||||
program_name,
|
||||
program_id.network().to_string(),
|
||||
handler,
|
||||
file_path.clone(),
|
||||
outputs.to_path_buf(),
|
||||
Some(options.into()),
|
||||
);
|
||||
|
||||
// TODO: Temporarily removing checksum files. Need to redesign this scheme.
|
||||
// // Check if we need to compile the Leo program.
|
||||
// let checksum_differs = {
|
||||
// // Compute the current program checksum.
|
||||
// let program_checksum = program.checksum()?;
|
||||
//
|
||||
// // Get the current program checksum.
|
||||
// let checksum_file = ChecksumFile::new(program_name);
|
||||
//
|
||||
// // If a checksum file exists, check if it differs from the new checksum.
|
||||
// let checksum_differs = if checksum_file.exists_at(package_path) {
|
||||
// let previous_checksum = checksum_file.read_from(package_path)?;
|
||||
// program_checksum != previous_checksum
|
||||
// } else {
|
||||
// // By default, the checksum differs if there is no checksum to compare against.
|
||||
// true
|
||||
// };
|
||||
//
|
||||
// // If checksum differs, compile the program
|
||||
// if checksum_differs {
|
||||
// // Write the new checksum to the output directory
|
||||
// checksum_file.write_to(package_path, program_checksum)?;
|
||||
//
|
||||
// tracing::debug!("Checksum saved ({:?})", package_path);
|
||||
// }
|
||||
//
|
||||
// checksum_differs
|
||||
// };
|
||||
|
||||
// if checksum_differs {
|
||||
// Compile the Leo program into Aleo instructions.
|
||||
let (symbol_table, instructions) = program.compile_and_generate_instructions()?;
|
||||
|
||||
// Create the path to the Aleo file.
|
||||
let mut aleo_file_path = build.to_path_buf();
|
||||
aleo_file_path.push(format!("{}.aleo", program_name));
|
||||
let (symbol_table, instructions) = compiler.compile_and_generate_instructions()?;
|
||||
|
||||
// Write the instructions.
|
||||
std::fs::File::create(&aleo_file_path)
|
||||
@ -279,5 +259,5 @@ fn compile_leo_file(
|
||||
// Log the build as successful.
|
||||
tracing::info!("Compiled '{}' into Aleo instructions", file_name,);
|
||||
|
||||
Ok(symbol_table.circuits)
|
||||
Ok(symbol_table.structs)
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! The serialized circuit output file.
|
||||
//! The serialized struct output file.
|
||||
|
||||
use crate::outputs::OUTPUTS_DIRECTORY_NAME;
|
||||
use leo_errors::{PackageError, Result};
|
||||
@ -69,7 +69,7 @@ impl SnapshotFile {
|
||||
path.exists()
|
||||
}
|
||||
|
||||
/// Reads the serialized circuit from the given file path if it exists.
|
||||
/// Reads the serialized struct from the given file path if it exists.
|
||||
pub fn read_from(&self, path: &Path) -> Result<String> {
|
||||
let path = self.snapshot_file_path(path);
|
||||
|
||||
@ -79,7 +79,7 @@ impl SnapshotFile {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// Removes the serialized circuit at the given path if it exists. Returns `true` on success,
|
||||
/// Removes the serialized struct at the given path if it exists. Returns `true` on success,
|
||||
/// `false` if the file doesn't exist, and `Error` if the file system fails during operation.
|
||||
pub fn remove(&self, path: &Path) -> Result<bool> {
|
||||
let path = self.snapshot_file_path(path);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! The serialized circuit output file.
|
||||
//! The serialized struct output file.
|
||||
|
||||
use crate::outputs::OUTPUTS_DIRECTORY_NAME;
|
||||
use leo_errors::{PackageError, Result};
|
||||
@ -48,7 +48,7 @@ impl CircuitFile {
|
||||
path.exists()
|
||||
}
|
||||
|
||||
/// Reads the serialized circuit from the given file path if it exists.
|
||||
/// Reads the serialized struct from the given file path if it exists.
|
||||
pub fn read_from(&self, path: &Path) -> Result<String> {
|
||||
let path = self.setup_file_path(path);
|
||||
|
||||
@ -57,7 +57,7 @@ impl CircuitFile {
|
||||
Ok(string)
|
||||
}
|
||||
|
||||
/// Writes the given serialized circuit to a file.
|
||||
/// Writes the given serialized struct to a file.
|
||||
pub fn write_to(&self, path: &Path, circuit: String) -> Result<()> {
|
||||
let path = self.setup_file_path(path);
|
||||
let mut file = File::create(&path).map_err(PackageError::io_error_circuit_file)?;
|
||||
@ -67,7 +67,7 @@ impl CircuitFile {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Removes the serialized circuit at the given path if it exists. Returns `true` on success,
|
||||
/// Removes the serialized struct at the given path if it exists. Returns `true` on success,
|
||||
/// `false` if the file doesn't exist, and `Error` if the file system fails during operation.
|
||||
pub fn remove(&self, path: &Path) -> Result<bool> {
|
||||
let path = self.setup_file_path(path);
|
||||
|
@ -15,8 +15,10 @@
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::parse_file_paths;
|
||||
|
||||
use leo_errors::{PackageError, Result};
|
||||
|
||||
use crate::source::MAIN_FILENAME;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
fs,
|
||||
@ -53,4 +55,13 @@ impl SourceDirectory {
|
||||
|
||||
Ok(file_paths)
|
||||
}
|
||||
|
||||
/// Check that the files in the source directory are valid.
|
||||
pub fn check_files(paths: &[PathBuf]) -> Result<()> {
|
||||
match paths.len() {
|
||||
0 => Err(PackageError::empty_source_directory().into()),
|
||||
1 if paths[0].as_path().ends_with(MAIN_FILENAME) => Ok(()),
|
||||
_ => Err(PackageError::source_directory_can_contain_only_one_file().into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,16 +66,18 @@ impl MainFile {
|
||||
.map_err(PackageError::io_error_main_file)?)
|
||||
}
|
||||
|
||||
// TODO: Generalize to other networks.
|
||||
fn template(&self) -> String {
|
||||
format!(
|
||||
r#"// The '{}' main function.
|
||||
@program
|
||||
function main(public a: u32, b: u32) -> u32 {{
|
||||
let c: u32 = a + b;
|
||||
return c;
|
||||
program {}.aleo {{
|
||||
transition main(public a: u32, b: u32) -> u32 {{
|
||||
let c: u32 = a + b;
|
||||
return c;
|
||||
}}
|
||||
}}
|
||||
"#,
|
||||
self.package_name
|
||||
self.package_name, self.package_name
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
circuit X {
|
||||
struct X {
|
||||
x: u32,
|
||||
y: u32,
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3,268 +3,269 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
function main() {
|
||||
const foo = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 };
|
||||
const bar = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 };
|
||||
|
||||
return foo.x0 + bar.x255;
|
||||
}
|
||||
|
||||
circuit Foo {
|
||||
x0: u8;
|
||||
x1: u8;
|
||||
x2: u8;
|
||||
x3: u8;
|
||||
x4: u8;
|
||||
x5: u8;
|
||||
x6: u8;
|
||||
x7: u8;
|
||||
x8: u8;
|
||||
x9: u8;
|
||||
x10: u8;
|
||||
x11: u8;
|
||||
x12: u8;
|
||||
x13: u8;
|
||||
x14: u8;
|
||||
x15: u8;
|
||||
x16: u8;
|
||||
x17: u8;
|
||||
x18: u8;
|
||||
x19: u8;
|
||||
x20: u8;
|
||||
x21: u8;
|
||||
x22: u8;
|
||||
x23: u8;
|
||||
x24: u8;
|
||||
x25: u8;
|
||||
x26: u8;
|
||||
x27: u8;
|
||||
x28: u8;
|
||||
x29: u8;
|
||||
x30: u8;
|
||||
x31: u8;
|
||||
x32: u8;
|
||||
x33: u8;
|
||||
x34: u8;
|
||||
x35: u8;
|
||||
x36: u8;
|
||||
x37: u8;
|
||||
x38: u8;
|
||||
x39: u8;
|
||||
x40: u8;
|
||||
x41: u8;
|
||||
x42: u8;
|
||||
x43: u8;
|
||||
x44: u8;
|
||||
x45: u8;
|
||||
x46: u8;
|
||||
x47: u8;
|
||||
x48: u8;
|
||||
x49: u8;
|
||||
x50: u8;
|
||||
x51: u8;
|
||||
x52: u8;
|
||||
x53: u8;
|
||||
x54: u8;
|
||||
x55: u8;
|
||||
x56: u8;
|
||||
x57: u8;
|
||||
x58: u8;
|
||||
x59: u8;
|
||||
x60: u8;
|
||||
x61: u8;
|
||||
x62: u8;
|
||||
x63: u8;
|
||||
x64: u8;
|
||||
x65: u8;
|
||||
x66: u8;
|
||||
x67: u8;
|
||||
x68: u8;
|
||||
x69: u8;
|
||||
x70: u8;
|
||||
x71: u8;
|
||||
x72: u8;
|
||||
x73: u8;
|
||||
x74: u8;
|
||||
x75: u8;
|
||||
x76: u8;
|
||||
x77: u8;
|
||||
x78: u8;
|
||||
x79: u8;
|
||||
x80: u8;
|
||||
x81: u8;
|
||||
x82: u8;
|
||||
x83: u8;
|
||||
x84: u8;
|
||||
x85: u8;
|
||||
x86: u8;
|
||||
x87: u8;
|
||||
x88: u8;
|
||||
x89: u8;
|
||||
x90: u8;
|
||||
x91: u8;
|
||||
x92: u8;
|
||||
x93: u8;
|
||||
x94: u8;
|
||||
x95: u8;
|
||||
x96: u8;
|
||||
x97: u8;
|
||||
x98: u8;
|
||||
x99: u8;
|
||||
x100: u8;
|
||||
x101: u8;
|
||||
x102: u8;
|
||||
x103: u8;
|
||||
x104: u8;
|
||||
x105: u8;
|
||||
x106: u8;
|
||||
x107: u8;
|
||||
x108: u8;
|
||||
x109: u8;
|
||||
x110: u8;
|
||||
x111: u8;
|
||||
x112: u8;
|
||||
x113: u8;
|
||||
x114: u8;
|
||||
x115: u8;
|
||||
x116: u8;
|
||||
x117: u8;
|
||||
x118: u8;
|
||||
x119: u8;
|
||||
x120: u8;
|
||||
x121: u8;
|
||||
x122: u8;
|
||||
x123: u8;
|
||||
x124: u8;
|
||||
x125: u8;
|
||||
x126: u8;
|
||||
x127: u8;
|
||||
x128: u8;
|
||||
x129: u8;
|
||||
x130: u8;
|
||||
x131: u8;
|
||||
x132: u8;
|
||||
x133: u8;
|
||||
x134: u8;
|
||||
x135: u8;
|
||||
x136: u8;
|
||||
x137: u8;
|
||||
x138: u8;
|
||||
x139: u8;
|
||||
x140: u8;
|
||||
x141: u8;
|
||||
x142: u8;
|
||||
x143: u8;
|
||||
x144: u8;
|
||||
x145: u8;
|
||||
x146: u8;
|
||||
x147: u8;
|
||||
x148: u8;
|
||||
x149: u8;
|
||||
x150: u8;
|
||||
x151: u8;
|
||||
x152: u8;
|
||||
x153: u8;
|
||||
x154: u8;
|
||||
x155: u8;
|
||||
x156: u8;
|
||||
x157: u8;
|
||||
x158: u8;
|
||||
x159: u8;
|
||||
x160: u8;
|
||||
x161: u8;
|
||||
x162: u8;
|
||||
x163: u8;
|
||||
x164: u8;
|
||||
x165: u8;
|
||||
x166: u8;
|
||||
x167: u8;
|
||||
x168: u8;
|
||||
x169: u8;
|
||||
x170: u8;
|
||||
x171: u8;
|
||||
x172: u8;
|
||||
x173: u8;
|
||||
x174: u8;
|
||||
x175: u8;
|
||||
x176: u8;
|
||||
x177: u8;
|
||||
x178: u8;
|
||||
x179: u8;
|
||||
x180: u8;
|
||||
x181: u8;
|
||||
x182: u8;
|
||||
x183: u8;
|
||||
x184: u8;
|
||||
x185: u8;
|
||||
x186: u8;
|
||||
x187: u8;
|
||||
x188: u8;
|
||||
x189: u8;
|
||||
x190: u8;
|
||||
x191: u8;
|
||||
x192: u8;
|
||||
x193: u8;
|
||||
x194: u8;
|
||||
x195: u8;
|
||||
x196: u8;
|
||||
x197: u8;
|
||||
x198: u8;
|
||||
x199: u8;
|
||||
x200: u8;
|
||||
x201: u8;
|
||||
x202: u8;
|
||||
x203: u8;
|
||||
x204: u8;
|
||||
x205: u8;
|
||||
x206: u8;
|
||||
x207: u8;
|
||||
x208: u8;
|
||||
x209: u8;
|
||||
x210: u8;
|
||||
x211: u8;
|
||||
x212: u8;
|
||||
x213: u8;
|
||||
x214: u8;
|
||||
x215: u8;
|
||||
x216: u8;
|
||||
x217: u8;
|
||||
x218: u8;
|
||||
x219: u8;
|
||||
x220: u8;
|
||||
x221: u8;
|
||||
x222: u8;
|
||||
x223: u8;
|
||||
x224: u8;
|
||||
x225: u8;
|
||||
x226: u8;
|
||||
x227: u8;
|
||||
x228: u8;
|
||||
x229: u8;
|
||||
x230: u8;
|
||||
x231: u8;
|
||||
x232: u8;
|
||||
x233: u8;
|
||||
x234: u8;
|
||||
x235: u8;
|
||||
x236: u8;
|
||||
x237: u8;
|
||||
x238: u8;
|
||||
x239: u8;
|
||||
x240: u8;
|
||||
x241: u8;
|
||||
x242: u8;
|
||||
x243: u8;
|
||||
x244: u8;
|
||||
x245: u8;
|
||||
x246: u8;
|
||||
x247: u8;
|
||||
x248: u8;
|
||||
x249: u8;
|
||||
x250: u8;
|
||||
x251: u8;
|
||||
x252: u8;
|
||||
x253: u8;
|
||||
x254: u8;
|
||||
x255: u8;
|
||||
}
|
||||
program test.aleo {
|
||||
function main() {
|
||||
const foo = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 };
|
||||
const bar = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 };
|
||||
|
||||
return foo.x0 + bar.x255;
|
||||
}
|
||||
|
||||
struct Foo {
|
||||
x0: u8;
|
||||
x1: u8;
|
||||
x2: u8;
|
||||
x3: u8;
|
||||
x4: u8;
|
||||
x5: u8;
|
||||
x6: u8;
|
||||
x7: u8;
|
||||
x8: u8;
|
||||
x9: u8;
|
||||
x10: u8;
|
||||
x11: u8;
|
||||
x12: u8;
|
||||
x13: u8;
|
||||
x14: u8;
|
||||
x15: u8;
|
||||
x16: u8;
|
||||
x17: u8;
|
||||
x18: u8;
|
||||
x19: u8;
|
||||
x20: u8;
|
||||
x21: u8;
|
||||
x22: u8;
|
||||
x23: u8;
|
||||
x24: u8;
|
||||
x25: u8;
|
||||
x26: u8;
|
||||
x27: u8;
|
||||
x28: u8;
|
||||
x29: u8;
|
||||
x30: u8;
|
||||
x31: u8;
|
||||
x32: u8;
|
||||
x33: u8;
|
||||
x34: u8;
|
||||
x35: u8;
|
||||
x36: u8;
|
||||
x37: u8;
|
||||
x38: u8;
|
||||
x39: u8;
|
||||
x40: u8;
|
||||
x41: u8;
|
||||
x42: u8;
|
||||
x43: u8;
|
||||
x44: u8;
|
||||
x45: u8;
|
||||
x46: u8;
|
||||
x47: u8;
|
||||
x48: u8;
|
||||
x49: u8;
|
||||
x50: u8;
|
||||
x51: u8;
|
||||
x52: u8;
|
||||
x53: u8;
|
||||
x54: u8;
|
||||
x55: u8;
|
||||
x56: u8;
|
||||
x57: u8;
|
||||
x58: u8;
|
||||
x59: u8;
|
||||
x60: u8;
|
||||
x61: u8;
|
||||
x62: u8;
|
||||
x63: u8;
|
||||
x64: u8;
|
||||
x65: u8;
|
||||
x66: u8;
|
||||
x67: u8;
|
||||
x68: u8;
|
||||
x69: u8;
|
||||
x70: u8;
|
||||
x71: u8;
|
||||
x72: u8;
|
||||
x73: u8;
|
||||
x74: u8;
|
||||
x75: u8;
|
||||
x76: u8;
|
||||
x77: u8;
|
||||
x78: u8;
|
||||
x79: u8;
|
||||
x80: u8;
|
||||
x81: u8;
|
||||
x82: u8;
|
||||
x83: u8;
|
||||
x84: u8;
|
||||
x85: u8;
|
||||
x86: u8;
|
||||
x87: u8;
|
||||
x88: u8;
|
||||
x89: u8;
|
||||
x90: u8;
|
||||
x91: u8;
|
||||
x92: u8;
|
||||
x93: u8;
|
||||
x94: u8;
|
||||
x95: u8;
|
||||
x96: u8;
|
||||
x97: u8;
|
||||
x98: u8;
|
||||
x99: u8;
|
||||
x100: u8;
|
||||
x101: u8;
|
||||
x102: u8;
|
||||
x103: u8;
|
||||
x104: u8;
|
||||
x105: u8;
|
||||
x106: u8;
|
||||
x107: u8;
|
||||
x108: u8;
|
||||
x109: u8;
|
||||
x110: u8;
|
||||
x111: u8;
|
||||
x112: u8;
|
||||
x113: u8;
|
||||
x114: u8;
|
||||
x115: u8;
|
||||
x116: u8;
|
||||
x117: u8;
|
||||
x118: u8;
|
||||
x119: u8;
|
||||
x120: u8;
|
||||
x121: u8;
|
||||
x122: u8;
|
||||
x123: u8;
|
||||
x124: u8;
|
||||
x125: u8;
|
||||
x126: u8;
|
||||
x127: u8;
|
||||
x128: u8;
|
||||
x129: u8;
|
||||
x130: u8;
|
||||
x131: u8;
|
||||
x132: u8;
|
||||
x133: u8;
|
||||
x134: u8;
|
||||
x135: u8;
|
||||
x136: u8;
|
||||
x137: u8;
|
||||
x138: u8;
|
||||
x139: u8;
|
||||
x140: u8;
|
||||
x141: u8;
|
||||
x142: u8;
|
||||
x143: u8;
|
||||
x144: u8;
|
||||
x145: u8;
|
||||
x146: u8;
|
||||
x147: u8;
|
||||
x148: u8;
|
||||
x149: u8;
|
||||
x150: u8;
|
||||
x151: u8;
|
||||
x152: u8;
|
||||
x153: u8;
|
||||
x154: u8;
|
||||
x155: u8;
|
||||
x156: u8;
|
||||
x157: u8;
|
||||
x158: u8;
|
||||
x159: u8;
|
||||
x160: u8;
|
||||
x161: u8;
|
||||
x162: u8;
|
||||
x163: u8;
|
||||
x164: u8;
|
||||
x165: u8;
|
||||
x166: u8;
|
||||
x167: u8;
|
||||
x168: u8;
|
||||
x169: u8;
|
||||
x170: u8;
|
||||
x171: u8;
|
||||
x172: u8;
|
||||
x173: u8;
|
||||
x174: u8;
|
||||
x175: u8;
|
||||
x176: u8;
|
||||
x177: u8;
|
||||
x178: u8;
|
||||
x179: u8;
|
||||
x180: u8;
|
||||
x181: u8;
|
||||
x182: u8;
|
||||
x183: u8;
|
||||
x184: u8;
|
||||
x185: u8;
|
||||
x186: u8;
|
||||
x187: u8;
|
||||
x188: u8;
|
||||
x189: u8;
|
||||
x190: u8;
|
||||
x191: u8;
|
||||
x192: u8;
|
||||
x193: u8;
|
||||
x194: u8;
|
||||
x195: u8;
|
||||
x196: u8;
|
||||
x197: u8;
|
||||
x198: u8;
|
||||
x199: u8;
|
||||
x200: u8;
|
||||
x201: u8;
|
||||
x202: u8;
|
||||
x203: u8;
|
||||
x204: u8;
|
||||
x205: u8;
|
||||
x206: u8;
|
||||
x207: u8;
|
||||
x208: u8;
|
||||
x209: u8;
|
||||
x210: u8;
|
||||
x211: u8;
|
||||
x212: u8;
|
||||
x213: u8;
|
||||
x214: u8;
|
||||
x215: u8;
|
||||
x216: u8;
|
||||
x217: u8;
|
||||
x218: u8;
|
||||
x219: u8;
|
||||
x220: u8;
|
||||
x221: u8;
|
||||
x222: u8;
|
||||
x223: u8;
|
||||
x224: u8;
|
||||
x225: u8;
|
||||
x226: u8;
|
||||
x227: u8;
|
||||
x228: u8;
|
||||
x229: u8;
|
||||
x230: u8;
|
||||
x231: u8;
|
||||
x232: u8;
|
||||
x233: u8;
|
||||
x234: u8;
|
||||
x235: u8;
|
||||
x236: u8;
|
||||
x237: u8;
|
||||
x238: u8;
|
||||
x239: u8;
|
||||
x240: u8;
|
||||
x241: u8;
|
||||
x242: u8;
|
||||
x243: u8;
|
||||
x244: u8;
|
||||
x245: u8;
|
||||
x246: u8;
|
||||
x247: u8;
|
||||
x248: u8;
|
||||
x249: u8;
|
||||
x250: u8;
|
||||
x251: u8;
|
||||
x252: u8;
|
||||
x253: u8;
|
||||
x254: u8;
|
||||
x255: u8;
|
||||
}}
|
||||
|
@ -3,392 +3,393 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
function main() -> u8 {
|
||||
const x: u8 = 191;
|
||||
|
||||
if x == 0 {
|
||||
return x;
|
||||
} else if x == 1 {
|
||||
return x - 1;
|
||||
} else if x == 2 {
|
||||
return x - 2;
|
||||
} else if x == 3 {
|
||||
return x - 3;
|
||||
} else if x == 4 {
|
||||
return x - 4;
|
||||
} else if x == 5 {
|
||||
return x - 5;
|
||||
} else if x == 6 {
|
||||
return x - 6;
|
||||
} else if x == 7 {
|
||||
return x - 7;
|
||||
} else if x == 8 {
|
||||
return x - 8;
|
||||
} else if x == 9 {
|
||||
return x - 9;
|
||||
} else if x == 10 {
|
||||
return x - 10;
|
||||
} else if x == 11 {
|
||||
return x - 11;
|
||||
} else if x == 12 {
|
||||
return x - 12;
|
||||
} else if x == 13 {
|
||||
return x - 13;
|
||||
} else if x == 14 {
|
||||
return x - 14;
|
||||
} else if x == 15 {
|
||||
return x - 15;
|
||||
} else if x == 16 {
|
||||
return x - 16;
|
||||
} else if x == 17 {
|
||||
return x - 17;
|
||||
} else if x == 18 {
|
||||
return x - 18;
|
||||
} else if x == 19 {
|
||||
return x - 19;
|
||||
} else if x == 20 {
|
||||
return x - 20;
|
||||
} else if x == 21 {
|
||||
return x - 21;
|
||||
} else if x == 22 {
|
||||
return x - 22;
|
||||
} else if x == 23 {
|
||||
return x - 23;
|
||||
} else if x == 24 {
|
||||
return x - 24;
|
||||
} else if x == 25 {
|
||||
return x - 25;
|
||||
} else if x == 26 {
|
||||
return x - 26;
|
||||
} else if x == 27 {
|
||||
return x - 27;
|
||||
} else if x == 28 {
|
||||
return x - 28;
|
||||
} else if x == 29 {
|
||||
return x - 29;
|
||||
} else if x == 30 {
|
||||
return x - 30;
|
||||
} else if x == 31 {
|
||||
return x - 31;
|
||||
} else if x == 32 {
|
||||
return x - 32;
|
||||
} else if x == 33 {
|
||||
return x - 33;
|
||||
} else if x == 34 {
|
||||
return x - 34;
|
||||
} else if x == 35 {
|
||||
return x - 35;
|
||||
} else if x == 36 {
|
||||
return x - 36;
|
||||
} else if x == 37 {
|
||||
return x - 37;
|
||||
} else if x == 38 {
|
||||
return x - 38;
|
||||
} else if x == 39 {
|
||||
return x - 39;
|
||||
} else if x == 40 {
|
||||
return x - 40;
|
||||
} else if x == 41 {
|
||||
return x - 41;
|
||||
} else if x == 42 {
|
||||
return x - 42;
|
||||
} else if x == 43 {
|
||||
return x - 43;
|
||||
} else if x == 44 {
|
||||
return x - 44;
|
||||
} else if x == 45 {
|
||||
return x - 45;
|
||||
} else if x == 46 {
|
||||
return x - 46;
|
||||
} else if x == 47 {
|
||||
return x - 47;
|
||||
} else if x == 48 {
|
||||
return x - 48;
|
||||
} else if x == 49 {
|
||||
return x - 49;
|
||||
} else if x == 50 {
|
||||
return x - 50;
|
||||
} else if x == 51 {
|
||||
return x - 51;
|
||||
} else if x == 52 {
|
||||
return x - 52;
|
||||
} else if x == 53 {
|
||||
return x - 53;
|
||||
} else if x == 54 {
|
||||
return x - 54;
|
||||
} else if x == 55 {
|
||||
return x - 55;
|
||||
} else if x == 56 {
|
||||
return x - 56;
|
||||
} else if x == 57 {
|
||||
return x - 57;
|
||||
} else if x == 58 {
|
||||
return x - 58;
|
||||
} else if x == 59 {
|
||||
return x - 59;
|
||||
} else if x == 60 {
|
||||
return x - 60;
|
||||
} else if x == 61 {
|
||||
return x - 61;
|
||||
} else if x == 62 {
|
||||
return x - 62;
|
||||
} else if x == 63 {
|
||||
return x - 63;
|
||||
} else if x == 64 {
|
||||
return x - 64;
|
||||
} else if x == 65 {
|
||||
return x - 65;
|
||||
} else if x == 66 {
|
||||
return x - 66;
|
||||
} else if x == 67 {
|
||||
return x - 67;
|
||||
} else if x == 68 {
|
||||
return x - 68;
|
||||
} else if x == 69 {
|
||||
return x - 69;
|
||||
} else if x == 70 {
|
||||
return x - 70;
|
||||
} else if x == 71 {
|
||||
return x - 71;
|
||||
} else if x == 72 {
|
||||
return x - 72;
|
||||
} else if x == 73 {
|
||||
return x - 73;
|
||||
} else if x == 74 {
|
||||
return x - 74;
|
||||
} else if x == 75 {
|
||||
return x - 75;
|
||||
} else if x == 76 {
|
||||
return x - 76;
|
||||
} else if x == 77 {
|
||||
return x - 77;
|
||||
} else if x == 78 {
|
||||
return x - 78;
|
||||
} else if x == 79 {
|
||||
return x - 79;
|
||||
} else if x == 80 {
|
||||
return x - 80;
|
||||
} else if x == 81 {
|
||||
return x - 81;
|
||||
} else if x == 82 {
|
||||
return x - 82;
|
||||
} else if x == 83 {
|
||||
return x - 83;
|
||||
} else if x == 84 {
|
||||
return x - 84;
|
||||
} else if x == 85 {
|
||||
return x - 85;
|
||||
} else if x == 86 {
|
||||
return x - 86;
|
||||
} else if x == 87 {
|
||||
return x - 87;
|
||||
} else if x == 88 {
|
||||
return x - 88;
|
||||
} else if x == 89 {
|
||||
return x - 89;
|
||||
} else if x == 90 {
|
||||
return x - 90;
|
||||
} else if x == 91 {
|
||||
return x - 91;
|
||||
} else if x == 92 {
|
||||
return x - 92;
|
||||
} else if x == 93 {
|
||||
return x - 93;
|
||||
} else if x == 94 {
|
||||
return x - 94;
|
||||
} else if x == 95 {
|
||||
return x - 95;
|
||||
} else if x == 96 {
|
||||
return x - 96;
|
||||
} else if x == 97 {
|
||||
return x - 97;
|
||||
} else if x == 98 {
|
||||
return x - 98;
|
||||
} else if x == 99 {
|
||||
return x - 99;
|
||||
} else if x == 100 {
|
||||
return x - 100;
|
||||
} else if x == 101 {
|
||||
return x - 101;
|
||||
} else if x == 102 {
|
||||
return x - 102;
|
||||
} else if x == 103 {
|
||||
return x - 103;
|
||||
} else if x == 104 {
|
||||
return x - 104;
|
||||
} else if x == 105 {
|
||||
return x - 105;
|
||||
} else if x == 106 {
|
||||
return x - 106;
|
||||
} else if x == 107 {
|
||||
return x - 107;
|
||||
} else if x == 108 {
|
||||
return x - 108;
|
||||
} else if x == 109 {
|
||||
return x - 109;
|
||||
} else if x == 110 {
|
||||
return x - 110;
|
||||
} else if x == 111 {
|
||||
return x - 111;
|
||||
} else if x == 112 {
|
||||
return x - 112;
|
||||
} else if x == 113 {
|
||||
return x - 113;
|
||||
} else if x == 114 {
|
||||
return x - 114;
|
||||
} else if x == 115 {
|
||||
return x - 115;
|
||||
} else if x == 116 {
|
||||
return x - 116;
|
||||
} else if x == 117 {
|
||||
return x - 117;
|
||||
} else if x == 118 {
|
||||
return x - 118;
|
||||
} else if x == 119 {
|
||||
return x - 119;
|
||||
} else if x == 120 {
|
||||
return x - 120;
|
||||
} else if x == 121 {
|
||||
return x - 121;
|
||||
} else if x == 122 {
|
||||
return x - 122;
|
||||
} else if x == 123 {
|
||||
return x - 123;
|
||||
} else if x == 124 {
|
||||
return x - 124;
|
||||
} else if x == 125 {
|
||||
return x - 125;
|
||||
} else if x == 126 {
|
||||
return x - 126;
|
||||
} else if x == 127 {
|
||||
return x - 127;
|
||||
} else if x == 128 {
|
||||
return x - 128;
|
||||
} else if x == 129 {
|
||||
return x - 129;
|
||||
} else if x == 130 {
|
||||
return x - 130;
|
||||
} else if x == 131 {
|
||||
return x - 131;
|
||||
} else if x == 132 {
|
||||
return x - 132;
|
||||
} else if x == 133 {
|
||||
return x - 133;
|
||||
} else if x == 134 {
|
||||
return x - 134;
|
||||
} else if x == 135 {
|
||||
return x - 135;
|
||||
} else if x == 136 {
|
||||
return x - 136;
|
||||
} else if x == 137 {
|
||||
return x - 137;
|
||||
} else if x == 138 {
|
||||
return x - 138;
|
||||
} else if x == 139 {
|
||||
return x - 139;
|
||||
} else if x == 140 {
|
||||
return x - 140;
|
||||
} else if x == 141 {
|
||||
return x - 141;
|
||||
} else if x == 142 {
|
||||
return x - 142;
|
||||
} else if x == 143 {
|
||||
return x - 143;
|
||||
} else if x == 144 {
|
||||
return x - 144;
|
||||
} else if x == 145 {
|
||||
return x - 145;
|
||||
} else if x == 146 {
|
||||
return x - 146;
|
||||
} else if x == 147 {
|
||||
return x - 147;
|
||||
} else if x == 148 {
|
||||
return x - 148;
|
||||
} else if x == 149 {
|
||||
return x - 149;
|
||||
} else if x == 150 {
|
||||
return x - 150;
|
||||
} else if x == 151 {
|
||||
return x - 151;
|
||||
} else if x == 152 {
|
||||
return x - 152;
|
||||
} else if x == 153 {
|
||||
return x - 153;
|
||||
} else if x == 154 {
|
||||
return x - 154;
|
||||
} else if x == 155 {
|
||||
return x - 155;
|
||||
} else if x == 156 {
|
||||
return x - 156;
|
||||
} else if x == 157 {
|
||||
return x - 157;
|
||||
} else if x == 158 {
|
||||
return x - 158;
|
||||
} else if x == 159 {
|
||||
return x - 159;
|
||||
} else if x == 160 {
|
||||
return x - 160;
|
||||
} else if x == 161 {
|
||||
return x - 161;
|
||||
} else if x == 162 {
|
||||
return x - 162;
|
||||
} else if x == 163 {
|
||||
return x - 163;
|
||||
} else if x == 164 {
|
||||
return x - 164;
|
||||
} else if x == 165 {
|
||||
return x - 165;
|
||||
} else if x == 166 {
|
||||
return x - 166;
|
||||
} else if x == 167 {
|
||||
return x - 167;
|
||||
} else if x == 168 {
|
||||
return x - 168;
|
||||
} else if x == 169 {
|
||||
return x - 169;
|
||||
} else if x == 170 {
|
||||
return x - 170;
|
||||
} else if x == 171 {
|
||||
return x - 171;
|
||||
} else if x == 172 {
|
||||
return x - 172;
|
||||
} else if x == 173 {
|
||||
return x - 173;
|
||||
} else if x == 174 {
|
||||
return x - 174;
|
||||
} else if x == 175 {
|
||||
return x - 175;
|
||||
} else if x == 176 {
|
||||
return x - 176;
|
||||
} else if x == 177 {
|
||||
return x - 177;
|
||||
} else if x == 178 {
|
||||
return x - 178;
|
||||
} else if x == 179 {
|
||||
return x - 179;
|
||||
} else if x == 180 {
|
||||
return x - 180;
|
||||
} else if x == 181 {
|
||||
return x - 181;
|
||||
} else if x == 182 {
|
||||
return x - 182;
|
||||
} else if x == 183 {
|
||||
return x - 183;
|
||||
} else if x == 184 {
|
||||
return x - 184;
|
||||
} else if x == 185 {
|
||||
return x - 185;
|
||||
} else if x == 186 {
|
||||
return x - 186;
|
||||
} else if x == 187 {
|
||||
return x - 187;
|
||||
} else if x == 188 {
|
||||
return x - 188;
|
||||
} else if x == 189 {
|
||||
return x - 189;
|
||||
} else if x == 190 {
|
||||
return x - 190;
|
||||
} else if x == 191 {
|
||||
return x - 191;
|
||||
}
|
||||
}
|
||||
program test.aleo {
|
||||
function main() -> u8 {
|
||||
const x: u8 = 191;
|
||||
|
||||
if x == 0 {
|
||||
return x;
|
||||
} else if x == 1 {
|
||||
return x - 1;
|
||||
} else if x == 2 {
|
||||
return x - 2;
|
||||
} else if x == 3 {
|
||||
return x - 3;
|
||||
} else if x == 4 {
|
||||
return x - 4;
|
||||
} else if x == 5 {
|
||||
return x - 5;
|
||||
} else if x == 6 {
|
||||
return x - 6;
|
||||
} else if x == 7 {
|
||||
return x - 7;
|
||||
} else if x == 8 {
|
||||
return x - 8;
|
||||
} else if x == 9 {
|
||||
return x - 9;
|
||||
} else if x == 10 {
|
||||
return x - 10;
|
||||
} else if x == 11 {
|
||||
return x - 11;
|
||||
} else if x == 12 {
|
||||
return x - 12;
|
||||
} else if x == 13 {
|
||||
return x - 13;
|
||||
} else if x == 14 {
|
||||
return x - 14;
|
||||
} else if x == 15 {
|
||||
return x - 15;
|
||||
} else if x == 16 {
|
||||
return x - 16;
|
||||
} else if x == 17 {
|
||||
return x - 17;
|
||||
} else if x == 18 {
|
||||
return x - 18;
|
||||
} else if x == 19 {
|
||||
return x - 19;
|
||||
} else if x == 20 {
|
||||
return x - 20;
|
||||
} else if x == 21 {
|
||||
return x - 21;
|
||||
} else if x == 22 {
|
||||
return x - 22;
|
||||
} else if x == 23 {
|
||||
return x - 23;
|
||||
} else if x == 24 {
|
||||
return x - 24;
|
||||
} else if x == 25 {
|
||||
return x - 25;
|
||||
} else if x == 26 {
|
||||
return x - 26;
|
||||
} else if x == 27 {
|
||||
return x - 27;
|
||||
} else if x == 28 {
|
||||
return x - 28;
|
||||
} else if x == 29 {
|
||||
return x - 29;
|
||||
} else if x == 30 {
|
||||
return x - 30;
|
||||
} else if x == 31 {
|
||||
return x - 31;
|
||||
} else if x == 32 {
|
||||
return x - 32;
|
||||
} else if x == 33 {
|
||||
return x - 33;
|
||||
} else if x == 34 {
|
||||
return x - 34;
|
||||
} else if x == 35 {
|
||||
return x - 35;
|
||||
} else if x == 36 {
|
||||
return x - 36;
|
||||
} else if x == 37 {
|
||||
return x - 37;
|
||||
} else if x == 38 {
|
||||
return x - 38;
|
||||
} else if x == 39 {
|
||||
return x - 39;
|
||||
} else if x == 40 {
|
||||
return x - 40;
|
||||
} else if x == 41 {
|
||||
return x - 41;
|
||||
} else if x == 42 {
|
||||
return x - 42;
|
||||
} else if x == 43 {
|
||||
return x - 43;
|
||||
} else if x == 44 {
|
||||
return x - 44;
|
||||
} else if x == 45 {
|
||||
return x - 45;
|
||||
} else if x == 46 {
|
||||
return x - 46;
|
||||
} else if x == 47 {
|
||||
return x - 47;
|
||||
} else if x == 48 {
|
||||
return x - 48;
|
||||
} else if x == 49 {
|
||||
return x - 49;
|
||||
} else if x == 50 {
|
||||
return x - 50;
|
||||
} else if x == 51 {
|
||||
return x - 51;
|
||||
} else if x == 52 {
|
||||
return x - 52;
|
||||
} else if x == 53 {
|
||||
return x - 53;
|
||||
} else if x == 54 {
|
||||
return x - 54;
|
||||
} else if x == 55 {
|
||||
return x - 55;
|
||||
} else if x == 56 {
|
||||
return x - 56;
|
||||
} else if x == 57 {
|
||||
return x - 57;
|
||||
} else if x == 58 {
|
||||
return x - 58;
|
||||
} else if x == 59 {
|
||||
return x - 59;
|
||||
} else if x == 60 {
|
||||
return x - 60;
|
||||
} else if x == 61 {
|
||||
return x - 61;
|
||||
} else if x == 62 {
|
||||
return x - 62;
|
||||
} else if x == 63 {
|
||||
return x - 63;
|
||||
} else if x == 64 {
|
||||
return x - 64;
|
||||
} else if x == 65 {
|
||||
return x - 65;
|
||||
} else if x == 66 {
|
||||
return x - 66;
|
||||
} else if x == 67 {
|
||||
return x - 67;
|
||||
} else if x == 68 {
|
||||
return x - 68;
|
||||
} else if x == 69 {
|
||||
return x - 69;
|
||||
} else if x == 70 {
|
||||
return x - 70;
|
||||
} else if x == 71 {
|
||||
return x - 71;
|
||||
} else if x == 72 {
|
||||
return x - 72;
|
||||
} else if x == 73 {
|
||||
return x - 73;
|
||||
} else if x == 74 {
|
||||
return x - 74;
|
||||
} else if x == 75 {
|
||||
return x - 75;
|
||||
} else if x == 76 {
|
||||
return x - 76;
|
||||
} else if x == 77 {
|
||||
return x - 77;
|
||||
} else if x == 78 {
|
||||
return x - 78;
|
||||
} else if x == 79 {
|
||||
return x - 79;
|
||||
} else if x == 80 {
|
||||
return x - 80;
|
||||
} else if x == 81 {
|
||||
return x - 81;
|
||||
} else if x == 82 {
|
||||
return x - 82;
|
||||
} else if x == 83 {
|
||||
return x - 83;
|
||||
} else if x == 84 {
|
||||
return x - 84;
|
||||
} else if x == 85 {
|
||||
return x - 85;
|
||||
} else if x == 86 {
|
||||
return x - 86;
|
||||
} else if x == 87 {
|
||||
return x - 87;
|
||||
} else if x == 88 {
|
||||
return x - 88;
|
||||
} else if x == 89 {
|
||||
return x - 89;
|
||||
} else if x == 90 {
|
||||
return x - 90;
|
||||
} else if x == 91 {
|
||||
return x - 91;
|
||||
} else if x == 92 {
|
||||
return x - 92;
|
||||
} else if x == 93 {
|
||||
return x - 93;
|
||||
} else if x == 94 {
|
||||
return x - 94;
|
||||
} else if x == 95 {
|
||||
return x - 95;
|
||||
} else if x == 96 {
|
||||
return x - 96;
|
||||
} else if x == 97 {
|
||||
return x - 97;
|
||||
} else if x == 98 {
|
||||
return x - 98;
|
||||
} else if x == 99 {
|
||||
return x - 99;
|
||||
} else if x == 100 {
|
||||
return x - 100;
|
||||
} else if x == 101 {
|
||||
return x - 101;
|
||||
} else if x == 102 {
|
||||
return x - 102;
|
||||
} else if x == 103 {
|
||||
return x - 103;
|
||||
} else if x == 104 {
|
||||
return x - 104;
|
||||
} else if x == 105 {
|
||||
return x - 105;
|
||||
} else if x == 106 {
|
||||
return x - 106;
|
||||
} else if x == 107 {
|
||||
return x - 107;
|
||||
} else if x == 108 {
|
||||
return x - 108;
|
||||
} else if x == 109 {
|
||||
return x - 109;
|
||||
} else if x == 110 {
|
||||
return x - 110;
|
||||
} else if x == 111 {
|
||||
return x - 111;
|
||||
} else if x == 112 {
|
||||
return x - 112;
|
||||
} else if x == 113 {
|
||||
return x - 113;
|
||||
} else if x == 114 {
|
||||
return x - 114;
|
||||
} else if x == 115 {
|
||||
return x - 115;
|
||||
} else if x == 116 {
|
||||
return x - 116;
|
||||
} else if x == 117 {
|
||||
return x - 117;
|
||||
} else if x == 118 {
|
||||
return x - 118;
|
||||
} else if x == 119 {
|
||||
return x - 119;
|
||||
} else if x == 120 {
|
||||
return x - 120;
|
||||
} else if x == 121 {
|
||||
return x - 121;
|
||||
} else if x == 122 {
|
||||
return x - 122;
|
||||
} else if x == 123 {
|
||||
return x - 123;
|
||||
} else if x == 124 {
|
||||
return x - 124;
|
||||
} else if x == 125 {
|
||||
return x - 125;
|
||||
} else if x == 126 {
|
||||
return x - 126;
|
||||
} else if x == 127 {
|
||||
return x - 127;
|
||||
} else if x == 128 {
|
||||
return x - 128;
|
||||
} else if x == 129 {
|
||||
return x - 129;
|
||||
} else if x == 130 {
|
||||
return x - 130;
|
||||
} else if x == 131 {
|
||||
return x - 131;
|
||||
} else if x == 132 {
|
||||
return x - 132;
|
||||
} else if x == 133 {
|
||||
return x - 133;
|
||||
} else if x == 134 {
|
||||
return x - 134;
|
||||
} else if x == 135 {
|
||||
return x - 135;
|
||||
} else if x == 136 {
|
||||
return x - 136;
|
||||
} else if x == 137 {
|
||||
return x - 137;
|
||||
} else if x == 138 {
|
||||
return x - 138;
|
||||
} else if x == 139 {
|
||||
return x - 139;
|
||||
} else if x == 140 {
|
||||
return x - 140;
|
||||
} else if x == 141 {
|
||||
return x - 141;
|
||||
} else if x == 142 {
|
||||
return x - 142;
|
||||
} else if x == 143 {
|
||||
return x - 143;
|
||||
} else if x == 144 {
|
||||
return x - 144;
|
||||
} else if x == 145 {
|
||||
return x - 145;
|
||||
} else if x == 146 {
|
||||
return x - 146;
|
||||
} else if x == 147 {
|
||||
return x - 147;
|
||||
} else if x == 148 {
|
||||
return x - 148;
|
||||
} else if x == 149 {
|
||||
return x - 149;
|
||||
} else if x == 150 {
|
||||
return x - 150;
|
||||
} else if x == 151 {
|
||||
return x - 151;
|
||||
} else if x == 152 {
|
||||
return x - 152;
|
||||
} else if x == 153 {
|
||||
return x - 153;
|
||||
} else if x == 154 {
|
||||
return x - 154;
|
||||
} else if x == 155 {
|
||||
return x - 155;
|
||||
} else if x == 156 {
|
||||
return x - 156;
|
||||
} else if x == 157 {
|
||||
return x - 157;
|
||||
} else if x == 158 {
|
||||
return x - 158;
|
||||
} else if x == 159 {
|
||||
return x - 159;
|
||||
} else if x == 160 {
|
||||
return x - 160;
|
||||
} else if x == 161 {
|
||||
return x - 161;
|
||||
} else if x == 162 {
|
||||
return x - 162;
|
||||
} else if x == 163 {
|
||||
return x - 163;
|
||||
} else if x == 164 {
|
||||
return x - 164;
|
||||
} else if x == 165 {
|
||||
return x - 165;
|
||||
} else if x == 166 {
|
||||
return x - 166;
|
||||
} else if x == 167 {
|
||||
return x - 167;
|
||||
} else if x == 168 {
|
||||
return x - 168;
|
||||
} else if x == 169 {
|
||||
return x - 169;
|
||||
} else if x == 170 {
|
||||
return x - 170;
|
||||
} else if x == 171 {
|
||||
return x - 171;
|
||||
} else if x == 172 {
|
||||
return x - 172;
|
||||
} else if x == 173 {
|
||||
return x - 173;
|
||||
} else if x == 174 {
|
||||
return x - 174;
|
||||
} else if x == 175 {
|
||||
return x - 175;
|
||||
} else if x == 176 {
|
||||
return x - 176;
|
||||
} else if x == 177 {
|
||||
return x - 177;
|
||||
} else if x == 178 {
|
||||
return x - 178;
|
||||
} else if x == 179 {
|
||||
return x - 179;
|
||||
} else if x == 180 {
|
||||
return x - 180;
|
||||
} else if x == 181 {
|
||||
return x - 181;
|
||||
} else if x == 182 {
|
||||
return x - 182;
|
||||
} else if x == 183 {
|
||||
return x - 183;
|
||||
} else if x == 184 {
|
||||
return x - 184;
|
||||
} else if x == 185 {
|
||||
return x - 185;
|
||||
} else if x == 186 {
|
||||
return x - 186;
|
||||
} else if x == 187 {
|
||||
return x - 187;
|
||||
} else if x == 188 {
|
||||
return x - 188;
|
||||
} else if x == 189 {
|
||||
return x - 189;
|
||||
} else if x == 190 {
|
||||
return x - 190;
|
||||
} else if x == 191 {
|
||||
return x - 191;
|
||||
}
|
||||
}}
|
||||
|
@ -3,8 +3,9 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
function main() -> u8 {
|
||||
const x: u8 = 255;
|
||||
|
||||
return x == 0 ? x : (x == 1 ? x : (x == 2 ? x : (x == 3 ? x : (x == 4 ? x : (x == 5 ? x : (x == 6 ? x : (x == 7 ? x : (x == 8 ? x : (x == 9 ? x : (x == 10 ? x : (x == 11 ? x : (x == 12 ? x : (x == 13 ? x : (x == 14 ? x : (x == 15 ? x : (x == 16 ? x : (x == 17 ? x : (x == 18 ? x : (x == 19 ? x : (x == 20 ? x : (x == 21 ? x : (x == 22 ? x : (x == 23 ? x : (x == 24 ? x : (x == 25 ? x : (x == 26 ? x : (x == 27 ? x : (x == 28 ? x : (x == 29 ? x : (x == 30 ? x : (x == 31 ? x : (x == 32 ? x : (x == 33 ? x : (x == 34 ? x : (x == 35 ? x : (x == 36 ? x : (x == 37 ? x : (x == 38 ? x : (x == 39 ? x : (x == 40 ? x : (x == 41 ? x : (x == 42 ? x : (x == 43 ? x : (x == 44 ? x : (x == 45 ? x : (x == 46 ? x : (x == 47 ? x : (x == 48 ? x : (x == 49 ? x : (x == 50 ? x : (x == 51 ? x : (x == 52 ? x : (x == 53 ? x : (x == 54 ? x : (x == 55 ? x : (x == 56 ? x : (x == 57 ? x : (x == 58 ? x : (x == 59 ? x : (x == 60 ? x : (x == 61 ? x : (x == 62 ? x : (x == 63 ? x : (x == 64 ? x : (x == 65 ? x : (x == 66 ? x : (x == 67 ? x : (x == 68 ? x : (x == 69 ? x : (x == 70 ? x : (x == 71 ? x : (x == 72 ? x : (x == 73 ? x : (x == 74 ? x : (x == 75 ? x : (x == 76 ? x : (x == 77 ? x : (x == 78 ? x : (x == 79 ? x : (x == 80 ? x : (x == 81 ? x : (x == 82 ? x : (x == 83 ? x : (x == 84 ? x : (x == 85 ? x : (x == 86 ? x : (x == 87 ? x : (x == 88 ? x : (x == 89 ? x : (x == 90 ? x : (x == 91 ? x : (x == 92 ? x : (x == 93 ? x : (x == 94 ? x : (x == 95 ? x : (x == 96 ? x : (x == 97 ? x : (x == 98 ? x : (x == 99 ? x : (x == 100 ? x : (x == 101 ? x : (x == 102 ? x : (x == 103 ? x : (x == 104 ? x : (x == 105 ? x : (x == 106 ? x : (x == 107 ? x : (x == 108 ? x : (x == 109 ? x : (x == 110 ? x : (x == 111 ? x : (x == 112 ? x : (x == 113 ? x : (x == 114 ? x : (x == 115 ? x : (x == 116 ? x : (x == 117 ? x : (x == 118 ? x : (x == 119 ? x : (x == 120 ? x : (x == 121 ? x : (x == 122 ? x : (x == 123 ? x : (x == 124 ? x : (x == 125 ? x : (x == 126 ? x : (x == 127 ? x : (x == 128 ? x : (x == 129 ? x : (x == 130 ? x : (x == 131 ? x : (x == 132 ? x : (x == 133 ? x : (x == 134 ? x : (x == 135 ? x : (x == 136 ? x : (x == 137 ? x : (x == 138 ? x : (x == 139 ? x : (x == 140 ? x : (x == 141 ? x : (x == 142 ? x : (x == 143 ? x : (x == 144 ? x : (x == 145 ? x : (x == 146 ? x : (x == 147 ? x : (x == 148 ? x : (x == 149 ? x : (x == 150 ? x : (x == 151 ? x : (x == 152 ? x : (x == 153 ? x : (x == 154 ? x : (x == 155 ? x : (x == 156 ? x : (x == 157 ? x : (x == 158 ? x : (x == 159 ? x : (x == 160 ? x : (x == 161 ? x : (x == 162 ? x : (x == 163 ? x : (x == 164 ? x : (x == 165 ? x : (x == 166 ? x : (x == 167 ? x : (x == 168 ? x : (x == 169 ? x : (x == 170 ? x : (x == 171 ? x : (x == 172 ? x : (x == 173 ? x : (x == 174 ? x : (x == 175 ? x : (x == 176 ? x : (x == 177 ? x : (x == 178 ? x : (x == 179 ? x : (x == 180 ? x : (x == 181 ? x : (x == 182 ? x : (x == 183 ? x : (x == 184 ? x : (x == 185 ? x : (x == 186 ? x : (x == 187 ? x : (x == 188 ? x : (x == 189 ? x : (x == 190 ? x : (x == 191 ? x : (x == 192 ? x : (x == 193 ? x : (x == 194 ? x : (x == 195 ? x : (x == 196 ? x : (x == 197 ? x : (x == 198 ? x : (x == 199 ? x : (x == 200 ? x : (x == 201 ? x : (x == 202 ? x : (x == 203 ? x : (x == 204 ? x : (x == 205 ? x : (x == 206 ? x : (x == 207 ? x : (x == 208 ? x : (x == 209 ? x : (x == 210 ? x : (x == 211 ? x : (x == 212 ? x : (x == 213 ? x : (x == 214 ? x : (x == 215 ? x : (x == 216 ? x : (x == 217 ? x : (x == 218 ? x : (x == 219 ? x : (x == 220 ? x : (x == 221 ? x : (x == 222 ? x : (x == 223 ? x : (x == 224 ? x : (x == 225 ? x : (x == 226 ? x : (x == 227 ? x : (x == 228 ? x : (x == 229 ? x : (x == 230 ? x : (x == 231 ? x : (x == 232 ? x : (x == 233 ? x : (x == 234 ? x : (x == 235 ? x : (x == 236 ? x : (x == 237 ? x : (x == 238 ? x : (x == 239 ? x : (x == 240 ? x : (x == 241 ? x : (x == 242 ? x : (x == 243 ? x : (x == 244 ? x : (x == 245 ? x : (x == 246 ? x : (x == 247 ? x : (x == 248 ? x : (x == 249 ? x : (x == 250 ? x : (x == 251 ? x : (x == 252 ? x : (x == 253 ? x : (x == 254 ? x : (x == 255 ? x : 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
|
||||
}
|
||||
program test.aleo {
|
||||
function main() -> u8 {
|
||||
const x: u8 = 255;
|
||||
|
||||
return x == 0 ? x : (x == 1 ? x : (x == 2 ? x : (x == 3 ? x : (x == 4 ? x : (x == 5 ? x : (x == 6 ? x : (x == 7 ? x : (x == 8 ? x : (x == 9 ? x : (x == 10 ? x : (x == 11 ? x : (x == 12 ? x : (x == 13 ? x : (x == 14 ? x : (x == 15 ? x : (x == 16 ? x : (x == 17 ? x : (x == 18 ? x : (x == 19 ? x : (x == 20 ? x : (x == 21 ? x : (x == 22 ? x : (x == 23 ? x : (x == 24 ? x : (x == 25 ? x : (x == 26 ? x : (x == 27 ? x : (x == 28 ? x : (x == 29 ? x : (x == 30 ? x : (x == 31 ? x : (x == 32 ? x : (x == 33 ? x : (x == 34 ? x : (x == 35 ? x : (x == 36 ? x : (x == 37 ? x : (x == 38 ? x : (x == 39 ? x : (x == 40 ? x : (x == 41 ? x : (x == 42 ? x : (x == 43 ? x : (x == 44 ? x : (x == 45 ? x : (x == 46 ? x : (x == 47 ? x : (x == 48 ? x : (x == 49 ? x : (x == 50 ? x : (x == 51 ? x : (x == 52 ? x : (x == 53 ? x : (x == 54 ? x : (x == 55 ? x : (x == 56 ? x : (x == 57 ? x : (x == 58 ? x : (x == 59 ? x : (x == 60 ? x : (x == 61 ? x : (x == 62 ? x : (x == 63 ? x : (x == 64 ? x : (x == 65 ? x : (x == 66 ? x : (x == 67 ? x : (x == 68 ? x : (x == 69 ? x : (x == 70 ? x : (x == 71 ? x : (x == 72 ? x : (x == 73 ? x : (x == 74 ? x : (x == 75 ? x : (x == 76 ? x : (x == 77 ? x : (x == 78 ? x : (x == 79 ? x : (x == 80 ? x : (x == 81 ? x : (x == 82 ? x : (x == 83 ? x : (x == 84 ? x : (x == 85 ? x : (x == 86 ? x : (x == 87 ? x : (x == 88 ? x : (x == 89 ? x : (x == 90 ? x : (x == 91 ? x : (x == 92 ? x : (x == 93 ? x : (x == 94 ? x : (x == 95 ? x : (x == 96 ? x : (x == 97 ? x : (x == 98 ? x : (x == 99 ? x : (x == 100 ? x : (x == 101 ? x : (x == 102 ? x : (x == 103 ? x : (x == 104 ? x : (x == 105 ? x : (x == 106 ? x : (x == 107 ? x : (x == 108 ? x : (x == 109 ? x : (x == 110 ? x : (x == 111 ? x : (x == 112 ? x : (x == 113 ? x : (x == 114 ? x : (x == 115 ? x : (x == 116 ? x : (x == 117 ? x : (x == 118 ? x : (x == 119 ? x : (x == 120 ? x : (x == 121 ? x : (x == 122 ? x : (x == 123 ? x : (x == 124 ? x : (x == 125 ? x : (x == 126 ? x : (x == 127 ? x : (x == 128 ? x : (x == 129 ? x : (x == 130 ? x : (x == 131 ? x : (x == 132 ? x : (x == 133 ? x : (x == 134 ? x : (x == 135 ? x : (x == 136 ? x : (x == 137 ? x : (x == 138 ? x : (x == 139 ? x : (x == 140 ? x : (x == 141 ? x : (x == 142 ? x : (x == 143 ? x : (x == 144 ? x : (x == 145 ? x : (x == 146 ? x : (x == 147 ? x : (x == 148 ? x : (x == 149 ? x : (x == 150 ? x : (x == 151 ? x : (x == 152 ? x : (x == 153 ? x : (x == 154 ? x : (x == 155 ? x : (x == 156 ? x : (x == 157 ? x : (x == 158 ? x : (x == 159 ? x : (x == 160 ? x : (x == 161 ? x : (x == 162 ? x : (x == 163 ? x : (x == 164 ? x : (x == 165 ? x : (x == 166 ? x : (x == 167 ? x : (x == 168 ? x : (x == 169 ? x : (x == 170 ? x : (x == 171 ? x : (x == 172 ? x : (x == 173 ? x : (x == 174 ? x : (x == 175 ? x : (x == 176 ? x : (x == 177 ? x : (x == 178 ? x : (x == 179 ? x : (x == 180 ? x : (x == 181 ? x : (x == 182 ? x : (x == 183 ? x : (x == 184 ? x : (x == 185 ? x : (x == 186 ? x : (x == 187 ? x : (x == 188 ? x : (x == 189 ? x : (x == 190 ? x : (x == 191 ? x : (x == 192 ? x : (x == 193 ? x : (x == 194 ? x : (x == 195 ? x : (x == 196 ? x : (x == 197 ? x : (x == 198 ? x : (x == 199 ? x : (x == 200 ? x : (x == 201 ? x : (x == 202 ? x : (x == 203 ? x : (x == 204 ? x : (x == 205 ? x : (x == 206 ? x : (x == 207 ? x : (x == 208 ? x : (x == 209 ? x : (x == 210 ? x : (x == 211 ? x : (x == 212 ? x : (x == 213 ? x : (x == 214 ? x : (x == 215 ? x : (x == 216 ? x : (x == 217 ? x : (x == 218 ? x : (x == 219 ? x : (x == 220 ? x : (x == 221 ? x : (x == 222 ? x : (x == 223 ? x : (x == 224 ? x : (x == 225 ? x : (x == 226 ? x : (x == 227 ? x : (x == 228 ? x : (x == 229 ? x : (x == 230 ? x : (x == 231 ? x : (x == 232 ? x : (x == 233 ? x : (x == 234 ? x : (x == 235 ? x : (x == 236 ? x : (x == 237 ? x : (x == 238 ? x : (x == 239 ? x : (x == 240 ? x : (x == 241 ? x : (x == 242 ? x : (x == 243 ? x : (x == 244 ? x : (x == 245 ? x : (x == 246 ? x : (x == 247 ? x : (x == 248 ? x : (x == 249 ? x : (x == 250 ? x : (x == 251 ? x : (x == 252 ? x : (x == 253 ? x : (x == 254 ? x : (x == 255 ? x : 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
|
||||
}}
|
||||
|
@ -3,294 +3,295 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
type g8SH = u8;
|
||||
|
||||
type V8fkp = u128;
|
||||
|
||||
const vxlan = 13658i16;
|
||||
|
||||
|
||||
circuit sylcl {
|
||||
bTxd7: bool,
|
||||
tfTQr: bool,
|
||||
l_Dfk: u32,
|
||||
YDbf: address,
|
||||
}
|
||||
|
||||
|
||||
function xGEs (
|
||||
const GEF7g: i32,
|
||||
eLHo5: i64
|
||||
) -> i64 {
|
||||
let bx6u = vRAg().0;
|
||||
let rasm: L9Snz = L9Snz {};
|
||||
let os4Ds: u128 = GzzO {RAyvy: '\u{6c495}', SGgTI: 3364i16, egtP: 45362813883629178786173234355737419504u128, AWm8P: '?'}.egtP;
|
||||
os4Ds -= os4Ds;
|
||||
os4Ds /= 255906798014072409735665528987467201281u128;
|
||||
os4Ds /= 99955633017584705512543248634901668143u128;
|
||||
if -49 < 74i8 || 6832u16 < 10718 {
|
||||
if 59 == 214u8 && eLHo5 > 7620307708530543535i64 {
|
||||
let oiM6V: i16 = vxlan;
|
||||
}
|
||||
bx6u -= bx6u;
|
||||
if 246u8 >= 109u8 && eLHo5 == 1907427762104562352i64 {
|
||||
let mcFo = -22613i16;
|
||||
mcFo *= 0i16;
|
||||
let gVku = GEF7g;
|
||||
let RzrP = false;
|
||||
RzrP = RzrP;
|
||||
const pMb5 = L9Snz {};
|
||||
}
|
||||
let FZVVE: char = L9Snz {}.lVSr(aleo1l44kg5uyj8psnfx76reyfwxltrxgn9jmum854grpjyal2rmjmg9qdsl3ch, -60, 95u8).2;
|
||||
let GDk3: bool = true;
|
||||
const ZHf8: bool = [[16281139673755659036u64; (2, 1)], [6465961370876558468u64; (2, 1)], [[8138243358139830344u64], [3000896053881090062u64; 1]]] == [[7249604088430675863u64; (2, 1)], [13296609702861980977u64; (2, 1)], [3670298495564722569u64; (2, 1)]] && 116u8 > 246u8;
|
||||
program test.aleo {
|
||||
type g8SH = u8;
|
||||
|
||||
type V8fkp = u128;
|
||||
|
||||
const vxlan = 13658i16;
|
||||
|
||||
|
||||
struct sylcl {
|
||||
bTxd7: bool,
|
||||
tfTQr: bool,
|
||||
l_Dfk: u32,
|
||||
YDbf: address,
|
||||
}
|
||||
|
||||
|
||||
function xGEs (
|
||||
const GEF7g: i32,
|
||||
eLHo5: i64
|
||||
) -> i64 {
|
||||
let bx6u = vRAg().0;
|
||||
let rasm: L9Snz = L9Snz {};
|
||||
let os4Ds: u128 = GzzO {RAyvy: '\u{6c495}', SGgTI: 3364i16, egtP: 45362813883629178786173234355737419504u128, AWm8P: '?'}.egtP;
|
||||
os4Ds -= os4Ds;
|
||||
os4Ds = os4Ds;
|
||||
} else if 93 != 7u8 || GEF7g < GEF7g {
|
||||
rasm = L9Snz {};
|
||||
let m8V0a: u16 = 6407;
|
||||
for YbMQ in 4091427659..4091427666 {
|
||||
m8V0a *= 0;
|
||||
bx6u = bx6u;
|
||||
os4Ds += os4Ds;
|
||||
rasm = rasm;
|
||||
}
|
||||
let nS4e: i8 = L9Snz {}.lVSr(aleo1ryu48sn5dx2gzlj0ua2dwyr46vedrrquhgxy8pnz6573rv8yqvpsmf6yzw, -77i8, true? 192u8 : 85).1;
|
||||
let jVsd: u32 = 3917661453u32;
|
||||
} else {
|
||||
const sj7Zv: field = 6936563642754163774323863008557263080068986485051214421772383532120071479321376198608464936088274231279486051362571687204548709195936208048652073445197732field;
|
||||
let VVDV = vxlan;
|
||||
let km18x = sj7Zv;
|
||||
if 15299435342099296908u64 >= 10738044447347729216u64 && rasm.lVSr(aleo1ckzy8audkf2p6ve2u0040gvrk6mx9n0v088a3yc5x6rxmlv0pgxser0gzf, -31i8, 118u8).0 > 1395837987u32 {
|
||||
if GEF7g <= GEF7g && ('\u{4133d}', 4990i16, aleo103cz6xcutagglr2e0rd0a46fnxxe6snfy05xqlardpanh4xjzqzqdkqpdz, os4Ds) != ('\u{7d}', VVDV * -2 - -25042i16, aleo10aandr8pvdg247lkmhqx0aef5ne4qlta245aynk80s4apydu559qcejjfl, 14813985053938346415046704789243138087u128) {
|
||||
bx6u += 14534558459111474236125164661730846152;
|
||||
VVDV /= vxlan;
|
||||
let AiteH: i32 = GEF7g;
|
||||
const seLUa: u16 = 23669u16;
|
||||
rasm = L9Snz {};
|
||||
} else if 159041408574150617959504640080391229811i128 <= bx6u || [14520, -14785i16, 3573i16] != [27584i16; 3] || VVDV > (false? 13752 : VVDV) {
|
||||
let xcvaS: field = 9495245829840311343768687500773412503474341293258678863329364855536358225067251860919673558180589446104317770373242242395342021886202312053663829628088260field;
|
||||
const aYuS: u32 = 3607927114u32;
|
||||
} else {
|
||||
km18x -= BHZjx(true, false, -55i8);
|
||||
bx6u += 34857824809713610052533673270581503998;
|
||||
let F6K4N: u128 = 47882796570533061725516167600161938873u128;
|
||||
L9Snz::PC0R(aleo10kumj5drme862697k98qnjn4dfxgry0keh55ad7hqgf5l9l23urquakjcx, 12113665486601200705u64 - (3034261385238854337 - 11626787452540944465 / 17758492766977014633u64 * 0u64 - 826119920202656664) + 10861478653900843501u64 / 11072739276507297001u64);
|
||||
os4Ds /= 255906798014072409735665528987467201281u128;
|
||||
os4Ds /= 99955633017584705512543248634901668143u128;
|
||||
if -49 < 74i8 || 6832u16 < 10718 {
|
||||
if 59 == 214u8 && eLHo5 > 7620307708530543535i64 {
|
||||
let oiM6V: i16 = vxlan;
|
||||
}
|
||||
let vIMt: i8 = -44i8;
|
||||
km18x += km18x;
|
||||
let q3qEF = aleo1qq4psjpe72kuwc2fs4rrerd5rxd09p90p6x3h9rwnzyl889f95xq00uatz;
|
||||
} else if 208u8 - 186 * 11 ** 0 + 111u8 == 177 || 7877i16 >= (false? vxlan : vxlan) {
|
||||
let NYB27 = GEF7g;
|
||||
L9Snz::PC0R(aleo1egfcvnawsy6hs0nc7pjl4s5ne4k7n60luu4ratkk208fal5dpvpqun3hym, 12155192664761333265);
|
||||
let nfZC: u64 = 6057621151098931675u64;
|
||||
const fwAeC: i128 = 96615783596569824584153535316491335220i128;
|
||||
} else {
|
||||
let c4S4V: [i32; 1] = [GEF7g];
|
||||
let hFQ1: char = '~';
|
||||
}
|
||||
}
|
||||
const W6AoN: L9Snz = L9Snz {};
|
||||
let zTGI: i64 = -4719638564784287794i64;
|
||||
const ZarBp: g8SH = 43u8;
|
||||
zTGI /= -4717776493235566297;
|
||||
const s2IF: u16 = 54046u16;
|
||||
let jEEwx: u32 = 2740345586;
|
||||
let GYYkA: field = 11582113721009926081533744146578992580659382705948021135670314230777109797210071657532235986079542543588709204398834785431450613982848535394935363785557969field;
|
||||
return eLHo5;
|
||||
}
|
||||
|
||||
circuit L9Snz {
|
||||
|
||||
function PC0R (
|
||||
const jevo: address,
|
||||
const PAVFU: u64
|
||||
) {
|
||||
const wiN0: i32 = -1258333968i32;
|
||||
const lB0z_: i64 = 6195651560731392364i64;
|
||||
const RMYXZ = lB0z_;
|
||||
const uY6e: i8 = 90i8;
|
||||
let m8v8: field = 1849045753805757079652732186700785301303603036928207700497640417309568558821969407937357366825028145150583808761466176190254377612596882180695831089782965;
|
||||
let VggtJ: u128 = 329104773346716025207789897721050367019u128;
|
||||
if -1190335173i32 - -1745345851i32 - wiN0 == 893384766 && (3950594431634582299294459077719375579440093722520345117175266254520038272680996320138725015909501750733428689005679387750685637768487056421097594765772537, 3108834599765871073, false) == (m8v8, PAVFU, true) {
|
||||
m8v8 += m8v8;
|
||||
let Ht_o5: i128 = -126434771302556954181557991774406279580i128;
|
||||
for ePzN in 1513798056u32..1513798074u32 {
|
||||
const v5KBA: i32 = -126706873i32;
|
||||
let N9Me: bool = false;
|
||||
bx6u -= bx6u;
|
||||
if 246u8 >= 109u8 && eLHo5 == 1907427762104562352i64 {
|
||||
let mcFo = -22613i16;
|
||||
mcFo *= 0i16;
|
||||
let gVku = GEF7g;
|
||||
let RzrP = false;
|
||||
RzrP = RzrP;
|
||||
const pMb5 = L9Snz {};
|
||||
}
|
||||
let FZVVE: char = L9Snz {}.lVSr(aleo1l44kg5uyj8psnfx76reyfwxltrxgn9jmum854grpjyal2rmjmg9qdsl3ch, -60, 95u8).2;
|
||||
let GDk3: bool = true;
|
||||
const ZHf8: bool = [[16281139673755659036u64; (2, 1)], [6465961370876558468u64; (2, 1)], [[8138243358139830344u64], [3000896053881090062u64; 1]]] == [[7249604088430675863u64; (2, 1)], [13296609702861980977u64; (2, 1)], [3670298495564722569u64; (2, 1)]] && 116u8 > 246u8;
|
||||
os4Ds -= os4Ds;
|
||||
os4Ds = os4Ds;
|
||||
} else if 93 != 7u8 || GEF7g < GEF7g {
|
||||
rasm = L9Snz {};
|
||||
let m8V0a: u16 = 6407;
|
||||
for YbMQ in 4091427659..4091427666 {
|
||||
m8V0a *= 0;
|
||||
bx6u = bx6u;
|
||||
os4Ds += os4Ds;
|
||||
rasm = rasm;
|
||||
}
|
||||
if 19850u16 <= 62489 || jevo != aleo1prwdx2qgu22n582kpgrg2a0kluftlsvust0q5xc0a27td7ufuy8su0g8tc && 254u8 != 117u8 {
|
||||
m8v8 += m8v8;
|
||||
Ht_o5 /= 11553847366431664216173263832376498087;
|
||||
let mRGK5: Self = Self {};
|
||||
let Skij = (55323u16, 126908632682311371168460144412966650831u128);
|
||||
m8v8 *= m8v8;
|
||||
let Ob5d = 2249779739u32;
|
||||
} else if 43071 <= 13140u16 || 42i8 <= uY6e && VggtJ != 154955034616989135434658403414435434895u128 {
|
||||
Ht_o5 += -6518746069029094677594415956468576403;
|
||||
if -5143 == vxlan || lB0z_ <= RMYXZ && VggtJ != VggtJ {
|
||||
VggtJ /= 157415906375046026780197645612102072420 + VggtJ / 200052657326939673132260906854658100686u128;
|
||||
Ht_o5 = Ht_o5;
|
||||
VggtJ /= VggtJ;
|
||||
let FEcY: address = jevo;
|
||||
let Ir2a = 500071970u32 ** 1u32 / 1327371589u32 * 2234521563u32 ** 1u32;
|
||||
const H_Wk = 140u8;
|
||||
Ht_o5 *= 1i128;
|
||||
let dgMO: Self = L9Snz {};
|
||||
} else if [(82i8, (168959946214662978530327896234211537106u128, (false, 12427427169985374723u64, -31456683461208515088456471787726297252i128, 56i8), (4908752618911443246697506192699588067797133636811902421444208448276619938465397710091372538939536414834528928690449062642613610859703225105481852391756372, '\u{706ea}', 4110780615))); 3] != [(7i8, (159139823899295607358682071997551895501u128, (true, 7477239449005644245u64, -98086754633827235468560233858202930964i128, -37i8), (8339532360997214503380546868946290675233376404602181916084341884293192858826000124252309397076808078470262081187984894041055791561714485960939858801444598field, 'K', 541080119u32))); 3] || aleo1v2tk5snmzp4f63c2tess4jgrppvh9amhtceknqg0lnwzpxreucqszqllch != jevo || 12504227462827476074631665974540786136397624300384090157368248825104544021070628315696049833177009832750518440263927963531548326394629426013067610843273555field != m8v8 {
|
||||
VggtJ += 8257065096993585333727606071356438242u128;
|
||||
VggtJ -= VggtJ;
|
||||
let nS4e: i8 = L9Snz {}.lVSr(aleo1ryu48sn5dx2gzlj0ua2dwyr46vedrrquhgxy8pnz6573rv8yqvpsmf6yzw, -77i8, true? 192u8 : 85).1;
|
||||
let jVsd: u32 = 3917661453u32;
|
||||
} else {
|
||||
const sj7Zv: field = 6936563642754163774323863008557263080068986485051214421772383532120071479321376198608464936088274231279486051362571687204548709195936208048652073445197732field;
|
||||
let VVDV = vxlan;
|
||||
let km18x = sj7Zv;
|
||||
if 15299435342099296908u64 >= 10738044447347729216u64 && rasm.lVSr(aleo1ckzy8audkf2p6ve2u0040gvrk6mx9n0v088a3yc5x6rxmlv0pgxser0gzf, -31i8, 118u8).0 > 1395837987u32 {
|
||||
if GEF7g <= GEF7g && ('\u{4133d}', 4990i16, aleo103cz6xcutagglr2e0rd0a46fnxxe6snfy05xqlardpanh4xjzqzqdkqpdz, os4Ds) != ('\u{7d}', VVDV * -2 - -25042i16, aleo10aandr8pvdg247lkmhqx0aef5ne4qlta245aynk80s4apydu559qcejjfl, 14813985053938346415046704789243138087u128) {
|
||||
bx6u += 14534558459111474236125164661730846152;
|
||||
VVDV /= vxlan;
|
||||
let AiteH: i32 = GEF7g;
|
||||
const seLUa: u16 = 23669u16;
|
||||
rasm = L9Snz {};
|
||||
} else if 159041408574150617959504640080391229811i128 <= bx6u || [14520, -14785i16, 3573i16] != [27584i16; 3] || VVDV > (false? 13752 : VVDV) {
|
||||
let xcvaS: field = 9495245829840311343768687500773412503474341293258678863329364855536358225067251860919673558180589446104317770373242242395342021886202312053663829628088260field;
|
||||
const aYuS: u32 = 3607927114u32;
|
||||
} else {
|
||||
km18x -= BHZjx(true, false, -55i8);
|
||||
bx6u += 34857824809713610052533673270581503998;
|
||||
let F6K4N: u128 = 47882796570533061725516167600161938873u128;
|
||||
L9Snz::PC0R(aleo10kumj5drme862697k98qnjn4dfxgry0keh55ad7hqgf5l9l23urquakjcx, 12113665486601200705u64 - (3034261385238854337 - 11626787452540944465 / 17758492766977014633u64 * 0u64 - 826119920202656664) + 10861478653900843501u64 / 11072739276507297001u64);
|
||||
}
|
||||
let omLT = VggtJ;
|
||||
const ld6U = 37u8;
|
||||
const vk_Q: char = '\u{eee33}';
|
||||
let qbiu = PAVFU;
|
||||
let vIMt: i8 = -44i8;
|
||||
km18x += km18x;
|
||||
let q3qEF = aleo1qq4psjpe72kuwc2fs4rrerd5rxd09p90p6x3h9rwnzyl889f95xq00uatz;
|
||||
} else if 208u8 - 186 * 11 ** 0 + 111u8 == 177 || 7877i16 >= (false? vxlan : vxlan) {
|
||||
let NYB27 = GEF7g;
|
||||
L9Snz::PC0R(aleo1egfcvnawsy6hs0nc7pjl4s5ne4k7n60luu4ratkk208fal5dpvpqun3hym, 12155192664761333265);
|
||||
let nfZC: u64 = 6057621151098931675u64;
|
||||
const fwAeC: i128 = 96615783596569824584153535316491335220i128;
|
||||
} else {
|
||||
const jM_M: address = aleo1sxg244usp0cx2vtdtacgm3vfayw228ga09faemh2q6tlej20fugsfa4zlc;
|
||||
m8v8 += m8v8;
|
||||
let O90S: char = '\u{49}';
|
||||
let fFzmH: i8 = -105i8;
|
||||
O90S = O90S;
|
||||
let hq5x: u8 = 181;
|
||||
const uZWn = aleo1w5njju0sa75nql82pld5uhz52hu3dw4st6cyx03ssvnxrs8ctsrqzntzjx;
|
||||
const FAjJc = 99u8;
|
||||
VggtJ += 994150734172258795168679886244864026u128;
|
||||
let c4S4V: [i32; 1] = [GEF7g];
|
||||
let hFQ1: char = '~';
|
||||
}
|
||||
let IphzC: char = '\x40';
|
||||
let amRFn: u64 = 7564051209867924479u64;
|
||||
amRFn += amRFn;
|
||||
m8v8 += 1347255737663462458814024878372058932536755071869327526992498831547110157173;
|
||||
}
|
||||
const yLQS4 = -55550312298071716641145606375319507761i128;
|
||||
VggtJ += 1382746757304325437648861664794573230;
|
||||
const W6AoN: L9Snz = L9Snz {};
|
||||
let zTGI: i64 = -4719638564784287794i64;
|
||||
const ZarBp: g8SH = 43u8;
|
||||
zTGI /= -4717776493235566297;
|
||||
const s2IF: u16 = 54046u16;
|
||||
let jEEwx: u32 = 2740345586;
|
||||
let GYYkA: field = 11582113721009926081533744146578992580659382705948021135670314230777109797210071657532235986079542543588709204398834785431450613982848535394935363785557969field;
|
||||
return eLHo5;
|
||||
}
|
||||
|
||||
struct L9Snz {
|
||||
|
||||
function PC0R (
|
||||
const jevo: address,
|
||||
const PAVFU: u64
|
||||
) {
|
||||
const wiN0: i32 = -1258333968i32;
|
||||
const lB0z_: i64 = 6195651560731392364i64;
|
||||
const RMYXZ = lB0z_;
|
||||
const uY6e: i8 = 90i8;
|
||||
let m8v8: field = 1849045753805757079652732186700785301303603036928207700497640417309568558821969407937357366825028145150583808761466176190254377612596882180695831089782965;
|
||||
let VggtJ: u128 = 329104773346716025207789897721050367019u128;
|
||||
if -1190335173i32 - -1745345851i32 - wiN0 == 893384766 && (3950594431634582299294459077719375579440093722520345117175266254520038272680996320138725015909501750733428689005679387750685637768487056421097594765772537, 3108834599765871073, false) == (m8v8, PAVFU, true) {
|
||||
m8v8 += m8v8;
|
||||
let Ht_o5: i128 = -126434771302556954181557991774406279580i128;
|
||||
for ePzN in 1513798056u32..1513798074u32 {
|
||||
const v5KBA: i32 = -126706873i32;
|
||||
let N9Me: bool = false;
|
||||
}
|
||||
if 19850u16 <= 62489 || jevo != aleo1prwdx2qgu22n582kpgrg2a0kluftlsvust0q5xc0a27td7ufuy8su0g8tc && 254u8 != 117u8 {
|
||||
m8v8 += m8v8;
|
||||
Ht_o5 /= 11553847366431664216173263832376498087;
|
||||
let mRGK5: Self = Self {};
|
||||
let Skij = (55323u16, 126908632682311371168460144412966650831u128);
|
||||
m8v8 *= m8v8;
|
||||
let Ob5d = 2249779739u32;
|
||||
} else if 43071 <= 13140u16 || 42i8 <= uY6e && VggtJ != 154955034616989135434658403414435434895u128 {
|
||||
Ht_o5 += -6518746069029094677594415956468576403;
|
||||
if -5143 == vxlan || lB0z_ <= RMYXZ && VggtJ != VggtJ {
|
||||
VggtJ /= 157415906375046026780197645612102072420 + VggtJ / 200052657326939673132260906854658100686u128;
|
||||
Ht_o5 = Ht_o5;
|
||||
VggtJ /= VggtJ;
|
||||
let FEcY: address = jevo;
|
||||
let Ir2a = 500071970u32 ** 1u32 / 1327371589u32 * 2234521563u32 ** 1u32;
|
||||
const H_Wk = 140u8;
|
||||
Ht_o5 *= 1i128;
|
||||
let dgMO: Self = L9Snz {};
|
||||
} else if [(82i8, (168959946214662978530327896234211537106u128, (false, 12427427169985374723u64, -31456683461208515088456471787726297252i128, 56i8), (4908752618911443246697506192699588067797133636811902421444208448276619938465397710091372538939536414834528928690449062642613610859703225105481852391756372, '\u{706ea}', 4110780615))); 3] != [(7i8, (159139823899295607358682071997551895501u128, (true, 7477239449005644245u64, -98086754633827235468560233858202930964i128, -37i8), (8339532360997214503380546868946290675233376404602181916084341884293192858826000124252309397076808078470262081187984894041055791561714485960939858801444598field, 'K', 541080119u32))); 3] || aleo1v2tk5snmzp4f63c2tess4jgrppvh9amhtceknqg0lnwzpxreucqszqllch != jevo || 12504227462827476074631665974540786136397624300384090157368248825104544021070628315696049833177009832750518440263927963531548326394629426013067610843273555field != m8v8 {
|
||||
VggtJ += 8257065096993585333727606071356438242u128;
|
||||
VggtJ -= VggtJ;
|
||||
}
|
||||
let omLT = VggtJ;
|
||||
const ld6U = 37u8;
|
||||
const vk_Q: char = '\u{eee33}';
|
||||
let qbiu = PAVFU;
|
||||
} else {
|
||||
const jM_M: address = aleo1sxg244usp0cx2vtdtacgm3vfayw228ga09faemh2q6tlej20fugsfa4zlc;
|
||||
m8v8 += m8v8;
|
||||
let O90S: char = '\u{49}';
|
||||
let fFzmH: i8 = -105i8;
|
||||
O90S = O90S;
|
||||
let hq5x: u8 = 181;
|
||||
const uZWn = aleo1w5njju0sa75nql82pld5uhz52hu3dw4st6cyx03ssvnxrs8ctsrqzntzjx;
|
||||
const FAjJc = 99u8;
|
||||
VggtJ += 994150734172258795168679886244864026u128;
|
||||
}
|
||||
let IphzC: char = '\x40';
|
||||
let amRFn: u64 = 7564051209867924479u64;
|
||||
amRFn += amRFn;
|
||||
m8v8 += 1347255737663462458814024878372058932536755071869327526992498831547110157173;
|
||||
}
|
||||
const yLQS4 = -55550312298071716641145606375319507761i128;
|
||||
VggtJ += 1382746757304325437648861664794573230;
|
||||
//RETURN
|
||||
}
|
||||
|
||||
function lVSr (
|
||||
&self,
|
||||
const VPWYz: address,
|
||||
const ADX7z: i8,
|
||||
const MHWK: g8SH
|
||||
) -> (
|
||||
u32,
|
||||
i8,
|
||||
char
|
||||
) {
|
||||
const eE25S = -3822011864922848919i64;
|
||||
let uxka: u16 = 31601u16;
|
||||
uxka += uxka;
|
||||
if uxka <= 54663 || 73004126144557259973298592729951019722u128 >= ([93797552382304599553760067286520681501u128; 1], 4172437329985364529i64, '\n').0[0..][2624001942 / 1517112597 / 1355807694u32 * 2889503665u32 ** 1] {
|
||||
const lApV: field = 6481943367152243104806590714680752346978771244964332374740256234629614754980878356122381536407948609474900709582949603889949969672871965127817496727202767;
|
||||
let cGWZP: u128 = 297768269069440894845608851567366910735u128;
|
||||
self = self;
|
||||
cGWZP -= cGWZP;
|
||||
cGWZP *= cGWZP;
|
||||
let LtjA: i128 = -22748455429796320857927085170522829329i128;
|
||||
} else if 6360448123073416118i64 == eE25S && '\u{34641}' == '\u{7}' {
|
||||
self = L9Snz {};
|
||||
} else {
|
||||
uxka = uxka;
|
||||
let FuVKM = vxlan;
|
||||
uxka -= 97393095744128946381012954133028907306 != 255951602883594918442095360688675180909u128 || 17905u16 != uxka && VPWYz == VPWYz? false? 44721 : uxka : uxka;
|
||||
}
|
||||
uxka -= uxka;
|
||||
let KUdYh: i16 = vxlan;
|
||||
KUdYh /= vxlan;
|
||||
KUdYh *= vxlan;
|
||||
let VFAW = false;
|
||||
return (1316647196u32, 37i8, '\x30');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function main (
|
||||
y8dPm: u64,
|
||||
sGaj: field
|
||||
) {
|
||||
let BYEm7: i8 = 97i8;
|
||||
let hKmDf: address = aleo1m253gg39f4cwwud8sknlks2cn26v9sf9479l0yncaq5ukjxqzyzq2xxsnk;
|
||||
const HZ9fX: u64 = 16202246012581085813u64 / 12465500443043502478u64 - (true? 15981860521684494965u64 : 6911258910006412467u64) * 0u64 * 0u64;
|
||||
hKmDf = hKmDf;
|
||||
hKmDf = hKmDf;
|
||||
//RETURN
|
||||
}
|
||||
|
||||
function lVSr (
|
||||
&self,
|
||||
const VPWYz: address,
|
||||
const ADX7z: i8,
|
||||
const MHWK: g8SH
|
||||
) -> (
|
||||
u32,
|
||||
i8,
|
||||
char
|
||||
) {
|
||||
const eE25S = -3822011864922848919i64;
|
||||
let uxka: u16 = 31601u16;
|
||||
uxka += uxka;
|
||||
if uxka <= 54663 || 73004126144557259973298592729951019722u128 >= ([93797552382304599553760067286520681501u128; 1], 4172437329985364529i64, '\n').0[0..][2624001942 / 1517112597 / 1355807694u32 * 2889503665u32 ** 1] {
|
||||
const lApV: field = 6481943367152243104806590714680752346978771244964332374740256234629614754980878356122381536407948609474900709582949603889949969672871965127817496727202767;
|
||||
let cGWZP: u128 = 297768269069440894845608851567366910735u128;
|
||||
self = self;
|
||||
cGWZP -= cGWZP;
|
||||
cGWZP *= cGWZP;
|
||||
let LtjA: i128 = -22748455429796320857927085170522829329i128;
|
||||
} else if 6360448123073416118i64 == eE25S && '\u{34641}' == '\u{7}' {
|
||||
self = L9Snz {};
|
||||
} else {
|
||||
uxka = uxka;
|
||||
let FuVKM = vxlan;
|
||||
uxka -= 97393095744128946381012954133028907306 != 255951602883594918442095360688675180909u128 || 17905u16 != uxka && VPWYz == VPWYz? false? 44721 : uxka : uxka;
|
||||
}
|
||||
uxka -= uxka;
|
||||
let KUdYh: i16 = vxlan;
|
||||
KUdYh /= vxlan;
|
||||
KUdYh *= vxlan;
|
||||
let VFAW = false;
|
||||
return (1316647196u32, 37i8, '\x30');
|
||||
|
||||
function BHZjx (
|
||||
const nxhfV: bool,
|
||||
OZNlW: bool,
|
||||
const jOC4: i8
|
||||
) -> field {
|
||||
let y7gf: field = 3130031617100883476569946236122797668194325421420005827215337287002604866213025267543520081466666132894801153349496723370271679207682862665770825319434816field;
|
||||
L9Snz::PC0R(aleo14zwmfwd9he3v4hjw2r7q2ctskzgjh6dwf9kc7k30l693n3jgpgpsk5yu78, 9446428592253181660);
|
||||
let GlSb = y7gf;
|
||||
let WUY_d: ((u32, u16, (g8SH, i16, field), u64), (u16, bool, i16)) = ((526471171u32, 7788, (19, 32726, 3434891954732353975444046757534090600268209052607533063785913738816065601863253991997648873003147300684388051350506871325750697070337976614620994165271278), 7922971368721996438u64), (50902, false, -20508i16));
|
||||
GlSb = y7gf;
|
||||
WUY_d.0.3 = WUY_d.0.3;
|
||||
WUY_d.0.1 += WUY_d.0.1;
|
||||
const Sc7C9: [u32; 1] = nxhfV? [874307396; 1] : [2630291403u32];
|
||||
WUY_d.0.2.0 = WUY_d.0.2.0;
|
||||
let ycp91: char = '\x14';
|
||||
const DM0j: u128 = 331905196230135311940900941762579610102u128;
|
||||
return WUY_d.0.2.2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function main (
|
||||
y8dPm: u64,
|
||||
sGaj: field
|
||||
) {
|
||||
let BYEm7: i8 = 97i8;
|
||||
let hKmDf: address = aleo1m253gg39f4cwwud8sknlks2cn26v9sf9479l0yncaq5ukjxqzyzq2xxsnk;
|
||||
const HZ9fX: u64 = 16202246012581085813u64 / 12465500443043502478u64 - (true? 15981860521684494965u64 : 6911258910006412467u64) * 0u64 * 0u64;
|
||||
hKmDf = hKmDf;
|
||||
hKmDf = hKmDf;
|
||||
//RETURN
|
||||
}
|
||||
|
||||
function BHZjx (
|
||||
const nxhfV: bool,
|
||||
OZNlW: bool,
|
||||
const jOC4: i8
|
||||
) -> field {
|
||||
let y7gf: field = 3130031617100883476569946236122797668194325421420005827215337287002604866213025267543520081466666132894801153349496723370271679207682862665770825319434816field;
|
||||
L9Snz::PC0R(aleo14zwmfwd9he3v4hjw2r7q2ctskzgjh6dwf9kc7k30l693n3jgpgpsk5yu78, 9446428592253181660);
|
||||
let GlSb = y7gf;
|
||||
let WUY_d: ((u32, u16, (g8SH, i16, field), u64), (u16, bool, i16)) = ((526471171u32, 7788, (19, 32726, 3434891954732353975444046757534090600268209052607533063785913738816065601863253991997648873003147300684388051350506871325750697070337976614620994165271278), 7922971368721996438u64), (50902, false, -20508i16));
|
||||
GlSb = y7gf;
|
||||
WUY_d.0.3 = WUY_d.0.3;
|
||||
WUY_d.0.1 += WUY_d.0.1;
|
||||
const Sc7C9: [u32; 1] = nxhfV? [874307396; 1] : [2630291403u32];
|
||||
WUY_d.0.2.0 = WUY_d.0.2.0;
|
||||
let ycp91: char = '\x14';
|
||||
const DM0j: u128 = 331905196230135311940900941762579610102u128;
|
||||
return WUY_d.0.2.2;
|
||||
}
|
||||
|
||||
circuit GzzO {
|
||||
RAyvy: char,
|
||||
SGgTI: i16,
|
||||
AWm8P: char,
|
||||
egtP: u128,
|
||||
}
|
||||
|
||||
|
||||
function D_6P (w9AC: L9Snz) -> (
|
||||
u32,
|
||||
((i8, g8SH, i16), [char; 3], L9Snz, field),
|
||||
i32
|
||||
) {
|
||||
const WWMs4: i128 = -6788181107836913317896185434758313415i128;
|
||||
const vv_n: u8 = (60u8, 16982434322799018778u64, -22964401300164128577831495677249421197i128, -481530683i32).0;
|
||||
const xHZT: i64 = -7542558825982757778;
|
||||
let RA0L4 = 2253591488u32;
|
||||
const JzkI: u128 = 51423136685081598067078208885837881611u128;
|
||||
RA0L4 *= 0;
|
||||
L9Snz::PC0R(aleo1ghg8n2kv59k7waylx9pu2juxe78khyq5mxqx4swk86wm6nld9cpszerza4, 14748858242389516977);
|
||||
let gZid: sylcl = sylcl {bTxd7: true, YDbf: aleo1r42wfxvqg6h2r8sxazq332sd4fxc4ftvg0q0zsveptrcykd7syxswwf3au, l_Dfk: RA0L4, tfTQr: true};
|
||||
gZid.bTxd7 = gZid.bTxd7;
|
||||
let qjKhR: u32 = 2925082278u32;
|
||||
let EJISu = BHZjx(true, true, -71i8);
|
||||
if 3985509016058024290 == 9147622246534204847u64 || EJISu + EJISu / EJISu - EJISu + BHZjx(false, gZid.tfTQr, 96i8) * EJISu != EJISu && JzkI != JzkI {
|
||||
gZid = sylcl {l_Dfk: qjKhR, tfTQr: true, YDbf: gZid.YDbf, bTxd7: gZid.tfTQr};
|
||||
const p36lW = [(-814427734842719938i64, 5339320581377470661u64, 294113937729276405578547191689392764549u128); 4];
|
||||
gZid.l_Dfk -= RA0L4;
|
||||
let VsEWm = gZid.bTxd7;
|
||||
gZid.l_Dfk **= 1u32;
|
||||
const EJGTh: field = 5561661189369667961686502997982535065877055308324648778039167906404275824028130538460917576931123645230444575965776072667677113915103516873246679748569999;
|
||||
EJISu /= EJISu;
|
||||
return (L9Snz {}.lVSr(aleo1r20fxtjjsq4cmcz0tvc69442g3x3amd7m79ds400q4vqrqy4gsrsap5q7y, -32, vv_n).0, ((-114i8, vv_n, 10216i16), [L9Snz {}.lVSr(aleo1263sz4dh99ch5arrgk9rqju8vm3vv889c5r9w85p3wmjwmtadu9qzqa7vk, 92, vv_n).2; 3], w9AC, EJGTh), -1086114968i32);
|
||||
} else if 18247u16 != 2832u16 && -2070179985i32 >= -832203371i32 || 2108854800u32 > RA0L4 {
|
||||
const nmbh: u32 = 1251166277u32;
|
||||
let SsR5h = gZid.l_Dfk;
|
||||
let HVAa = w9AC;
|
||||
return (3766010195u32, ((-105i8, 162u8, 26251), ['\u{4e}'; 3], L9Snz {}, 3783102502099847461136024093398414597616258289790210683307756458700958277778997744007793644412769648771201890253252209457549966246727682027693578962905328), 1405827686i32);
|
||||
} else {
|
||||
EJISu /= EJISu;
|
||||
const ecan: bool = false;
|
||||
return (RA0L4, ((73i8, 67u8, -28746i16), ['\\'; 3], L9Snz {}, 9939607077961044954502119705805750533325928371640903562794817944828499108518903389133383383289034846905481326089002555501553000756689627524145002624427458field), -1889793240i32);
|
||||
}
|
||||
}
|
||||
|
||||
function vRAg () -> (
|
||||
i128,
|
||||
(address, u16)
|
||||
) {
|
||||
let na_U: bool = false;
|
||||
let sa7tL: [bool; 2] = [true; 2];
|
||||
sa7tL[..2u32] = na_U? sa7tL : sa7tL[0..2u32];
|
||||
const bZ3_ = (5062121477657524756691001991959148343560642547664575296025469558174877724273997732296925246044794229476666182584113489143775657972780129591419547290910023field, '\u{5516b}');
|
||||
sa7tL[0] = sa7tL[0u32..][1u32];
|
||||
const FAXX: i128 = 82723903814286642271212537939014048713;
|
||||
const kENpX = aleo100khm587cspwmcafftyythvamha9z4gqrmne8hq5zqetyg3xmcpqmsjrhg;
|
||||
const Sr1Ln: address = kENpX;
|
||||
sa7tL = sa7tL;
|
||||
return (-65993239589993742548447387951590481703, (aleo1t0r4zqurd4tkr8dqjhwk0ckzpdd7690v79f5xrstwa597u6qqspsazrgcp, 23506));
|
||||
}
|
||||
|
||||
struct GzzO {
|
||||
RAyvy: char,
|
||||
SGgTI: i16,
|
||||
AWm8P: char,
|
||||
egtP: u128,
|
||||
}
|
||||
|
||||
|
||||
function D_6P (w9AC: L9Snz) -> (
|
||||
u32,
|
||||
((i8, g8SH, i16), [char; 3], L9Snz, field),
|
||||
i32
|
||||
) {
|
||||
const WWMs4: i128 = -6788181107836913317896185434758313415i128;
|
||||
const vv_n: u8 = (60u8, 16982434322799018778u64, -22964401300164128577831495677249421197i128, -481530683i32).0;
|
||||
const xHZT: i64 = -7542558825982757778;
|
||||
let RA0L4 = 2253591488u32;
|
||||
const JzkI: u128 = 51423136685081598067078208885837881611u128;
|
||||
RA0L4 *= 0;
|
||||
L9Snz::PC0R(aleo1ghg8n2kv59k7waylx9pu2juxe78khyq5mxqx4swk86wm6nld9cpszerza4, 14748858242389516977);
|
||||
let gZid: sylcl = sylcl {bTxd7: true, YDbf: aleo1r42wfxvqg6h2r8sxazq332sd4fxc4ftvg0q0zsveptrcykd7syxswwf3au, l_Dfk: RA0L4, tfTQr: true};
|
||||
gZid.bTxd7 = gZid.bTxd7;
|
||||
let qjKhR: u32 = 2925082278u32;
|
||||
let EJISu = BHZjx(true, true, -71i8);
|
||||
if 3985509016058024290 == 9147622246534204847u64 || EJISu + EJISu / EJISu - EJISu + BHZjx(false, gZid.tfTQr, 96i8) * EJISu != EJISu && JzkI != JzkI {
|
||||
gZid = sylcl {l_Dfk: qjKhR, tfTQr: true, YDbf: gZid.YDbf, bTxd7: gZid.tfTQr};
|
||||
const p36lW = [(-814427734842719938i64, 5339320581377470661u64, 294113937729276405578547191689392764549u128); 4];
|
||||
gZid.l_Dfk -= RA0L4;
|
||||
let VsEWm = gZid.bTxd7;
|
||||
gZid.l_Dfk **= 1u32;
|
||||
const EJGTh: field = 5561661189369667961686502997982535065877055308324648778039167906404275824028130538460917576931123645230444575965776072667677113915103516873246679748569999;
|
||||
EJISu /= EJISu;
|
||||
return (L9Snz {}.lVSr(aleo1r20fxtjjsq4cmcz0tvc69442g3x3amd7m79ds400q4vqrqy4gsrsap5q7y, -32, vv_n).0, ((-114i8, vv_n, 10216i16), [L9Snz {}.lVSr(aleo1263sz4dh99ch5arrgk9rqju8vm3vv889c5r9w85p3wmjwmtadu9qzqa7vk, 92, vv_n).2; 3], w9AC, EJGTh), -1086114968i32);
|
||||
} else if 18247u16 != 2832u16 && -2070179985i32 >= -832203371i32 || 2108854800u32 > RA0L4 {
|
||||
const nmbh: u32 = 1251166277u32;
|
||||
let SsR5h = gZid.l_Dfk;
|
||||
let HVAa = w9AC;
|
||||
return (3766010195u32, ((-105i8, 162u8, 26251), ['\u{4e}'; 3], L9Snz {}, 3783102502099847461136024093398414597616258289790210683307756458700958277778997744007793644412769648771201890253252209457549966246727682027693578962905328), 1405827686i32);
|
||||
} else {
|
||||
EJISu /= EJISu;
|
||||
const ecan: bool = false;
|
||||
return (RA0L4, ((73i8, 67u8, -28746i16), ['\\'; 3], L9Snz {}, 9939607077961044954502119705805750533325928371640903562794817944828499108518903389133383383289034846905481326089002555501553000756689627524145002624427458field), -1889793240i32);
|
||||
}
|
||||
}
|
||||
|
||||
function vRAg () -> (
|
||||
i128,
|
||||
(address, u16)
|
||||
) {
|
||||
let na_U: bool = false;
|
||||
let sa7tL: [bool; 2] = [true; 2];
|
||||
sa7tL[..2u32] = na_U? sa7tL : sa7tL[0..2u32];
|
||||
const bZ3_ = (5062121477657524756691001991959148343560642547664575296025469558174877724273997732296925246044794229476666182584113489143775657972780129591419547290910023field, '\u{5516b}');
|
||||
sa7tL[0] = sa7tL[0u32..][1u32];
|
||||
const FAXX: i128 = 82723903814286642271212537939014048713;
|
||||
const kENpX = aleo100khm587cspwmcafftyythvamha9z4gqrmne8hq5zqetyg3xmcpqmsjrhg;
|
||||
const Sr1Ln: address = kENpX;
|
||||
sa7tL = sa7tL;
|
||||
return (-65993239589993742548447387951590481703, (aleo1t0r4zqurd4tkr8dqjhwk0ckzpdd7690v79f5xrstwa597u6qqspsazrgcp, 23506));
|
||||
}}
|
||||
|
@ -3,399 +3,400 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
type JzT3X = t5RQ;
|
||||
|
||||
type RaEnk = JzT3X;
|
||||
|
||||
type qQAv = i64;
|
||||
|
||||
type lLyE = VdqTF;
|
||||
|
||||
type m1ys8 = address;
|
||||
|
||||
const nI8f: (bool, u128) = (false, 138624358552358706580496409244518932936u128);
|
||||
|
||||
|
||||
const JtPat: u8 = 22u8;
|
||||
|
||||
|
||||
function HnaR (
|
||||
ONK5A: field,
|
||||
jxBI: i16
|
||||
) -> (
|
||||
i32,
|
||||
(i16, [i16; 3], i64, u16),
|
||||
bool,
|
||||
[address; 2]
|
||||
) {
|
||||
let UiOY: u8 = 197;
|
||||
const uqDfG = 244u8;
|
||||
if 14 * -7i8 * 1 > 36 && UiOY == 50 {
|
||||
const Nsof: u16 = 61299u16;
|
||||
const xQG2 = (-78677041305034957029235253770237774612i128, Nsof);
|
||||
UiOY = 61u8;
|
||||
} else {
|
||||
UiOY *= 0;
|
||||
}
|
||||
let xABE: address = aleo18na4r4tmlh5fgmznsxvfx2edplc0l6qgtvrsx632qjq02z8xc5xsx62fcr;
|
||||
const k7_5F = 46213u16;
|
||||
let VoTi: bool = false;
|
||||
return (-189603432, (28990, [-1892i16; 3], -3751793658146050073, 53730), true, [aleo1mz2skscve8gq9d9j8lvsd3zmg4ppyewwkfwxxmlr053jjfxejg9sv9frxl; 2]);
|
||||
}
|
||||
|
||||
function Tw0p (jCQc: char) -> (
|
||||
u16,
|
||||
i128,
|
||||
u64,
|
||||
(u16, RaEnk)
|
||||
) {
|
||||
let NR_C: JzT3X = t5RQ {};
|
||||
let RD1U: field = 3006368756432145027093799683618550726093102506687552253093476217748623071135112833326420434244184050077234188883388733925420743627834963361535348967445941field;
|
||||
const V1nN = aleo1j9y6cc02tjpljhw3qlgte9y6l4zmxv0tzh386ksvk34m8hzawczqpqgsqr;
|
||||
let QI4RL: u32 = 4174894181u32;
|
||||
const wUpD: i8 = -73i8;
|
||||
let SZPz: u32 = 4125266212u32;
|
||||
NR_C = NR_C;
|
||||
const gVoY: lLyE = VdqTF {JkBcA: V1nN, vNAMH: true, qQtCF: 5057};
|
||||
const BEcUt = ('\u{8}', -6708122641235748559i64, -2730500549981686507i64);
|
||||
QI4RL /= QI4RL;
|
||||
let lH95z: u32 = QI4RL;
|
||||
return (6810u16, 122075245384760587708883454153053778463i128, 11162326899970246285u64, (15111u16, t5RQ {}));
|
||||
}
|
||||
|
||||
circuit t5RQ {
|
||||
}
|
||||
|
||||
|
||||
function fGeK (const YKvX: i8) -> u8 {
|
||||
if YKvX >= YKvX && false && YKvX <= YKvX {
|
||||
let QEAS: char = '\u{d1290}';
|
||||
const PzT2o = (3907343854998883480063214119544699297780621314687237535050680256515848549925979938945863859753374805327386884171897412321471780865498076822115347428113750field, -2127951728i32, 7820691722384525995u64);
|
||||
}
|
||||
let zYkk: i128 = -24135032554736812030416370574505501964i128;
|
||||
const VOer = -22376i16;
|
||||
zYkk -= zYkk;
|
||||
zYkk = zYkk;
|
||||
zYkk -= zYkk;
|
||||
return 199u8;
|
||||
}
|
||||
|
||||
circuit q2USj {
|
||||
GoGV: bool,
|
||||
aLCN: i32,
|
||||
E_t6: bool,
|
||||
qmz3: u8,
|
||||
|
||||
function GOYuA (
|
||||
self,
|
||||
const fY7mJ: Self,
|
||||
jWmq: u16,
|
||||
const nwZP: u8
|
||||
program test.aleo {
|
||||
type JzT3X = t5RQ;
|
||||
|
||||
type RaEnk = JzT3X;
|
||||
|
||||
type qQAv = i64;
|
||||
|
||||
type lLyE = VdqTF;
|
||||
|
||||
type m1ys8 = address;
|
||||
|
||||
const nI8f: (bool, u128) = (false, 138624358552358706580496409244518932936u128);
|
||||
|
||||
|
||||
const JtPat: u8 = 22u8;
|
||||
|
||||
|
||||
function HnaR (
|
||||
ONK5A: field,
|
||||
jxBI: i16
|
||||
) -> (
|
||||
[u32; 4],
|
||||
i64
|
||||
i32,
|
||||
(i16, [i16; 3], i64, u16),
|
||||
bool,
|
||||
[address; 2]
|
||||
) {
|
||||
let Avj6N: i32 = fY7mJ.aLCN;
|
||||
Avj6N = 364107726i32;
|
||||
const DX9q2 = fY7mJ.qmz3;
|
||||
if 483103504u32 > 2578589642u32 && aleo1m2cjlkawd5m0zl5rutsguz94y572mjj4u8lnxx2mq8pguhw4dqqsq9vcar == aleo1wnykcamqw5aghz56g8qrz90h7gqpm62zykyefp9vu85yqk2j0sqqachstx {
|
||||
const IjwUB: u32 = 4065726433u32;
|
||||
let c17Qz: u16 = jWmq;
|
||||
const BnL_: u128 = 51761633273380017465434432628428125170u128;
|
||||
let vxDm: i64 = -5494074842541052547i64;
|
||||
const lMmJc: field = 125545887137495523397577547635418533381158968954640996668608928671130971517914452783158107876547411564762624046750113283173064518704428534673396909364510field;
|
||||
} else if [201893701929816058901180594907743208728; 1] == [79982146642254653817983190224958060318u128; 1] && jWmq > jWmq && [aleo1qdck5ln6cpm3llqjk6mvhp6r5xltkv3syww8cfue0j7gwsusrvrqsmlh8h, aleo19cka50c6l7ua5a34lnfwhxlx2hs3jysn7pyuehf69kvv4gjwsqgqz6qzd5, aleo1y8q2w4zh2c7k9ee5fzsyeazyzmynv8wxrl2ec67lsdenhveqeuxsqjcwkp] != [aleo14d9jx649l5feffrk7s3xwyl5p3dz3dn7q2m65vyvg46y76chcqxske4jay; 3] {
|
||||
let Fzyfc = -22317i16 - -25418i16 + 14121i16;
|
||||
Avj6N **= 1;
|
||||
const Ram7m: i32 = fY7mJ.aLCN;
|
||||
const Jyap: address = aleo1hf5700rcpz68s7fspd25kat2felkmggzddstazkgmu7xt2syug8qu7nkjc;
|
||||
Fzyfc *= 0;
|
||||
Avj6N += (Ram7m / Ram7m / -1490396869i32) + self.aLCN * 1;
|
||||
Avj6N /= self.aLCN;
|
||||
const PBAT: i64 = -205621369696754507i64;
|
||||
let UiOY: u8 = 197;
|
||||
const uqDfG = 244u8;
|
||||
if 14 * -7i8 * 1 > 36 && UiOY == 50 {
|
||||
const Nsof: u16 = 61299u16;
|
||||
const xQG2 = (-78677041305034957029235253770237774612i128, Nsof);
|
||||
UiOY = 61u8;
|
||||
} else {
|
||||
const Dqt5E = 995262057u32;
|
||||
Avj6N -= self.aLCN;
|
||||
let XJms = 61i8;
|
||||
const vvOQZ: field = 2097735165804900312999580621838429207407595983420724021671887967978821818938171460938180437319640910570853915289167466089093039844862455656252123826976864field;
|
||||
let sP0I = (jWmq, '\x76');
|
||||
let S9uAD: u8 = fY7mJ.qmz3;
|
||||
UiOY *= 0;
|
||||
}
|
||||
let XPlIn = t5RQ {};
|
||||
let Dchf: char = '\u{79}';
|
||||
const L4mb: [i64; 1] = [(4498224565295528194i64, true).0; 1];
|
||||
XPlIn = XPlIn;
|
||||
return ([688873667u32; 4], -7142513596480754292i64);
|
||||
let xABE: address = aleo18na4r4tmlh5fgmznsxvfx2edplc0l6qgtvrsx632qjq02z8xc5xsx62fcr;
|
||||
const k7_5F = 46213u16;
|
||||
let VoTi: bool = false;
|
||||
return (-189603432, (28990, [-1892i16; 3], -3751793658146050073, 53730), true, [aleo1mz2skscve8gq9d9j8lvsd3zmg4ppyewwkfwxxmlr053jjfxejg9sv9frxl; 2]);
|
||||
}
|
||||
|
||||
function Bchw (&self, const RwPZX: i128) -> (
|
||||
|
||||
function Tw0p (jCQc: char) -> (
|
||||
u16,
|
||||
i8,
|
||||
i16,
|
||||
i64,
|
||||
char
|
||||
i128,
|
||||
u64,
|
||||
(u16, RaEnk)
|
||||
) {
|
||||
let UYSF: u128 = 262102823998991425630620909427922442176u128;
|
||||
let E1hjK = 10375244632967105723169088070309024219397254573760531061153053085696174606082038377241096687473895366928875518762523866901404864961733598111880816563280455field;
|
||||
let e4zkn = '\x32';
|
||||
const Tyz9 = aleo1jtjc68kf2x3euxufngq0mm7szwwvhpzugqzk7ej4p4wvhym4cursppgq38;
|
||||
self.E_t6 = self.GoGV;
|
||||
return (2520u16, -121i8, 13444i16, -6913886128685393087i64, '\x0c');
|
||||
let NR_C: JzT3X = t5RQ {};
|
||||
let RD1U: field = 3006368756432145027093799683618550726093102506687552253093476217748623071135112833326420434244184050077234188883388733925420743627834963361535348967445941field;
|
||||
const V1nN = aleo1j9y6cc02tjpljhw3qlgte9y6l4zmxv0tzh386ksvk34m8hzawczqpqgsqr;
|
||||
let QI4RL: u32 = 4174894181u32;
|
||||
const wUpD: i8 = -73i8;
|
||||
let SZPz: u32 = 4125266212u32;
|
||||
NR_C = NR_C;
|
||||
const gVoY: lLyE = VdqTF {JkBcA: V1nN, vNAMH: true, qQtCF: 5057};
|
||||
const BEcUt = ('\u{8}', -6708122641235748559i64, -2730500549981686507i64);
|
||||
QI4RL /= QI4RL;
|
||||
let lH95z: u32 = QI4RL;
|
||||
return (6810u16, 122075245384760587708883454153053778463i128, 11162326899970246285u64, (15111u16, t5RQ {}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function AXU_S () -> (
|
||||
address,
|
||||
field,
|
||||
char,
|
||||
[field; 1]
|
||||
) {
|
||||
const tVTY = [203u8; 3];
|
||||
let OV1kp = -1213152733781511670i64;
|
||||
let Xq_tC = VdqTF {vNAMH: false, qQtCF: -3948i16, JkBcA: aleo1vgkk9ymnjhhxe6vmul45rxu8d4g95euafvlqne26km9qr7m42g8qhkxkgf};
|
||||
let VIrY = 17593201753785968724348147573543201683u128;
|
||||
OV1kp -= OV1kp;
|
||||
const Q4U3S = 27137u16;
|
||||
let AlH2I: (i128, JzT3X) = (139188993752357605548144436826980887896i128, t5RQ {});
|
||||
const Vsvk: char = '1';
|
||||
Xq_tC = Xq_tC;
|
||||
let nf2yj: address = aleo1pyhp5pgv0np0n5pvtr7hg97ukj3hpd33jtpeg8hn08wgr9g49uzqaqxllp;
|
||||
return (aleo10nxyeq4s5l40wnl2vfl2llw78kgvt5enfeemlggmkkuuqhzqzsgsemhzt9, 10284116216941408283824722444823323169743229072384235793724572129107892255808365407378202665173472895512465558177101917815129958884392467286207303058249836, '🝎', [5251293705195853262669358257210379533137794199696014230716504931515180367833369101390595615074170181388161695941210696920452345567559460763086722252516477; 1]);
|
||||
}
|
||||
|
||||
function mH2Y9 (iEfoy: u8) -> (
|
||||
field,
|
||||
char,
|
||||
u8
|
||||
) {
|
||||
const fG0q3 = -59154251402565510076278685361797057569i128;
|
||||
let PrNua: u8 = iEfoy;
|
||||
PrNua *= 3;
|
||||
PrNua -= PrNua;
|
||||
PrNua *= PrNua;
|
||||
if 32668u16 != 21786u16 || (aleo1j49vf34whm0m4uws0estyu4gq5tht5zx0q6qzxmdzscnclmxfg9qdgzda0, 41540, 134304434296530196734061550676303486963u128) != (aleo1xva5m9jur0a0tprwqc8nzphgzgd6skjd0q0pw5cgr4neuu6l2ygsasgpk9, 55043u16, 129033633348452456271720971239228800745u128) && 24828206122290956941869728717938262622u128 == 190550268981330710707990793850974074495 {
|
||||
let FFxXY: i128 = fG0q3;
|
||||
}
|
||||
const mu6N = [7582669102660056372947255416050366024078733101207257721015648696292977286038066716759935417295636191557803704683778990632154263740251772206823891196733587field, 8196660721793919824431109574792746081235843603331574262589237067642966218636776362612899587315350318796338078462915808190066779316191244649686894554175818field, 7243540293239857928937388141203501039817875319585790175435641863324995357870510220128659842790875126815373993172381399497896402138463576231151096997987235field];
|
||||
const Bpf8B: RaEnk = t5RQ {};
|
||||
return (11817726415298897201781763882612161235674380541753244883813987091658618975514747358698825992261995321821959028187112813486614880508876689770337142994146408field, '\u{105181}', 212u8);
|
||||
}
|
||||
|
||||
circuit VdqTF {
|
||||
vNAMH: bool,
|
||||
JkBcA: address,
|
||||
qQtCF: i16,
|
||||
|
||||
function XBi3v (
|
||||
const SLNe2: u64,
|
||||
const ZceI: u8,
|
||||
const BU9w: q2USj
|
||||
) -> (
|
||||
u128,
|
||||
i32
|
||||
) {
|
||||
const iELE: ((u32, char), u128, i64) = ((384601192u32, '\u{5d}'), 260866785695740709874051028796502206859u128, -321465745518097240i64);
|
||||
let YfiVq = iELE.1;
|
||||
const iH8i = 47086u16;
|
||||
YfiVq *= 0u128;
|
||||
let Us69 = BU9w.qmz3;
|
||||
const gt_QR: i64 = iELE.2;
|
||||
let z26R: u16 = iH8i;
|
||||
const CwF6T = 2122017455351828831u64;
|
||||
Us69 = Us69;
|
||||
let a19dG = -86613533756289588059622956126783773336i128;
|
||||
if a19dG == -49319611420542273374035057559272823755 && SLNe2 <= SLNe2 && -23356 != -16419i16 {
|
||||
let kX9E: char = iELE.0.1;
|
||||
let AdkEx: [i16; 2] = [-5468i16; 2];
|
||||
const UcJQG: i64 = 1017251936437173056i64;
|
||||
let rm6_8: u8 = Us69;
|
||||
const zgZL: q2USj = BU9w;
|
||||
AdkEx[..1] = [AdkEx[0u32]];
|
||||
return (108204645183890682686172343964957448867u128, 1149096697i32);
|
||||
} else if -31 == -69i8 || a19dG <= a19dG {
|
||||
let zpnQ: u8 = 72;
|
||||
a19dG += 84542379573227848725665999581434532730;
|
||||
if iELE.0.1 == '{' && BU9w.E_t6 != !false && 100 >= (q2USj {aLCN: [(4158624514u32, 123278280530457701497833478904269469213u128, 375400254i32, 4030338526369534919352204641539656959774203635820637603220580819386423470678850085111744039458909079319352854489628011888463617722287850191230995765822356field); 1][0].2, GoGV: BU9w.E_t6, E_t6: BU9w.GoGV, qmz3: Us69 ** 0 + BU9w.qmz3}).Bchw(-85474839122628384091136338030133571122).1 {
|
||||
const j6mpM: u64 = CwF6T;
|
||||
const Qjgj = CwF6T;
|
||||
a19dG = a19dG;
|
||||
YfiVq *= 0u128;
|
||||
YfiVq *= YfiVq;
|
||||
if (true? aleo1zlkfjx7kmswac8kkz6gmrpp5wdlfyjcpa82p3sxlc7t9hdpxyurqr4pm0y : aleo18846l5defv4cmp707jzfmnyphxe05y94wgqljklkd2vuhujuccqqncphly) == aleo1vvzw6wwnr4qzw3c833wzzzglnamw6rqw4frucvz3cz4ca9d3hvgsjm8xaj && iELE.1 >= iELE.1 || j6mpM <= j6mpM {
|
||||
if Qjgj > Qjgj || -1777i16 <= -21839i16 {
|
||||
let jmjH1 = aleo18a6ztczu0l2rc0w2dxtqf6nlgwwqe9k99tq5el7w5kcwrc0085yqkey0fv;
|
||||
jmjH1 = jmjH1;
|
||||
a19dG -= a19dG;
|
||||
let HwJn: u64 = 17714981732057656865u64;
|
||||
YfiVq = iELE.1;
|
||||
let m3kTh = jmjH1;
|
||||
m3kTh = m3kTh;
|
||||
} else if mH2Y9(34).0 == mH2Y9(9u8).0 && 6273i16 < 4909 || -8867466881151025294i64 < gt_QR {
|
||||
YfiVq += iELE.1;
|
||||
a19dG -= a19dG;
|
||||
} else {
|
||||
let crw_: bool = true;
|
||||
zpnQ -= 24u8;
|
||||
const dsGM: [bool; 2] = BU9w.GoGV? [false, false] : [false, false];
|
||||
}
|
||||
let kJb1: char = '\x59';
|
||||
a19dG += BU9w.GoGV? a19dG : a19dG;
|
||||
zpnQ = 212u8;
|
||||
a19dG = a19dG;
|
||||
z26R = 55775u16;
|
||||
let SNxJp: u8 = zpnQ;
|
||||
a19dG += a19dG;
|
||||
const EPCfE: i64 = -2588330871158477199;
|
||||
} else {
|
||||
if 8297695527096070029141173015706745148u128 < YfiVq && ('#', 42214, 15441661, 3727013545) != ('\u{59}', 34058u16, 3653945965u32, 1129351315u32) {
|
||||
z26R += z26R - 55038u16 / iH8i - 30074u16;
|
||||
const hNyo: char = iELE.0.1;
|
||||
z26R = z26R;
|
||||
} else if Us69 == Us69 || 912492226995330448 > SLNe2 {
|
||||
Us69 = zpnQ;
|
||||
z26R += iH8i - z26R - 0 * z26R / iH8i / z26R;
|
||||
const B1Hx: u128 = iELE.1;
|
||||
let V9bJ4 = BU9w.E_t6;
|
||||
} else {
|
||||
const YHwJ7: i64 = 8808493453600301821i64;
|
||||
zpnQ += zpnQ;
|
||||
const mCw1_ = 7801278669036649611368151749591863685236870578853066004483602881165648711426811156956719869085171471031126066717127183381568375078432206971070288097037807field;
|
||||
YfiVq -= YfiVq;
|
||||
z26R -= z26R;
|
||||
a19dG += a19dG;
|
||||
let zHNJ = iELE.0.1;
|
||||
let wI7u: field = 2550144609268528440691705040114940648343270796680326402121986343650268171471569132206972126710945335689980818687697891282702140492021153719137048087792240field;
|
||||
}
|
||||
}
|
||||
const LkcEj = iELE.1;
|
||||
}
|
||||
for SogB in iELE.0.0..384601214 {
|
||||
let DYkE: u128 = iELE.1;
|
||||
const kAOX = BU9w.E_t6;
|
||||
DYkE -= DYkE;
|
||||
const M59dm: (u16, u64, field) = (43488u16, 9124896517185954065u64, 10561644927788416398392784857829962551661255265035645354800005079247111969376265845407072644801592007585225067672023612023814003754382765372559116699973115field);
|
||||
const JaobB = BU9w.aLCN;
|
||||
let WvXP = SLNe2;
|
||||
let VO6G: u128 = YfiVq;
|
||||
let ffilS: u16 = M59dm.0;
|
||||
let YZOB: [RaEnk; 1] = [t5RQ {}; 1];
|
||||
}
|
||||
let dNY4: u16 = 42664u16;
|
||||
const ew3P: u16 = iH8i;
|
||||
const rhMm = (-12175035427752017433810985932786769741i128, t5RQ {}, 271081707118414207u64, t5RQ {});
|
||||
if CwF6T == 11331100544714433941u64 && -137675837326651778150405129011408487179 <= a19dG || ew3P > ew3P {
|
||||
const EDvW_: i64 = gt_QR;
|
||||
let uo2t: i8 = -49i8;
|
||||
let Df3aR = CwF6T;
|
||||
const O95wG: u128 = 233656278189081722025096788379753584619u128;
|
||||
zpnQ *= 2;
|
||||
if [YfiVq; (1, 4)] != [[169806268696379052753386048486355766015u128; 4]] && O95wG == O95wG {
|
||||
a19dG = rhMm.0;
|
||||
const F9OI8 = 7722095094283521054i64;
|
||||
dNY4 = ew3P;
|
||||
return (208326420935540144401016536701458059817, -982099885i32);
|
||||
} else {
|
||||
dNY4 /= iH8i;
|
||||
const Bib0s: (u8, i32) = (17u8, BU9w.aLCN);
|
||||
let drCDJ: u8 = mH2Y9(59).2;
|
||||
return (161370180874192340940279967916022560712u128, 824395561i32);
|
||||
}
|
||||
} else {
|
||||
Us69 **= 0u8;
|
||||
if 13374625417223606661203178669122357262895208428058127395102070813150800996346310387528492920172705731913360080696233776310891992358563843352652013188713944field == 263532422099937944708673518073513763117335195026879259697639252603769892703299683875517609580006174666409952835928025508899712918393480532217337922966555 || 1096149508u32 != 2994358812u32 || [12890087337307472884436170949641374530429153345545555376245573207602294126747170115789551329058532240766554606961796542359650950559524558773090959768475930field; 1] == [2143632458517463038479141456562071005118430667816722632824939540043109994093969259778518202045640720180325070912765589063054454459930550396018099750062403] {
|
||||
let L_TyE = zpnQ + ZceI / mH2Y9(zpnQ).2 ** Us69;
|
||||
z26R -= dNY4;
|
||||
z26R += iH8i;
|
||||
dNY4 += 16917u16;
|
||||
dNY4 -= iH8i;
|
||||
return (41882921589805161698106929041066935475u128, -1250228558i32);
|
||||
} else if iELE.0.1 != iELE.0.1 || iELE.1 <= 112733576472926129085561582397187256731 && rhMm.0 <= 156193507662835091964445626817294215008 {
|
||||
if iELE.0.0 != iELE.0.0 && iELE.2 < iELE.2 && 20 < 136u8 {
|
||||
dNY4 **= 0u16;
|
||||
let JlUA: address = aleo1vdwy8d4xa25z933kwtrfa2rcue76y4enuqzpt2wcawnpah3wzsqq2mva5a;
|
||||
const flZpN = (4615902933436516462u64, [1051606236738913649i64; 4], 52700u16);
|
||||
Us69 *= mH2Y9(74u8).2;
|
||||
let rvGR: (i32, VdqTF, u16, u8) = (BU9w.aLCN, Self {JkBcA: JlUA, vNAMH: BU9w.E_t6, qQtCF: 28341i16}, dNY4, mH2Y9(zpnQ).2);
|
||||
} else if CwF6T < SLNe2 || -60168501559691069371405162360254879048 < -161477792457033742618657363363311658871i128 {
|
||||
let XWlHi: i64 = gt_QR;
|
||||
let rudj: address = aleo1lfwytf44azjrgv506dta4amsu58k3eex9dp33hg05jud25crxuxs80nrp6;
|
||||
}
|
||||
const dFd0: address = aleo1jeyl5j4r9u6hqz5jk3t6kla3jff5vgvn63lped7dsdwhqp4auupqsyaj5e;
|
||||
const Fj_t = 26i8;
|
||||
YfiVq *= YfiVq;
|
||||
dNY4 /= dNY4;
|
||||
return (251797454112440413890352461173202213335, 927710880i32);
|
||||
} else {
|
||||
dNY4 **= 30488 / dNY4 + 29821u16 - 27432u16 - 2353u16 + q2USj {GoGV: BU9w.GoGV, E_t6: BU9w.GoGV, aLCN: BU9w.aLCN, qmz3: 83}.Bchw(154446541901057916622609095185682224927).0 - 2555u16;
|
||||
Us69 = ZceI;
|
||||
Us69 *= 0;
|
||||
const k85V: address = aleo1gtres8rsyj6d6jz5y3g3y9tjqsrr7tud2kvtzv2w2c9d46g865xq32n37e;
|
||||
z26R = ew3P;
|
||||
return (206704597053005722166881401158050055285u128, 1164596760i32);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (71, 2881902654u32, -2069668436, 92123972876894013803446307211773509241) != (131u8, 3282192165u32, -2129422448i32, 43305229915134948318570373955312734854u128) && BU9w.qmz3 > 189 {
|
||||
Us69 -= 49u8;
|
||||
const JYg1D: i16 = -2604i16;
|
||||
const rliN7: VdqTF = VdqTF {vNAMH: BU9w.GoGV, qQtCF: -24022i16, JkBcA: aleo1eujyhsjffg9r7tkxgmfurg3mt8c7nvc03a2lgzsgqe0r3sp8lvxqc5qdmh};
|
||||
z26R = z26R;
|
||||
let f3kA: u64 = CwF6T;
|
||||
YfiVq = YfiVq;
|
||||
} else {
|
||||
const VqQ9j: u64 = CwF6T;
|
||||
z26R = z26R;
|
||||
}
|
||||
const RAtF: u64 = SLNe2;
|
||||
a19dG = a19dG;
|
||||
let wP8M = RAtF;
|
||||
const ku4m: [u8; 1] = [BU9w.qmz3; 1];
|
||||
return (138950913523788282516433261892988500386u128, BU9w.aLCN);
|
||||
|
||||
struct t5RQ {
|
||||
}
|
||||
|
||||
|
||||
function fGeK (const YKvX: i8) -> u8 {
|
||||
if YKvX >= YKvX && false && YKvX <= YKvX {
|
||||
let QEAS: char = '\u{d1290}';
|
||||
const PzT2o = (3907343854998883480063214119544699297780621314687237535050680256515848549925979938945863859753374805327386884171897412321471780865498076822115347428113750field, -2127951728i32, 7820691722384525995u64);
|
||||
}
|
||||
let zYkk: i128 = -24135032554736812030416370574505501964i128;
|
||||
const VOer = -22376i16;
|
||||
zYkk -= zYkk;
|
||||
zYkk = zYkk;
|
||||
zYkk -= zYkk;
|
||||
return 199u8;
|
||||
}
|
||||
|
||||
function M5uyg (
|
||||
&self,
|
||||
const okvyq: address,
|
||||
const jLfv: address
|
||||
) -> (
|
||||
[u16; 1],
|
||||
field,
|
||||
u32,
|
||||
|
||||
struct q2USj {
|
||||
GoGV: bool,
|
||||
aLCN: i32,
|
||||
E_t6: bool,
|
||||
qmz3: u8,
|
||||
|
||||
function GOYuA (
|
||||
self,
|
||||
const fY7mJ: Self,
|
||||
jWmq: u16,
|
||||
const nwZP: u8
|
||||
) -> (
|
||||
[u32; 4],
|
||||
i64
|
||||
) {
|
||||
let Avj6N: i32 = fY7mJ.aLCN;
|
||||
Avj6N = 364107726i32;
|
||||
const DX9q2 = fY7mJ.qmz3;
|
||||
if 483103504u32 > 2578589642u32 && aleo1m2cjlkawd5m0zl5rutsguz94y572mjj4u8lnxx2mq8pguhw4dqqsq9vcar == aleo1wnykcamqw5aghz56g8qrz90h7gqpm62zykyefp9vu85yqk2j0sqqachstx {
|
||||
const IjwUB: u32 = 4065726433u32;
|
||||
let c17Qz: u16 = jWmq;
|
||||
const BnL_: u128 = 51761633273380017465434432628428125170u128;
|
||||
let vxDm: i64 = -5494074842541052547i64;
|
||||
const lMmJc: field = 125545887137495523397577547635418533381158968954640996668608928671130971517914452783158107876547411564762624046750113283173064518704428534673396909364510field;
|
||||
} else if [201893701929816058901180594907743208728; 1] == [79982146642254653817983190224958060318u128; 1] && jWmq > jWmq && [aleo1qdck5ln6cpm3llqjk6mvhp6r5xltkv3syww8cfue0j7gwsusrvrqsmlh8h, aleo19cka50c6l7ua5a34lnfwhxlx2hs3jysn7pyuehf69kvv4gjwsqgqz6qzd5, aleo1y8q2w4zh2c7k9ee5fzsyeazyzmynv8wxrl2ec67lsdenhveqeuxsqjcwkp] != [aleo14d9jx649l5feffrk7s3xwyl5p3dz3dn7q2m65vyvg46y76chcqxske4jay; 3] {
|
||||
let Fzyfc = -22317i16 - -25418i16 + 14121i16;
|
||||
Avj6N **= 1;
|
||||
const Ram7m: i32 = fY7mJ.aLCN;
|
||||
const Jyap: address = aleo1hf5700rcpz68s7fspd25kat2felkmggzddstazkgmu7xt2syug8qu7nkjc;
|
||||
Fzyfc *= 0;
|
||||
Avj6N += (Ram7m / Ram7m / -1490396869i32) + self.aLCN * 1;
|
||||
Avj6N /= self.aLCN;
|
||||
const PBAT: i64 = -205621369696754507i64;
|
||||
} else {
|
||||
const Dqt5E = 995262057u32;
|
||||
Avj6N -= self.aLCN;
|
||||
let XJms = 61i8;
|
||||
const vvOQZ: field = 2097735165804900312999580621838429207407595983420724021671887967978821818938171460938180437319640910570853915289167466089093039844862455656252123826976864field;
|
||||
let sP0I = (jWmq, '\x76');
|
||||
let S9uAD: u8 = fY7mJ.qmz3;
|
||||
}
|
||||
let XPlIn = t5RQ {};
|
||||
let Dchf: char = '\u{79}';
|
||||
const L4mb: [i64; 1] = [(4498224565295528194i64, true).0; 1];
|
||||
XPlIn = XPlIn;
|
||||
return ([688873667u32; 4], -7142513596480754292i64);
|
||||
}
|
||||
|
||||
function Bchw (&self, const RwPZX: i128) -> (
|
||||
u16,
|
||||
i8,
|
||||
i16,
|
||||
i64,
|
||||
char
|
||||
) {
|
||||
let UYSF: u128 = 262102823998991425630620909427922442176u128;
|
||||
let E1hjK = 10375244632967105723169088070309024219397254573760531061153053085696174606082038377241096687473895366928875518762523866901404864961733598111880816563280455field;
|
||||
let e4zkn = '\x32';
|
||||
const Tyz9 = aleo1jtjc68kf2x3euxufngq0mm7szwwvhpzugqzk7ej4p4wvhym4cursppgq38;
|
||||
self.E_t6 = self.GoGV;
|
||||
return (2520u16, -121i8, 13444i16, -6913886128685393087i64, '\x0c');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function AXU_S () -> (
|
||||
address,
|
||||
i64
|
||||
field,
|
||||
char,
|
||||
[field; 1]
|
||||
) {
|
||||
const uTtoZ: u32 = 2911953024u32;
|
||||
self = Self {vNAMH: HnaR(9637107400116582286875632406821960049552027667572334234709696347580021917799394395119248241957821783181912394721554018583849251698821030898138872231958121, -484i16).2, JkBcA: aleo1l37vuw8u8d7plfhcfzjt8m0qwfe3j8u4aufm9xqtvsghu5svdq8qx53uzl, qQtCF: 22825i16};
|
||||
self.vNAMH = self.vNAMH;
|
||||
self.vNAMH = true;
|
||||
const kJJp: field = 11645589667993280099034622824350749720911055347704063229918455679843827052479299776284340059356896792159135506144424390068971515703723527659351438790152783field;
|
||||
self.vNAMH = self.vNAMH;
|
||||
self = self.vNAMH? self : self;
|
||||
const XicT: char = '\x3a';
|
||||
self.qQtCF /= self.qQtCF;
|
||||
return ([26235u16], 10204220262695726749783274260328053259745286134580082341779447510196179136312755669231619017189600069545303530663107245149667915069169858552950905395161580field, 92907414u32, aleo16nlemverjfhlqlezej0ncfynxgcnlu5nk9n3ag6l8c5m7uuk8qyq84sh5n, -3147978309964363954i64);
|
||||
const tVTY = [203u8; 3];
|
||||
let OV1kp = -1213152733781511670i64;
|
||||
let Xq_tC = VdqTF {vNAMH: false, qQtCF: -3948i16, JkBcA: aleo1vgkk9ymnjhhxe6vmul45rxu8d4g95euafvlqne26km9qr7m42g8qhkxkgf};
|
||||
let VIrY = 17593201753785968724348147573543201683u128;
|
||||
OV1kp -= OV1kp;
|
||||
const Q4U3S = 27137u16;
|
||||
let AlH2I: (i128, JzT3X) = (139188993752357605548144436826980887896i128, t5RQ {});
|
||||
const Vsvk: char = '1';
|
||||
Xq_tC = Xq_tC;
|
||||
let nf2yj: address = aleo1pyhp5pgv0np0n5pvtr7hg97ukj3hpd33jtpeg8hn08wgr9g49uzqaqxllp;
|
||||
return (aleo10nxyeq4s5l40wnl2vfl2llw78kgvt5enfeemlggmkkuuqhzqzsgsemhzt9, 10284116216941408283824722444823323169743229072384235793724572129107892255808365407378202665173472895512465558177101917815129958884392467286207303058249836, '🝎', [5251293705195853262669358257210379533137794199696014230716504931515180367833369101390595615074170181388161695941210696920452345567559460763086722252516477; 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function main (
|
||||
nq60Q: i8,
|
||||
lVdR: i32
|
||||
) -> (
|
||||
i8,
|
||||
i16
|
||||
) {
|
||||
const HKkwa: u128 = nI8f.1;
|
||||
const V03E: i8 = -79i8;
|
||||
const OjYjs: (u16, u16) = (61993u16 + 36672u16 * 0u16 / (49290u16 - 1647u16 + 5273u16 + 64600u16 / 28457u16), 10262u16);
|
||||
let fz_h: qQAv = 1882284745174847260;
|
||||
fz_h *= -1i64;
|
||||
let Yw2dn: i16 = -297i16;
|
||||
let er63n: m1ys8 = aleo1yl8g8c3scda0e9gta5dxn49xm29avlwc6ngzr6l3yflmzraktygq2qaks4;
|
||||
Yw2dn = Yw2dn;
|
||||
const HeMx: u8 = 55u8;
|
||||
let AJTYt: u64 = 4813604680719586955u64;
|
||||
return (V03E, Yw2dn);
|
||||
}
|
||||
|
||||
function mH2Y9 (iEfoy: u8) -> (
|
||||
field,
|
||||
char,
|
||||
u8
|
||||
) {
|
||||
const fG0q3 = -59154251402565510076278685361797057569i128;
|
||||
let PrNua: u8 = iEfoy;
|
||||
PrNua *= 3;
|
||||
PrNua -= PrNua;
|
||||
PrNua *= PrNua;
|
||||
if 32668u16 != 21786u16 || (aleo1j49vf34whm0m4uws0estyu4gq5tht5zx0q6qzxmdzscnclmxfg9qdgzda0, 41540, 134304434296530196734061550676303486963u128) != (aleo1xva5m9jur0a0tprwqc8nzphgzgd6skjd0q0pw5cgr4neuu6l2ygsasgpk9, 55043u16, 129033633348452456271720971239228800745u128) && 24828206122290956941869728717938262622u128 == 190550268981330710707990793850974074495 {
|
||||
let FFxXY: i128 = fG0q3;
|
||||
}
|
||||
const mu6N = [7582669102660056372947255416050366024078733101207257721015648696292977286038066716759935417295636191557803704683778990632154263740251772206823891196733587field, 8196660721793919824431109574792746081235843603331574262589237067642966218636776362612899587315350318796338078462915808190066779316191244649686894554175818field, 7243540293239857928937388141203501039817875319585790175435641863324995357870510220128659842790875126815373993172381399497896402138463576231151096997987235field];
|
||||
const Bpf8B: RaEnk = t5RQ {};
|
||||
return (11817726415298897201781763882612161235674380541753244883813987091658618975514747358698825992261995321821959028187112813486614880508876689770337142994146408field, '\u{105181}', 212u8);
|
||||
}
|
||||
|
||||
struct VdqTF {
|
||||
vNAMH: bool,
|
||||
JkBcA: address,
|
||||
qQtCF: i16,
|
||||
|
||||
function XBi3v (
|
||||
const SLNe2: u64,
|
||||
const ZceI: u8,
|
||||
const BU9w: q2USj
|
||||
) -> (
|
||||
u128,
|
||||
i32
|
||||
) {
|
||||
const iELE: ((u32, char), u128, i64) = ((384601192u32, '\u{5d}'), 260866785695740709874051028796502206859u128, -321465745518097240i64);
|
||||
let YfiVq = iELE.1;
|
||||
const iH8i = 47086u16;
|
||||
YfiVq *= 0u128;
|
||||
let Us69 = BU9w.qmz3;
|
||||
const gt_QR: i64 = iELE.2;
|
||||
let z26R: u16 = iH8i;
|
||||
const CwF6T = 2122017455351828831u64;
|
||||
Us69 = Us69;
|
||||
let a19dG = -86613533756289588059622956126783773336i128;
|
||||
if a19dG == -49319611420542273374035057559272823755 && SLNe2 <= SLNe2 && -23356 != -16419i16 {
|
||||
let kX9E: char = iELE.0.1;
|
||||
let AdkEx: [i16; 2] = [-5468i16; 2];
|
||||
const UcJQG: i64 = 1017251936437173056i64;
|
||||
let rm6_8: u8 = Us69;
|
||||
const zgZL: q2USj = BU9w;
|
||||
AdkEx[..1] = [AdkEx[0u32]];
|
||||
return (108204645183890682686172343964957448867u128, 1149096697i32);
|
||||
} else if -31 == -69i8 || a19dG <= a19dG {
|
||||
let zpnQ: u8 = 72;
|
||||
a19dG += 84542379573227848725665999581434532730;
|
||||
if iELE.0.1 == '{' && BU9w.E_t6 != !false && 100 >= (q2USj {aLCN: [(4158624514u32, 123278280530457701497833478904269469213u128, 375400254i32, 4030338526369534919352204641539656959774203635820637603220580819386423470678850085111744039458909079319352854489628011888463617722287850191230995765822356field); 1][0].2, GoGV: BU9w.E_t6, E_t6: BU9w.GoGV, qmz3: Us69 ** 0 + BU9w.qmz3}).Bchw(-85474839122628384091136338030133571122).1 {
|
||||
const j6mpM: u64 = CwF6T;
|
||||
const Qjgj = CwF6T;
|
||||
a19dG = a19dG;
|
||||
YfiVq *= 0u128;
|
||||
YfiVq *= YfiVq;
|
||||
if (true? aleo1zlkfjx7kmswac8kkz6gmrpp5wdlfyjcpa82p3sxlc7t9hdpxyurqr4pm0y : aleo18846l5defv4cmp707jzfmnyphxe05y94wgqljklkd2vuhujuccqqncphly) == aleo1vvzw6wwnr4qzw3c833wzzzglnamw6rqw4frucvz3cz4ca9d3hvgsjm8xaj && iELE.1 >= iELE.1 || j6mpM <= j6mpM {
|
||||
if Qjgj > Qjgj || -1777i16 <= -21839i16 {
|
||||
let jmjH1 = aleo18a6ztczu0l2rc0w2dxtqf6nlgwwqe9k99tq5el7w5kcwrc0085yqkey0fv;
|
||||
jmjH1 = jmjH1;
|
||||
a19dG -= a19dG;
|
||||
let HwJn: u64 = 17714981732057656865u64;
|
||||
YfiVq = iELE.1;
|
||||
let m3kTh = jmjH1;
|
||||
m3kTh = m3kTh;
|
||||
} else if mH2Y9(34).0 == mH2Y9(9u8).0 && 6273i16 < 4909 || -8867466881151025294i64 < gt_QR {
|
||||
YfiVq += iELE.1;
|
||||
a19dG -= a19dG;
|
||||
} else {
|
||||
let crw_: bool = true;
|
||||
zpnQ -= 24u8;
|
||||
const dsGM: [bool; 2] = BU9w.GoGV? [false, false] : [false, false];
|
||||
}
|
||||
let kJb1: char = '\x59';
|
||||
a19dG += BU9w.GoGV? a19dG : a19dG;
|
||||
zpnQ = 212u8;
|
||||
a19dG = a19dG;
|
||||
z26R = 55775u16;
|
||||
let SNxJp: u8 = zpnQ;
|
||||
a19dG += a19dG;
|
||||
const EPCfE: i64 = -2588330871158477199;
|
||||
} else {
|
||||
if 8297695527096070029141173015706745148u128 < YfiVq && ('#', 42214, 15441661, 3727013545) != ('\u{59}', 34058u16, 3653945965u32, 1129351315u32) {
|
||||
z26R += z26R - 55038u16 / iH8i - 30074u16;
|
||||
const hNyo: char = iELE.0.1;
|
||||
z26R = z26R;
|
||||
} else if Us69 == Us69 || 912492226995330448 > SLNe2 {
|
||||
Us69 = zpnQ;
|
||||
z26R += iH8i - z26R - 0 * z26R / iH8i / z26R;
|
||||
const B1Hx: u128 = iELE.1;
|
||||
let V9bJ4 = BU9w.E_t6;
|
||||
} else {
|
||||
const YHwJ7: i64 = 8808493453600301821i64;
|
||||
zpnQ += zpnQ;
|
||||
const mCw1_ = 7801278669036649611368151749591863685236870578853066004483602881165648711426811156956719869085171471031126066717127183381568375078432206971070288097037807field;
|
||||
YfiVq -= YfiVq;
|
||||
z26R -= z26R;
|
||||
a19dG += a19dG;
|
||||
let zHNJ = iELE.0.1;
|
||||
let wI7u: field = 2550144609268528440691705040114940648343270796680326402121986343650268171471569132206972126710945335689980818687697891282702140492021153719137048087792240field;
|
||||
}
|
||||
}
|
||||
const LkcEj = iELE.1;
|
||||
}
|
||||
for SogB in iELE.0.0..384601214 {
|
||||
let DYkE: u128 = iELE.1;
|
||||
const kAOX = BU9w.E_t6;
|
||||
DYkE -= DYkE;
|
||||
const M59dm: (u16, u64, field) = (43488u16, 9124896517185954065u64, 10561644927788416398392784857829962551661255265035645354800005079247111969376265845407072644801592007585225067672023612023814003754382765372559116699973115field);
|
||||
const JaobB = BU9w.aLCN;
|
||||
let WvXP = SLNe2;
|
||||
let VO6G: u128 = YfiVq;
|
||||
let ffilS: u16 = M59dm.0;
|
||||
let YZOB: [RaEnk; 1] = [t5RQ {}; 1];
|
||||
}
|
||||
let dNY4: u16 = 42664u16;
|
||||
const ew3P: u16 = iH8i;
|
||||
const rhMm = (-12175035427752017433810985932786769741i128, t5RQ {}, 271081707118414207u64, t5RQ {});
|
||||
if CwF6T == 11331100544714433941u64 && -137675837326651778150405129011408487179 <= a19dG || ew3P > ew3P {
|
||||
const EDvW_: i64 = gt_QR;
|
||||
let uo2t: i8 = -49i8;
|
||||
let Df3aR = CwF6T;
|
||||
const O95wG: u128 = 233656278189081722025096788379753584619u128;
|
||||
zpnQ *= 2;
|
||||
if [YfiVq; (1, 4)] != [[169806268696379052753386048486355766015u128; 4]] && O95wG == O95wG {
|
||||
a19dG = rhMm.0;
|
||||
const F9OI8 = 7722095094283521054i64;
|
||||
dNY4 = ew3P;
|
||||
return (208326420935540144401016536701458059817, -982099885i32);
|
||||
} else {
|
||||
dNY4 /= iH8i;
|
||||
const Bib0s: (u8, i32) = (17u8, BU9w.aLCN);
|
||||
let drCDJ: u8 = mH2Y9(59).2;
|
||||
return (161370180874192340940279967916022560712u128, 824395561i32);
|
||||
}
|
||||
} else {
|
||||
Us69 **= 0u8;
|
||||
if 13374625417223606661203178669122357262895208428058127395102070813150800996346310387528492920172705731913360080696233776310891992358563843352652013188713944field == 263532422099937944708673518073513763117335195026879259697639252603769892703299683875517609580006174666409952835928025508899712918393480532217337922966555 || 1096149508u32 != 2994358812u32 || [12890087337307472884436170949641374530429153345545555376245573207602294126747170115789551329058532240766554606961796542359650950559524558773090959768475930field; 1] == [2143632458517463038479141456562071005118430667816722632824939540043109994093969259778518202045640720180325070912765589063054454459930550396018099750062403] {
|
||||
let L_TyE = zpnQ + ZceI / mH2Y9(zpnQ).2 ** Us69;
|
||||
z26R -= dNY4;
|
||||
z26R += iH8i;
|
||||
dNY4 += 16917u16;
|
||||
dNY4 -= iH8i;
|
||||
return (41882921589805161698106929041066935475u128, -1250228558i32);
|
||||
} else if iELE.0.1 != iELE.0.1 || iELE.1 <= 112733576472926129085561582397187256731 && rhMm.0 <= 156193507662835091964445626817294215008 {
|
||||
if iELE.0.0 != iELE.0.0 && iELE.2 < iELE.2 && 20 < 136u8 {
|
||||
dNY4 **= 0u16;
|
||||
let JlUA: address = aleo1vdwy8d4xa25z933kwtrfa2rcue76y4enuqzpt2wcawnpah3wzsqq2mva5a;
|
||||
const flZpN = (4615902933436516462u64, [1051606236738913649i64; 4], 52700u16);
|
||||
Us69 *= mH2Y9(74u8).2;
|
||||
let rvGR: (i32, VdqTF, u16, u8) = (BU9w.aLCN, Self {JkBcA: JlUA, vNAMH: BU9w.E_t6, qQtCF: 28341i16}, dNY4, mH2Y9(zpnQ).2);
|
||||
} else if CwF6T < SLNe2 || -60168501559691069371405162360254879048 < -161477792457033742618657363363311658871i128 {
|
||||
let XWlHi: i64 = gt_QR;
|
||||
let rudj: address = aleo1lfwytf44azjrgv506dta4amsu58k3eex9dp33hg05jud25crxuxs80nrp6;
|
||||
}
|
||||
const dFd0: address = aleo1jeyl5j4r9u6hqz5jk3t6kla3jff5vgvn63lped7dsdwhqp4auupqsyaj5e;
|
||||
const Fj_t = 26i8;
|
||||
YfiVq *= YfiVq;
|
||||
dNY4 /= dNY4;
|
||||
return (251797454112440413890352461173202213335, 927710880i32);
|
||||
} else {
|
||||
dNY4 **= 30488 / dNY4 + 29821u16 - 27432u16 - 2353u16 + q2USj {GoGV: BU9w.GoGV, E_t6: BU9w.GoGV, aLCN: BU9w.aLCN, qmz3: 83}.Bchw(154446541901057916622609095185682224927).0 - 2555u16;
|
||||
Us69 = ZceI;
|
||||
Us69 *= 0;
|
||||
const k85V: address = aleo1gtres8rsyj6d6jz5y3g3y9tjqsrr7tud2kvtzv2w2c9d46g865xq32n37e;
|
||||
z26R = ew3P;
|
||||
return (206704597053005722166881401158050055285u128, 1164596760i32);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (71, 2881902654u32, -2069668436, 92123972876894013803446307211773509241) != (131u8, 3282192165u32, -2129422448i32, 43305229915134948318570373955312734854u128) && BU9w.qmz3 > 189 {
|
||||
Us69 -= 49u8;
|
||||
const JYg1D: i16 = -2604i16;
|
||||
const rliN7: VdqTF = VdqTF {vNAMH: BU9w.GoGV, qQtCF: -24022i16, JkBcA: aleo1eujyhsjffg9r7tkxgmfurg3mt8c7nvc03a2lgzsgqe0r3sp8lvxqc5qdmh};
|
||||
z26R = z26R;
|
||||
let f3kA: u64 = CwF6T;
|
||||
YfiVq = YfiVq;
|
||||
} else {
|
||||
const VqQ9j: u64 = CwF6T;
|
||||
z26R = z26R;
|
||||
}
|
||||
const RAtF: u64 = SLNe2;
|
||||
a19dG = a19dG;
|
||||
let wP8M = RAtF;
|
||||
const ku4m: [u8; 1] = [BU9w.qmz3; 1];
|
||||
return (138950913523788282516433261892988500386u128, BU9w.aLCN);
|
||||
}
|
||||
}
|
||||
|
||||
function M5uyg (
|
||||
&self,
|
||||
const okvyq: address,
|
||||
const jLfv: address
|
||||
) -> (
|
||||
[u16; 1],
|
||||
field,
|
||||
u32,
|
||||
address,
|
||||
i64
|
||||
) {
|
||||
const uTtoZ: u32 = 2911953024u32;
|
||||
self = Self {vNAMH: HnaR(9637107400116582286875632406821960049552027667572334234709696347580021917799394395119248241957821783181912394721554018583849251698821030898138872231958121, -484i16).2, JkBcA: aleo1l37vuw8u8d7plfhcfzjt8m0qwfe3j8u4aufm9xqtvsghu5svdq8qx53uzl, qQtCF: 22825i16};
|
||||
self.vNAMH = self.vNAMH;
|
||||
self.vNAMH = true;
|
||||
const kJJp: field = 11645589667993280099034622824350749720911055347704063229918455679843827052479299776284340059356896792159135506144424390068971515703723527659351438790152783field;
|
||||
self.vNAMH = self.vNAMH;
|
||||
self = self.vNAMH? self : self;
|
||||
const XicT: char = '\x3a';
|
||||
self.qQtCF /= self.qQtCF;
|
||||
return ([26235u16], 10204220262695726749783274260328053259745286134580082341779447510196179136312755669231619017189600069545303530663107245149667915069169858552950905395161580field, 92907414u32, aleo16nlemverjfhlqlezej0ncfynxgcnlu5nk9n3ag6l8c5m7uuk8qyq84sh5n, -3147978309964363954i64);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function main (
|
||||
nq60Q: i8,
|
||||
lVdR: i32
|
||||
) -> (
|
||||
i8,
|
||||
i16
|
||||
) {
|
||||
const HKkwa: u128 = nI8f.1;
|
||||
const V03E: i8 = -79i8;
|
||||
const OjYjs: (u16, u16) = (61993u16 + 36672u16 * 0u16 / (49290u16 - 1647u16 + 5273u16 + 64600u16 / 28457u16), 10262u16);
|
||||
let fz_h: qQAv = 1882284745174847260;
|
||||
fz_h *= -1i64;
|
||||
let Yw2dn: i16 = -297i16;
|
||||
let er63n: m1ys8 = aleo1yl8g8c3scda0e9gta5dxn49xm29avlwc6ngzr6l3yflmzraktygq2qaks4;
|
||||
Yw2dn = Yw2dn;
|
||||
const HeMx: u8 = 55u8;
|
||||
let AJTYt: u64 = 4813604680719586955u64;
|
||||
return (V03E, Yw2dn);
|
||||
}}
|
||||
|
@ -3,359 +3,361 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
type f7emM = i32;
|
||||
|
||||
type D7DUI = field;
|
||||
|
||||
type eJa93 = u32;
|
||||
|
||||
type R9gK = i8;
|
||||
|
||||
const KN5GV: u8 = 135;
|
||||
|
||||
|
||||
const HIvz: u16 = 8353u16;
|
||||
|
||||
|
||||
const RxDY: i128 = 160507423339819228254499907855942116643i128;
|
||||
|
||||
|
||||
function FCIe (
|
||||
const UVuLE: char,
|
||||
const F9oz: D7DUI,
|
||||
j9xg: u128
|
||||
) -> (
|
||||
(i64, i8, u128, i8),
|
||||
char,
|
||||
i128,
|
||||
i16
|
||||
) {
|
||||
const HUPGM: [field; 2] = [13277594549785768136284430178007837859568136834230341432435178881596844874513004667327467035429833750272956397180760385366596119340548168128876632009997790field, 1422581498637680138044229982545977777417953390362474916059262745889909423177974455160773650800419815223963856164884271573917800433866887521655476469172219field];
|
||||
let zOaeh: u64 = 2447328702336489745u64;
|
||||
const drQQ: u32 = 3787261625;
|
||||
zOaeh /= zOaeh;
|
||||
zOaeh += 12692165764150258137;
|
||||
const grLX6: u16 = 55650u16;
|
||||
zOaeh *= 10578752206098725527u64 - zOaeh / 15360172840497151888u64 * 0 / zOaeh / 15868540033809659835 - 10578752206098725527u64;
|
||||
zOaeh += (zOaeh - zOaeh + zOaeh + zOaeh) + zOaeh / 17962297468044929180;
|
||||
let Z7cF: u8 = 186;
|
||||
zOaeh *= 0u64;
|
||||
Z7cF = Z7cF;
|
||||
let co5i: f7emM = -593933979i32;
|
||||
Z7cF -= Z7cF;
|
||||
const WN3V5: i32 = -1943816238i32;
|
||||
if grLX6 < grLX6 || -24321i16 <= -29946i16 {
|
||||
program test.aleo {
|
||||
type f7emM = i32;
|
||||
|
||||
type D7DUI = field;
|
||||
|
||||
type eJa93 = u32;
|
||||
|
||||
type R9gK = i8;
|
||||
|
||||
const KN5GV: u8 = 135;
|
||||
|
||||
|
||||
const HIvz: u16 = 8353u16;
|
||||
|
||||
|
||||
const RxDY: i128 = 160507423339819228254499907855942116643i128;
|
||||
|
||||
|
||||
function FCIe (
|
||||
const UVuLE: char,
|
||||
const F9oz: D7DUI,
|
||||
j9xg: u128
|
||||
) -> (
|
||||
(i64, i8, u128, i8),
|
||||
char,
|
||||
i128,
|
||||
i16
|
||||
) {
|
||||
const HUPGM: [field; 2] = [13277594549785768136284430178007837859568136834230341432435178881596844874513004667327467035429833750272956397180760385366596119340548168128876632009997790field, 1422581498637680138044229982545977777417953390362474916059262745889909423177974455160773650800419815223963856164884271573917800433866887521655476469172219field];
|
||||
let zOaeh: u64 = 2447328702336489745u64;
|
||||
const drQQ: u32 = 3787261625;
|
||||
zOaeh /= zOaeh;
|
||||
zOaeh += 12692165764150258137;
|
||||
const grLX6: u16 = 55650u16;
|
||||
zOaeh *= 10578752206098725527u64 - zOaeh / 15360172840497151888u64 * 0 / zOaeh / 15868540033809659835 - 10578752206098725527u64;
|
||||
zOaeh += (zOaeh - zOaeh + zOaeh + zOaeh) + zOaeh / 17962297468044929180;
|
||||
let Z7cF: u8 = 186;
|
||||
zOaeh *= 0u64;
|
||||
Z7cF = Z7cF;
|
||||
zOaeh -= zOaeh;
|
||||
zOaeh = zOaeh;
|
||||
co5i /= WN3V5;
|
||||
if -2565301346371103071i64 != 5669173694005880994i64 || 2242759494058485131623600955976083003446883139676356950994987610980627965999678277966408450558596707449282885603220282725974464948026399614490986096065319 == HUPGM[0u32..][1u32] {
|
||||
co5i *= co5i;
|
||||
const D8FT: u8 = ((5645836405824963934i64, c0q0D {sWaX: aleo12ngdtsa7cemyulvhsk3hfu6wv4yddheun93f9dvn7n7m6eqrzu9sv0r4aw, BEMu: 'L', K4OKX: 885192667795883897u64}, (-109723950938405130273438859813497633393i128, -5739653383984923764i64, 37u8)), (836836554u32, -2194483750600446187i64, c0q0D {sWaX: aleo1dzmz8f7g2zeeqyluhfeaqvs2t95se9ltr9pfn5sv3d2qdzzdtggqgu2sfl, BEMu: '\x4a', K4OKX: 2927923949679163273u64}), '\u{d}', (c0q0D {sWaX: aleo15ej5jxywpr8hnkh6xwlu59rkgrvxv3srcvshdh7rv6gz6vwpqypqau47pl, BEMu: '\u{b}', K4OKX: 15065814023811538003u64}, -102i8)).0.2.2;
|
||||
const jyff: u128 = 26382778784425638847130040540725332486u128;
|
||||
} else if -6124866717687854932 < 6013203712033162263i64 && 3068062336091201633u64 <= zOaeh && 77297194591003381904415188889274252251i128 == -122057918084905958454478185247873063516 {
|
||||
zOaeh *= zOaeh;
|
||||
}
|
||||
Z7cF /= 98u8;
|
||||
const qzYd: u8 = 24u8 * 8 * 0u8;
|
||||
return ((2328001503999089507i64, -33i8, 172700950727876363058053915213183512621u128, 122i8), '\u{ce906}', 165396319652248172259296996926935483030i128, -17826i16);
|
||||
} else {
|
||||
const J4s1l: char = UVuLE;
|
||||
return ((-6092265953157273729i64, 50i8, 264509740629002487510521118509646003552u128, 72i8), '\x3c', -65096494732343930891926872919880984891i128, -7983i16);
|
||||
}
|
||||
}
|
||||
|
||||
circuit x4x07 {
|
||||
Gg_UX: u16,
|
||||
CFmyP: bool,
|
||||
QdLo: u64,
|
||||
|
||||
function tFoP (self) -> (
|
||||
u64,
|
||||
R9gK
|
||||
) {
|
||||
let YhcI: D7DUI = 10041756911293925311839456197432788172577488883953451408506250325562551174751802101892197286578765117103165134818383623324827979619522104377776795934092783field;
|
||||
YhcI += YhcI;
|
||||
YhcI /= YhcI;
|
||||
YhcI /= uocd().0;
|
||||
YhcI += 2109099897408687578464162609847863160154158737566461923793201140365366378692field;
|
||||
YhcI -= YhcI;
|
||||
const s5UA2: [(u128, [[address; 1]; 3]); 2] = [(78520263641837826402410359563426572088u128, [aleo19v9jtk28p9hfz0s79vldtwhj2wsv7rp6qzgwpzzzlgrcypng85qszac8wy; (3, 1)]); 2];
|
||||
YhcI *= YhcI;
|
||||
YhcI = YhcI;
|
||||
DjAk(RxDY);
|
||||
YhcI = 7044684870410365474493487720610678832328537861091382271585725006824079229854322516096295355398330317566313160532626993456065979091608689168288445268821544;
|
||||
const lgfTI: bool = false;
|
||||
return (self.QdLo, -118i8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function main (
|
||||
HT3GJ: bool,
|
||||
nfEkY: u16,
|
||||
const YkvP: i128
|
||||
) -> (
|
||||
u128,
|
||||
i128,
|
||||
i128
|
||||
) {
|
||||
const dU2_ = 17617960660724493139u64 / 6194278111530993676u64 / 3319391222769102077u64 + (10849170017303134999u64 * 0u64 - 0u64 + (true? 2774547757065642486 : 12774957265044619107u64) - 1605116883245688885u64) / (true? 14231626722754827495u64 : 413680800867858612u64) - 0u64;
|
||||
let x5MF = 22368518u32;
|
||||
x5MF *= 156;
|
||||
let CREHc = HIvz;
|
||||
let MGWLm = -1800392205i32;
|
||||
let z8ku = -87i8;
|
||||
const wyIn: field = 10733765163001415897583781334507501877579149054537923538817102911561935149880247989114716181053539561399586511949123113150518327567285269118282285194889342;
|
||||
let G3uvm: R9gK = 23;
|
||||
MGWLm -= MGWLm;
|
||||
return (122363506321495815854865379581118597190, 141064124005494437087595272075651273306, -95739232923139212477565752848665046675);
|
||||
}
|
||||
|
||||
function nFflF (
|
||||
QFsBY: u16,
|
||||
ig8AI: i32
|
||||
) -> (
|
||||
eJa93,
|
||||
u128
|
||||
) {
|
||||
let wVYs: u64 = 17150358843210732735u64;
|
||||
let PW7m: u8 = KN5GV;
|
||||
wVYs = wVYs;
|
||||
wVYs *= 0;
|
||||
PW7m += 6u8;
|
||||
let Ngu6p = 8943877831269998164i64;
|
||||
DjAk(RxDY);
|
||||
const ZPntN = 494201974525721541u64;
|
||||
let BI3P = false;
|
||||
Ngu6p += -6302257762972050303i64;
|
||||
for dOGCq in 96378382..96378385 {
|
||||
let D3p6: [i128; 4] = [RxDY; 4];
|
||||
D3p6[1u32..2][0u32] /= D3p6[..3][0u32];
|
||||
let vS3t: char = 'x';
|
||||
let sSXA = -25469i16;
|
||||
const ib6hy: address = aleo1m7zhdd6g3cadgjw8s2pxt2v62hlfula3sj607vfjyt0c9tqpj5xsl8tq35;
|
||||
PW7m -= PW7m;
|
||||
let aS3I: [bool; 2] = [false; 2];
|
||||
D3p6[3u32] *= D3p6[1u32..0 * 2851184652u32 ** 1u32 * 0 * 0 - 0u32 + 3][0u32] * (-132398739494581955581789609515195973911 * 0 * D3p6[0..][1412242597 + 2626927325u32 + (2670766347 / c0q0D {BEMu: '\u{e630a}', K4OKX: 29999364278060019u64, sWaX: aleo18kk9pny7qjlr0ahhhc7f372vsztqd7cnzcdd6zndu7hd06rp7ygqt7dkpn}.TnP8d().1 * dOGCq / dOGCq) / dOGCq - 4039169921u32] * 0i128 + D3p6[1..][0]) / -56005947257550409174821572609407516561 + D3p6[0u32..true? 4u32 : 4u32][1] / -85246368279954515360146418422322718265i128;
|
||||
}
|
||||
return (390197594, 260459899954261109021372419872275322165);
|
||||
}
|
||||
|
||||
function DjAk (const C88h: i128) {
|
||||
if KN5GV > KN5GV && 123 > -90i8 && 2285689222 < 428945436u32 {
|
||||
let XaiAH: u16 = HIvz;
|
||||
XaiAH *= 0u16;
|
||||
const aN6j: c0q0D = c0q0D {K4OKX: 8501428031508490118u64, sWaX: aleo1pcnslsg5d9qv9uss6v5glenpjrrp8emz0jjuptlgjsahzxfyfsfqgk9c5c, BEMu: '\u{106903}'};
|
||||
XaiAH = XaiAH;
|
||||
let v_gr: R9gK = 86i8;
|
||||
let vQBrv: i8 = v_gr;
|
||||
} else if false != false && '\x02' == '\u{fe0a1}' {
|
||||
const Cv6t: c0q0D = c0q0D {BEMu: '\u{1c}', K4OKX: 4026017311429506330u64, sWaX: aleo1wh7fetrs63yr5ttr2d3xptkcrg30kkxnfuwhdqfhsnpsm738es9ssasnk4};
|
||||
let CFDU = 2554706819u32;
|
||||
} else {
|
||||
const XTXW: address = aleo1h9pa4s2gvh7chmyv2p99m4x7kmjskvu87hdzs6k92p2xnzzfjq9qjj3fjj;
|
||||
let anV6: R9gK = 106i8 ** 1i8 - (-65i8 / 39i8 * 6 ** 1) / 40;
|
||||
anV6 *= -81 - anV6 / anV6 ** 1i8 / -71i8 * anV6 + 80;
|
||||
let SVb5Q: [field; 1] = [4077384098494544667206066621428937904611008619967972987679305158596214220268495436363662321849766684235995314354942797342023149141772799315520179193258961field; 1];
|
||||
let hRtIk = [XTXW; 2];
|
||||
if 11360636251338665983u64 == 6182556736798576232u64 || 2818 < HIvz && 770830148i32 <= 2065969546 {
|
||||
let TxKP: eJa93 = c0q0D {sWaX: aleo1phfn932fnrpqvp2kydnd9shg26yj8nx9a2fqm7yy2gffxenycy9skct8m5, BEMu: FCIe('\x40', 7762636663263793586165276257252074065285452327816447223493926745924714407746413112191982102760406793158705070144184459624393741405589435306392529691108229, 143936786489186856337147359494669603286u128).1, K4OKX: M9bVT(c0q0D {BEMu: '\x2d', sWaX: aleo1h75wyxsmkmrlzaq4qemk9k9qfq0g9nluev0vzy66qyj6tjthjy8sv3c3m9, K4OKX: 7088702153228388238u64}.Iv4zF(13735531298038916337122557094612295893u128, KN5GV).0, 9953454491133807989249392638102019888543634898766562480703825926903264258664004505403271946073825334942084724425470955112328071093521950031906547905778694).1}.TnP8d().1;
|
||||
} else if 67u8 != KN5GV && 224953994693159224576578985106062181604 < 249440015587999031178484669792393069501u128 {
|
||||
hRtIk = hRtIk[0u32..];
|
||||
hRtIk[1..2][0u32] = hRtIk[1u32..2u32][0u32];
|
||||
let b6Ssn: i16 = -12298i16;
|
||||
let lYeI = (67037739923401076397062117992995431111i128, (-1925376793i32 >= -1453765275i32 && true != true? true : c0q0D {K4OKX: 5437340408171671476, BEMu: '\u{b01d7}', sWaX: aleo1uhje6jhv9ef0dcddjp2k9q5chepte9q69aj4xee88k25zt078qys0swynr}.Iv4zF(246374823898085179502856584377327541409, KN5GV).3)? c0q0D {BEMu: '5', K4OKX: M9bVT(-2046298489i32, SVb5Q[0..1u32][0]).1, sWaX: hRtIk[1u32..][0]} : c0q0D {BEMu: '\x38', K4OKX: 4525421086478513427u64, sWaX: aleo16d4u44sj28vv80ctyyy2yemleksgwv92ev7vu3qjgxqm05v8fqzq0xa6w4});
|
||||
SVb5Q[0u32..][0] *= SVb5Q[0u32..][..1][0];
|
||||
const OTuJD: char = 'X';
|
||||
let beqKf: char = ';';
|
||||
}
|
||||
let tc8Gw: [u8; 1] = [249u8; 1];
|
||||
tc8Gw[0..][0] += 0;
|
||||
tc8Gw[0u32..][0] *= 0u8;
|
||||
}
|
||||
if ['\x6d'; 3] == ['\u{c9437}'; 3] || -16573 <= -25741i16 || false == false {
|
||||
let gvbR: i16 = 16881i16;
|
||||
gvbR = gvbR;
|
||||
} else if aleo1evp22w8jtdfpzczqvz8fc34g0n5manlfvdhljha39k3740wdqursqnrza7 != aleo1mwwnplsmd8wlff6472eug06eszfz34p9mfvrl2put4kta9psyuzqn9cz5h && 5948144561193241423191637167728058303641973413071041880623282696840869970146872267108964222249247879428697403882067936500263123592142073385454010941437678 != 6741557943011570877578132335502636958361532271961769794787210902450438513460639642503171383031881141592233605006765658763340012210058645164039609847020737field && true != true {
|
||||
let NtCaM = [-4293925878918538465968391374178736514i128; 4];
|
||||
let uiDf = false;
|
||||
let c95x = c0q0D {sWaX: aleo1q23un4fadvtem0ddrsayw2kqxkdhcp52nd8tmr0gcm83dlqwuvzq962kp7, BEMu: ')', K4OKX: M9bVT(-1443533206, 7071866406647088236012383855462583350620191614555416228696018352702230906569951503953496771707337140195132189172381742116147595416246916329483847950043580field).1};
|
||||
NtCaM[..3u32][2u32] = NtCaM[0..4266700832u32 - 991705198u32 * 3u32 - 77852670 + 25603080u32 - 1239335645u32][1u32];
|
||||
const WRzGY: char = '\x1f';
|
||||
}
|
||||
const mJg_: R9gK = -106i8;
|
||||
let vph1: i16 = 16028;
|
||||
const gIfT = HIvz;
|
||||
let PeDJx: u8 = KN5GV;
|
||||
PeDJx += 74u8;
|
||||
const G2XDG = 23249i16 + -16543i16 / -26625i16;
|
||||
//RETURN
|
||||
}
|
||||
|
||||
function M9bVT (
|
||||
TSy1v: f7emM,
|
||||
fEkX: D7DUI
|
||||
) -> (
|
||||
[D7DUI; 2],
|
||||
u64,
|
||||
i16
|
||||
) {
|
||||
const O5Dl = true;
|
||||
const cKumc: field = 3381959365089964659190697228976142723593135010335530288360938140490965049778958198339208056882159925115722498684489544526835331723777589908514445431444956field;
|
||||
const PPide: [u64; 2] = [17661624248069496308u64, 11336616822948858680u64];
|
||||
let Kq4Qa: u64 = PPide[0u32];
|
||||
Kq4Qa -= PPide[0u32..991788121 / 1342912343u32 ** 2241021841 ** 0u32 + 2u32][1474344181u32 / c0q0D {K4OKX: PPide[0..2u32][O5Dl? O5Dl? 1u32 : 1u32 : 1], sWaX: aleo1hgky57732rlgr46tuvatgtmnkhthnq4frhj8ln05j3j8xas3wg8s8znnjw, BEMu: '\u{c}'}.TnP8d().1 + 655506754u32 / 2723267006 * 0u32 - 16];
|
||||
const zPop2: address = aleo1d0kerkqm8qukl8v0r5t8zf8lrenfm905x42j7przjj9yzw3eqgpq9vgc3v;
|
||||
Kq4Qa *= 1u64;
|
||||
const fC_K: f7emM = -1916096586;
|
||||
Kq4Qa += PPide[..1157284771 + 2286188359u32 + 510713829u32 + 314266907 - 4268453864][1];
|
||||
let elsT: u64 = PPide[0..2][0u32];
|
||||
Kq4Qa *= 7522699392864730264 / PPide[0..2][0u32] + PPide[1u32..2u32][0] / PPide[..1][0];
|
||||
return ([cKumc; 2], PPide[616486984 + 1779172181 / 497863060u32 - 732489493 * 0u32 / 2650790141 - 616486987u32..1369307979 ** 1 * 2u32 - 2738615956u32][0..][1u32], -1958);
|
||||
}
|
||||
|
||||
function uocd () -> (
|
||||
D7DUI,
|
||||
i128,
|
||||
u16
|
||||
) {
|
||||
let HNDgu = aleo1wveqsn8jr2dtmg8lknwtmg6u4ecqzjl5dr3tzz0qd3yce68fuu9qvyzq69;
|
||||
HNDgu = aleo1uk7ezw4dm322ky83xvpc4qlyllkhh7qzxhu3dezllkcner7cwugszrfz5y;
|
||||
HNDgu = HNDgu;
|
||||
const PrfI: i64 = -2415128496557894375i64;
|
||||
HNDgu = HNDgu;
|
||||
let sMamP: D7DUI = 3050972207293858985898027261134989740280030677253680626624233331809624642412field / 3535589802656998200414663729378559203486047389364630633320510383222552413078field - 7617669674777116573145493034288771881912278786788014099379523903600643564789field;
|
||||
sMamP = 7283898863926607047829441804784735551993698333151824285033297975715284272357181121366898148613021172170773141391819075973764254354221433711234731582155247field;
|
||||
HNDgu = aleo1wmcz5msr0drgm93sy3c92jgpdwc38qxnc86v6pgjrnq3h0agqcgswtq08z;
|
||||
return (679694547190221403116537244681951121754919771791350316747287453042032902862057226918548953516602842317380963297974405319599274158746187816329125707432325field, 83083990534768452705048990419652926759, 21119u16);
|
||||
}
|
||||
|
||||
circuit c0q0D {
|
||||
K4OKX: u64,
|
||||
sWaX: address,
|
||||
BEMu: char,
|
||||
|
||||
function Iv4zF (
|
||||
&self,
|
||||
const ipMh: u128,
|
||||
const iOEIN: u8
|
||||
) -> (
|
||||
i32,
|
||||
u128,
|
||||
[address; 1],
|
||||
bool,
|
||||
bool
|
||||
) {
|
||||
self = self;
|
||||
self = self;
|
||||
const FzZBe: i64 = -643197592149967748;
|
||||
let YMf89 = FzZBe;
|
||||
let Dgb9: i64 = YMf89;
|
||||
const CLk2: i64 = FzZBe;
|
||||
let LAWrc: i16 = 32079i16;
|
||||
const qoicx: i8 = 126i8;
|
||||
LAWrc *= 1;
|
||||
self.BEMu = self.BEMu;
|
||||
let tdal7: [u64; 2] = [8388245588918634420u64, 1453414813218090559u64];
|
||||
tdal7[0..1][0] /= tdal7[3164332165u32 + 2467536369 * 0 - 995826184u32 * 3 / 2801076471u32 - 3164332164];
|
||||
if 8751819645477606739465991767336590174073657295189763951167036411552106813904106536054062561076463895660387284106042310404524825109480630466867779897231432field != 2115127521050823232154380155084113954644219345940856568249006021510649777751865861552474344263416250700685708337939930923605370429167388464237111171457269field || 13018102272562842131u64 != tdal7[3604865223u32 ** 0 + 2712791363 - 2157811397 - 554979967u32..1u32][0u32] && 268189170360476989005118072433093795065 <= 259597897676373350325954734974886119976u128 {
|
||||
let F0Wce: bool = false;
|
||||
const wM77z: i16 = -32698i16;
|
||||
let wOaL: u16 = 14538u16;
|
||||
let FV28t: c0q0D = self;
|
||||
tdal7[1u32..] = tdal7[1u32..];
|
||||
const sLhCp: i16 = wM77z;
|
||||
} else if -1598077892 < 834430274i32 || 7324314711686203691272558422022398360572523502301058715976822051136052462012834082000875535792826566421689489490288767984613382378164770887705837042049072field != 12020087347898652995061212535901462039777615210755734983434269553301944288156831518125668986272344618833804181615295707102238124262698343406193721402374171field && self.sWaX == self.sWaX {
|
||||
const LskI: i64 = FzZBe;
|
||||
let Bn5B: u8 = 37u8;
|
||||
let F31fB: i8 = 34i8;
|
||||
const zNbM_: u128 = 222889208679280605484259939391970401830u128;
|
||||
let rmTy3: char = '&';
|
||||
let uOun = [68726522506679376221642071634646978539u128; 4];
|
||||
const pTIL: address = aleo1r89u42rfh8ptcjl93t42cvqylwq6gh3quk99tp47tm7qwxl3esps49ek4n;
|
||||
uOun[2..false? true? 4 : 4u32 : 4u32] = [uOun[0u32..][3u32]; 2];
|
||||
}
|
||||
return (-1330563779i32, 49869787931219468050003648635684350950u128, [aleo1rqpas4pkm4hgwh6sj0gc7aycffcvqjdarnaq3jz592hu6t4s75zq3j33g2], Dgb9 > -1331431069782354307i64 || 22i8 < -54i8, false);
|
||||
}
|
||||
|
||||
function TnP8d (self) -> (
|
||||
bool,
|
||||
u32
|
||||
) {
|
||||
const DmLm: u16 = 62276u16;
|
||||
let VcDk: u32 = 2076386889u32;
|
||||
let akpiC: field = 12620179876212747618015263078521181097597683180570903043504022611362055512187511418595324819926630700868621135200337445883209486801296284506852422837115795field;
|
||||
akpiC *= 6795301077265828102230819445788147289785807698219041499098841944122326621697;
|
||||
const kfHSZ: i128 = -11142910603737792714635157500488940642i128;
|
||||
return (Self {K4OKX: 11651891261795895744, sWaX: self.sWaX, BEMu: self.BEMu}.Iv4zF(237114277218198383018381080565600145702u128, 12).4, 84191294);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
circuit yoi2 {
|
||||
Q9XX: address,
|
||||
PeYO: char,
|
||||
|
||||
function d6a4a (
|
||||
self,
|
||||
KcEYB: u16,
|
||||
fITS7: i64,
|
||||
const SK3R: eJa93
|
||||
) -> (
|
||||
u128,
|
||||
i64,
|
||||
u128,
|
||||
u16,
|
||||
address
|
||||
) {
|
||||
const uYYNS: i16 = 4741i16;
|
||||
const AH1JA = SK3R;
|
||||
let C4eK5 = 15184229167774774597u64;
|
||||
C4eK5 = 1817823583727555793u64;
|
||||
if KN5GV != KN5GV && [10418; 4] == [46848u16; 4] || HIvz != ((KcEYB, 122i8), [326029612984919646259098413389086890933u128; 3]).0.0 {
|
||||
C4eK5 *= 0;
|
||||
let Ssjl: bool = false;
|
||||
let ELoJ: field = 4022025590070768614089504591446675525797902791905376121862004687697577330817391703446136392285510032646232430939678135588587329823607772956008498800316399field;
|
||||
let zWtQ = [139948959111052778124615455604631167440u128, 336271332812688144290687269674766777149u128];
|
||||
const tHBUz: i16 = -25418;
|
||||
DjAk(-152362983330921703465720711984467904217);
|
||||
const ndmr: f7emM = -616661352i32;
|
||||
zWtQ[0..2u32] = [zWtQ[..2][1]; 2];
|
||||
let JPT1 = uYYNS;
|
||||
} else if 30299i16 > uYYNS && 13156527554563220026766089172089410459727999823345608524237717848710505815674096741335546400445265707108640077658559127214449526812881748406135944135596729field == 1058122273492342301462951281560720684476970353691764752934697683100145379802460313917016093694918124212459745345527183177838167747998263153876566167496987field && 16516805546786858913 == 7271458256740227509u64 {
|
||||
let lhh7z: u8 = 184u8;
|
||||
let qhAGL: i128 = -160544352790873401672660389179862682249i128;
|
||||
let co5i: f7emM = -593933979i32;
|
||||
Z7cF -= Z7cF;
|
||||
const WN3V5: i32 = -1943816238i32;
|
||||
if grLX6 < grLX6 || -24321i16 <= -29946i16 {
|
||||
Z7cF = Z7cF;
|
||||
zOaeh -= zOaeh;
|
||||
zOaeh = zOaeh;
|
||||
co5i /= WN3V5;
|
||||
if -2565301346371103071i64 != 5669173694005880994i64 || 2242759494058485131623600955976083003446883139676356950994987610980627965999678277966408450558596707449282885603220282725974464948026399614490986096065319 == HUPGM[0u32..][1u32] {
|
||||
co5i *= co5i;
|
||||
const D8FT: u8 = ((5645836405824963934i64, c0q0D {sWaX: aleo12ngdtsa7cemyulvhsk3hfu6wv4yddheun93f9dvn7n7m6eqrzu9sv0r4aw, BEMu: 'L', K4OKX: 885192667795883897u64}, (-109723950938405130273438859813497633393i128, -5739653383984923764i64, 37u8)), (836836554u32, -2194483750600446187i64, c0q0D {sWaX: aleo1dzmz8f7g2zeeqyluhfeaqvs2t95se9ltr9pfn5sv3d2qdzzdtggqgu2sfl, BEMu: '\x4a', K4OKX: 2927923949679163273u64}), '\u{d}', (c0q0D {sWaX: aleo15ej5jxywpr8hnkh6xwlu59rkgrvxv3srcvshdh7rv6gz6vwpqypqau47pl, BEMu: '\u{b}', K4OKX: 15065814023811538003u64}, -102i8)).0.2.2;
|
||||
const jyff: u128 = 26382778784425638847130040540725332486u128;
|
||||
} else if -6124866717687854932 < 6013203712033162263i64 && 3068062336091201633u64 <= zOaeh && 77297194591003381904415188889274252251i128 == -122057918084905958454478185247873063516 {
|
||||
zOaeh *= zOaeh;
|
||||
}
|
||||
Z7cF /= 98u8;
|
||||
const qzYd: u8 = 24u8 * 8 * 0u8;
|
||||
return ((2328001503999089507i64, -33i8, 172700950727876363058053915213183512621u128, 122i8), '\u{ce906}', 165396319652248172259296996926935483030i128, -17826i16);
|
||||
} else {
|
||||
C4eK5 /= 1474268314080872282u64;
|
||||
let G7B2 = 48135549813543607988338174687857554657i128;
|
||||
const J4s1l: char = UVuLE;
|
||||
return ((-6092265953157273729i64, 50i8, 264509740629002487510521118509646003552u128, 72i8), '\x3c', -65096494732343930891926872919880984891i128, -7983i16);
|
||||
}
|
||||
const PBF3D = -996550112i32;
|
||||
C4eK5 /= M9bVT(PBF3D, 5475802643900380806255643067094297463445681606339363686226205535604484372434222551701413509272022595621682781571585753579531751460567891941376825933384850).1;
|
||||
let EsRQv: i16 = uYYNS;
|
||||
const gOLj: i128 = -37892591301074942600370100541164391364i128;
|
||||
return (81064696772658427187273269555356373315u128, -2307465862478716785i64, 7593952914351541530419915238062231210u128, 6779u16, aleo1gdxz3j4gf0qc977262s5j620tjsk982ahlqn6vsjt3fsvjv96y8sx7gpy5);
|
||||
}
|
||||
|
||||
function VxgF (
|
||||
self,
|
||||
const iaAWb: R9gK,
|
||||
const mL53A: u16,
|
||||
const atdZ: ([u16; 2], [(i32, yoi2, u8, u32); 4])
|
||||
|
||||
struct x4x07 {
|
||||
Gg_UX: u16,
|
||||
CFmyP: bool,
|
||||
QdLo: u64,
|
||||
|
||||
function tFoP (self) -> (
|
||||
u64,
|
||||
R9gK
|
||||
) {
|
||||
let YhcI: D7DUI = 10041756911293925311839456197432788172577488883953451408506250325562551174751802101892197286578765117103165134818383623324827979619522104377776795934092783field;
|
||||
YhcI += YhcI;
|
||||
YhcI /= YhcI;
|
||||
YhcI /= uocd().0;
|
||||
YhcI += 2109099897408687578464162609847863160154158737566461923793201140365366378692field;
|
||||
YhcI -= YhcI;
|
||||
const s5UA2: [(u128, [[address; 1]; 3]); 2] = [(78520263641837826402410359563426572088u128, [aleo19v9jtk28p9hfz0s79vldtwhj2wsv7rp6qzgwpzzzlgrcypng85qszac8wy; (3, 1)]); 2];
|
||||
YhcI *= YhcI;
|
||||
YhcI = YhcI;
|
||||
DjAk(RxDY);
|
||||
YhcI = 7044684870410365474493487720610678832328537861091382271585725006824079229854322516096295355398330317566313160532626993456065979091608689168288445268821544;
|
||||
const lgfTI: bool = false;
|
||||
return (self.QdLo, -118i8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function main (
|
||||
HT3GJ: bool,
|
||||
nfEkY: u16,
|
||||
const YkvP: i128
|
||||
) -> (
|
||||
u128,
|
||||
field,
|
||||
i64
|
||||
i128,
|
||||
i128
|
||||
) {
|
||||
const ku0bH: D7DUI = 11754752438259210427697170300987982028351432552797332663052854387111213342643848238421416191764489443428757402393852684480462172060453178973561128479470346;
|
||||
const K4STs: address = atdZ.1[3u32].1.Q9XX;
|
||||
const FWaK = 28672i16;
|
||||
let Vnbm = 4873298198158298303i64;
|
||||
Vnbm = -7525761477311718518;
|
||||
let Atdc: bool = true;
|
||||
const Zb3H: i128 = 130699347522932019666671778034147335541i128;
|
||||
const c33Fz: D7DUI = ku0bH;
|
||||
Atdc = Atdc;
|
||||
return (82624614926581149725349075041935125160, 2706225903841093727126482902797685194990264682272662674982659458493642750020421705260015665573361316348405833721364351456196890223766219493504966898847324field, -6035924515464853359);
|
||||
const dU2_ = 17617960660724493139u64 / 6194278111530993676u64 / 3319391222769102077u64 + (10849170017303134999u64 * 0u64 - 0u64 + (true? 2774547757065642486 : 12774957265044619107u64) - 1605116883245688885u64) / (true? 14231626722754827495u64 : 413680800867858612u64) - 0u64;
|
||||
let x5MF = 22368518u32;
|
||||
x5MF *= 156;
|
||||
let CREHc = HIvz;
|
||||
let MGWLm = -1800392205i32;
|
||||
let z8ku = -87i8;
|
||||
const wyIn: field = 10733765163001415897583781334507501877579149054537923538817102911561935149880247989114716181053539561399586511949123113150518327567285269118282285194889342;
|
||||
let G3uvm: R9gK = 23;
|
||||
MGWLm -= MGWLm;
|
||||
return (122363506321495815854865379581118597190, 141064124005494437087595272075651273306, -95739232923139212477565752848665046675);
|
||||
}
|
||||
|
||||
function nFflF (
|
||||
QFsBY: u16,
|
||||
ig8AI: i32
|
||||
) -> (
|
||||
eJa93,
|
||||
u128
|
||||
) {
|
||||
let wVYs: u64 = 17150358843210732735u64;
|
||||
let PW7m: u8 = KN5GV;
|
||||
wVYs = wVYs;
|
||||
wVYs *= 0;
|
||||
PW7m += 6u8;
|
||||
let Ngu6p = 8943877831269998164i64;
|
||||
DjAk(RxDY);
|
||||
const ZPntN = 494201974525721541u64;
|
||||
let BI3P = false;
|
||||
Ngu6p += -6302257762972050303i64;
|
||||
for dOGCq in 96378382..96378385 {
|
||||
let D3p6: [i128; 4] = [RxDY; 4];
|
||||
D3p6[1u32..2][0u32] /= D3p6[..3][0u32];
|
||||
let vS3t: char = 'x';
|
||||
let sSXA = -25469i16;
|
||||
const ib6hy: address = aleo1m7zhdd6g3cadgjw8s2pxt2v62hlfula3sj607vfjyt0c9tqpj5xsl8tq35;
|
||||
PW7m -= PW7m;
|
||||
let aS3I: [bool; 2] = [false; 2];
|
||||
D3p6[3u32] *= D3p6[1u32..0 * 2851184652u32 ** 1u32 * 0 * 0 - 0u32 + 3][0u32] * (-132398739494581955581789609515195973911 * 0 * D3p6[0..][1412242597 + 2626927325u32 + (2670766347 / c0q0D {BEMu: '\u{e630a}', K4OKX: 29999364278060019u64, sWaX: aleo18kk9pny7qjlr0ahhhc7f372vsztqd7cnzcdd6zndu7hd06rp7ygqt7dkpn}.TnP8d().1 * dOGCq / dOGCq) / dOGCq - 4039169921u32] * 0i128 + D3p6[1..][0]) / -56005947257550409174821572609407516561 + D3p6[0u32..true? 4u32 : 4u32][1] / -85246368279954515360146418422322718265i128;
|
||||
}
|
||||
return (390197594, 260459899954261109021372419872275322165);
|
||||
}
|
||||
|
||||
function DjAk (const C88h: i128) {
|
||||
if KN5GV > KN5GV && 123 > -90i8 && 2285689222 < 428945436u32 {
|
||||
let XaiAH: u16 = HIvz;
|
||||
XaiAH *= 0u16;
|
||||
const aN6j: c0q0D = c0q0D {K4OKX: 8501428031508490118u64, sWaX: aleo1pcnslsg5d9qv9uss6v5glenpjrrp8emz0jjuptlgjsahzxfyfsfqgk9c5c, BEMu: '\u{106903}'};
|
||||
XaiAH = XaiAH;
|
||||
let v_gr: R9gK = 86i8;
|
||||
let vQBrv: i8 = v_gr;
|
||||
} else if false != false && '\x02' == '\u{fe0a1}' {
|
||||
const Cv6t: c0q0D = c0q0D {BEMu: '\u{1c}', K4OKX: 4026017311429506330u64, sWaX: aleo1wh7fetrs63yr5ttr2d3xptkcrg30kkxnfuwhdqfhsnpsm738es9ssasnk4};
|
||||
let CFDU = 2554706819u32;
|
||||
} else {
|
||||
const XTXW: address = aleo1h9pa4s2gvh7chmyv2p99m4x7kmjskvu87hdzs6k92p2xnzzfjq9qjj3fjj;
|
||||
let anV6: R9gK = 106i8 ** 1i8 - (-65i8 / 39i8 * 6 ** 1) / 40;
|
||||
anV6 *= -81 - anV6 / anV6 ** 1i8 / -71i8 * anV6 + 80;
|
||||
let SVb5Q: [field; 1] = [4077384098494544667206066621428937904611008619967972987679305158596214220268495436363662321849766684235995314354942797342023149141772799315520179193258961field; 1];
|
||||
let hRtIk = [XTXW; 2];
|
||||
if 11360636251338665983u64 == 6182556736798576232u64 || 2818 < HIvz && 770830148i32 <= 2065969546 {
|
||||
let TxKP: eJa93 = c0q0D {sWaX: aleo1phfn932fnrpqvp2kydnd9shg26yj8nx9a2fqm7yy2gffxenycy9skct8m5, BEMu: FCIe('\x40', 7762636663263793586165276257252074065285452327816447223493926745924714407746413112191982102760406793158705070144184459624393741405589435306392529691108229, 143936786489186856337147359494669603286u128).1, K4OKX: M9bVT(c0q0D {BEMu: '\x2d', sWaX: aleo1h75wyxsmkmrlzaq4qemk9k9qfq0g9nluev0vzy66qyj6tjthjy8sv3c3m9, K4OKX: 7088702153228388238u64}.Iv4zF(13735531298038916337122557094612295893u128, KN5GV).0, 9953454491133807989249392638102019888543634898766562480703825926903264258664004505403271946073825334942084724425470955112328071093521950031906547905778694).1}.TnP8d().1;
|
||||
} else if 67u8 != KN5GV && 224953994693159224576578985106062181604 < 249440015587999031178484669792393069501u128 {
|
||||
hRtIk = hRtIk[0u32..];
|
||||
hRtIk[1..2][0u32] = hRtIk[1u32..2u32][0u32];
|
||||
let b6Ssn: i16 = -12298i16;
|
||||
let lYeI = (67037739923401076397062117992995431111i128, (-1925376793i32 >= -1453765275i32 && true != true? true : c0q0D {K4OKX: 5437340408171671476, BEMu: '\u{b01d7}', sWaX: aleo1uhje6jhv9ef0dcddjp2k9q5chepte9q69aj4xee88k25zt078qys0swynr}.Iv4zF(246374823898085179502856584377327541409, KN5GV).3)? c0q0D {BEMu: '5', K4OKX: M9bVT(-2046298489i32, SVb5Q[0..1u32][0]).1, sWaX: hRtIk[1u32..][0]} : c0q0D {BEMu: '\x38', K4OKX: 4525421086478513427u64, sWaX: aleo16d4u44sj28vv80ctyyy2yemleksgwv92ev7vu3qjgxqm05v8fqzq0xa6w4});
|
||||
SVb5Q[0u32..][0] *= SVb5Q[0u32..][..1][0];
|
||||
const OTuJD: char = 'X';
|
||||
let beqKf: char = ';';
|
||||
}
|
||||
let tc8Gw: [u8; 1] = [249u8; 1];
|
||||
tc8Gw[0..][0] += 0;
|
||||
tc8Gw[0u32..][0] *= 0u8;
|
||||
}
|
||||
if ['\x6d'; 3] == ['\u{c9437}'; 3] || -16573 <= -25741i16 || false == false {
|
||||
let gvbR: i16 = 16881i16;
|
||||
gvbR = gvbR;
|
||||
} else if aleo1evp22w8jtdfpzczqvz8fc34g0n5manlfvdhljha39k3740wdqursqnrza7 != aleo1mwwnplsmd8wlff6472eug06eszfz34p9mfvrl2put4kta9psyuzqn9cz5h && 5948144561193241423191637167728058303641973413071041880623282696840869970146872267108964222249247879428697403882067936500263123592142073385454010941437678 != 6741557943011570877578132335502636958361532271961769794787210902450438513460639642503171383031881141592233605006765658763340012210058645164039609847020737field && true != true {
|
||||
let NtCaM = [-4293925878918538465968391374178736514i128; 4];
|
||||
let uiDf = false;
|
||||
let c95x = c0q0D {sWaX: aleo1q23un4fadvtem0ddrsayw2kqxkdhcp52nd8tmr0gcm83dlqwuvzq962kp7, BEMu: ')', K4OKX: M9bVT(-1443533206, 7071866406647088236012383855462583350620191614555416228696018352702230906569951503953496771707337140195132189172381742116147595416246916329483847950043580field).1};
|
||||
NtCaM[..3u32][2u32] = NtCaM[0..4266700832u32 - 991705198u32 * 3u32 - 77852670 + 25603080u32 - 1239335645u32][1u32];
|
||||
const WRzGY: char = '\x1f';
|
||||
}
|
||||
const mJg_: R9gK = -106i8;
|
||||
let vph1: i16 = 16028;
|
||||
const gIfT = HIvz;
|
||||
let PeDJx: u8 = KN5GV;
|
||||
PeDJx += 74u8;
|
||||
const G2XDG = 23249i16 + -16543i16 / -26625i16;
|
||||
//RETURN
|
||||
}
|
||||
|
||||
function M9bVT (
|
||||
TSy1v: f7emM,
|
||||
fEkX: D7DUI
|
||||
) -> (
|
||||
[D7DUI; 2],
|
||||
u64,
|
||||
i16
|
||||
) {
|
||||
const O5Dl = true;
|
||||
const cKumc: field = 3381959365089964659190697228976142723593135010335530288360938140490965049778958198339208056882159925115722498684489544526835331723777589908514445431444956field;
|
||||
const PPide: [u64; 2] = [17661624248069496308u64, 11336616822948858680u64];
|
||||
let Kq4Qa: u64 = PPide[0u32];
|
||||
Kq4Qa -= PPide[0u32..991788121 / 1342912343u32 ** 2241021841 ** 0u32 + 2u32][1474344181u32 / c0q0D {K4OKX: PPide[0..2u32][O5Dl? O5Dl? 1u32 : 1u32 : 1], sWaX: aleo1hgky57732rlgr46tuvatgtmnkhthnq4frhj8ln05j3j8xas3wg8s8znnjw, BEMu: '\u{c}'}.TnP8d().1 + 655506754u32 / 2723267006 * 0u32 - 16];
|
||||
const zPop2: address = aleo1d0kerkqm8qukl8v0r5t8zf8lrenfm905x42j7przjj9yzw3eqgpq9vgc3v;
|
||||
Kq4Qa *= 1u64;
|
||||
const fC_K: f7emM = -1916096586;
|
||||
Kq4Qa += PPide[..1157284771 + 2286188359u32 + 510713829u32 + 314266907 - 4268453864][1];
|
||||
let elsT: u64 = PPide[0..2][0u32];
|
||||
Kq4Qa *= 7522699392864730264 / PPide[0..2][0u32] + PPide[1u32..2u32][0] / PPide[..1][0];
|
||||
return ([cKumc; 2], PPide[616486984 + 1779172181 / 497863060u32 - 732489493 * 0u32 / 2650790141 - 616486987u32..1369307979 ** 1 * 2u32 - 2738615956u32][0..][1u32], -1958);
|
||||
}
|
||||
|
||||
function uocd () -> (
|
||||
D7DUI,
|
||||
i128,
|
||||
u16
|
||||
) {
|
||||
let HNDgu = aleo1wveqsn8jr2dtmg8lknwtmg6u4ecqzjl5dr3tzz0qd3yce68fuu9qvyzq69;
|
||||
HNDgu = aleo1uk7ezw4dm322ky83xvpc4qlyllkhh7qzxhu3dezllkcner7cwugszrfz5y;
|
||||
HNDgu = HNDgu;
|
||||
const PrfI: i64 = -2415128496557894375i64;
|
||||
HNDgu = HNDgu;
|
||||
let sMamP: D7DUI = 3050972207293858985898027261134989740280030677253680626624233331809624642412field / 3535589802656998200414663729378559203486047389364630633320510383222552413078field - 7617669674777116573145493034288771881912278786788014099379523903600643564789field;
|
||||
sMamP = 7283898863926607047829441804784735551993698333151824285033297975715284272357181121366898148613021172170773141391819075973764254354221433711234731582155247field;
|
||||
HNDgu = aleo1wmcz5msr0drgm93sy3c92jgpdwc38qxnc86v6pgjrnq3h0agqcgswtq08z;
|
||||
return (679694547190221403116537244681951121754919771791350316747287453042032902862057226918548953516602842317380963297974405319599274158746187816329125707432325field, 83083990534768452705048990419652926759, 21119u16);
|
||||
}
|
||||
|
||||
struct c0q0D {
|
||||
K4OKX: u64,
|
||||
sWaX: address,
|
||||
BEMu: char,
|
||||
|
||||
function Iv4zF (
|
||||
&self,
|
||||
const ipMh: u128,
|
||||
const iOEIN: u8
|
||||
) -> (
|
||||
i32,
|
||||
u128,
|
||||
[address; 1],
|
||||
bool,
|
||||
bool
|
||||
) {
|
||||
self = self;
|
||||
self = self;
|
||||
const FzZBe: i64 = -643197592149967748;
|
||||
let YMf89 = FzZBe;
|
||||
let Dgb9: i64 = YMf89;
|
||||
const CLk2: i64 = FzZBe;
|
||||
let LAWrc: i16 = 32079i16;
|
||||
const qoicx: i8 = 126i8;
|
||||
LAWrc *= 1;
|
||||
self.BEMu = self.BEMu;
|
||||
let tdal7: [u64; 2] = [8388245588918634420u64, 1453414813218090559u64];
|
||||
tdal7[0..1][0] /= tdal7[3164332165u32 + 2467536369 * 0 - 995826184u32 * 3 / 2801076471u32 - 3164332164];
|
||||
if 8751819645477606739465991767336590174073657295189763951167036411552106813904106536054062561076463895660387284106042310404524825109480630466867779897231432field != 2115127521050823232154380155084113954644219345940856568249006021510649777751865861552474344263416250700685708337939930923605370429167388464237111171457269field || 13018102272562842131u64 != tdal7[3604865223u32 ** 0 + 2712791363 - 2157811397 - 554979967u32..1u32][0u32] && 268189170360476989005118072433093795065 <= 259597897676373350325954734974886119976u128 {
|
||||
let F0Wce: bool = false;
|
||||
const wM77z: i16 = -32698i16;
|
||||
let wOaL: u16 = 14538u16;
|
||||
let FV28t: c0q0D = self;
|
||||
tdal7[1u32..] = tdal7[1u32..];
|
||||
const sLhCp: i16 = wM77z;
|
||||
} else if -1598077892 < 834430274i32 || 7324314711686203691272558422022398360572523502301058715976822051136052462012834082000875535792826566421689489490288767984613382378164770887705837042049072field != 12020087347898652995061212535901462039777615210755734983434269553301944288156831518125668986272344618833804181615295707102238124262698343406193721402374171field && self.sWaX == self.sWaX {
|
||||
const LskI: i64 = FzZBe;
|
||||
let Bn5B: u8 = 37u8;
|
||||
let F31fB: i8 = 34i8;
|
||||
const zNbM_: u128 = 222889208679280605484259939391970401830u128;
|
||||
let rmTy3: char = '&';
|
||||
let uOun = [68726522506679376221642071634646978539u128; 4];
|
||||
const pTIL: address = aleo1r89u42rfh8ptcjl93t42cvqylwq6gh3quk99tp47tm7qwxl3esps49ek4n;
|
||||
uOun[2..false? true? 4 : 4u32 : 4u32] = [uOun[0u32..][3u32]; 2];
|
||||
}
|
||||
return (-1330563779i32, 49869787931219468050003648635684350950u128, [aleo1rqpas4pkm4hgwh6sj0gc7aycffcvqjdarnaq3jz592hu6t4s75zq3j33g2], Dgb9 > -1331431069782354307i64 || 22i8 < -54i8, false);
|
||||
}
|
||||
|
||||
function TnP8d (self) -> (
|
||||
bool,
|
||||
u32
|
||||
) {
|
||||
const DmLm: u16 = 62276u16;
|
||||
let VcDk: u32 = 2076386889u32;
|
||||
let akpiC: field = 12620179876212747618015263078521181097597683180570903043504022611362055512187511418595324819926630700868621135200337445883209486801296284506852422837115795field;
|
||||
akpiC *= 6795301077265828102230819445788147289785807698219041499098841944122326621697;
|
||||
const kfHSZ: i128 = -11142910603737792714635157500488940642i128;
|
||||
return (Self {K4OKX: 11651891261795895744, sWaX: self.sWaX, BEMu: self.BEMu}.Iv4zF(237114277218198383018381080565600145702u128, 12).4, 84191294);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct yoi2 {
|
||||
Q9XX: address,
|
||||
PeYO: char,
|
||||
|
||||
function d6a4a (
|
||||
self,
|
||||
KcEYB: u16,
|
||||
fITS7: i64,
|
||||
const SK3R: eJa93
|
||||
) -> (
|
||||
u128,
|
||||
i64,
|
||||
u128,
|
||||
u16,
|
||||
address
|
||||
) {
|
||||
const uYYNS: i16 = 4741i16;
|
||||
const AH1JA = SK3R;
|
||||
let C4eK5 = 15184229167774774597u64;
|
||||
C4eK5 = 1817823583727555793u64;
|
||||
if KN5GV != KN5GV && [10418; 4] == [46848u16; 4] || HIvz != ((KcEYB, 122i8), [326029612984919646259098413389086890933u128; 3]).0.0 {
|
||||
C4eK5 *= 0;
|
||||
let Ssjl: bool = false;
|
||||
let ELoJ: field = 4022025590070768614089504591446675525797902791905376121862004687697577330817391703446136392285510032646232430939678135588587329823607772956008498800316399field;
|
||||
let zWtQ = [139948959111052778124615455604631167440u128, 336271332812688144290687269674766777149u128];
|
||||
const tHBUz: i16 = -25418;
|
||||
DjAk(-152362983330921703465720711984467904217);
|
||||
const ndmr: f7emM = -616661352i32;
|
||||
zWtQ[0..2u32] = [zWtQ[..2][1]; 2];
|
||||
let JPT1 = uYYNS;
|
||||
} else if 30299i16 > uYYNS && 13156527554563220026766089172089410459727999823345608524237717848710505815674096741335546400445265707108640077658559127214449526812881748406135944135596729field == 1058122273492342301462951281560720684476970353691764752934697683100145379802460313917016093694918124212459745345527183177838167747998263153876566167496987field && 16516805546786858913 == 7271458256740227509u64 {
|
||||
let lhh7z: u8 = 184u8;
|
||||
let qhAGL: i128 = -160544352790873401672660389179862682249i128;
|
||||
} else {
|
||||
C4eK5 /= 1474268314080872282u64;
|
||||
let G7B2 = 48135549813543607988338174687857554657i128;
|
||||
}
|
||||
const PBF3D = -996550112i32;
|
||||
C4eK5 /= M9bVT(PBF3D, 5475802643900380806255643067094297463445681606339363686226205535604484372434222551701413509272022595621682781571585753579531751460567891941376825933384850).1;
|
||||
let EsRQv: i16 = uYYNS;
|
||||
const gOLj: i128 = -37892591301074942600370100541164391364i128;
|
||||
return (81064696772658427187273269555356373315u128, -2307465862478716785i64, 7593952914351541530419915238062231210u128, 6779u16, aleo1gdxz3j4gf0qc977262s5j620tjsk982ahlqn6vsjt3fsvjv96y8sx7gpy5);
|
||||
}
|
||||
|
||||
function VxgF (
|
||||
self,
|
||||
const iaAWb: R9gK,
|
||||
const mL53A: u16,
|
||||
const atdZ: ([u16; 2], [(i32, yoi2, u8, u32); 4])
|
||||
) -> (
|
||||
u128,
|
||||
field,
|
||||
i64
|
||||
) {
|
||||
const ku0bH: D7DUI = 11754752438259210427697170300987982028351432552797332663052854387111213342643848238421416191764489443428757402393852684480462172060453178973561128479470346;
|
||||
const K4STs: address = atdZ.1[3u32].1.Q9XX;
|
||||
const FWaK = 28672i16;
|
||||
let Vnbm = 4873298198158298303i64;
|
||||
Vnbm = -7525761477311718518;
|
||||
let Atdc: bool = true;
|
||||
const Zb3H: i128 = 130699347522932019666671778034147335541i128;
|
||||
const c33Fz: D7DUI = ku0bH;
|
||||
Atdc = Atdc;
|
||||
return (82624614926581149725349075041935125160, 2706225903841093727126482902797685194990264682272662674982659458493642750020421705260015665573361316348405833721364351456196890223766219493504966898847324field, -6035924515464853359);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,250 +3,251 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
type TESjC = u8;
|
||||
|
||||
type XgJbM = ud9u;
|
||||
|
||||
type KMjk = u64;
|
||||
|
||||
type zyIj = [gwqG; 3];
|
||||
|
||||
type nyaT0 = KMjk;
|
||||
|
||||
circuit ud9u {
|
||||
|
||||
function OA2a (self, const PQSm: i64) -> (
|
||||
[[u8; 1]; 2],
|
||||
u8,
|
||||
[field; 3]
|
||||
) {
|
||||
const WR50u: u8 = 89;
|
||||
const aJkWK: i64 = PQSm;
|
||||
const CuB6: i64 = aJkWK;
|
||||
let j6ofZ = true;
|
||||
const wj6tp = aleo1m70z0jghu88ef4q3s2plwhm4h0vjrcat79278c0uv0hzhpngmszq3u4ft4;
|
||||
let NZkd = j6ofZ;
|
||||
for vwqa in 1814569814..1814569840u32 {
|
||||
NZkd = j6ofZ;
|
||||
let XCfL: u64 = 8940103248940692844u64;
|
||||
NZkd = true;
|
||||
const ihYs1: u128 = 200771802962651051493456821267800245072;
|
||||
let GSEY = 74i8;
|
||||
program test.aleo {
|
||||
type TESjC = u8;
|
||||
|
||||
type XgJbM = ud9u;
|
||||
|
||||
type KMjk = u64;
|
||||
|
||||
type zyIj = [gwqG; 3];
|
||||
|
||||
type nyaT0 = KMjk;
|
||||
|
||||
struct ud9u {
|
||||
|
||||
function OA2a (self, const PQSm: i64) -> (
|
||||
[[u8; 1]; 2],
|
||||
u8,
|
||||
[field; 3]
|
||||
) {
|
||||
const WR50u: u8 = 89;
|
||||
const aJkWK: i64 = PQSm;
|
||||
const CuB6: i64 = aJkWK;
|
||||
let j6ofZ = true;
|
||||
const wj6tp = aleo1m70z0jghu88ef4q3s2plwhm4h0vjrcat79278c0uv0hzhpngmszq3u4ft4;
|
||||
let NZkd = j6ofZ;
|
||||
for vwqa in 1814569814..1814569840u32 {
|
||||
NZkd = j6ofZ;
|
||||
let XCfL: u64 = 8940103248940692844u64;
|
||||
NZkd = true;
|
||||
const ihYs1: u128 = 200771802962651051493456821267800245072;
|
||||
let GSEY = 74i8;
|
||||
}
|
||||
j6ofZ = NZkd;
|
||||
let s8Yd: char = '\x29';
|
||||
return ([28u8; (2, 1)], 196u8, [11613534243791163909098452126521461350059044290095737839705917403745497411067632416830425209120023881761098367665718381435033217273736816307046757848867494field; 3]);
|
||||
}
|
||||
|
||||
function txH_ (self) {
|
||||
let Bk2m: address = aleo1c52af5rl3m3kt8vvlq2wczzvnv8ef998grujqrqrn8m9pgvy4cgqjjqaql;
|
||||
Bk2m = Bk2m;
|
||||
let Qy_0J: address = Bk2m;
|
||||
let x2r8: char = '\u{107897}';
|
||||
const Fy6DX: u64 = 14051074936732436832u64;
|
||||
const aF05: u128 = 58248732485744991059773190464179758341u128;
|
||||
//RETURN
|
||||
}
|
||||
j6ofZ = NZkd;
|
||||
let s8Yd: char = '\x29';
|
||||
return ([28u8; (2, 1)], 196u8, [11613534243791163909098452126521461350059044290095737839705917403745497411067632416830425209120023881761098367665718381435033217273736816307046757848867494field; 3]);
|
||||
}
|
||||
|
||||
function txH_ (self) {
|
||||
let Bk2m: address = aleo1c52af5rl3m3kt8vvlq2wczzvnv8ef998grujqrqrn8m9pgvy4cgqjjqaql;
|
||||
Bk2m = Bk2m;
|
||||
let Qy_0J: address = Bk2m;
|
||||
let x2r8: char = '\u{107897}';
|
||||
const Fy6DX: u64 = 14051074936732436832u64;
|
||||
const aF05: u128 = 58248732485744991059773190464179758341u128;
|
||||
//RETURN
|
||||
|
||||
|
||||
struct QIdG {
|
||||
mOJx: u128,
|
||||
ats6: i32,
|
||||
QJg2: u32,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
circuit QIdG {
|
||||
mOJx: u128,
|
||||
ats6: i32,
|
||||
QJg2: u32,
|
||||
}
|
||||
|
||||
|
||||
function kDEUr (
|
||||
u6nw: ((address, field, [(i8, u16); 1]), u128, u16, field),
|
||||
E8rp: bool
|
||||
) -> (
|
||||
(address, char),
|
||||
u16,
|
||||
u32,
|
||||
i32
|
||||
) {
|
||||
let ozt9: field = u6nw.3;
|
||||
ozt9 *= ozt9;
|
||||
let xOyuj: u64 = 13578623587887876151u64;
|
||||
const c7OvE: ud9u = ud9u {};
|
||||
const TUHZ: TESjC = 197u8;
|
||||
const cnqDN = 28229i16 + (20672i16 + -8178i16 + 25460i16 ** 0i16 / -17361i16) ** 0i16 / 18989i16 ** 0i16;
|
||||
xOyuj /= xOyuj;
|
||||
let j6FKQ: i8 = u6nw.0.2[0u32].0;
|
||||
const jhIC = aleo14d4vderqrxpgh0akgjwlzppte4hs2nhhrwcs3r4g46l95jqp5uzqt2luuy;
|
||||
return ((aleo1x4j93j80z9884fqxemay9wddpek37gd5srgc6dlzafn3q8qjlcqqwrwfny, '='), u6nw.0.2[2693679475u32 - 985713480u32 + 1702181668u32 - 3410147663u32].1, 434662353u32, -464439425i32);
|
||||
}
|
||||
|
||||
function main (elXa: i128) -> (
|
||||
address,
|
||||
u8
|
||||
) {
|
||||
let Ru9m: i128 = elXa;
|
||||
let QqX1p: u16 = 29055u16;
|
||||
Ru9m *= -78783067066806544842812258509769343126i128 / -5192770903335893587638550000711824419 * -9435685705221922686293311198515767869 - 23767944657469791368988025644903192385i128 + 165303230235798631663387693622639710420;
|
||||
Ru9m += elXa;
|
||||
QqX1p += QqX1p;
|
||||
const Y9Zos: KMjk = false? 10974874796025158940 : 10392375857856966340u64;
|
||||
ud9u {}.txH_();
|
||||
Ru9m *= 14204762091749667829716695633555975943 - 2i128 * elXa / elXa / -51256873949263659182183494734768974285i128 * Ru9m - 14204762091749667829716695633555975943i128;
|
||||
Ru9m = Ru9m;
|
||||
const DOKSH: char = 'C';
|
||||
let PYAL: i64 = -2994169907192071424i64;
|
||||
return (aleo1fl2jl3jyphgprzcmj78j88s93fu3clx47uskj0508y5r7z6fncyq8706c6, (183u8 ** 0u8 + (true? 67 : 65u8) * 0u8 + 195u8 / 203u8) * 60u8 ** 1u8 - 0u8 * 0u8 ** (61u8 - 32u8 - 13u8 - 23u8 / 65u8 / 84u8));
|
||||
}
|
||||
|
||||
circuit gwqG {
|
||||
KWE2: (i64, i128, [i32; 2], (([address; 1], i64, address, i128), TESjC)),
|
||||
PtPCd: u64,
|
||||
P4SG: (i32, [(u32, bool, TESjC); 2], i32, i16),
|
||||
}
|
||||
|
||||
|
||||
function q7VG (const X4Gb: field) -> (
|
||||
(u64, u32, bool),
|
||||
bool,
|
||||
char
|
||||
) {
|
||||
const lX8Z = (true? true == false && 3353090067u32 < 996765664u32 && -88376969325974228891119886691968649663i128 > 56219380627480955959740192790875220093 : 128634236493270227551216251086470968550 < 238236668216240613240346188824974400926u128 && 2776064343u32 != 3820469247u32 || 1983509902 != 2041221782u32, 4206i16, 577664685i32, 7766914339925552831i64);
|
||||
let QD9Lx: i128 = 28861373067964821194095254514253894788;
|
||||
let ZVLx = QIdG {QJg2: 1685667744u32, ats6: lX8Z.2, mOJx: QIdG {ats6: -1461469311i32, QJg2: 3183947795u32, mOJx: 218386195035658591842525198906231184080u128}.mOJx};
|
||||
ZVLx.mOJx = 0u128 * ZVLx.mOJx * ZVLx.mOJx;
|
||||
let jY4c: bool = lX8Z.0;
|
||||
const mHL7 = 105i8;
|
||||
ZVLx.QJg2 **= 1u32;
|
||||
const ULFb1: i16 = -16154i16;
|
||||
return ((6763254871531561533u64, 139486710, false), false, '\u{14e8c}');
|
||||
}
|
||||
|
||||
function CoGhD (const WJFU1: (XgJbM, field, i64, field)) -> bool {
|
||||
let eGKE: [[bool; 2]; 1] = [true; (1, 2)];
|
||||
let yFrO = 2036u16;
|
||||
const D7Xx: i64 = -2440702085321745647i64;
|
||||
const U5YY: address = aleo16t6ygmm2m382q8uehktsp4ten9sy2cxh4j8509wtr7rmm93wcgxs8tglw3;
|
||||
eGKE[233845097 / 3736404436u32 - kDEUr(((aleo1g4k309zp3vaqv0sxglrvkhs9gp9ckhw5v52jmfyu62ma4u7uey8sklw2uk, 10086291435577022007997301325406879763624457159392633804470943861697748575824794153623634261246049427910568941445685913807246737378194595481640110825434705, [(-95, 42141); 1]), 87335344619067415986073728015470963163, 19630, 3283923985777856979751544617900598730773060262053677782741241332916996598750174662203783751362944176254364190278085131518918179082964387816577837078606845), eGKE[0][0..1][0u32]).2 / 1291051558][..4113867190 ** 0u32 + 2320379293u32 - 2320379292] = eGKE[0u32..][0u32];
|
||||
let oSqd = 7446728409031362153i64;
|
||||
const wuEu: i128 = -50284962727750254171464282994019009082i128;
|
||||
const OeE4B: TESjC = 61u8;
|
||||
eGKE[0][1..2][0] = eGKE[0u32][..2u32][0u32];
|
||||
if '\x51' == '\u{2629f}' || yFrO != yFrO || eGKE[0][..2u32][1u32] != eGKE[0u32][0u32..][0] {
|
||||
let oT_X: bool = eGKE[0u32][0u32..][1u32];
|
||||
} else if 11395076137437459228u64 <= 3181544859890518079u64 || 327243686524707468148062285179309560977u128 == [(103907580244344151265856573374909602732u128, [168u8; 2], 563298971i32, 7269i16)][2839524245 * 2903128575 ** 0u32 - 2839524245u32].0 {
|
||||
eGKE[..1u32][0..1u32] = eGKE[0..1];
|
||||
eGKE[0..][0u32] = eGKE[..1u32][true? 0u32 : 0u32];
|
||||
eGKE[0][0u32..][1u32] = eGKE[0u32][0u32..][1u32];
|
||||
eGKE[..1u32] = eGKE[..1u32];
|
||||
}
|
||||
if kDEUr(((aleo10jay9nh76z83chxdl8l8r6p3nycp58gcsy7pypafdx4f3mrwruxq02kmgq, 11687200791853548151965426187690814707484368141892857878855417328749648641559979695873324082015270477986014492427181621509748453362692313269740171990323847, [(-77, 26673)]), 100969797919704407328452720214024220208u128, 47339u16, 7449814326481628066684811708681677614363848253846043453728537648794454074889305814692166515007738753324687796145518810650479167278505003144898332234658154), eGKE[0][0..2][0u32]).3 < -1401848276 && 3490351887u32 <= 765619537u32 && U5YY == U5YY {
|
||||
eGKE[0u32][..1][0u32] = eGKE[0u32][0..2][1u32];
|
||||
eGKE[0][3509040380u32 + 3116946467 / 1074258280u32 - 1196067799 - 979950986 - 1333021597u32..][0u32] = eGKE[0][1u32..][2370601846u32 + 1040939512 * 1 * 1161196229u32 ** 0 - 3411541358u32..][0u32];
|
||||
if wuEu <= wuEu || -27137 <= -3403i16 {
|
||||
const Fjd8U: i16 = -10771i16;
|
||||
eGKE[0u32][..2] = eGKE[..3661531842u32 ** 1u32 - 963533551u32 - 2680747516 - 5705872 + 620673541 - 632218443u32][0];
|
||||
eGKE[0][1u32..][0] = eGKE[0u32][1..][0u32];
|
||||
} else if 's' == '\u{2}' && 13295627065129031147473905922046883809660101779304731275924598473775312740820299976041279707365689742715884647665916823843495325467976847844967332012480195field == WJFU1.1 {
|
||||
let mgFdw: u64 = 11577870450728313922u64;
|
||||
const nuMI: u32 = 1362094470u32;
|
||||
eGKE[0u32][(true? (1324099563400772497189259229374217694971725250319701416295264450434223251341129528798118554948314727574977981892553921980656954354366523311996343515643442, (wuEu, (true, 17140470428350360762u64, 13883709179841168205u64, true), 17063950483798517543u64)) != (9509400093295463668020117236440450287556405822150254027907795454481937657335598561644899647708487637402544140806933618697879228161024740767605485832813986field, (-80246066962419246510688450876934885634i128, (true, 14991284161801234458u64, 69576329936762586u64, true), 10776468650675250839u64)) && 76i8 <= (false? false? 90 : 84i8 : -107) || OeE4B != OeE4B? 1u32 : 1 : nuMI - 836493990u32 + 3497030522u32 - nuMI - 140025802 - 1148250509u32 - 1372260220u32)..] = eGKE[0u32][1u32..2u32];
|
||||
yFrO += yFrO;
|
||||
const pWuv: char = '\u{5}';
|
||||
eGKE[nuMI * 1u32 + 2032926285u32 - 3395020755][..1][0u32] = eGKE[0][..1][0u32];
|
||||
|
||||
|
||||
function kDEUr (
|
||||
u6nw: ((address, field, [(i8, u16); 1]), u128, u16, field),
|
||||
E8rp: bool
|
||||
) -> (
|
||||
(address, char),
|
||||
u16,
|
||||
u32,
|
||||
i32
|
||||
) {
|
||||
let ozt9: field = u6nw.3;
|
||||
ozt9 *= ozt9;
|
||||
let xOyuj: u64 = 13578623587887876151u64;
|
||||
const c7OvE: ud9u = ud9u {};
|
||||
const TUHZ: TESjC = 197u8;
|
||||
const cnqDN = 28229i16 + (20672i16 + -8178i16 + 25460i16 ** 0i16 / -17361i16) ** 0i16 / 18989i16 ** 0i16;
|
||||
xOyuj /= xOyuj;
|
||||
let j6FKQ: i8 = u6nw.0.2[0u32].0;
|
||||
const jhIC = aleo14d4vderqrxpgh0akgjwlzppte4hs2nhhrwcs3r4g46l95jqp5uzqt2luuy;
|
||||
return ((aleo1x4j93j80z9884fqxemay9wddpek37gd5srgc6dlzafn3q8qjlcqqwrwfny, '='), u6nw.0.2[2693679475u32 - 985713480u32 + 1702181668u32 - 3410147663u32].1, 434662353u32, -464439425i32);
|
||||
}
|
||||
|
||||
function main (elXa: i128) -> (
|
||||
address,
|
||||
u8
|
||||
) {
|
||||
let Ru9m: i128 = elXa;
|
||||
let QqX1p: u16 = 29055u16;
|
||||
Ru9m *= -78783067066806544842812258509769343126i128 / -5192770903335893587638550000711824419 * -9435685705221922686293311198515767869 - 23767944657469791368988025644903192385i128 + 165303230235798631663387693622639710420;
|
||||
Ru9m += elXa;
|
||||
QqX1p += QqX1p;
|
||||
const Y9Zos: KMjk = false? 10974874796025158940 : 10392375857856966340u64;
|
||||
ud9u {}.txH_();
|
||||
Ru9m *= 14204762091749667829716695633555975943 - 2i128 * elXa / elXa / -51256873949263659182183494734768974285i128 * Ru9m - 14204762091749667829716695633555975943i128;
|
||||
Ru9m = Ru9m;
|
||||
const DOKSH: char = 'C';
|
||||
let PYAL: i64 = -2994169907192071424i64;
|
||||
return (aleo1fl2jl3jyphgprzcmj78j88s93fu3clx47uskj0508y5r7z6fncyq8706c6, (183u8 ** 0u8 + (true? 67 : 65u8) * 0u8 + 195u8 / 203u8) * 60u8 ** 1u8 - 0u8 * 0u8 ** (61u8 - 32u8 - 13u8 - 23u8 / 65u8 / 84u8));
|
||||
}
|
||||
|
||||
struct gwqG {
|
||||
KWE2: (i64, i128, [i32; 2], (([address; 1], i64, address, i128), TESjC)),
|
||||
PtPCd: u64,
|
||||
P4SG: (i32, [(u32, bool, TESjC); 2], i32, i16),
|
||||
}
|
||||
|
||||
|
||||
function q7VG (const X4Gb: field) -> (
|
||||
(u64, u32, bool),
|
||||
bool,
|
||||
char
|
||||
) {
|
||||
const lX8Z = (true? true == false && 3353090067u32 < 996765664u32 && -88376969325974228891119886691968649663i128 > 56219380627480955959740192790875220093 : 128634236493270227551216251086470968550 < 238236668216240613240346188824974400926u128 && 2776064343u32 != 3820469247u32 || 1983509902 != 2041221782u32, 4206i16, 577664685i32, 7766914339925552831i64);
|
||||
let QD9Lx: i128 = 28861373067964821194095254514253894788;
|
||||
let ZVLx = QIdG {QJg2: 1685667744u32, ats6: lX8Z.2, mOJx: QIdG {ats6: -1461469311i32, QJg2: 3183947795u32, mOJx: 218386195035658591842525198906231184080u128}.mOJx};
|
||||
ZVLx.mOJx = 0u128 * ZVLx.mOJx * ZVLx.mOJx;
|
||||
let jY4c: bool = lX8Z.0;
|
||||
const mHL7 = 105i8;
|
||||
ZVLx.QJg2 **= 1u32;
|
||||
const ULFb1: i16 = -16154i16;
|
||||
return ((6763254871531561533u64, 139486710, false), false, '\u{14e8c}');
|
||||
}
|
||||
|
||||
function CoGhD (const WJFU1: (XgJbM, field, i64, field)) -> bool {
|
||||
let eGKE: [[bool; 2]; 1] = [true; (1, 2)];
|
||||
let yFrO = 2036u16;
|
||||
const D7Xx: i64 = -2440702085321745647i64;
|
||||
const U5YY: address = aleo16t6ygmm2m382q8uehktsp4ten9sy2cxh4j8509wtr7rmm93wcgxs8tglw3;
|
||||
eGKE[233845097 / 3736404436u32 - kDEUr(((aleo1g4k309zp3vaqv0sxglrvkhs9gp9ckhw5v52jmfyu62ma4u7uey8sklw2uk, 10086291435577022007997301325406879763624457159392633804470943861697748575824794153623634261246049427910568941445685913807246737378194595481640110825434705, [(-95, 42141); 1]), 87335344619067415986073728015470963163, 19630, 3283923985777856979751544617900598730773060262053677782741241332916996598750174662203783751362944176254364190278085131518918179082964387816577837078606845), eGKE[0][0..1][0u32]).2 / 1291051558][..4113867190 ** 0u32 + 2320379293u32 - 2320379292] = eGKE[0u32..][0u32];
|
||||
let oSqd = 7446728409031362153i64;
|
||||
const wuEu: i128 = -50284962727750254171464282994019009082i128;
|
||||
const OeE4B: TESjC = 61u8;
|
||||
eGKE[0][1..2][0] = eGKE[0u32][..2u32][0u32];
|
||||
if '\x51' == '\u{2629f}' || yFrO != yFrO || eGKE[0][..2u32][1u32] != eGKE[0u32][0u32..][0] {
|
||||
let oT_X: bool = eGKE[0u32][0u32..][1u32];
|
||||
} else if 11395076137437459228u64 <= 3181544859890518079u64 || 327243686524707468148062285179309560977u128 == [(103907580244344151265856573374909602732u128, [168u8; 2], 563298971i32, 7269i16)][2839524245 * 2903128575 ** 0u32 - 2839524245u32].0 {
|
||||
eGKE[..1u32][0..1u32] = eGKE[0..1];
|
||||
eGKE[0..][0u32] = eGKE[..1u32][true? 0u32 : 0u32];
|
||||
eGKE[0][0u32..][1u32] = eGKE[0u32][0u32..][1u32];
|
||||
eGKE[..1u32] = eGKE[..1u32];
|
||||
}
|
||||
if 97961373739574987193198311452118127234i128 <= 88149576313370097628825768959778517416 || wuEu == 140907141284439736247636185407353477261i128 {
|
||||
let Xlbx: i8 = eGKE[0u32][1989383460u32 ** 1u32 + 368828696u32 + 178704341u32 + 711311306u32 - 3248227803u32..][1u32]? -39 : 19i8;
|
||||
const tG_o: [[u64; 3]; 2] = [8351631060358886228u64; (2, 3)];
|
||||
const pofE = 34608u16;
|
||||
eGKE[0][0u32..][0u32] = eGKE[0][0u32..896155508u32 + 2123742783u32 / 82464430 - 896155531][3599492765 + 469168208 + 1510002368u32 / kDEUr(((U5YY, 2490679513469546434529351683782591947174770828265084971041727633159185080151531469641950514197128009829000203315755718140996406599875799694693523808457143field, [(-98i8, 37092u16)]), 188547537262576526670523000470002996434, 36693u16, WJFU1.1), eGKE[0u32][1u32]).2 - 4068660976u32];
|
||||
const mvUJr: [u128; (2, 3)] = [[192135102743266045779694578941481188480u128, 250316349057433474146799608574805237644u128, 232012296241327518720945688036673048736u128], [140153643843594627170578302698357494486u128; 3]];
|
||||
const Mxoc9: char = '!';
|
||||
let Id7g = (44923u16, '\u{7}', ['{'; 2], -26120i16);
|
||||
if (OeE4B, 1374) == (120u8, 6487u16) || eGKE[eGKE[3587636127u32 / 1734717873u32 * kDEUr(((aleo1559jt2h8tqaqjjg8376nl8jgwc9cnr3rjvdac78s6uhfkfgdy58q8rvy34, 4893039754597810991298101006579207465658269559265607181406483387920310275546431026893580245633409806089162204882902581239961472845825571507775938543642478field, [(Xlbx, pofE); 1]), mvUJr[1][1u32..true? 1093450336 * 2u32 * 0 * 0u32 - 0u32 + 3u32 : 3u32][0], Id7g.0, WJFU1.1), eGKE[1421989724 + 2282765521 + 1 ** kDEUr(((aleo1w9ea5jhqfvlkf63dfepcvgvlhu8jymyna7t0xx6xzse8n9czgurqu32kad, 12553051198281264968411827973380821180152422734228413690022186641595490316661398472030208591140127071025109535839461656919590189834665276233238839668056456, [(-6i8, 27335)]), 169542850521684343130284369641384038448, 44392, 3727181691205833796346995232789395995452385289630482711223012484507052098570222170942893024610259723295955017055379300068326693405492410815606192348210162), true).2 * 1640793295u32 * 0 - 3704755245][0..2][1u32]).2 - 869324706u32][0..2u32][0]? 0u32 : 0u32][0u32..][1u32] != eGKE[0u32][..2][0] {
|
||||
let wWeZ3: i8 = -93;
|
||||
let epWx4 = kDEUr(((aleo1guhrk23u5qwjnz8e8cmp6aj9ecs9kxvxfh00qdw9x6e44wzumqgqvnlgmq, 10850347706529691777383717267011097059081564264327863153034046577664766768121774050313599314193730778947782829388854050400394295607533685465139069269751942, [(-62, 44990); 1]), 137377424026935693438565684896161687398u128, 8800u16, 3565615291890963597709054041735431255229923978841874140464190589208258967469909660677502450044900127682733477177316102377810434350705282439917460198185775), false).3;
|
||||
const us0a = false;
|
||||
const Achr: bool = us0a;
|
||||
const f9rd: i64 = D7Xx;
|
||||
const xiaW: i64 = WJFU1.2;
|
||||
if Xlbx == Xlbx && epWx4 != epWx4 {
|
||||
const Jrg4 = [aleo1vv9rhr2t05pdl2sfqxjg6xclky9c66pv9y92k4dzcpz5zu97m5qsccmu6c; 4];
|
||||
const Tfxe: char = '\x38';
|
||||
let PNP2F: i8 = Xlbx;
|
||||
let QJq3: i16 = Id7g.3;
|
||||
eGKE[0u32][0..][1] = us0a;
|
||||
eGKE[0][0u32..][1u32] = Achr;
|
||||
Id7g.2[0u32..1][0u32] = Id7g.2[0u32..2u32][1u32];
|
||||
const ybJxx: i32 = -1337727605i32;
|
||||
const DyNk: u128 = mvUJr[0u32][..730328362u32 + (0u32 ** 984982457u32 ** 1u32) - 3552469159u32 / 3288198542u32 - 730328359u32][1u32];
|
||||
} else if -3627647846447564088 >= WJFU1.2 || [[false; 4]] != [false; (1, 4)] && U5YY == U5YY {
|
||||
Xlbx += Xlbx;
|
||||
let rYoi: (i16, field, i8, u16) = (15304i16, 3625259188763400242879491794840836446305612663997255866451867848521152710113680228748341130832324989157228483488461502392395711170008392647825262579121170field, 73i8, 4687u16);
|
||||
let IaPsZ: u128 = mvUJr[4087366772u32 / 1121309916u32 ** 0u32 * 0u32 * 0u32 + 1u32][..1u32][0u32 ** kDEUr(((aleo1u59h09jcvx5zun6q97h34dhw96pe6e092caht7dm8xn6z3ypagrsp3rtud, 4572346816259149108743961473575372827369895305947975888914970127393094943768582719247196172453386943091243064784373101008901733439865373142568607156802019field, [(113, 60999u16); 1]), mvUJr[1][0..us0a? 2u32 : 2u32][0], yFrO, rYoi.1), eGKE[0][0u32]).2 - 3173809056u32 ** 0u32 * 0u32 ** kDEUr(((aleo1nsmvxzakh57tdg7x9uyexk90es5a03zd7dprynn8ywgj9ku8zsxs76c2xy, 13231270929795927303772027390821043840951668465103819710789039173773877854378660101481042606411970378869697545937991133234264609078057024095623687897522873field, [(-113, 26548u16)]), 187537437138539430164480165812094435266, 14634, WJFU1.3), eGKE[0u32][0..][0]).2];
|
||||
eGKE[0..1u32] = eGKE[..1u32];
|
||||
eGKE[0u32] = eGKE[0][..2];
|
||||
Id7g.0 += rYoi.3;
|
||||
const IO7T: i32 = -1775026454i32;
|
||||
const nInEx = false? OeE4B : OeE4B;
|
||||
Id7g.2[..2] = Id7g.2[..2u32];
|
||||
} else {
|
||||
eGKE[0u32][0..945890680 + (false? 975425886u32 : 3146089746) * 0 - 945890679u32] = eGKE[0u32][..1u32];
|
||||
Id7g.2[1..][0] = Id7g.2[2419375510u32 / 190259160u32 * 2047118047u32 ** 0u32 / (eGKE[0u32][0u32]? kDEUr(((aleo1r8j6hc48ehlwhkqrdumwd55alh3nrvx6nntxt5jstc6yhmm88gfqcsfkru, 154607879377828207039408865230382656642460575105035392923433776823685140532600490051892006678379951323378194927013475952015512998723056973980863745309892field, [(-116i8, 61504u16); 1]), 5904036629510321716572936841925707394u128, 2700u16, WJFU1.3), eGKE[0][..3321162822u32 * 0u32 / (2302801384 ** 0u32 * 3620175210) + 1u32][0]).2 : kDEUr(((aleo16uscssuaaxy2tt5c3lqyxx2afl8z7pus4v8ygfjux2wxm3c4c5xqwl77jk, 1983703272889905468311836805795055485164861238369026076348929176230261086685907618645648838270802265401728739210864892526398594546017419684284779373009088field, [(14i8, 28890); 1]), 124153545594470221385586778552050724536, 40890, 12151836699736089119504903080018693322145319182124805149232958935846145521476055396995487179113270824459142148947281187229889156575035077182723450145657888field), true).2 / 863700377 * 0 + kDEUr(((aleo1dw2lmvrzx4y3x8fffgn8hcr22g30nqrzgmv30fz7nkadlg2qfvgq3akljz, 29732478688380494703339886956751542152110817174982441900083078413148796023106524594518819116049126014992186605540919343965295614262205387916810526553744, [(18i8, 2843); 1]), mvUJr[0][..3][1u32], yFrO, WJFU1.3), eGKE[0u32][0]).2) - 0u32];
|
||||
eGKE[0u32][..2u32][1] = epWx4 != 582403777i32 || (Achr? f9rd : xiaW) > D7Xx && 123i8 < -35;
|
||||
}
|
||||
} else if (WJFU1.1 * WJFU1.1 + 4997196675491260686001972934572280655948598823503424920331071523371386872790 - WJFU1.3 - WJFU1.1, oSqd, tG_o[0u32][0..2u32][1], (118, -25912i16)) != (5689382486401851183244561252762534880901387299311469507557881598344946452378644684946541128384662553424523434570526106597122063636091236834612694116299023field, 688179155413492233i64, 3270723359228597020u64, (-128i8, 28672i16)) && WJFU1.1 != WJFU1.3 && -1045737702 > 1167872995i32 {
|
||||
let ezOw: TESjC = 176;
|
||||
Xlbx -= Xlbx;
|
||||
let zkzx = wuEu;
|
||||
const B6nF2 = -865346137i32 - -1506338518i32 - 1889286591i32 ** 1i32;
|
||||
ud9u {}.txH_();
|
||||
Id7g.2[1..2u32][0u32] = '#';
|
||||
Id7g.2[..1u32][..1][0u32] = Id7g.2[0u32..][0];
|
||||
Id7g.2[1..] = Id7g.2[..1u32];
|
||||
} else {
|
||||
let Ddgt: i64 = WJFU1.2;
|
||||
if wuEu > wuEu && 4950191121644525007 * 1 + WJFU1.2 / D7Xx + D7Xx / D7Xx > Ddgt && (3445709662445339124966039955851910804825394763370142824106604387483865997362734623038345126555362147677743770469355767645697752481754904401585905040649845field, 12760233673026295027169325044258802893205988142757535481584951002852675315682976473240833997243099468269850726585895476087054478306870052616041699264571589, (false, 2362554768193566915017550509045849086111347769924326264905379896693764679651344674477430023748331696530454272840838499562488956265850450263335219724879307field, 13, 238567901038010930208120788385310382705846250069475009354407688177082454479483307254797504692991707028073390522123272123983358360941385246857379307641155), 714903914) == (WJFU1.1, WJFU1.1, (eGKE[0u32][0u32..][1u32], 4993859481089268687173684676314618051582712413234438444938276593501161971006238398744898606637894395649165706956113041208809079590082468227312357865660736field, 1u8 + 232u8 ** 0u8 - 0u8, 5146126727091813424584693335683521116282876803042677903474218001976551388900344647364718712119059322786863710041208868953765066730245850518116415104245194field), 734730659i32) {
|
||||
let j4xdK: bool = eGKE[0u32][0u32..][0u32];
|
||||
} else {
|
||||
let rvHo: i8 = Xlbx;
|
||||
}
|
||||
let By0o9: u16 = Id7g.0;
|
||||
if mvUJr[1][1u32..3u32][3976141290u32 * 0u32 + 888605653u32 - 888605652u32] > mvUJr[1u32][0..][0] || By0o9 > By0o9 || Xlbx == Xlbx {
|
||||
const gQ0ft: address = U5YY;
|
||||
} else if wuEu == -160335800677657412752072363260265326402 || [[true, false], [true; 2]] != (eGKE[0u32][1]? [[false; 2], [false; 2]] : [false; (2, 2)]) || Id7g.3 >= 14928i16 {
|
||||
eGKE[0][..2u32] = [false, true];
|
||||
let pBr5 = 86236897525765601521958346370883266108i128;
|
||||
let K6YXq: TESjC = 139u8;
|
||||
const kA2Ks: u16 = pofE;
|
||||
yFrO *= 20u16;
|
||||
} else {
|
||||
let XfS0 = U5YY;
|
||||
eGKE[0u32][0u32..][0] = false;
|
||||
oSqd /= Ddgt;
|
||||
eGKE[0][2714664265 + 265918089 + 0u32 ** 4284932475u32 ** 1 - 2980582353..][417523846u32 ** 1 - 1149997708u32 * 1u32 / 3327611392 - 417523846] = true;
|
||||
let JziC: u16 = yFrO;
|
||||
const mCeT: i64 = -9200318551018854695i64;
|
||||
}
|
||||
Id7g.2[1..2][0u32..][0] = '\x7a';
|
||||
ud9u {}.txH_();
|
||||
Id7g.2 = Id7g.2[0u32..2u32];
|
||||
const miqRZ: field = WJFU1.1;
|
||||
Id7g.2[1..] = [Id7g.1];
|
||||
if kDEUr(((aleo10jay9nh76z83chxdl8l8r6p3nycp58gcsy7pypafdx4f3mrwruxq02kmgq, 11687200791853548151965426187690814707484368141892857878855417328749648641559979695873324082015270477986014492427181621509748453362692313269740171990323847, [(-77, 26673)]), 100969797919704407328452720214024220208u128, 47339u16, 7449814326481628066684811708681677614363848253846043453728537648794454074889305814692166515007738753324687796145518810650479167278505003144898332234658154), eGKE[0][0..2][0u32]).3 < -1401848276 && 3490351887u32 <= 765619537u32 && U5YY == U5YY {
|
||||
eGKE[0u32][..1][0u32] = eGKE[0u32][0..2][1u32];
|
||||
eGKE[0][3509040380u32 + 3116946467 / 1074258280u32 - 1196067799 - 979950986 - 1333021597u32..][0u32] = eGKE[0][1u32..][2370601846u32 + 1040939512 * 1 * 1161196229u32 ** 0 - 3411541358u32..][0u32];
|
||||
if wuEu <= wuEu || -27137 <= -3403i16 {
|
||||
const Fjd8U: i16 = -10771i16;
|
||||
eGKE[0u32][..2] = eGKE[..3661531842u32 ** 1u32 - 963533551u32 - 2680747516 - 5705872 + 620673541 - 632218443u32][0];
|
||||
eGKE[0][1u32..][0] = eGKE[0u32][1..][0u32];
|
||||
} else if 's' == '\u{2}' && 13295627065129031147473905922046883809660101779304731275924598473775312740820299976041279707365689742715884647665916823843495325467976847844967332012480195field == WJFU1.1 {
|
||||
let mgFdw: u64 = 11577870450728313922u64;
|
||||
const nuMI: u32 = 1362094470u32;
|
||||
eGKE[0u32][(true? (1324099563400772497189259229374217694971725250319701416295264450434223251341129528798118554948314727574977981892553921980656954354366523311996343515643442, (wuEu, (true, 17140470428350360762u64, 13883709179841168205u64, true), 17063950483798517543u64)) != (9509400093295463668020117236440450287556405822150254027907795454481937657335598561644899647708487637402544140806933618697879228161024740767605485832813986field, (-80246066962419246510688450876934885634i128, (true, 14991284161801234458u64, 69576329936762586u64, true), 10776468650675250839u64)) && 76i8 <= (false? false? 90 : 84i8 : -107) || OeE4B != OeE4B? 1u32 : 1 : nuMI - 836493990u32 + 3497030522u32 - nuMI - 140025802 - 1148250509u32 - 1372260220u32)..] = eGKE[0u32][1u32..2u32];
|
||||
yFrO += yFrO;
|
||||
const pWuv: char = '\u{5}';
|
||||
eGKE[nuMI * 1u32 + 2032926285u32 - 3395020755][..1][0u32] = eGKE[0][..1][0u32];
|
||||
}
|
||||
let MzbK1 = mvUJr[0u32][1u32];
|
||||
} else if kDEUr(eGKE[0u32][4220456327u32 ** 0u32 + 920325500u32 - 775699652u32 - 144625849..1][0]? ((aleo1dtjlzdar745jwhvf5vhdeak3pdvarsr8jfx2t78hdl86x77ykqpqg2hks7, 10370644121642292595522409921374543364347459055821343939899800512248497191619899977622618403047143654246392905951500535716071354350642769414032597379940456field, [(124, 6169u16); 1]), 111931430081106712937097825451394535656u128, 48941u16, 10579470616455153490081489709169828901595762761679051557680779383918092539985392613485269936591554688538019497232448460996768405534418536976127377158654917field) : ((U5YY, 7275473031633978899663765071702200825091065017135552629728814753923979270436271907411600144211677939826486129786424145608822037266543066553809169109293374, [(-73, 37996u16); 1]), 334220435131399063682028438435658901662 - 35237824718992320204349492467850013805u128 * 2, 62465, 4069179869508152711227405075145957342268191129422751515316413854428985697968190682821997649146293743131581293119946427609890753151066109801720999353418883), eGKE[0u32][0u32..][..2u32][0u32]).2 >= 830715864 * 0 * 0u32 - 0u32 + (false? 1432888226 : 878164863u32) && aleo1f6y674hy8hqmzyk4fpwh0k4ftmh87aeqmdepp8d7mpsx8qmlxg8qetx9ch == U5YY || [861534212] != [kDEUr(((aleo122x2vcp2wx4hmzaa20l05tdczx5f2lzkfjwprd5v7j6p37cezq8qywr6hm, 1259883616915239703117645974018378541934807819884841255104732964781216350849549077253305202652484258263637381863439462808981263385937792580382458607366588, [(57, 52212u16); 1]), 135403533360244029398138511608494947816 * 1 / 49614810379508161127983409048041043135 + 10u128 * (true? 15081697512629196355910705568558178274 : 24103367896811228082909608839761037922u128) + 38265341771786524718198635716867211804, yFrO, WJFU1.3), eGKE[0][1..][0]).2; 1] {
|
||||
eGKE[0][0u32] = false;
|
||||
eGKE[..1u32][0u32] = [false, eGKE[0][2638085348 - kDEUr(((U5YY, WJFU1.3, [(104i8, 38695u16)]), 45449989719842721759392643706511860045u128, yFrO, WJFU1.3), false).2 - 3875654274u32 / 575679938u32 ** 0u32 * 0u32 - 2203422994]];
|
||||
eGKE[0][1] = (10028293976899540510u64, 63864u16, [false; (3, 3)]).2[1][0u32..][1u32];
|
||||
let lZ0a: u16 = yFrO;
|
||||
let TxK3a: i32 = -1346274927i32;
|
||||
if 97961373739574987193198311452118127234i128 <= 88149576313370097628825768959778517416 || wuEu == 140907141284439736247636185407353477261i128 {
|
||||
let Xlbx: i8 = eGKE[0u32][1989383460u32 ** 1u32 + 368828696u32 + 178704341u32 + 711311306u32 - 3248227803u32..][1u32]? -39 : 19i8;
|
||||
const tG_o: [[u64; 3]; 2] = [8351631060358886228u64; (2, 3)];
|
||||
const pofE = 34608u16;
|
||||
eGKE[0][0u32..][0u32] = eGKE[0][0u32..896155508u32 + 2123742783u32 / 82464430 - 896155531][3599492765 + 469168208 + 1510002368u32 / kDEUr(((U5YY, 2490679513469546434529351683782591947174770828265084971041727633159185080151531469641950514197128009829000203315755718140996406599875799694693523808457143field, [(-98i8, 37092u16)]), 188547537262576526670523000470002996434, 36693u16, WJFU1.1), eGKE[0u32][1u32]).2 - 4068660976u32];
|
||||
const mvUJr: [u128; (2, 3)] = [[192135102743266045779694578941481188480u128, 250316349057433474146799608574805237644u128, 232012296241327518720945688036673048736u128], [140153643843594627170578302698357494486u128; 3]];
|
||||
const Mxoc9: char = '!';
|
||||
let Id7g = (44923u16, '\u{7}', ['{'; 2], -26120i16);
|
||||
if (OeE4B, 1374) == (120u8, 6487u16) || eGKE[eGKE[3587636127u32 / 1734717873u32 * kDEUr(((aleo1559jt2h8tqaqjjg8376nl8jgwc9cnr3rjvdac78s6uhfkfgdy58q8rvy34, 4893039754597810991298101006579207465658269559265607181406483387920310275546431026893580245633409806089162204882902581239961472845825571507775938543642478field, [(Xlbx, pofE); 1]), mvUJr[1][1u32..true? 1093450336 * 2u32 * 0 * 0u32 - 0u32 + 3u32 : 3u32][0], Id7g.0, WJFU1.1), eGKE[1421989724 + 2282765521 + 1 ** kDEUr(((aleo1w9ea5jhqfvlkf63dfepcvgvlhu8jymyna7t0xx6xzse8n9czgurqu32kad, 12553051198281264968411827973380821180152422734228413690022186641595490316661398472030208591140127071025109535839461656919590189834665276233238839668056456, [(-6i8, 27335)]), 169542850521684343130284369641384038448, 44392, 3727181691205833796346995232789395995452385289630482711223012484507052098570222170942893024610259723295955017055379300068326693405492410815606192348210162), true).2 * 1640793295u32 * 0 - 3704755245][0..2][1u32]).2 - 869324706u32][0..2u32][0]? 0u32 : 0u32][0u32..][1u32] != eGKE[0u32][..2][0] {
|
||||
let wWeZ3: i8 = -93;
|
||||
let epWx4 = kDEUr(((aleo1guhrk23u5qwjnz8e8cmp6aj9ecs9kxvxfh00qdw9x6e44wzumqgqvnlgmq, 10850347706529691777383717267011097059081564264327863153034046577664766768121774050313599314193730778947782829388854050400394295607533685465139069269751942, [(-62, 44990); 1]), 137377424026935693438565684896161687398u128, 8800u16, 3565615291890963597709054041735431255229923978841874140464190589208258967469909660677502450044900127682733477177316102377810434350705282439917460198185775), false).3;
|
||||
const us0a = false;
|
||||
const Achr: bool = us0a;
|
||||
const f9rd: i64 = D7Xx;
|
||||
const xiaW: i64 = WJFU1.2;
|
||||
if Xlbx == Xlbx && epWx4 != epWx4 {
|
||||
const Jrg4 = [aleo1vv9rhr2t05pdl2sfqxjg6xclky9c66pv9y92k4dzcpz5zu97m5qsccmu6c; 4];
|
||||
const Tfxe: char = '\x38';
|
||||
let PNP2F: i8 = Xlbx;
|
||||
let QJq3: i16 = Id7g.3;
|
||||
eGKE[0u32][0..][1] = us0a;
|
||||
eGKE[0][0u32..][1u32] = Achr;
|
||||
Id7g.2[0u32..1][0u32] = Id7g.2[0u32..2u32][1u32];
|
||||
const ybJxx: i32 = -1337727605i32;
|
||||
const DyNk: u128 = mvUJr[0u32][..730328362u32 + (0u32 ** 984982457u32 ** 1u32) - 3552469159u32 / 3288198542u32 - 730328359u32][1u32];
|
||||
} else if -3627647846447564088 >= WJFU1.2 || [[false; 4]] != [false; (1, 4)] && U5YY == U5YY {
|
||||
Xlbx += Xlbx;
|
||||
let rYoi: (i16, field, i8, u16) = (15304i16, 3625259188763400242879491794840836446305612663997255866451867848521152710113680228748341130832324989157228483488461502392395711170008392647825262579121170field, 73i8, 4687u16);
|
||||
let IaPsZ: u128 = mvUJr[4087366772u32 / 1121309916u32 ** 0u32 * 0u32 * 0u32 + 1u32][..1u32][0u32 ** kDEUr(((aleo1u59h09jcvx5zun6q97h34dhw96pe6e092caht7dm8xn6z3ypagrsp3rtud, 4572346816259149108743961473575372827369895305947975888914970127393094943768582719247196172453386943091243064784373101008901733439865373142568607156802019field, [(113, 60999u16); 1]), mvUJr[1][0..us0a? 2u32 : 2u32][0], yFrO, rYoi.1), eGKE[0][0u32]).2 - 3173809056u32 ** 0u32 * 0u32 ** kDEUr(((aleo1nsmvxzakh57tdg7x9uyexk90es5a03zd7dprynn8ywgj9ku8zsxs76c2xy, 13231270929795927303772027390821043840951668465103819710789039173773877854378660101481042606411970378869697545937991133234264609078057024095623687897522873field, [(-113, 26548u16)]), 187537437138539430164480165812094435266, 14634, WJFU1.3), eGKE[0u32][0..][0]).2];
|
||||
eGKE[0..1u32] = eGKE[..1u32];
|
||||
eGKE[0u32] = eGKE[0][..2];
|
||||
Id7g.0 += rYoi.3;
|
||||
const IO7T: i32 = -1775026454i32;
|
||||
const nInEx = false? OeE4B : OeE4B;
|
||||
Id7g.2[..2] = Id7g.2[..2u32];
|
||||
} else {
|
||||
eGKE[0u32][0..945890680 + (false? 975425886u32 : 3146089746) * 0 - 945890679u32] = eGKE[0u32][..1u32];
|
||||
Id7g.2[1..][0] = Id7g.2[2419375510u32 / 190259160u32 * 2047118047u32 ** 0u32 / (eGKE[0u32][0u32]? kDEUr(((aleo1r8j6hc48ehlwhkqrdumwd55alh3nrvx6nntxt5jstc6yhmm88gfqcsfkru, 154607879377828207039408865230382656642460575105035392923433776823685140532600490051892006678379951323378194927013475952015512998723056973980863745309892field, [(-116i8, 61504u16); 1]), 5904036629510321716572936841925707394u128, 2700u16, WJFU1.3), eGKE[0][..3321162822u32 * 0u32 / (2302801384 ** 0u32 * 3620175210) + 1u32][0]).2 : kDEUr(((aleo16uscssuaaxy2tt5c3lqyxx2afl8z7pus4v8ygfjux2wxm3c4c5xqwl77jk, 1983703272889905468311836805795055485164861238369026076348929176230261086685907618645648838270802265401728739210864892526398594546017419684284779373009088field, [(14i8, 28890); 1]), 124153545594470221385586778552050724536, 40890, 12151836699736089119504903080018693322145319182124805149232958935846145521476055396995487179113270824459142148947281187229889156575035077182723450145657888field), true).2 / 863700377 * 0 + kDEUr(((aleo1dw2lmvrzx4y3x8fffgn8hcr22g30nqrzgmv30fz7nkadlg2qfvgq3akljz, 29732478688380494703339886956751542152110817174982441900083078413148796023106524594518819116049126014992186605540919343965295614262205387916810526553744, [(18i8, 2843); 1]), mvUJr[0][..3][1u32], yFrO, WJFU1.3), eGKE[0u32][0]).2) - 0u32];
|
||||
eGKE[0u32][..2u32][1] = epWx4 != 582403777i32 || (Achr? f9rd : xiaW) > D7Xx && 123i8 < -35;
|
||||
}
|
||||
} else if (WJFU1.1 * WJFU1.1 + 4997196675491260686001972934572280655948598823503424920331071523371386872790 - WJFU1.3 - WJFU1.1, oSqd, tG_o[0u32][0..2u32][1], (118, -25912i16)) != (5689382486401851183244561252762534880901387299311469507557881598344946452378644684946541128384662553424523434570526106597122063636091236834612694116299023field, 688179155413492233i64, 3270723359228597020u64, (-128i8, 28672i16)) && WJFU1.1 != WJFU1.3 && -1045737702 > 1167872995i32 {
|
||||
let ezOw: TESjC = 176;
|
||||
Xlbx -= Xlbx;
|
||||
let zkzx = wuEu;
|
||||
const B6nF2 = -865346137i32 - -1506338518i32 - 1889286591i32 ** 1i32;
|
||||
ud9u {}.txH_();
|
||||
Id7g.2[1..2u32][0u32] = '#';
|
||||
Id7g.2[..1u32][..1][0u32] = Id7g.2[0u32..][0];
|
||||
Id7g.2[1..] = Id7g.2[..1u32];
|
||||
} else {
|
||||
let Ddgt: i64 = WJFU1.2;
|
||||
if wuEu > wuEu && 4950191121644525007 * 1 + WJFU1.2 / D7Xx + D7Xx / D7Xx > Ddgt && (3445709662445339124966039955851910804825394763370142824106604387483865997362734623038345126555362147677743770469355767645697752481754904401585905040649845field, 12760233673026295027169325044258802893205988142757535481584951002852675315682976473240833997243099468269850726585895476087054478306870052616041699264571589, (false, 2362554768193566915017550509045849086111347769924326264905379896693764679651344674477430023748331696530454272840838499562488956265850450263335219724879307field, 13, 238567901038010930208120788385310382705846250069475009354407688177082454479483307254797504692991707028073390522123272123983358360941385246857379307641155), 714903914) == (WJFU1.1, WJFU1.1, (eGKE[0u32][0u32..][1u32], 4993859481089268687173684676314618051582712413234438444938276593501161971006238398744898606637894395649165706956113041208809079590082468227312357865660736field, 1u8 + 232u8 ** 0u8 - 0u8, 5146126727091813424584693335683521116282876803042677903474218001976551388900344647364718712119059322786863710041208868953765066730245850518116415104245194field), 734730659i32) {
|
||||
let j4xdK: bool = eGKE[0u32][0u32..][0u32];
|
||||
} else {
|
||||
let rvHo: i8 = Xlbx;
|
||||
}
|
||||
let By0o9: u16 = Id7g.0;
|
||||
if mvUJr[1][1u32..3u32][3976141290u32 * 0u32 + 888605653u32 - 888605652u32] > mvUJr[1u32][0..][0] || By0o9 > By0o9 || Xlbx == Xlbx {
|
||||
const gQ0ft: address = U5YY;
|
||||
} else if wuEu == -160335800677657412752072363260265326402 || [[true, false], [true; 2]] != (eGKE[0u32][1]? [[false; 2], [false; 2]] : [false; (2, 2)]) || Id7g.3 >= 14928i16 {
|
||||
eGKE[0][..2u32] = [false, true];
|
||||
let pBr5 = 86236897525765601521958346370883266108i128;
|
||||
let K6YXq: TESjC = 139u8;
|
||||
const kA2Ks: u16 = pofE;
|
||||
yFrO *= 20u16;
|
||||
} else {
|
||||
let XfS0 = U5YY;
|
||||
eGKE[0u32][0u32..][0] = false;
|
||||
oSqd /= Ddgt;
|
||||
eGKE[0][2714664265 + 265918089 + 0u32 ** 4284932475u32 ** 1 - 2980582353..][417523846u32 ** 1 - 1149997708u32 * 1u32 / 3327611392 - 417523846] = true;
|
||||
let JziC: u16 = yFrO;
|
||||
const mCeT: i64 = -9200318551018854695i64;
|
||||
}
|
||||
Id7g.2[1..2][0u32..][0] = '\x7a';
|
||||
ud9u {}.txH_();
|
||||
Id7g.2 = Id7g.2[0u32..2u32];
|
||||
const miqRZ: field = WJFU1.1;
|
||||
Id7g.2[1..] = [Id7g.1];
|
||||
}
|
||||
let MzbK1 = mvUJr[0u32][1u32];
|
||||
} else if kDEUr(eGKE[0u32][4220456327u32 ** 0u32 + 920325500u32 - 775699652u32 - 144625849..1][0]? ((aleo1dtjlzdar745jwhvf5vhdeak3pdvarsr8jfx2t78hdl86x77ykqpqg2hks7, 10370644121642292595522409921374543364347459055821343939899800512248497191619899977622618403047143654246392905951500535716071354350642769414032597379940456field, [(124, 6169u16); 1]), 111931430081106712937097825451394535656u128, 48941u16, 10579470616455153490081489709169828901595762761679051557680779383918092539985392613485269936591554688538019497232448460996768405534418536976127377158654917field) : ((U5YY, 7275473031633978899663765071702200825091065017135552629728814753923979270436271907411600144211677939826486129786424145608822037266543066553809169109293374, [(-73, 37996u16); 1]), 334220435131399063682028438435658901662 - 35237824718992320204349492467850013805u128 * 2, 62465, 4069179869508152711227405075145957342268191129422751515316413854428985697968190682821997649146293743131581293119946427609890753151066109801720999353418883), eGKE[0u32][0u32..][..2u32][0u32]).2 >= 830715864 * 0 * 0u32 - 0u32 + (false? 1432888226 : 878164863u32) && aleo1f6y674hy8hqmzyk4fpwh0k4ftmh87aeqmdepp8d7mpsx8qmlxg8qetx9ch == U5YY || [861534212] != [kDEUr(((aleo122x2vcp2wx4hmzaa20l05tdczx5f2lzkfjwprd5v7j6p37cezq8qywr6hm, 1259883616915239703117645974018378541934807819884841255104732964781216350849549077253305202652484258263637381863439462808981263385937792580382458607366588, [(57, 52212u16); 1]), 135403533360244029398138511608494947816 * 1 / 49614810379508161127983409048041043135 + 10u128 * (true? 15081697512629196355910705568558178274 : 24103367896811228082909608839761037922u128) + 38265341771786524718198635716867211804, yFrO, WJFU1.3), eGKE[0][1..][0]).2; 1] {
|
||||
eGKE[0][0u32] = false;
|
||||
eGKE[..1u32][0u32] = [false, eGKE[0][2638085348 - kDEUr(((U5YY, WJFU1.3, [(104i8, 38695u16)]), 45449989719842721759392643706511860045u128, yFrO, WJFU1.3), false).2 - 3875654274u32 / 575679938u32 ** 0u32 * 0u32 - 2203422994]];
|
||||
eGKE[0][1] = (10028293976899540510u64, 63864u16, [false; (3, 3)]).2[1][0u32..][1u32];
|
||||
let lZ0a: u16 = yFrO;
|
||||
let TxK3a: i32 = -1346274927i32;
|
||||
}
|
||||
eGKE[0u32][0..3020829405u32 / 2816243188u32 ** 1u32 * 688944866 - 688944864] = [false, false];
|
||||
let Bsws: i64 = 1953871591801733083i64;
|
||||
} else {
|
||||
let lmZNX: i64 = 2169515082030718947;
|
||||
let Qudw: address = U5YY;
|
||||
eGKE[0u32][0..2u32] = eGKE[..1u32][..1][319641018u32 / kDEUr(((aleo1e8vpjm2j6jm8q5msdz4lc0rfrmtkm3vhrpjcgpfsgcrc9907pygsz4htjt, 10906489555755384996160253267530748839587906592661473642143908920262899070262611087944298991260771730528727100761548853063124541410810053582752622065153317, [(-52, 63279); 1]), 14708957858605865911442517788844336623, 15329, 11493993658091838526906957036054647156831193054796422378866703169572166986935069159121719284018670105571796350570592933752742764863914905511942988023255439field), eGKE[0][1..][0]).2 ** 1 + 2127061393u32 * 0 + 3437810752u32 - 3437810752];
|
||||
let nzbS = wuEu;
|
||||
}
|
||||
eGKE[0u32][0..3020829405u32 / 2816243188u32 ** 1u32 * 688944866 - 688944864] = [false, false];
|
||||
let Bsws: i64 = 1953871591801733083i64;
|
||||
} else {
|
||||
let lmZNX: i64 = 2169515082030718947;
|
||||
let Qudw: address = U5YY;
|
||||
eGKE[0u32][0..2u32] = eGKE[..1u32][..1][319641018u32 / kDEUr(((aleo1e8vpjm2j6jm8q5msdz4lc0rfrmtkm3vhrpjcgpfsgcrc9907pygsz4htjt, 10906489555755384996160253267530748839587906592661473642143908920262899070262611087944298991260771730528727100761548853063124541410810053582752622065153317, [(-52, 63279); 1]), 14708957858605865911442517788844336623, 15329, 11493993658091838526906957036054647156831193054796422378866703169572166986935069159121719284018670105571796350570592933752742764863914905511942988023255439field), eGKE[0][1..][0]).2 ** 1 + 2127061393u32 * 0 + 3437810752u32 - 3437810752];
|
||||
let nzbS = wuEu;
|
||||
}
|
||||
const NNes: XgJbM = WJFU1.0;
|
||||
return eGKE[0u32][1u32..2u32][0u32];
|
||||
}
|
||||
const NNes: XgJbM = WJFU1.0;
|
||||
return eGKE[0u32][1u32..2u32][0u32];
|
||||
}}
|
||||
|
@ -3,313 +3,315 @@ namespace: Bench
|
||||
expectation: Skip
|
||||
*/
|
||||
|
||||
type NmYjQ = i32;
|
||||
|
||||
const K_baB = [85i8; 3];
|
||||
|
||||
|
||||
const Piti: bool = false? true : false;
|
||||
|
||||
|
||||
const GC5na: ([u32; 4], [[address; 3]; 3], u32) = ([3448216382; 4], [aleo1lfftk849g5y62cpw2u2dlad8dq9am85c2pej0lfcq5va88weecyqpv8yqq; (3, 3)], 208128685u32);
|
||||
|
||||
|
||||
const lB6c: u128 = 162298174429733905534736049855024103711u128;
|
||||
|
||||
|
||||
const AXWu: i32 = -1572240138;
|
||||
|
||||
|
||||
function main () -> (
|
||||
char,
|
||||
i16,
|
||||
char,
|
||||
(bool, i8, i64, i8),
|
||||
NmYjQ
|
||||
) {
|
||||
const R9rQ: u16 = 51243u16;
|
||||
const vOwHC: u16 = R9rQ;
|
||||
let IA55 = 10924234741147826596u64;
|
||||
IA55 = IA55;
|
||||
const qBqw: u128 = lB6c;
|
||||
const Obu3: u128 = lB6c;
|
||||
IA55 = IA55;
|
||||
IA55 += 6445515318607477828u64;
|
||||
const woTZ = (-277680533i32, 5632111985474328273292436822461150888i128);
|
||||
return ('\x6a', -32246, '\x0f', (false, -78, 134482078048524008i64, 54), woTZ.0);
|
||||
}
|
||||
|
||||
circuit XzVq {
|
||||
amVgA: [i64; 2],
|
||||
|
||||
function m0NjV (self) {
|
||||
let ns7a: char = 'L';
|
||||
let fk8H: u8 = 249u8;
|
||||
ns7a = ns7a;
|
||||
let crneu: char = '5';
|
||||
let MVol: bool = Piti;
|
||||
program test.aleo {
|
||||
type NmYjQ = i32;
|
||||
|
||||
const K_baB = [85i8; 3];
|
||||
|
||||
|
||||
const Piti: bool = false? true : false;
|
||||
|
||||
|
||||
const GC5na: ([u32; 4], [[address; 3]; 3], u32) = ([3448216382; 4], [aleo1lfftk849g5y62cpw2u2dlad8dq9am85c2pej0lfcq5va88weecyqpv8yqq; (3, 3)], 208128685u32);
|
||||
|
||||
|
||||
const lB6c: u128 = 162298174429733905534736049855024103711u128;
|
||||
|
||||
|
||||
const AXWu: i32 = -1572240138;
|
||||
|
||||
|
||||
function main () -> (
|
||||
char,
|
||||
i16,
|
||||
char,
|
||||
(bool, i8, i64, i8),
|
||||
NmYjQ
|
||||
) {
|
||||
const R9rQ: u16 = 51243u16;
|
||||
const vOwHC: u16 = R9rQ;
|
||||
let IA55 = 10924234741147826596u64;
|
||||
IA55 = IA55;
|
||||
const qBqw: u128 = lB6c;
|
||||
const Obu3: u128 = lB6c;
|
||||
IA55 = IA55;
|
||||
IA55 += 6445515318607477828u64;
|
||||
const woTZ = (-277680533i32, 5632111985474328273292436822461150888i128);
|
||||
return ('\x6a', -32246, '\x0f', (false, -78, 134482078048524008i64, 54), woTZ.0);
|
||||
}
|
||||
|
||||
struct XzVq {
|
||||
amVgA: [i64; 2],
|
||||
|
||||
function m0NjV (self) {
|
||||
let ns7a: char = 'L';
|
||||
let fk8H: u8 = 249u8;
|
||||
ns7a = ns7a;
|
||||
let crneu: char = '5';
|
||||
let MVol: bool = Piti;
|
||||
//RETURN
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function yJ9T (
|
||||
const LZhKs: address,
|
||||
const lHpLu: i8
|
||||
) {
|
||||
XzVq {amVgA: [2367901415351931474; 2]}.m0NjV();
|
||||
let ADccF = M6Cza {};
|
||||
let un49O: u16 = 37669u16;
|
||||
let uCXu: bool = Piti;
|
||||
let ey4HW: u64 = 3300386990536871051u64;
|
||||
let sHctQ: u32 = GC5na.0[0u32..3u32][2u32];
|
||||
sHctQ += GC5na.2;
|
||||
//RETURN
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function yJ9T (
|
||||
const LZhKs: address,
|
||||
const lHpLu: i8
|
||||
) {
|
||||
XzVq {amVgA: [2367901415351931474; 2]}.m0NjV();
|
||||
let ADccF = M6Cza {};
|
||||
let un49O: u16 = 37669u16;
|
||||
let uCXu: bool = Piti;
|
||||
let ey4HW: u64 = 3300386990536871051u64;
|
||||
let sHctQ: u32 = GC5na.0[0u32..3u32][2u32];
|
||||
sHctQ += GC5na.2;
|
||||
//RETURN
|
||||
}
|
||||
|
||||
circuit M6Cza {
|
||||
|
||||
function JYvIz (
|
||||
self,
|
||||
const dK1r: char,
|
||||
a05bL: bool
|
||||
) -> [i128; 3] {
|
||||
const Dbmn: u16 = 48758u16;
|
||||
let rNzi: u64 = 9786653144134249844u64;
|
||||
rNzi /= 16472830353492137635u64;
|
||||
rNzi /= 10130180327331766099u64;
|
||||
let jFUi = XzVq {amVgA: [-5915449544088967853i64 * -1i64 / 2362964183957924237i64, -3971487555647040975i64]};
|
||||
jFUi = jFUi;
|
||||
let PFCiY: field = 665449050833366163801950040274954303336695772749654704340515271878277165537536782102487505520376157097812176726897377986635097686633953549643734642663957field;
|
||||
let RjR1 = Dbmn;
|
||||
if [Dbmn; 3] == [27923, 44475u16, 50595] && false != a05bL {
|
||||
let ZsAa = dK1r;
|
||||
const B73fS: (i128, bool) = (-158089465950985221687422606333866663655i128, Piti);
|
||||
jFUi.m0NjV();
|
||||
let h2hwS: field = PFCiY;
|
||||
return [157852251306494179667475462121192004686i128; 3];
|
||||
} else if -63918006093606870481770261696050297213 < -56495550124737581022458288911787298947i128 || dK1r != dK1r || PFCiY == PFCiY {
|
||||
XzVq {amVgA: jFUi.amVgA[..197696103u32 + (GC5na.0[0..2u32][1] - GC5na.0[1u32] + GC5na.0[1..Piti? 3u32 : 3u32][1u32]) + 46417396u32 - 3692329879][0u32..]}.m0NjV();
|
||||
const nNfe = AXWu;
|
||||
return [92541869758983182973755356221231277316i128; 3];
|
||||
|
||||
struct M6Cza {
|
||||
|
||||
function JYvIz (
|
||||
self,
|
||||
const dK1r: char,
|
||||
a05bL: bool
|
||||
) -> [i128; 3] {
|
||||
const Dbmn: u16 = 48758u16;
|
||||
let rNzi: u64 = 9786653144134249844u64;
|
||||
rNzi /= 16472830353492137635u64;
|
||||
rNzi /= 10130180327331766099u64;
|
||||
let jFUi = XzVq {amVgA: [-5915449544088967853i64 * -1i64 / 2362964183957924237i64, -3971487555647040975i64]};
|
||||
jFUi = jFUi;
|
||||
let PFCiY: field = 665449050833366163801950040274954303336695772749654704340515271878277165537536782102487505520376157097812176726897377986635097686633953549643734642663957field;
|
||||
let RjR1 = Dbmn;
|
||||
if [Dbmn; 3] == [27923, 44475u16, 50595] && false != a05bL {
|
||||
let ZsAa = dK1r;
|
||||
const B73fS: (i128, bool) = (-158089465950985221687422606333866663655i128, Piti);
|
||||
jFUi.m0NjV();
|
||||
let h2hwS: field = PFCiY;
|
||||
return [157852251306494179667475462121192004686i128; 3];
|
||||
} else if -63918006093606870481770261696050297213 < -56495550124737581022458288911787298947i128 || dK1r != dK1r || PFCiY == PFCiY {
|
||||
XzVq {amVgA: jFUi.amVgA[..197696103u32 + (GC5na.0[0..2u32][1] - GC5na.0[1u32] + GC5na.0[1..Piti? 3u32 : 3u32][1u32]) + 46417396u32 - 3692329879][0u32..]}.m0NjV();
|
||||
const nNfe = AXWu;
|
||||
return [92541869758983182973755356221231277316i128; 3];
|
||||
} else {
|
||||
const F3wC = lB6c;
|
||||
const eRfOf: i64 = 6615865733488357448i64;
|
||||
PFCiY = 13210292667569411295876582680213285999734348468822303319353672409053939436084664250738747493105491382106522124003482872326125862769110639573504536945005026field;
|
||||
jFUi.amVgA[0..][GC5na.0[0u32..4u32][2] - GC5na.0[2] - 703626867 / GC5na.0[1..4u32][2] + 1] /= jFUi.amVgA[0u32];
|
||||
let X67R: u32 = 3806229975u32;
|
||||
return [-57715398463157412841011851386521399516i128, -38320140130521463705530560331425690648i128, 70285342755721462672599998236995271037i128];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Hv_R (
|
||||
const hdIB: i32,
|
||||
hGCWD: FjCxy,
|
||||
Ng2Y: XzVq
|
||||
) -> (
|
||||
i8,
|
||||
(i64, XzVq)
|
||||
) {
|
||||
const iRyz: i8 = K_baB[..1u32][0u32];
|
||||
let Z24jc: i8 = K_baB[0u32..3u32][0u32];
|
||||
Z24jc = K_baB[..2][GC5na.0[GC5na.0[..4][GC5na.0[2u32..4u32][0] / (GC5na.0[..2][0u32] - 0u32 ** GC5na.0[0u32..3u32][2]) ** 0u32 / GC5na.0[2..][930726283u32 / 2072894369 * 539781298u32 ** 0 * 0u32 + 1] ** 1 * GC5na.0[..2][0] - 3448216382u32] ** 0u32 ** GC5na.0[2..][1u32] + 2690999757u32 - 2690999757u32..3u32][GC5na.0[..4u32][0u32] * 0 / GC5na.0[1..][0u32] + 1] - 85333289u32 - 1250392080 + 1464596585u32 - 1454877115u32 - 2122210482u32];
|
||||
let I4y7: u8 = 1;
|
||||
let EiX0: (i16, i128, char) = (-16393i16, 157776413619505894407704989602317788511i128, 'K');
|
||||
const s_3QF = 7249575175756079635i64;
|
||||
Z24jc -= K_baB[(false? 2u32 : 2)..3][0];
|
||||
if 8451888259556015495830721527065764415025400166428207271661929189596630352926871853508994188932966884245189345045039601784362781772864676346859074246946163field == 11012775681384774712529333893121831410089026669120068975870674724655965209337389759466846852993569820558647449740077887191573324109514103515080957367667097field && 11537533470918506307708947880126150677173025345105109319452507266700925872711339094659951244000194733571650816143210040432369657103213714690849923401527240 == 13267155018508793225600470434279136160210683842295053847708184157465110711629711349737184665975669085065149008806453969639343232025453198205738841248015753field {
|
||||
let Tupk = 62263u16;
|
||||
const QL3ab = Piti? aleo15493t0zw0z2kxpkv0v6t5ufzy8955vlyep8qwatl7xcysr2msgzq6al67l : GC5na.1[1][0..2][0];
|
||||
I4y7 /= I4y7;
|
||||
} else if 10510193118362467927702685754181902755859312520259032066366242122057602891635261901588538552529178222392629034433796480747194732401519855447280039864447190field != 10323020605364273285682111767575543276647475815895233465743149981858876233545354422470080167582462356552069862579691769248295430704410880723942383909858847 || I4y7 < I4y7 && 59 > 181u8 {
|
||||
let I2qT = AXWu + -573512413i32 * -3i32;
|
||||
Z24jc **= 125i8;
|
||||
const tWZjx = [false; 1];
|
||||
} else {
|
||||
const F3wC = lB6c;
|
||||
const eRfOf: i64 = 6615865733488357448i64;
|
||||
PFCiY = 13210292667569411295876582680213285999734348468822303319353672409053939436084664250738747493105491382106522124003482872326125862769110639573504536945005026field;
|
||||
jFUi.amVgA[0..][GC5na.0[0u32..4u32][2] - GC5na.0[2] - 703626867 / GC5na.0[1..4u32][2] + 1] /= jFUi.amVgA[0u32];
|
||||
let X67R: u32 = 3806229975u32;
|
||||
return [-57715398463157412841011851386521399516i128, -38320140130521463705530560331425690648i128, 70285342755721462672599998236995271037i128];
|
||||
Z24jc /= K_baB[0..1][0];
|
||||
I4y7 *= 231u8;
|
||||
}
|
||||
EiX0.1 = EiX0.1;
|
||||
if 9673u16 >= 17571 || EiX0.2 == EiX0.2 || ((6605630297873056610026724284365997549292345399335935178800599738704530115800072964350790931488587647404602937455762336644170361236487728451889417256291489field, -3243570615589615825), 46788) == ((183373165870398460009473875903085947412650315657657244564477883647771846091964027549181661541602158070473387786985615260222601574919348807464992392922535field, -2224739339763290381i64), 26108u16) {
|
||||
let JVWQq: bool = Piti == Piti || 108i8 >= (4481063272727283166896005434320654337479487679034546284963307730775322010606686848325521560124312457672695271817161699386892416796626182551177144682977100field, 66i8).1 || 111i8 >= iRyz;
|
||||
EiX0.2 = '\r';
|
||||
const zKUb: u128 = 15886401916204892493948663420208300866;
|
||||
} else if I4y7 > I4y7 && GC5na.0[1] ** 1 * 0 * (1882593815u32 + GC5na.0[0u32..3u32][1u32] * 0u32 ** GC5na.0[0u32..][3] / 1u32 ** GC5na.0[0..4u32][3]) * 541123131 ** 1 >= 2557011466 || lB6c > lB6c {
|
||||
let Fliam: field = (6396378861739788768752167643123248196265510649978143323098231336185876021990 - 1562253746949333604976323116241847959188129176659344651191305155144323566893field - 1907590690079466125593988264803794530863623718776019788228600481978822285979field + 2826192401061709981552707701883329449637423679161878864741672467914281024731 - 7744155930567596367555138454895265470835379008487414199545455727428494397068 / 5887382286969298091463502399117813574976696749392276217880855580177392624329field) / 8138068432985050796709811429199400527728756964199209562353182355729034161610field - 4676363783900024209476989322077524423319736925630347387334837845138297847636 * (7716393770037956249493463814426875880088065621995766965952859225009720876060 + 4054464491818517944465041925004453961450750498666581601966133390075900630291 * 6470619646586328969212970545234385916067473967938270008214262410940824854748field * 5136019809719697126337585033338630155246336585752266299393598434820183635657 * 3199363828121504572471936072786041570218898172308476844390465125426120775261field / (2870735947046075509431120577200145564983224486153161281542380005676840924255 + (Piti? 7326514850008204114193923413140668023593712788820594320620854420992269671010403885619751867126434250975412004398786396991063063100809114630960658260759184 : 287691821947227194648690594322191785809355376991124495822673931314225986843982741156194617314207885085663542930841654298382265328931537999256280842784429field) + 4111224977412177408644345424935033581093673186776072518639702215411409276491field / 6396924971239159712318152437767102244199601932533137181403685339120257803760 / 2032052115950198440446636907339521858006331115389735204024877422557742018957 / (6439397127355927479815766604033208761884791896154148632511703534770967748614 + 6823611677553532338624085026977586921458547252011571045537956888166702594766 * 5498224734100066579769005985640226311034780030805045144507141850150142945239field * 5718520185124928482804734388192245075695544323566979546232491889023610798291field * 7542226518570052291643647771726838475087911398749371995409807077080488605891field)));
|
||||
} else {
|
||||
const CCYf: u8 = 69u8;
|
||||
const TUdx: ((i16, u32, char), i8, field) = ((-16229i16, 1376365916u32, '\u{951c4}'), 30i8, 12173002344181128654339279354796894183971985760710774565698927037560371981971617359621927577061674798615472633279532436485473795733167256616729998612175398field);
|
||||
if GC5na.1[1u32][0u32..3u32][GC5na.0[..2][0 ** GC5na.0[1..][2] / GC5na.0[1u32..][1] / 2450550577] - GC5na.0[0u32..1][0] / GC5na.0[3u32..4][TUdx.0.1 / GC5na.0[0u32..4][2u32] * GC5na.0[0u32..GC5na.0[0..][3] + GC5na.0[0] ** 0u32 / GC5na.0[0u32..3u32][2] / GC5na.0[..4][2] - 3448216378][0] * 0 * 0 - 0u32] / 2332650131u32 - 3448216380] != aleo14uq2mutwp4sp6g9kn3huklt7clmk4g0xeqq5akxvxnj4vu4c0sxqrv4379 || 28410 > 30824i16 && -113383771062135197880751679502769501310i128 > 7273624671757503050848051095764363087 {
|
||||
const HqWt2: u8 = CCYf;
|
||||
const QRcKx: (i64, u32, u64) = (-3673578757000504846i64, GC5na.0[0u32..3u32][0u32], 6872941707062733567u64);
|
||||
let VVFz = EiX0.1;
|
||||
I4y7 += CCYf;
|
||||
if -3207026076534034896i64 <= 3652263778919217051i64 || TUdx.0.0 < TUdx.0.0 {
|
||||
let QaPU: i8 = K_baB[..3u32][Piti? 1 : 1u32];
|
||||
let CyFXp: u8 = 0u8 ** I4y7 * HqWt2 * lXFx(TUdx.0.0).2;
|
||||
let qhXNF: XzVq = Ng2Y;
|
||||
EiX0.1 *= 0;
|
||||
const s0qB: u64 = 16748477482649535899u64;
|
||||
}
|
||||
} else if 6023u16 != 40984u16 || I4y7 > I4y7 {
|
||||
const LsidE = (XzVq {amVgA: [-6062086657179083330i64; 2]}, '𡐉', 163u8, 8183u16);
|
||||
} else {
|
||||
let Ibvtm: [char; 4] = ['\u{46988}'; 4];
|
||||
Ibvtm[0] = Ibvtm[1u32..][0u32];
|
||||
Ibvtm[3u32..] = Ibvtm[2u32..3u32];
|
||||
Ibvtm[1..4u32] = ['?'; 3];
|
||||
Ibvtm[..2] = ['\u{c42a7}'; 2];
|
||||
let F6EV: u64 = 17128117265803594802u64;
|
||||
let sbql = hGCWD;
|
||||
let lsjqA: (u128, address, address) = (4559977830801778029892755119050981913u128, aleo1wv8s4kv5cyseta3579ua2l375gdshj7y4lp5vnyj8sf3v2stdcgs37q0cm, aleo1r6flxcqqjpwsrhhu2xvlpcuajj3pzfy5kuunwm3st5vdp2qnmsxqstv5ps);
|
||||
}
|
||||
let DULm: u32 = 2812309314u32;
|
||||
let CldaL: u8 = 195u8;
|
||||
}
|
||||
let XUbZ = hdIB;
|
||||
EiX0 = EiX0;
|
||||
if 27066 > lXFx(12217).1 || 6927229215077945246u64 >= 7423605298906567602u64 * 0 * 0u64 - 0u64 {
|
||||
const sRO1: u64 = 8638881537800293187u64;
|
||||
let R8WQ3 = GC5na.1[1u32][0u32..3u32][(GC5na.0[2u32..][1u32] + 410433655u32 - GC5na.0[..4u32][0u32] / 2215520944u32) - GC5na.0[0u32..][GC5na.0[1u32..4u32][2u32] / GC5na.0[0u32..][0u32] ** 1u32 / 857889251u32 + 3u32] ** 1u32 / GC5na.0[3u32] / 1u32 ** GC5na.0[1u32..2u32][0u32] - 3858650035u32];
|
||||
Z24jc /= -37;
|
||||
return (K_baB[2u32..][0u32], (Ng2Y.amVgA[1u32..][3628841383u32 / 4123574656u32 + GC5na.0[0u32..4u32][3u32] - 3448216382u32], Ng2Y));
|
||||
} else {
|
||||
EiX0.0 **= 1;
|
||||
const x97BK: u32 = 345049321u32;
|
||||
let TJGWW: (i64, i64, u16, char) = (-2112081792003952471i64, 675970213075073906i64, 24532u16, 'Z');
|
||||
const Yoph: i16 = -27924i16;
|
||||
let MpPzW: u8 = I4y7;
|
||||
let zFL2 = Piti;
|
||||
Z24jc += K_baB[3409642267u32 / 4180980559 * 0u32];
|
||||
const jmXt = 1735784169u32;
|
||||
if EiX0.2 == '\u{f9517}' && 16167948181270667293u64 - (18319198699454340865 / 3088893505027334567u64 * 2160983166367418132u64 + 9515024868518284807 * 0 + 4204057007392572310) - 17972255788488367608 / 2868695264298187559u64 != 16210555867748384950 {
|
||||
const Og5B: u64 = Piti? 14082318920386055479u64 : 11881386050725131201u64;
|
||||
EiX0.1 *= 1;
|
||||
zFL2 = Piti;
|
||||
TJGWW = TJGWW;
|
||||
let dW09: i64 = Ng2Y.amVgA[0];
|
||||
TJGWW.0 /= -8341229632512320238;
|
||||
} else {
|
||||
const gHsV0: u64 = 15489463556002917073u64;
|
||||
Ng2Y.m0NjV();
|
||||
const Zy_s: u32 = GC5na.0[Piti? 3u32 : 3];
|
||||
let tC3lK: char = TJGWW.3;
|
||||
}
|
||||
return (37, (-2093390865580218817i64, XzVq {amVgA: [-8123038279259036857; 2]}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Hv_R (
|
||||
const hdIB: i32,
|
||||
hGCWD: FjCxy,
|
||||
Ng2Y: XzVq
|
||||
) -> (
|
||||
i8,
|
||||
(i64, XzVq)
|
||||
) {
|
||||
const iRyz: i8 = K_baB[..1u32][0u32];
|
||||
let Z24jc: i8 = K_baB[0u32..3u32][0u32];
|
||||
Z24jc = K_baB[..2][GC5na.0[GC5na.0[..4][GC5na.0[2u32..4u32][0] / (GC5na.0[..2][0u32] - 0u32 ** GC5na.0[0u32..3u32][2]) ** 0u32 / GC5na.0[2..][930726283u32 / 2072894369 * 539781298u32 ** 0 * 0u32 + 1] ** 1 * GC5na.0[..2][0] - 3448216382u32] ** 0u32 ** GC5na.0[2..][1u32] + 2690999757u32 - 2690999757u32..3u32][GC5na.0[..4u32][0u32] * 0 / GC5na.0[1..][0u32] + 1] - 85333289u32 - 1250392080 + 1464596585u32 - 1454877115u32 - 2122210482u32];
|
||||
let I4y7: u8 = 1;
|
||||
let EiX0: (i16, i128, char) = (-16393i16, 157776413619505894407704989602317788511i128, 'K');
|
||||
const s_3QF = 7249575175756079635i64;
|
||||
Z24jc -= K_baB[(false? 2u32 : 2)..3][0];
|
||||
if 8451888259556015495830721527065764415025400166428207271661929189596630352926871853508994188932966884245189345045039601784362781772864676346859074246946163field == 11012775681384774712529333893121831410089026669120068975870674724655965209337389759466846852993569820558647449740077887191573324109514103515080957367667097field && 11537533470918506307708947880126150677173025345105109319452507266700925872711339094659951244000194733571650816143210040432369657103213714690849923401527240 == 13267155018508793225600470434279136160210683842295053847708184157465110711629711349737184665975669085065149008806453969639343232025453198205738841248015753field {
|
||||
let Tupk = 62263u16;
|
||||
const QL3ab = Piti? aleo15493t0zw0z2kxpkv0v6t5ufzy8955vlyep8qwatl7xcysr2msgzq6al67l : GC5na.1[1][0..2][0];
|
||||
I4y7 /= I4y7;
|
||||
} else if 10510193118362467927702685754181902755859312520259032066366242122057602891635261901588538552529178222392629034433796480747194732401519855447280039864447190field != 10323020605364273285682111767575543276647475815895233465743149981858876233545354422470080167582462356552069862579691769248295430704410880723942383909858847 || I4y7 < I4y7 && 59 > 181u8 {
|
||||
let I2qT = AXWu + -573512413i32 * -3i32;
|
||||
Z24jc **= 125i8;
|
||||
const tWZjx = [false; 1];
|
||||
} else {
|
||||
Z24jc /= K_baB[0..1][0];
|
||||
I4y7 *= 231u8;
|
||||
}
|
||||
EiX0.1 = EiX0.1;
|
||||
if 9673u16 >= 17571 || EiX0.2 == EiX0.2 || ((6605630297873056610026724284365997549292345399335935178800599738704530115800072964350790931488587647404602937455762336644170361236487728451889417256291489field, -3243570615589615825), 46788) == ((183373165870398460009473875903085947412650315657657244564477883647771846091964027549181661541602158070473387786985615260222601574919348807464992392922535field, -2224739339763290381i64), 26108u16) {
|
||||
let JVWQq: bool = Piti == Piti || 108i8 >= (4481063272727283166896005434320654337479487679034546284963307730775322010606686848325521560124312457672695271817161699386892416796626182551177144682977100field, 66i8).1 || 111i8 >= iRyz;
|
||||
EiX0.2 = '\r';
|
||||
const zKUb: u128 = 15886401916204892493948663420208300866;
|
||||
} else if I4y7 > I4y7 && GC5na.0[1] ** 1 * 0 * (1882593815u32 + GC5na.0[0u32..3u32][1u32] * 0u32 ** GC5na.0[0u32..][3] / 1u32 ** GC5na.0[0..4u32][3]) * 541123131 ** 1 >= 2557011466 || lB6c > lB6c {
|
||||
let Fliam: field = (6396378861739788768752167643123248196265510649978143323098231336185876021990 - 1562253746949333604976323116241847959188129176659344651191305155144323566893field - 1907590690079466125593988264803794530863623718776019788228600481978822285979field + 2826192401061709981552707701883329449637423679161878864741672467914281024731 - 7744155930567596367555138454895265470835379008487414199545455727428494397068 / 5887382286969298091463502399117813574976696749392276217880855580177392624329field) / 8138068432985050796709811429199400527728756964199209562353182355729034161610field - 4676363783900024209476989322077524423319736925630347387334837845138297847636 * (7716393770037956249493463814426875880088065621995766965952859225009720876060 + 4054464491818517944465041925004453961450750498666581601966133390075900630291 * 6470619646586328969212970545234385916067473967938270008214262410940824854748field * 5136019809719697126337585033338630155246336585752266299393598434820183635657 * 3199363828121504572471936072786041570218898172308476844390465125426120775261field / (2870735947046075509431120577200145564983224486153161281542380005676840924255 + (Piti? 7326514850008204114193923413140668023593712788820594320620854420992269671010403885619751867126434250975412004398786396991063063100809114630960658260759184 : 287691821947227194648690594322191785809355376991124495822673931314225986843982741156194617314207885085663542930841654298382265328931537999256280842784429field) + 4111224977412177408644345424935033581093673186776072518639702215411409276491field / 6396924971239159712318152437767102244199601932533137181403685339120257803760 / 2032052115950198440446636907339521858006331115389735204024877422557742018957 / (6439397127355927479815766604033208761884791896154148632511703534770967748614 + 6823611677553532338624085026977586921458547252011571045537956888166702594766 * 5498224734100066579769005985640226311034780030805045144507141850150142945239field * 5718520185124928482804734388192245075695544323566979546232491889023610798291field * 7542226518570052291643647771726838475087911398749371995409807077080488605891field)));
|
||||
} else {
|
||||
const CCYf: u8 = 69u8;
|
||||
const TUdx: ((i16, u32, char), i8, field) = ((-16229i16, 1376365916u32, '\u{951c4}'), 30i8, 12173002344181128654339279354796894183971985760710774565698927037560371981971617359621927577061674798615472633279532436485473795733167256616729998612175398field);
|
||||
if GC5na.1[1u32][0u32..3u32][GC5na.0[..2][0 ** GC5na.0[1..][2] / GC5na.0[1u32..][1] / 2450550577] - GC5na.0[0u32..1][0] / GC5na.0[3u32..4][TUdx.0.1 / GC5na.0[0u32..4][2u32] * GC5na.0[0u32..GC5na.0[0..][3] + GC5na.0[0] ** 0u32 / GC5na.0[0u32..3u32][2] / GC5na.0[..4][2] - 3448216378][0] * 0 * 0 - 0u32] / 2332650131u32 - 3448216380] != aleo14uq2mutwp4sp6g9kn3huklt7clmk4g0xeqq5akxvxnj4vu4c0sxqrv4379 || 28410 > 30824i16 && -113383771062135197880751679502769501310i128 > 7273624671757503050848051095764363087 {
|
||||
const HqWt2: u8 = CCYf;
|
||||
const QRcKx: (i64, u32, u64) = (-3673578757000504846i64, GC5na.0[0u32..3u32][0u32], 6872941707062733567u64);
|
||||
let VVFz = EiX0.1;
|
||||
I4y7 += CCYf;
|
||||
if -3207026076534034896i64 <= 3652263778919217051i64 || TUdx.0.0 < TUdx.0.0 {
|
||||
let QaPU: i8 = K_baB[..3u32][Piti? 1 : 1u32];
|
||||
let CyFXp: u8 = 0u8 ** I4y7 * HqWt2 * lXFx(TUdx.0.0).2;
|
||||
let qhXNF: XzVq = Ng2Y;
|
||||
EiX0.1 *= 0;
|
||||
const s0qB: u64 = 16748477482649535899u64;
|
||||
}
|
||||
} else if 6023u16 != 40984u16 || I4y7 > I4y7 {
|
||||
const LsidE = (XzVq {amVgA: [-6062086657179083330i64; 2]}, '𡐉', 163u8, 8183u16);
|
||||
} else {
|
||||
let Ibvtm: [char; 4] = ['\u{46988}'; 4];
|
||||
Ibvtm[0] = Ibvtm[1u32..][0u32];
|
||||
Ibvtm[3u32..] = Ibvtm[2u32..3u32];
|
||||
Ibvtm[1..4u32] = ['?'; 3];
|
||||
Ibvtm[..2] = ['\u{c42a7}'; 2];
|
||||
let F6EV: u64 = 17128117265803594802u64;
|
||||
let sbql = hGCWD;
|
||||
let lsjqA: (u128, address, address) = (4559977830801778029892755119050981913u128, aleo1wv8s4kv5cyseta3579ua2l375gdshj7y4lp5vnyj8sf3v2stdcgs37q0cm, aleo1r6flxcqqjpwsrhhu2xvlpcuajj3pzfy5kuunwm3st5vdp2qnmsxqstv5ps);
|
||||
}
|
||||
let DULm: u32 = 2812309314u32;
|
||||
let CldaL: u8 = 195u8;
|
||||
}
|
||||
let XUbZ = hdIB;
|
||||
EiX0 = EiX0;
|
||||
if 27066 > lXFx(12217).1 || 6927229215077945246u64 >= 7423605298906567602u64 * 0 * 0u64 - 0u64 {
|
||||
const sRO1: u64 = 8638881537800293187u64;
|
||||
let R8WQ3 = GC5na.1[1u32][0u32..3u32][(GC5na.0[2u32..][1u32] + 410433655u32 - GC5na.0[..4u32][0u32] / 2215520944u32) - GC5na.0[0u32..][GC5na.0[1u32..4u32][2u32] / GC5na.0[0u32..][0u32] ** 1u32 / 857889251u32 + 3u32] ** 1u32 / GC5na.0[3u32] / 1u32 ** GC5na.0[1u32..2u32][0u32] - 3858650035u32];
|
||||
Z24jc /= -37;
|
||||
return (K_baB[2u32..][0u32], (Ng2Y.amVgA[1u32..][3628841383u32 / 4123574656u32 + GC5na.0[0u32..4u32][3u32] - 3448216382u32], Ng2Y));
|
||||
} else {
|
||||
EiX0.0 **= 1;
|
||||
const x97BK: u32 = 345049321u32;
|
||||
let TJGWW: (i64, i64, u16, char) = (-2112081792003952471i64, 675970213075073906i64, 24532u16, 'Z');
|
||||
const Yoph: i16 = -27924i16;
|
||||
let MpPzW: u8 = I4y7;
|
||||
let zFL2 = Piti;
|
||||
Z24jc += K_baB[3409642267u32 / 4180980559 * 0u32];
|
||||
const jmXt = 1735784169u32;
|
||||
if EiX0.2 == '\u{f9517}' && 16167948181270667293u64 - (18319198699454340865 / 3088893505027334567u64 * 2160983166367418132u64 + 9515024868518284807 * 0 + 4204057007392572310) - 17972255788488367608 / 2868695264298187559u64 != 16210555867748384950 {
|
||||
const Og5B: u64 = Piti? 14082318920386055479u64 : 11881386050725131201u64;
|
||||
EiX0.1 *= 1;
|
||||
zFL2 = Piti;
|
||||
TJGWW = TJGWW;
|
||||
let dW09: i64 = Ng2Y.amVgA[0];
|
||||
TJGWW.0 /= -8341229632512320238;
|
||||
} else {
|
||||
const gHsV0: u64 = 15489463556002917073u64;
|
||||
Ng2Y.m0NjV();
|
||||
const Zy_s: u32 = GC5na.0[Piti? 3u32 : 3];
|
||||
let tC3lK: char = TJGWW.3;
|
||||
}
|
||||
return (37, (-2093390865580218817i64, XzVq {amVgA: [-8123038279259036857; 2]}));
|
||||
}
|
||||
}
|
||||
|
||||
function lXFx (XK0T: i16) -> (
|
||||
char,
|
||||
i16,
|
||||
u8
|
||||
) {
|
||||
let GevsK: i8 = K_baB[0u32..GC5na.0[..4u32][0u32 * GC5na.0[..GC5na.0[1u32..][1u32] + GC5na.0[0u32..][1u32] / GC5na.0[0u32..2u32][0u32] - 3448216379u32][3u32] + (18065u16 < 21604u16 && GC5na.1[0u32][1u32..2u32][0u32] != GC5na.1[Piti? 1u32 : 1][(false? 1u32 : 1)..3u32][..2u32][0u32] || (GC5na.0[..4u32][1u32] >= GC5na.0[..4u32][0u32] && -1307689122451390649i64 == 2127488539316075275i64 || K_baB[1u32..][0u32] != -51i8) == true? GC5na.0[..(Piti? GC5na.0[..3][2] : GC5na.0[(true? 2 : 2)..][1u32]) / GC5na.0[1..3226391491 ** 3528347423u32 ** 0 + 145035181u32 - 3371426668u32][2u32] + 3920272396 - 3920272395][1] : 783239167u32) / 1455575933u32 ** 1u32 - 2u32] * 0u32 + 1877417993u32 - 1877417990u32][..1u32][0u32];
|
||||
GevsK **= 0i8;
|
||||
let GZ9Be: FjCxy = FjCxy {};
|
||||
GZ9Be = FjCxy {};
|
||||
let lB8N: u128 = lB6c;
|
||||
if lB8N > lB6c && '\u{14}' != '\x13' || 29836 >= (false? XK0T : XK0T) {
|
||||
let txzUG: u32 = GC5na.0[2u32];
|
||||
let A50Vs: u16 = 12542u16;
|
||||
if 5650008019146055916554586508371930930351435245054512787396927850192656022068field - 4933227739834069390849610110138103961767173270961316895740777281238360037115field + 70431822478396507075527188341288113728009976499101402504086455300768429371field == 1590870218966073091314252912732397618743063305358546847191387592337819796667 + 2872808458803440163284803150927406551373031395178872573747154805401730941206field * 7212868918825428953927155085253730102525790498605071358132902668412984131997 + 2995581854747478141140241750009120639327102627412190809155046253592740575026field * 1824777979924669359693556898537399710828257246578657532771346569613386056695 && GC5na.1[1u32][..2][0u32] == GC5na.1[GC5na.0[2..4][0u32] + 792376471u32 - (GC5na.0[1u32..Piti? Piti? 3u32 : 3 : 3u32][0..][1u32] / 112388018 / GC5na.0[1u32..3u32][0] / 116183050 ** 1u32) ** 2807171279u32 - 4240592852][0u32..1u32][0u32] && (-6618439962282640257, 31716) != (9001458957811067500i64, 714u16) {
|
||||
let u1jkn = XK0T;
|
||||
GZ9Be = GZ9Be;
|
||||
A50Vs /= A50Vs;
|
||||
const W5ty = Piti;
|
||||
GZ9Be = FjCxy {};
|
||||
if lB6c > 252185208672613692740092054599750472323u128 || 3800805862554725604i64 / 4093465489338565326 * -1 * 0 > -8735765288935445631i64 && [15905i16; 1] != [-20876] {
|
||||
if 503271405i32 < -1822815827i32 || 357941800873541969898682795565829563411233125965547729542360937017200033481812906459993968753506998632075420756324433909006918976184664261303953996341517 != 2985898859737055148243482254769697530770128832797044716399468557583383410819268117234438571517507247730744537292464564471428094238378600383332188425274075field {
|
||||
const D5Tqt: u8 = 224u8;
|
||||
const rKhFB: bool = W5ty;
|
||||
const D45X = lB6c;
|
||||
const vuTlx = -5634989829341940409i64;
|
||||
let l4pc: field = 3031214035321266989747422688264556869165193730115967779088357747657440424579131093595423265556350362939419741625853198769891529197590822464761357748535833field;
|
||||
}
|
||||
u1jkn += -9708;
|
||||
A50Vs = A50Vs;
|
||||
A50Vs *= A50Vs;
|
||||
let bcWi: address = GC5na.1[1u32][301086311u32 + GC5na.0[..4u32][3u32..][0u32] - GC5na.0[..0u32 ** GC5na.0[1u32..4u32][0u32] * GC5na.0[1u32..GC5na.0[1u32..4u32][0u32] / 3860763016u32 ** 0u32 - 3448216378u32][GC5na.0[0u32..][0u32] / GC5na.0[3u32] + 1275166309u32 ** 1u32 - 1275166310u32] * (GC5na.0[1u32..4u32][1u32] - GC5na.0[3u32..][true? 0u32 : 0u32 * GC5na.0[1u32] / GC5na.0[..2u32][1]] + 78568537u32 / 894338155u32) + 4u32][1u32..3u32][1u32] - 47545458u32 + 736110778u32 - 989651629u32..][0u32];
|
||||
}
|
||||
let illfz: bool = W5ty;
|
||||
A50Vs += A50Vs;
|
||||
} else if 157 <= 255u8 && GC5na.0[..3][2u32] > GC5na.0[2u32..3][0] {
|
||||
let QSFiW: bool = Piti;
|
||||
}
|
||||
A50Vs = 54465u16;
|
||||
for YvHu in GC5na.0[0..2][1u32]..3448216412 {
|
||||
let M2JW0: u32 = GC5na.0[0u32..][2u32];
|
||||
let ea5X: i32 = -1116691885i32;
|
||||
if GC5na.0[1u32] > 2436904091u32 || -36116492946513054660489981462153647973 > 145836909874245468519676552562733775458i128 && 131511527684725280380205228950986952270i128 / 96382253206826283697837771167639093749i128 + 119069848725345222899291714663526773719i128 / 86075031580567774256760522683169900464 != -154504546051089382197739749201383627028 {
|
||||
let ziyyO: u32 = 2445597197u32;
|
||||
|
||||
function lXFx (XK0T: i16) -> (
|
||||
char,
|
||||
i16,
|
||||
u8
|
||||
) {
|
||||
let GevsK: i8 = K_baB[0u32..GC5na.0[..4u32][0u32 * GC5na.0[..GC5na.0[1u32..][1u32] + GC5na.0[0u32..][1u32] / GC5na.0[0u32..2u32][0u32] - 3448216379u32][3u32] + (18065u16 < 21604u16 && GC5na.1[0u32][1u32..2u32][0u32] != GC5na.1[Piti? 1u32 : 1][(false? 1u32 : 1)..3u32][..2u32][0u32] || (GC5na.0[..4u32][1u32] >= GC5na.0[..4u32][0u32] && -1307689122451390649i64 == 2127488539316075275i64 || K_baB[1u32..][0u32] != -51i8) == true? GC5na.0[..(Piti? GC5na.0[..3][2] : GC5na.0[(true? 2 : 2)..][1u32]) / GC5na.0[1..3226391491 ** 3528347423u32 ** 0 + 145035181u32 - 3371426668u32][2u32] + 3920272396 - 3920272395][1] : 783239167u32) / 1455575933u32 ** 1u32 - 2u32] * 0u32 + 1877417993u32 - 1877417990u32][..1u32][0u32];
|
||||
GevsK **= 0i8;
|
||||
let GZ9Be: FjCxy = FjCxy {};
|
||||
GZ9Be = FjCxy {};
|
||||
let lB8N: u128 = lB6c;
|
||||
if lB8N > lB6c && '\u{14}' != '\x13' || 29836 >= (false? XK0T : XK0T) {
|
||||
let txzUG: u32 = GC5na.0[2u32];
|
||||
let A50Vs: u16 = 12542u16;
|
||||
if 5650008019146055916554586508371930930351435245054512787396927850192656022068field - 4933227739834069390849610110138103961767173270961316895740777281238360037115field + 70431822478396507075527188341288113728009976499101402504086455300768429371field == 1590870218966073091314252912732397618743063305358546847191387592337819796667 + 2872808458803440163284803150927406551373031395178872573747154805401730941206field * 7212868918825428953927155085253730102525790498605071358132902668412984131997 + 2995581854747478141140241750009120639327102627412190809155046253592740575026field * 1824777979924669359693556898537399710828257246578657532771346569613386056695 && GC5na.1[1u32][..2][0u32] == GC5na.1[GC5na.0[2..4][0u32] + 792376471u32 - (GC5na.0[1u32..Piti? Piti? 3u32 : 3 : 3u32][0..][1u32] / 112388018 / GC5na.0[1u32..3u32][0] / 116183050 ** 1u32) ** 2807171279u32 - 4240592852][0u32..1u32][0u32] && (-6618439962282640257, 31716) != (9001458957811067500i64, 714u16) {
|
||||
let u1jkn = XK0T;
|
||||
GZ9Be = GZ9Be;
|
||||
} else if A50Vs < 49919u16 || 11858539661841911680u64 != 8066479542160191036u64 || XK0T >= -11268 {
|
||||
let L2Mu2: [i8; 1] = K_baB[2u32..];
|
||||
A50Vs /= A50Vs;
|
||||
const W5ty = Piti;
|
||||
GZ9Be = FjCxy {};
|
||||
if lB6c > 252185208672613692740092054599750472323u128 || 3800805862554725604i64 / 4093465489338565326 * -1 * 0 > -8735765288935445631i64 && [15905i16; 1] != [-20876] {
|
||||
if 503271405i32 < -1822815827i32 || 357941800873541969898682795565829563411233125965547729542360937017200033481812906459993968753506998632075420756324433909006918976184664261303953996341517 != 2985898859737055148243482254769697530770128832797044716399468557583383410819268117234438571517507247730744537292464564471428094238378600383332188425274075field {
|
||||
const D5Tqt: u8 = 224u8;
|
||||
const rKhFB: bool = W5ty;
|
||||
const D45X = lB6c;
|
||||
const vuTlx = -5634989829341940409i64;
|
||||
let l4pc: field = 3031214035321266989747422688264556869165193730115967779088357747657440424579131093595423265556350362939419741625853198769891529197590822464761357748535833field;
|
||||
}
|
||||
u1jkn += -9708;
|
||||
A50Vs = A50Vs;
|
||||
A50Vs *= A50Vs;
|
||||
let bcWi: address = GC5na.1[1u32][301086311u32 + GC5na.0[..4u32][3u32..][0u32] - GC5na.0[..0u32 ** GC5na.0[1u32..4u32][0u32] * GC5na.0[1u32..GC5na.0[1u32..4u32][0u32] / 3860763016u32 ** 0u32 - 3448216378u32][GC5na.0[0u32..][0u32] / GC5na.0[3u32] + 1275166309u32 ** 1u32 - 1275166310u32] * (GC5na.0[1u32..4u32][1u32] - GC5na.0[3u32..][true? 0u32 : 0u32 * GC5na.0[1u32] / GC5na.0[..2u32][1]] + 78568537u32 / 894338155u32) + 4u32][1u32..3u32][1u32] - 47545458u32 + 736110778u32 - 989651629u32..][0u32];
|
||||
}
|
||||
let illfz: bool = W5ty;
|
||||
A50Vs += A50Vs;
|
||||
} else if 157 <= 255u8 && GC5na.0[..3][2u32] > GC5na.0[2u32..3][0] {
|
||||
let QSFiW: bool = Piti;
|
||||
}
|
||||
let xICSI = GC5na.1[0u32][..GC5na.0[2u32] + 808903237u32 / GC5na.0[0u32..][0u32] - 1u32 ** GC5na.0[GC5na.0[..4u32][3u32] / GC5na.0[0u32..][false? 0u32 : 0u32] ** 0u32 - 3448216381u32] * GC5na.0[..3u32][0u32] + 1u32][0u32];
|
||||
const tpvo2: i64 = 5729090369714237708;
|
||||
ea5X = ea5X;
|
||||
}
|
||||
txzUG **= 1u32;
|
||||
lB8N -= lB6c;
|
||||
}
|
||||
GZ9Be = GZ9Be;
|
||||
GevsK *= K_baB[4144431037u32 - GC5na.0[1..false? 4 : 4][0u32] - 240862610u32 - 455352043u32..GC5na.0[0u32] - 1625788343 * 0u32 - 3448216379u32][0u32];
|
||||
return ('g', -3069i16, 85u8);
|
||||
}
|
||||
|
||||
function nKDZF (
|
||||
GQvi: i8,
|
||||
const PA5e: i8
|
||||
) -> (
|
||||
u128,
|
||||
address
|
||||
) {
|
||||
const Ga8b = 66u8;
|
||||
const ZTrqz = (61714u16 + 1695u16 + 1705u16 + 1584u16 / 16493u16 / (35611u16 ** 0u16 + 58312u16), lB6c, (false, true, 8093244057719019961894348430889680190272144977514810266826054962064561285394847912582096010413630818468376067546881213613711423727537355713533485479686490field, 1859488065694876536u64), Ga8b);
|
||||
let J95N: u128 = lB6c;
|
||||
J95N *= 0u128;
|
||||
let acICD = Ga8b;
|
||||
J95N = ZTrqz.1;
|
||||
let DMNz = K_baB[0u32..(3437263896u32 + 835594347u32 - GC5na.0[1u32..4u32][1u32]) / 1261474132u32 / GC5na.0[..2u32][0u32] * GC5na.0[..3u32][0u32] + 3u32][2u32];
|
||||
let tXGsI = '\u{9d563}';
|
||||
DMNz -= K_baB[2..][646416367 - GC5na.0[3..4u32][0] / GC5na.0[0..4u32][2] + 3124847898 - GC5na.0[1..4][1u32] - 323047882u32];
|
||||
const jdMow: i8 = -122i8;
|
||||
let hgngX: (i64, i64, i32) = (-3338157062156526977i64, 1655542284862083064i64, -826307539i32);
|
||||
if -1853591717 < hgngX.2 || GC5na.0[0..3u32][0u32] >= GC5na.0[0u32..1u32][0] {
|
||||
DMNz = 86i8;
|
||||
const ca32: i64 = 7662664585440494512i64;
|
||||
hgngX = hgngX;
|
||||
hgngX.0 *= 2i64;
|
||||
let U9_l = ZTrqz.2.0;
|
||||
} else if -311606970 <= hgngX.2 && 1513381302355575806151475121676224619075997051620832438053416936851070376282365927807691500240864045705745854209431664169742023365721287514984843573289436field != ZTrqz.2.2 && ZTrqz.2.1 != ZTrqz.2.1 {
|
||||
J95N += J95N;
|
||||
}
|
||||
if tXGsI != '\u{47}' && GC5na.0[0u32..4][1..4u32][2] > GC5na.2 {
|
||||
J95N += 25026043934213379684868521121867068361u128;
|
||||
acICD /= acICD;
|
||||
let qapVn: u64 = ZTrqz.2.3;
|
||||
const sPx2: u32 = GC5na.0[0u32..4u32][GC5na.0[2u32..][0u32] * 0u32 + 3618742644u32 - 3618742641u32];
|
||||
hgngX.0 += hgngX.1;
|
||||
hgngX.0 /= hgngX.1;
|
||||
let dSHwS: field = ZTrqz.2.2;
|
||||
const hgo_i: FjCxy = FjCxy {};
|
||||
return (26612933517182050769569932657707698703u128, aleo1pt2e0h5r7jhm38deqgk398rwh8xqgw7jscw476g7ev3hap5r0vyqpz4578);
|
||||
} else {
|
||||
let hVi5i: i16 = -24207i16;
|
||||
let PdJc1 = hgngX.0;
|
||||
const iY7iv: u8 = Ga8b;
|
||||
const YXBXv: u16 = ZTrqz.0;
|
||||
const FWSp1 = -998948994i32;
|
||||
DMNz -= K_baB[0u32..3][1040336326u32 + 3790109365 / 751309844u32 + GC5na.0[0u32..4u32][0u32..4u32][0u32] * 0 - 1040336329u32];
|
||||
hgngX.2 /= ZTrqz.2.0? FWSp1 : FWSp1;
|
||||
const jLMcn: bool = false;
|
||||
let ITsX: bool = Piti;
|
||||
return (J95N, GC5na.1[GC5na.0[3..4u32][0] - GC5na.0[0u32..][2] / GC5na.0[319496605 + GC5na.0[GC5na.0[1..3][0u32] * 1u32 ** GC5na.0[1u32] / GC5na.0[..404575834u32 / 1271543374u32 + 4286953846 + 1181410u32 - 4288135252][1] - 1u32..4][3u32] + 0 ** GC5na.0[1202683606u32 / GC5na.0[0] / GC5na.0[0u32..3][2u32] * GC5na.0[1..][2u32] * 0 + 1] - 3767712987..2u32][0u32] - 3448216380u32][..1][0u32]);
|
||||
}
|
||||
}
|
||||
|
||||
circuit FjCxy {
|
||||
A50Vs = 54465u16;
|
||||
for YvHu in GC5na.0[0..2][1u32]..3448216412 {
|
||||
let M2JW0: u32 = GC5na.0[0u32..][2u32];
|
||||
let ea5X: i32 = -1116691885i32;
|
||||
if GC5na.0[1u32] > 2436904091u32 || -36116492946513054660489981462153647973 > 145836909874245468519676552562733775458i128 && 131511527684725280380205228950986952270i128 / 96382253206826283697837771167639093749i128 + 119069848725345222899291714663526773719i128 / 86075031580567774256760522683169900464 != -154504546051089382197739749201383627028 {
|
||||
let ziyyO: u32 = 2445597197u32;
|
||||
GZ9Be = GZ9Be;
|
||||
} else if A50Vs < 49919u16 || 11858539661841911680u64 != 8066479542160191036u64 || XK0T >= -11268 {
|
||||
let L2Mu2: [i8; 1] = K_baB[2u32..];
|
||||
}
|
||||
let xICSI = GC5na.1[0u32][..GC5na.0[2u32] + 808903237u32 / GC5na.0[0u32..][0u32] - 1u32 ** GC5na.0[GC5na.0[..4u32][3u32] / GC5na.0[0u32..][false? 0u32 : 0u32] ** 0u32 - 3448216381u32] * GC5na.0[..3u32][0u32] + 1u32][0u32];
|
||||
const tpvo2: i64 = 5729090369714237708;
|
||||
ea5X = ea5X;
|
||||
}
|
||||
txzUG **= 1u32;
|
||||
lB8N -= lB6c;
|
||||
}
|
||||
GZ9Be = GZ9Be;
|
||||
GevsK *= K_baB[4144431037u32 - GC5na.0[1..false? 4 : 4][0u32] - 240862610u32 - 455352043u32..GC5na.0[0u32] - 1625788343 * 0u32 - 3448216379u32][0u32];
|
||||
return ('g', -3069i16, 85u8);
|
||||
}
|
||||
|
||||
function nKDZF (
|
||||
GQvi: i8,
|
||||
const PA5e: i8
|
||||
) -> (
|
||||
u128,
|
||||
address
|
||||
) {
|
||||
const Ga8b = 66u8;
|
||||
const ZTrqz = (61714u16 + 1695u16 + 1705u16 + 1584u16 / 16493u16 / (35611u16 ** 0u16 + 58312u16), lB6c, (false, true, 8093244057719019961894348430889680190272144977514810266826054962064561285394847912582096010413630818468376067546881213613711423727537355713533485479686490field, 1859488065694876536u64), Ga8b);
|
||||
let J95N: u128 = lB6c;
|
||||
J95N *= 0u128;
|
||||
let acICD = Ga8b;
|
||||
J95N = ZTrqz.1;
|
||||
let DMNz = K_baB[0u32..(3437263896u32 + 835594347u32 - GC5na.0[1u32..4u32][1u32]) / 1261474132u32 / GC5na.0[..2u32][0u32] * GC5na.0[..3u32][0u32] + 3u32][2u32];
|
||||
let tXGsI = '\u{9d563}';
|
||||
DMNz -= K_baB[2..][646416367 - GC5na.0[3..4u32][0] / GC5na.0[0..4u32][2] + 3124847898 - GC5na.0[1..4][1u32] - 323047882u32];
|
||||
const jdMow: i8 = -122i8;
|
||||
let hgngX: (i64, i64, i32) = (-3338157062156526977i64, 1655542284862083064i64, -826307539i32);
|
||||
if -1853591717 < hgngX.2 || GC5na.0[0..3u32][0u32] >= GC5na.0[0u32..1u32][0] {
|
||||
DMNz = 86i8;
|
||||
const ca32: i64 = 7662664585440494512i64;
|
||||
hgngX = hgngX;
|
||||
hgngX.0 *= 2i64;
|
||||
let U9_l = ZTrqz.2.0;
|
||||
} else if -311606970 <= hgngX.2 && 1513381302355575806151475121676224619075997051620832438053416936851070376282365927807691500240864045705745854209431664169742023365721287514984843573289436field != ZTrqz.2.2 && ZTrqz.2.1 != ZTrqz.2.1 {
|
||||
J95N += J95N;
|
||||
}
|
||||
if tXGsI != '\u{47}' && GC5na.0[0u32..4][1..4u32][2] > GC5na.2 {
|
||||
J95N += 25026043934213379684868521121867068361u128;
|
||||
acICD /= acICD;
|
||||
let qapVn: u64 = ZTrqz.2.3;
|
||||
const sPx2: u32 = GC5na.0[0u32..4u32][GC5na.0[2u32..][0u32] * 0u32 + 3618742644u32 - 3618742641u32];
|
||||
hgngX.0 += hgngX.1;
|
||||
hgngX.0 /= hgngX.1;
|
||||
let dSHwS: field = ZTrqz.2.2;
|
||||
const hgo_i: FjCxy = FjCxy {};
|
||||
return (26612933517182050769569932657707698703u128, aleo1pt2e0h5r7jhm38deqgk398rwh8xqgw7jscw476g7ev3hap5r0vyqpz4578);
|
||||
} else {
|
||||
let hVi5i: i16 = -24207i16;
|
||||
let PdJc1 = hgngX.0;
|
||||
const iY7iv: u8 = Ga8b;
|
||||
const YXBXv: u16 = ZTrqz.0;
|
||||
const FWSp1 = -998948994i32;
|
||||
DMNz -= K_baB[0u32..3][1040336326u32 + 3790109365 / 751309844u32 + GC5na.0[0u32..4u32][0u32..4u32][0u32] * 0 - 1040336329u32];
|
||||
hgngX.2 /= ZTrqz.2.0? FWSp1 : FWSp1;
|
||||
const jLMcn: bool = false;
|
||||
let ITsX: bool = Piti;
|
||||
return (J95N, GC5na.1[GC5na.0[3..4u32][0] - GC5na.0[0u32..][2] / GC5na.0[319496605 + GC5na.0[GC5na.0[1..3][0u32] * 1u32 ** GC5na.0[1u32] / GC5na.0[..404575834u32 / 1271543374u32 + 4286953846 + 1181410u32 - 4288135252][1] - 1u32..4][3u32] + 0 ** GC5na.0[1202683606u32 / GC5na.0[0] / GC5na.0[0u32..3][2u32] * GC5na.0[1..][2u32] * 0 + 1] - 3767712987..2u32][0u32] - 3448216380u32][..1][0u32]);
|
||||
}
|
||||
}
|
||||
|
||||
struct FjCxy {
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user