From 2a94af6ff07252d9cf3bf821848cdedca7085c48 Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 24 Aug 2021 14:49:08 +0200 Subject: [PATCH 01/83] implement type aliasing --- .../examples/alias/basic_aliasing.zok | 13 + zokrates_cli/examples/alias/import_alias.zok | 14 + .../examples/alias/struct_aliasing.zok | 15 ++ zokrates_core/src/absy/from_ast.rs | 27 ++ zokrates_core/src/absy/mod.rs | 69 ++++- zokrates_core/src/absy/node.rs | 1 + zokrates_core/src/semantics.rs | 241 ++++++++++++++++-- zokrates_parser/src/zokrates.pest | 5 +- zokrates_pest_ast/src/lib.rs | 15 +- 9 files changed, 362 insertions(+), 38 deletions(-) create mode 100644 zokrates_cli/examples/alias/basic_aliasing.zok create mode 100644 zokrates_cli/examples/alias/import_alias.zok create mode 100644 zokrates_cli/examples/alias/struct_aliasing.zok diff --git a/zokrates_cli/examples/alias/basic_aliasing.zok b/zokrates_cli/examples/alias/basic_aliasing.zok new file mode 100644 index 000000000..c12362e5a --- /dev/null +++ b/zokrates_cli/examples/alias/basic_aliasing.zok @@ -0,0 +1,13 @@ +type byte = u8 +type uint32 = u32 +type UInt32Array = uint32[N] + +type matrix = field[R][C] + +def fill(field v) -> matrix: + return [[v; C]; R] + +def main(uint32 a, uint32 b) -> (UInt32Array<2>, matrix<2, 4>): + UInt32Array<2> res = [a, b] + matrix<2, 4> m = fill(1) + return res, m \ No newline at end of file diff --git a/zokrates_cli/examples/alias/import_alias.zok b/zokrates_cli/examples/alias/import_alias.zok new file mode 100644 index 000000000..6e7e54e49 --- /dev/null +++ b/zokrates_cli/examples/alias/import_alias.zok @@ -0,0 +1,14 @@ +from "./basic_aliasing.zok" import matrix +from "./struct_aliasing.zok" import Buzz + +const u32 R = 2 +const u32 C = 4 + +type matrix_2x4 = matrix + +def buzz() -> Buzz: + return Buzz { a: [0; N], b: [0; N] } + +def main(matrix_2x4 m) -> (Buzz<2>, matrix_2x4): + Buzz<2> b = buzz::<2>() + return b, m \ No newline at end of file diff --git a/zokrates_cli/examples/alias/struct_aliasing.zok b/zokrates_cli/examples/alias/struct_aliasing.zok new file mode 100644 index 000000000..932587b68 --- /dev/null +++ b/zokrates_cli/examples/alias/struct_aliasing.zok @@ -0,0 +1,15 @@ +type FieldArray = field[N] + +struct Foo { + FieldArray a + FieldArray b +} + +type Bar = Foo<2, 2> +type Buzz = Foo + +def main(Bar a) -> Buzz<2>: + Bar bar = Bar { a: [1, 2], b: [1, 2] } + Buzz<2> buzz = Buzz { a: [1, 2], b: [1, 2] } + assert(bar == buzz) + return buzz \ No newline at end of file diff --git a/zokrates_core/src/absy/from_ast.rs b/zokrates_core/src/absy/from_ast.rs index a968b9c29..48bdd35eb 100644 --- a/zokrates_core/src/absy/from_ast.rs +++ b/zokrates_core/src/absy/from_ast.rs @@ -1,5 +1,6 @@ use crate::absy; +use crate::absy::SymbolDefinition; use num_bigint::BigUint; use std::path::Path; use zokrates_pest_ast as pest; @@ -10,6 +11,7 @@ impl<'ast> From> for absy::Module<'ast> { pest::SymbolDeclaration::Import(i) => import_directive_to_symbol_vec(i), pest::SymbolDeclaration::Constant(c) => vec![c.into()], pest::SymbolDeclaration::Struct(s) => vec![s.into()], + pest::SymbolDeclaration::Type(t) => vec![t.into()], pest::SymbolDeclaration::Function(f) => vec![f.into()], })) } @@ -135,6 +137,31 @@ impl<'ast> From> for absy::SymbolDeclarationNode< } } +impl<'ast> From> for absy::SymbolDeclarationNode<'ast> { + fn from(definition: pest::TypeDefinition<'ast>) -> absy::SymbolDeclarationNode<'ast> { + use crate::absy::NodeValue; + + let span = definition.span; + let id = definition.id.span.as_str(); + + let ty = absy::TypeDefinition { + generics: definition + .generics + .into_iter() + .map(absy::ConstantGenericNode::from) + .collect(), + ty: definition.ty.into(), + } + .span(span.clone()); + + absy::SymbolDeclaration { + id, + symbol: absy::Symbol::Here(SymbolDefinition::Type(ty)), + } + .span(span) + } +} + impl<'ast> From> for absy::SymbolDeclarationNode<'ast> { fn from(function: pest::FunctionDefinition<'ast>) -> absy::SymbolDeclarationNode<'ast> { use crate::absy::NodeValue; diff --git a/zokrates_core/src/absy/mod.rs b/zokrates_core/src/absy/mod.rs index 70fc76d09..26fa114a2 100644 --- a/zokrates_core/src/absy/mod.rs +++ b/zokrates_core/src/absy/mod.rs @@ -133,6 +133,7 @@ pub enum SymbolDefinition<'ast> { Import(CanonicalImportNode<'ast>), Struct(StructDefinitionNode<'ast>), Constant(ConstantDefinitionNode<'ast>), + Type(TypeDefinitionNode<'ast>), Function(FunctionNode<'ast>), } @@ -153,12 +154,28 @@ impl<'ast> fmt::Display for SymbolDeclaration<'ast> { i.value.source.display(), i.value.id ), - SymbolDefinition::Struct(ref t) => write!(f, "struct {}{}", self.id, t), + SymbolDefinition::Struct(ref s) => write!(f, "struct {}{}", self.id, s), SymbolDefinition::Constant(ref c) => write!( f, "const {} {} = {}", c.value.ty, self.id, c.value.expression ), + SymbolDefinition::Type(ref t) => { + write!(f, "type {}", self.id)?; + if !t.value.generics.is_empty() { + write!( + f, + "<{}>", + t.value + .generics + .iter() + .map(|g| g.to_string()) + .collect::>() + .join(", ") + )?; + } + write!(f, " = {}", t.value.ty) + } SymbolDefinition::Function(ref func) => { write!(f, "def {}{}", self.id, func) } @@ -205,15 +222,18 @@ pub struct StructDefinition<'ast> { impl<'ast> fmt::Display for StructDefinition<'ast> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - writeln!( - f, - "<{}> {{", - self.generics - .iter() - .map(|g| g.to_string()) - .collect::>() - .join(", "), - )?; + if !self.generics.is_empty() { + write!( + f, + "<{}> ", + self.generics + .iter() + .map(|g| g.to_string()) + .collect::>() + .join(", ") + )?; + } + writeln!(f, "{{")?; for field in &self.fields { writeln!(f, " {}", field)?; } @@ -248,7 +268,34 @@ pub type ConstantDefinitionNode<'ast> = Node>; impl<'ast> fmt::Display for ConstantDefinition<'ast> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "const {}({})", self.ty, self.expression) + write!(f, "const {} _ = {}", self.ty, self.expression) + } +} + +/// A type definition +#[derive(Debug, Clone, PartialEq)] +pub struct TypeDefinition<'ast> { + pub generics: Vec>, + pub ty: UnresolvedTypeNode<'ast>, +} + +pub type TypeDefinitionNode<'ast> = Node>; + +impl<'ast> fmt::Display for TypeDefinition<'ast> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "type _")?; + if !self.generics.is_empty() { + write!( + f, + "<{}>", + self.generics + .iter() + .map(|g| g.to_string()) + .collect::>() + .join(", ") + )?; + } + write!(f, " = {}", self.ty) } } diff --git a/zokrates_core/src/absy/node.rs b/zokrates_core/src/absy/node.rs index 8a5745c0d..222966f1a 100644 --- a/zokrates_core/src/absy/node.rs +++ b/zokrates_core/src/absy/node.rs @@ -84,6 +84,7 @@ impl<'ast> NodeValue for UnresolvedType<'ast> {} impl<'ast> NodeValue for StructDefinition<'ast> {} impl<'ast> NodeValue for StructDefinitionField<'ast> {} impl<'ast> NodeValue for ConstantDefinition<'ast> {} +impl<'ast> NodeValue for TypeDefinition<'ast> {} impl<'ast> NodeValue for Function<'ast> {} impl<'ast> NodeValue for Module<'ast> {} impl<'ast> NodeValue for CanonicalImport<'ast> {} diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 937fbf174..0aeb6f020 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -55,7 +55,9 @@ impl ErrorInner { } } -type TypeMap<'ast> = HashMap>>; +type GenericDeclarations<'ast> = Option>>>; +type TypeMap<'ast> = + HashMap, GenericDeclarations<'ast>)>>; type ConstantMap<'ast> = HashMap, DeclarationType<'ast>>>; @@ -349,6 +351,85 @@ impl<'ast, T: Field> Checker<'ast, T> { }) } + fn check_type_definition( + &mut self, + ty: TypeDefinitionNode<'ast>, + module_id: &ModuleId, + state: &State<'ast, T>, + ) -> Result<(DeclarationType<'ast>, GenericDeclarations<'ast>), Vec> { + let pos = ty.pos(); + let ty = ty.value; + + let mut errors = vec![]; + + let mut generics = vec![]; + let mut generics_map = HashMap::new(); + + for (index, g) in ty.generics.iter().enumerate() { + if state + .constants + .get(module_id) + .and_then(|m| m.get(g.value)) + .is_some() + { + errors.push(ErrorInner { + pos: Some(g.pos()), + message: format!( + "Generic parameter {p} conflicts with constant symbol {p}", + p = g.value + ), + }); + } else { + match generics_map.insert(g.value, index).is_none() { + true => { + generics.push(Some(DeclarationConstant::Generic(GenericIdentifier { + name: g.value, + index, + }))); + } + false => { + errors.push(ErrorInner { + pos: Some(g.pos()), + message: format!("Generic parameter {} is already declared", g.value), + }); + } + } + } + } + + let mut used_generics = HashSet::new(); + + match self.check_declaration_type( + ty.ty, + module_id, + state, + &generics_map, + &mut used_generics, + ) { + Ok(ty) => { + // check that all declared generics were used + for declared_generic in generics_map.keys() { + if !used_generics.contains(declared_generic) { + errors.push(ErrorInner { + pos: Some(pos), + message: format!("Generic parameter {} must be used", declared_generic), + }); + } + } + + if !errors.is_empty() { + return Err(errors); + } + + Ok((ty, Some(generics))) + } + Err(e) => { + errors.push(e); + Err(errors) + } + } + } + fn check_constant_definition( &mut self, id: ConstantIdentifier<'ast>, @@ -541,7 +622,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .types .entry(module_id.to_path_buf()) .or_default() - .insert(declaration.id.to_string(), ty) + .insert(declaration.id.to_string(), (ty, None)) .is_none()); } }; @@ -593,6 +674,35 @@ impl<'ast, T: Field> Checker<'ast, T> { } } } + Symbol::Here(SymbolDefinition::Type(t)) => { + match self.check_type_definition(t, module_id, state) { + Ok(ty) => { + match symbol_unifier.insert_type(declaration.id) { + false => errors.push( + ErrorInner { + pos: Some(pos), + message: format!( + "{} conflicts with another symbol", + declaration.id, + ), + } + .in_file(module_id), + ), + true => { + assert!(state + .types + .entry(module_id.to_path_buf()) + .or_default() + .insert(declaration.id.to_string(), ty) + .is_none()); + } + }; + } + Err(e) => { + errors.extend(e.into_iter().map(|inner| inner.in_file(module_id))); + } + } + } Symbol::Here(SymbolDefinition::Function(f)) => { match self.check_function(f, module_id, state) { Ok(funct) => { @@ -673,7 +783,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .cloned(); match (function_candidates.len(), type_candidate, const_candidate) { - (0, Some(t), None) => { + (0, Some((t, alias_generics)), None) => { // rename the type to the declared symbol let t = match t { @@ -684,7 +794,7 @@ impl<'ast, T: Field> Checker<'ast, T> { }), ..t }), - _ => unreachable!() + _ => t // type alias }; // we imported a type, so the symbol it gets bound to should not already exist @@ -706,7 +816,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .types .entry(module_id.to_path_buf()) .or_default() - .insert(declaration.id.to_string(), t); + .insert(declaration.id.to_string(), (t, alias_generics)); } (0, None, Some(ty)) => { match symbol_unifier.insert_constant(declaration.id) { @@ -1187,23 +1297,22 @@ impl<'ast, T: Field> Checker<'ast, T> { ))) } UnresolvedType::User(id, generics) => { - let declaration_type = - types - .get(module_id) - .unwrap() - .get(&id) - .cloned() - .ok_or_else(|| ErrorInner { - pos: Some(pos), - message: format!("Undefined type {}", id), - })?; + let (declaration_type, alias_generics) = types + .get(module_id) + .unwrap() + .get(&id) + .cloned() + .ok_or_else(|| ErrorInner { + pos: Some(pos), + message: format!("Undefined type {}", id), + })?; // absence of generics is treated as 0 generics, as we do not provide inference for now let generics = generics.unwrap_or_default(); // check generics - match declaration_type { - DeclarationType::Struct(struct_type) => { + match (declaration_type, alias_generics) { + (DeclarationType::Struct(struct_type), None) => { match struct_type.generics.len() == generics.len() { true => { // downcast the generics to identifiers, as this is the only possibility here @@ -1263,7 +1372,58 @@ impl<'ast, T: Field> Checker<'ast, T> { }), } } - _ => unreachable!("user defined types should always be structs"), + (declaration_type, Some(alias_generics)) => { + match alias_generics.len() == generics.len() { + true => { + let generic_identifiers = + alias_generics.iter().map(|c| match c.as_ref().unwrap() { + DeclarationConstant::Generic(g) => g.clone(), + _ => unreachable!(), + }); + + // build the generic assignment for this type + let assignment = GGenericsAssignment(generics + .into_iter() + .zip(generic_identifiers) + .map(|(e, g)| match e { + Some(e) => { + self + .check_expression(e, module_id, types) + .and_then(|e| { + UExpression::try_from_typed(e, &UBitwidth::B32) + .map(|e| (g, e)) + .map_err(|e| ErrorInner { + pos: Some(pos), + message: format!("Expected u32 expression, but got expression of type {}", e.get_type()), + }) + }) + }, + None => Err(ErrorInner { + pos: Some(pos), + message: + "Expected u32 constant or identifier, but found `_`. Generic inference is not supported yet." + .into(), + }) + }) + .collect::>()?); + + // specialize the declared type using the generic assignment + Ok(specialize_declaration_type(declaration_type, &assignment) + .unwrap()) + } + false => Err(ErrorInner { + pos: Some(pos), + message: format!( + "Expected {} generic argument{} on type {}, but got {}", + alias_generics.len(), + if alias_generics.len() == 1 { "" } else { "s" }, + id, + generics.len() + ), + }), + } + } + _ => unreachable!(), } } } @@ -1358,7 +1518,7 @@ impl<'ast, T: Field> Checker<'ast, T> { ))) } UnresolvedType::User(id, generics) => { - let declared_ty = state + let (declared_ty, alias_generics) = state .types .get(module_id) .unwrap() @@ -1369,8 +1529,43 @@ impl<'ast, T: Field> Checker<'ast, T> { message: format!("Undefined type {}", id), })?; - match declared_ty { - DeclarationType::Struct(declared_struct_ty) => { + match (declared_ty, alias_generics) { + (ty, Some(alias_generics)) => { + let generics = generics.unwrap_or_default(); + let checked_generics: Vec<_> = generics + .into_iter() + .map(|e| match e { + Some(e) => self + .check_generic_expression( + e, + module_id, + state.constants.get(module_id).unwrap_or(&HashMap::new()), + generics_map, + used_generics, + ) + .map(Some), + None => Err(ErrorInner { + pos: Some(pos), + message: "Expected u32 constant or identifier, but found `_`" + .into(), + }), + }) + .collect::>()?; + + let mut assignment = GGenericsAssignment::default(); + + assignment.0.extend( + alias_generics.iter().zip(checked_generics.iter()).map( + |(decl_g, g_val)| match decl_g.clone().unwrap() { + DeclarationConstant::Generic(g) => (g, g_val.clone().unwrap()), + _ => unreachable!(), + }, + ), + ); + + Ok(specialize_declaration_type(ty, &assignment).unwrap()) + } + (DeclarationType::Struct(declared_struct_ty), None) => { let generics = generics.unwrap_or_default(); match declared_struct_ty.generics.len() == generics.len() { true => { @@ -1441,7 +1636,7 @@ impl<'ast, T: Field> Checker<'ast, T> { }), } } - _ => Ok(declared_ty), + (declared_ty, _) => Ok(declared_ty), } } } @@ -2910,7 +3105,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .into()) } Expression::InlineStruct(id, inline_members) => { - let ty = match types.get(module_id).unwrap().get(&id).cloned() { + let (ty, _) = match types.get(module_id).unwrap().get(&id).cloned() { None => Err(ErrorInner { pos: Some(pos), message: format!("Undefined type `{}`", id), diff --git a/zokrates_parser/src/zokrates.pest b/zokrates_parser/src/zokrates.pest index ce7499e70..c833a8447 100644 --- a/zokrates_parser/src/zokrates.pest +++ b/zokrates_parser/src/zokrates.pest @@ -4,7 +4,7 @@ file = { SOI ~ NEWLINE* ~ pragma? ~ NEWLINE* ~ symbol_declaration* ~ EOI } pragma = { "#pragma" ~ "curve" ~ curve } curve = @{ (ASCII_ALPHANUMERIC | "_") * } -symbol_declaration = { (import_directive | ty_struct_definition | const_definition | function_definition) ~ NEWLINE* } +symbol_declaration = { (import_directive | ty_struct_definition | const_definition | type_definition | function_definition) ~ NEWLINE* } import_directive = { main_import_directive | from_import_directive } from_import_directive = { "from" ~ "\"" ~ import_source ~ "\"" ~ "import" ~ import_symbol_list ~ NEWLINE* } @@ -14,6 +14,7 @@ import_symbol = { identifier ~ ("as" ~ identifier)? } import_symbol_list = _{ import_symbol ~ ("," ~ import_symbol)* } function_definition = {"def" ~ identifier ~ constant_generics_declaration? ~ "(" ~ parameter_list ~ ")" ~ return_types ~ ":" ~ NEWLINE* ~ statement* } const_definition = {"const" ~ ty ~ identifier ~ "=" ~ expression ~ NEWLINE*} +type_definition = {"type" ~ identifier ~ constant_generics_declaration? ~ "=" ~ ty ~ NEWLINE*} return_types = _{ ( "->" ~ ( "(" ~ type_list ~ ")" | ty ))? } constant_generics_declaration = _{ "<" ~ constant_generics_list ~ ">" } constant_generics_list = _{ identifier ~ ("," ~ identifier)* } @@ -163,6 +164,6 @@ COMMENT = _{ ("/*" ~ (!"*/" ~ ANY)* ~ "*/") | ("//" ~ (!NEWLINE ~ ANY)*) } // the ordering of reserved keywords matters: if "as" is before "assert", then "assert" gets parsed as (as)(sert) and incorrectly // accepted -keyword = @{"assert"|"as"|"bool"|"byte"|"const"|"def"|"do"|"else"|"endfor"|"export"|"false"|"field"|"for"|"if"|"then"|"fi"|"import"|"from"| +keyword = @{"assert"|"as"|"bool"|"const"|"def"|"do"|"else"|"endfor"|"export"|"false"|"field"|"for"|"if"|"then"|"fi"|"import"|"from"| "in"|"private"|"public"|"return"|"struct"|"true"|"u8"|"u16"|"u32"|"u64" } diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index 22b4d0d78..7f4d5490f 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -17,8 +17,8 @@ pub use ast::{ InlineStructExpression, InlineStructMember, IterationStatement, LiteralExpression, Parameter, PostfixExpression, Range, RangeOrExpression, ReturnStatement, Span, Spread, SpreadOrExpression, Statement, StructDefinition, StructField, SymbolDeclaration, TernaryExpression, ToExpression, - Type, TypedIdentifier, TypedIdentifierOrAssignee, UnaryExpression, UnaryOperator, Underscore, - Visibility, + Type, TypeDefinition, TypedIdentifier, TypedIdentifierOrAssignee, UnaryExpression, + UnaryOperator, Underscore, Visibility, }; mod ast { @@ -140,6 +140,7 @@ mod ast { Import(ImportDirective<'ast>), Constant(ConstantDefinition<'ast>), Struct(StructDefinition<'ast>), + Type(TypeDefinition<'ast>), Function(FunctionDefinition<'ast>), } @@ -184,6 +185,16 @@ mod ast { pub span: Span<'ast>, } + #[derive(Debug, FromPest, PartialEq, Clone)] + #[pest_ast(rule(Rule::type_definition))] + pub struct TypeDefinition<'ast> { + pub id: IdentifierExpression<'ast>, + pub generics: Vec>, + pub ty: Type<'ast>, + #[pest_ast(outer())] + pub span: Span<'ast>, + } + #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::import_directive))] pub enum ImportDirective<'ast> { From 5c5410915c018b88b7fd971c06591983c04e3fe7 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 25 Aug 2021 18:25:55 +0200 Subject: [PATCH 02/83] add changelog --- changelogs/unreleased/982-dark64 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/982-dark64 diff --git a/changelogs/unreleased/982-dark64 b/changelogs/unreleased/982-dark64 new file mode 100644 index 000000000..689198008 --- /dev/null +++ b/changelogs/unreleased/982-dark64 @@ -0,0 +1 @@ +Implement type aliasing \ No newline at end of file From 18b599696bf0e33082d1dbc8015edffa54837842 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 25 Aug 2021 18:29:14 +0200 Subject: [PATCH 03/83] fix test in semantic checker --- zokrates_core/src/semantics.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 0aeb6f020..2572dc655 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -5679,6 +5679,7 @@ mod tests { .get(&*MODULE_ID) .unwrap() .get(&"Bar".to_string()) + .map(|(ty, _)| ty) .unwrap(), &DeclarationType::Struct(DeclarationStructType::new( (*MODULE_ID).clone(), From 942901c55b96897078b28b38abde51755bfabfd6 Mon Sep 17 00:00:00 2001 From: dark64 Date: Sun, 12 Sep 2021 19:28:34 +0200 Subject: [PATCH 04/83] make field to uint casting more strict to match runtime behaviour --- .../src/static_analysis/propagation.rs | 107 ++++++++++-------- .../stdlib/utils/casts/field_to_u16.zok | 8 +- .../stdlib/utils/casts/field_to_u32.zok | 8 +- .../stdlib/utils/casts/field_to_u64.zok | 8 +- .../stdlib/utils/casts/field_to_u8.zok | 8 +- 5 files changed, 84 insertions(+), 55 deletions(-) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index 38c29a0cb..afd707450 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -22,6 +22,7 @@ type Constants<'ast, T> = HashMap, TypedExpression<'ast, T>>; pub enum Error { Type(String), AssertionFailed(String), + ValueTooLarge(String), OutOfBounds(u128, u128), NonConstantExponent(String), } @@ -31,6 +32,7 @@ impl fmt::Display for Error { match self { Error::Type(s) => write!(f, "{}", s), Error::AssertionFailed(s) => write!(f, "{}", s), + Error::ValueTooLarge(s) => write!(f, "{}", s), Error::OutOfBounds(index, size) => write!( f, "Out of bounds index ({} >= {}) found during static analysis", @@ -384,47 +386,47 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { match arguments.iter().all(|a| a.is_constant()) { true => { let r: Option> = match embed { - FlatEmbed::BitArrayLe => None, // todo - FlatEmbed::U64FromBits => Some(process_u_from_bits( + FlatEmbed::BitArrayLe => Ok(None), // todo + FlatEmbed::U64FromBits => Ok(Some(process_u_from_bits( assignees.clone(), arguments.clone(), UBitwidth::B64, - )), - FlatEmbed::U32FromBits => Some(process_u_from_bits( + ))), + FlatEmbed::U32FromBits => Ok(Some(process_u_from_bits( assignees.clone(), arguments.clone(), UBitwidth::B32, - )), - FlatEmbed::U16FromBits => Some(process_u_from_bits( + ))), + FlatEmbed::U16FromBits => Ok(Some(process_u_from_bits( assignees.clone(), arguments.clone(), UBitwidth::B16, - )), - FlatEmbed::U8FromBits => Some(process_u_from_bits( + ))), + FlatEmbed::U8FromBits => Ok(Some(process_u_from_bits( assignees.clone(), arguments.clone(), UBitwidth::B8, - )), - FlatEmbed::U64ToBits => Some(process_u_to_bits( + ))), + FlatEmbed::U64ToBits => Ok(Some(process_u_to_bits( assignees.clone(), arguments.clone(), UBitwidth::B64, - )), - FlatEmbed::U32ToBits => Some(process_u_to_bits( + ))), + FlatEmbed::U32ToBits => Ok(Some(process_u_to_bits( assignees.clone(), arguments.clone(), UBitwidth::B32, - )), - FlatEmbed::U16ToBits => Some(process_u_to_bits( + ))), + FlatEmbed::U16ToBits => Ok(Some(process_u_to_bits( assignees.clone(), arguments.clone(), UBitwidth::B16, - )), - FlatEmbed::U8ToBits => Some(process_u_to_bits( + ))), + FlatEmbed::U8ToBits => Ok(Some(process_u_to_bits( assignees.clone(), arguments.clone(), UBitwidth::B8, - )), + ))), FlatEmbed::Unpack => { assert_eq!(assignees.len(), 1); assert_eq!(arguments.len(), 1); @@ -432,46 +434,55 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { let bit_width = generics[0]; - match FieldElementExpression::try_from(arguments[0].clone()) - .unwrap() + match FieldElementExpression::::try_from( + arguments[0].clone(), + ) + .unwrap() { FieldElementExpression::Number(num) => { - let mut num = num; + let mut acc = num.clone(); let mut res = vec![]; for i in (0..bit_width as usize).rev() { - if T::from(2).pow(i) <= num { - num = num - T::from(2).pow(i); + if T::from(2).pow(i) <= acc { + acc = acc - T::from(2).pow(i); res.push(true); } else { res.push(false); } } - assert_eq!(num, T::zero()); - - Some( - ArrayExpressionInner::Value( - res.into_iter() - .map(|v| { - BooleanExpression::Value(v).into() - }) - .collect::>() - .into(), - ) - .annotate(Type::Boolean, bit_width) - .into(), - ) + + if acc != T::zero() { + Err(Error::ValueTooLarge(format!( + "Cannot unpack `{}` to `{}`: value is too large", + num, assignees.first().unwrap().get_type() + ))) + } else { + Ok(Some( + ArrayExpressionInner::Value( + res.into_iter() + .map(|v| { + BooleanExpression::Value(v) + .into() + }) + .collect::>() + .into(), + ) + .annotate(Type::Boolean, bit_width) + .into(), + )) + } } _ => unreachable!("should be a field value"), } } #[cfg(feature = "bellman")] - FlatEmbed::Sha256Round => None, + FlatEmbed::Sha256Round => Ok(None), #[cfg(feature = "ark")] - FlatEmbed::SnarkVerifyBls12377 => None, - }; + FlatEmbed::SnarkVerifyBls12377 => Ok(None), + }?; - match r { + Ok(match r { // if the function call returns a constant Some(expr) => { let mut assignees = assignees; @@ -497,9 +508,11 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { assignee, expr, ), ], - None => vec![TypedStatement::Definition( - assignee, expr, - )], + None => { + vec![TypedStatement::Definition( + assignee, expr, + )] + } }, } } @@ -537,7 +550,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { )], } } - } + }) } false => { // if the function arguments are not constant, invalidate the cache @@ -562,7 +575,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { } }); - invalidations.chain(std::iter::once(def)).collect() + Ok(invalidations.chain(std::iter::once(def)).collect()) } } } @@ -604,9 +617,9 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { } }); - invalidations.chain(std::iter::once(def)).collect() + Ok(invalidations.chain(std::iter::once(def)).collect()) } - }; + }?; Ok(statements) } diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok index 9f39cbc17..810208d64 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok @@ -1,5 +1,9 @@ from "EMBED" import unpack, u16_from_bits -def main(field i) -> u16: - bool[16] bits = unpack(i) +const field U16_MAX = 65535 + +// Condition: field value is asserted to be in range [0, U16_MAX] +def main(field input) -> u16: + assert(input <= U16_MAX) + bool[16] bits = unpack(input) return u16_from_bits(bits) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok index cf14aa90f..fc5c6a565 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok @@ -1,5 +1,9 @@ from "EMBED" import unpack, u32_from_bits -def main(field i) -> u32: - bool[32] bits = unpack(i) +const field U32_MAX = 4294967295 + +// Condition: field value is asserted to be in range [0, U32_MAX] +def main(field input) -> u32: + assert(input <= U32_MAX) + bool[32] bits = unpack(input) return u32_from_bits(bits) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok index 8433dd638..1b99ee74d 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok @@ -1,5 +1,9 @@ from "EMBED" import unpack, u64_from_bits -def main(field i) -> u64: - bool[64] bits = unpack(i) +const field U64_MAX = 18446744073709551615 + +// Condition: field value is asserted to be in range [0, U64_MAX] +def main(field input) -> u64: + assert(input <= U64_MAX) + bool[64] bits = unpack(input) return u64_from_bits(bits) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok index 3045e3020..bda7f6e24 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok @@ -1,5 +1,9 @@ from "EMBED" import unpack, u8_from_bits -def main(field i) -> u8: - bool[8] bits = unpack(i) +const field U8_MAX = 255 + +// Condition: field value is asserted to be in range [0, U8_MAX] +def main(field input) -> u8: + assert(input <= U8_MAX) + bool[8] bits = unpack(input) return u8_from_bits(bits) \ No newline at end of file From 6e066f869cfaab199c8997f210b15e764e589289 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 15 Sep 2021 12:38:26 +0200 Subject: [PATCH 05/83] keep original declaration type intact and specialize on the fly --- zokrates_core/src/compile.rs | 2 + zokrates_core/src/semantics.rs | 27 +++----- zokrates_core/src/typed_absy/types.rs | 99 ++++++++++++++++++--------- 3 files changed, 77 insertions(+), 51 deletions(-) diff --git a/zokrates_core/src/compile.rs b/zokrates_core/src/compile.rs index 172ad7473..de33ea26f 100644 --- a/zokrates_core/src/compile.rs +++ b/zokrates_core/src/compile.rs @@ -247,6 +247,8 @@ fn check_with_arena<'ast, T: Field, E: Into>( let typed_ast = Checker::check(compiled) .map_err(|errors| CompileErrors(errors.into_iter().map(CompileError::from).collect()))?; + log::trace!("\n{}", typed_ast); + let main_module = typed_ast.main.clone(); log::debug!("Run static analysis"); diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 2572dc655..ce4a97a8a 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1600,24 +1600,9 @@ impl<'ast, T: Field> Checker<'ast, T> { _ => unreachable!("generic on declaration struct types must be generic identifiers") })); - // generate actual type based on generic type and concrete generics - let members = declared_struct_ty - .members - .into_iter() - .map(|m| { - Ok(DeclarationStructMember { - ty: box specialize_declaration_type(*m.ty, &assignment) - .unwrap(), - ..m - }) - }) - .collect::, _>>()?; - Ok(DeclarationType::Struct(DeclarationStructType { - canonical_location: declared_struct_ty.canonical_location, - location: declared_struct_ty.location, generics: checked_generics, - members, + ..declared_struct_ty })) } false => Err(ErrorInner { @@ -3113,11 +3098,19 @@ impl<'ast, T: Field> Checker<'ast, T> { Some(ty) => Ok(ty), }?; - let declared_struct_type = match ty { + let mut declared_struct_type = match ty { DeclarationType::Struct(struct_type) => struct_type, _ => unreachable!(), }; + declared_struct_type.generics = (0..declared_struct_type.generics.len()) + .map(|index| { + Some(DeclarationConstant::Generic( + GenericIdentifier::with_name("DUMMY").index(index), + )) + }) + .collect(); + // check that we provided the required number of values if declared_struct_type.members_count() != inline_members.len() { return Err(ErrorInner { diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 24d125c4d..4cdf41f23 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -57,7 +57,7 @@ impl<'ast, T> Types<'ast, T> { } } -#[derive(Debug, Clone, Eq, Ord)] +#[derive(Debug, Clone, Eq)] pub struct GenericIdentifier<'ast> { pub name: &'ast str, pub index: usize, @@ -86,6 +86,12 @@ impl<'ast> PartialOrd for GenericIdentifier<'ast> { } } +impl<'ast> Ord for GenericIdentifier<'ast> { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.partial_cmp(other).unwrap() + } +} + impl<'ast> Hash for GenericIdentifier<'ast> { fn hash(&self, state: &mut H) { self.index.hash(state); @@ -995,9 +1001,8 @@ pub fn specialize_declaration_type< Ok(match decl_ty { DeclarationType::Int => unreachable!(), DeclarationType::Array(t0) => { - // let s1 = t1.size.clone(); - let ty = box specialize_declaration_type(*t0.ty, &generics)?; + let size = match t0.size { DeclarationConstant::Generic(s) => generics.0.get(&s).cloned().ok_or(s), DeclarationConstant::Concrete(s) => Ok(s.into()), @@ -1009,37 +1014,63 @@ pub fn specialize_declaration_type< DeclarationType::FieldElement => GType::FieldElement, DeclarationType::Boolean => GType::Boolean, DeclarationType::Uint(b0) => GType::Uint(b0), - DeclarationType::Struct(s0) => GType::Struct(GStructType { - members: s0 - .members - .into_iter() - .map(|m| { - let id = m.id; - specialize_declaration_type(*m.ty, generics) - .map(|ty| GStructMember { ty: box ty, id }) - }) - .collect::>()?, - generics: s0 - .generics - .into_iter() - .map(|g| match g { - Some(constant) => match constant { - DeclarationConstant::Generic(s) => { - generics.0.get(&s).cloned().ok_or(s).map(Some) - } - DeclarationConstant::Concrete(s) => Ok(Some(s.into())), - DeclarationConstant::Constant(..) => { - unreachable!( - "identifiers should have been removed in constant inlining" - ) - } - }, - _ => Ok(None), - }) - .collect::>()?, - canonical_location: s0.canonical_location, - location: s0.location, - }), + DeclarationType::Struct(s0) => { + // here we specialize Foo {FooDef} with some values for Generics + // we need to remap these values for InsideGenerics to then visit the members + + let inside_generics = GGenericsAssignment( + s0.generics + .clone() + .into_iter() + .enumerate() + .map(|(index, g)| { + ( + GenericIdentifier::with_name("dummy").index(index), + g.map(|g| match g { + DeclarationConstant::Generic(s) => { + generics.0.get(&s).cloned().unwrap() + } + DeclarationConstant::Concrete(s) => s.into(), + DeclarationConstant::Constant(c) => c.into(), + }) + .unwrap(), + ) + }) + .collect(), + ); + + GType::Struct(GStructType { + members: s0 + .members + .into_iter() + .map(|m| { + let id = m.id; + specialize_declaration_type(*m.ty, &inside_generics) + .map(|ty| GStructMember { ty: box ty, id }) + }) + .collect::>()?, + generics: s0 + .generics + .into_iter() + .map(|g| match g { + Some(constant) => match constant { + DeclarationConstant::Generic(s) => { + generics.0.get(&s).cloned().ok_or(s).map(Some) + } + DeclarationConstant::Concrete(s) => Ok(Some(s.into())), + DeclarationConstant::Constant(..) => { + unreachable!( + "identifiers should have been removed in constant inlining" + ) + } + }, + _ => Ok(None), + }) + .collect::>()?, + canonical_location: s0.canonical_location, + location: s0.location, + }) + } }) } From 11b595ef21989443e6e3e4afe05bf31704a09a8d Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 15 Sep 2021 19:39:01 +0200 Subject: [PATCH 06/83] implement ternary operator --- zokrates_book/src/language/control_flow.md | 6 ++++ zokrates_cli/examples/book/ternary.zok | 3 ++ zokrates_core/src/semantics.rs | 6 ++-- zokrates_core_test/tests/tests/ternary.json | 36 +++++++++++++++++++++ zokrates_core_test/tests/tests/ternary.zok | 2 ++ zokrates_parser/src/zokrates.pest | 4 ++- zokrates_pest_ast/src/lib.rs | 7 ++++ 7 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 zokrates_cli/examples/book/ternary.zok create mode 100644 zokrates_core_test/tests/tests/ternary.json create mode 100644 zokrates_core_test/tests/tests/ternary.zok diff --git a/zokrates_book/src/language/control_flow.md b/zokrates_book/src/language/control_flow.md index 9e47d289f..38a574652 100644 --- a/zokrates_book/src/language/control_flow.md +++ b/zokrates_book/src/language/control_flow.md @@ -26,6 +26,12 @@ An if-expression allows you to branch your code depending on a boolean condition {{#include ../../../zokrates_cli/examples/book/if_else.zok}} ``` +The conditional expression can also be written using a ternary operator: + +```zokrates +{{#include ../../../zokrates_cli/examples/book/ternary.zok}} +``` + There are two important caveats when it comes to conditional expressions. Before we go into them, let's define two concepts: - for an execution of the program, *an executed branch* is a branch which has to be paid for when executing the program, generating proofs, etc. - for an execution of the program, *a logically executed branch* is a branch which is "chosen" by the condition of an if-expression. This is the more intuitive notion of execution, and there is only one for each if-expression. diff --git a/zokrates_cli/examples/book/ternary.zok b/zokrates_cli/examples/book/ternary.zok new file mode 100644 index 000000000..c90ecc5c2 --- /dev/null +++ b/zokrates_cli/examples/book/ternary.zok @@ -0,0 +1,3 @@ +def main(field x) -> field: + field y = x + 2 == 3 ? 1 : 5 + return y \ No newline at end of file diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 937fbf174..3864aa5ec 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -2225,7 +2225,7 @@ impl<'ast, T: Field> Checker<'ast, T> { ) .map_err(|(e1, e2)| ErrorInner { pos: Some(pos), - message: format!("{{consequence}} and {{alternative}} in `if/else` expression should have the same type, found {}, {}", e1.get_type(), e2.get_type()), + message: format!("{{consequence}} and {{alternative}} in conditional expression should have the same type, found {}, {}", e1.get_type(), e2.get_type()), })?; match condition_checked { @@ -2251,14 +2251,14 @@ impl<'ast, T: Field> Checker<'ast, T> { }, (c, a) => Err(ErrorInner { pos: Some(pos), - message: format!("{{consequence}} and {{alternative}} in `if/else` expression should have the same type, found {}, {}", c.get_type(), a.get_type()) + message: format!("{{consequence}} and {{alternative}} in conditional expression should have the same type, found {}, {}", c.get_type(), a.get_type()) }) } } c => Err(ErrorInner { pos: Some(pos), message: format!( - "{{condition}} after `if` should be a boolean, found {}", + "{{condition}} should be a boolean, found {}", c.get_type() ), }), diff --git a/zokrates_core_test/tests/tests/ternary.json b/zokrates_core_test/tests/tests/ternary.json new file mode 100644 index 000000000..3b23ef5a9 --- /dev/null +++ b/zokrates_core_test/tests/tests/ternary.json @@ -0,0 +1,36 @@ +{ + "entry_point": "./tests/tests/ternary.zok", + "max_constraint_count": 4, + "tests": [ + { + "input": { + "values": ["1", "0"] + }, + "output": { + "Ok": { + "values": ["1"] + } + } + }, + { + "input": { + "values": ["0", "1"] + }, + "output": { + "Ok": { + "values": ["2"] + } + } + }, + { + "input": { + "values": ["0", "0"] + }, + "output": { + "Ok": { + "values": ["3"] + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/ternary.zok b/zokrates_core_test/tests/tests/ternary.zok new file mode 100644 index 000000000..a9b8cb577 --- /dev/null +++ b/zokrates_core_test/tests/tests/ternary.zok @@ -0,0 +1,2 @@ +def main(bool a, bool b) -> field: + return a ? 1 : b ? 2 : 3 // (a ? 1 : (b ? 2 : 3)) \ No newline at end of file diff --git a/zokrates_parser/src/zokrates.pest b/zokrates_parser/src/zokrates.pest index ce7499e70..108ee5cf4 100644 --- a/zokrates_parser/src/zokrates.pest +++ b/zokrates_parser/src/zokrates.pest @@ -154,8 +154,10 @@ op_neg = {"-"} op_pos = {"+"} op_left_shift = @{"<<"} op_right_shift = @{">>"} +op_ternary = {"?" ~ expression ~ ":"} + // `op_pow` is *not* in `op_binary` because its precedence is handled in this parser rather than down the line in precedence climbing -op_binary = _ { op_or | op_and | op_bit_xor | op_bit_and | op_bit_or | op_left_shift | op_right_shift | op_equal | op_not_equal | op_lte | op_lt | op_gte | op_gt | op_add | op_sub | op_mul | op_div | op_rem } +op_binary = _ { op_or | op_and | op_bit_xor | op_bit_and | op_bit_or | op_left_shift | op_right_shift | op_equal | op_not_equal | op_lte | op_lt | op_gte | op_gt | op_add | op_sub | op_mul | op_div | op_rem | op_ternary } op_unary = { op_pos | op_neg | op_not } WHITESPACE = _{ " " | "\t" | "\\" ~ COMMENT? ~ NEWLINE} diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index 22b4d0d78..b2089faee 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -38,6 +38,7 @@ mod ast { // based on https://docs.python.org/3/reference/expressions.html#operator-precedence fn build_precedence_climber() -> PrecClimber { PrecClimber::new(vec![ + Operator::new(Rule::op_ternary, Assoc::Right), Operator::new(Rule::op_or, Assoc::Left), Operator::new(Rule::op_and, Assoc::Left), Operator::new(Rule::op_lt, Assoc::Left) @@ -89,6 +90,12 @@ mod ast { Rule::op_bit_or => Expression::binary(BinaryOperator::BitOr, lhs, rhs, span), Rule::op_right_shift => Expression::binary(BinaryOperator::RightShift, lhs, rhs, span), Rule::op_left_shift => Expression::binary(BinaryOperator::LeftShift, lhs, rhs, span), + Rule::op_ternary => dbg!(Expression::ternary( + lhs, + Box::new(Expression::from_pest(&mut pair.into_inner()).unwrap()), + rhs, + span, + )), _ => unreachable!(), }) } From d2df0c1f91a6194115700ca833f4f54a63276058 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 15 Sep 2021 21:48:14 +0200 Subject: [PATCH 07/83] add changelog --- changelogs/unreleased/1010-dark64 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1010-dark64 diff --git a/changelogs/unreleased/1010-dark64 b/changelogs/unreleased/1010-dark64 new file mode 100644 index 000000000..6aa232ca5 --- /dev/null +++ b/changelogs/unreleased/1010-dark64 @@ -0,0 +1 @@ +Introduce ternary operator \ No newline at end of file From 6fe68211665b1432c6a6ddc98bf68457a243a40e Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 15 Sep 2021 21:57:40 +0200 Subject: [PATCH 08/83] remove dbg --- zokrates_pest_ast/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index b2089faee..f446f54a3 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -90,12 +90,12 @@ mod ast { Rule::op_bit_or => Expression::binary(BinaryOperator::BitOr, lhs, rhs, span), Rule::op_right_shift => Expression::binary(BinaryOperator::RightShift, lhs, rhs, span), Rule::op_left_shift => Expression::binary(BinaryOperator::LeftShift, lhs, rhs, span), - Rule::op_ternary => dbg!(Expression::ternary( + Rule::op_ternary => Expression::ternary( lhs, Box::new(Expression::from_pest(&mut pair.into_inner()).unwrap()), rhs, span, - )), + ), _ => unreachable!(), }) } From 3975437fe4d9eb2de7ac247f7337afae4bf1aa5f Mon Sep 17 00:00:00 2001 From: dark64 Date: Thu, 16 Sep 2021 15:54:03 +0200 Subject: [PATCH 09/83] improve tests --- zokrates_cli/examples/compile_errors/ternary_precedence.zok | 5 +++++ zokrates_core_test/tests/tests/ternary.zok | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 zokrates_cli/examples/compile_errors/ternary_precedence.zok diff --git a/zokrates_cli/examples/compile_errors/ternary_precedence.zok b/zokrates_cli/examples/compile_errors/ternary_precedence.zok new file mode 100644 index 000000000..180b081e1 --- /dev/null +++ b/zokrates_cli/examples/compile_errors/ternary_precedence.zok @@ -0,0 +1,5 @@ +def main(bool a) -> field: + // ternary expression should be wrapped in parentheses 1 + (a ? 2 : 3) + // otherwise the whole expression is parsed as (1 + a) ? 2 : 3 + field x = 1 + a ? 2 : 3 + return x \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/ternary.zok b/zokrates_core_test/tests/tests/ternary.zok index a9b8cb577..7bd9486e2 100644 --- a/zokrates_core_test/tests/tests/ternary.zok +++ b/zokrates_core_test/tests/tests/ternary.zok @@ -1,2 +1,5 @@ def main(bool a, bool b) -> field: - return a ? 1 : b ? 2 : 3 // (a ? 1 : (b ? 2 : 3)) \ No newline at end of file + field x = a ? 1 : b ? 2 : 3 // (a ? 1 : (b ? 2 : 3)) + field y = if a then 1 else if b then 2 else 3 fi fi + assert(x == y) + return x \ No newline at end of file From 6f8b73ab0f4e00e3617880421bea117699891c25 Mon Sep 17 00:00:00 2001 From: schaeff Date: Thu, 16 Sep 2021 18:36:17 +0300 Subject: [PATCH 10/83] fix abi with concretization, fix StructType --- zokrates_core/src/semantics.rs | 32 +++++-- .../static_analysis/flatten_complex_types.rs | 2 + zokrates_core/src/static_analysis/mod.rs | 10 ++ .../src/static_analysis/propagation.rs | 18 ++-- .../src/static_analysis/struct_concretizer.rs | 96 +++++++++++++++++++ zokrates_core/src/typed_absy/mod.rs | 14 ++- zokrates_core/src/typed_absy/types.rs | 3 +- 7 files changed, 153 insertions(+), 22 deletions(-) create mode 100644 zokrates_core/src/static_analysis/struct_concretizer.rs diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index ce4a97a8a..85421404f 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -6,7 +6,7 @@ use crate::absy::Identifier; use crate::absy::*; -use crate::typed_absy::types::GGenericsAssignment; +use crate::typed_absy::types::{GGenericsAssignment, GenericsAssignment}; use crate::typed_absy::*; use crate::typed_absy::{DeclarationParameter, DeclarationVariable, Variable}; use num_bigint::BigUint; @@ -1032,17 +1032,28 @@ impl<'ast, T: Field> Checker<'ast, T> { match self.check_signature(funct.signature, module_id, state) { Ok(s) => { + // initialise generics map + let mut generics: GenericsAssignment<'ast, T> = GGenericsAssignment::default(); + // define variables for the constants for generic in &s.generics { - let generic = generic.clone().unwrap(); // for declaration signatures, generics cannot be ignored + let generic = match generic.clone().unwrap() { + DeclarationConstant::Generic(g) => g, + _ => unreachable!(), + }; + + // for declaration signatures, generics cannot be ignored let v = Variable::with_id_and_type( - match generic { - DeclarationConstant::Generic(g) => g.name, - _ => unreachable!(), - }, + generic.name.clone(), Type::Uint(UBitwidth::B32), ); + + generics.0.insert( + generic.clone(), + UExpressionInner::Identifier(generic.name.into()).annotate(UBitwidth::B32), + ); + // we don't have to check for conflicts here, because this was done when checking the signature self.insert_into_scope(v.clone()); } @@ -1055,9 +1066,12 @@ impl<'ast, T: Field> Checker<'ast, T> { let decl_v = DeclarationVariable::with_id_and_type(arg.id.value.id, decl_ty.clone()); - match self.insert_into_scope( - crate::typed_absy::variable::try_from_g_variable(decl_v.clone()).unwrap(), - ) { + let ty = specialize_declaration_type(decl_v.clone()._type, &generics).unwrap(); + + match self.insert_into_scope(crate::typed_absy::variable::Variable { + id: decl_v.clone().id, + _type: ty, + }) { true => {} false => { errors.push(ErrorInner { diff --git a/zokrates_core/src/static_analysis/flatten_complex_types.rs b/zokrates_core/src/static_analysis/flatten_complex_types.rs index f3973297a..db213ca6c 100644 --- a/zokrates_core/src/static_analysis/flatten_complex_types.rs +++ b/zokrates_core/src/static_analysis/flatten_complex_types.rs @@ -1125,6 +1125,8 @@ fn fold_struct_expression<'ast, T: Field>( statements_buffer: &mut Vec>, e: typed_absy::StructExpression<'ast, T>, ) -> Vec> { + println!("{:#?}", e.ty()); + f.fold_struct_expression_inner( statements_buffer, &typed_absy::types::ConcreteStructType::try_from(e.ty().clone()).unwrap(), diff --git a/zokrates_core/src/static_analysis/mod.rs b/zokrates_core/src/static_analysis/mod.rs index 2285115b4..ae46821ff 100644 --- a/zokrates_core/src/static_analysis/mod.rs +++ b/zokrates_core/src/static_analysis/mod.rs @@ -11,6 +11,7 @@ mod flat_propagation; mod flatten_complex_types; mod propagation; mod reducer; +mod struct_concretizer; mod uint_optimizer; mod unconstrained_vars; mod variable_write_remover; @@ -20,6 +21,7 @@ use self::constant_argument_checker::ConstantArgumentChecker; use self::flatten_complex_types::Flattener; use self::propagation::Propagator; use self::reducer::reduce_program; +use self::struct_concretizer::StructConcretizer; use self::uint_optimizer::UintOptimizer; use self::unconstrained_vars::UnconstrainedVariableDetector; use self::variable_write_remover::VariableWriteRemover; @@ -101,6 +103,14 @@ impl<'ast, T: Field> TypedProgram<'ast, T> { let r = reduce_program(r).map_err(Error::from)?; log::trace!("\n{}", r); + log::debug!("Static analyser: Propagate"); + let r = Propagator::propagate(r)?; + log::trace!("\n{}", r); + + log::debug!("Static analyser: Concretize structs"); + let r = StructConcretizer::concretize(r); + log::trace!("\n{}", r); + // generate abi log::debug!("Static analyser: Generate abi"); let abi = r.abi(); diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index b90fc99d6..1450e0773 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -1194,16 +1194,14 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { let e1 = self.fold_struct_expression(e1)?; let e2 = self.fold_struct_expression(e2)?; - if let (Ok(t1), Ok(t2)) = ( - ConcreteType::try_from(e1.get_type()), - ConcreteType::try_from(e2.get_type()), - ) { - if t1 != t2 { - return Err(Error::Type(format!( - "Cannot compare {} of type {} to {} of type {}", - e1, t1, e2, t2 - ))); - } + let t1 = e1.get_type(); + let t2 = e2.get_type(); + + if t1 != t2 { + return Err(Error::Type(format!( + "Cannot compare {} of type {} to {} of type {}", + e1, t1, e2, t2 + ))); }; Ok(BooleanExpression::StructEq(box e1, box e2)) diff --git a/zokrates_core/src/static_analysis/struct_concretizer.rs b/zokrates_core/src/static_analysis/struct_concretizer.rs new file mode 100644 index 000000000..874a4b361 --- /dev/null +++ b/zokrates_core/src/static_analysis/struct_concretizer.rs @@ -0,0 +1,96 @@ +// After all generics are inlined, a program should be completely "concrete", which means that all types must only contain +// litterals for array sizes. This is especially important to generate the ABI of the program. +// It is direct to ensure that with most types, however the way structs are implemented requires a slightly different process: +// Where for an array, `field[N]` ends up being propagated to `field[42]` which is direct to turn into a concrete type, +// for structs, `Foo { field[N] a }` is propagated to `Foo<42> { field[N] a }`. The missing step is replacing `N` by `42` +// *inside* the canonical type, so that it can be concretized in the same way arrays are. +// We apply this transformation only to the main function. + +use crate::typed_absy::folder::*; +use crate::typed_absy::{ + types::{ + ConcreteGenericsAssignment, DeclarationArrayType, DeclarationConstant, + DeclarationStructMember, GGenericsAssignment, + }, + DeclarationStructType, GenericIdentifier, TypedProgram, +}; +use zokrates_field::Field; + +#[derive(Default)] +pub struct StructConcretizer<'ast> { + generics: ConcreteGenericsAssignment<'ast>, +} + +impl<'ast> StructConcretizer<'ast> { + pub fn concretize(p: TypedProgram<'ast, T>) -> TypedProgram<'ast, T> { + StructConcretizer::default().fold_program(p) + } + + pub fn with_generics(generics: ConcreteGenericsAssignment<'ast>) -> Self { + Self { generics } + } +} + +impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast> { + fn fold_declaration_struct_type( + &mut self, + ty: DeclarationStructType<'ast>, + ) -> DeclarationStructType<'ast> { + let concrete_generics: Vec<_> = ty + .generics + .iter() + .map(|g| match g.as_ref().unwrap() { + DeclarationConstant::Generic(s) => self.generics.0.get(&s).cloned().unwrap(), + DeclarationConstant::Concrete(s) => *s as usize, + DeclarationConstant::Constant(..) => unreachable!(), + }) + .collect(); + + let concrete_generics_map: ConcreteGenericsAssignment = GGenericsAssignment( + concrete_generics + .iter() + .enumerate() + .map(|(index, g)| (GenericIdentifier::with_name("DUMMY").index(index), *g)) + .collect(), + ); + + let mut internal_concretizer = StructConcretizer::with_generics(concrete_generics_map); + + DeclarationStructType { + members: ty + .members + .into_iter() + .map(|member| { + DeclarationStructMember::new( + member.id, + >::fold_declaration_type( + &mut internal_concretizer, + *member.ty, + ), + ) + }) + .collect(), + generics: concrete_generics + .into_iter() + .map(|g| Some(DeclarationConstant::Concrete(g as u32))) + .collect(), + ..ty + } + } + + fn fold_declaration_array_type( + &mut self, + ty: DeclarationArrayType<'ast>, + ) -> DeclarationArrayType<'ast> { + let size = match ty.size { + DeclarationConstant::Generic(s) => self.generics.0.get(&s).cloned().unwrap() as u32, + DeclarationConstant::Concrete(s) => s, + DeclarationConstant::Constant(..) => unreachable!(), + }; + + DeclarationArrayType { + size: DeclarationConstant::Concrete(size), + ty: box >::fold_declaration_type(self, *ty.ty), + } + } +} diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index b31dfeee1..29a8dfb69 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -663,7 +663,19 @@ impl<'ast, T: fmt::Display> fmt::Display for StructExpression<'ast, T> { StructExpressionInner::IfElse(ref c) => write!(f, "{}", c), StructExpressionInner::Member(ref m) => write!(f, "{}", m), StructExpressionInner::Select(ref select) => write!(f, "{}", select), - } + }?; + + write!( + f, + "/* {} {{{}}} */", + self.ty, + self.ty + .members + .iter() + .map(|m| format!("{}: {}", m.id, m.ty)) + .collect::>() + .join(", ") + ) } } diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 4cdf41f23..94a6acc19 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -371,8 +371,7 @@ impl<'ast, S, R: PartialEq> PartialEq> for GStructType { .zip(other.generics.iter()) .all(|(a, b)| match (a, b) { (Some(a), Some(b)) => a == b, - (None, None) => true, - _ => false, + _ => true, }) } } From 3a54229f9bc2dcfbc7262b70a8c3dc29a9e76439 Mon Sep 17 00:00:00 2001 From: dark64 Date: Thu, 16 Sep 2021 18:10:45 +0200 Subject: [PATCH 11/83] correct max constraint count --- zokrates_core_test/tests/tests/ternary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_core_test/tests/tests/ternary.json b/zokrates_core_test/tests/tests/ternary.json index 3b23ef5a9..fb751f4d9 100644 --- a/zokrates_core_test/tests/tests/ternary.json +++ b/zokrates_core_test/tests/tests/ternary.json @@ -1,6 +1,6 @@ { "entry_point": "./tests/tests/ternary.zok", - "max_constraint_count": 4, + "max_constraint_count": 6, "tests": [ { "input": { From a3bfa9f6d6573fc55ab70a779de5b3895e03d728 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 17 Sep 2021 16:21:52 +0300 Subject: [PATCH 12/83] clippy --- zokrates_core/src/semantics.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 85421404f..213a69a75 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1044,10 +1044,7 @@ impl<'ast, T: Field> Checker<'ast, T> { // for declaration signatures, generics cannot be ignored - let v = Variable::with_id_and_type( - generic.name.clone(), - Type::Uint(UBitwidth::B32), - ); + let v = Variable::with_id_and_type(generic.name, Type::Uint(UBitwidth::B32)); generics.0.insert( generic.clone(), From 1dbd753ac77f904e79a5955f8ebc4f18a23c5b10 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 20 Sep 2021 18:23:24 +0200 Subject: [PATCH 13/83] Add optional message to assert statement --- zokrates_core/src/absy/from_ast.rs | 7 +- zokrates_core/src/absy/mod.rs | 11 +- zokrates_core/src/flat_absy/mod.rs | 20 +-- zokrates_core/src/flatten/mod.rs | 139 +++++++++++------- zokrates_core/src/ir/interpreter.rs | 34 ++++- zokrates_core/src/parser/tokenize/position.rs | 2 +- zokrates_core/src/semantics.rs | 13 +- .../static_analysis/flatten_complex_types.rs | 4 +- .../src/static_analysis/propagation.rs | 10 +- .../src/static_analysis/uint_optimizer.rs | 9 +- .../static_analysis/variable_write_remover.rs | 1 + .../src/static_analysis/zir_propagation.rs | 36 +++-- zokrates_core/src/typed_absy/folder.rs | 4 +- zokrates_core/src/typed_absy/mod.rs | 31 +++- zokrates_core/src/typed_absy/result_folder.rs | 4 +- zokrates_core/src/zir/folder.rs | 2 +- zokrates_core/src/zir/mod.rs | 42 ++---- zokrates_core/src/zir/result_folder.rs | 2 +- .../tests/tests/arrays/identity.json | 2 +- .../tests/tests/arrays/select.json | 2 +- .../tests/tests/assert_one.json | 4 +- .../conditional_bound_throw_no_isolation.json | 12 +- .../panics/deep_branch_no_isolation.json | 4 +- .../panics/internal_panic_no_isolation.json | 2 +- .../tests/tests/panics/loop_bound.json | 4 +- .../tests/tests/panics/panic_isolation.json | 4 +- .../tests/panics/panic_no_isolation.json | 4 +- .../tests/tests/structs/identity.json | 2 +- zokrates_parser/src/zokrates.pest | 9 +- zokrates_pest_ast/src/lib.rs | 31 ++-- 30 files changed, 276 insertions(+), 175 deletions(-) diff --git a/zokrates_core/src/absy/from_ast.rs b/zokrates_core/src/absy/from_ast.rs index a968b9c29..bd95f61c1 100644 --- a/zokrates_core/src/absy/from_ast.rs +++ b/zokrates_core/src/absy/from_ast.rs @@ -346,8 +346,11 @@ impl<'ast> From> for absy::StatementNode<'ast> { fn from(statement: pest::AssertionStatement<'ast>) -> absy::StatementNode<'ast> { use crate::absy::NodeValue; - absy::Statement::Assertion(absy::ExpressionNode::from(statement.expression)) - .span(statement.span) + absy::Statement::Assertion( + absy::ExpressionNode::from(statement.expression), + statement.message.map(|m| m.value), + ) + .span(statement.span) } } diff --git a/zokrates_core/src/absy/mod.rs b/zokrates_core/src/absy/mod.rs index 70fc76d09..31150df4c 100644 --- a/zokrates_core/src/absy/mod.rs +++ b/zokrates_core/src/absy/mod.rs @@ -337,7 +337,7 @@ pub enum Statement<'ast> { Return(ExpressionListNode<'ast>), Declaration(VariableNode<'ast>), Definition(AssigneeNode<'ast>, ExpressionNode<'ast>), - Assertion(ExpressionNode<'ast>), + Assertion(ExpressionNode<'ast>, Option), For( VariableNode<'ast>, ExpressionNode<'ast>, @@ -355,7 +355,14 @@ impl<'ast> fmt::Display for Statement<'ast> { Statement::Return(ref expr) => write!(f, "return {}", expr), Statement::Declaration(ref var) => write!(f, "{}", var), Statement::Definition(ref lhs, ref rhs) => write!(f, "{} = {}", lhs, rhs), - Statement::Assertion(ref e) => write!(f, "assert({})", e), + Statement::Assertion(ref e, ref message) => { + write!(f, "assert({}", e)?; + if message.is_some() { + write!(f, ", \"{}\")", message.as_ref().unwrap()) + } else { + write!(f, ")") + } + } Statement::For(ref var, ref start, ref stop, ref list) => { writeln!(f, "for {} in {}..{} do", var, start, stop)?; for l in list { diff --git a/zokrates_core/src/flat_absy/mod.rs b/zokrates_core/src/flat_absy/mod.rs index 9da11f490..96cdab83e 100644 --- a/zokrates_core/src/flat_absy/mod.rs +++ b/zokrates_core/src/flat_absy/mod.rs @@ -43,18 +43,18 @@ pub enum RuntimeError { Euclidean, ShaXor, Division, - Source, + Source(Option), ArgumentBitness, SelectRangeCheck, } impl RuntimeError { - fn is_malicious(&self) -> bool { + pub(crate) fn is_malicious(&self) -> bool { use RuntimeError::*; !matches!( self, - Source | Inverse | LtSum | SelectRangeCheck | ArgumentBitness + Source(_) | Inverse | LtSum | SelectRangeCheck | ArgumentBitness ) } } @@ -87,19 +87,15 @@ impl fmt::Display for RuntimeError { Euclidean => "Euclidean check failed", ShaXor => "Internal Sha check failed", Division => "Division check failed", - Source => "User assertion failed", + Source(m) => m + .as_ref() + .map(|s| s.as_str()) + .unwrap_or("User assertion failed"), ArgumentBitness => "Argument bitness check failed", SelectRangeCheck => "Out of bounds array access", }; - write!(f, "{}", msg)?; - - if self.is_malicious() { - writeln!(f)?; - write!(f, "The default ZoKrates interpreter should not yield this error. Please open an issue")?; - } - - write!(f, "") + write!(f, "{}", msg) } } diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index 79d3948f9..7564ba9dd 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -14,6 +14,7 @@ use crate::compile::CompileConfig; use crate::embed::FlatEmbed; use crate::flat_absy::*; use crate::solvers::Solver; +use crate::typed_absy::AssertionMetadata; use crate::zir::types::{Type, UBitwidth}; use crate::zir::*; use std::collections::hash_map::Entry; @@ -2367,13 +2368,13 @@ impl<'ast, T: Field> Flattener<'ast, T> { .insert(FlatExpression::Identifier(var), bits); } } - ZirStatement::Assertion(e) => { + ZirStatement::Assertion(e, metadata) => { match e { BooleanExpression::And(..) => { for boolean in e.into_conjunction_iterator() { self.flatten_statement( statements_flattened, - ZirStatement::Assertion(boolean), + ZirStatement::Assertion(boolean, metadata.clone()), ) } } @@ -2381,7 +2382,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { let lhs = self.flatten_field_expression(statements_flattened, lhs); let rhs = self.flatten_field_expression(statements_flattened, rhs); - self.flatten_equality_assertion(statements_flattened, lhs, rhs) + self.flatten_equality_assertion(statements_flattened, lhs, rhs, metadata) } BooleanExpression::UintEq(box lhs, box rhs) => { let lhs = self @@ -2391,13 +2392,13 @@ impl<'ast, T: Field> Flattener<'ast, T> { .flatten_uint_expression(statements_flattened, rhs) .get_field_unchecked(); - self.flatten_equality_assertion(statements_flattened, lhs, rhs) + self.flatten_equality_assertion(statements_flattened, lhs, rhs, metadata) } BooleanExpression::BoolEq(box lhs, box rhs) => { let lhs = self.flatten_boolean_expression(statements_flattened, lhs); let rhs = self.flatten_boolean_expression(statements_flattened, rhs); - self.flatten_equality_assertion(statements_flattened, lhs, rhs) + self.flatten_equality_assertion(statements_flattened, lhs, rhs, metadata) } _ => { // naive approach: flatten the boolean to a single field element and constrain it to 1 @@ -2407,14 +2408,14 @@ impl<'ast, T: Field> Flattener<'ast, T> { statements_flattened.push(FlatStatement::Condition( e, FlatExpression::Number(T::from(1)), - RuntimeError::Source, + RuntimeError::Source(metadata.map(|m| m.to_string())), )); } else { // swap so that left side is linear statements_flattened.push(FlatStatement::Condition( FlatExpression::Number(T::from(1)), e, - RuntimeError::Source, + RuntimeError::Source(metadata.map(|m| m.to_string())), )); } } @@ -2526,6 +2527,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { statements_flattened: &mut FlatStatements, lhs: FlatExpression, rhs: FlatExpression, + metadata: Option, ) { let (lhs, rhs) = match (lhs, rhs) { (FlatExpression::Mult(box x, box y), z) | (z, FlatExpression::Mult(box x, box y)) => ( @@ -2543,7 +2545,11 @@ impl<'ast, T: Field> Flattener<'ast, T> { ), ), }; - statements_flattened.push(FlatStatement::Condition(lhs, rhs, RuntimeError::Source)); + statements_flattened.push(FlatStatement::Condition( + lhs, + rhs, + RuntimeError::Source(metadata.map(|m| m.to_string())), + )); } /// Identifies a non-linear expression by assigning it to a new identifier. @@ -2676,10 +2682,13 @@ mod tests { Variable::boolean("y".into()), BooleanExpression::Value(true).into(), ), - ZirStatement::Assertion(BooleanExpression::BoolEq( - box BooleanExpression::Identifier("x".into()), - box BooleanExpression::Identifier("y".into()), - )), + ZirStatement::Assertion( + BooleanExpression::BoolEq( + box BooleanExpression::Identifier("x".into()), + box BooleanExpression::Identifier("y".into()), + ), + None, + ), ], signature: Signature { inputs: vec![], @@ -2708,7 +2717,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; @@ -2738,13 +2747,16 @@ mod tests { Variable::field_element("y"), FieldElementExpression::Number(Bn128Field::from(2)).into(), ), - ZirStatement::Assertion(BooleanExpression::FieldEq( - box FieldElementExpression::Add( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Number(Bn128Field::from(1)), + ZirStatement::Assertion( + BooleanExpression::FieldEq( + box FieldElementExpression::Add( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Number(Bn128Field::from(1)), + ), + box FieldElementExpression::Identifier("y".into()), ), - box FieldElementExpression::Identifier("y".into()), - )), + None, + ), ], signature: Signature { inputs: vec![], @@ -2776,7 +2788,7 @@ mod tests { ), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; @@ -2808,12 +2820,15 @@ mod tests { .metadata(metadata.clone()), ), ), - ZirStatement::Assertion(BooleanExpression::UintEq( - box UExpressionInner::Identifier("x".into()) - .annotate(32) - .metadata(metadata.clone()), - box UExpressionInner::Value(42).annotate(32).metadata(metadata), - )), + ZirStatement::Assertion( + BooleanExpression::UintEq( + box UExpressionInner::Identifier("x".into()) + .annotate(32) + .metadata(metadata.clone()), + box UExpressionInner::Value(42).annotate(32).metadata(metadata), + ), + None, + ), ], signature: Signature { inputs: vec![], @@ -2838,7 +2853,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; @@ -2868,10 +2883,13 @@ mod tests { Variable::field_element("y"), FieldElementExpression::Number(Bn128Field::from(2)).into(), ), - ZirStatement::Assertion(BooleanExpression::FieldEq( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Identifier("y".into()), - )), + ZirStatement::Assertion( + BooleanExpression::FieldEq( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Identifier("y".into()), + ), + None, + ), ], signature: Signature { inputs: vec![], @@ -2900,7 +2918,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; @@ -2936,13 +2954,16 @@ mod tests { Variable::field_element("z"), FieldElementExpression::Number(Bn128Field::from(4)).into(), ), - ZirStatement::Assertion(BooleanExpression::FieldEq( - box FieldElementExpression::Mult( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Identifier("y".into()), + ZirStatement::Assertion( + BooleanExpression::FieldEq( + box FieldElementExpression::Mult( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Identifier("y".into()), + ), + box FieldElementExpression::Identifier("z".into()), ), - box FieldElementExpression::Identifier("z".into()), - )), + None, + ), ], signature: Signature { inputs: vec![], @@ -2975,7 +2996,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; @@ -3011,13 +3032,16 @@ mod tests { Variable::field_element("z"), FieldElementExpression::Number(Bn128Field::from(4)).into(), ), - ZirStatement::Assertion(BooleanExpression::FieldEq( - box FieldElementExpression::Identifier("z".into()), - box FieldElementExpression::Mult( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Identifier("y".into()), + ZirStatement::Assertion( + BooleanExpression::FieldEq( + box FieldElementExpression::Identifier("z".into()), + box FieldElementExpression::Mult( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Identifier("y".into()), + ), ), - )), + None, + ), ], signature: Signature { inputs: vec![], @@ -3050,7 +3074,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; @@ -3093,16 +3117,19 @@ mod tests { Variable::field_element("t"), FieldElementExpression::Number(Bn128Field::from(2)).into(), ), - ZirStatement::Assertion(BooleanExpression::FieldEq( - box FieldElementExpression::Mult( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Identifier("y".into()), - ), - box FieldElementExpression::Mult( - box FieldElementExpression::Identifier("z".into()), - box FieldElementExpression::Identifier("t".into()), + ZirStatement::Assertion( + BooleanExpression::FieldEq( + box FieldElementExpression::Mult( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Identifier("y".into()), + ), + box FieldElementExpression::Mult( + box FieldElementExpression::Identifier("z".into()), + box FieldElementExpression::Identifier("t".into()), + ), ), - )), + None, + ), ], signature: Signature { inputs: vec![], @@ -3146,7 +3173,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source, + RuntimeError::Source(None), ), ], }; diff --git a/zokrates_core/src/ir/interpreter.rs b/zokrates_core/src/ir/interpreter.rs index 8b071998c..be02e8b1a 100644 --- a/zokrates_core/src/ir/interpreter.rs +++ b/zokrates_core/src/ir/interpreter.rs @@ -1,4 +1,5 @@ use crate::flat_absy::flat_variable::FlatVariable; +use crate::flat_absy::RuntimeError; use crate::ir::{LinComb, Prog, QuadComb, Statement, Witness}; use crate::solvers::Solver; use serde::{Deserialize, Serialize}; @@ -44,7 +45,7 @@ impl Interpreter { for statement in program.statements.iter() { match statement { - Statement::Constraint(quad, lin, message) => match lin.is_assignee(&witness) { + Statement::Constraint(quad, lin, error) => match lin.is_assignee(&witness) { true => { let val = quad.evaluate(&witness).unwrap(); witness.insert(lin.0.get(0).unwrap().0, val); @@ -56,10 +57,7 @@ impl Interpreter { return Err(Error::UnsatisfiedConstraint { left: lhs_value.to_dec_string(), right: rhs_value.to_dec_string(), - message: message - .as_ref() - .map(|m| m.to_string()) - .unwrap_or_else(|| "Unknown".to_string()), + error: error.to_owned(), }); } } @@ -285,7 +283,7 @@ pub enum Error { UnsatisfiedConstraint { left: String, right: String, - message: String, + error: Option, }, Solver, WrongInputCount { @@ -300,8 +298,28 @@ impl fmt::Display for Error { Error::UnsatisfiedConstraint { ref left, ref right, - ref message, - } => write!(f, "{}: expected {} to equal {}", message, left, right), + ref error, + } => { + write!( + f, + "{}", + error + .as_ref() + .map(|m| m.to_string()) + .unwrap_or_else(|| format!( + "Unsatisfied constraint: expected {} to equal {}", + left, right + )) + )?; + + match error { + Some(e) if e.is_malicious() => { + writeln!(f)?; + write!(f, "The default ZoKrates interpreter should not yield this error. Please open an issue.") + } + _ => write!(f, ""), + } + } Error::Solver => write!(f, ""), Error::WrongInputCount { expected, received } => write!( f, diff --git a/zokrates_core/src/parser/tokenize/position.rs b/zokrates_core/src/parser/tokenize/position.rs index a85ed3ce5..ee90bccbf 100644 --- a/zokrates_core/src/parser/tokenize/position.rs +++ b/zokrates_core/src/parser/tokenize/position.rs @@ -1,6 +1,6 @@ use std::fmt; -#[derive(Clone, PartialEq, Copy)] +#[derive(Clone, PartialEq, Eq, Copy, Hash, Default)] pub struct Position { pub line: usize, pub col: usize, diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 937fbf174..2ce7f5173 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1700,13 +1700,20 @@ impl<'ast, T: Field> Checker<'ast, T> { .map(|rhs| TypedStatement::Definition(var, rhs)) .map_err(|e| vec![e]) } - Statement::Assertion(e) => { + Statement::Assertion(e, message) => { let e = self .check_expression(e, module_id, types) .map_err(|e| vec![e])?; match e { - TypedExpression::Boolean(e) => Ok(TypedStatement::Assertion(e)), + TypedExpression::Boolean(e) => Ok(TypedStatement::Assertion( + e, + Some(AssertionMetadata { + file: module_id.display().to_string(), + position: pos.0, + message, + }), + )), e => Err(ErrorInner { pos: Some(pos), message: format!( @@ -4523,6 +4530,7 @@ mod tests { box Expression::FunctionCall("foo", None, vec![]).mock(), ) .mock(), + None, ) .mock(), Statement::Return( @@ -4923,6 +4931,7 @@ mod tests { box Expression::FunctionCall("foo", None, vec![]).mock(), ) .mock(), + None, ) .mock(), Statement::Return( diff --git a/zokrates_core/src/static_analysis/flatten_complex_types.rs b/zokrates_core/src/static_analysis/flatten_complex_types.rs index f3973297a..83af0e993 100644 --- a/zokrates_core/src/static_analysis/flatten_complex_types.rs +++ b/zokrates_core/src/static_analysis/flatten_complex_types.rs @@ -379,9 +379,9 @@ fn fold_statement<'ast, T: Field>( typed_absy::TypedStatement::Declaration(..) => { unreachable!() } - typed_absy::TypedStatement::Assertion(e) => { + typed_absy::TypedStatement::Assertion(e, m) => { let e = f.fold_boolean_expression(statements_buffer, e); - vec![zir::ZirStatement::Assertion(e)] + vec![zir::ZirStatement::Assertion(e, m)] } typed_absy::TypedStatement::For(..) => unreachable!(), typed_absy::TypedStatement::MultipleDefinition(variables, elist) => { diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index 38c29a0cb..0fb654cfd 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -610,15 +610,17 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { Ok(statements) } - TypedStatement::Assertion(e) => { + TypedStatement::Assertion(e, s) => { let e_str = e.to_string(); let expr = self.fold_boolean_expression(e)?; match expr { BooleanExpression::Value(v) if !v => Err(Error::AssertionFailed(format!( - "Assertion failed on expression `{}`", - e_str + "{}: ({})", + s.map(|m| m.to_string()) + .unwrap_or_else(|| "Assertion failed".to_string()), + e_str, ))), - _ => Ok(vec![TypedStatement::Assertion(expr)]), + _ => Ok(vec![TypedStatement::Assertion(expr, s)]), } } s @ TypedStatement::PushCallLog(..) => Ok(vec![s]), diff --git a/zokrates_core/src/static_analysis/uint_optimizer.rs b/zokrates_core/src/static_analysis/uint_optimizer.rs index ab8911a7e..4c0a26c6a 100644 --- a/zokrates_core/src/static_analysis/uint_optimizer.rs +++ b/zokrates_core/src/static_analysis/uint_optimizer.rs @@ -531,7 +531,7 @@ impl<'ast, T: Field> Folder<'ast, T> for UintOptimizer<'ast, T> { } } } - ZirStatement::Assertion(BooleanExpression::UintEq(box left, box right)) => { + ZirStatement::Assertion(BooleanExpression::UintEq(box left, box right), m) => { let left = self.fold_uint_expression(left); let right = self.fold_uint_expression(right); @@ -539,9 +539,10 @@ impl<'ast, T: Field> Folder<'ast, T> for UintOptimizer<'ast, T> { let left = force_reduce(left); let right = force_reduce(right); - vec![ZirStatement::Assertion(BooleanExpression::UintEq( - box left, box right, - ))] + vec![ZirStatement::Assertion( + BooleanExpression::UintEq(box left, box right), + m, + )] } s => fold_statement(self, s), } diff --git a/zokrates_core/src/static_analysis/variable_write_remover.rs b/zokrates_core/src/static_analysis/variable_write_remover.rs index 82cc206ec..c99459fd3 100644 --- a/zokrates_core/src/static_analysis/variable_write_remover.rs +++ b/zokrates_core/src/static_analysis/variable_write_remover.rs @@ -49,6 +49,7 @@ impl<'ast> VariableWriteRemover { Access::Select(head) => { statements.insert(TypedStatement::Assertion( BooleanExpression::UintLt(box head.clone(), box size.into()), + None, )); ArrayExpressionInner::Value( diff --git a/zokrates_core/src/static_analysis/zir_propagation.rs b/zokrates_core/src/static_analysis/zir_propagation.rs index c3028a030..8e0b77140 100644 --- a/zokrates_core/src/static_analysis/zir_propagation.rs +++ b/zokrates_core/src/static_analysis/zir_propagation.rs @@ -51,9 +51,9 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ZirPropagator<'ast, T> { s: ZirStatement<'ast, T>, ) -> Result>, Self::Error> { match s { - ZirStatement::Assertion(e) => match self.fold_boolean_expression(e)? { + ZirStatement::Assertion(e, m) => match self.fold_boolean_expression(e)? { BooleanExpression::Value(true) => Ok(vec![]), - e => Ok(vec![ZirStatement::Assertion(e)]), + e => Ok(vec![ZirStatement::Assertion(e, m)]), }, ZirStatement::Definition(a, e) => { let e = self.fold_expression(e)?; @@ -659,16 +659,19 @@ mod tests { #[test] fn propagation() { // assert([x, 1] == [y, 1]) - let statements = vec![ZirStatement::Assertion(BooleanExpression::And( - box BooleanExpression::FieldEq( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Identifier("y".into()), - ), - box BooleanExpression::FieldEq( - box FieldElementExpression::Number(Bn128Field::from(1)), - box FieldElementExpression::Number(Bn128Field::from(1)), + let statements = vec![ZirStatement::Assertion( + BooleanExpression::And( + box BooleanExpression::FieldEq( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Identifier("y".into()), + ), + box BooleanExpression::FieldEq( + box FieldElementExpression::Number(Bn128Field::from(1)), + box FieldElementExpression::Number(Bn128Field::from(1)), + ), ), - ))]; + None, + )]; let mut propagator = ZirPropagator::default(); let statements: Vec> = statements @@ -682,10 +685,13 @@ mod tests { assert_eq!( statements, - vec![ZirStatement::Assertion(BooleanExpression::FieldEq( - box FieldElementExpression::Identifier("x".into()), - box FieldElementExpression::Identifier("y".into()), - ))] + vec![ZirStatement::Assertion( + BooleanExpression::FieldEq( + box FieldElementExpression::Identifier("x".into()), + box FieldElementExpression::Identifier("y".into()), + ), + None + )] ); } diff --git a/zokrates_core/src/typed_absy/folder.rs b/zokrates_core/src/typed_absy/folder.rs index 6bb1cc197..ac3dcd49d 100644 --- a/zokrates_core/src/typed_absy/folder.rs +++ b/zokrates_core/src/typed_absy/folder.rs @@ -416,7 +416,9 @@ pub fn fold_statement<'ast, T: Field, F: Folder<'ast, T>>( TypedStatement::Definition(f.fold_assignee(a), f.fold_expression(e)) } TypedStatement::Declaration(v) => TypedStatement::Declaration(f.fold_variable(v)), - TypedStatement::Assertion(e) => TypedStatement::Assertion(f.fold_boolean_expression(e)), + TypedStatement::Assertion(e, m) => { + TypedStatement::Assertion(f.fold_boolean_expression(e), m) + } TypedStatement::For(v, from, to, statements) => TypedStatement::For( f.fold_variable(v), f.fold_uint_expression(from), diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index b31dfeee1..3b4a90394 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -24,6 +24,7 @@ pub use self::types::{ DeclarationStructType, DeclarationType, GArrayType, GStructType, GType, GenericIdentifier, IntoTypes, Signature, StructType, Type, Types, UBitwidth, }; +use crate::parser::Position; use crate::typed_absy::types::ConcreteGenericsAssignment; pub use self::variable::{ConcreteVariable, DeclarationVariable, GVariable, Variable}; @@ -485,6 +486,24 @@ impl<'ast, T: fmt::Display> fmt::Display for TypedAssignee<'ast, T> { } } +#[derive(Clone, Debug, PartialEq, Hash, Eq, Default)] +pub struct AssertionMetadata { + pub file: String, + pub position: Position, + pub message: Option, +} + +impl fmt::Display for AssertionMetadata { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Assertion failed at {}:{}", self.file, self.position)?; + if self.message.is_some() { + write!(f, ": \"{}\"", self.message.as_ref().unwrap()) + } else { + write!(f, "") + } + } +} + /// A statement in a `TypedFunction` #[allow(clippy::large_enum_variant)] #[derive(Clone, PartialEq, Debug, Hash, Eq)] @@ -492,7 +511,7 @@ pub enum TypedStatement<'ast, T> { Return(Vec>), Definition(TypedAssignee<'ast, T>, TypedExpression<'ast, T>), Declaration(Variable<'ast, T>), - Assertion(BooleanExpression<'ast, T>), + Assertion(BooleanExpression<'ast, T>, Option), For( Variable<'ast, T>, UExpression<'ast, T>, @@ -540,7 +559,15 @@ impl<'ast, T: fmt::Display> fmt::Display for TypedStatement<'ast, T> { } TypedStatement::Declaration(ref var) => write!(f, "{}", var), TypedStatement::Definition(ref lhs, ref rhs) => write!(f, "{} = {}", lhs, rhs), - TypedStatement::Assertion(ref e) => write!(f, "assert({})", e), + TypedStatement::Assertion(ref e, ref metadata) => { + write!(f, "assert({}", e)?; + let metadata = metadata.as_ref().unwrap(); + if metadata.message.is_some() { + write!(f, ", \"{}\")", metadata.message.as_ref().unwrap()) + } else { + write!(f, ")") + } + } TypedStatement::For(ref var, ref start, ref stop, ref list) => { writeln!(f, "for {} in {}..{} do", var, start, stop)?; for l in list { diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index c85e97a7d..831e7af6e 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -444,7 +444,9 @@ pub fn fold_statement<'ast, T: Field, F: ResultFolder<'ast, T>>( TypedStatement::Definition(f.fold_assignee(a)?, f.fold_expression(e)?) } TypedStatement::Declaration(v) => TypedStatement::Declaration(f.fold_variable(v)?), - TypedStatement::Assertion(e) => TypedStatement::Assertion(f.fold_boolean_expression(e)?), + TypedStatement::Assertion(e, m) => { + TypedStatement::Assertion(f.fold_boolean_expression(e)?, m) + } TypedStatement::For(v, from, to, statements) => TypedStatement::For( f.fold_variable(v)?, f.fold_uint_expression(from)?, diff --git a/zokrates_core/src/zir/folder.rs b/zokrates_core/src/zir/folder.rs index b8f55e8d1..dbf6011fc 100644 --- a/zokrates_core/src/zir/folder.rs +++ b/zokrates_core/src/zir/folder.rs @@ -115,7 +115,7 @@ pub fn fold_statement<'ast, T: Field, F: Folder<'ast, T>>( .flat_map(|e| f.fold_statement(e)) .collect(), ), - ZirStatement::Assertion(e) => ZirStatement::Assertion(f.fold_boolean_expression(e)), + ZirStatement::Assertion(e, m) => ZirStatement::Assertion(f.fold_boolean_expression(e), m), ZirStatement::MultipleDefinition(variables, elist) => ZirStatement::MultipleDefinition( variables.into_iter().map(|v| f.fold_variable(v)).collect(), f.fold_expression_list(elist), diff --git a/zokrates_core/src/zir/mod.rs b/zokrates_core/src/zir/mod.rs index db5ab4a69..bc54c58aa 100644 --- a/zokrates_core/src/zir/mod.rs +++ b/zokrates_core/src/zir/mod.rs @@ -21,6 +21,7 @@ use zokrates_field::Field; pub use self::folder::Folder; pub use self::identifier::{Identifier, SourceIdentifier}; +use crate::typed_absy::AssertionMetadata; /// A typed program as a collection of modules, one of them being the main #[derive(PartialEq, Debug)] @@ -87,7 +88,7 @@ impl<'ast, T: fmt::Debug> fmt::Debug for ZirFunction<'ast, T> { pub type ZirAssignee<'ast> = Variable<'ast>; /// A statement in a `ZirFunction` -#[derive(Clone, PartialEq, Hash, Eq)] +#[derive(Clone, PartialEq, Hash, Eq, Debug)] pub enum ZirStatement<'ast, T> { Return(Vec>), Definition(ZirAssignee<'ast>, ZirExpression<'ast, T>), @@ -96,37 +97,10 @@ pub enum ZirStatement<'ast, T> { Vec>, Vec>, ), - Assertion(BooleanExpression<'ast, T>), + Assertion(BooleanExpression<'ast, T>, Option), MultipleDefinition(Vec>, ZirExpressionList<'ast, T>), } -impl<'ast, T: fmt::Debug> fmt::Debug for ZirStatement<'ast, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - ZirStatement::Return(ref exprs) => { - write!(f, "Return(")?; - for (i, expr) in exprs.iter().enumerate() { - write!(f, "{:?}", expr)?; - if i < exprs.len() - 1 { - write!(f, ", ")?; - } - } - write!(f, ")") - } - ZirStatement::Definition(ref consequence, ref alternative) => { - write!(f, "Definition({:?}, {:?})", consequence, alternative) - } - ZirStatement::IfElse(ref condition, ref lhs, ref rhs) => { - write!(f, "IfElse({:?}, {:?}, {:?})", condition, lhs, rhs) - } - ZirStatement::Assertion(ref e) => write!(f, "Assertion({:?})", e), - ZirStatement::MultipleDefinition(ref lhs, ref rhs) => { - write!(f, "MultipleDefinition({:?}, {:?})", lhs, rhs) - } - } - } -} - impl<'ast, T: fmt::Display> fmt::Display for ZirStatement<'ast, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -158,7 +132,15 @@ impl<'ast, T: fmt::Display> fmt::Display for ZirStatement<'ast, T> { .join("\n") ) } - ZirStatement::Assertion(ref e) => write!(f, "assert({})", e), + ZirStatement::Assertion(ref e, ref metadata) => { + write!(f, "assert({}", e)?; + let metadata = metadata.as_ref().unwrap(); + if metadata.message.is_some() { + write!(f, ", \"{}\")", metadata.message.as_ref().unwrap()) + } else { + write!(f, ")") + } + } ZirStatement::MultipleDefinition(ref ids, ref rhs) => { for (i, id) in ids.iter().enumerate() { write!(f, "{}", id)?; diff --git a/zokrates_core/src/zir/result_folder.rs b/zokrates_core/src/zir/result_folder.rs index 791e16baa..0b566c9c8 100644 --- a/zokrates_core/src/zir/result_folder.rs +++ b/zokrates_core/src/zir/result_folder.rs @@ -137,7 +137,7 @@ pub fn fold_statement<'ast, T: Field, F: ResultFolder<'ast, T>>( .flatten() .collect(), ), - ZirStatement::Assertion(e) => ZirStatement::Assertion(f.fold_boolean_expression(e)?), + ZirStatement::Assertion(e, m) => ZirStatement::Assertion(f.fold_boolean_expression(e)?, m), ZirStatement::MultipleDefinition(variables, elist) => ZirStatement::MultipleDefinition( variables .into_iter() diff --git a/zokrates_core_test/tests/tests/arrays/identity.json b/zokrates_core_test/tests/tests/arrays/identity.json index 62fa6ec45..2b3bfa95b 100644 --- a/zokrates_core_test/tests/tests/arrays/identity.json +++ b/zokrates_core_test/tests/tests/arrays/identity.json @@ -31,7 +31,7 @@ "UnsatisfiedConstraint": { "left": "4", "right": "2", - "message": "Argument bitness check failed" + "error": "ArgumentBitness" } } } diff --git a/zokrates_core_test/tests/tests/arrays/select.json b/zokrates_core_test/tests/tests/arrays/select.json index fff4f17e2..d48fbf75e 100644 --- a/zokrates_core_test/tests/tests/arrays/select.json +++ b/zokrates_core_test/tests/tests/arrays/select.json @@ -42,7 +42,7 @@ "UnsatisfiedConstraint": { "left": "1", "right": "0", - "message": "Out of bounds array access" + "error": "SelectRangeCheck" } } } diff --git a/zokrates_core_test/tests/tests/assert_one.json b/zokrates_core_test/tests/tests/assert_one.json index 290e69e88..3e4f785cc 100644 --- a/zokrates_core_test/tests/tests/assert_one.json +++ b/zokrates_core_test/tests/tests/assert_one.json @@ -11,7 +11,9 @@ "UnsatisfiedConstraint": { "left": "0", "right": "1", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/assert_one.zok:2:2" + } } } } diff --git a/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json b/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json index 89c37f175..1e7ef278f 100644 --- a/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json @@ -13,7 +13,9 @@ "UnsatisfiedConstraint": { "left": "0", "right": "1", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" + } } } } @@ -29,7 +31,9 @@ "UnsatisfiedConstraint": { "left": "1", "right": "0", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" + } } } } @@ -45,7 +49,9 @@ "UnsatisfiedConstraint": { "left": "2", "right": "0", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" + } } } } diff --git a/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json b/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json index 64497465a..952bfff2c 100644 --- a/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json @@ -13,7 +13,9 @@ "UnsatisfiedConstraint": { "left": "0", "right": "1", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/deep_branch.zok:2:5" + } } } } diff --git a/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json b/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json index df455520b..fb1f8c585 100644 --- a/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json @@ -25,7 +25,7 @@ "UnsatisfiedConstraint": { "left": "0", "right": "1", - "message": "Division by zero" + "error": "Inverse" } } } diff --git a/zokrates_core_test/tests/tests/panics/loop_bound.json b/zokrates_core_test/tests/tests/panics/loop_bound.json index cddac3129..fe123a724 100644 --- a/zokrates_core_test/tests/tests/panics/loop_bound.json +++ b/zokrates_core_test/tests/tests/panics/loop_bound.json @@ -13,7 +13,9 @@ "UnsatisfiedConstraint": { "left": "0", "right": "1", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/loop_bound.zok:2:3" + } } } } diff --git a/zokrates_core_test/tests/tests/panics/panic_isolation.json b/zokrates_core_test/tests/tests/panics/panic_isolation.json index 1dc70fd5c..6d7da9525 100644 --- a/zokrates_core_test/tests/tests/panics/panic_isolation.json +++ b/zokrates_core_test/tests/tests/panics/panic_isolation.json @@ -20,7 +20,9 @@ "UnsatisfiedConstraint": { "left": "1", "right": "21888242871839275222246405745257275088548364400416034343698204186575808495577", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:18:5" + } } } } diff --git a/zokrates_core_test/tests/tests/panics/panic_no_isolation.json b/zokrates_core_test/tests/tests/panics/panic_no_isolation.json index 063cb533b..9feb6d3f1 100644 --- a/zokrates_core_test/tests/tests/panics/panic_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/panic_no_isolation.json @@ -20,7 +20,9 @@ "UnsatisfiedConstraint": { "left": "1", "right": "0", - "message": "User assertion failed" + "error": { + "Source": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:14:5" + } } } } diff --git a/zokrates_core_test/tests/tests/structs/identity.json b/zokrates_core_test/tests/tests/structs/identity.json index cce1788de..26cc4b514 100644 --- a/zokrates_core_test/tests/tests/structs/identity.json +++ b/zokrates_core_test/tests/tests/structs/identity.json @@ -31,7 +31,7 @@ "UnsatisfiedConstraint": { "left": "9", "right": "3", - "message": "Argument bitness check failed" + "error": "ArgumentBitness" } } } diff --git a/zokrates_parser/src/zokrates.pest b/zokrates_parser/src/zokrates.pest index ce7499e70..e83b091ed 100644 --- a/zokrates_parser/src/zokrates.pest +++ b/zokrates_parser/src/zokrates.pest @@ -3,13 +3,14 @@ file = { SOI ~ NEWLINE* ~ pragma? ~ NEWLINE* ~ symbol_declaration* ~ EOI } pragma = { "#pragma" ~ "curve" ~ curve } curve = @{ (ASCII_ALPHANUMERIC | "_") * } +string = @{(!"\"" ~ ANY)*} +quoted_string = _{ "\"" ~ string ~ "\"" } symbol_declaration = { (import_directive | ty_struct_definition | const_definition | function_definition) ~ NEWLINE* } import_directive = { main_import_directive | from_import_directive } -from_import_directive = { "from" ~ "\"" ~ import_source ~ "\"" ~ "import" ~ import_symbol_list ~ NEWLINE* } -main_import_directive = { "import" ~ "\"" ~ import_source ~ "\"" ~ ("as" ~ identifier)? ~ NEWLINE+ } -import_source = @{(!"\"" ~ ANY)*} +from_import_directive = { "from" ~ quoted_string ~ "import" ~ import_symbol_list ~ NEWLINE* } +main_import_directive = { "import" ~ quoted_string ~ ("as" ~ identifier)? ~ NEWLINE+ } import_symbol = { identifier ~ ("as" ~ identifier)? } import_symbol_list = _{ import_symbol ~ ("," ~ import_symbol)* } function_definition = {"def" ~ identifier ~ constant_generics_declaration? ~ "(" ~ parameter_list ~ ")" ~ return_types ~ ":" ~ NEWLINE* ~ statement* } @@ -55,7 +56,7 @@ statement = { (return_statement // does not require subsequent newline iteration_statement = { "for" ~ ty ~ identifier ~ "in" ~ expression ~ ".." ~ expression ~ "do" ~ NEWLINE* ~ statement* ~ "endfor"} return_statement = { "return" ~ expression_list} definition_statement = { typed_identifier_or_assignee_list ~ "=" ~ expression } // declare and assign, so only identifiers are allowed, unlike `assignment_statement` -expression_statement = {"assert" ~ "(" ~ expression ~ ")"} +expression_statement = {"assert" ~ "(" ~ expression ~ ("," ~ quoted_string)? ~ ")"} typed_identifier_or_assignee_list = _{ typed_identifier_or_assignee ~ ("," ~ typed_identifier_or_assignee)* } typed_identifier_or_assignee = { typed_identifier | assignee } // we don't use { ty? ~ identifier } as with a single token, it gets parsed as `ty` but we want `identifier` diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index 22b4d0d78..fb6e8096e 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -13,7 +13,7 @@ pub use ast::{ CallAccess, ConstantDefinition, ConstantGenericValue, DecimalLiteralExpression, DecimalNumber, DecimalSuffix, DefinitionStatement, ExplicitGenerics, Expression, FieldType, File, FromExpression, FunctionDefinition, HexLiteralExpression, HexNumberExpression, - IdentifierExpression, ImportDirective, ImportSource, ImportSymbol, InlineArrayExpression, + IdentifierExpression, ImportDirective, ImportSymbol, InlineArrayExpression, InlineStructExpression, InlineStructMember, IterationStatement, LiteralExpression, Parameter, PostfixExpression, Range, RangeOrExpression, ReturnStatement, Span, Spread, SpreadOrExpression, Statement, StructDefinition, StructField, SymbolDeclaration, TernaryExpression, ToExpression, @@ -194,7 +194,7 @@ mod ast { #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::main_import_directive))] pub struct MainImportDirective<'ast> { - pub source: ImportSource<'ast>, + pub source: AnyString<'ast>, pub alias: Option>, #[pest_ast(outer())] pub span: Span<'ast>, @@ -212,21 +212,12 @@ mod ast { #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::from_import_directive))] pub struct FromImportDirective<'ast> { - pub source: ImportSource<'ast>, + pub source: AnyString<'ast>, pub symbols: Vec>, #[pest_ast(outer())] pub span: Span<'ast>, } - #[derive(Debug, FromPest, PartialEq, Clone)] - #[pest_ast(rule(Rule::import_source))] - pub struct ImportSource<'ast> { - #[pest_ast(outer(with(span_into_str)))] - pub value: String, - #[pest_ast(outer())] - pub span: Span<'ast>, - } - #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::ty))] pub enum Type<'ast> { @@ -357,10 +348,20 @@ mod ast { pub span: Span<'ast>, } + #[derive(Debug, FromPest, PartialEq, Clone)] + #[pest_ast(rule(Rule::string))] + pub struct AnyString<'ast> { + #[pest_ast(outer(with(span_into_str)))] + pub value: String, + #[pest_ast(outer())] + pub span: Span<'ast>, + } + #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::expression_statement))] pub struct AssertionStatement<'ast> { pub expression: Expression<'ast>, + pub message: Option>, #[pest_ast(outer())] pub span: Span<'ast>, } @@ -1076,7 +1077,7 @@ mod tests { pragma: None, declarations: vec![ SymbolDeclaration::Import(ImportDirective::Main(MainImportDirective { - source: ImportSource { + source: AnyString { value: String::from("foo"), span: Span::new(&source, 8, 11).unwrap() }, @@ -1137,7 +1138,7 @@ mod tests { pragma: None, declarations: vec![ SymbolDeclaration::Import(ImportDirective::Main(MainImportDirective { - source: ImportSource { + source: AnyString { value: String::from("foo"), span: Span::new(&source, 8, 11).unwrap() }, @@ -1222,7 +1223,7 @@ mod tests { pragma: None, declarations: vec![ SymbolDeclaration::Import(ImportDirective::Main(MainImportDirective { - source: ImportSource { + source: AnyString { value: String::from("foo"), span: Span::new(&source, 8, 11).unwrap() }, From 7cc8279460021ddab517aed3afc4b407e08efef5 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 20 Sep 2021 18:24:38 +0200 Subject: [PATCH 14/83] add changelog --- changelogs/unreleased/1012-dark64 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1012-dark64 diff --git a/changelogs/unreleased/1012-dark64 b/changelogs/unreleased/1012-dark64 new file mode 100644 index 000000000..7c55ef914 --- /dev/null +++ b/changelogs/unreleased/1012-dark64 @@ -0,0 +1 @@ +Add optional message to assert statement \ No newline at end of file From 302f561993a3f76124aef59c39a81646248aac98 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 20 Sep 2021 18:30:03 +0200 Subject: [PATCH 15/83] fix indentation --- .../tests/tests/assert_one.json | 40 +++++++++---------- .../conditional_bound_throw_no_isolation.json | 38 +++++++++--------- .../panics/deep_branch_no_isolation.json | 14 +++---- .../panics/internal_panic_no_isolation.json | 20 +++++----- .../tests/tests/panics/loop_bound.json | 20 +++++----- .../tests/tests/panics/panic_isolation.json | 30 +++++++------- .../tests/panics/panic_no_isolation.json | 14 +++---- 7 files changed, 88 insertions(+), 88 deletions(-) diff --git a/zokrates_core_test/tests/tests/assert_one.json b/zokrates_core_test/tests/tests/assert_one.json index 3e4f785cc..7791e6bb8 100644 --- a/zokrates_core_test/tests/tests/assert_one.json +++ b/zokrates_core_test/tests/tests/assert_one.json @@ -1,22 +1,22 @@ { - "entry_point": "./tests/tests/assert_one.zok", - "curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"], - "tests": [ - { - "input": { - "values": ["0"] - }, - "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "0", - "right": "1", - "error": { - "Source": "Assertion failed at ./tests/tests/assert_one.zok:2:2" - } - } - } - } - } - ] + "entry_point": "./tests/tests/assert_one.zok", + "curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"], + "tests": [ + { + "input": { + "values": ["0"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "left": "0", + "right": "1", + "error": { + "Source": "Assertion failed at ./tests/tests/assert_one.zok:2:2" + } + } + } + } + } + ] } diff --git a/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json b/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json index 1e7ef278f..4402beb1f 100644 --- a/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json @@ -1,7 +1,7 @@ { "entry_point": "./tests/tests/panics/conditional_bound_throw.zok", "curves": ["Bn128"], - "tests": [ + "tests": [ { "input": { "values": [ @@ -9,15 +9,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "0", - "right": "1", + "Err": { + "UnsatisfiedConstraint": { + "left": "0", + "right": "1", "error": { "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" } - } - } + } + } } }, { @@ -27,15 +27,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "1", - "right": "0", + "Err": { + "UnsatisfiedConstraint": { + "left": "1", + "right": "0", "error": { "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" } - } - } + } + } } }, { @@ -45,15 +45,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "2", - "right": "0", + "Err": { + "UnsatisfiedConstraint": { + "left": "2", + "right": "0", "error": { "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" } - } - } + } + } } } ] diff --git a/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json b/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json index 952bfff2c..d89b6a1df 100644 --- a/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json @@ -1,7 +1,7 @@ { "entry_point": "./tests/tests/panics/deep_branch.zok", "curves": ["Bn128"], - "tests": [ + "tests": [ { "input": { "values": [ @@ -9,15 +9,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "0", - "right": "1", + "Err": { + "UnsatisfiedConstraint": { + "left": "0", + "right": "1", "error": { "Source": "Assertion failed at ./tests/tests/panics/deep_branch.zok:2:5" } - } - } + } + } } } ] diff --git a/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json b/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json index fb1f8c585..46e3e2751 100644 --- a/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/internal_panic_no_isolation.json @@ -1,7 +1,7 @@ { "entry_point": "./tests/tests/panics/internal_panic.zok", "curves": ["Bn128"], - "tests": [ + "tests": [ { "input": { "values": [ @@ -9,9 +9,9 @@ ] }, "output": { - "Ok": { - "values": ["1"] - } + "Ok": { + "values": ["1"] + } } }, { @@ -21,13 +21,13 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "0", - "right": "1", + "Err": { + "UnsatisfiedConstraint": { + "left": "0", + "right": "1", "error": "Inverse" - } - } + } + } } } ] diff --git a/zokrates_core_test/tests/tests/panics/loop_bound.json b/zokrates_core_test/tests/tests/panics/loop_bound.json index fe123a724..a3599f3ba 100644 --- a/zokrates_core_test/tests/tests/panics/loop_bound.json +++ b/zokrates_core_test/tests/tests/panics/loop_bound.json @@ -1,7 +1,7 @@ { "entry_point": "./tests/tests/panics/loop_bound.zok", "curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"], - "tests": [ + "tests": [ { "input": { "values": [ @@ -9,15 +9,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "0", - "right": "1", + "Err": { + "UnsatisfiedConstraint": { + "left": "0", + "right": "1", "error": { "Source": "Assertion failed at ./tests/tests/panics/loop_bound.zok:2:3" } - } - } + } + } } }, { @@ -27,9 +27,9 @@ ] }, "output": { - "Ok": { - "values": [] - } + "Ok": { + "values": [] + } } } ] diff --git a/zokrates_core_test/tests/tests/panics/panic_isolation.json b/zokrates_core_test/tests/tests/panics/panic_isolation.json index 6d7da9525..703b0deaa 100644 --- a/zokrates_core_test/tests/tests/panics/panic_isolation.json +++ b/zokrates_core_test/tests/tests/panics/panic_isolation.json @@ -5,7 +5,7 @@ "isolate_branches": true }, "curves": ["Bn128"], - "tests": [ + "tests": [ { "input": { "values": [ @@ -16,15 +16,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "1", - "right": "21888242871839275222246405745257275088548364400416034343698204186575808495577", + "Err": { + "UnsatisfiedConstraint": { + "left": "1", + "right": "21888242871839275222246405745257275088548364400416034343698204186575808495577", "error": { "Source": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:18:5" } - } - } + } + } } }, { @@ -37,14 +37,14 @@ ] }, "output": { - "Ok": { - "values": [ + "Ok": { + "values": [ "1", "1", "1", "1" - ] - } + ] + } } }, { @@ -57,14 +57,14 @@ ] }, "output": { - "Ok": { - "values": [ + "Ok": { + "values": [ "0", "2", "2", "0" - ] - } + ] + } } } ] diff --git a/zokrates_core_test/tests/tests/panics/panic_no_isolation.json b/zokrates_core_test/tests/tests/panics/panic_no_isolation.json index 9feb6d3f1..f2b562e80 100644 --- a/zokrates_core_test/tests/tests/panics/panic_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/panic_no_isolation.json @@ -5,7 +5,7 @@ "isolate_branches": false }, "curves": ["Bn128"], - "tests": [ + "tests": [ { "input": { "values": [ @@ -16,15 +16,15 @@ ] }, "output": { - "Err": { - "UnsatisfiedConstraint": { - "left": "1", - "right": "0", + "Err": { + "UnsatisfiedConstraint": { + "left": "1", + "right": "0", "error": { "Source": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:14:5" } - } - } + } + } } } ] From ae825b7f36334974d57b298c182c1aed326ac86d Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 21 Sep 2021 14:01:49 +0300 Subject: [PATCH 16/83] update highlighters --- zokrates_parser/src/ace_mode/index.js | 2 +- .../src/textmate/zokrates.tmLanguage.yaml | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/zokrates_parser/src/ace_mode/index.js b/zokrates_parser/src/ace_mode/index.js index 9778609bd..b576695f8 100644 --- a/zokrates_parser/src/ace_mode/index.js +++ b/zokrates_parser/src/ace_mode/index.js @@ -37,7 +37,7 @@ ace.define("ace/mode/zokrates_highlight_rules",["require","exports","module","ac var ZoKratesHighlightRules = function () { var keywords = ( - "assert|as|bool|byte|const|def|do|else|endfor|export|false|field|for|if|then|fi|import|from|in|private|public|return|struct|true|u8|u16|u32|u64" + "assert|as|bool|byte|const|def|do|else|endfor|export|false|field|for|if|then|fi|import|from|in|private|public|return|struct|true|type|u8|u16|u32|u64" ); var keywordMapper = this.createKeywordMapper({ diff --git a/zokrates_parser/src/textmate/zokrates.tmLanguage.yaml b/zokrates_parser/src/textmate/zokrates.tmLanguage.yaml index 2a2e9fb68..bb2000570 100644 --- a/zokrates_parser/src/textmate/zokrates.tmLanguage.yaml +++ b/zokrates_parser/src/textmate/zokrates.tmLanguage.yaml @@ -202,19 +202,23 @@ repository: - comment: 'control flow keywords' name: keyword.control.zokrates - match: \b(do|else|for|do|endfor|if|then|fi|return|assert)\b + match: \b(for|in|do|endfor|if|then|else|fi|return|assert)\b - comment: 'storage keywords' name: storage.type.zokrates match: \b(struct)\b - - comment: const + comment: 'const keyword' name: keyword.other.const.zokrates - match: \bconst\b + match: \b(const)\b - - comment: def + comment: 'type keyword' + name: keyword.other.type.zokrates + match: \b(type)\b + - + comment: 'def keyword' name: keyword.other.def.zokrates - match: \bdef\b + match: \b(def)\b - comment: 'import keywords' name: keyword.other.import.zokrates From fad1b2fa3773e8b3952d683904f2f34e77b5021d Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 21 Sep 2021 15:14:26 +0300 Subject: [PATCH 17/83] clean, use u32 for concrete array sizes, introduce functions to map using generic assignments --- zokrates_core/src/embed.rs | 24 ++-- .../static_analysis/flatten_complex_types.rs | 15 +-- .../src/static_analysis/struct_concretizer.rs | 11 +- .../static_analysis/variable_write_remover.rs | 7 +- zokrates_core/src/typed_absy/mod.rs | 14 +-- zokrates_core/src/typed_absy/types.rs | 112 ++++++++---------- zokrates_core/src/typed_absy/uint.rs | 10 +- zokrates_core/src/typed_absy/variable.rs | 2 +- zokrates_core/src/zir/identifier.rs | 2 +- 9 files changed, 80 insertions(+), 117 deletions(-) diff --git a/zokrates_core/src/embed.rs b/zokrates_core/src/embed.rs index 3ee07660d..88f0604c1 100644 --- a/zokrates_core/src/embed.rs +++ b/zokrates_core/src/embed.rs @@ -94,59 +94,59 @@ impl FlatEmbed { .inputs(vec![DeclarationType::uint(8)]) .outputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 8usize, + 8u32, ))]), FlatEmbed::U16ToBits => DeclarationSignature::new() .inputs(vec![DeclarationType::uint(16)]) .outputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 16usize, + 16u32, ))]), FlatEmbed::U32ToBits => DeclarationSignature::new() .inputs(vec![DeclarationType::uint(32)]) .outputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 32usize, + 32u32, ))]), FlatEmbed::U64ToBits => DeclarationSignature::new() .inputs(vec![DeclarationType::uint(64)]) .outputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 64usize, + 64u32, ))]), FlatEmbed::U8FromBits => DeclarationSignature::new() .outputs(vec![DeclarationType::uint(8)]) .inputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 8usize, + 8u32, ))]), FlatEmbed::U16FromBits => DeclarationSignature::new() .outputs(vec![DeclarationType::uint(16)]) .inputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 16usize, + 16u32, ))]), FlatEmbed::U32FromBits => DeclarationSignature::new() .outputs(vec![DeclarationType::uint(32)]) .inputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 32usize, + 32u32, ))]), FlatEmbed::U64FromBits => DeclarationSignature::new() .outputs(vec![DeclarationType::uint(64)]) .inputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 64usize, + 64u32, ))]), #[cfg(feature = "bellman")] FlatEmbed::Sha256Round => DeclarationSignature::new() .inputs(vec![ - DeclarationType::array((DeclarationType::Boolean, 512usize)), - DeclarationType::array((DeclarationType::Boolean, 256usize)), + DeclarationType::array((DeclarationType::Boolean, 512u32)), + DeclarationType::array((DeclarationType::Boolean, 256u32)), ]) .outputs(vec![DeclarationType::array(( DeclarationType::Boolean, - 256usize, + 256u32, ))]), #[cfg(feature = "ark")] FlatEmbed::SnarkVerifyBls12377 => DeclarationSignature::new() @@ -168,7 +168,7 @@ impl FlatEmbed { index: 0, }, )), // inputs - DeclarationType::array((DeclarationType::FieldElement, 8usize)), // proof + DeclarationType::array((DeclarationType::FieldElement, 8u32)), // proof DeclarationType::array(( DeclarationType::FieldElement, GenericIdentifier { diff --git a/zokrates_core/src/static_analysis/flatten_complex_types.rs b/zokrates_core/src/static_analysis/flatten_complex_types.rs index db213ca6c..c9fcfea3b 100644 --- a/zokrates_core/src/static_analysis/flatten_complex_types.rs +++ b/zokrates_core/src/static_analysis/flatten_complex_types.rs @@ -340,7 +340,7 @@ impl<'ast, T: Field> Flattener { &mut self, statements_buffer: &mut Vec>, ty: &typed_absy::types::ConcreteType, - size: usize, + size: u32, e: typed_absy::ArrayExpressionInner<'ast, T>, ) -> Vec> { fold_array_expression_inner(self, statements_buffer, ty, size, e) @@ -404,7 +404,7 @@ fn fold_array_expression_inner<'ast, T: Field>( f: &mut Flattener, statements_buffer: &mut Vec>, ty: &typed_absy::types::ConcreteType, - size: usize, + size: u32, array: typed_absy::ArrayExpressionInner<'ast, T>, ) -> Vec> { match array { @@ -437,7 +437,7 @@ fn fold_array_expression_inner<'ast, T: Field>( .flat_map(|e| f.fold_expression_or_spread(statements_buffer, e)) .collect(); - assert_eq!(exprs.len(), size * ty.get_primitive_count()); + assert_eq!(exprs.len(), size as usize * ty.get_primitive_count()); exprs } @@ -458,7 +458,7 @@ fn fold_array_expression_inner<'ast, T: Field>( match (from.into_inner(), to.into_inner()) { (zir::UExpressionInner::Value(from), zir::UExpressionInner::Value(to)) => { - assert_eq!(size, to.saturating_sub(from) as usize); + assert_eq!(size, to.saturating_sub(from) as u32); let element_size = ty.get_primitive_count(); let start = from as usize * element_size; @@ -1108,10 +1108,7 @@ fn fold_array_expression<'ast, T: Field>( statements_buffer: &mut Vec>, e: typed_absy::ArrayExpression<'ast, T>, ) -> Vec> { - let size = match e.size().into_inner() { - typed_absy::UExpressionInner::Value(v) => v, - _ => unreachable!(), - } as usize; + let size: u32 = e.size().try_into().unwrap(); f.fold_array_expression_inner( statements_buffer, &typed_absy::types::ConcreteType::try_from(e.inner_type().clone()).unwrap(), @@ -1125,8 +1122,6 @@ fn fold_struct_expression<'ast, T: Field>( statements_buffer: &mut Vec>, e: typed_absy::StructExpression<'ast, T>, ) -> Vec> { - println!("{:#?}", e.ty()); - f.fold_struct_expression_inner( statements_buffer, &typed_absy::types::ConcreteStructType::try_from(e.ty().clone()).unwrap(), diff --git a/zokrates_core/src/static_analysis/struct_concretizer.rs b/zokrates_core/src/static_analysis/struct_concretizer.rs index 874a4b361..2b137357b 100644 --- a/zokrates_core/src/static_analysis/struct_concretizer.rs +++ b/zokrates_core/src/static_analysis/struct_concretizer.rs @@ -36,14 +36,11 @@ impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast> { &mut self, ty: DeclarationStructType<'ast>, ) -> DeclarationStructType<'ast> { - let concrete_generics: Vec<_> = ty + let concrete_generics: Vec = ty .generics - .iter() - .map(|g| match g.as_ref().unwrap() { - DeclarationConstant::Generic(s) => self.generics.0.get(&s).cloned().unwrap(), - DeclarationConstant::Concrete(s) => *s as usize, - DeclarationConstant::Constant(..) => unreachable!(), - }) + .clone() + .into_iter() + .map(|g| g.unwrap().map_concrete(&self.generics).unwrap()) .collect(); let concrete_generics_map: ConcreteGenericsAssignment = GGenericsAssignment( diff --git a/zokrates_core/src/static_analysis/variable_write_remover.rs b/zokrates_core/src/static_analysis/variable_write_remover.rs index 82cc206ec..e66a44613 100644 --- a/zokrates_core/src/static_analysis/variable_write_remover.rs +++ b/zokrates_core/src/static_analysis/variable_write_remover.rs @@ -37,10 +37,9 @@ impl<'ast> VariableWriteRemover { let inner_ty = base.inner_type(); let size = base.size(); - let size = match size.as_inner() { - UExpressionInner::Value(v) => *v as u32, - _ => unreachable!(), - }; + use std::convert::TryInto; + + let size: u32 = size.try_into().unwrap(); let head = indices.remove(0); let tail = indices; diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index 29a8dfb69..b31dfeee1 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -663,19 +663,7 @@ impl<'ast, T: fmt::Display> fmt::Display for StructExpression<'ast, T> { StructExpressionInner::IfElse(ref c) => write!(f, "{}", c), StructExpressionInner::Member(ref m) => write!(f, "{}", m), StructExpressionInner::Select(ref select) => write!(f, "{}", select), - }?; - - write!( - f, - "/* {} {{{}}} */", - self.ty, - self.ty - .members - .iter() - .map(|m| format!("{}: {}", m.id, m.ty)) - .collect::>() - .join(", ") - ) + } } } diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 94a6acc19..608cdb883 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -137,6 +137,32 @@ pub enum DeclarationConstant<'ast> { Constant(CanonicalConstantIdentifier<'ast>), } +impl<'ast> DeclarationConstant<'ast> { + pub fn map> + From + Clone>( + self, + generics: &GGenericsAssignment<'ast, S>, + ) -> Result> { + match self { + DeclarationConstant::Generic(g) => generics.0.get(&g).cloned().ok_or(g), + DeclarationConstant::Concrete(v) => Ok(v.into()), + DeclarationConstant::Constant(c) => Ok(c.into()), + } + } + + pub fn map_concrete + Clone>( + self, + generics: &GGenericsAssignment<'ast, S>, + ) -> Result> { + match self { + DeclarationConstant::Constant(_) => unreachable!( + "called map_concrete on a constant, it should have been resolved before" + ), + DeclarationConstant::Generic(g) => generics.0.get(&g).cloned().ok_or(g), + DeclarationConstant::Concrete(v) => Ok(v.into()), + } + } +} + impl<'ast, T> PartialEq> for DeclarationConstant<'ast> { fn eq(&self, other: &UExpression<'ast, T>) -> bool { match (self, other.as_inner()) { @@ -158,12 +184,6 @@ impl<'ast> From for DeclarationConstant<'ast> { } } -impl<'ast> From for DeclarationConstant<'ast> { - fn from(e: usize) -> Self { - DeclarationConstant::Concrete(e as u32) - } -} - impl<'ast> From> for DeclarationConstant<'ast> { fn from(e: GenericIdentifier<'ast>) -> Self { DeclarationConstant::Generic(e) @@ -180,8 +200,8 @@ impl<'ast> fmt::Display for DeclarationConstant<'ast> { } } -impl<'ast, T> From for UExpression<'ast, T> { - fn from(i: usize) -> Self { +impl<'ast, T> From for UExpression<'ast, T> { + fn from(i: u32) -> Self { UExpressionInner::Value(i as u128).annotate(UBitwidth::B32) } } @@ -202,25 +222,14 @@ impl<'ast, T> From> for UExpression<'ast, T> { } } -impl<'ast, T> TryInto for UExpression<'ast, T> { +impl<'ast, T> TryInto for UExpression<'ast, T> { type Error = SpecializationError; - fn try_into(self) -> Result { + fn try_into(self) -> Result { assert_eq!(self.bitwidth, UBitwidth::B32); match self.into_inner() { - UExpressionInner::Value(v) => Ok(v as usize), - _ => Err(SpecializationError), - } - } -} - -impl<'ast> TryInto for DeclarationConstant<'ast> { - type Error = SpecializationError; - - fn try_into(self) -> Result { - match self { - DeclarationConstant::Concrete(v) => Ok(v as usize), + UExpressionInner::Value(v) => Ok(v as u32), _ => Err(SpecializationError), } } @@ -237,7 +246,7 @@ pub struct GStructMember { } pub type DeclarationStructMember<'ast> = GStructMember>; -pub type ConcreteStructMember = GStructMember; +pub type ConcreteStructMember = GStructMember; pub type StructMember<'ast, T> = GStructMember>; impl<'ast, S, R: PartialEq> PartialEq> for GStructMember { @@ -277,7 +286,7 @@ pub struct GArrayType { } pub type DeclarationArrayType<'ast> = GArrayType>; -pub type ConcreteArrayType = GArrayType; +pub type ConcreteArrayType = GArrayType; pub type ArrayType<'ast, T> = GArrayType>; impl<'ast, S, R: PartialEq> PartialEq> for GArrayType { @@ -359,7 +368,7 @@ pub struct GStructType { } pub type DeclarationStructType<'ast> = GStructType>; -pub type ConcreteStructType = GStructType; +pub type ConcreteStructType = GStructType; pub type StructType<'ast, T> = GStructType>; impl<'ast, S, R: PartialEq> PartialEq> for GStructType { @@ -615,7 +624,7 @@ impl<'de, S: Deserialize<'de>> Deserialize<'de> for GType { } pub type DeclarationType<'ast> = GType>; -pub type ConcreteType = GType; +pub type ConcreteType = GType; pub type Type<'ast, T> = GType>; impl<'ast, S, R: PartialEq> PartialEq> for GType { @@ -804,7 +813,9 @@ impl ConcreteType { GType::FieldElement => 1, GType::Boolean => 1, GType::Uint(_) => 1, - GType::Array(array_type) => array_type.size * array_type.ty.get_primitive_count(), + GType::Array(array_type) => { + array_type.size as usize * array_type.ty.get_primitive_count() + } GType::Int => unreachable!(), GType::Struct(struct_type) => struct_type .iter() @@ -824,7 +835,7 @@ pub struct GFunctionKey<'ast, S> { } pub type DeclarationFunctionKey<'ast> = GFunctionKey<'ast, DeclarationConstant<'ast>>; -pub type ConcreteFunctionKey<'ast> = GFunctionKey<'ast, usize>; +pub type ConcreteFunctionKey<'ast> = GFunctionKey<'ast, u32>; pub type FunctionKey<'ast, T> = GFunctionKey<'ast, UExpression<'ast, T>>; impl<'ast, S: fmt::Display> fmt::Display for GFunctionKey<'ast, S> { @@ -836,7 +847,7 @@ impl<'ast, S: fmt::Display> fmt::Display for GFunctionKey<'ast, S> { #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub struct GGenericsAssignment<'ast, S>(pub BTreeMap, S>); -pub type ConcreteGenericsAssignment<'ast> = GGenericsAssignment<'ast, usize>; +pub type ConcreteGenericsAssignment<'ast> = GGenericsAssignment<'ast, u32>; pub type GenericsAssignment<'ast, T> = GGenericsAssignment<'ast, UExpression<'ast, T>>; impl<'ast, S> Default for GGenericsAssignment<'ast, S> { @@ -936,7 +947,7 @@ impl<'ast> ConcreteFunctionKey<'ast> { use std::collections::btree_map::Entry; -pub fn check_type<'ast, S: Clone + PartialEq + PartialEq>( +pub fn check_type<'ast, S: Clone + PartialEq + PartialEq>( decl_ty: &DeclarationType<'ast>, ty: >ype, constants: &mut GGenericsAssignment<'ast, S>, @@ -957,7 +968,7 @@ pub fn check_type<'ast, S: Clone + PartialEq + PartialEq>( true } }, - DeclarationConstant::Concrete(s0) => s1 == *s0 as usize, + DeclarationConstant::Concrete(s0) => s1 == *s0 as u32, // in the case of a constant, we do not know the value yet, so we optimistically assume it's correct // if it does not match, it will be caught during inlining DeclarationConstant::Constant(..) => true, @@ -1002,11 +1013,7 @@ pub fn specialize_declaration_type< DeclarationType::Array(t0) => { let ty = box specialize_declaration_type(*t0.ty, &generics)?; - let size = match t0.size { - DeclarationConstant::Generic(s) => generics.0.get(&s).cloned().ok_or(s), - DeclarationConstant::Concrete(s) => Ok(s.into()), - DeclarationConstant::Constant(c) => Ok(c.into()), - }?; + let size = t0.size.map(generics)?; GType::Array(GArrayType { size, ty }) } @@ -1025,14 +1032,7 @@ pub fn specialize_declaration_type< .map(|(index, g)| { ( GenericIdentifier::with_name("dummy").index(index), - g.map(|g| match g { - DeclarationConstant::Generic(s) => { - generics.0.get(&s).cloned().unwrap() - } - DeclarationConstant::Concrete(s) => s.into(), - DeclarationConstant::Constant(c) => c.into(), - }) - .unwrap(), + g.map(|g| g.map(generics).unwrap()).unwrap(), ) }) .collect(), @@ -1052,17 +1052,7 @@ pub fn specialize_declaration_type< .generics .into_iter() .map(|g| match g { - Some(constant) => match constant { - DeclarationConstant::Generic(s) => { - generics.0.get(&s).cloned().ok_or(s).map(Some) - } - DeclarationConstant::Concrete(s) => Ok(Some(s.into())), - DeclarationConstant::Constant(..) => { - unreachable!( - "identifiers should have been removed in constant inlining" - ) - } - }, + Some(constant) => constant.map(generics).map(Some), _ => Ok(None), }) .collect::>()?, @@ -1127,7 +1117,7 @@ pub mod signature { } pub type DeclarationSignature<'ast> = GSignature>; - pub type ConcreteSignature = GSignature; + pub type ConcreteSignature = GSignature; pub type Signature<'ast, T> = GSignature>; impl<'ast> PartialEq> for ConcreteSignature { @@ -1140,7 +1130,7 @@ pub mod signature { .iter() .chain(other.outputs.iter()) .zip(self.inputs.iter().chain(self.outputs.iter())) - .all(|(decl_ty, ty)| check_type::(decl_ty, ty, &mut constants)) + .all(|(decl_ty, ty)| check_type::(decl_ty, ty, &mut constants)) } } @@ -1165,7 +1155,7 @@ pub mod signature { constants.0.extend( decl_generics .zip(values.into_iter()) - .filter_map(|(g, v)| v.map(|v| (g, v as usize))), + .filter_map(|(g, v)| v.map(|v| (g, v))), ); let condition = self @@ -1488,8 +1478,8 @@ pub mod signature { fn array_slug() { let s = ConcreteSignature::new() .inputs(vec![ - ConcreteType::array((ConcreteType::FieldElement, 42usize)), - ConcreteType::array((ConcreteType::FieldElement, 21usize)), + ConcreteType::array((ConcreteType::FieldElement, 42u32)), + ConcreteType::array((ConcreteType::FieldElement, 21u32)), ]) .outputs(vec![]); @@ -1512,7 +1502,7 @@ mod tests { fn array_display() { // field[1][2] let t = ConcreteType::Array(ConcreteArrayType::new( - ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 2usize)), + ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 2u32)), 1usize, )); assert_eq!(format!("{}", t), "field[1][2]"); diff --git a/zokrates_core/src/typed_absy/uint.rs b/zokrates_core/src/typed_absy/uint.rs index 4620dd7cf..3fab93a80 100644 --- a/zokrates_core/src/typed_absy/uint.rs +++ b/zokrates_core/src/typed_absy/uint.rs @@ -146,12 +146,6 @@ pub struct UExpression<'ast, T> { pub inner: UExpressionInner<'ast, T>, } -impl<'ast, T> From for UExpression<'ast, T> { - fn from(u: u32) -> Self { - UExpressionInner::Value(u as u128).annotate(UBitwidth::B32) - } -} - impl<'ast, T> From for UExpression<'ast, T> { fn from(u: u16) -> Self { UExpressionInner::Value(u as u128).annotate(UBitwidth::B16) @@ -164,8 +158,8 @@ impl<'ast, T> From for UExpression<'ast, T> { } } -impl<'ast, T> PartialEq for UExpression<'ast, T> { - fn eq(&self, other: &usize) -> bool { +impl<'ast, T> PartialEq for UExpression<'ast, T> { + fn eq(&self, other: &u32) -> bool { match self.as_inner() { UExpressionInner::Value(v) => *v == *other as u128, _ => true, diff --git a/zokrates_core/src/typed_absy/variable.rs b/zokrates_core/src/typed_absy/variable.rs index 2d19a95ef..281b9a492 100644 --- a/zokrates_core/src/typed_absy/variable.rs +++ b/zokrates_core/src/typed_absy/variable.rs @@ -12,7 +12,7 @@ pub struct GVariable<'ast, S> { } pub type DeclarationVariable<'ast> = GVariable<'ast, DeclarationConstant<'ast>>; -pub type ConcreteVariable<'ast> = GVariable<'ast, usize>; +pub type ConcreteVariable<'ast> = GVariable<'ast, u32>; pub type Variable<'ast, T> = GVariable<'ast, UExpression<'ast, T>>; impl<'ast, T> TryFrom> for ConcreteVariable<'ast> { diff --git a/zokrates_core/src/zir/identifier.rs b/zokrates_core/src/zir/identifier.rs index 87eea34d1..9f7b6a9e8 100644 --- a/zokrates_core/src/zir/identifier.rs +++ b/zokrates_core/src/zir/identifier.rs @@ -11,7 +11,7 @@ pub enum Identifier<'ast> { #[derive(Debug, PartialEq, Clone, Hash, Eq)] pub enum SourceIdentifier<'ast> { Basic(CoreIdentifier<'ast>), - Select(Box>, usize), + Select(Box>, u32), Member(Box>, MemberId), } From 2e589796d7404232a9267b413eb70147d447bd3b Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 21 Sep 2021 15:34:51 +0300 Subject: [PATCH 18/83] refactor GenericIdentifier to avoid dummy names --- zokrates_core/src/embed.rs | 49 +++++-------------- zokrates_core/src/semantics.rs | 44 ++++++++--------- .../static_analysis/reducer/shallow_ssa.rs | 2 +- .../src/static_analysis/struct_concretizer.rs | 36 +++++++------- zokrates_core/src/typed_absy/types.rs | 32 +++++++++--- 5 files changed, 77 insertions(+), 86 deletions(-) diff --git a/zokrates_core/src/embed.rs b/zokrates_core/src/embed.rs index 88f0604c1..496ceaa8d 100644 --- a/zokrates_core/src/embed.rs +++ b/zokrates_core/src/embed.rs @@ -50,25 +50,16 @@ impl FlatEmbed { match self { FlatEmbed::BitArrayLe => DeclarationSignature::new() .generics(vec![Some(DeclarationConstant::Generic( - GenericIdentifier { - name: "N", - index: 0, - }, + GenericIdentifier::with_name("N").with_index(0), ))]) .inputs(vec![ DeclarationType::array(( DeclarationType::Boolean, - GenericIdentifier { - name: "N", - index: 0, - }, + GenericIdentifier::with_name("N").with_index(0), )), DeclarationType::array(( DeclarationType::Boolean, - GenericIdentifier { - name: "N", - index: 0, - }, + GenericIdentifier::with_name("N").with_index(0), )), ]) .outputs(vec![DeclarationType::Boolean]), @@ -77,18 +68,12 @@ impl FlatEmbed { .outputs(vec![DeclarationType::FieldElement]), FlatEmbed::Unpack => DeclarationSignature::new() .generics(vec![Some(DeclarationConstant::Generic( - GenericIdentifier { - name: "N", - index: 0, - }, + GenericIdentifier::with_name("N").with_index(0), ))]) .inputs(vec![DeclarationType::FieldElement]) .outputs(vec![DeclarationType::array(( DeclarationType::Boolean, - GenericIdentifier { - name: "N", - index: 0, - }, + GenericIdentifier::with_name("N").with_index(0), ))]), FlatEmbed::U8ToBits => DeclarationSignature::new() .inputs(vec![DeclarationType::uint(8)]) @@ -151,30 +136,22 @@ impl FlatEmbed { #[cfg(feature = "ark")] FlatEmbed::SnarkVerifyBls12377 => DeclarationSignature::new() .generics(vec![ - Some(DeclarationConstant::Generic(GenericIdentifier { - name: "N", - index: 0, - })), - Some(DeclarationConstant::Generic(GenericIdentifier { - name: "V", - index: 1, - })), + Some(DeclarationConstant::Generic( + GenericIdentifier::with_name("N").with_index(0), + )), + Some(DeclarationConstant::Generic( + GenericIdentifier::with_name("V").with_index(1), + )), ]) .inputs(vec![ DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier { - name: "N", - index: 0, - }, + GenericIdentifier::with_name("N").with_index(0), )), // inputs DeclarationType::array((DeclarationType::FieldElement, 8u32)), // proof DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier { - name: "V", - index: 1, - }, + GenericIdentifier::with_name("V").with_index(1), )), // 18 + (2 * n) // vk ]) .outputs(vec![DeclarationType::Boolean]), diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 213a69a75..ff0194818 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -382,10 +382,9 @@ impl<'ast, T: Field> Checker<'ast, T> { } else { match generics_map.insert(g.value, index).is_none() { true => { - generics.push(Some(DeclarationConstant::Generic(GenericIdentifier { - name: g.value, - index, - }))); + generics.push(Some(DeclarationConstant::Generic( + GenericIdentifier::with_name(g.value).with_index(index), + ))); } false => { errors.push(ErrorInner { @@ -515,10 +514,9 @@ impl<'ast, T: Field> Checker<'ast, T> { } else { match generics_map.insert(g.value, index).is_none() { true => { - generics.push(Some(DeclarationConstant::Generic(GenericIdentifier { - name: g.value, - index, - }))); + generics.push(Some(DeclarationConstant::Generic( + GenericIdentifier::with_name(g.value).with_index(index), + ))); } false => { errors.push(ErrorInner { @@ -1044,11 +1042,12 @@ impl<'ast, T: Field> Checker<'ast, T> { // for declaration signatures, generics cannot be ignored - let v = Variable::with_id_and_type(generic.name, Type::Uint(UBitwidth::B32)); + let v = Variable::with_id_and_type(generic.name(), Type::Uint(UBitwidth::B32)); generics.0.insert( generic.clone(), - UExpressionInner::Identifier(generic.name.into()).annotate(UBitwidth::B32), + UExpressionInner::Identifier(generic.name().into()) + .annotate(UBitwidth::B32), ); // we don't have to check for conflicts here, because this was done when checking the signature @@ -1191,10 +1190,9 @@ impl<'ast, T: Field> Checker<'ast, T> { } else { match generics_map.insert(g.value, index).is_none() { true => { - generics.push(Some(DeclarationConstant::Generic(GenericIdentifier { - name: g.value, - index, - }))); + generics.push(Some(DeclarationConstant::Generic( + GenericIdentifier::with_name(g.value).with_index(index), + ))); } false => { errors.push(ErrorInner { @@ -1482,7 +1480,7 @@ impl<'ast, T: Field> Checker<'ast, T> { }) } } - (None, Some(index)) => Ok(DeclarationConstant::Generic(GenericIdentifier { name, index: *index })), + (None, Some(index)) => Ok(DeclarationConstant::Generic(GenericIdentifier::with_name(name).with_index(*index))), _ => Err(ErrorInner { pos: Some(pos), message: format!("Undeclared symbol `{}`", name) @@ -3117,7 +3115,7 @@ impl<'ast, T: Field> Checker<'ast, T> { declared_struct_type.generics = (0..declared_struct_type.generics.len()) .map(|index| { Some(DeclarationConstant::Generic( - GenericIdentifier::with_name("DUMMY").index(index), + GenericIdentifier::without_name().with_index(index), )) }) .collect(); @@ -3676,7 +3674,7 @@ mod tests { "bar", DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into() + GenericIdentifier::with_name("K").with_index(0).into() )]) .inputs(vec![DeclarationType::FieldElement]) )); @@ -3685,11 +3683,11 @@ mod tests { "bar", DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into() + GenericIdentifier::with_name("K").with_index(0).into() )]) .inputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0) + GenericIdentifier::with_name("K").with_index(0) ))]) )); // a `bar` function with an equivalent signature, just renaming generic parameters @@ -3697,11 +3695,11 @@ mod tests { "bar", DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("L").index(0).into() + GenericIdentifier::with_name("L").with_index(0).into() )]) .inputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier::with_name("L").index(0) + GenericIdentifier::with_name("L").with_index(0) ))]) )); // a `bar` type isn't allowed as the name is already taken by at least one function @@ -4265,7 +4263,7 @@ mod tests { .inputs(vec![DeclarationType::array(( DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0) + GenericIdentifier::with_name("K").with_index(0) )), GenericIdentifier::with_name("L").index(1) ))]) @@ -4274,7 +4272,7 @@ mod tests { DeclarationType::FieldElement, GenericIdentifier::with_name("L").index(1) )), - GenericIdentifier::with_name("K").index(0) + GenericIdentifier::with_name("K").with_index(0) ))])) ); } diff --git a/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs b/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs index 5ae603bce..a06453b78 100644 --- a/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs +++ b/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs @@ -105,7 +105,7 @@ impl<'ast, 'a> ShallowTransformer<'ast, 'a> { .map(|(g, v)| { TypedStatement::Definition( TypedAssignee::Identifier(Variable::with_id_and_type( - g.name, + g.name(), Type::Uint(UBitwidth::B32), )), UExpression::from(*v as u32).into(), diff --git a/zokrates_core/src/static_analysis/struct_concretizer.rs b/zokrates_core/src/static_analysis/struct_concretizer.rs index 2b137357b..b5fb5407c 100644 --- a/zokrates_core/src/static_analysis/struct_concretizer.rs +++ b/zokrates_core/src/static_analysis/struct_concretizer.rs @@ -14,24 +14,28 @@ use crate::typed_absy::{ }, DeclarationStructType, GenericIdentifier, TypedProgram, }; +use std::marker::PhantomData; use zokrates_field::Field; -#[derive(Default)] -pub struct StructConcretizer<'ast> { +pub struct StructConcretizer<'ast, T> { generics: ConcreteGenericsAssignment<'ast>, + marker: PhantomData, } -impl<'ast> StructConcretizer<'ast> { - pub fn concretize(p: TypedProgram<'ast, T>) -> TypedProgram<'ast, T> { - StructConcretizer::default().fold_program(p) +impl<'ast, T: Field> StructConcretizer<'ast, T> { + pub fn concretize(p: TypedProgram<'ast, T>) -> TypedProgram<'ast, T> { + StructConcretizer::with_generics(ConcreteGenericsAssignment::default()).fold_program(p) } pub fn with_generics(generics: ConcreteGenericsAssignment<'ast>) -> Self { - Self { generics } + Self { + generics, + marker: PhantomData, + } } } -impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast> { +impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast, T> { fn fold_declaration_struct_type( &mut self, ty: DeclarationStructType<'ast>, @@ -47,11 +51,12 @@ impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast> { concrete_generics .iter() .enumerate() - .map(|(index, g)| (GenericIdentifier::with_name("DUMMY").index(index), *g)) + .map(|(index, g)| (GenericIdentifier::without_name().with_index(index), *g)) .collect(), ); - let mut internal_concretizer = StructConcretizer::with_generics(concrete_generics_map); + let mut internal_concretizer: StructConcretizer<'ast, T> = + StructConcretizer::with_generics(concrete_generics_map); DeclarationStructType { members: ty @@ -60,10 +65,7 @@ impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast> { .map(|member| { DeclarationStructMember::new( member.id, - >::fold_declaration_type( - &mut internal_concretizer, - *member.ty, - ), + internal_concretizer.fold_declaration_type(*member.ty), ) }) .collect(), @@ -79,15 +81,11 @@ impl<'ast, T: Field> Folder<'ast, T> for StructConcretizer<'ast> { &mut self, ty: DeclarationArrayType<'ast>, ) -> DeclarationArrayType<'ast> { - let size = match ty.size { - DeclarationConstant::Generic(s) => self.generics.0.get(&s).cloned().unwrap() as u32, - DeclarationConstant::Concrete(s) => s, - DeclarationConstant::Constant(..) => unreachable!(), - }; + let size = ty.size.map_concrete(&self.generics).unwrap(); DeclarationArrayType { size: DeclarationConstant::Concrete(size), - ty: box >::fold_declaration_type(self, *ty.ty), + ty: box self.fold_declaration_type(*ty.ty), } } } diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 608cdb883..44c6b2e5d 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -59,19 +59,37 @@ impl<'ast, T> Types<'ast, T> { #[derive(Debug, Clone, Eq)] pub struct GenericIdentifier<'ast> { - pub name: &'ast str, - pub index: usize, + name: Option<&'ast str>, + index: usize, } impl<'ast> GenericIdentifier<'ast> { + pub fn without_name() -> Self { + Self { + name: None, + index: 0, + } + } + pub fn with_name(name: &'ast str) -> Self { - Self { name, index: 0 } + Self { + name: Some(name), + index: 0, + } } - pub fn index(mut self, index: usize) -> Self { + pub fn with_index(mut self, index: usize) -> Self { self.index = index; self } + + pub fn name(&self) -> &'ast str { + self.name.unwrap() + } + + pub fn index(&self) -> usize { + self.index + } } impl<'ast> PartialEq for GenericIdentifier<'ast> { @@ -100,7 +118,7 @@ impl<'ast> Hash for GenericIdentifier<'ast> { impl<'ast> fmt::Display for GenericIdentifier<'ast> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.name) + write!(f, "{}", self.name()) } } @@ -210,7 +228,7 @@ impl<'ast, T> From> for UExpression<'ast, T> { fn from(c: DeclarationConstant<'ast>) -> Self { match c { DeclarationConstant::Generic(i) => { - UExpressionInner::Identifier(i.name.into()).annotate(UBitwidth::B32) + UExpressionInner::Identifier(i.name().into()).annotate(UBitwidth::B32) } DeclarationConstant::Concrete(v) => { UExpressionInner::Value(v as u128).annotate(UBitwidth::B32) @@ -1031,7 +1049,7 @@ pub fn specialize_declaration_type< .enumerate() .map(|(index, g)| { ( - GenericIdentifier::with_name("dummy").index(index), + GenericIdentifier::without_name().with_index(index), g.map(|g| g.map(generics).unwrap()).unwrap(), ) }) From 1ffbc024b2a751dd010ed88ea1fbd78547682ea8 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 21 Sep 2021 17:39:13 +0300 Subject: [PATCH 19/83] fix tests --- zokrates_abi/src/lib.rs | 7 +--- zokrates_core/src/semantics.rs | 4 +- .../src/static_analysis/constant_inliner.rs | 10 ++--- .../src/static_analysis/propagation.rs | 2 +- .../src/static_analysis/reducer/mod.rs | 42 +++++++++---------- .../static_analysis/reducer/shallow_ssa.rs | 12 +++--- zokrates_core/src/typed_absy/abi.rs | 10 ++--- zokrates_core/src/typed_absy/types.rs | 26 +++--------- 8 files changed, 48 insertions(+), 65 deletions(-) diff --git a/zokrates_abi/src/lib.rs b/zokrates_abi/src/lib.rs index 6c07891ed..16cdca31d 100644 --- a/zokrates_abi/src/lib.rs +++ b/zokrates_abi/src/lib.rs @@ -413,11 +413,8 @@ mod tests { fn array() { let s = "[[true, false]]"; assert_eq!( - parse_strict::( - s, - vec![ConcreteType::array((ConcreteType::Boolean, 2usize))] - ) - .unwrap(), + parse_strict::(s, vec![ConcreteType::array((ConcreteType::Boolean, 2u32))]) + .unwrap(), Values(vec![Value::Array(vec![ Value::Boolean(true), Value::Boolean(false) diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index ff0194818..36f7af1da 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -4265,12 +4265,12 @@ mod tests { DeclarationType::FieldElement, GenericIdentifier::with_name("K").with_index(0) )), - GenericIdentifier::with_name("L").index(1) + GenericIdentifier::with_name("L").with_index(1) ))]) .outputs(vec![DeclarationType::array(( DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier::with_name("L").index(1) + GenericIdentifier::with_name("L").with_index(1) )), GenericIdentifier::with_name("K").with_index(0) ))])) diff --git a/zokrates_core/src/static_analysis/constant_inliner.rs b/zokrates_core/src/static_analysis/constant_inliner.rs index 589ace6fd..d2b803e83 100644 --- a/zokrates_core/src/static_analysis/constant_inliner.rs +++ b/zokrates_core/src/static_analysis/constant_inliner.rs @@ -574,13 +574,13 @@ mod tests { statements: vec![TypedStatement::Return(vec![FieldElementExpression::Add( FieldElementExpression::select( ArrayExpressionInner::Identifier(Identifier::from(const_id)) - .annotate(GType::FieldElement, 2usize), + .annotate(GType::FieldElement, 2u32), UExpressionInner::Value(0u128).annotate(UBitwidth::B32), ) .into(), FieldElementExpression::select( ArrayExpressionInner::Identifier(Identifier::from(const_id)) - .annotate(GType::FieldElement, 2usize), + .annotate(GType::FieldElement, 2u32), UExpressionInner::Value(1u128).annotate(UBitwidth::B32), ) .into(), @@ -608,7 +608,7 @@ mod tests { ] .into(), ) - .annotate(GType::FieldElement, 2usize), + .annotate(GType::FieldElement, 2u32), ))), )] .into_iter() @@ -649,7 +649,7 @@ mod tests { ] .into(), ) - .annotate(GType::FieldElement, 2usize), + .annotate(GType::FieldElement, 2u32), UExpressionInner::Value(0u128).annotate(UBitwidth::B32), ) .into(), @@ -661,7 +661,7 @@ mod tests { ] .into(), ) - .annotate(GType::FieldElement, 2usize), + .annotate(GType::FieldElement, 2u32), UExpressionInner::Value(1u128).annotate(UBitwidth::B32), ) .into(), diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index 1450e0773..9424ee35e 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -1463,7 +1463,7 @@ mod tests { ] .into(), ) - .annotate(Type::FieldElement, 3usize), + .annotate(Type::FieldElement, 3u32), UExpressionInner::Add(box 1u32.into(), box 1u32.into()) .annotate(UBitwidth::B32), ); diff --git a/zokrates_core/src/static_analysis/reducer/mod.rs b/zokrates_core/src/static_analysis/reducer/mod.rs index 84790f29b..b5b8fd24a 100644 --- a/zokrates_core/src/static_analysis/reducer/mod.rs +++ b/zokrates_core/src/static_analysis/reducer/mod.rs @@ -830,22 +830,22 @@ mod tests { let foo_signature = DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ))]) .outputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ))]); let foo: TypedFunction = TypedFunction { arguments: vec![DeclarationVariable::array( "a", DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0), + GenericIdentifier::with_name("K").with_index(0), ) .into()], statements: vec![TypedStatement::Return(vec![ @@ -954,7 +954,7 @@ mod tests { DeclarationFunctionKey::with_location("main", "foo") .signature(foo_signature.clone()), GGenericsAssignment( - vec![(GenericIdentifier::with_name("K").index(0), 1)] + vec![(GenericIdentifier::with_name("K").with_index(0), 1)] .into_iter() .collect(), ), @@ -1049,22 +1049,22 @@ mod tests { let foo_signature = DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ))]) .outputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ))]); let foo: TypedFunction = TypedFunction { arguments: vec![DeclarationVariable::array( "a", DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0), + GenericIdentifier::with_name("K").with_index(0), ) .into()], statements: vec![TypedStatement::Return(vec![ @@ -1182,7 +1182,7 @@ mod tests { DeclarationFunctionKey::with_location("main", "foo") .signature(foo_signature.clone()), GGenericsAssignment( - vec![(GenericIdentifier::with_name("K").index(0), 1)] + vec![(GenericIdentifier::with_name("K").with_index(0), 1)] .into_iter() .collect(), ), @@ -1280,21 +1280,21 @@ mod tests { let foo_signature = DeclarationSignature::new() .inputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ))]) .outputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ))]) .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]); let foo: TypedFunction = TypedFunction { arguments: vec![DeclarationVariable::array( "a", DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ) .into()], statements: vec![ @@ -1358,7 +1358,7 @@ mod tests { arguments: vec![DeclarationVariable::array( "a", DeclarationType::FieldElement, - DeclarationConstant::Generic(GenericIdentifier::with_name("K").index(0)), + DeclarationConstant::Generic(GenericIdentifier::with_name("K").with_index(0)), ) .into()], statements: vec![TypedStatement::Return(vec![ @@ -1433,7 +1433,7 @@ mod tests { DeclarationFunctionKey::with_location("main", "foo") .signature(foo_signature.clone()), GGenericsAssignment( - vec![(GenericIdentifier::with_name("K").index(0), 1)] + vec![(GenericIdentifier::with_name("K").with_index(0), 1)] .into_iter() .collect(), ), @@ -1442,7 +1442,7 @@ mod tests { DeclarationFunctionKey::with_location("main", "bar") .signature(foo_signature.clone()), GGenericsAssignment( - vec![(GenericIdentifier::with_name("K").index(0), 2)] + vec![(GenericIdentifier::with_name("K").with_index(0), 2)] .into_iter() .collect(), ), @@ -1489,22 +1489,22 @@ mod tests { let foo_signature = DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0), + GenericIdentifier::with_name("K").with_index(0), ))]) .outputs(vec![DeclarationType::array(( DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0), + GenericIdentifier::with_name("K").with_index(0), ))]); let foo: TypedFunction = TypedFunction { arguments: vec![DeclarationVariable::array( "a", DeclarationType::FieldElement, - GenericIdentifier::with_name("K").index(0), + GenericIdentifier::with_name("K").with_index(0), ) .into()], statements: vec![TypedStatement::Return(vec![ diff --git a/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs b/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs index a06453b78..aa744e8d9 100644 --- a/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs +++ b/zokrates_core/src/static_analysis/reducer/shallow_ssa.rs @@ -662,7 +662,7 @@ mod tests { ], signature: DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::FieldElement]) .outputs(vec![DeclarationType::FieldElement]), @@ -673,7 +673,7 @@ mod tests { let ssa = ShallowTransformer::transform( f, &GGenericsAssignment( - vec![(GenericIdentifier::with_name("K").index(0), 1)] + vec![(GenericIdentifier::with_name("K").with_index(0), 1)] .into_iter() .collect(), ), @@ -742,7 +742,7 @@ mod tests { ], signature: DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::FieldElement]) .outputs(vec![DeclarationType::FieldElement]), @@ -851,7 +851,7 @@ mod tests { ], signature: DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::FieldElement]) .outputs(vec![DeclarationType::FieldElement]), @@ -862,7 +862,7 @@ mod tests { let ssa = ShallowTransformer::transform( f, &GGenericsAssignment( - vec![(GenericIdentifier::with_name("K").index(0), 1)] + vec![(GenericIdentifier::with_name("K").with_index(0), 1)] .into_iter() .collect(), ), @@ -934,7 +934,7 @@ mod tests { ], signature: DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier::with_name("K").index(0).into(), + GenericIdentifier::with_name("K").with_index(0).into(), )]) .inputs(vec![DeclarationType::FieldElement]) .outputs(vec![DeclarationType::FieldElement]), diff --git a/zokrates_core/src/typed_absy/abi.rs b/zokrates_core/src/typed_absy/abi.rs index 15554a735..0dfbfade5 100644 --- a/zokrates_core/src/typed_absy/abi.rs +++ b/zokrates_core/src/typed_absy/abi.rs @@ -231,12 +231,12 @@ mod tests { ty: ConcreteType::Struct(ConcreteStructType::new( "".into(), "Bar".into(), - vec![Some(1usize)], + vec![Some(1u32)], vec![ConcreteStructMember::new( String::from("a"), ConcreteType::Array(ConcreteArrayType::new( ConcreteType::FieldElement, - 1usize, + 1u32, )), )], )), @@ -400,7 +400,7 @@ mod tests { ConcreteStructMember::new(String::from("c"), ConcreteType::Boolean), ], )), - 2usize, + 2u32, )), }], outputs: vec![ConcreteType::Boolean], @@ -454,8 +454,8 @@ mod tests { name: String::from("a"), public: false, ty: ConcreteType::Array(ConcreteArrayType::new( - ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 2usize)), - 2usize, + ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 2u32)), + 2u32, )), }], outputs: vec![ConcreteType::FieldElement], diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 44c6b2e5d..750de0242 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -1405,33 +1405,19 @@ pub mod signature { let generic1 = DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier { - name: "P", - index: 0, - } - .into(), + GenericIdentifier::with_name("P").with_index(0).into(), )]) .inputs(vec![DeclarationType::array(DeclarationArrayType::new( DeclarationType::FieldElement, - GenericIdentifier { - name: "P", - index: 0, - }, + GenericIdentifier::with_name("P").with_index(0), ))]); let generic2 = DeclarationSignature::new() .generics(vec![Some( - GenericIdentifier { - name: "Q", - index: 0, - } - .into(), + GenericIdentifier::with_name("Q").with_index(0).into(), )]) .inputs(vec![DeclarationType::array(DeclarationArrayType::new( DeclarationType::FieldElement, - GenericIdentifier { - name: "Q", - index: 0, - }, + GenericIdentifier::with_name("Q").with_index(0), ))]); assert_eq!(generic1, generic2); @@ -1512,7 +1498,7 @@ mod tests { #[test] fn array() { - let t = ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 42usize)); + let t = ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 42u32)); assert_eq!(t.get_primitive_count(), 42); } @@ -1521,7 +1507,7 @@ mod tests { // field[1][2] let t = ConcreteType::Array(ConcreteArrayType::new( ConcreteType::Array(ConcreteArrayType::new(ConcreteType::FieldElement, 2u32)), - 1usize, + 1u32, )); assert_eq!(format!("{}", t), "field[1][2]"); } From 30ebec6f375af5a243679a912b45d5894157f8a2 Mon Sep 17 00:00:00 2001 From: schaeff Date: Thu, 23 Sep 2021 11:14:18 +0300 Subject: [PATCH 20/83] simplify treatment of user defined types --- zokrates_core/src/semantics.rs | 399 +++++++++++++-------------------- 1 file changed, 159 insertions(+), 240 deletions(-) diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 36f7af1da..2c28e0b33 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -55,9 +55,33 @@ impl ErrorInner { } } -type GenericDeclarations<'ast> = Option>>>; -type TypeMap<'ast> = - HashMap, GenericDeclarations<'ast>)>>; +// a single struct to cover all cases of user-defined types +#[derive(Debug, Clone)] +struct UserDeclarationType<'ast> { + generics: Vec>, + ty: DeclarationType<'ast>, +} + +impl<'ast> UserDeclarationType<'ast> { + // returns the declared generics for this user type + // for alias of basic types this is empty + // for structs this is the same as the used generics + // for aliases of structs this is the names of the generics declared on the left side of the type declaration + fn declaration_generics(&self) -> Vec<&'ast str> { + self.generics + .iter() + .filter_map(|g| match g { + DeclarationConstant::Generic(g) => Some(g), + _ => None, + }) + .collect::>() // we collect into a BTreeSet because draining it after yields the element in the right order defined by Ord + .into_iter() + .map(|g| g.name()) + .collect() + } +} + +type TypeMap<'ast> = HashMap>>; type ConstantMap<'ast> = HashMap, DeclarationType<'ast>>>; @@ -356,7 +380,7 @@ impl<'ast, T: Field> Checker<'ast, T> { ty: TypeDefinitionNode<'ast>, module_id: &ModuleId, state: &State<'ast, T>, - ) -> Result<(DeclarationType<'ast>, GenericDeclarations<'ast>), Vec> { + ) -> Result, Vec> { let pos = ty.pos(); let ty = ty.value; @@ -382,9 +406,9 @@ impl<'ast, T: Field> Checker<'ast, T> { } else { match generics_map.insert(g.value, index).is_none() { true => { - generics.push(Some(DeclarationConstant::Generic( + generics.push(DeclarationConstant::Generic( GenericIdentifier::with_name(g.value).with_index(index), - ))); + )); } false => { errors.push(ErrorInner { @@ -420,7 +444,7 @@ impl<'ast, T: Field> Checker<'ast, T> { return Err(errors); } - Ok((ty, Some(generics))) + Ok(UserDeclarationType { generics, ty }) } Err(e) => { errors.push(e); @@ -486,7 +510,7 @@ impl<'ast, T: Field> Checker<'ast, T> { s: StructDefinitionNode<'ast>, module_id: &ModuleId, state: &State<'ast, T>, - ) -> Result, Vec> { + ) -> Result, Vec> { let pos = s.pos(); let s = s.value; @@ -569,7 +593,7 @@ impl<'ast, T: Field> Checker<'ast, T> { return Err(errors); } - Ok(DeclarationType::Struct(DeclarationStructType::new( + Ok(DeclarationStructType::new( module_id.to_path_buf(), id, generics, @@ -577,7 +601,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .iter() .map(|f| DeclarationStructMember::new(f.0.clone(), f.1.clone())) .collect(), - ))) + )) } fn check_symbol_declaration( @@ -620,7 +644,18 @@ impl<'ast, T: Field> Checker<'ast, T> { .types .entry(module_id.to_path_buf()) .or_default() - .insert(declaration.id.to_string(), (ty, None)) + .insert( + declaration.id.to_string(), + UserDeclarationType { + generics: ty + .generics + .clone() + .into_iter() + .map(|g| g.unwrap()) + .collect(), + ty: DeclarationType::Struct(ty) + } + ) .is_none()); } }; @@ -781,18 +816,20 @@ impl<'ast, T: Field> Checker<'ast, T> { .cloned(); match (function_candidates.len(), type_candidate, const_candidate) { - (0, Some((t, alias_generics)), None) => { - + (0, Some(t), None) => { // rename the type to the declared symbol - let t = match t { - DeclarationType::Struct(t) => DeclarationType::Struct(DeclarationStructType { - location: Some(StructLocation { - name: declaration.id.into(), - module: module_id.to_path_buf() + let t = UserDeclarationType { + ty: match t.ty { + DeclarationType::Struct(t) => DeclarationType::Struct(DeclarationStructType { + location: Some(StructLocation { + name: declaration.id.into(), + module: module_id.to_path_buf() + }), + ..t }), - ..t - }), - _ => t // type alias + _ => t.ty // all other cases + }, + ..t }; // we imported a type, so the symbol it gets bound to should not already exist @@ -814,7 +851,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .types .entry(module_id.to_path_buf()) .or_default() - .insert(declaration.id.to_string(), (t, alias_generics)); + .insert(declaration.id.to_string(), t); } (0, None, Some(ty)) => { match symbol_unifier.insert_constant(declaration.id) { @@ -1306,133 +1343,71 @@ impl<'ast, T: Field> Checker<'ast, T> { ))) } UnresolvedType::User(id, generics) => { - let (declaration_type, alias_generics) = types - .get(module_id) - .unwrap() - .get(&id) - .cloned() - .ok_or_else(|| ErrorInner { - pos: Some(pos), - message: format!("Undefined type {}", id), - })?; + let declared_ty = + types + .get(module_id) + .unwrap() + .get(&id) + .cloned() + .ok_or_else(|| ErrorInner { + pos: Some(pos), + message: format!("Undefined type {}", id), + })?; + + let generic_identifiers = declared_ty.declaration_generics(); + + let declaration_type = declared_ty.ty; // absence of generics is treated as 0 generics, as we do not provide inference for now let generics = generics.unwrap_or_default(); // check generics - match (declaration_type, alias_generics) { - (DeclarationType::Struct(struct_type), None) => { - match struct_type.generics.len() == generics.len() { - true => { - // downcast the generics to identifiers, as this is the only possibility here - let generic_identifiers = struct_type.generics.iter().map(|c| { - match c.as_ref().unwrap() { - DeclarationConstant::Generic(g) => g.clone(), - _ => unreachable!(), - } - }); - - // build the generic assignment for this type - let assignment = GGenericsAssignment(generics - .into_iter() - .zip(generic_identifiers) - .map(|(e, g)| match e { - Some(e) => { - self - .check_expression(e, module_id, types) - .and_then(|e| { - UExpression::try_from_typed(e, &UBitwidth::B32) - .map(|e| (g, e)) - .map_err(|e| ErrorInner { - pos: Some(pos), - message: format!("Expected u32 expression, but got expression of type {}", e.get_type()), - }) - }) - }, - None => Err(ErrorInner { - pos: Some(pos), - message: - "Expected u32 constant or identifier, but found `_`. Generic inference is not supported yet." - .into(), - }) - }) - .collect::>()?); - - // specialize the declared type using the generic assignment - Ok(specialize_declaration_type( - DeclarationType::Struct(struct_type), - &assignment, - ) - .unwrap()) - } - false => Err(ErrorInner { - pos: Some(pos), - message: format!( - "Expected {} generic argument{} on type {}, but got {}", - struct_type.generics.len(), - if struct_type.generics.len() == 1 { - "" - } else { - "s" - }, - id, - generics.len() - ), - }), - } - } - (declaration_type, Some(alias_generics)) => { - match alias_generics.len() == generics.len() { - true => { - let generic_identifiers = - alias_generics.iter().map(|c| match c.as_ref().unwrap() { - DeclarationConstant::Generic(g) => g.clone(), - _ => unreachable!(), - }); - - // build the generic assignment for this type - let assignment = GGenericsAssignment(generics - .into_iter() - .zip(generic_identifiers) - .map(|(e, g)| match e { - Some(e) => { - self - .check_expression(e, module_id, types) - .and_then(|e| { - UExpression::try_from_typed(e, &UBitwidth::B32) - .map(|e| (g, e)) - .map_err(|e| ErrorInner { - pos: Some(pos), - message: format!("Expected u32 expression, but got expression of type {}", e.get_type()), - }) + match generic_identifiers.len() == generics.len() { + true => { + // build the generic assignment for this type + let assignment = GGenericsAssignment(generics + .into_iter() + .zip(generic_identifiers) + .enumerate() + .map(|(i, (e, g))| match e { + Some(e) => { + self + .check_expression(e, module_id, types) + .and_then(|e| { + UExpression::try_from_typed(e, &UBitwidth::B32) + .map(|e| (GenericIdentifier::with_name(g).with_index(i), e)) + .map_err(|e| ErrorInner { + pos: Some(pos), + message: format!("Expected u32 expression, but got expression of type {}", e.get_type()), }) - }, - None => Err(ErrorInner { - pos: Some(pos), - message: - "Expected u32 constant or identifier, but found `_`. Generic inference is not supported yet." - .into(), }) - }) - .collect::>()?); + }, + None => Err(ErrorInner { + pos: Some(pos), + message: + "Expected u32 constant or identifier, but found `_`. Generic inference is not supported yet." + .into(), + }) + }) + .collect::>()?); - // specialize the declared type using the generic assignment - Ok(specialize_declaration_type(declaration_type, &assignment) - .unwrap()) - } - false => Err(ErrorInner { - pos: Some(pos), - message: format!( - "Expected {} generic argument{} on type {}, but got {}", - alias_generics.len(), - if alias_generics.len() == 1 { "" } else { "s" }, - id, - generics.len() - ), - }), - } + // specialize the declared type using the generic assignment + Ok(specialize_declaration_type(declaration_type, &assignment).unwrap()) } - _ => unreachable!(), + false => Err(ErrorInner { + pos: Some(pos), + message: format!( + "Expected {} generic argument{} on type {}, but got {}", + generic_identifiers.len(), + if generic_identifiers.len() == 1 { + "" + } else { + "s" + }, + id, + generics.len() + ), + }), } } } @@ -1527,7 +1502,7 @@ impl<'ast, T: Field> Checker<'ast, T> { ))) } UnresolvedType::User(id, generics) => { - let (declared_ty, alias_generics) = state + let ty = state .types .get(module_id) .unwrap() @@ -1538,99 +1513,47 @@ impl<'ast, T: Field> Checker<'ast, T> { message: format!("Undefined type {}", id), })?; - match (declared_ty, alias_generics) { - (ty, Some(alias_generics)) => { - let generics = generics.unwrap_or_default(); - let checked_generics: Vec<_> = generics - .into_iter() - .map(|e| match e { - Some(e) => self - .check_generic_expression( - e, - module_id, - state.constants.get(module_id).unwrap_or(&HashMap::new()), - generics_map, - used_generics, - ) - .map(Some), - None => Err(ErrorInner { - pos: Some(pos), - message: "Expected u32 constant or identifier, but found `_`" - .into(), - }), - }) - .collect::>()?; + let generics = generics.unwrap_or_default(); + let checked_generics: Vec<_> = generics + .into_iter() + .map(|e| match e { + Some(e) => self + .check_generic_expression( + e, + module_id, + state.constants.get(module_id).unwrap_or(&HashMap::new()), + generics_map, + used_generics, + ) + .map(Some), + None => Err(ErrorInner { + pos: Some(pos), + message: "Expected u32 constant or identifier, but found `_`".into(), + }), + }) + .collect::>()?; + match ty.generics.len() == checked_generics.len() { + true => { let mut assignment = GGenericsAssignment::default(); - assignment.0.extend( - alias_generics.iter().zip(checked_generics.iter()).map( - |(decl_g, g_val)| match decl_g.clone().unwrap() { - DeclarationConstant::Generic(g) => (g, g_val.clone().unwrap()), - _ => unreachable!(), - }, - ), - ); + assignment.0.extend(ty.generics.iter().zip(checked_generics.iter()).map(|(decl_g, g_val)| match decl_g.clone() { + DeclarationConstant::Generic(g) => (g, g_val.clone().unwrap()), + _ => unreachable!("generic on declaration struct types must be generic identifiers") + })); - Ok(specialize_declaration_type(ty, &assignment).unwrap()) + Ok(specialize_declaration_type(ty.ty, &assignment).unwrap()) } - (DeclarationType::Struct(declared_struct_ty), None) => { - let generics = generics.unwrap_or_default(); - match declared_struct_ty.generics.len() == generics.len() { - true => { - let checked_generics: Vec<_> = generics - .into_iter() - .map(|e| match e { - Some(e) => self - .check_generic_expression( - e, - module_id, - state - .constants - .get(module_id) - .unwrap_or(&HashMap::new()), - generics_map, - used_generics, - ) - .map(Some), - None => Err(ErrorInner { - pos: Some(pos), - message: - "Expected u32 constant or identifier, but found `_`" - .into(), - }), - }) - .collect::>()?; - - let mut assignment = GGenericsAssignment::default(); - - assignment.0.extend(declared_struct_ty.generics.iter().zip(checked_generics.iter()).map(|(decl_g, g_val)| match decl_g.clone().unwrap() { - DeclarationConstant::Generic(g) => (g, g_val.clone().unwrap()), - _ => unreachable!("generic on declaration struct types must be generic identifiers") - })); - - Ok(DeclarationType::Struct(DeclarationStructType { - generics: checked_generics, - ..declared_struct_ty - })) - } - false => Err(ErrorInner { - pos: Some(pos), - message: format!( - "Expected {} generic argument{} on type {}, but got {}", - declared_struct_ty.generics.len(), - if declared_struct_ty.generics.len() == 1 { - "" - } else { - "s" - }, - id, - generics.len() - ), - }), - } - } - (declared_ty, _) => Ok(declared_ty), + false => Err(ErrorInner { + pos: Some(pos), + message: format!( + "Expected {} generic argument{} on type {}, but got {}", + ty.generics.len(), + if ty.generics.len() == 1 { "" } else { "s" }, + id, + checked_generics.len() + ), + }), } } } @@ -3099,7 +3022,7 @@ impl<'ast, T: Field> Checker<'ast, T> { .into()) } Expression::InlineStruct(id, inline_members) => { - let (ty, _) = match types.get(module_id).unwrap().get(&id).cloned() { + let ty = match types.get(module_id).unwrap().get(&id).cloned() { None => Err(ErrorInner { pos: Some(pos), message: format!("Undefined type `{}`", id), @@ -3107,7 +3030,7 @@ impl<'ast, T: Field> Checker<'ast, T> { Some(ty) => Ok(ty), }?; - let mut declared_struct_type = match ty { + let mut declared_struct_type = match ty.ty { DeclarationType::Struct(struct_type) => struct_type, _ => unreachable!(), }; @@ -5529,12 +5452,8 @@ mod tests { } .mock(); - let expected_type = DeclarationType::Struct(DeclarationStructType::new( - "".into(), - "Foo".into(), - vec![], - vec![], - )); + let expected_type = + DeclarationStructType::new("".into(), "Foo".into(), vec![], vec![]); assert_eq!( Checker::::new().check_struct_type_declaration( @@ -5570,7 +5489,7 @@ mod tests { } .mock(); - let expected_type = DeclarationType::Struct(DeclarationStructType::new( + let expected_type = DeclarationStructType::new( "".into(), "Foo".into(), vec![], @@ -5578,7 +5497,7 @@ mod tests { DeclarationStructMember::new("foo".into(), DeclarationType::FieldElement), DeclarationStructMember::new("bar".into(), DeclarationType::Boolean), ], - )); + ); assert_eq!( Checker::::new().check_struct_type_declaration( @@ -5681,7 +5600,7 @@ mod tests { .get(&*MODULE_ID) .unwrap() .get(&"Bar".to_string()) - .map(|(ty, _)| ty) + .map(|ty| &ty.ty) .unwrap(), &DeclarationType::Struct(DeclarationStructType::new( (*MODULE_ID).clone(), From b8e831ed5b8efc00881b2f89fcd86ac3f643061f Mon Sep 17 00:00:00 2001 From: schaeff Date: Thu, 23 Sep 2021 14:13:21 +0300 Subject: [PATCH 21/83] avoid visiting members --- zokrates_core/src/semantics.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 2c28e0b33..fb4687e66 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1542,7 +1542,19 @@ impl<'ast, T: Field> Checker<'ast, T> { _ => unreachable!("generic on declaration struct types must be generic identifiers") })); - Ok(specialize_declaration_type(ty.ty, &assignment).unwrap()) + let res = match ty.ty { + // if the type is a struct, we do not specialize in the members. + // we only remap the generics + DeclarationType::Struct(declared_struct_ty) => { + DeclarationType::Struct(DeclarationStructType { + generics: checked_generics, + ..declared_struct_ty + }) + } + ty => specialize_declaration_type(ty, &assignment).unwrap(), + }; + + Ok(res) } false => Err(ErrorInner { pos: Some(pos), From 018e5bf29ea5704a83f244e4992556e91df1f9a3 Mon Sep 17 00:00:00 2001 From: dark64 Date: Thu, 23 Sep 2021 13:26:15 +0200 Subject: [PATCH 22/83] cleanup --- zokrates_core/src/static_analysis/propagation.rs | 7 ++++--- zokrates_core/src/static_analysis/uint_optimizer.rs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index 0fb654cfd..a097a289d 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -610,17 +610,18 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { Ok(statements) } - TypedStatement::Assertion(e, s) => { + TypedStatement::Assertion(e, metadata) => { let e_str = e.to_string(); let expr = self.fold_boolean_expression(e)?; match expr { BooleanExpression::Value(v) if !v => Err(Error::AssertionFailed(format!( "{}: ({})", - s.map(|m| m.to_string()) + metadata + .map(|m| m.to_string()) .unwrap_or_else(|| "Assertion failed".to_string()), e_str, ))), - _ => Ok(vec![TypedStatement::Assertion(expr, s)]), + _ => Ok(vec![TypedStatement::Assertion(expr, metadata)]), } } s @ TypedStatement::PushCallLog(..) => Ok(vec![s]), diff --git a/zokrates_core/src/static_analysis/uint_optimizer.rs b/zokrates_core/src/static_analysis/uint_optimizer.rs index 4c0a26c6a..7219b652f 100644 --- a/zokrates_core/src/static_analysis/uint_optimizer.rs +++ b/zokrates_core/src/static_analysis/uint_optimizer.rs @@ -531,7 +531,7 @@ impl<'ast, T: Field> Folder<'ast, T> for UintOptimizer<'ast, T> { } } } - ZirStatement::Assertion(BooleanExpression::UintEq(box left, box right), m) => { + ZirStatement::Assertion(BooleanExpression::UintEq(box left, box right), metadata) => { let left = self.fold_uint_expression(left); let right = self.fold_uint_expression(right); @@ -541,7 +541,7 @@ impl<'ast, T: Field> Folder<'ast, T> for UintOptimizer<'ast, T> { vec![ZirStatement::Assertion( BooleanExpression::UintEq(box left, box right), - m, + metadata, )] } s => fold_statement(self, s), From 4b99a99815c29d9db827171a6465843ff43203d9 Mon Sep 17 00:00:00 2001 From: schaeff Date: Thu, 23 Sep 2021 14:45:45 +0300 Subject: [PATCH 23/83] remove explicit generics where applicable --- zokrates_cli/examples/compile_errors/variable_constant_lt.zok | 2 +- zokrates_stdlib/stdlib/hashes/keccak/256bit.zok | 2 +- zokrates_stdlib/stdlib/hashes/keccak/384bit.zok | 2 +- zokrates_stdlib/stdlib/hashes/keccak/512bit.zok | 2 +- zokrates_stdlib/stdlib/hashes/sha3/256bit.zok | 2 +- zokrates_stdlib/stdlib/hashes/sha3/384bit.zok | 2 +- zokrates_stdlib/stdlib/hashes/sha3/512bit.zok | 2 +- zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok | 2 +- zokrates_stdlib/stdlib/utils/pack/bool/unpack128.zok | 2 +- zokrates_stdlib/tests/tests/hashes/blake2/blake2s_1536bit.zok | 2 +- zokrates_stdlib/tests/tests/hashes/blake2/blake2s_512bit.zok | 2 +- zokrates_stdlib/tests/tests/hashes/blake2/blake2s_p.zok | 2 +- zokrates_stdlib/tests/tests/hashes/keccak/384bit.zok | 2 +- zokrates_stdlib/tests/tests/hashes/mimcSponge/mimcSponge.zok | 4 ++-- zokrates_stdlib/tests/tests/hashes/sha3/256bit.zok | 2 +- zokrates_stdlib/tests/tests/hashes/sha3/512bit.zok | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/zokrates_cli/examples/compile_errors/variable_constant_lt.zok b/zokrates_cli/examples/compile_errors/variable_constant_lt.zok index 062d82952..86c3979c4 100644 --- a/zokrates_cli/examples/compile_errors/variable_constant_lt.zok +++ b/zokrates_cli/examples/compile_errors/variable_constant_lt.zok @@ -2,4 +2,4 @@ from "EMBED" import bit_array_le // Calling the `bit_array_le` embed on a non-constant second argument should fail at compile-time def main(bool[1] a, bool[1] b) -> bool: - return bit_array_le::<1>(a, b) \ No newline at end of file + return bit_array_le(a, b) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/hashes/keccak/256bit.zok b/zokrates_stdlib/stdlib/hashes/keccak/256bit.zok index 59d800fe8..a066170c3 100644 --- a/zokrates_stdlib/stdlib/hashes/keccak/256bit.zok +++ b/zokrates_stdlib/stdlib/hashes/keccak/256bit.zok @@ -1,4 +1,4 @@ import "hashes/keccak/keccak" as keccak def main(u64[N] input) -> u64[4]: - return keccak::(input, 0x0000000000000001)[..4] \ No newline at end of file + return keccak::<_, 256>(input, 0x0000000000000001)[..4] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/hashes/keccak/384bit.zok b/zokrates_stdlib/stdlib/hashes/keccak/384bit.zok index f261ebcc3..0378c6dde 100644 --- a/zokrates_stdlib/stdlib/hashes/keccak/384bit.zok +++ b/zokrates_stdlib/stdlib/hashes/keccak/384bit.zok @@ -1,4 +1,4 @@ import "hashes/keccak/keccak" as keccak def main(u64[N] input) -> u64[6]: - return keccak::(input, 0x0000000000000001)[..6] \ No newline at end of file + return keccak::<_, 384>(input, 0x0000000000000001)[..6] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/hashes/keccak/512bit.zok b/zokrates_stdlib/stdlib/hashes/keccak/512bit.zok index 8345df528..00678fcb0 100644 --- a/zokrates_stdlib/stdlib/hashes/keccak/512bit.zok +++ b/zokrates_stdlib/stdlib/hashes/keccak/512bit.zok @@ -1,4 +1,4 @@ import "hashes/keccak/keccak" as keccak def main(u64[N] input) -> u64[8]: - return keccak::(input, 0x0000000000000001)[..8] \ No newline at end of file + return keccak::<_, 512>(input, 0x0000000000000001)[..8] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/hashes/sha3/256bit.zok b/zokrates_stdlib/stdlib/hashes/sha3/256bit.zok index 99d213fa9..2dfed2ccc 100644 --- a/zokrates_stdlib/stdlib/hashes/sha3/256bit.zok +++ b/zokrates_stdlib/stdlib/hashes/sha3/256bit.zok @@ -1,4 +1,4 @@ import "hashes/keccak/keccak" as keccak def main(u64[N] input) -> (u64[4]): - return keccak::(input, 0x0000000000000006)[..4] \ No newline at end of file + return keccak::<_, 256>(input, 0x0000000000000006)[..4] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/hashes/sha3/384bit.zok b/zokrates_stdlib/stdlib/hashes/sha3/384bit.zok index 1b6dfeff5..95c8dafec 100644 --- a/zokrates_stdlib/stdlib/hashes/sha3/384bit.zok +++ b/zokrates_stdlib/stdlib/hashes/sha3/384bit.zok @@ -1,4 +1,4 @@ import "hashes/keccak/keccak" as keccak def main(u64[N] input) -> (u64[6]): - return keccak::(input, 0x0000000000000006)[..6] \ No newline at end of file + return keccak::<_, 384>(input, 0x0000000000000006)[..6] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/hashes/sha3/512bit.zok b/zokrates_stdlib/stdlib/hashes/sha3/512bit.zok index 6c37836e2..5dbd8d5eb 100644 --- a/zokrates_stdlib/stdlib/hashes/sha3/512bit.zok +++ b/zokrates_stdlib/stdlib/hashes/sha3/512bit.zok @@ -1,4 +1,4 @@ import "hashes/keccak/keccak" as keccak def main(u64[N] input) -> (u64[8]): - return keccak::(input, 0x0000000000000006)[..8] \ No newline at end of file + return keccak::<_, 512>(input, 0x0000000000000006)[..8] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok b/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok index e31dece46..754fc659b 100644 --- a/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok +++ b/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok @@ -7,6 +7,6 @@ import "./unpack_unchecked" // For example, `0` can map to `[0, 0, ..., 0]` or to `bits(p)` def main(field i) -> bool[256]: - bool[254] b = unpack_unchecked::<254>(i) + bool[254] b = unpack_unchecked(i) return [false, false, ...b] \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/pack/bool/unpack128.zok b/zokrates_stdlib/stdlib/utils/pack/bool/unpack128.zok index 8f0b12030..1998bedef 100644 --- a/zokrates_stdlib/stdlib/utils/pack/bool/unpack128.zok +++ b/zokrates_stdlib/stdlib/utils/pack/bool/unpack128.zok @@ -3,5 +3,5 @@ import "./unpack" as unpack // Unpack a field element as 128 big-endian bits // If the input is larger than `2**128 - 1`, the output is truncated. def main(field i) -> bool[128]: - bool[128] res = unpack::<128>(i) + bool[128] res = unpack(i) return res \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_1536bit.zok b/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_1536bit.zok index 05340e3c8..2115a1825 100644 --- a/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_1536bit.zok +++ b/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_1536bit.zok @@ -9,7 +9,7 @@ import "hashes/blake2/blake2s" // '879043503b04cab2f3c0d7a4bb01c1db74c238c49887da84e8a619893092b6e2' def main(): - u32[8] h = blake2s::<3>([[0x12345678; 16]; 3]) // 3 * 16 * 32 = 1536 bit input + u32[8] h = blake2s([[0x12345678; 16]; 3]) // 3 * 16 * 32 = 1536 bit input assert(h == [ 0x87904350, 0x3B04CAB2, 0xF3C0D7A4, 0xBB01C1DB, 0x74C238C4, 0x9887DA84, 0xE8A61989, 0x3092B6E2 diff --git a/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_512bit.zok b/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_512bit.zok index 2398c6082..62c0c4258 100644 --- a/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_512bit.zok +++ b/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_512bit.zok @@ -9,7 +9,7 @@ import "hashes/blake2/blake2s" // '52af1aec3e6663bcc759d55fc7557fbb2f710219f0de138b1b52c919f5c94415' def main(): - u32[8] h = blake2s::<1>([[0x12345678; 16]; 1]) // 16 * 32 = 512 bit input + u32[8] h = blake2s([[0x12345678; 16]; 1]) // 16 * 32 = 512 bit input assert(h == [ 0x52AF1AEC, 0x3E6663BC, 0xC759D55F, 0xC7557FBB, 0x2F710219, 0xF0DE138B, 0x1B52C919, 0xF5C94415 diff --git a/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_p.zok b/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_p.zok index ecea1f263..91d3da974 100644 --- a/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_p.zok +++ b/zokrates_stdlib/tests/tests/hashes/blake2/blake2s_p.zok @@ -9,7 +9,7 @@ import "hashes/blake2/blake2s_p" as blake2s // '780105bc9ca7633b1f289b3d1558dece65e04ac23f88e711dc29600fa3e0258a' def main(): - u32[8] h = blake2s::<1>([[0x12345678; 16]; 1], [0x12345678, 0]) + u32[8] h = blake2s([[0x12345678; 16]; 1], [0x12345678, 0]) assert(h == [ 0x780105BC, 0x9CA7633B, 0x1F289B3D, 0x1558DECE, 0x65E04AC2, 0x3F88E711, 0xDC29600F, 0xA3E0258A diff --git a/zokrates_stdlib/tests/tests/hashes/keccak/384bit.zok b/zokrates_stdlib/tests/tests/hashes/keccak/384bit.zok index a12a3f964..3220ca0b2 100644 --- a/zokrates_stdlib/tests/tests/hashes/keccak/384bit.zok +++ b/zokrates_stdlib/tests/tests/hashes/keccak/384bit.zok @@ -9,7 +9,7 @@ import "hashes/keccak/384bit" as keccak384 // 'a944b9b859c1e69d66b52d4cf1f678b24ed8a9ccb0a32bbe882af8a3a1acbd3b68eed9c628307e5d3789f1a64a50e8e7' def main(): - u64[6] h = keccak384::<20>([42; 20]) + u64[6] h = keccak384([42; 20]) assert(h == [ 0xA944B9B859C1E69D, 0x66B52D4CF1F678B2, 0x4ED8A9CCB0A32BBE, 0x882AF8A3A1ACBD3B, 0x68EED9C628307E5D, 0x3789F1A64A50E8E7 diff --git a/zokrates_stdlib/tests/tests/hashes/mimcSponge/mimcSponge.zok b/zokrates_stdlib/tests/tests/hashes/mimcSponge/mimcSponge.zok index 4924b8dfa..7e61a472b 100644 --- a/zokrates_stdlib/tests/tests/hashes/mimcSponge/mimcSponge.zok +++ b/zokrates_stdlib/tests/tests/hashes/mimcSponge/mimcSponge.zok @@ -1,12 +1,12 @@ import "hashes/mimcSponge/mimcSponge" as mimcSponge def main(): - assert(mimcSponge::<2, 3>([1, 2], 3) == [ + assert(mimcSponge::<_, 3>([1, 2], 3) == [ 20225509322021146255705869525264566735642015554514977326536820959638320229084, 13871743498877225461925335509899475799121918157213219438898506786048812913771, 21633608428713573518356618235457250173701815120501233429160399974209848779097 ]) - assert(mimcSponge::<2, 3>([0, 0], 0) == [ + assert(mimcSponge::<_, 3>([0, 0], 0) == [ 20636625426020718969131298365984859231982649550971729229988535915544421356929, 6046202021237334713296073963481784771443313518730771623154467767602059802325, 16227963524034219233279650312501310147918176407385833422019760797222680144279 diff --git a/zokrates_stdlib/tests/tests/hashes/sha3/256bit.zok b/zokrates_stdlib/tests/tests/hashes/sha3/256bit.zok index 203bb9706..243dea412 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha3/256bit.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha3/256bit.zok @@ -9,6 +9,6 @@ import "hashes/sha3/256bit" as sha3_256 // '18d00c9e97cd5516243b67b243ede9e2cf0d45d3a844d33340bfc4efc9165100' def main(): - u64[4] h = sha3_256::<20>([42; 20]) + u64[4] h = sha3_256([42; 20]) assert(h == [0x18D00C9E97CD5516, 0x243B67B243EDE9E2, 0xCF0D45D3A844D333, 0x40BFC4EFC9165100]) return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha3/512bit.zok b/zokrates_stdlib/tests/tests/hashes/sha3/512bit.zok index 9e65810ad..69badc5f5 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha3/512bit.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha3/512bit.zok @@ -9,7 +9,7 @@ import "hashes/sha3/512bit" as sha3_512 // '73a0967b68de5ce1093cbd7482fd4de9ccc9c782e2edc71b583d26fe16fb19e3322a2a024b7f6e163fbb1a15161686dd3a39233f9cf8616e7c74e91fa1aa3b2b' def main(): - u64[8] h = sha3_512::<20>([42; 20]) + u64[8] h = sha3_512([42; 20]) assert(h == [ 0x73A0967B68DE5CE1, 0x093CBD7482FD4DE9, 0xCCC9C782E2EDC71B, 0x583D26FE16FB19E3, 0x322A2A024B7F6E16, 0x3FBB1A15161686DD, 0x3A39233F9CF8616E, 0x7C74E91FA1AA3B2B From 9895e85ea6ff168f215510e5a8d72f78b9ededf4 Mon Sep 17 00:00:00 2001 From: schaeff Date: Thu, 23 Sep 2021 16:49:20 +0300 Subject: [PATCH 24/83] remap generics when checking struct alias --- zokrates_core/src/semantics.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index fb4687e66..cabf41551 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1547,7 +1547,11 @@ impl<'ast, T: Field> Checker<'ast, T> { // we only remap the generics DeclarationType::Struct(declared_struct_ty) => { DeclarationType::Struct(DeclarationStructType { - generics: checked_generics, + generics: declared_struct_ty + .generics + .into_iter() + .map(|g| g.map(|g| g.map(&assignment).unwrap())) + .collect(), ..declared_struct_ty }) } From 87115c8cd1dc69b68e57107335dc41ab57bd9ac2 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 24 Sep 2021 15:15:58 +0300 Subject: [PATCH 25/83] check generics on structs and infer them --- zokrates_core/src/typed_absy/types.rs | 50 ++++++++++++++-------- zokrates_stdlib/tests/tests/snark/gm17.zok | 2 +- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 750de0242..c21031b20 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -965,6 +965,33 @@ impl<'ast> ConcreteFunctionKey<'ast> { use std::collections::btree_map::Entry; +// check an optional generic value against the corresponding declaration constant +// if None is provided, return true +// if some value is provided, insert it into the map or check that it doesn't conflict if a value is already thereq +pub fn check_generic<'ast, S: Clone + PartialEq + PartialEq>( + generic: &DeclarationConstant<'ast>, + value: Option<&S>, + constants: &mut GGenericsAssignment<'ast, S>, +) -> bool { + value + .map(|value| match generic { + // if the generic is an identifier, we insert into the map, or check if the concrete size + // matches if this identifier is already in the map + DeclarationConstant::Generic(id) => match constants.0.entry(id.clone()) { + Entry::Occupied(e) => *e.get() == *value, + Entry::Vacant(e) => { + e.insert(value.clone()); + true + } + }, + DeclarationConstant::Concrete(generic) => *value == *generic, + // in the case of a constant, we do not know the value yet, so we optimistically assume it's correct + // if it does not match, it will be caught during inlining + DeclarationConstant::Constant(..) => true, + }) + .unwrap_or(true) +} + pub fn check_type<'ast, S: Clone + PartialEq + PartialEq>( decl_ty: &DeclarationType<'ast>, ty: >ype, @@ -972,31 +999,20 @@ pub fn check_type<'ast, S: Clone + PartialEq + PartialEq>( ) -> bool { match (decl_ty, ty) { (DeclarationType::Array(t0), GType::Array(t1)) => { - let s1 = t1.size.clone(); - // both the inner type and the size must match check_type(&t0.ty, &t1.ty, constants) - && match &t0.size { - // if the declared size is an identifier, we insert into the map, or check if the concrete size - // matches if this identifier is already in the map - DeclarationConstant::Generic(id) => match constants.0.entry(id.clone()) { - Entry::Occupied(e) => *e.get() == s1, - Entry::Vacant(e) => { - e.insert(s1); - true - } - }, - DeclarationConstant::Concrete(s0) => s1 == *s0 as u32, - // in the case of a constant, we do not know the value yet, so we optimistically assume it's correct - // if it does not match, it will be caught during inlining - DeclarationConstant::Constant(..) => true, - } + && check_generic(&t0.size, Some(&t1.size), constants) } (DeclarationType::FieldElement, GType::FieldElement) | (DeclarationType::Boolean, GType::Boolean) => true, (DeclarationType::Uint(b0), GType::Uint(b1)) => b0 == b1, (DeclarationType::Struct(s0), GType::Struct(s1)) => { s0.canonical_location == s1.canonical_location + && s0 + .generics + .iter() + .zip(s1.generics.iter()) + .all(|(g0, g1)| check_generic(g0.as_ref().unwrap(), g1.as_ref(), constants)) } _ => false, } diff --git a/zokrates_stdlib/tests/tests/snark/gm17.zok b/zokrates_stdlib/tests/tests/snark/gm17.zok index d09a2473a..6efc36b12 100644 --- a/zokrates_stdlib/tests/tests/snark/gm17.zok +++ b/zokrates_stdlib/tests/tests/snark/gm17.zok @@ -54,4 +54,4 @@ from "snark/gm17" import main as verify, Proof, VerificationKey def main(Proof<3> proof, VerificationKey<4> vk) -> bool: - return verify::<3, 4>(proof, vk) \ No newline at end of file + return verify(proof, vk) \ No newline at end of file From 42fd168029ebb1def1e554f4bc57ca8a548b3e3f Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 27 Sep 2021 15:07:14 +0200 Subject: [PATCH 26/83] safe unpack on field to uint casts --- zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok | 12 +++++------- zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok | 12 +++++------- zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok | 12 +++++------- zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok | 12 +++++------- .../tests/tests/utils/casts/field_to_uint.json | 4 ++-- .../tests/tests/utils/casts/field_to_uint.zok | 12 ++++++------ 6 files changed, 28 insertions(+), 36 deletions(-) diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok index 810208d64..8febe4b2b 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u16.zok @@ -1,9 +1,7 @@ -from "EMBED" import unpack, u16_from_bits +from "field" import FIELD_SIZE_IN_BITS +import "utils/pack/bool/unpack" +import "utils/casts/u16_from_bits" -const field U16_MAX = 65535 - -// Condition: field value is asserted to be in range [0, U16_MAX] def main(field input) -> u16: - assert(input <= U16_MAX) - bool[16] bits = unpack(input) - return u16_from_bits(bits) \ No newline at end of file + bool[FIELD_SIZE_IN_BITS] bits = unpack(input) + return u16_from_bits(bits[FIELD_SIZE_IN_BITS-16..]) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok index fc5c6a565..28577d795 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u32.zok @@ -1,9 +1,7 @@ -from "EMBED" import unpack, u32_from_bits +from "field" import FIELD_SIZE_IN_BITS +import "utils/pack/bool/unpack" +import "utils/casts/u32_from_bits" -const field U32_MAX = 4294967295 - -// Condition: field value is asserted to be in range [0, U32_MAX] def main(field input) -> u32: - assert(input <= U32_MAX) - bool[32] bits = unpack(input) - return u32_from_bits(bits) \ No newline at end of file + bool[FIELD_SIZE_IN_BITS] bits = unpack(input) + return u32_from_bits(bits[FIELD_SIZE_IN_BITS-32..]) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok index 1b99ee74d..d614ebcff 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u64.zok @@ -1,9 +1,7 @@ -from "EMBED" import unpack, u64_from_bits +from "field" import FIELD_SIZE_IN_BITS +import "utils/pack/bool/unpack" +import "utils/casts/u64_from_bits" -const field U64_MAX = 18446744073709551615 - -// Condition: field value is asserted to be in range [0, U64_MAX] def main(field input) -> u64: - assert(input <= U64_MAX) - bool[64] bits = unpack(input) - return u64_from_bits(bits) \ No newline at end of file + bool[FIELD_SIZE_IN_BITS] bits = unpack(input) + return u64_from_bits(bits[FIELD_SIZE_IN_BITS-64..]) \ No newline at end of file diff --git a/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok b/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok index bda7f6e24..99c795fde 100644 --- a/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok +++ b/zokrates_stdlib/stdlib/utils/casts/field_to_u8.zok @@ -1,9 +1,7 @@ -from "EMBED" import unpack, u8_from_bits +from "field" import FIELD_SIZE_IN_BITS +import "utils/pack/bool/unpack" +import "utils/casts/u8_from_bits" -const field U8_MAX = 255 - -// Condition: field value is asserted to be in range [0, U8_MAX] def main(field input) -> u8: - assert(input <= U8_MAX) - bool[8] bits = unpack(input) - return u8_from_bits(bits) \ No newline at end of file + bool[FIELD_SIZE_IN_BITS] bits = unpack(input) + return u8_from_bits(bits[FIELD_SIZE_IN_BITS-8..]) \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.json b/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.json index 1c988f730..0e617ee32 100644 --- a/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.json +++ b/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.json @@ -4,11 +4,11 @@ "tests": [ { "input": { - "values": ["0", "1", "18446744073709551615", "42", "0", "1", "4294967295", "42", "0", "1", "65535", "42", "0", "1", "255", "42"] + "values": ["0", "1", "18446744073709551615", "18446744073709551616", "18446744073709551658", "0", "1", "4294967295", "4294967296", "4294967338", "0", "1", "65535", "65536", "65578", "0", "1", "255", "256", "298"] }, "output": { "Ok": { - "values": ["0", "1", "18446744073709551615", "42", "0", "1", "4294967295", "42", "0", "1", "65535", "42", "0", "1", "255", "42"] + "values": ["0", "1", "18446744073709551615", "0", "42", "0", "1", "4294967295", "0", "42", "0", "1", "65535", "0", "42", "0", "1", "255", "0", "42"] } } } diff --git a/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.zok b/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.zok index b8a3de762..4d5be3bbd 100644 --- a/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.zok +++ b/zokrates_stdlib/tests/tests/utils/casts/field_to_uint.zok @@ -3,13 +3,13 @@ import "utils/casts/field_to_u32" import "utils/casts/field_to_u16" import "utils/casts/field_to_u8" -def main(field[4] a, field[4] b, field[4] c, field[4] d) -> (u64[4], u32[4], u16[4], u8[4]): - u64[4] e = [0; 4] - u32[4] f = [0; 4] - u16[4] g = [0; 4] - u8[4] h = [0; 4] +def main(field[5] a, field[5] b, field[5] c, field[5] d) -> (u64[5], u32[5], u16[5], u8[5]): + u64[5] e = [0; 5] + u32[5] f = [0; 5] + u16[5] g = [0; 5] + u8[5] h = [0; 5] - for u32 i in 0..4 do + for u32 i in 0..5 do e[i] = field_to_u64(a[i]) f[i] = field_to_u32(b[i]) g[i] = field_to_u16(c[i]) From 2ff4189ab92f39879812b35214c152f38276c27a Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 27 Sep 2021 15:10:07 +0200 Subject: [PATCH 27/83] add changelog --- changelogs/unreleased/997-dark64 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/997-dark64 diff --git a/changelogs/unreleased/997-dark64 b/changelogs/unreleased/997-dark64 new file mode 100644 index 000000000..95d5971be --- /dev/null +++ b/changelogs/unreleased/997-dark64 @@ -0,0 +1 @@ +Make field to uint casts truncate values bigger than uint max \ No newline at end of file From 995851a03c8ebdd139c73604de526e532b3c618e Mon Sep 17 00:00:00 2001 From: Thibaut Schaeffer Date: Mon, 27 Sep 2021 20:58:04 +0300 Subject: [PATCH 28/83] Create 1016-schaeff --- changelogs/unreleased/1016-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1016-schaeff diff --git a/changelogs/unreleased/1016-schaeff b/changelogs/unreleased/1016-schaeff new file mode 100644 index 000000000..d944de965 --- /dev/null +++ b/changelogs/unreleased/1016-schaeff @@ -0,0 +1 @@ +Fix false positives and false negatives in struct generic inference From 3ad893889715d3536d34dcd55c8d759cbe93e5d0 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 27 Sep 2021 20:51:30 +0200 Subject: [PATCH 29/83] add failing test for unpack --- .../examples/compile_errors/unpack_value_too_large.zok | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 zokrates_cli/examples/compile_errors/unpack_value_too_large.zok diff --git a/zokrates_cli/examples/compile_errors/unpack_value_too_large.zok b/zokrates_cli/examples/compile_errors/unpack_value_too_large.zok new file mode 100644 index 000000000..c592d4a0b --- /dev/null +++ b/zokrates_cli/examples/compile_errors/unpack_value_too_large.zok @@ -0,0 +1,5 @@ +from "EMBED" import unpack + +def main(): + bool[2] bits = unpack(4) // we need 3 bits to unpack 4 + return \ No newline at end of file From f41639864a53860e4f3ced12ac5d61698d739cfc Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 28 Sep 2021 14:23:29 +0200 Subject: [PATCH 30/83] minor refactor --- zokrates_core/src/absy/mod.rs | 7 +++---- zokrates_core/src/typed_absy/mod.rs | 14 ++++++-------- zokrates_core/src/zir/mod.rs | 7 +++---- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/zokrates_core/src/absy/mod.rs b/zokrates_core/src/absy/mod.rs index 31150df4c..14b67f4ab 100644 --- a/zokrates_core/src/absy/mod.rs +++ b/zokrates_core/src/absy/mod.rs @@ -357,10 +357,9 @@ impl<'ast> fmt::Display for Statement<'ast> { Statement::Definition(ref lhs, ref rhs) => write!(f, "{} = {}", lhs, rhs), Statement::Assertion(ref e, ref message) => { write!(f, "assert({}", e)?; - if message.is_some() { - write!(f, ", \"{}\")", message.as_ref().unwrap()) - } else { - write!(f, ")") + match message { + Some(m) => write!(f, ", \"{}\")", m), + None => write!(f, ")"), } } Statement::For(ref var, ref start, ref stop, ref list) => { diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index 3b4a90394..c1286150b 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -496,10 +496,9 @@ pub struct AssertionMetadata { impl fmt::Display for AssertionMetadata { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Assertion failed at {}:{}", self.file, self.position)?; - if self.message.is_some() { - write!(f, ": \"{}\"", self.message.as_ref().unwrap()) - } else { - write!(f, "") + match &self.message { + Some(m) => write!(f, ": \"{}\"", m), + None => write!(f, ""), } } } @@ -562,10 +561,9 @@ impl<'ast, T: fmt::Display> fmt::Display for TypedStatement<'ast, T> { TypedStatement::Assertion(ref e, ref metadata) => { write!(f, "assert({}", e)?; let metadata = metadata.as_ref().unwrap(); - if metadata.message.is_some() { - write!(f, ", \"{}\")", metadata.message.as_ref().unwrap()) - } else { - write!(f, ")") + match &metadata.message { + Some(m) => write!(f, ", \"{}\")", m), + None => write!(f, ")"), } } TypedStatement::For(ref var, ref start, ref stop, ref list) => { diff --git a/zokrates_core/src/zir/mod.rs b/zokrates_core/src/zir/mod.rs index bc54c58aa..01abcaa66 100644 --- a/zokrates_core/src/zir/mod.rs +++ b/zokrates_core/src/zir/mod.rs @@ -135,10 +135,9 @@ impl<'ast, T: fmt::Display> fmt::Display for ZirStatement<'ast, T> { ZirStatement::Assertion(ref e, ref metadata) => { write!(f, "assert({}", e)?; let metadata = metadata.as_ref().unwrap(); - if metadata.message.is_some() { - write!(f, ", \"{}\")", metadata.message.as_ref().unwrap()) - } else { - write!(f, ")") + match &metadata.message { + Some(m) => write!(f, ", \"{}\")", m), + None => write!(f, ")"), } } ZirStatement::MultipleDefinition(ref ids, ref rhs) => { From fe6a334997795932fa0caf59b9b9295317aa23f8 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 29 Sep 2021 15:10:31 +0200 Subject: [PATCH 31/83] fix interpreter error display --- zokrates_core/src/ir/interpreter.rs | 31 ++++------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/zokrates_core/src/ir/interpreter.rs b/zokrates_core/src/ir/interpreter.rs index be02e8b1a..d4c06c8c8 100644 --- a/zokrates_core/src/ir/interpreter.rs +++ b/zokrates_core/src/ir/interpreter.rs @@ -55,8 +55,6 @@ impl Interpreter { let rhs_value = lin.evaluate(&witness).unwrap(); if lhs_value != rhs_value { return Err(Error::UnsatisfiedConstraint { - left: lhs_value.to_dec_string(), - right: rhs_value.to_dec_string(), error: error.to_owned(), }); } @@ -280,37 +278,16 @@ impl QuadComb { #[derive(PartialEq, Serialize, Deserialize, Clone)] pub enum Error { - UnsatisfiedConstraint { - left: String, - right: String, - error: Option, - }, + UnsatisfiedConstraint { error: Option }, Solver, - WrongInputCount { - expected: usize, - received: usize, - }, + WrongInputCount { expected: usize, received: usize }, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { - Error::UnsatisfiedConstraint { - ref left, - ref right, - ref error, - } => { - write!( - f, - "{}", - error - .as_ref() - .map(|m| m.to_string()) - .unwrap_or_else(|| format!( - "Unsatisfied constraint: expected {} to equal {}", - left, right - )) - )?; + Error::UnsatisfiedConstraint { ref error } => { + write!(f, "{}", error.as_ref().map(|m| m.to_string()).unwrap())?; match error { Some(e) if e.is_malicious() => { From 6d7482f347050d2e7bf8178101a52c036b73634e Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 29 Sep 2021 15:14:17 +0200 Subject: [PATCH 32/83] use expect instead of unwrap --- zokrates_core/src/ir/interpreter.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zokrates_core/src/ir/interpreter.rs b/zokrates_core/src/ir/interpreter.rs index d4c06c8c8..ba256c88b 100644 --- a/zokrates_core/src/ir/interpreter.rs +++ b/zokrates_core/src/ir/interpreter.rs @@ -287,7 +287,14 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Error::UnsatisfiedConstraint { ref error } => { - write!(f, "{}", error.as_ref().map(|m| m.to_string()).unwrap())?; + write!( + f, + "{}", + error + .as_ref() + .map(|m| m.to_string()) + .expect("Found an unsatisfied constraint without an attached error.") + )?; match error { Some(e) if e.is_malicious() => { From ef7183cae05cdda0f103675b65b8ba427a50c697 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 29 Sep 2021 18:46:12 +0200 Subject: [PATCH 33/83] differentiate between if-expression and ternary expression in typed_absy --- zokrates_core/src/absy/from_ast.rs | 23 ++- zokrates_core/src/absy/mod.rs | 26 ++- zokrates_core/src/semantics.rs | 23 ++- .../src/static_analysis/branch_isolator.rs | 11 +- .../static_analysis/flatten_complex_types.rs | 30 ++-- .../src/static_analysis/propagation.rs | 22 +-- .../static_analysis/variable_write_remover.rs | 15 +- zokrates_core/src/typed_absy/folder.rs | 58 +++---- zokrates_core/src/typed_absy/integer.rs | 25 +-- zokrates_core/src/typed_absy/mod.rs | 150 ++++++++++++------ zokrates_core/src/typed_absy/result_folder.rs | 67 ++++---- zokrates_core/src/typed_absy/uint.rs | 2 +- zokrates_parser/src/zokrates.pest | 4 +- zokrates_pest_ast/src/lib.rs | 88 +++++----- 14 files changed, 334 insertions(+), 210 deletions(-) diff --git a/zokrates_core/src/absy/from_ast.rs b/zokrates_core/src/absy/from_ast.rs index a968b9c29..4dc5ee53d 100644 --- a/zokrates_core/src/absy/from_ast.rs +++ b/zokrates_core/src/absy/from_ast.rs @@ -375,6 +375,7 @@ impl<'ast> From> for absy::ExpressionNode<'ast> { match expression { pest::Expression::Binary(e) => absy::ExpressionNode::from(e), pest::Expression::Ternary(e) => absy::ExpressionNode::from(e), + pest::Expression::IfElse(e) => absy::ExpressionNode::from(e), pest::Expression::Literal(e) => absy::ExpressionNode::from(e), pest::Expression::Identifier(e) => absy::ExpressionNode::from(e), pest::Expression::Postfix(e) => absy::ExpressionNode::from(e), @@ -475,13 +476,27 @@ impl<'ast> From> for absy::ExpressionNode<'ast> { } } +impl<'ast> From> for absy::ExpressionNode<'ast> { + fn from(expression: pest::IfElseExpression<'ast>) -> absy::ExpressionNode<'ast> { + use crate::absy::NodeValue; + absy::Expression::Conditional( + box absy::ExpressionNode::from(*expression.condition), + box absy::ExpressionNode::from(*expression.consequence), + box absy::ExpressionNode::from(*expression.alternative), + absy::ConditionalKind::IfElse, + ) + .span(expression.span) + } +} + impl<'ast> From> for absy::ExpressionNode<'ast> { fn from(expression: pest::TernaryExpression<'ast>) -> absy::ExpressionNode<'ast> { use crate::absy::NodeValue; - absy::Expression::IfElse( - box absy::ExpressionNode::from(*expression.first), - box absy::ExpressionNode::from(*expression.second), - box absy::ExpressionNode::from(*expression.third), + absy::Expression::Conditional( + box absy::ExpressionNode::from(*expression.condition), + box absy::ExpressionNode::from(*expression.consequence), + box absy::ExpressionNode::from(*expression.alternative), + absy::ConditionalKind::Ternary, ) .span(expression.span) } diff --git a/zokrates_core/src/absy/mod.rs b/zokrates_core/src/absy/mod.rs index 70fc76d09..422e0e760 100644 --- a/zokrates_core/src/absy/mod.rs +++ b/zokrates_core/src/absy/mod.rs @@ -454,6 +454,12 @@ impl<'ast> fmt::Display for Range<'ast> { } } +#[derive(Debug, Clone, PartialEq)] +pub enum ConditionalKind { + IfElse, + Ternary, +} + /// An expression #[derive(Debug, Clone, PartialEq)] pub enum Expression<'ast> { @@ -473,10 +479,11 @@ pub enum Expression<'ast> { Pow(Box>, Box>), Neg(Box>), Pos(Box>), - IfElse( + Conditional( Box>, Box>, Box>, + ConditionalKind, ), FunctionCall( FunctionIdentifier<'ast>, @@ -524,11 +531,18 @@ impl<'ast> fmt::Display for Expression<'ast> { Expression::Neg(ref e) => write!(f, "(-{})", e), Expression::Pos(ref e) => write!(f, "(+{})", e), Expression::BooleanConstant(b) => write!(f, "{}", b), - Expression::IfElse(ref condition, ref consequent, ref alternative) => write!( - f, - "if {} then {} else {} fi", - condition, consequent, alternative - ), + Expression::Conditional(ref condition, ref consequent, ref alternative, ref kind) => { + match kind { + ConditionalKind::IfElse => write!( + f, + "if {} then {} else {} fi", + condition, consequent, alternative + ), + ConditionalKind::Ternary => { + write!(f, "{} ? {} : {}", condition, consequent, alternative) + } + } + } Expression::FunctionCall(ref i, ref g, ref p) => { if let Some(g) = g { write!( diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 3864aa5ec..4274c7212 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -2213,7 +2213,7 @@ impl<'ast, T: Field> Checker<'ast, T> { }), } } - Expression::IfElse(box condition, box consequence, box alternative) => { + Expression::Conditional(box condition, box consequence, box alternative, kind) => { let condition_checked = self.check_expression(condition, module_id, types)?; let consequence_checked = self.check_expression(consequence, module_id, types)?; let alternative_checked = self.check_expression(alternative, module_id, types)?; @@ -2228,26 +2228,35 @@ impl<'ast, T: Field> Checker<'ast, T> { message: format!("{{consequence}} and {{alternative}} in conditional expression should have the same type, found {}, {}", e1.get_type(), e2.get_type()), })?; + let kind = match kind { + crate::absy::ConditionalKind::IfElse => { + crate::typed_absy::ConditionalKind::IfElse + } + crate::absy::ConditionalKind::Ternary => { + crate::typed_absy::ConditionalKind::Ternary + } + }; + match condition_checked { TypedExpression::Boolean(condition) => { match (consequence_checked, alternative_checked) { (TypedExpression::FieldElement(consequence), TypedExpression::FieldElement(alternative)) => { - Ok(FieldElementExpression::if_else(condition, consequence, alternative).into()) + Ok(FieldElementExpression::conditional(condition, consequence, alternative, kind).into()) }, (TypedExpression::Boolean(consequence), TypedExpression::Boolean(alternative)) => { - Ok(BooleanExpression::if_else(condition, consequence, alternative).into()) + Ok(BooleanExpression::conditional(condition, consequence, alternative, kind).into()) }, (TypedExpression::Array(consequence), TypedExpression::Array(alternative)) => { - Ok(ArrayExpression::if_else(condition, consequence, alternative).into()) + Ok(ArrayExpression::conditional(condition, consequence, alternative, kind).into()) }, (TypedExpression::Struct(consequence), TypedExpression::Struct(alternative)) => { - Ok(StructExpression::if_else(condition, consequence, alternative).into()) + Ok(StructExpression::conditional(condition, consequence, alternative, kind).into()) }, (TypedExpression::Uint(consequence), TypedExpression::Uint(alternative)) => { - Ok(UExpression::if_else(condition, consequence, alternative).into()) + Ok(UExpression::conditional(condition, consequence, alternative, kind).into()) }, (TypedExpression::Int(consequence), TypedExpression::Int(alternative)) => { - Ok(IntExpression::if_else(condition, consequence, alternative).into()) + Ok(IntExpression::conditional(condition, consequence, alternative, kind).into()) }, (c, a) => Err(ErrorInner { pos: Some(pos), diff --git a/zokrates_core/src/static_analysis/branch_isolator.rs b/zokrates_core/src/static_analysis/branch_isolator.rs index c9d848d81..775803866 100644 --- a/zokrates_core/src/static_analysis/branch_isolator.rs +++ b/zokrates_core/src/static_analysis/branch_isolator.rs @@ -17,17 +17,18 @@ impl Isolator { } impl<'ast, T: Field> Folder<'ast, T> for Isolator { - fn fold_if_else_expression< - E: Expr<'ast, T> + Block<'ast, T> + Fold<'ast, T> + IfElse<'ast, T>, + fn fold_conditional_expression< + E: Expr<'ast, T> + Block<'ast, T> + Fold<'ast, T> + Conditional<'ast, T>, >( &mut self, _: &E::Ty, - e: IfElseExpression<'ast, T, E>, - ) -> IfElseOrExpression<'ast, T, E> { - IfElseOrExpression::IfElse(IfElseExpression::new( + e: ConditionalExpression<'ast, T, E>, + ) -> ConditionalOrExpression<'ast, T, E> { + ConditionalOrExpression::Conditional(ConditionalExpression::new( self.fold_boolean_expression(*e.condition), E::block(vec![], e.consequence.fold(self)), E::block(vec![], e.alternative.fold(self)), + e.kind, )) } } diff --git a/zokrates_core/src/static_analysis/flatten_complex_types.rs b/zokrates_core/src/static_analysis/flatten_complex_types.rs index f3973297a..5c55a98dd 100644 --- a/zokrates_core/src/static_analysis/flatten_complex_types.rs +++ b/zokrates_core/src/static_analysis/flatten_complex_types.rs @@ -281,12 +281,12 @@ impl<'ast, T: Field> Flattener { } } - fn fold_if_else_expression>( + fn fold_conditional_expression>( &mut self, statements_buffer: &mut Vec>, - c: typed_absy::IfElseExpression<'ast, T, E>, + c: typed_absy::ConditionalExpression<'ast, T, E>, ) -> Vec> { - fold_if_else_expression(self, statements_buffer, c) + fold_conditional_expression(self, statements_buffer, c) } fn fold_member_expression( @@ -442,8 +442,8 @@ fn fold_array_expression_inner<'ast, T: Field>( exprs } typed_absy::ArrayExpressionInner::FunctionCall(..) => unreachable!(), - typed_absy::ArrayExpressionInner::IfElse(c) => { - f.fold_if_else_expression(statements_buffer, c) + typed_absy::ArrayExpressionInner::Conditional(c) => { + f.fold_conditional_expression(statements_buffer, c) } typed_absy::ArrayExpressionInner::Member(m) => { f.fold_member_expression(statements_buffer, m) @@ -517,8 +517,8 @@ fn fold_struct_expression_inner<'ast, T: Field>( .flat_map(|e| f.fold_expression(statements_buffer, e)) .collect(), typed_absy::StructExpressionInner::FunctionCall(..) => unreachable!(), - typed_absy::StructExpressionInner::IfElse(c) => { - f.fold_if_else_expression(statements_buffer, c) + typed_absy::StructExpressionInner::Conditional(c) => { + f.fold_conditional_expression(statements_buffer, c) } typed_absy::StructExpressionInner::Member(m) => { f.fold_member_expression(statements_buffer, m) @@ -640,10 +640,10 @@ fn fold_select_expression<'ast, T: Field, E>( } } -fn fold_if_else_expression<'ast, T: Field, E: Flatten<'ast, T>>( +fn fold_conditional_expression<'ast, T: Field, E: Flatten<'ast, T>>( f: &mut Flattener, statements_buffer: &mut Vec>, - c: typed_absy::IfElseExpression<'ast, T, E>, + c: typed_absy::ConditionalExpression<'ast, T, E>, ) -> Vec> { let mut consequence_statements = vec![]; let mut alternative_statements = vec![]; @@ -736,8 +736,8 @@ fn fold_field_expression<'ast, T: Field>( typed_absy::FieldElementExpression::Pos(box e) => { f.fold_field_expression(statements_buffer, e) } - typed_absy::FieldElementExpression::IfElse(c) => f - .fold_if_else_expression(statements_buffer, c) + typed_absy::FieldElementExpression::Conditional(c) => f + .fold_conditional_expression(statements_buffer, c) .pop() .unwrap() .try_into() @@ -902,8 +902,8 @@ fn fold_boolean_expression<'ast, T: Field>( let e = f.fold_boolean_expression(statements_buffer, e); zir::BooleanExpression::Not(box e) } - typed_absy::BooleanExpression::IfElse(c) => f - .fold_if_else_expression(statements_buffer, c) + typed_absy::BooleanExpression::Conditional(c) => f + .fold_conditional_expression(statements_buffer, c) .pop() .unwrap() .try_into() @@ -1064,8 +1064,8 @@ fn fold_uint_expression_inner<'ast, T: Field>( ) .unwrap() .into_inner(), - typed_absy::UExpressionInner::IfElse(c) => zir::UExpression::try_from( - f.fold_if_else_expression(statements_buffer, c) + typed_absy::UExpressionInner::Conditional(c) => zir::UExpression::try_from( + f.fold_conditional_expression(statements_buffer, c) .pop() .unwrap(), ) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index 38c29a0cb..c8b2d050f 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -173,13 +173,13 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { fold_function(self, f) } - fn fold_if_else_expression< - E: Expr<'ast, T> + IfElse<'ast, T> + PartialEq + ResultFold<'ast, T>, + fn fold_conditional_expression< + E: Expr<'ast, T> + Conditional<'ast, T> + PartialEq + ResultFold<'ast, T>, >( &mut self, _: &E::Ty, - e: IfElseExpression<'ast, T, E>, - ) -> Result, Self::Error> { + e: ConditionalExpression<'ast, T, E>, + ) -> Result, Self::Error> { Ok( match ( self.fold_boolean_expression(*e.condition)?, @@ -187,16 +187,16 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { e.alternative.fold(self)?, ) { (BooleanExpression::Value(true), consequence, _) => { - IfElseOrExpression::Expression(consequence.into_inner()) + ConditionalOrExpression::Expression(consequence.into_inner()) } (BooleanExpression::Value(false), _, alternative) => { - IfElseOrExpression::Expression(alternative.into_inner()) + ConditionalOrExpression::Expression(alternative.into_inner()) } (_, consequence, alternative) if consequence == alternative => { - IfElseOrExpression::Expression(consequence.into_inner()) + ConditionalOrExpression::Expression(consequence.into_inner()) } - (condition, consequence, alternative) => IfElseOrExpression::IfElse( - IfElseExpression::new(condition, consequence, alternative), + (condition, consequence, alternative) => ConditionalOrExpression::Conditional( + ConditionalExpression::new(condition, consequence, alternative, e.kind), ), }, ) @@ -1431,7 +1431,7 @@ mod tests { #[test] fn if_else_true() { - let e = FieldElementExpression::if_else( + let e = FieldElementExpression::conditional( BooleanExpression::Value(true), FieldElementExpression::Number(Bn128Field::from(2)), FieldElementExpression::Number(Bn128Field::from(3)), @@ -1445,7 +1445,7 @@ mod tests { #[test] fn if_else_false() { - let e = FieldElementExpression::if_else( + let e = FieldElementExpression::conditional( BooleanExpression::Value(false), FieldElementExpression::Number(Bn128Field::from(2)), FieldElementExpression::Number(Bn128Field::from(3)), diff --git a/zokrates_core/src/static_analysis/variable_write_remover.rs b/zokrates_core/src/static_analysis/variable_write_remover.rs index 82cc206ec..30582d438 100644 --- a/zokrates_core/src/static_analysis/variable_write_remover.rs +++ b/zokrates_core/src/static_analysis/variable_write_remover.rs @@ -55,7 +55,7 @@ impl<'ast> VariableWriteRemover { (0..size) .map(|i| match inner_ty { Type::Int => unreachable!(), - Type::Array(..) => ArrayExpression::if_else( + Type::Array(..) => ArrayExpression::conditional( BooleanExpression::UintEq( box i.into(), box head.clone(), @@ -73,9 +73,10 @@ impl<'ast> VariableWriteRemover { ), }, ArrayExpression::select(base.clone(), i), + ConditionalKind::IfElse, ) .into(), - Type::Struct(..) => StructExpression::if_else( + Type::Struct(..) => StructExpression::conditional( BooleanExpression::UintEq( box i.into(), box head.clone(), @@ -93,9 +94,10 @@ impl<'ast> VariableWriteRemover { ), }, StructExpression::select(base.clone(), i), + ConditionalKind::IfElse, ) .into(), - Type::FieldElement => FieldElementExpression::if_else( + Type::FieldElement => FieldElementExpression::conditional( BooleanExpression::UintEq( box i.into(), box head.clone(), @@ -114,9 +116,10 @@ impl<'ast> VariableWriteRemover { ), }, FieldElementExpression::select(base.clone(), i), + ConditionalKind::IfElse, ) .into(), - Type::Boolean => BooleanExpression::if_else( + Type::Boolean => BooleanExpression::conditional( BooleanExpression::UintEq( box i.into(), box head.clone(), @@ -134,9 +137,10 @@ impl<'ast> VariableWriteRemover { ), }, BooleanExpression::select(base.clone(), i), + ConditionalKind::IfElse, ) .into(), - Type::Uint(..) => UExpression::if_else( + Type::Uint(..) => UExpression::conditional( BooleanExpression::UintEq( box i.into(), box head.clone(), @@ -154,6 +158,7 @@ impl<'ast> VariableWriteRemover { ), }, UExpression::select(base.clone(), i), + ConditionalKind::IfElse, ) .into(), }) diff --git a/zokrates_core/src/typed_absy/folder.rs b/zokrates_core/src/typed_absy/folder.rs index 6bb1cc197..5f0382dc4 100644 --- a/zokrates_core/src/typed_absy/folder.rs +++ b/zokrates_core/src/typed_absy/folder.rs @@ -258,18 +258,18 @@ pub trait Folder<'ast, T: Field>: Sized { fold_block_expression(self, block) } - fn fold_if_else_expression< + fn fold_conditional_expression< E: Expr<'ast, T> + Fold<'ast, T> + Block<'ast, T> - + IfElse<'ast, T> + + Conditional<'ast, T> + From>, >( &mut self, ty: &E::Ty, - e: IfElseExpression<'ast, T, E>, - ) -> IfElseOrExpression<'ast, T, E> { - fold_if_else_expression(self, ty, e) + e: ConditionalExpression<'ast, T, E>, + ) -> ConditionalOrExpression<'ast, T, E> { + fold_conditional_expression(self, ty, e) } fn fold_member_expression< @@ -293,7 +293,7 @@ pub trait Folder<'ast, T: Field>: Sized { } fn fold_select_expression< - E: Expr<'ast, T> + Select<'ast, T> + IfElse<'ast, T> + From>, + E: Expr<'ast, T> + Select<'ast, T> + Conditional<'ast, T> + From>, >( &mut self, ty: &E::Ty, @@ -459,9 +459,9 @@ pub fn fold_array_expression_inner<'ast, T: Field, F: Folder<'ast, T>>( FunctionCallOrExpression::Expression(u) => u, } } - ArrayExpressionInner::IfElse(c) => match f.fold_if_else_expression(ty, c) { - IfElseOrExpression::IfElse(s) => ArrayExpressionInner::IfElse(s), - IfElseOrExpression::Expression(u) => u, + ArrayExpressionInner::Conditional(c) => match f.fold_conditional_expression(ty, c) { + ConditionalOrExpression::Conditional(s) => ArrayExpressionInner::Conditional(s), + ConditionalOrExpression::Expression(u) => u, }, ArrayExpressionInner::Select(select) => match f.fold_select_expression(ty, select) { SelectOrExpression::Select(s) => ArrayExpressionInner::Select(s), @@ -506,9 +506,9 @@ pub fn fold_struct_expression_inner<'ast, T: Field, F: Folder<'ast, T>>( FunctionCallOrExpression::Expression(u) => u, } } - StructExpressionInner::IfElse(c) => match f.fold_if_else_expression(ty, c) { - IfElseOrExpression::IfElse(s) => StructExpressionInner::IfElse(s), - IfElseOrExpression::Expression(u) => u, + StructExpressionInner::Conditional(c) => match f.fold_conditional_expression(ty, c) { + ConditionalOrExpression::Conditional(s) => StructExpressionInner::Conditional(s), + ConditionalOrExpression::Expression(u) => u, }, StructExpressionInner::Select(select) => match f.fold_select_expression(ty, select) { SelectOrExpression::Select(s) => StructExpressionInner::Select(s), @@ -568,10 +568,10 @@ pub fn fold_field_expression<'ast, T: Field, F: Folder<'ast, T>>( FieldElementExpression::Pos(box e) } - FieldElementExpression::IfElse(c) => { - match f.fold_if_else_expression(&Type::FieldElement, c) { - IfElseOrExpression::IfElse(s) => FieldElementExpression::IfElse(s), - IfElseOrExpression::Expression(u) => u, + FieldElementExpression::Conditional(c) => { + match f.fold_conditional_expression(&Type::FieldElement, c) { + ConditionalOrExpression::Conditional(s) => FieldElementExpression::Conditional(s), + ConditionalOrExpression::Expression(u) => u, } } FieldElementExpression::FunctionCall(function_call) => { @@ -596,20 +596,21 @@ pub fn fold_field_expression<'ast, T: Field, F: Folder<'ast, T>>( } } -pub fn fold_if_else_expression< +pub fn fold_conditional_expression< 'ast, T: Field, - E: Expr<'ast, T> + Fold<'ast, T> + IfElse<'ast, T> + From>, + E: Expr<'ast, T> + Fold<'ast, T> + Conditional<'ast, T> + From>, F: Folder<'ast, T>, >( f: &mut F, _: &E::Ty, - e: IfElseExpression<'ast, T, E>, -) -> IfElseOrExpression<'ast, T, E> { - IfElseOrExpression::IfElse(IfElseExpression::new( + e: ConditionalExpression<'ast, T, E>, +) -> ConditionalOrExpression<'ast, T, E> { + ConditionalOrExpression::Conditional(ConditionalExpression::new( f.fold_boolean_expression(*e.condition), e.consequence.fold(f), e.alternative.fold(f), + e.kind, )) } @@ -632,7 +633,7 @@ pub fn fold_member_expression< pub fn fold_select_expression< 'ast, T: Field, - E: Expr<'ast, T> + Select<'ast, T> + IfElse<'ast, T> + From>, + E: Expr<'ast, T> + Select<'ast, T> + Conditional<'ast, T> + From>, F: Folder<'ast, T>, >( f: &mut F, @@ -747,9 +748,10 @@ pub fn fold_boolean_expression<'ast, T: Field, F: Folder<'ast, T>>( FunctionCallOrExpression::Expression(u) => u, } } - BooleanExpression::IfElse(c) => match f.fold_if_else_expression(&Type::Boolean, c) { - IfElseOrExpression::IfElse(s) => BooleanExpression::IfElse(s), - IfElseOrExpression::Expression(u) => u, + BooleanExpression::Conditional(c) => match f.fold_conditional_expression(&Type::Boolean, c) + { + ConditionalOrExpression::Conditional(s) => BooleanExpression::Conditional(s), + ConditionalOrExpression::Expression(u) => u, }, BooleanExpression::Select(select) => match f.fold_select_expression(&Type::Boolean, select) { @@ -875,9 +877,9 @@ pub fn fold_uint_expression_inner<'ast, T: Field, F: Folder<'ast, T>>( SelectOrExpression::Select(s) => UExpressionInner::Select(s), SelectOrExpression::Expression(u) => u, }, - UExpressionInner::IfElse(c) => match f.fold_if_else_expression(&ty, c) { - IfElseOrExpression::IfElse(s) => UExpressionInner::IfElse(s), - IfElseOrExpression::Expression(u) => u, + UExpressionInner::Conditional(c) => match f.fold_conditional_expression(&ty, c) { + ConditionalOrExpression::Conditional(s) => UExpressionInner::Conditional(s), + ConditionalOrExpression::Expression(u) => u, }, UExpressionInner::Member(m) => match f.fold_member_expression(&ty, m) { MemberOrExpression::Member(m) => UExpressionInner::Member(m), diff --git a/zokrates_core/src/typed_absy/integer.rs b/zokrates_core/src/typed_absy/integer.rs index 62eba07c3..308cfd6fd 100644 --- a/zokrates_core/src/typed_absy/integer.rs +++ b/zokrates_core/src/typed_absy/integer.rs @@ -5,9 +5,10 @@ use crate::typed_absy::types::{ }; use crate::typed_absy::UBitwidth; use crate::typed_absy::{ - ArrayExpression, ArrayExpressionInner, BooleanExpression, Expr, FieldElementExpression, IfElse, - IfElseExpression, Select, SelectExpression, StructExpression, StructExpressionInner, Typed, - TypedExpression, TypedExpressionOrSpread, TypedSpread, UExpression, UExpressionInner, + ArrayExpression, ArrayExpressionInner, BooleanExpression, Conditional, ConditionalExpression, + Expr, FieldElementExpression, Select, SelectExpression, StructExpression, + StructExpressionInner, Typed, TypedExpression, TypedExpressionOrSpread, TypedSpread, + UExpression, UExpressionInner, }; use num_bigint::BigUint; use std::convert::TryFrom; @@ -239,7 +240,7 @@ pub enum IntExpression<'ast, T> { Div(Box>, Box>), Rem(Box>, Box>), Pow(Box>, Box>), - IfElse(IfElseExpression<'ast, T, IntExpression<'ast, T>>), + Conditional(ConditionalExpression<'ast, T, IntExpression<'ast, T>>), Select(SelectExpression<'ast, T, IntExpression<'ast, T>>), Xor(Box>, Box>), And(Box>, Box>), @@ -354,7 +355,7 @@ impl<'ast, T: fmt::Display> fmt::Display for IntExpression<'ast, T> { IntExpression::RightShift(ref e, ref by) => write!(f, "({} >> {})", e, by), IntExpression::LeftShift(ref e, ref by) => write!(f, "({} << {})", e, by), IntExpression::Not(ref e) => write!(f, "!{}", e), - IntExpression::IfElse(ref c) => write!(f, "{}", c), + IntExpression::Conditional(ref c) => write!(f, "{}", c), } } } @@ -404,10 +405,11 @@ impl<'ast, T: Field> FieldElementExpression<'ast, T> { )), IntExpression::Pos(box e) => Ok(Self::Pos(box Self::try_from_int(e)?)), IntExpression::Neg(box e) => Ok(Self::Neg(box Self::try_from_int(e)?)), - IntExpression::IfElse(c) => Ok(Self::IfElse(IfElseExpression::new( + IntExpression::Conditional(c) => Ok(Self::Conditional(ConditionalExpression::new( *c.condition, Self::try_from_int(*c.consequence)?, Self::try_from_int(*c.alternative)?, + c.kind, ))), IntExpression::Select(select) => { let array = *select.array; @@ -523,10 +525,11 @@ impl<'ast, T: Field> UExpression<'ast, T> { Self::try_from_int(e1, bitwidth)?, e2, )), - IfElse(c) => Ok(UExpression::if_else( + Conditional(c) => Ok(UExpression::conditional( *c.condition, Self::try_from_int(*c.consequence, bitwidth)?, Self::try_from_int(*c.alternative, bitwidth)?, + c.kind, )), Select(select) => { let array = *select.array; @@ -714,7 +717,7 @@ mod tests { n.clone() * n.clone(), IntExpression::pow(n.clone(), n.clone()), n.clone() / n.clone(), - IntExpression::if_else(c.clone(), n.clone(), n.clone()), + IntExpression::conditional(c.clone(), n.clone(), n.clone()), IntExpression::select(n_a.clone(), i.clone()), ]; @@ -725,7 +728,7 @@ mod tests { t.clone() * t.clone(), FieldElementExpression::pow(t.clone(), i.clone()), t.clone() / t.clone(), - FieldElementExpression::if_else(c.clone(), t.clone(), t.clone()), + FieldElementExpression::conditional(c.clone(), t.clone(), t.clone()), FieldElementExpression::select(t_a.clone(), i.clone()), ]; @@ -780,7 +783,7 @@ mod tests { IntExpression::left_shift(n.clone(), i.clone()), IntExpression::right_shift(n.clone(), i.clone()), !n.clone(), - IntExpression::if_else(c.clone(), n.clone(), n.clone()), + IntExpression::conditional(c.clone(), n.clone(), n.clone()), IntExpression::select(n_a.clone(), i.clone()), ]; @@ -797,7 +800,7 @@ mod tests { UExpression::left_shift(t.clone(), i.clone()), UExpression::right_shift(t.clone(), i.clone()), !t.clone(), - UExpression::if_else(c.clone(), t.clone(), t.clone()), + UExpression::conditional(c.clone(), t.clone(), t.clone()), UExpression::select(t_a.clone(), i.clone()), ]; diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index b31dfeee1..423328939 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -660,7 +660,7 @@ impl<'ast, T: fmt::Display> fmt::Display for StructExpression<'ast, T> { StructExpressionInner::FunctionCall(ref function_call) => { write!(f, "{}", function_call) } - StructExpressionInner::IfElse(ref c) => write!(f, "{}", c), + StructExpressionInner::Conditional(ref c) => write!(f, "{}", c), StructExpressionInner::Member(ref m) => write!(f, "{}", m), StructExpressionInner::Select(ref select) => write!(f, "{}", select), } @@ -805,30 +805,50 @@ impl<'ast, T: fmt::Display, E> fmt::Display for SelectExpression<'ast, T, E> { } } +#[derive(Debug, Clone, PartialEq, Hash, Eq)] +pub enum ConditionalKind { + IfElse, + Ternary, +} + #[derive(Clone, PartialEq, Debug, Hash, Eq)] -pub struct IfElseExpression<'ast, T, E> { +pub struct ConditionalExpression<'ast, T, E> { pub condition: Box>, pub consequence: Box, pub alternative: Box, + pub kind: ConditionalKind, } -impl<'ast, T, E> IfElseExpression<'ast, T, E> { - pub fn new(condition: BooleanExpression<'ast, T>, consequence: E, alternative: E) -> Self { - IfElseExpression { +impl<'ast, T, E> ConditionalExpression<'ast, T, E> { + pub fn new( + condition: BooleanExpression<'ast, T>, + consequence: E, + alternative: E, + kind: ConditionalKind, + ) -> Self { + ConditionalExpression { condition: box condition, consequence: box consequence, alternative: box alternative, + kind, } } } -impl<'ast, T: fmt::Display, E: fmt::Display> fmt::Display for IfElseExpression<'ast, T, E> { +impl<'ast, T: fmt::Display, E: fmt::Display> fmt::Display for ConditionalExpression<'ast, T, E> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!( - f, - "if {} then {} else {} fi", - self.condition, self.consequence, self.alternative - ) + match self.kind { + ConditionalKind::IfElse => write!( + f, + "if {} then {} else {} fi", + self.condition, self.consequence, self.alternative + ), + ConditionalKind::Ternary => write!( + f, + "{} ? {} : {}", + self.condition, self.consequence, self.alternative + ), + } } } @@ -910,7 +930,7 @@ pub enum FieldElementExpression<'ast, T> { Box>, Box>, ), - IfElse(IfElseExpression<'ast, T, Self>), + Conditional(ConditionalExpression<'ast, T, Self>), Neg(Box>), Pos(Box>), FunctionCall(FunctionCallExpression<'ast, T, Self>), @@ -1010,7 +1030,7 @@ pub enum BooleanExpression<'ast, T> { Box>, ), Not(Box>), - IfElse(IfElseExpression<'ast, T, Self>), + Conditional(ConditionalExpression<'ast, T, Self>), Member(MemberExpression<'ast, T, Self>), FunctionCall(FunctionCallExpression<'ast, T, Self>), Select(SelectExpression<'ast, T, Self>), @@ -1117,7 +1137,7 @@ pub enum ArrayExpressionInner<'ast, T> { Identifier(Identifier<'ast>), Value(ArrayValue<'ast, T>), FunctionCall(FunctionCallExpression<'ast, T, ArrayExpression<'ast, T>>), - IfElse(IfElseExpression<'ast, T, ArrayExpression<'ast, T>>), + Conditional(ConditionalExpression<'ast, T, ArrayExpression<'ast, T>>), Member(MemberExpression<'ast, T, ArrayExpression<'ast, T>>), Select(SelectExpression<'ast, T, ArrayExpression<'ast, T>>), Slice( @@ -1181,7 +1201,7 @@ pub enum StructExpressionInner<'ast, T> { Identifier(Identifier<'ast>), Value(Vec>), FunctionCall(FunctionCallExpression<'ast, T, StructExpression<'ast, T>>), - IfElse(IfElseExpression<'ast, T, StructExpression<'ast, T>>), + Conditional(ConditionalExpression<'ast, T, StructExpression<'ast, T>>), Member(MemberExpression<'ast, T, StructExpression<'ast, T>>), Select(SelectExpression<'ast, T, StructExpression<'ast, T>>), } @@ -1323,7 +1343,7 @@ impl<'ast, T: fmt::Display> fmt::Display for FieldElementExpression<'ast, T> { FieldElementExpression::Pow(ref lhs, ref rhs) => write!(f, "{}**{}", lhs, rhs), FieldElementExpression::Neg(ref e) => write!(f, "(-{})", e), FieldElementExpression::Pos(ref e) => write!(f, "(+{})", e), - FieldElementExpression::IfElse(ref c) => write!(f, "{}", c), + FieldElementExpression::Conditional(ref c) => write!(f, "{}", c), FieldElementExpression::FunctionCall(ref function_call) => { write!(f, "{}", function_call) } @@ -1357,7 +1377,7 @@ impl<'ast, T: fmt::Display> fmt::Display for UExpression<'ast, T> { UExpressionInner::Pos(ref e) => write!(f, "(+{})", e), UExpressionInner::Select(ref select) => write!(f, "{}", select), UExpressionInner::FunctionCall(ref function_call) => write!(f, "{}", function_call), - UExpressionInner::IfElse(ref c) => write!(f, "{}", c), + UExpressionInner::Conditional(ref c) => write!(f, "{}", c), UExpressionInner::Member(ref m) => write!(f, "{}", m), } } @@ -1386,7 +1406,7 @@ impl<'ast, T: fmt::Display> fmt::Display for BooleanExpression<'ast, T> { BooleanExpression::Not(ref exp) => write!(f, "!{}", exp), BooleanExpression::Value(b) => write!(f, "{}", b), BooleanExpression::FunctionCall(ref function_call) => write!(f, "{}", function_call), - BooleanExpression::IfElse(ref c) => write!(f, "{}", c), + BooleanExpression::Conditional(ref c) => write!(f, "{}", c), BooleanExpression::Member(ref m) => write!(f, "{}", m), BooleanExpression::Select(ref select) => write!(f, "{}", select), } @@ -1408,7 +1428,7 @@ impl<'ast, T: fmt::Display> fmt::Display for ArrayExpressionInner<'ast, T> { .join(", ") ), ArrayExpressionInner::FunctionCall(ref function_call) => write!(f, "{}", function_call), - ArrayExpressionInner::IfElse(ref c) => write!(f, "{}", c), + ArrayExpressionInner::Conditional(ref c) => write!(f, "{}", c), ArrayExpressionInner::Member(ref m) => write!(f, "{}", m), ArrayExpressionInner::Select(ref select) => write!(f, "{}", select), ArrayExpressionInner::Slice(ref a, ref from, ref to) => { @@ -1648,81 +1668,121 @@ pub enum MemberOrExpression<'ast, T, E: Expr<'ast, T>> { Expression(E::Inner), } -pub enum IfElseOrExpression<'ast, T, E: Expr<'ast, T>> { - IfElse(IfElseExpression<'ast, T, E>), +pub enum ConditionalOrExpression<'ast, T, E: Expr<'ast, T>> { + Conditional(ConditionalExpression<'ast, T, E>), Expression(E::Inner), } -pub trait IfElse<'ast, T> { - fn if_else(condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self) - -> Self; +pub trait Conditional<'ast, T> { + fn conditional( + condition: BooleanExpression<'ast, T>, + consequence: Self, + alternative: Self, + kind: ConditionalKind, + ) -> Self; } -impl<'ast, T> IfElse<'ast, T> for FieldElementExpression<'ast, T> { - fn if_else( +impl<'ast, T> Conditional<'ast, T> for FieldElementExpression<'ast, T> { + fn conditional( condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self, + kind: ConditionalKind, ) -> Self { - FieldElementExpression::IfElse(IfElseExpression::new(condition, consequence, alternative)) + FieldElementExpression::Conditional(ConditionalExpression::new( + condition, + consequence, + alternative, + kind, + )) } } -impl<'ast, T> IfElse<'ast, T> for IntExpression<'ast, T> { - fn if_else( +impl<'ast, T> Conditional<'ast, T> for IntExpression<'ast, T> { + fn conditional( condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self, + kind: ConditionalKind, ) -> Self { - IntExpression::IfElse(IfElseExpression::new(condition, consequence, alternative)) + IntExpression::Conditional(ConditionalExpression::new( + condition, + consequence, + alternative, + kind, + )) } } -impl<'ast, T> IfElse<'ast, T> for BooleanExpression<'ast, T> { - fn if_else( +impl<'ast, T> Conditional<'ast, T> for BooleanExpression<'ast, T> { + fn conditional( condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self, + kind: ConditionalKind, ) -> Self { - BooleanExpression::IfElse(IfElseExpression::new(condition, consequence, alternative)) + BooleanExpression::Conditional(ConditionalExpression::new( + condition, + consequence, + alternative, + kind, + )) } } -impl<'ast, T> IfElse<'ast, T> for UExpression<'ast, T> { - fn if_else( +impl<'ast, T> Conditional<'ast, T> for UExpression<'ast, T> { + fn conditional( condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self, + kind: ConditionalKind, ) -> Self { let bitwidth = consequence.bitwidth; - UExpressionInner::IfElse(IfElseExpression::new(condition, consequence, alternative)) - .annotate(bitwidth) + UExpressionInner::Conditional(ConditionalExpression::new( + condition, + consequence, + alternative, + kind, + )) + .annotate(bitwidth) } } -impl<'ast, T: Clone> IfElse<'ast, T> for ArrayExpression<'ast, T> { - fn if_else( +impl<'ast, T: Clone> Conditional<'ast, T> for ArrayExpression<'ast, T> { + fn conditional( condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self, + kind: ConditionalKind, ) -> Self { let ty = consequence.inner_type().clone(); let size = consequence.size(); - ArrayExpressionInner::IfElse(IfElseExpression::new(condition, consequence, alternative)) - .annotate(ty, size) + ArrayExpressionInner::Conditional(ConditionalExpression::new( + condition, + consequence, + alternative, + kind, + )) + .annotate(ty, size) } } -impl<'ast, T: Clone> IfElse<'ast, T> for StructExpression<'ast, T> { - fn if_else( +impl<'ast, T: Clone> Conditional<'ast, T> for StructExpression<'ast, T> { + fn conditional( condition: BooleanExpression<'ast, T>, consequence: Self, alternative: Self, + kind: ConditionalKind, ) -> Self { let ty = consequence.ty().clone(); - StructExpressionInner::IfElse(IfElseExpression::new(condition, consequence, alternative)) - .annotate(ty) + StructExpressionInner::Conditional(ConditionalExpression::new( + condition, + consequence, + alternative, + kind, + )) + .annotate(ty) } } diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index c85e97a7d..d2adf6ca4 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -164,14 +164,14 @@ pub trait ResultFolder<'ast, T: Field>: Sized { fold_types(self, tys) } - fn fold_if_else_expression< - E: Expr<'ast, T> + PartialEq + IfElse<'ast, T> + ResultFold<'ast, T>, + fn fold_conditional_expression< + E: Expr<'ast, T> + PartialEq + Conditional<'ast, T> + ResultFold<'ast, T>, >( &mut self, ty: &E::Ty, - e: IfElseExpression<'ast, T, E>, - ) -> Result, Self::Error> { - fold_if_else_expression(self, ty, e) + e: ConditionalExpression<'ast, T, E>, + ) -> Result, Self::Error> { + fold_conditional_expression(self, ty, e) } fn fold_block_expression>( @@ -491,9 +491,9 @@ pub fn fold_array_expression_inner<'ast, T: Field, F: ResultFolder<'ast, T>>( FunctionCallOrExpression::Expression(u) => u, } } - ArrayExpressionInner::IfElse(c) => match f.fold_if_else_expression(ty, c)? { - IfElseOrExpression::IfElse(c) => ArrayExpressionInner::IfElse(c), - IfElseOrExpression::Expression(u) => u, + ArrayExpressionInner::Conditional(c) => match f.fold_conditional_expression(ty, c)? { + ConditionalOrExpression::Conditional(c) => ArrayExpressionInner::Conditional(c), + ConditionalOrExpression::Expression(u) => u, }, ArrayExpressionInner::Member(m) => match f.fold_member_expression(ty, m)? { MemberOrExpression::Member(m) => ArrayExpressionInner::Member(m), @@ -542,9 +542,9 @@ pub fn fold_struct_expression_inner<'ast, T: Field, F: ResultFolder<'ast, T>>( FunctionCallOrExpression::Expression(u) => u, } } - StructExpressionInner::IfElse(c) => match f.fold_if_else_expression(ty, c)? { - IfElseOrExpression::IfElse(c) => StructExpressionInner::IfElse(c), - IfElseOrExpression::Expression(u) => u, + StructExpressionInner::Conditional(c) => match f.fold_conditional_expression(ty, c)? { + ConditionalOrExpression::Conditional(c) => StructExpressionInner::Conditional(c), + ConditionalOrExpression::Expression(u) => u, }, StructExpressionInner::Member(m) => match f.fold_member_expression(ty, m)? { MemberOrExpression::Member(m) => StructExpressionInner::Member(m), @@ -605,10 +605,10 @@ pub fn fold_field_expression<'ast, T: Field, F: ResultFolder<'ast, T>>( FieldElementExpression::Pos(box e) } - FieldElementExpression::IfElse(c) => { - match f.fold_if_else_expression(&Type::FieldElement, c)? { - IfElseOrExpression::IfElse(c) => FieldElementExpression::IfElse(c), - IfElseOrExpression::Expression(u) => u, + FieldElementExpression::Conditional(c) => { + match f.fold_conditional_expression(&Type::FieldElement, c)? { + ConditionalOrExpression::Conditional(c) => FieldElementExpression::Conditional(c), + ConditionalOrExpression::Expression(u) => u, } } FieldElementExpression::FunctionCall(function_call) => { @@ -659,11 +659,11 @@ pub fn fold_block_expression<'ast, T: Field, E: ResultFold<'ast, T>, F: ResultFo }) } -pub fn fold_if_else_expression< +pub fn fold_conditional_expression< 'ast, T: Field, E: Expr<'ast, T> - + IfElse<'ast, T> + + Conditional<'ast, T> + PartialEq + ResultFold<'ast, T> + From>, @@ -671,13 +671,16 @@ pub fn fold_if_else_expression< >( f: &mut F, _: &E::Ty, - e: IfElseExpression<'ast, T, E>, -) -> Result, F::Error> { - Ok(IfElseOrExpression::IfElse(IfElseExpression::new( - f.fold_boolean_expression(*e.condition)?, - e.consequence.fold(f)?, - e.alternative.fold(f)?, - ))) + e: ConditionalExpression<'ast, T, E>, +) -> Result, F::Error> { + Ok(ConditionalOrExpression::Conditional( + ConditionalExpression::new( + f.fold_boolean_expression(*e.condition)?, + e.consequence.fold(f)?, + e.alternative.fold(f)?, + e.kind, + ), + )) } pub fn fold_member_expression< @@ -830,10 +833,12 @@ pub fn fold_boolean_expression<'ast, T: Field, F: ResultFolder<'ast, T>>( FunctionCallOrExpression::Expression(u) => u, } } - BooleanExpression::IfElse(c) => match f.fold_if_else_expression(&Type::Boolean, c)? { - IfElseOrExpression::IfElse(c) => BooleanExpression::IfElse(c), - IfElseOrExpression::Expression(u) => u, - }, + BooleanExpression::Conditional(c) => { + match f.fold_conditional_expression(&Type::Boolean, c)? { + ConditionalOrExpression::Conditional(c) => BooleanExpression::Conditional(c), + ConditionalOrExpression::Expression(u) => u, + } + } BooleanExpression::Select(select) => { match f.fold_select_expression(&Type::Boolean, select)? { SelectOrExpression::Select(s) => BooleanExpression::Select(s), @@ -958,9 +963,9 @@ pub fn fold_uint_expression_inner<'ast, T: Field, F: ResultFolder<'ast, T>>( SelectOrExpression::Select(s) => UExpressionInner::Select(s), SelectOrExpression::Expression(u) => u, }, - UExpressionInner::IfElse(c) => match f.fold_if_else_expression(&ty, c)? { - IfElseOrExpression::IfElse(c) => UExpressionInner::IfElse(c), - IfElseOrExpression::Expression(u) => u, + UExpressionInner::Conditional(c) => match f.fold_conditional_expression(&ty, c)? { + ConditionalOrExpression::Conditional(c) => UExpressionInner::Conditional(c), + ConditionalOrExpression::Expression(u) => u, }, UExpressionInner::Member(m) => match f.fold_member_expression(&ty, m)? { MemberOrExpression::Member(m) => UExpressionInner::Member(m), diff --git a/zokrates_core/src/typed_absy/uint.rs b/zokrates_core/src/typed_absy/uint.rs index 4620dd7cf..d5ba1c527 100644 --- a/zokrates_core/src/typed_absy/uint.rs +++ b/zokrates_core/src/typed_absy/uint.rs @@ -193,7 +193,7 @@ pub enum UExpressionInner<'ast, T> { FunctionCall(FunctionCallExpression<'ast, T, UExpression<'ast, T>>), LeftShift(Box>, Box>), RightShift(Box>, Box>), - IfElse(IfElseExpression<'ast, T, UExpression<'ast, T>>), + Conditional(ConditionalExpression<'ast, T, UExpression<'ast, T>>), Member(MemberExpression<'ast, T, UExpression<'ast, T>>), Select(SelectExpression<'ast, T, UExpression<'ast, T>>), } diff --git a/zokrates_parser/src/zokrates.pest b/zokrates_parser/src/zokrates.pest index 108ee5cf4..5ccdb6a36 100644 --- a/zokrates_parser/src/zokrates.pest +++ b/zokrates_parser/src/zokrates.pest @@ -66,13 +66,13 @@ expression_list = _{(expression ~ ("," ~ expression)*)?} expression = { unaried_term ~ (op_binary ~ unaried_term)* } unaried_term = { op_unary? ~ powered_term } powered_term = { term ~ (op_pow ~ exponent_expression)? } -term = { ("(" ~ expression ~ ")") | inline_struct_expression | conditional_expression | postfix_expression | primary_expression | inline_array_expression | array_initializer_expression } +term = { ("(" ~ expression ~ ")") | inline_struct_expression | if_else_expression | postfix_expression | primary_expression | inline_array_expression | array_initializer_expression } spread = { "..." ~ expression } range = { from_expression? ~ ".." ~ to_expression? } from_expression = { expression } to_expression = { expression } -conditional_expression = { "if" ~ expression ~ "then" ~ expression ~ "else" ~ expression ~ "fi"} +if_else_expression = { "if" ~ expression ~ "then" ~ expression ~ "else" ~ expression ~ "fi"} postfix_expression = { identifier ~ access+ } // we force there to be at least one access, otherwise this matches single identifiers access = { array_access | call_access | member_access } diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index f446f54a3..33ae987d4 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -13,12 +13,12 @@ pub use ast::{ CallAccess, ConstantDefinition, ConstantGenericValue, DecimalLiteralExpression, DecimalNumber, DecimalSuffix, DefinitionStatement, ExplicitGenerics, Expression, FieldType, File, FromExpression, FunctionDefinition, HexLiteralExpression, HexNumberExpression, - IdentifierExpression, ImportDirective, ImportSource, ImportSymbol, InlineArrayExpression, - InlineStructExpression, InlineStructMember, IterationStatement, LiteralExpression, Parameter, - PostfixExpression, Range, RangeOrExpression, ReturnStatement, Span, Spread, SpreadOrExpression, - Statement, StructDefinition, StructField, SymbolDeclaration, TernaryExpression, ToExpression, - Type, TypedIdentifier, TypedIdentifierOrAssignee, UnaryExpression, UnaryOperator, Underscore, - Visibility, + IdentifierExpression, IfElseExpression, ImportDirective, ImportSource, ImportSymbol, + InlineArrayExpression, InlineStructExpression, InlineStructMember, IterationStatement, + LiteralExpression, Parameter, PostfixExpression, Range, RangeOrExpression, ReturnStatement, + Span, Spread, SpreadOrExpression, Statement, StructDefinition, StructField, SymbolDeclaration, + TernaryExpression, ToExpression, Type, TypedIdentifier, TypedIdentifierOrAssignee, + UnaryExpression, UnaryOperator, Underscore, Visibility, }; mod ast { @@ -418,6 +418,7 @@ mod ast { #[derive(Debug, PartialEq, Clone)] pub enum Expression<'ast> { Ternary(TernaryExpression<'ast>), + IfElse(IfElseExpression<'ast>), Binary(BinaryExpression<'ast>), Unary(UnaryExpression<'ast>), Postfix(PostfixExpression<'ast>), @@ -433,7 +434,7 @@ mod ast { pub enum Term<'ast> { Expression(Expression<'ast>), InlineStruct(InlineStructExpression<'ast>), - Ternary(TernaryExpression<'ast>), + Ternary(IfElseExpression<'ast>), Postfix(PostfixExpression<'ast>), Primary(PrimaryExpression<'ast>), InlineArray(InlineArrayExpression<'ast>), @@ -518,7 +519,7 @@ mod ast { fn from(t: Term<'ast>) -> Self { match t { Term::Expression(e) => e, - Term::Ternary(e) => Expression::Ternary(e), + Term::Ternary(e) => Expression::IfElse(e), Term::Postfix(e) => Expression::Postfix(e), Term::Primary(e) => e.into(), Term::InlineArray(e) => Expression::InlineArray(e), @@ -746,27 +747,49 @@ mod ast { pub span: Span<'ast>, } - #[derive(Debug, FromPest, PartialEq, Clone)] - #[pest_ast(rule(Rule::conditional_expression))] + #[derive(Debug, PartialEq, Clone)] pub struct TernaryExpression<'ast> { - pub first: Box>, - pub second: Box>, - pub third: Box>, + pub condition: Box>, + pub consequence: Box>, + pub alternative: Box>, + pub span: Span<'ast>, + } + + #[derive(Debug, FromPest, PartialEq, Clone)] + #[pest_ast(rule(Rule::if_else_expression))] + pub struct IfElseExpression<'ast> { + pub condition: Box>, + pub consequence: Box>, + pub alternative: Box>, #[pest_ast(outer())] pub span: Span<'ast>, } impl<'ast> Expression<'ast> { + pub fn if_else( + condition: Box>, + consequence: Box>, + alternative: Box>, + span: Span<'ast>, + ) -> Self { + Expression::IfElse(IfElseExpression { + condition, + consequence, + alternative, + span, + }) + } + pub fn ternary( - first: Box>, - second: Box>, - third: Box>, + condition: Box>, + consequence: Box>, + alternative: Box>, span: Span<'ast>, ) -> Self { Expression::Ternary(TernaryExpression { - first, - second, - third, + condition, + consequence, + alternative, span, }) } @@ -791,6 +814,7 @@ mod ast { Expression::Identifier(i) => &i.span, Expression::Literal(c) => &c.span(), Expression::Ternary(t) => &t.span, + Expression::IfElse(ie) => &ie.span, Expression::Postfix(p) => &p.span, Expression::InlineArray(a) => &a.span, Expression::InlineStruct(s) => &s.span, @@ -1056,20 +1080,6 @@ mod tests { pub fn pow(left: Expression<'ast>, right: Expression<'ast>, span: Span<'ast>) -> Self { Self::binary(BinaryOperator::Pow, Box::new(left), Box::new(right), span) } - - pub fn if_else( - condition: Expression<'ast>, - consequence: Expression<'ast>, - alternative: Expression<'ast>, - span: Span<'ast>, - ) -> Self { - Self::ternary( - Box::new(condition), - Box::new(consequence), - Box::new(alternative), - span, - ) - } } #[test] @@ -1248,7 +1258,7 @@ mod tests { }))], statements: vec![Statement::Return(ReturnStatement { expressions: vec![Expression::if_else( - Expression::Literal(LiteralExpression::DecimalLiteral( + Box::new(Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { @@ -1256,8 +1266,8 @@ mod tests { }, span: Span::new(&source, 62, 63).unwrap() } - )), - Expression::Literal(LiteralExpression::DecimalLiteral( + ))), + Box::new(Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { @@ -1265,8 +1275,8 @@ mod tests { }, span: Span::new(&source, 69, 70).unwrap() } - )), - Expression::Literal(LiteralExpression::DecimalLiteral( + ))), + Box::new(Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { @@ -1274,7 +1284,7 @@ mod tests { }, span: Span::new(&source, 76, 77).unwrap() } - )), + ))), Span::new(&source, 59, 80).unwrap() )], span: Span::new(&source, 52, 80).unwrap(), From 99fe0062680e715bf6aee88ae5523060b51c5d8d Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 29 Sep 2021 19:02:56 +0200 Subject: [PATCH 34/83] fix tests --- zokrates_core/src/static_analysis/propagation.rs | 2 ++ zokrates_core/src/typed_absy/integer.rs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index c8b2d050f..aefcdde90 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -1435,6 +1435,7 @@ mod tests { BooleanExpression::Value(true), FieldElementExpression::Number(Bn128Field::from(2)), FieldElementExpression::Number(Bn128Field::from(3)), + ConditionalKind::IfElse, ); assert_eq!( @@ -1449,6 +1450,7 @@ mod tests { BooleanExpression::Value(false), FieldElementExpression::Number(Bn128Field::from(2)), FieldElementExpression::Number(Bn128Field::from(3)), + ConditionalKind::IfElse, ); assert_eq!( diff --git a/zokrates_core/src/typed_absy/integer.rs b/zokrates_core/src/typed_absy/integer.rs index 308cfd6fd..5a82cfea0 100644 --- a/zokrates_core/src/typed_absy/integer.rs +++ b/zokrates_core/src/typed_absy/integer.rs @@ -696,6 +696,7 @@ impl<'ast, T> From for IntExpression<'ast, T> { #[cfg(test)] mod tests { use super::*; + use crate::typed_absy::ConditionalKind; use zokrates_field::Bn128Field; #[test] @@ -717,7 +718,7 @@ mod tests { n.clone() * n.clone(), IntExpression::pow(n.clone(), n.clone()), n.clone() / n.clone(), - IntExpression::conditional(c.clone(), n.clone(), n.clone()), + IntExpression::conditional(c.clone(), n.clone(), n.clone(), ConditionalKind::IfElse), IntExpression::select(n_a.clone(), i.clone()), ]; @@ -728,7 +729,12 @@ mod tests { t.clone() * t.clone(), FieldElementExpression::pow(t.clone(), i.clone()), t.clone() / t.clone(), - FieldElementExpression::conditional(c.clone(), t.clone(), t.clone()), + FieldElementExpression::conditional( + c.clone(), + t.clone(), + t.clone(), + ConditionalKind::IfElse, + ), FieldElementExpression::select(t_a.clone(), i.clone()), ]; @@ -783,7 +789,7 @@ mod tests { IntExpression::left_shift(n.clone(), i.clone()), IntExpression::right_shift(n.clone(), i.clone()), !n.clone(), - IntExpression::conditional(c.clone(), n.clone(), n.clone()), + IntExpression::conditional(c.clone(), n.clone(), n.clone(), ConditionalKind::IfElse), IntExpression::select(n_a.clone(), i.clone()), ]; @@ -800,7 +806,7 @@ mod tests { UExpression::left_shift(t.clone(), i.clone()), UExpression::right_shift(t.clone(), i.clone()), !t.clone(), - UExpression::conditional(c.clone(), t.clone(), t.clone()), + UExpression::conditional(c.clone(), t.clone(), t.clone(), ConditionalKind::IfElse), UExpression::select(t_a.clone(), i.clone()), ]; From edc064d69d5ecfc32fbc41dc65af297399146c2c Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 29 Sep 2021 19:04:57 +0200 Subject: [PATCH 35/83] fix naming --- zokrates_pest_ast/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index 33ae987d4..6f4368db9 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -434,7 +434,7 @@ mod ast { pub enum Term<'ast> { Expression(Expression<'ast>), InlineStruct(InlineStructExpression<'ast>), - Ternary(IfElseExpression<'ast>), + IfElse(IfElseExpression<'ast>), Postfix(PostfixExpression<'ast>), Primary(PrimaryExpression<'ast>), InlineArray(InlineArrayExpression<'ast>), @@ -519,7 +519,7 @@ mod ast { fn from(t: Term<'ast>) -> Self { match t { Term::Expression(e) => e, - Term::Ternary(e) => Expression::IfElse(e), + Term::IfElse(e) => Expression::IfElse(e), Term::Postfix(e) => Expression::Postfix(e), Term::Primary(e) => e.into(), Term::InlineArray(e) => Expression::InlineArray(e), From b8556e3cd40209dcfe608149abb59dbf58ce2d06 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 1 Oct 2021 18:14:10 +0300 Subject: [PATCH 36/83] implement dynamic lt using a shifted sub --- zokrates_core/src/flatten/mod.rs | 148 +++++-------------------------- 1 file changed, 20 insertions(+), 128 deletions(-) diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index 79d3948f9..0321521d8 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -681,139 +681,35 @@ impl<'ast, T: Field> Flattener<'ast, T> { T::max_value() - constant, ), (lhs_flattened, rhs_flattened) => { - let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies to words of width `bit_width - 2` + let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies field elements whose difference is strictly smaller than 2**(bitwidth - 2) - // lhs let lhs_id = self.define(lhs_flattened, statements_flattened); - - // check that lhs and rhs are within the right range, i.e., their higher two bits are zero. We use big-endian so they are at positions 0 and 1 - - // lhs - { - // define variables for the bits - let lhs_bits_be: Vec = - (0..safe_width).map(|_| self.use_sym()).collect(); - - // add a directive to get the bits - statements_flattened.push(FlatStatement::Directive( - FlatDirective::new( - lhs_bits_be.clone(), - Solver::bits(safe_width), - vec![lhs_id], - ), - )); - - // bitness checks - for bit in lhs_bits_be.iter().take(safe_width) { - statements_flattened.push(FlatStatement::Condition( - FlatExpression::Identifier(*bit), - FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Identifier(*bit), - ), - RuntimeError::LtBitness, - )); - } - - // bit decomposition check - let mut lhs_sum = FlatExpression::Number(T::from(0)); - - for (i, bit) in lhs_bits_be.iter().take(safe_width).enumerate() { - lhs_sum = FlatExpression::Add( - box lhs_sum, - box FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Number( - T::from(2).pow(safe_width - i - 1), - ), - ), - ); - } - - statements_flattened.push(FlatStatement::Condition( - FlatExpression::Identifier(lhs_id), - lhs_sum, - RuntimeError::LtSum, - )); - } - - // rhs let rhs_id = self.define(rhs_flattened, statements_flattened); - // rhs - { - // define variables for the bits - let rhs_bits_be: Vec = - (0..safe_width).map(|_| self.use_sym()).collect(); - - // add a directive to get the bits - statements_flattened.push(FlatStatement::Directive( - FlatDirective::new( - rhs_bits_be.clone(), - Solver::bits(safe_width), - vec![rhs_id], - ), - )); - - // bitness checks - for bit in rhs_bits_be.iter().take(safe_width) { - statements_flattened.push(FlatStatement::Condition( - FlatExpression::Identifier(*bit), - FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Identifier(*bit), - ), - RuntimeError::LtBitness, - )); - } - - // bit decomposition check - let mut rhs_sum = FlatExpression::Number(T::from(0)); - - for (i, bit) in rhs_bits_be.iter().take(safe_width).enumerate() { - rhs_sum = FlatExpression::Add( - box rhs_sum, - box FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Number( - T::from(2).pow(safe_width - i - 1), - ), - ), - ); - } - - statements_flattened.push(FlatStatement::Condition( - FlatExpression::Identifier(rhs_id), - rhs_sum, - RuntimeError::LtSum, - )); - } - - // sym := (lhs * 2) - (rhs * 2) - let subtraction_result = FlatExpression::Sub( - box FlatExpression::Mult( - box FlatExpression::Number(T::from(2)), + // shifted_sub := 2**safe_width + lhs - rhs + let shifted_sub = FlatExpression::Add( + box FlatExpression::Number(T::from(2).pow(safe_width)), + box FlatExpression::Sub( box FlatExpression::Identifier(lhs_id), - ), - box FlatExpression::Mult( - box FlatExpression::Number(T::from(2)), box FlatExpression::Identifier(rhs_id), ), ); + let sub_width = safe_width + 1; + // define variables for the bits - let sub_bits_be: Vec = - (0..bit_width).map(|_| self.use_sym()).collect(); + let shifted_sub_bits_be: Vec = + (0..sub_width).map(|_| self.use_sym()).collect(); // add a directive to get the bits statements_flattened.push(FlatStatement::Directive(FlatDirective::new( - sub_bits_be.clone(), - Solver::bits(bit_width), - vec![subtraction_result.clone()], + shifted_sub_bits_be.clone(), + Solver::bits(sub_width), + vec![shifted_sub.clone()], ))); // bitness checks - for bit in sub_bits_be.iter().take(bit_width) { + for bit in shifted_sub_bits_be.iter() { statements_flattened.push(FlatStatement::Condition( FlatExpression::Identifier(*bit), FlatExpression::Mult( @@ -824,33 +720,29 @@ impl<'ast, T: Field> Flattener<'ast, T> { )); } - // check that the decomposition is in the field with a strict `< p` checks - self.enforce_constant_le_check( - statements_flattened, - &sub_bits_be, - &T::max_value().bit_vector_be(), - ); - // sum(sym_b{i} * 2**i) let mut expr = FlatExpression::Number(T::from(0)); - for (i, bit) in sub_bits_be.iter().take(bit_width).enumerate() { + for (i, bit) in shifted_sub_bits_be.iter().take(sub_width).enumerate() { expr = FlatExpression::Add( box expr, box FlatExpression::Mult( box FlatExpression::Identifier(*bit), - box FlatExpression::Number(T::from(2).pow(bit_width - i - 1)), + box FlatExpression::Number(T::from(2).pow(sub_width - i - 1)), ), ); } statements_flattened.push(FlatStatement::Condition( - subtraction_result, + shifted_sub, expr, RuntimeError::LtFinalSum, )); - FlatExpression::Identifier(sub_bits_be[bit_width - 1]) + FlatExpression::Sub( + box FlatExpression::Number(T::one()), + box FlatExpression::Identifier(shifted_sub_bits_be[0]), + ) } } } From 3371df28cc31de39b9ef5e888b73a67c46cc95d9 Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 4 Oct 2021 21:37:23 +0300 Subject: [PATCH 37/83] fmt clippy --- zokrates_core/src/static_analysis/propagation.rs | 6 +----- zokrates_core/src/typed_absy/types.rs | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index a41d16c0c..8d2d08edf 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -1075,11 +1075,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { }) // ignore spreads over empty arrays .filter_map(|e| match e { - TypedExpressionOrSpread::Spread(s) - if s.array.size() == UExpression::from(0u32) => - { - None - } + TypedExpressionOrSpread::Spread(s) if s.array.size() == 0u32 => None, e => Some(e), }) .collect(), diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 7213227e0..a741b98da 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -165,7 +165,6 @@ impl<'ast, T> DeclarationConstant<'ast, T> { DeclarationConstant::Concrete(v) => Ok(v.into()), DeclarationConstant::Constant(c) => Ok(c.into()), DeclarationConstant::Expression(_) => unreachable!(), - } } @@ -1023,10 +1022,10 @@ pub fn check_generic<'ast, T, S: Clone + PartialEq + PartialEq>( DeclarationConstant::Expression(e) => match e { TypedExpression::Uint(e) => match e.as_inner() { UExpressionInner::Value(v) => *value == *v as u32, - _ => true + _ => true, }, - _ => unreachable!() - } + _ => unreachable!(), + }, }) .unwrap_or(true) } From 6ca342720fbf6a339390d5f21366535af7ea12c2 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 5 Oct 2021 12:30:53 +0300 Subject: [PATCH 38/83] simplify expression_at making the return value generic, reverting wrong clippy suggestion --- .../src/static_analysis/propagation.rs | 35 ++++++++++--------- zokrates_core/src/typed_absy/mod.rs | 27 +++++++------- zokrates_core/src/typed_absy/result_folder.rs | 5 ++- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index 8d2d08edf..3a93991a8 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -971,7 +971,10 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { } fn fold_select_expression< - E: Expr<'ast, T> + Select<'ast, T> + From>, + E: Expr<'ast, T> + + Select<'ast, T> + + TryFrom> + + Into>, >( &mut self, _: &E::Ty, @@ -988,12 +991,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { (ArrayExpressionInner::Value(v), UExpressionInner::Value(n)) => { if n < size { Ok(SelectOrExpression::Expression( - E::from( - v.expression_at::>(n as usize) - .unwrap() - .clone(), - ) - .into_inner(), + v.expression_at::(n as usize).unwrap().into_inner(), )) } else { Err(Error::OutOfBounds(n, size)) @@ -1005,14 +1003,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { TypedExpression::Array(a) => match a.as_inner() { ArrayExpressionInner::Value(v) => { Ok(SelectOrExpression::Expression( - E::from( - v.expression_at::>( - n as usize, - ) - .unwrap() - .clone(), - ) - .into_inner(), + v.expression_at::(n as usize).unwrap().into_inner(), )) } _ => unreachable!("should be an array value"), @@ -1075,7 +1066,19 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { }) // ignore spreads over empty arrays .filter_map(|e| match e { - TypedExpressionOrSpread::Spread(s) if s.array.size() == 0u32 => None, + // clippy makes a wrong suggestion here: + // ``` + // this creates an owned instance just for comparison + // UExpression::from(0u32) + // help: try: `0u32` + // ``` + // But for `UExpression`, `PartialEq` is different from `PartialEq` (the latter is too optimistic in this case) + #[allow(clippy::cmp_owned)] + TypedExpressionOrSpread::Spread(s) + if s.array.size() == UExpression::from(0u32) => + { + None + } e => Some(e), }) .collect(), diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index f9d40185e..cf5ab54a9 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -1142,11 +1142,13 @@ impl<'ast, T> IntoIterator for ArrayValue<'ast, T> { } impl<'ast, T: Clone> ArrayValue<'ast, T> { - fn expression_at_aux + Into>>( + fn expression_at_aux< + U: Select<'ast, T> + From> + Into>, + >( v: TypedExpressionOrSpread<'ast, T>, - ) -> Vec>> { + ) -> Vec> { match v { - TypedExpressionOrSpread::Expression(e) => vec![Some(e.clone())], + TypedExpressionOrSpread::Expression(e) => vec![Some(U::from(e))], TypedExpressionOrSpread::Spread(s) => match s.array.size().into_inner() { UExpressionInner::Value(size) => { let array_ty = s.array.ty().clone(); @@ -1158,14 +1160,11 @@ impl<'ast, T: Clone> ArrayValue<'ast, T> { .collect(), a => (0..size) .map(|i| { - Some( - U::select( - a.clone() - .annotate(*array_ty.ty.clone(), array_ty.size.clone()), - i as u32, - ) - .into(), - ) + Some(U::select( + a.clone() + .annotate(*array_ty.ty.clone(), array_ty.size.clone()), + i as u32, + )) }) .collect(), } @@ -1175,10 +1174,12 @@ impl<'ast, T: Clone> ArrayValue<'ast, T> { } } - pub fn expression_at + Into>>( + pub fn expression_at< + U: Select<'ast, T> + From> + Into>, + >( &self, index: usize, - ) -> Option> { + ) -> Option { self.0 .iter() .map(|v| Self::expression_at_aux::(v.clone())) diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index 738f026cc..e62903423 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -212,7 +212,10 @@ pub trait ResultFolder<'ast, T: Field>: Sized { } fn fold_select_expression< - E: Expr<'ast, T> + Select<'ast, T> + From>, + E: Expr<'ast, T> + + Select<'ast, T> + + Into> + + From>, >( &mut self, ty: &E::Ty, From 980b4be79ea60e070b86a254d04651dc9b0a88fa Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 5 Oct 2021 13:15:47 +0300 Subject: [PATCH 39/83] upgrade toolchain --- rust-toolchain | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 1cfd57a1d..d4d39d43a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-04-25 \ No newline at end of file +nightly-2021-10-05 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 41d688e55..4d5f7afdb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2021-04-25" \ No newline at end of file +channel = "nightly-2021-10-05" \ No newline at end of file From 2169010cf7f5f118eb1e1d35e7a37e838bcdb86a Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 5 Oct 2021 14:01:50 +0300 Subject: [PATCH 40/83] fix clippy --- zokrates_cli/src/bin.rs | 4 +- zokrates_cli/src/ops/export_verifier.rs | 2 +- zokrates_core/src/absy/from_ast.rs | 28 +-- zokrates_core/src/compile.rs | 8 +- zokrates_core/src/flatten/mod.rs | 3 + zokrates_core/src/imports.rs | 4 +- zokrates_core/src/ir/interpreter.rs | 15 +- zokrates_core/src/optimizer/redefinition.rs | 2 +- zokrates_core/src/proof_system/ark/gm17.rs | 2 +- zokrates_core/src/proof_system/bellman/mod.rs | 14 +- zokrates_core/src/semantics.rs | 33 ++-- .../src/static_analysis/propagation.rs | 8 +- .../src/static_analysis/reducer/inline.rs | 2 +- .../src/static_analysis/reducer/mod.rs | 18 +- .../src/static_analysis/unconstrained_vars.rs | 26 +-- zokrates_core/src/typed_absy/integer.rs | 4 +- zokrates_core/src/typed_absy/mod.rs | 8 +- zokrates_core/src/typed_absy/types.rs | 10 +- zokrates_core/tests/out_of_range.rs | 8 +- zokrates_embed/src/ark.rs | 2 +- zokrates_pest_ast/src/lib.rs | 160 +++++++++--------- zokrates_test/src/lib.rs | 17 +- zokrates_test_derive/src/lib.rs | 2 +- 23 files changed, 186 insertions(+), 194 deletions(-) diff --git a/zokrates_cli/src/bin.rs b/zokrates_cli/src/bin.rs index c3bb2e051..5f40f3449 100644 --- a/zokrates_cli/src/bin.rs +++ b/zokrates_cli/src/bin.rs @@ -195,7 +195,7 @@ mod tests { let interpreter = ir::Interpreter::default(); let _ = interpreter - .execute(&artifacts.prog(), &[Bn128Field::from(0)]) + .execute(artifacts.prog(), &[Bn128Field::from(0)]) .unwrap(); } } @@ -226,7 +226,7 @@ mod tests { let interpreter = ir::Interpreter::default(); - let res = interpreter.execute(&artifacts.prog(), &[Bn128Field::from(0)]); + let res = interpreter.execute(artifacts.prog(), &[Bn128Field::from(0)]); assert!(res.is_err()); } diff --git a/zokrates_cli/src/ops/export_verifier.rs b/zokrates_cli/src/ops/export_verifier.rs index 225c8dc60..8da06a761 100644 --- a/zokrates_cli/src/ops/export_verifier.rs +++ b/zokrates_cli/src/ops/export_verifier.rs @@ -99,7 +99,7 @@ fn cli_export_verifier From> for absy::ExpressionNode<'ast> { expression.accesses.into_iter().fold(id, |acc, a| match a { pest::Access::Call(a) => match acc.value { absy::Expression::Identifier(_) => absy::Expression::FunctionCall( - &id_str, + id_str, a.explicit_generics.map(|explicit_generics| { explicit_generics .values @@ -652,7 +652,7 @@ impl<'ast> From> for absy::ExpressionNode<' match expression.suffix { Some(suffix) => match suffix { pest::DecimalSuffix::Field(_) => absy::Expression::FieldConstant( - BigUint::parse_bytes(&expression.value.span.as_str().as_bytes(), 10).unwrap(), + BigUint::parse_bytes(expression.value.span.as_str().as_bytes(), 10).unwrap(), ), pest::DecimalSuffix::U64(_) => { absy::Expression::U64Constant(expression.value.span.as_str().parse().unwrap()) @@ -669,7 +669,7 @@ impl<'ast> From> for absy::ExpressionNode<' } .span(expression.span), None => absy::Expression::IntConstant( - BigUint::parse_bytes(&expression.value.span.as_str().as_bytes(), 10).unwrap(), + BigUint::parse_bytes(expression.value.span.as_str().as_bytes(), 10).unwrap(), ) .span(expression.span), } @@ -682,16 +682,16 @@ impl<'ast> From> for absy::ExpressionNode<'ast> match expression.value { pest::HexNumberExpression::U64(e) => { - absy::Expression::U64Constant(u64::from_str_radix(&e.span.as_str(), 16).unwrap()) + absy::Expression::U64Constant(u64::from_str_radix(e.span.as_str(), 16).unwrap()) } pest::HexNumberExpression::U32(e) => { - absy::Expression::U32Constant(u32::from_str_radix(&e.span.as_str(), 16).unwrap()) + absy::Expression::U32Constant(u32::from_str_radix(e.span.as_str(), 16).unwrap()) } pest::HexNumberExpression::U16(e) => { - absy::Expression::U16Constant(u16::from_str_radix(&e.span.as_str(), 16).unwrap()) + absy::Expression::U16Constant(u16::from_str_radix(e.span.as_str(), 16).unwrap()) } pest::HexNumberExpression::U8(e) => { - absy::Expression::U8Constant(u8::from_str_radix(&e.span.as_str(), 16).unwrap()) + absy::Expression::U8Constant(u8::from_str_radix(e.span.as_str(), 16).unwrap()) } } .span(expression.span) @@ -838,7 +838,7 @@ mod tests { #[test] fn return_forty_two() { let source = "def main() -> field: return 42"; - let ast = pest::generate_ast(&source).unwrap(); + let ast = pest::generate_ast(source).unwrap(); let expected: absy::Module = absy::Module { symbols: vec![absy::SymbolDeclaration { id: &source[4..8], @@ -869,7 +869,7 @@ mod tests { #[test] fn return_true() { let source = "def main() -> bool: return true"; - let ast = pest::generate_ast(&source).unwrap(); + let ast = pest::generate_ast(source).unwrap(); let expected: absy::Module = absy::Module { symbols: vec![absy::SymbolDeclaration { id: &source[4..8], @@ -898,7 +898,7 @@ mod tests { #[test] fn arguments() { let source = "def main(private field a, bool b) -> field: return 42"; - let ast = pest::generate_ast(&source).unwrap(); + let ast = pest::generate_ast(source).unwrap(); let expected: absy::Module = absy::Module { symbols: vec![absy::SymbolDeclaration { @@ -1127,7 +1127,7 @@ mod tests { fn call_array_element() { // a call after an array access should be rejected let source = "def main(): return a[2](3)"; - let ast = pest::generate_ast(&source).unwrap(); + let ast = pest::generate_ast(source).unwrap(); absy::Module::from(ast); } @@ -1136,7 +1136,7 @@ mod tests { fn call_call_result() { // a call after a call should be rejected let source = "def main(): return a(2)(3)"; - let ast = pest::generate_ast(&source).unwrap(); + let ast = pest::generate_ast(source).unwrap(); absy::Module::from(ast); } } @@ -1144,7 +1144,7 @@ mod tests { fn declarations() { use self::pest::Span; - let span = Span::new(&"", 0, 0).unwrap(); + let span = Span::new("", 0, 0).unwrap(); // For different definitions, we generate declarations // Case 1: `id = expr` where `expr` is not a function call @@ -1163,7 +1163,7 @@ mod tests { expression: pest::Expression::Literal(pest::LiteralExpression::DecimalLiteral( pest::DecimalLiteralExpression { value: pest::DecimalNumber { - span: Span::new(&"1", 0, 1).unwrap(), + span: Span::new("1", 0, 1).unwrap(), }, suffix: None, span: span.clone(), diff --git a/zokrates_core/src/compile.rs b/zokrates_core/src/compile.rs index 5b9d378fa..86a9943e9 100644 --- a/zokrates_core/src/compile.rs +++ b/zokrates_core/src/compile.rs @@ -243,7 +243,7 @@ fn check_with_arena<'ast, T: Field, E: Into>( log::debug!("Parse program with entry file {}", location.display()); - let compiled = parse_program::(source, location, resolver, &arena)?; + let compiled = parse_program::(source, location, resolver, arena)?; log::debug!("Check semantics"); @@ -271,7 +271,7 @@ pub fn parse_program<'ast, T: Field, E: Into>( ) -> Result, CompileErrors> { let mut modules = HashMap::new(); - let main = parse_module::(&source, location.clone(), resolver, &mut modules, &arena)?; + let main = parse_module::(source, location.clone(), resolver, &mut modules, arena)?; modules.insert(location.clone(), main); @@ -290,7 +290,7 @@ pub fn parse_module<'ast, T: Field, E: Into>( ) -> Result, CompileErrors> { log::debug!("Generate pest AST for {}", location.display()); - let ast = pest::generate_ast(&source) + let ast = pest::generate_ast(source) .map_err(|e| CompileErrors::from(CompileErrorInner::from(e).in_file(&location)))?; log::debug!("Process macros for {}", location.display()); @@ -309,7 +309,7 @@ pub fn parse_module<'ast, T: Field, E: Into>( location.clone(), resolver, modules, - &arena, + arena, ) } diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index 79d3948f9..156c08519 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -2202,7 +2202,10 @@ impl<'ast, T: Field> Flattener<'ast, T> { // convert the exponent to bytes, big endian let ebytes_be = e.to_be_bytes(); + // convert the bytes to bits, remove leading zeroes (we only need powers up to the highest non-zero bit) + #[allow(clippy::needless_collect)] + // collecting is required as we then reverse let ebits_be: Vec<_> = ebytes_be .iter() .flat_map(|byte| (0..8).rev().map(move |i| byte & (1 << i) != 0)) // byte to bit, big endian diff --git a/zokrates_core/src/imports.rs b/zokrates_core/src/imports.rs index bd01796e4..00814b741 100644 --- a/zokrates_core/src/imports.rs +++ b/zokrates_core/src/imports.rs @@ -231,7 +231,7 @@ impl Importer { new_location.clone(), resolver, modules, - &arena, + arena, )?; assert!(modules.insert(new_location.clone(), compiled).is_none()); @@ -239,7 +239,7 @@ impl Importer { }; SymbolDeclaration { - id: &alias, + id: alias, symbol: Symbol::There( SymbolImport::with_id_in_module(symbol.id, new_location) .start_end(pos.0, pos.1), diff --git a/zokrates_core/src/ir/interpreter.rs b/zokrates_core/src/ir/interpreter.rs index 8b071998c..3e674f00f 100644 --- a/zokrates_core/src/ir/interpreter.rs +++ b/zokrates_core/src/ir/interpreter.rs @@ -10,20 +10,13 @@ pub type ExecutionResult = Result, Error>; impl Prog {} +#[derive(Default)] pub struct Interpreter { /// Whether we should try to give out-of-range bit decompositions when the input is not a single summand. /// Used to do targetted testing of `<` flattening, making sure the bit decomposition we base the result on is unique. should_try_out_of_range: bool, } -impl Default for Interpreter { - fn default() -> Interpreter { - Interpreter { - should_try_out_of_range: false, - } - } -} - impl Interpreter { pub fn try_out_of_range() -> Interpreter { Interpreter { @@ -34,7 +27,7 @@ impl Interpreter { impl Interpreter { pub fn execute(&self, program: &Prog, inputs: &[T]) -> ExecutionResult { - self.check_inputs(&program, &inputs)?; + self.check_inputs(program, inputs)?; let mut witness = BTreeMap::new(); witness.insert(FlatVariable::one(), T::one()); @@ -274,8 +267,8 @@ impl LinComb { impl QuadComb { pub fn evaluate(&self, witness: &BTreeMap) -> Result { - let left = self.left.evaluate(&witness)?; - let right = self.right.evaluate(&witness)?; + let left = self.left.evaluate(witness)?; + let right = self.right.evaluate(witness)?; Ok(left * right) } } diff --git a/zokrates_core/src/optimizer/redefinition.rs b/zokrates_core/src/optimizer/redefinition.rs index 28bab99e8..1080b5a54 100644 --- a/zokrates_core/src/optimizer/redefinition.rs +++ b/zokrates_core/src/optimizer/redefinition.rs @@ -191,7 +191,7 @@ impl Folder for RedefinitionOptimizer { match lc .0 .iter() - .any(|(variable, _)| self.substitution.get(&variable).is_some()) + .any(|(variable, _)| self.substitution.get(variable).is_some()) { true => // for each summand, check if it is equal to a linear term in our substitution, otherwise keep it as is diff --git a/zokrates_core/src/proof_system/ark/gm17.rs b/zokrates_core/src/proof_system/ark/gm17.rs index 4c54b261f..59e77e942 100644 --- a/zokrates_core/src/proof_system/ark/gm17.rs +++ b/zokrates_core/src/proof_system/ark/gm17.rs @@ -126,7 +126,7 @@ impl NonUniversalBackend for Ark { .vk .query .iter() - .map(|g1| parse_g1::(g1)) + .map(parse_g1::) .collect(), }; diff --git a/zokrates_core/src/proof_system/bellman/mod.rs b/zokrates_core/src/proof_system/bellman/mod.rs index 84a63bab2..4489fa98c 100644 --- a/zokrates_core/src/proof_system/bellman/mod.rs +++ b/zokrates_core/src/proof_system/bellman/mod.rs @@ -228,8 +228,8 @@ mod parse { let raw_e = e.to_string(); let captures = G1_REGEX.captures(&raw_e).unwrap(); G1Affine( - captures.name(&"x").unwrap().as_str().to_string(), - captures.name(&"y").unwrap().as_str().to_string(), + captures.name("x").unwrap().as_str().to_string(), + captures.name("y").unwrap().as_str().to_string(), ) } @@ -240,12 +240,12 @@ mod parse { let captures = G2_REGEX.captures(&raw_e).unwrap(); G2Affine( ( - captures.name(&"x0").unwrap().as_str().to_string(), - captures.name(&"x1").unwrap().as_str().to_string(), + captures.name("x0").unwrap().as_str().to_string(), + captures.name("x1").unwrap().as_str().to_string(), ), ( - captures.name(&"y0").unwrap().as_str().to_string(), - captures.name(&"y1").unwrap().as_str().to_string(), + captures.name("y0").unwrap().as_str().to_string(), + captures.name("y1").unwrap().as_str().to_string(), ), ) } @@ -253,7 +253,7 @@ mod parse { pub fn parse_fr(e: &::Fr) -> Fr { let raw_e = e.to_string(); let captures = FR_REGEX.captures(&raw_e).unwrap(); - captures.name(&"x").unwrap().as_str().to_string() + captures.name("x").unwrap().as_str().to_string() } } diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index d4b224c33..20c3c00d5 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -233,7 +233,7 @@ impl<'ast, T: Field> FunctionQuery<'ast, T> { .inputs .iter() .zip(func.signature.inputs.iter()) - .all(|(input_ty, sig_ty)| input_ty.can_be_specialized_to(&sig_ty)) + .all(|(input_ty, sig_ty)| input_ty.can_be_specialized_to(sig_ty)) && self.outputs.len() == func.signature.outputs.len() && self .outputs @@ -242,7 +242,7 @@ impl<'ast, T: Field> FunctionQuery<'ast, T> { .all(|(output_ty, sig_ty)| { output_ty .as_ref() - .map(|output_ty| output_ty.can_be_specialized_to(&sig_ty)) + .map(|output_ty| output_ty.can_be_specialized_to(sig_ty)) .unwrap_or(true) }) } @@ -378,7 +378,7 @@ impl<'ast, T: Field> Checker<'ast, T> { let ty = self.check_declaration_type( c.value.ty.clone(), module_id, - &state, + state, &BTreeMap::default(), &mut HashSet::default(), )?; @@ -396,11 +396,10 @@ impl<'ast, T: Field> Checker<'ast, T> { UExpression::try_from_typed(checked_expr, &bitwidth).map(TypedExpression::from) } DeclarationType::Array(ref array_ty) => { - ArrayExpression::try_from_typed(checked_expr, &array_ty).map(TypedExpression::from) + ArrayExpression::try_from_typed(checked_expr, array_ty).map(TypedExpression::from) } DeclarationType::Struct(ref struct_ty) => { - StructExpression::try_from_typed(checked_expr, &struct_ty) - .map(TypedExpression::from) + StructExpression::try_from_typed(checked_expr, struct_ty).map(TypedExpression::from) } DeclarationType::Int => Err(checked_expr), // Integers cannot be assigned } @@ -1810,7 +1809,7 @@ impl<'ast, T: Field> Checker<'ast, T> { let arguments_types: Vec<_> = arguments_checked.iter().map(|a| a.get_type()).collect(); - let query = FunctionQuery::new(&fun_id, &generics_checked, &arguments_types, &assignee_types); + let query = FunctionQuery::new(fun_id, &generics_checked, &arguments_types, &assignee_types); let functions = self.find_functions(&query); @@ -1856,7 +1855,7 @@ impl<'ast, T: Field> Checker<'ast, T> { let pos = assignee.pos(); // check that the assignee is declared match assignee.value { - Assignee::Identifier(variable_name) => match self.get_key_value_scope(&variable_name) { + Assignee::Identifier(variable_name) => match self.get_key_value_scope(variable_name) { Some((id, ty)) => match id.is_constant() { true => Err(ErrorInner { pos: Some(assignee.pos()), @@ -1992,7 +1991,7 @@ impl<'ast, T: Field> Checker<'ast, T> { Expression::Identifier(name) => { // check that `id` is defined in the scope match self - .get_key_value_scope(&name) + .get_key_value_scope(name) .map(|(x, y)| (x.clone(), y.clone())) { Some((id, ty)) => match ty { @@ -2361,7 +2360,7 @@ impl<'ast, T: Field> Checker<'ast, T> { // outside of multidef, function calls must have a single return value // we use type inference to determine the type of the return, so we don't specify it let query = - FunctionQuery::new(&fun_id, &generics_checked, &arguments_types, &[None]); + FunctionQuery::new(fun_id, &generics_checked, &arguments_types, &[None]); let functions = self.find_functions(&query); @@ -2374,7 +2373,7 @@ impl<'ast, T: Field> Checker<'ast, T> { let signature = f.signature; - let arguments_checked = arguments_checked.into_iter().zip(signature.inputs.iter()).map(|(a, t)| TypedExpression::align_to_type(a, &t)).collect::, _>>().map_err(|e| ErrorInner { + let arguments_checked = arguments_checked.into_iter().zip(signature.inputs.iter()).map(|(a, t)| TypedExpression::align_to_type(a, t)).collect::, _>>().map_err(|e| ErrorInner { pos: Some(pos), message: format!("Expected function call argument to be of type {}, found {}", e.1, e.0) })?; @@ -3323,7 +3322,7 @@ impl<'ast, T: Field> Checker<'ast, T> { fn exit_scope(&mut self) { let current_level = self.level; self.scope - .retain(|ref scoped_variable, _| scoped_variable.level < current_level); + .retain(|scoped_variable, _| scoped_variable.level < current_level); self.level -= 1; } } @@ -3850,22 +3849,20 @@ mod tests { .get(&*MODULE_ID) .unwrap() .functions_iter() - .find(|d| d.key + .any(|d| d.key == DeclarationFunctionKey::with_location((*MODULE_ID).clone(), "foo") - .signature(DeclarationSignature::new())) - .is_some()); + .signature(DeclarationSignature::new()))); assert!(state .typed_modules .get(&*MODULE_ID) .unwrap() .functions_iter() - .find(|d| d.key + .any(|d| d.key == DeclarationFunctionKey::with_location((*MODULE_ID).clone(), "foo") .signature( DeclarationSignature::new().inputs(vec![DeclarationType::FieldElement]) - )) - .is_some()); + ))); } #[test] diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index cb09a669e..a9471b571 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -79,7 +79,7 @@ impl<'ast, 'a, T: Field> Propagator<'ast, 'a, T> { .map(|c| Ok((var, c))) .unwrap_or(Err(var)), TypedAssignee::Select(box assignee, box index) => { - match self.try_get_constant_mut(&assignee) { + match self.try_get_constant_mut(assignee) { Ok((variable, constant)) => match index.as_inner() { UExpressionInner::Value(n) => match constant { TypedExpression::Array(a) => match a.as_inner_mut() { @@ -101,7 +101,7 @@ impl<'ast, 'a, T: Field> Propagator<'ast, 'a, T> { e => e, } } - TypedAssignee::Member(box assignee, m) => match self.try_get_constant_mut(&assignee) { + TypedAssignee::Member(box assignee, m) => match self.try_get_constant_mut(assignee) { Ok((v, c)) => { let ty = assignee.get_type(); @@ -548,7 +548,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { let invalidations = assignees.iter().flat_map(|assignee| { let v = self - .try_get_constant_mut(&assignee) + .try_get_constant_mut(assignee) .map(|(v, _)| v) .unwrap_or_else(|v| v); match self.constants.remove(&v.id) { @@ -590,7 +590,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { let invalidations = assignees.iter().flat_map(|assignee| { let v = self - .try_get_constant_mut(&assignee) + .try_get_constant_mut(assignee) .map(|(v, _)| v) .unwrap_or_else(|v| v); match self.constants.remove(&v.id) { diff --git a/zokrates_core/src/static_analysis/reducer/inline.rs b/zokrates_core/src/static_analysis/reducer/inline.rs index d7132f81a..51efdbdca 100644 --- a/zokrates_core/src/static_analysis/reducer/inline.rs +++ b/zokrates_core/src/static_analysis/reducer/inline.rs @@ -69,7 +69,7 @@ fn get_canonical_function<'ast, T: Field>( .unwrap(); match &s.symbol { - TypedFunctionSymbol::There(key) => get_canonical_function(key.clone(), &program), + TypedFunctionSymbol::There(key) => get_canonical_function(key.clone(), program), _ => s.clone(), } } diff --git a/zokrates_core/src/static_analysis/reducer/mod.rs b/zokrates_core/src/static_analysis/reducer/mod.rs index 401593c35..9c7880232 100644 --- a/zokrates_core/src/static_analysis/reducer/mod.rs +++ b/zokrates_core/src/static_analysis/reducer/mod.rs @@ -161,7 +161,7 @@ fn register<'ast>( ) { for (id, key, value) in substitute .iter() - .filter_map(|(id, version)| with.get(&id).map(|to| (id, version, to))) + .filter_map(|(id, version)| with.get(id).map(|to| (id, version, to))) .filter(|(_, key, value)| key != value) { let sub = substitutions.0.entry(id.clone()).or_default(); @@ -235,8 +235,8 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Reducer<'ast, 'a, T> { generics, arguments, ty, - &self.program, - &mut self.versions, + self.program, + self.versions, ); match res { @@ -354,8 +354,8 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Reducer<'ast, 'a, T> { generics, arguments, &types, - &self.program, - &mut self.versions, + self.program, + self.versions, ) { Ok(Output::Complete((statements, expressions))) => { assert_eq!(v.len(), expressions.len()); @@ -420,7 +420,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Reducer<'ast, 'a, T> { self.versions.values_mut().for_each(|v| *v += 1); // add this set of versions to the substitution, pointing to the versions before the loop - register(&mut self.substitutions, &self.versions, &versions_before); + register(self.substitutions, self.versions, &versions_before); // the versions after the loop are found by applying an offset of 2 to the versions before the loop let versions_after = versions_before @@ -429,7 +429,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Reducer<'ast, 'a, T> { .map(|(k, v)| (k, v + 2)) .collect(); - let mut transformer = ShallowTransformer::with_versions(&mut self.versions); + let mut transformer = ShallowTransformer::with_versions(self.versions); if to - from > MAX_FOR_LOOP_SIZE { return Err(Error::LoopTooLarge(to.saturating_sub(*from))); @@ -454,7 +454,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Reducer<'ast, 'a, T> { // we know the final versions of the variables after full unrolling of the loop // the versions after the loop need to point to these, so we add to the substitutions - register(&mut self.substitutions, &versions_after, &self.versions); + register(self.substitutions, &versions_after, self.versions); // we may have found new for loops when unrolling this one, which means new backed up versions // we insert these in our backup list and update our cursor @@ -573,7 +573,7 @@ fn reduce_function<'ast, T: Field>( loop { let mut reducer = Reducer::new( - &program, + program, &mut versions, &mut substitutions, for_loop_versions, diff --git a/zokrates_core/src/static_analysis/unconstrained_vars.rs b/zokrates_core/src/static_analysis/unconstrained_vars.rs index 52793cece..516be73a5 100644 --- a/zokrates_core/src/static_analysis/unconstrained_vars.rs +++ b/zokrates_core/src/static_analysis/unconstrained_vars.rs @@ -28,7 +28,7 @@ impl fmt::Display for Error { impl UnconstrainedVariableDetector { pub fn detect(p: &Prog) -> Result<(), Error> { let mut instance = Self::default(); - instance.visit_module(&p); + instance.visit_module(p); if instance.variables.is_empty() { Ok(()) @@ -118,39 +118,39 @@ mod tests { // (1 * ~one) * (1 * ~one + (-1) * _1) == 1 * ~out_0 // return ~out_0 - let _0 = FlatParameter::private(FlatVariable::new(0)); - let _1 = FlatVariable::new(1); - let _2 = FlatVariable::new(2); + let v_0 = FlatParameter::private(FlatVariable::new(0)); + let v_1 = FlatVariable::new(1); + let v_2 = FlatVariable::new(2); let out_0 = FlatVariable::public(0); let one = FlatVariable::one(); let p: Prog = Prog { - arguments: vec![_0], + arguments: vec![v_0], statements: vec![ Statement::Directive(Directive { - inputs: vec![(LinComb::summand(-42, one) + LinComb::summand(1, _0.id)).into()], - outputs: vec![_1, _2], + inputs: vec![(LinComb::summand(-42, one) + LinComb::summand(1, v_0.id)).into()], + outputs: vec![v_1, v_2], solver: Solver::ConditionEq, }), Statement::constraint( QuadComb::from_linear_combinations( - LinComb::summand(-42, one) + LinComb::summand(1, _0.id), - LinComb::summand(1, _2), + LinComb::summand(-42, one) + LinComb::summand(1, v_0.id), + LinComb::summand(1, v_2), ), - LinComb::summand(1, _1), + LinComb::summand(1, v_1), ), Statement::constraint( QuadComb::from_linear_combinations( - LinComb::summand(1, one) + LinComb::summand(-1, _1), - LinComb::summand(-42, one) + LinComb::summand(1, _0.id), + LinComb::summand(1, one) + LinComb::summand(-1, v_1), + LinComb::summand(-42, one) + LinComb::summand(1, v_0.id), ), LinComb::zero(), ), Statement::constraint( QuadComb::from_linear_combinations( LinComb::summand(1, one), - LinComb::summand(1, one) + LinComb::summand(-1, _1), + LinComb::summand(1, one) + LinComb::summand(-1, v_1), ), LinComb::summand(1, out_0), ), diff --git a/zokrates_core/src/typed_absy/integer.rs b/zokrates_core/src/typed_absy/integer.rs index b430f3a92..bd1b24449 100644 --- a/zokrates_core/src/typed_absy/integer.rs +++ b/zokrates_core/src/typed_absy/integer.rs @@ -597,7 +597,7 @@ impl<'ast, T: Field> ArrayExpression<'ast, T> { inline_array .into_iter() .map(|v| { - TypedExpressionOrSpread::align_to_type(v, &target_array_ty).map_err( + TypedExpressionOrSpread::align_to_type(v, target_array_ty).map_err( |(e, _)| match e { TypedExpressionOrSpread::Expression(e) => e, TypedExpressionOrSpread::Spread(a) => { @@ -620,7 +620,7 @@ impl<'ast, T: Field> ArrayExpression<'ast, T> { GType::Int => Ok(ArrayExpressionInner::Repeat(box e, box count) .annotate(Type::Int, array_ty.size)), // try to align the repeated element to the target type - t => TypedExpression::align_to_type(e, &t) + t => TypedExpression::align_to_type(e, t) .map(|e| { let ty = e.get_type().clone(); diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index f9d40185e..344f6947b 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -263,7 +263,7 @@ impl<'ast, T: Field> TypedFunctionSymbol<'ast, T> { .find(|d| d.key == *key) .unwrap() .symbol - .signature(&modules), + .signature(modules), TypedFunctionSymbol::Flat(flat_fun) => flat_fun.typed_signature(), } } @@ -1588,7 +1588,7 @@ impl<'ast, T: Clone> Expr<'ast, T> for FieldElementExpression<'ast, T> { } fn as_inner(&self) -> &Self::Inner { - &self + self } fn as_inner_mut(&mut self) -> &mut Self::Inner { @@ -1609,7 +1609,7 @@ impl<'ast, T: Clone> Expr<'ast, T> for BooleanExpression<'ast, T> { } fn as_inner(&self) -> &Self::Inner { - &self + self } fn as_inner_mut(&mut self) -> &mut Self::Inner { @@ -1693,7 +1693,7 @@ impl<'ast, T: Clone> Expr<'ast, T> for IntExpression<'ast, T> { } fn as_inner(&self) -> &Self::Inner { - &self + self } fn as_inner_mut(&mut self) -> &mut Self::Inner { diff --git a/zokrates_core/src/typed_absy/types.rs b/zokrates_core/src/typed_absy/types.rs index 6efbaf4c6..7fb2d30c7 100644 --- a/zokrates_core/src/typed_absy/types.rs +++ b/zokrates_core/src/typed_absy/types.rs @@ -301,7 +301,7 @@ impl fmt::Display for GArrayType { ) -> fmt::Result { acc.push(&t.size); match &*t.ty { - GType::Array(array_type) => fmt_aux(f, &array_type, acc), + GType::Array(array_type) => fmt_aux(f, array_type, acc), t => { write!(f, "{}", t)?; for i in acc { @@ -314,7 +314,7 @@ impl fmt::Display for GArrayType { let acc = vec![]; - fmt_aux(f, &self, acc) + fmt_aux(f, self, acc) } } @@ -458,7 +458,7 @@ impl GStructType { } fn location(&self) -> &StructLocation { - &self.location.as_ref().unwrap_or(&self.canonical_location) + self.location.as_ref().unwrap_or(&self.canonical_location) } pub fn name(&self) -> &str { @@ -1009,7 +1009,7 @@ pub fn specialize_declaration_type< Ok(match decl_ty { DeclarationType::Int => unreachable!(), DeclarationType::Array(t0) => { - let ty = box specialize_declaration_type(*t0.ty, &generics)?; + let ty = box specialize_declaration_type(*t0.ty, generics)?; let size = match t0.size { DeclarationConstant::Generic(s) => generics.0.get(&s).cloned().ok_or(s), DeclarationConstant::Concrete(s) => Ok(s.into()), @@ -1085,7 +1085,7 @@ pub mod signature { impl Ord for GSignature { fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.partial_cmp(&other).unwrap() + self.partial_cmp(other).unwrap() } } diff --git a/zokrates_core/tests/out_of_range.rs b/zokrates_core/tests/out_of_range.rs index c27e23614..2e44a031c 100644 --- a/zokrates_core/tests/out_of_range.rs +++ b/zokrates_core/tests/out_of_range.rs @@ -38,7 +38,7 @@ fn lt_field() { assert!(interpreter .execute( - &res.prog(), + res.prog(), &[Bn128Field::from(10000), Bn128Field::from(5555)] ) .is_err()); @@ -70,7 +70,7 @@ fn lt_uint() { assert!(interpreter .execute( - &res.prog(), + res.prog(), &[Bn128Field::from(10000), Bn128Field::from(5555)] ) .is_err()); @@ -112,7 +112,7 @@ fn unpack256() { let interpreter = Interpreter::try_out_of_range(); assert!(interpreter - .execute(&res.prog(), &[Bn128Field::from(0)]) + .execute(res.prog(), &[Bn128Field::from(0)]) .is_err()); } @@ -152,6 +152,6 @@ fn unpack256_unchecked() { let interpreter = Interpreter::try_out_of_range(); assert!(interpreter - .execute(&res.prog(), &[Bn128Field::from(0)]) + .execute(res.prog(), &[Bn128Field::from(0)]) .is_ok()); } diff --git a/zokrates_embed/src/ark.rs b/zokrates_embed/src/ark.rs index 47e145294..ff8826a3b 100644 --- a/zokrates_embed/src/ark.rs +++ b/zokrates_embed/src/ark.rs @@ -111,7 +111,7 @@ pub fn generate_verify_constraints( let num_instance_variables = cs.num_instance_variables(); let input_indices = fp_vars .iter() - .map(|f| var_to_index(&f, 0)) + .map(|f| var_to_index(f, 0)) .collect::>(); let proof_indices: Vec = vec![ diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index 22b4d0d78..40afd640b 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -782,7 +782,7 @@ mod ast { match self { Expression::Binary(b) => &b.span, Expression::Identifier(i) => &i.span, - Expression::Literal(c) => &c.span(), + Expression::Literal(c) => c.span(), Expression::Ternary(t) => &t.span, Expression::Postfix(p) => &p.span, Expression::InlineArray(a) => &a.span, @@ -1071,57 +1071,57 @@ mod tests { def main() -> (field): return 1 + 1 "#; assert_eq!( - generate_ast(&source), + generate_ast(source), Ok(File { pragma: None, declarations: vec![ SymbolDeclaration::Import(ImportDirective::Main(MainImportDirective { source: ImportSource { value: String::from("foo"), - span: Span::new(&source, 8, 11).unwrap() + span: Span::new(source, 8, 11).unwrap() }, alias: None, - span: Span::new(&source, 0, 29).unwrap() + span: Span::new(source, 0, 29).unwrap() })), SymbolDeclaration::Function(FunctionDefinition { generics: vec![], id: IdentifierExpression { value: String::from("main"), - span: Span::new(&source, 33, 37).unwrap() + span: Span::new(source, 33, 37).unwrap() }, parameters: vec![], returns: vec![Type::Basic(BasicType::Field(FieldType { - span: Span::new(&source, 44, 49).unwrap() + span: Span::new(source, 44, 49).unwrap() }))], statements: vec![Statement::Return(ReturnStatement { expressions: vec![Expression::add( Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { value: DecimalNumber { - span: Span::new(&source, 59, 60).unwrap() + span: Span::new(source, 59, 60).unwrap() }, suffix: None, - span: Span::new(&source, 59, 60).unwrap() + span: Span::new(source, 59, 60).unwrap() } )), Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { value: DecimalNumber { - span: Span::new(&source, 63, 64).unwrap() + span: Span::new(source, 63, 64).unwrap() }, suffix: None, - span: Span::new(&source, 63, 64).unwrap() + span: Span::new(source, 63, 64).unwrap() } )), - Span::new(&source, 59, 64).unwrap() + Span::new(source, 59, 64).unwrap() )], - span: Span::new(&source, 52, 64).unwrap(), + span: Span::new(source, 52, 64).unwrap(), })], - span: Span::new(&source, 29, source.len()).unwrap(), + span: Span::new(source, 29, source.len()).unwrap(), }) ], eoi: EOI {}, - span: Span::new(&source, 0, 65).unwrap() + span: Span::new(source, 0, 65).unwrap() }) ); } @@ -1132,27 +1132,27 @@ mod tests { def main() -> (field): return 1 + 2 * 3 ** 4 "#; assert_eq!( - generate_ast(&source), + generate_ast(source), Ok(File { pragma: None, declarations: vec![ SymbolDeclaration::Import(ImportDirective::Main(MainImportDirective { source: ImportSource { value: String::from("foo"), - span: Span::new(&source, 8, 11).unwrap() + span: Span::new(source, 8, 11).unwrap() }, alias: None, - span: Span::new(&source, 0, 29).unwrap() + span: Span::new(source, 0, 29).unwrap() })), SymbolDeclaration::Function(FunctionDefinition { generics: vec![], id: IdentifierExpression { value: String::from("main"), - span: Span::new(&source, 33, 37).unwrap() + span: Span::new(source, 33, 37).unwrap() }, parameters: vec![], returns: vec![Type::Basic(BasicType::Field(FieldType { - span: Span::new(&source, 44, 49).unwrap() + span: Span::new(source, 44, 49).unwrap() }))], statements: vec![Statement::Return(ReturnStatement { expressions: vec![Expression::add( @@ -1160,9 +1160,9 @@ mod tests { DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 59, 60).unwrap() + span: Span::new(source, 59, 60).unwrap() }, - span: Span::new(&source, 59, 60).unwrap() + span: Span::new(source, 59, 60).unwrap() } )), Expression::mul( @@ -1170,9 +1170,9 @@ mod tests { DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 63, 64).unwrap() + span: Span::new(source, 63, 64).unwrap() }, - span: Span::new(&source, 63, 64).unwrap() + span: Span::new(source, 63, 64).unwrap() } )), Expression::pow( @@ -1180,33 +1180,33 @@ mod tests { DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 67, 68).unwrap() + span: Span::new(source, 67, 68).unwrap() }, - span: Span::new(&source, 67, 68).unwrap() + span: Span::new(source, 67, 68).unwrap() } )), Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 72, 73).unwrap() + span: Span::new(source, 72, 73).unwrap() }, - span: Span::new(&source, 72, 73).unwrap() + span: Span::new(source, 72, 73).unwrap() } )), - Span::new(&source, 67, 73).unwrap() + Span::new(source, 67, 73).unwrap() ), - Span::new(&source, 63, 73).unwrap() + Span::new(source, 63, 73).unwrap() ), - Span::new(&source, 59, 73).unwrap() + Span::new(source, 59, 73).unwrap() )], - span: Span::new(&source, 52, 73).unwrap(), + span: Span::new(source, 52, 73).unwrap(), })], - span: Span::new(&source, 29, 74).unwrap(), + span: Span::new(source, 29, 74).unwrap(), }) ], eoi: EOI {}, - span: Span::new(&source, 0, 74).unwrap() + span: Span::new(source, 0, 74).unwrap() }) ); } @@ -1217,27 +1217,27 @@ mod tests { def main() -> (field): return if 1 then 2 else 3 fi "#; assert_eq!( - generate_ast(&source), + generate_ast(source), Ok(File { pragma: None, declarations: vec![ SymbolDeclaration::Import(ImportDirective::Main(MainImportDirective { source: ImportSource { value: String::from("foo"), - span: Span::new(&source, 8, 11).unwrap() + span: Span::new(source, 8, 11).unwrap() }, alias: None, - span: Span::new(&source, 0, 29).unwrap() + span: Span::new(source, 0, 29).unwrap() })), SymbolDeclaration::Function(FunctionDefinition { generics: vec![], id: IdentifierExpression { value: String::from("main"), - span: Span::new(&source, 33, 37).unwrap() + span: Span::new(source, 33, 37).unwrap() }, parameters: vec![], returns: vec![Type::Basic(BasicType::Field(FieldType { - span: Span::new(&source, 44, 49).unwrap() + span: Span::new(source, 44, 49).unwrap() }))], statements: vec![Statement::Return(ReturnStatement { expressions: vec![Expression::if_else( @@ -1245,38 +1245,38 @@ mod tests { DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 62, 63).unwrap() + span: Span::new(source, 62, 63).unwrap() }, - span: Span::new(&source, 62, 63).unwrap() + span: Span::new(source, 62, 63).unwrap() } )), Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 69, 70).unwrap() + span: Span::new(source, 69, 70).unwrap() }, - span: Span::new(&source, 69, 70).unwrap() + span: Span::new(source, 69, 70).unwrap() } )), Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 76, 77).unwrap() + span: Span::new(source, 76, 77).unwrap() }, - span: Span::new(&source, 76, 77).unwrap() + span: Span::new(source, 76, 77).unwrap() } )), - Span::new(&source, 59, 80).unwrap() + Span::new(source, 59, 80).unwrap() )], - span: Span::new(&source, 52, 80).unwrap(), + span: Span::new(source, 52, 80).unwrap(), })], - span: Span::new(&source, 29, 81).unwrap(), + span: Span::new(source, 29, 81).unwrap(), }) ], eoi: EOI {}, - span: Span::new(&source, 0, 81).unwrap() + span: Span::new(source, 0, 81).unwrap() }) ); } @@ -1286,35 +1286,35 @@ mod tests { let source = r#"def main() -> (field): return (1) "#; assert_eq!( - generate_ast(&source), + generate_ast(source), Ok(File { pragma: None, declarations: vec![SymbolDeclaration::Function(FunctionDefinition { generics: vec![], id: IdentifierExpression { value: String::from("main"), - span: Span::new(&source, 4, 8).unwrap() + span: Span::new(source, 4, 8).unwrap() }, parameters: vec![], returns: vec![Type::Basic(BasicType::Field(FieldType { - span: Span::new(&source, 15, 20).unwrap() + span: Span::new(source, 15, 20).unwrap() }))], statements: vec![Statement::Return(ReturnStatement { expressions: vec![Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 31, 32).unwrap() + span: Span::new(source, 31, 32).unwrap() }, - span: Span::new(&source, 31, 32).unwrap() + span: Span::new(source, 31, 32).unwrap() } ))], - span: Span::new(&source, 23, 33).unwrap(), + span: Span::new(source, 23, 33).unwrap(), })], - span: Span::new(&source, 0, 34).unwrap(), + span: Span::new(source, 0, 34).unwrap(), })], eoi: EOI {}, - span: Span::new(&source, 0, 34).unwrap() + span: Span::new(source, 0, 34).unwrap() }) ); } @@ -1324,44 +1324,44 @@ mod tests { let source = r#"def main() -> (field): field a, b = foo(1, 2 + 3) "#; assert_eq!( - generate_ast(&source), + generate_ast(source), Ok(File { pragma: None, declarations: vec![SymbolDeclaration::Function(FunctionDefinition { generics: vec![], id: IdentifierExpression { value: String::from("main"), - span: Span::new(&source, 4, 8).unwrap() + span: Span::new(source, 4, 8).unwrap() }, parameters: vec![], returns: vec![Type::Basic(BasicType::Field(FieldType { - span: Span::new(&source, 15, 20).unwrap() + span: Span::new(source, 15, 20).unwrap() }))], statements: vec![Statement::Definition(DefinitionStatement { lhs: vec![ TypedIdentifierOrAssignee::TypedIdentifier(TypedIdentifier { ty: Type::Basic(BasicType::Field(FieldType { - span: Span::new(&source, 23, 28).unwrap() + span: Span::new(source, 23, 28).unwrap() })), identifier: IdentifierExpression { value: String::from("a"), - span: Span::new(&source, 29, 30).unwrap(), + span: Span::new(source, 29, 30).unwrap(), }, - span: Span::new(&source, 23, 30).unwrap() + span: Span::new(source, 23, 30).unwrap() }), TypedIdentifierOrAssignee::Assignee(Assignee { id: IdentifierExpression { value: String::from("b"), - span: Span::new(&source, 32, 33).unwrap(), + span: Span::new(source, 32, 33).unwrap(), }, accesses: vec![], - span: Span::new(&source, 32, 34).unwrap() + span: Span::new(source, 32, 34).unwrap() }), ], expression: Expression::Postfix(PostfixExpression { id: IdentifierExpression { value: String::from("foo"), - span: Span::new(&source, 36, 39).unwrap() + span: Span::new(source, 36, 39).unwrap() }, accesses: vec![Access::Call(CallAccess { explicit_generics: None, @@ -1371,9 +1371,9 @@ mod tests { DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 40, 41).unwrap() + span: Span::new(source, 40, 41).unwrap() }, - span: Span::new(&source, 40, 41).unwrap() + span: Span::new(source, 40, 41).unwrap() } )), Expression::add( @@ -1381,35 +1381,35 @@ mod tests { DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 43, 44).unwrap() + span: Span::new(source, 43, 44).unwrap() }, - span: Span::new(&source, 43, 44).unwrap() + span: Span::new(source, 43, 44).unwrap() } )), Expression::Literal(LiteralExpression::DecimalLiteral( DecimalLiteralExpression { suffix: None, value: DecimalNumber { - span: Span::new(&source, 47, 48).unwrap() + span: Span::new(source, 47, 48).unwrap() }, - span: Span::new(&source, 47, 48).unwrap() + span: Span::new(source, 47, 48).unwrap() } )), - Span::new(&source, 43, 48).unwrap() + Span::new(source, 43, 48).unwrap() ), ], - span: Span::new(&source, 40, 48).unwrap() + span: Span::new(source, 40, 48).unwrap() }, - span: Span::new(&source, 39, 49).unwrap() + span: Span::new(source, 39, 49).unwrap() })], - span: Span::new(&source, 36, 49).unwrap(), + span: Span::new(source, 36, 49).unwrap(), }), - span: Span::new(&source, 23, 49).unwrap() + span: Span::new(source, 23, 49).unwrap() })], - span: Span::new(&source, 0, 50).unwrap(), + span: Span::new(source, 0, 50).unwrap(), })], eoi: EOI {}, - span: Span::new(&source, 0, 50).unwrap() + span: Span::new(source, 0, 50).unwrap() }) ); } @@ -1432,8 +1432,8 @@ mod tests { assert(a.member == 1) return a "#; - let res = generate_ast(&source); - println!("{:#?}", generate_ast(&source)); + let res = generate_ast(source); + println!("{:#?}", generate_ast(source)); assert!(res.is_ok()); } } diff --git a/zokrates_test/src/lib.rs b/zokrates_test/src/lib.rs index ca95920c3..9398105a7 100644 --- a/zokrates_test/src/lib.rs +++ b/zokrates_test/src/lib.rs @@ -157,15 +157,14 @@ fn compile_and_run(t: Tests) { if let Some(target_count) = t.max_constraint_count { let count = bin.constraint_count(); - if count > target_count { - panic!( - "{} exceeded max constraint count (actual={}, max={}, p={:.2}% of max)", - entry_point.display(), - count, - target_count, - (count as f32) / (target_count as f32) * 100_f32 - ); - } + assert!( + !count > target_count, + "{} exceeded max constraint count (actual={}, max={}, p={:.2}% of max)", + entry_point.display(), + count, + target_count, + (count as f32) / (target_count as f32) * 100_f32 + ); }; let interpreter = zokrates_core::ir::Interpreter::default(); diff --git a/zokrates_test_derive/src/lib.rs b/zokrates_test_derive/src/lib.rs index 74b0fa24c..4cfc8d07c 100644 --- a/zokrates_test_derive/src/lib.rs +++ b/zokrates_test_derive/src/lib.rs @@ -13,7 +13,7 @@ pub fn write_tests(base: &str) { let mut writer = BufWriter::new(test_file); for p in glob(base.join("**/*.json").to_str().unwrap()).unwrap() { - write_test(&mut writer, &p.unwrap(), &base); + write_test(&mut writer, &p.unwrap(), base); } } From 44899ace8da6fb374a4eeb7eba5749dcd21d7cdc Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 5 Oct 2021 18:19:53 +0200 Subject: [PATCH 41/83] update book --- zokrates_book/src/language/operators.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zokrates_book/src/language/operators.md b/zokrates_book/src/language/operators.md index b82d59b78..7f013b227 100644 --- a/zokrates_book/src/language/operators.md +++ b/zokrates_book/src/language/operators.md @@ -16,10 +16,12 @@ The following table lists the precedence and associativity of all operators. Ope | `!=`
`==`
| Not Equal
Equal
| ✓ | ✓ | ✓ | Left | | | `&&` | Boolean AND |   |   | ✓ | Left | | | || | Boolean OR |   |   | ✓ | Left | | -| `if c then x else y fi` | Conditional expression | ✓ | ✓ | ✓ | Right | | +| `if c then x else y fi` | Conditional expression | ✓ | ✓ | ✓ | Right | [^4] | [^1]: The exponent must be a compile-time constant of type `u32` [^2]: The right operand must be a compile time constant of type `u32` -[^3]: Both operands are asserted to be strictly lower than the biggest power of 2 lower than `p/2`, unless one of them can be determined to be a compile-time constant \ No newline at end of file +[^3]: Both operands are asserted to be strictly lower than the biggest power of 2 lower than `p/2`, unless one of them can be determined to be a compile-time constant + +[^4]: Conditional expression can also be written using a ternary operator: `c ? x : y` \ No newline at end of file From c8ddc8913e8e56b5f632a6c22f55a5d389c5dc69 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 5 Oct 2021 19:56:43 +0300 Subject: [PATCH 42/83] enable general postfix expressions in the parser, move function name check to semantics --- zokrates_core/src/absy/from_ast.rs | 50 +++++++++++----------- zokrates_core/src/absy/mod.rs | 4 +- zokrates_core/src/absy/types.rs | 2 - zokrates_core/src/semantics.rs | 66 +++++++++++++++++++++++------ zokrates_core/src/typed_absy/mod.rs | 4 +- zokrates_parser/src/zokrates.pest | 6 +-- zokrates_pest_ast/src/lib.rs | 47 +++++++++++++------- 7 files changed, 118 insertions(+), 61 deletions(-) diff --git a/zokrates_core/src/absy/from_ast.rs b/zokrates_core/src/absy/from_ast.rs index a968b9c29..48db883fd 100644 --- a/zokrates_core/src/absy/from_ast.rs +++ b/zokrates_core/src/absy/from_ast.rs @@ -599,17 +599,18 @@ impl<'ast> From> for absy::ExpressionNode<'ast> { fn from(expression: pest::PostfixExpression<'ast>) -> absy::ExpressionNode<'ast> { use crate::absy::NodeValue; - let id_str = expression.id.span.as_str(); - let id = absy::ExpressionNode::from(expression.id); + let base = absy::ExpressionNode::from(*expression.base); // pest::PostFixExpression contains an array of "accesses": `a(34)[42]` is represented as `[a, [Call(34), Select(42)]]`, but absy::ExpressionNode // is recursive, so it is `Select(Call(a, 34), 42)`. We apply this transformation here - // we start with the id, and we fold the array of accesses by wrapping the current value - expression.accesses.into_iter().fold(id, |acc, a| match a { - pest::Access::Call(a) => match acc.value { - absy::Expression::Identifier(_) => absy::Expression::FunctionCall( - &id_str, + // we start with the base, and we fold the array of accesses by wrapping the current value + expression + .accesses + .into_iter() + .fold(base, |acc, a| match a { + pest::Access::Call(a) => absy::Expression::FunctionCall( + Box::new(acc), a.explicit_generics.map(|explicit_generics| { explicit_generics .values @@ -630,18 +631,17 @@ impl<'ast> From> for absy::ExpressionNode<'ast> { .into_iter() .map(absy::ExpressionNode::from) .collect(), - ), - e => unimplemented!("only identifiers are callable, found \"{}\"", e), - } - .span(a.span), - pest::Access::Select(a) => { - absy::Expression::Select(box acc, box absy::RangeOrExpression::from(a.expression)) - .span(a.span) - } - pest::Access::Member(m) => { - absy::Expression::Member(box acc, box m.id.span.as_str()).span(m.span) - } - }) + ) + .span(a.span), + pest::Access::Select(a) => absy::Expression::Select( + box acc, + box absy::RangeOrExpression::from(a.expression), + ) + .span(a.span), + pest::Access::Member(m) => { + absy::Expression::Member(box acc, box m.id.span.as_str()).span(m.span) + } + }) } } @@ -1082,7 +1082,7 @@ mod tests { "a(3)[4]", absy::Expression::Select( box absy::Expression::FunctionCall( - "a", + box absy::Expression::Identifier("a").mock(), None, vec![absy::Expression::IntConstant(3usize.into()).into()], ) @@ -1097,7 +1097,7 @@ mod tests { absy::Expression::Select( box absy::Expression::Select( box absy::Expression::FunctionCall( - "a", + box absy::Expression::Identifier("a").mock(), None, vec![absy::Expression::IntConstant(3usize.into()).into()], ) @@ -1195,10 +1195,10 @@ mod tests { span: span.clone(), })], expression: pest::Expression::Postfix(pest::PostfixExpression { - id: pest::IdentifierExpression { + base: box pest::Expression::Identifier(pest::IdentifierExpression { value: String::from("foo"), span: span.clone(), - }, + }), accesses: vec![pest::Access::Call(pest::CallAccess { explicit_generics: None, arguments: pest::Arguments { @@ -1248,10 +1248,10 @@ mod tests { }), ], expression: pest::Expression::Postfix(pest::PostfixExpression { - id: pest::IdentifierExpression { + base: box pest::Expression::Identifier(pest::IdentifierExpression { value: String::from("foo"), span: span.clone(), - }, + }), accesses: vec![pest::Access::Call(pest::CallAccess { explicit_generics: None, arguments: pest::Arguments { diff --git a/zokrates_core/src/absy/mod.rs b/zokrates_core/src/absy/mod.rs index 70fc76d09..efab2fa85 100644 --- a/zokrates_core/src/absy/mod.rs +++ b/zokrates_core/src/absy/mod.rs @@ -13,7 +13,7 @@ pub mod variable; pub use crate::absy::node::{Node, NodeValue}; pub use crate::absy::parameter::{Parameter, ParameterNode}; -use crate::absy::types::{FunctionIdentifier, UnresolvedSignature, UnresolvedType, UserTypeId}; +use crate::absy::types::{UnresolvedSignature, UnresolvedType, UserTypeId}; pub use crate::absy::variable::{Variable, VariableNode}; use crate::embed::FlatEmbed; use std::path::{Path, PathBuf}; @@ -479,7 +479,7 @@ pub enum Expression<'ast> { Box>, ), FunctionCall( - FunctionIdentifier<'ast>, + Box>, Option>>>, Vec>, ), diff --git a/zokrates_core/src/absy/types.rs b/zokrates_core/src/absy/types.rs index a35820764..86409591a 100644 --- a/zokrates_core/src/absy/types.rs +++ b/zokrates_core/src/absy/types.rs @@ -56,8 +56,6 @@ impl<'ast> UnresolvedType<'ast> { } } -pub type FunctionIdentifier<'ast> = &'ast str; - pub use self::signature::UnresolvedSignature; mod signature { diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index d4b224c33..008df9c46 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1764,7 +1764,19 @@ impl<'ast, T: Field> Checker<'ast, T> { Statement::MultipleDefinition(assignees, rhs) => { match rhs.value { // Right side has to be a function call - Expression::FunctionCall(fun_id, generics, arguments) => { + Expression::FunctionCall(fun_id_expression, generics, arguments) => { + + let fun_id = match fun_id_expression.value { + Expression::Identifier(id) => Ok(id), + e => Err(vec![ErrorInner { + pos: Some(pos), + message: format!( + "Expected function in function call to be an identifier, found {}", + e + ), + }]) + }?; + // check the generic arguments, if any let generics_checked: Option>>> = generics .map(|generics| @@ -2318,7 +2330,18 @@ impl<'ast, T: Field> Checker<'ast, T> { Expression::U16Constant(n) => Ok(UExpressionInner::Value(n.into()).annotate(16).into()), Expression::U32Constant(n) => Ok(UExpressionInner::Value(n.into()).annotate(32).into()), Expression::U64Constant(n) => Ok(UExpressionInner::Value(n.into()).annotate(64).into()), - Expression::FunctionCall(fun_id, generics, arguments) => { + Expression::FunctionCall(fun_id_expression, generics, arguments) => { + let fun_id = match fun_id_expression.value { + Expression::Identifier(id) => Ok(id), + e => Err(ErrorInner { + pos: Some(pos), + message: format!( + "Expected function in function call to be an identifier, found `{}`", + e + ), + }), + }?; + // check the generic arguments, if any let generics_checked: Option>>> = generics .map(|generics| { @@ -4516,7 +4539,8 @@ mod tests { .mock(), Statement::MultipleDefinition( vec![Assignee::Identifier("a").mock()], - Expression::FunctionCall("foo", None, vec![]).mock(), + Expression::FunctionCall(box Expression::Identifier("foo").mock(), None, vec![]) + .mock(), ) .mock(), Statement::Return( @@ -4573,7 +4597,12 @@ mod tests { Statement::Assertion( Expression::Eq( box Expression::IntConstant(2usize.into()).mock(), - box Expression::FunctionCall("foo", None, vec![]).mock(), + box Expression::FunctionCall( + box Expression::Identifier("foo").mock(), + None, + vec![], + ) + .mock(), ) .mock(), ) @@ -4632,7 +4661,8 @@ mod tests { .mock(), Statement::MultipleDefinition( vec![Assignee::Identifier("a").mock()], - Expression::FunctionCall("foo", None, vec![]).mock(), + Expression::FunctionCall(box Expression::Identifier("foo").mock(), None, vec![]) + .mock(), ) .mock(), Statement::Return( @@ -4717,8 +4747,12 @@ mod tests { Assignee::Identifier("a").mock(), Assignee::Identifier("b").mock(), ], - Expression::FunctionCall("foo", None, vec![Expression::Identifier("x").mock()]) - .mock(), + Expression::FunctionCall( + box Expression::Identifier("foo").mock(), + None, + vec![Expression::Identifier("x").mock()], + ) + .mock(), ) .mock(), Statement::Return( @@ -4806,7 +4840,8 @@ mod tests { Assignee::Identifier("a").mock(), Assignee::Identifier("b").mock(), ], - Expression::FunctionCall("foo", None, vec![]).mock(), + Expression::FunctionCall(box Expression::Identifier("foo").mock(), None, vec![]) + .mock(), ) .mock(), Statement::Return( @@ -4921,7 +4956,8 @@ mod tests { ), ) .mock()], - Expression::FunctionCall("foo", None, vec![]).mock(), + Expression::FunctionCall(box Expression::Identifier("foo").mock(), None, vec![]) + .mock(), ) .mock(), Statement::Return( @@ -4973,7 +5009,12 @@ mod tests { Statement::Assertion( Expression::Eq( box Expression::IntConstant(1usize.into()).mock(), - box Expression::FunctionCall("foo", None, vec![]).mock(), + box Expression::FunctionCall( + box Expression::Identifier("foo").mock(), + None, + vec![], + ) + .mock(), ) .mock(), ) @@ -5071,7 +5112,8 @@ mod tests { Assignee::Identifier("a").mock(), Assignee::Identifier("b").mock(), ], - Expression::FunctionCall("foo", None, vec![]).mock(), + Expression::FunctionCall(box Expression::Identifier("foo").mock(), None, vec![]) + .mock(), ) .mock(), Statement::Return( @@ -6128,7 +6170,7 @@ mod tests { main.value.statements = vec![Statement::Return( ExpressionList { expressions: vec![Expression::FunctionCall( - "foo", + box Expression::Identifier("foo").mock(), None, vec![Expression::IntConstant(0usize.into()).mock()], ) diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index f9d40185e..70faa133d 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -1141,7 +1141,7 @@ impl<'ast, T> IntoIterator for ArrayValue<'ast, T> { } } -impl<'ast, T: Clone> ArrayValue<'ast, T> { +impl<'ast, T: Clone + fmt::Debug> ArrayValue<'ast, T> { fn expression_at_aux + Into>>( v: TypedExpressionOrSpread<'ast, T>, ) -> Vec>> { @@ -1181,7 +1181,7 @@ impl<'ast, T: Clone> ArrayValue<'ast, T> { ) -> Option> { self.0 .iter() - .map(|v| Self::expression_at_aux::(v.clone())) + .map(|v| dbg!(Self::expression_at_aux::(v.clone()))) .flatten() .take_while(|e| e.is_some()) .map(|e| e.unwrap()) diff --git a/zokrates_parser/src/zokrates.pest b/zokrates_parser/src/zokrates.pest index ce7499e70..a9d4da85b 100644 --- a/zokrates_parser/src/zokrates.pest +++ b/zokrates_parser/src/zokrates.pest @@ -65,8 +65,9 @@ expression_list = _{(expression ~ ("," ~ expression)*)?} expression = { unaried_term ~ (op_binary ~ unaried_term)* } unaried_term = { op_unary? ~ powered_term } -powered_term = { term ~ (op_pow ~ exponent_expression)? } -term = { ("(" ~ expression ~ ")") | inline_struct_expression | conditional_expression | postfix_expression | primary_expression | inline_array_expression | array_initializer_expression } +powered_term = { postfixed_term ~ (op_pow ~ exponent_expression)? } +postfixed_term = { term ~ access* } +term = { ("(" ~ expression ~ ")") | inline_struct_expression | conditional_expression | primary_expression | inline_array_expression | array_initializer_expression } spread = { "..." ~ expression } range = { from_expression? ~ ".." ~ to_expression? } from_expression = { expression } @@ -74,7 +75,6 @@ to_expression = { expression } conditional_expression = { "if" ~ expression ~ "then" ~ expression ~ "else" ~ expression ~ "fi"} -postfix_expression = { identifier ~ access+ } // we force there to be at least one access, otherwise this matches single identifiers access = { array_access | call_access | member_access } array_access = { "[" ~ range_or_expression ~ "]" } call_access = { ("::" ~ explicit_generics)? ~ "(" ~ arguments ~ ")" } diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index 22b4d0d78..ae27e4712 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -413,8 +413,8 @@ mod ast { Ternary(TernaryExpression<'ast>), Binary(BinaryExpression<'ast>), Unary(UnaryExpression<'ast>), - Postfix(PostfixExpression<'ast>), Identifier(IdentifierExpression<'ast>), + Postfix(PostfixExpression<'ast>), Literal(LiteralExpression<'ast>), InlineArray(InlineArrayExpression<'ast>), InlineStruct(InlineStructExpression<'ast>), @@ -427,16 +427,43 @@ mod ast { Expression(Expression<'ast>), InlineStruct(InlineStructExpression<'ast>), Ternary(TernaryExpression<'ast>), - Postfix(PostfixExpression<'ast>), Primary(PrimaryExpression<'ast>), InlineArray(InlineArrayExpression<'ast>), ArrayInitializer(ArrayInitializerExpression<'ast>), } + #[derive(Debug, FromPest, PartialEq, Clone)] + #[pest_ast(rule(Rule::postfixed_term))] + pub struct PostfixedTerm<'ast> { + pub base: Term<'ast>, + pub accesses: Vec>, + #[pest_ast(outer())] + pub span: Span<'ast>, + } + + #[derive(Debug, Clone, PartialEq)] + pub struct PostfixExpression<'ast> { + pub base: Box>, + pub accesses: Vec>, + pub span: Span<'ast>, + } + + impl<'ast> From> for Expression<'ast> { + fn from(t: PostfixedTerm<'ast>) -> Self { + let base = Expression::from(t.base); + let accesses = t.accesses.into_iter().map(Access::from).collect(); + Expression::Postfix(PostfixExpression { + base: Box::new(base), + accesses, + span: t.span, + }) + } + } + #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::powered_term))] struct PoweredTerm<'ast> { - base: Term<'ast>, + base: PostfixedTerm<'ast>, op: Option, exponent: Option>, #[pest_ast(outer())] @@ -512,7 +539,6 @@ mod ast { match t { Term::Expression(e) => e, Term::Ternary(e) => Expression::Ternary(e), - Term::Postfix(e) => Expression::Postfix(e), Term::Primary(e) => e.into(), Term::InlineArray(e) => Expression::InlineArray(e), Term::InlineStruct(e) => Expression::InlineStruct(e), @@ -592,15 +618,6 @@ mod ast { #[pest_ast(rule(Rule::to_expression))] pub struct ToExpression<'ast>(pub Expression<'ast>); - #[derive(Debug, FromPest, PartialEq, Clone)] - #[pest_ast(rule(Rule::postfix_expression))] - pub struct PostfixExpression<'ast> { - pub id: IdentifierExpression<'ast>, - pub accesses: Vec>, - #[pest_ast(outer())] - pub span: Span<'ast>, - } - #[derive(Debug, FromPest, PartialEq, Clone)] #[pest_ast(rule(Rule::inline_array_expression))] pub struct InlineArrayExpression<'ast> { @@ -1359,10 +1376,10 @@ mod tests { }), ], expression: Expression::Postfix(PostfixExpression { - id: IdentifierExpression { + base: Box::new(Expression::Identifier(IdentifierExpression { value: String::from("foo"), span: Span::new(&source, 36, 39).unwrap() - }, + })), accesses: vec![Access::Call(CallAccess { explicit_generics: None, arguments: Arguments { From f3f400a6bd838c4a4869170f2ebf44eb0dbc2b42 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 5 Oct 2021 21:20:55 +0300 Subject: [PATCH 43/83] fix tests, add breaking example --- .../constant_index_on_spread_inline.zok | 2 ++ zokrates_core/src/absy/from_ast.rs | 35 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 zokrates_cli/examples/constant_index_on_spread_inline.zok diff --git a/zokrates_cli/examples/constant_index_on_spread_inline.zok b/zokrates_cli/examples/constant_index_on_spread_inline.zok new file mode 100644 index 000000000..ccd266e2c --- /dev/null +++ b/zokrates_cli/examples/constant_index_on_spread_inline.zok @@ -0,0 +1,2 @@ +def main(field[3] a) -> field: + return [...a][0] \ No newline at end of file diff --git a/zokrates_core/src/absy/from_ast.rs b/zokrates_core/src/absy/from_ast.rs index 48db883fd..296a98654 100644 --- a/zokrates_core/src/absy/from_ast.rs +++ b/zokrates_core/src/absy/from_ast.rs @@ -1123,21 +1123,44 @@ mod tests { } #[test] - #[should_panic] fn call_array_element() { - // a call after an array access should be rejected + // a call after an array access should be accepted let source = "def main(): return a[2](3)"; let ast = pest::generate_ast(&source).unwrap(); - absy::Module::from(ast); + assert_eq!( + absy::Module::from(ast), + wrap(absy::Expression::FunctionCall( + box absy::Expression::Select( + box absy::Expression::Identifier("a").mock(), + box absy::RangeOrExpression::Expression( + absy::Expression::IntConstant(2u32.into()).mock() + ) + ) + .mock(), + None, + vec![absy::Expression::IntConstant(3u32.into()).mock()], + )) + ); } #[test] - #[should_panic] fn call_call_result() { - // a call after a call should be rejected + // a call after a call should be accepted let source = "def main(): return a(2)(3)"; let ast = pest::generate_ast(&source).unwrap(); - absy::Module::from(ast); + assert_eq!( + absy::Module::from(ast), + wrap(absy::Expression::FunctionCall( + box absy::Expression::FunctionCall( + box absy::Expression::Identifier("a").mock(), + None, + vec![absy::Expression::IntConstant(2u32.into()).mock()] + ) + .mock(), + None, + vec![absy::Expression::IntConstant(3u32.into()).mock()], + )) + ); } } #[test] From 69cb867a8e3745769c0e70b8946dd1e1e7e456ca Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 5 Oct 2021 21:39:18 +0300 Subject: [PATCH 44/83] fix incorrect propagation --- .../src/static_analysis/propagation.rs | 21 ++++------- zokrates_core/src/typed_absy/mod.rs | 36 +++++++++---------- zokrates_core/src/typed_absy/result_folder.rs | 10 ++++-- 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index cb09a669e..337b2c34b 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -971,7 +971,10 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { } fn fold_select_expression< - E: Expr<'ast, T> + Select<'ast, T> + From>, + E: Expr<'ast, T> + + Select<'ast, T> + + From> + + Into>, >( &mut self, _: &E::Ty, @@ -988,12 +991,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { (ArrayExpressionInner::Value(v), UExpressionInner::Value(n)) => { if n < size { Ok(SelectOrExpression::Expression( - E::from( - v.expression_at::>(n as usize) - .unwrap() - .clone(), - ) - .into_inner(), + v.expression_at::(n as usize).unwrap().into_inner(), )) } else { Err(Error::OutOfBounds(n, size)) @@ -1005,14 +1003,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { TypedExpression::Array(a) => match a.as_inner() { ArrayExpressionInner::Value(v) => { Ok(SelectOrExpression::Expression( - E::from( - v.expression_at::>( - n as usize, - ) - .unwrap() - .clone(), - ) - .into_inner(), + v.expression_at::(n as usize).unwrap().into_inner(), )) } _ => unreachable!("should be an array value"), diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index 70faa133d..8b362c9e5 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -1142,30 +1142,28 @@ impl<'ast, T> IntoIterator for ArrayValue<'ast, T> { } impl<'ast, T: Clone + fmt::Debug> ArrayValue<'ast, T> { - fn expression_at_aux + Into>>( + fn expression_at_aux< + U: Select<'ast, T> + Into> + From>, + >( v: TypedExpressionOrSpread<'ast, T>, - ) -> Vec>> { + ) -> Vec> { match v { - TypedExpressionOrSpread::Expression(e) => vec![Some(e.clone())], + TypedExpressionOrSpread::Expression(e) => vec![Some(e.clone().into())], TypedExpressionOrSpread::Spread(s) => match s.array.size().into_inner() { UExpressionInner::Value(size) => { let array_ty = s.array.ty().clone(); match s.array.into_inner() { - ArrayExpressionInner::Value(v) => v - .into_iter() - .flat_map(Self::expression_at_aux::) - .collect(), + ArrayExpressionInner::Value(v) => { + v.into_iter().flat_map(Self::expression_at_aux).collect() + } a => (0..size) .map(|i| { - Some( - U::select( - a.clone() - .annotate(*array_ty.ty.clone(), array_ty.size.clone()), - i as u32, - ) - .into(), - ) + Some(U::select( + a.clone() + .annotate(*array_ty.ty.clone(), array_ty.size.clone()), + i as u32, + )) }) .collect(), } @@ -1175,13 +1173,15 @@ impl<'ast, T: Clone + fmt::Debug> ArrayValue<'ast, T> { } } - pub fn expression_at + Into>>( + pub fn expression_at< + U: Select<'ast, T> + Into> + From>, + >( &self, index: usize, - ) -> Option> { + ) -> Option { self.0 .iter() - .map(|v| dbg!(Self::expression_at_aux::(v.clone()))) + .map(|v| Self::expression_at_aux(v.clone())) .flatten() .take_while(|e| e.is_some()) .map(|e| e.unwrap()) diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index 738f026cc..eb0e38fee 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -212,7 +212,10 @@ pub trait ResultFolder<'ast, T: Field>: Sized { } fn fold_select_expression< - E: Expr<'ast, T> + Select<'ast, T> + From>, + E: Expr<'ast, T> + + Select<'ast, T> + + From> + + Into>, >( &mut self, ty: &E::Ty, @@ -724,7 +727,10 @@ pub fn fold_member_expression< pub fn fold_select_expression< 'ast, T: Field, - E: Expr<'ast, T> + Select<'ast, T> + From>, + E: Expr<'ast, T> + + Select<'ast, T> + + From> + + Into>, F: ResultFolder<'ast, T>, >( f: &mut F, From fa30d66427a168dc80d6b6303e7443f8f1ef8f37 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 8 Oct 2021 10:28:32 +0300 Subject: [PATCH 45/83] avoid creating postfix expressions with no accesses --- zokrates_pest_ast/src/lib.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/zokrates_pest_ast/src/lib.rs b/zokrates_pest_ast/src/lib.rs index ae27e4712..cf41cd9ce 100644 --- a/zokrates_pest_ast/src/lib.rs +++ b/zokrates_pest_ast/src/lib.rs @@ -413,8 +413,8 @@ mod ast { Ternary(TernaryExpression<'ast>), Binary(BinaryExpression<'ast>), Unary(UnaryExpression<'ast>), - Identifier(IdentifierExpression<'ast>), Postfix(PostfixExpression<'ast>), + Identifier(IdentifierExpression<'ast>), Literal(LiteralExpression<'ast>), InlineArray(InlineArrayExpression<'ast>), InlineStruct(InlineStructExpression<'ast>), @@ -451,12 +451,16 @@ mod ast { impl<'ast> From> for Expression<'ast> { fn from(t: PostfixedTerm<'ast>) -> Self { let base = Expression::from(t.base); - let accesses = t.accesses.into_iter().map(Access::from).collect(); - Expression::Postfix(PostfixExpression { - base: Box::new(base), - accesses, - span: t.span, - }) + let accesses = t.accesses; + if accesses.is_empty() { + base + } else { + Expression::Postfix(PostfixExpression { + base: Box::new(base), + accesses, + span: t.span, + }) + } } } From 392bd9e67cdff9a81e86e25d0b58a4fc841a7bad Mon Sep 17 00:00:00 2001 From: Thibaut Schaeffer Date: Fri, 8 Oct 2021 13:14:03 +0300 Subject: [PATCH 46/83] Create 1030-schaeff --- changelogs/unreleased/1030-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1030-schaeff diff --git a/changelogs/unreleased/1030-schaeff b/changelogs/unreleased/1030-schaeff new file mode 100644 index 000000000..bfeaa2d0b --- /dev/null +++ b/changelogs/unreleased/1030-schaeff @@ -0,0 +1 @@ +Allow more postfix expressions, exit gracefully when trying to call anything else than an identifier From 31ee9ea6a8c035bfc534aa59e1c97691a76f05d0 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 8 Oct 2021 14:24:13 +0300 Subject: [PATCH 47/83] try an older nightly --- rust-toolchain | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index d4d39d43a..86d5c15de 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-10-05 \ No newline at end of file +nightly-2021-09-10 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4d5f7afdb..b05a1056b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2021-10-05" \ No newline at end of file +channel = "nightly-2021-09-10" \ No newline at end of file From 6de5a21d7e7228cbd83abe97aac6430f353209a4 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 8 Oct 2021 20:26:28 +0300 Subject: [PATCH 48/83] improve example --- zokrates_cli/examples/constant_index_on_spread_inline.zok | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_cli/examples/constant_index_on_spread_inline.zok b/zokrates_cli/examples/constant_index_on_spread_inline.zok index ccd266e2c..c876e1aa6 100644 --- a/zokrates_cli/examples/constant_index_on_spread_inline.zok +++ b/zokrates_cli/examples/constant_index_on_spread_inline.zok @@ -1,2 +1,2 @@ def main(field[3] a) -> field: - return [...a][0] \ No newline at end of file + return [...a][0] + [a[0]][0] + [a[0]; 1][0] \ No newline at end of file From be629093ec20b0f8d33387b5b921e7ff514b6fe8 Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 11 Oct 2021 09:33:23 +0300 Subject: [PATCH 49/83] remove clone --- zokrates_core/src/typed_absy/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index 8b362c9e5..0dc8db347 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -1148,7 +1148,7 @@ impl<'ast, T: Clone + fmt::Debug> ArrayValue<'ast, T> { v: TypedExpressionOrSpread<'ast, T>, ) -> Vec> { match v { - TypedExpressionOrSpread::Expression(e) => vec![Some(e.clone().into())], + TypedExpressionOrSpread::Expression(e) => vec![Some(e.into())], TypedExpressionOrSpread::Spread(s) => match s.array.size().into_inner() { UExpressionInner::Value(size) => { let array_ty = s.array.ty().clone(); From 60ed48be238a983597fa39fe901d6cc7e880d6e7 Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 11 Oct 2021 10:16:03 +0300 Subject: [PATCH 50/83] tweak assert --- zokrates_test/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_test/src/lib.rs b/zokrates_test/src/lib.rs index 9398105a7..f3605f35f 100644 --- a/zokrates_test/src/lib.rs +++ b/zokrates_test/src/lib.rs @@ -158,7 +158,7 @@ fn compile_and_run(t: Tests) { let count = bin.constraint_count(); assert!( - !count > target_count, + count <= target_count, "{} exceeded max constraint count (actual={}, max={}, p={:.2}% of max)", entry_point.display(), count, From 60569586fd86a571f4bdb2f1ebda25beaaeede9e Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 11 Oct 2021 10:34:49 +0300 Subject: [PATCH 51/83] fail in zir propagation when an assertion is false --- zokrates_core/src/static_analysis/zir_propagation.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zokrates_core/src/static_analysis/zir_propagation.rs b/zokrates_core/src/static_analysis/zir_propagation.rs index c3028a030..69cbd4842 100644 --- a/zokrates_core/src/static_analysis/zir_propagation.rs +++ b/zokrates_core/src/static_analysis/zir_propagation.rs @@ -15,6 +15,7 @@ type Constants<'ast, T> = HashMap, ZirExpression<'ast, T>>; pub enum Error { OutOfBounds(u128, u128), DivisionByZero, + AssertionFailed, } impl fmt::Display for Error { @@ -28,6 +29,7 @@ impl fmt::Display for Error { Error::DivisionByZero => { write!(f, "Division by zero detected in zir during static analysis",) } + Error::AssertionFailed => write!(f, "User assertion failed"), } } } @@ -53,6 +55,7 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ZirPropagator<'ast, T> { match s { ZirStatement::Assertion(e) => match self.fold_boolean_expression(e)? { BooleanExpression::Value(true) => Ok(vec![]), + BooleanExpression::Value(false) => Err(Error::AssertionFailed), e => Ok(vec![ZirStatement::Assertion(e)]), }, ZirStatement::Definition(a, e) => { From eb492153f4de240e6d60a5b67885f323fc6e49da Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 12:10:02 +0300 Subject: [PATCH 52/83] add docs, use alias in example --- zokrates_book/src/language/types.md | 12 ++++++++++++ zokrates_cli/examples/book/type_aliases.zok | 11 +++++++++++ .../examples/sudoku/prime_sudoku_checker.zok | 17 +++++++++++++---- .../src/static_analysis/struct_concretizer.rs | 1 - 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 zokrates_cli/examples/book/type_aliases.zok diff --git a/zokrates_book/src/language/types.md b/zokrates_book/src/language/types.md index b97c1913d..8d4bbee2b 100644 --- a/zokrates_book/src/language/types.md +++ b/zokrates_book/src/language/types.md @@ -128,6 +128,8 @@ struct Point { } ``` +Note that two struct definitions with the same members still introduce two entirely different types. For example, they cannot be compared with each other. + #### Declaration and Initialization Initialization of a variable of a struct type always needs to happen in the same statement as a declaration, unless the struct-typed variable is declared within a function's signature. @@ -144,3 +146,13 @@ The variables within a struct instance, the so called members, can be accessed t ```zokrates {{#include ../../../zokrates_cli/examples/book/struct_assign.zok}} ``` + +### Type aliases + +Type aliases can be defined for any existing type. This can be useful for readability, or to specialize generic types. + +Note that type aliases are just syntactic sugar: in the type system, a type and its alias are exactly equivalent. For example, they can be compared. + +```zokrates +{{#include ../../../zokrates_cli/examples/book/type_aliases.zok}} +``` diff --git a/zokrates_cli/examples/book/type_aliases.zok b/zokrates_cli/examples/book/type_aliases.zok new file mode 100644 index 000000000..fd500a4e6 --- /dev/null +++ b/zokrates_cli/examples/book/type_aliases.zok @@ -0,0 +1,11 @@ +type MyField = field + +type Rectangle = bool[L][W] + +type Square = Rectangle + +def main(): + MyField f = 42 + Rectangle<2, 2> r = [[true; 2]; 2] + Square<2> s = r + return \ No newline at end of file diff --git a/zokrates_cli/examples/sudoku/prime_sudoku_checker.zok b/zokrates_cli/examples/sudoku/prime_sudoku_checker.zok index a5cd37d63..aec779179 100644 --- a/zokrates_cli/examples/sudoku/prime_sudoku_checker.zok +++ b/zokrates_cli/examples/sudoku/prime_sudoku_checker.zok @@ -8,6 +8,9 @@ // -------------------------- // | c21 | c22 || d21 | d22 | +type Grid = field[N][N] +const field[4] PRIMES = [2, 3, 5, 7] + // We encode values in the following way: // 1 -> 2 // 2 -> 3 @@ -18,16 +21,22 @@ // assumption: `a, b, c, d` are all in `{ 2, 3, 5, 7 }` def checkNoDuplicates(field a, field b, field c, field d) -> bool: // as `{ 2, 3, 5, 7 }` are primes, the set `{ a, b, c, d }` is equal to the set `{ 2, 3, 5, 7}` if and only if the products match - return a * b * c * d == 2 * 3 * 5 * 7 + return a * b * c * d == PRIMES[0] * PRIMES[1] * PRIMES[2] * PRIMES[3] -// returns `0` if and only if `x` in `{ 2, 3, 5, 7 }` +// returns true if and only if `x` is one of the `4` primes def validateInput(field x) -> bool: - return (x-2) * (x-3) * (x-5) * (x-7) == 0 + field res = 1 + + for u32 i in 0..4 do + res = res * (x - PRIMES[i]) + endfor + + return res == 0 // variables naming: box'row''column' def main(field a21, field b11, field b22, field c11, field c22, field d21, private field a11, private field a12, private field a22, private field b12, private field b21, private field c12, private field c21, private field d11, private field d12, private field d22) -> bool: - field[4][4] a = [[a11, a12, b11, b12], [a21, a22, b21, b22], [c11, c12, d11, d12], [c21, c22, d21, d22]] + Grid<4> a = [[a11, a12, b11, b12], [a21, a22, b21, b22], [c11, c12, d11, d12], [c21, c22, d21, d22]] bool res = true diff --git a/zokrates_core/src/static_analysis/struct_concretizer.rs b/zokrates_core/src/static_analysis/struct_concretizer.rs index c62a31ae7..71502cc1f 100644 --- a/zokrates_core/src/static_analysis/struct_concretizer.rs +++ b/zokrates_core/src/static_analysis/struct_concretizer.rs @@ -4,7 +4,6 @@ // Where for an array, `field[N]` ends up being propagated to `field[42]` which is direct to turn into a concrete type, // for structs, `Foo { field[N] a }` is propagated to `Foo<42> { field[N] a }`. The missing step is replacing `N` by `42` // *inside* the canonical type, so that it can be concretized in the same way arrays are. -// We apply this transformation only to the main function. use crate::typed_absy::folder::*; use crate::typed_absy::{ From d7389378238acc6196cc3a05e92dd06ae4933ef8 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 19:35:25 +0300 Subject: [PATCH 53/83] try with older nightly --- rust-toolchain | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 07734de24..5ca2f2e27 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-09-01 \ No newline at end of file +nightly-2021-08-01 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 146e37bda..47d8ceee2 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2021-09-01" \ No newline at end of file +channel = "nightly-2021-08-01" \ No newline at end of file From bdd68fb922a5470081a1643271fee097527af3d8 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 19:45:17 +0300 Subject: [PATCH 54/83] try with previous nightly --- rust-toolchain | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 5ca2f2e27..1cfd57a1d 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-08-01 \ No newline at end of file +nightly-2021-04-25 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 47d8ceee2..41d688e55 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2021-08-01" \ No newline at end of file +channel = "nightly-2021-04-25" \ No newline at end of file From bb3632f57d254721274d7d579cce318214092bd4 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 19:56:34 +0300 Subject: [PATCH 55/83] upgrade cargo lock --- Cargo.lock | 367 ++++++++++++++++++++++++++--------------------------- 1 file changed, 182 insertions(+), 185 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84b07de18..5896115c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "991984e3fd003e7ba02eb724f87a0f997b78677c46c0e91f8424ad7394c9886a" dependencies = [ "getrandom 0.2.3", "once_cell", @@ -145,8 +145,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e8cb28c2137af1ef058aa59616db3f7df67dbb70bf2be4ee6920008cc30d98c" dependencies = [ - "quote 1.0.9", - "syn 1.0.73", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -155,10 +155,10 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b9c256a93a10ed9708c16a517d6dcfaba3d215c0d7fab44d29a9affefb5eeb8" dependencies = [ - "num-bigint 0.4.0", + "num-bigint 0.4.2", "num-traits 0.2.14", - "quote 1.0.9", - "syn 1.0.73", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -208,7 +208,7 @@ dependencies = [ "ark-relations", "ark-std", "derivative", - "num-bigint 0.4.0", + "num-bigint 0.4.2", "num-integer", "num-traits 0.2.14", "tracing", @@ -254,7 +254,7 @@ dependencies = [ "ark-relations", "ark-std", "derivative", - "num-bigint 0.4.0", + "num-bigint 0.4.2", "num-traits 0.2.14", "tracing", ] @@ -286,9 +286,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ac3d78c750b01f5df5b2e76d106ed31487a93b3868f14a7f0eb3a74f45e1d8a" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -354,9 +354,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" dependencies = [ "addr2line", "cc", @@ -403,15 +403,15 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake2" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a5720225ef5daecf08657f23791354e1685a8c91a4c60c7f3d3b2892f978f4" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" dependencies = [ "crypto-mac", "digest 0.9.0", @@ -461,9 +461,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static", "memchr", @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" +checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" [[package]] name = "byte-tools" @@ -497,9 +497,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cargo-platform" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] @@ -519,9 +519,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.68" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" dependencies = [ "jobserver", ] @@ -555,9 +555,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089" dependencies = [ "cc", ] @@ -575,11 +575,11 @@ dependencies = [ [[package]] name = "console_error_panic_hook" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "wasm-bindgen", ] @@ -591,9 +591,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cpufeatures" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" dependencies = [ "libc", ] @@ -624,9 +624,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -710,12 +710,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" +checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" dependencies = [ - "quote 1.0.9", - "syn 1.0.73", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -724,9 +724,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -838,9 +838,9 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", "synstructure", ] @@ -882,9 +882,9 @@ dependencies = [ "num-bigint 0.2.6", "num-integer", "num-traits 0.2.14", - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -921,9 +921,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" +checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" dependencies = [ "futures-channel", "futures-core", @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" dependencies = [ "futures-core", "futures-sink", @@ -946,15 +946,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" [[package]] name = "futures-executor" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" +checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" dependencies = [ "futures-core", "futures-task", @@ -964,27 +964,27 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" [[package]] name = "futures-sink" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" +checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" [[package]] name = "futures-task" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" [[package]] name = "futures-util" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" dependencies = [ "autocfg", "futures-channel", @@ -1043,15 +1043,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "git2" -version = "0.13.20" +version = "0.13.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9831e983241f8c5591ed53f17d874833e2fa82cac2625f3888c50cbfe136cba" +checksum = "2a8057932925d3a9d9e4434ea016570d37420ddb1ceed45a174d577f24ed6700" dependencies = [ "bitflags", "libc", @@ -1126,24 +1126,24 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "jobserver" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -1156,15 +1156,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.98" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" +checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" [[package]] name = "libgit2-sys" -version = "0.12.21+1.1.0" +version = "0.12.24+1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86271bacd72b2b9e854c3dcfb82efd538f15f870e4c11af66900effb462f6825" +checksum = "ddbd6021eef06fb289a8f54b3c2acfdd85ff2a585dfbb24b8576325373d2152c" dependencies = [ "cc", "libc", @@ -1176,9 +1176,9 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.2.21" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0186af0d8f171ae6b9c4c90ec51898bad5d08a2d5e470903a50d9ad8959cbee" +checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" dependencies = [ "cc", "libc", @@ -1217,9 +1217,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "maybe-uninit" @@ -1229,9 +1229,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" @@ -1283,9 +1283,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d047c1062aa51e256408c560894e5251f08925980e53cf1aa5bd00eec6512" +checksum = "74e768dff5fb39a41b3bcd30bb25cf989706c90d028d1ad71971987aa309d535" dependencies = [ "autocfg", "num-integer", @@ -1343,9 +1343,9 @@ dependencies = [ [[package]] name = "object" -version = "0.25.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" dependencies = [ "memchr", ] @@ -1376,9 +1376,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.65" +version = "0.9.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" +checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058" dependencies = [ "autocfg", "cc", @@ -1453,9 +1453,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -1483,9 +1483,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb" [[package]] name = "ppv-lite86" @@ -1516,9 +1516,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" dependencies = [ "unicode-xid 0.2.2", ] @@ -1545,11 +1545,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.29", ] [[package]] @@ -1681,9 +1681,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] @@ -1760,9 +1760,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_version" @@ -1838,29 +1838,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.126" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -1893,9 +1893,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.5" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", @@ -1930,9 +1930,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" [[package]] name = "strsim" @@ -1942,9 +1942,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "subtle" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" @@ -1959,24 +1959,24 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.73" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", + "proc-macro2 1.0.29", + "quote 1.0.10", "unicode-xid 0.2.2", ] [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", "unicode-xid 0.2.2", ] @@ -2042,9 +2042,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.2.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" dependencies = [ "tinyvec_macros", ] @@ -2057,9 +2057,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tracing" -version = "0.1.26" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -2069,20 +2069,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] name = "tracing-core" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" [[package]] name = "typed-arena" @@ -2092,9 +2092,9 @@ checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d" [[package]] name = "typenum" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" +checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "ucd-trie" @@ -2119,12 +2119,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -2137,9 +2134,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -2220,9 +2217,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -2230,24 +2227,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.24" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2257,38 +2254,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ - "quote 1.0.9", + "quote 1.0.10", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wasm-bindgen-test" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cab416a9b970464c2882ed92d55b0c33046b08e0bdc9d59b3b718acd4e1bae8" +checksum = "96f1aa7971fdf61ef0f353602102dbea75a56e225ed036c1e3740564b91e6b7e" dependencies = [ "console_error_panic_hook", "js-sys", @@ -2300,19 +2297,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4543fc6cf3541ef0d98bf720104cc6bd856d7eba449fd2aa365ef4fed0e782" +checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", + "proc-macro2 1.0.29", + "quote 1.0.10", ] [[package]] name = "web-sys" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2351,22 +2348,22 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "zeroize" -version = "1.3.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "bf68b08513768deaa790264a7fac27a58cbf2705cfcdc9448362229217d7e970" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" +checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7" dependencies = [ - "proc-macro2 1.0.27", - "quote 1.0.9", - "syn 1.0.73", + "proc-macro2 1.0.29", + "quote 1.0.10", + "syn 1.0.80", "synstructure", ] @@ -2445,7 +2442,7 @@ dependencies = [ "regex 0.2.11", "serde", "serde_json", - "sha2 0.9.5", + "sha2 0.9.8", "typed-arena", "wasm-bindgen-test", "zokrates_common", From 86acffe23b0e28bbb81e43556f64e9e3d798ca5d Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 20:11:01 +0300 Subject: [PATCH 56/83] revert toolchain --- rust-toolchain | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 86d5c15de..1cfd57a1d 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-09-10 \ No newline at end of file +nightly-2021-04-25 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b05a1056b..41d688e55 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2021-09-10" \ No newline at end of file +channel = "nightly-2021-04-25" \ No newline at end of file From e454f89b3d814fc1f5a089e85544e9c8f64167c8 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 20:47:24 +0300 Subject: [PATCH 57/83] disable parallel --- zokrates_core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_core/Cargo.toml b/zokrates_core/Cargo.toml index 41d4a1056..35435b1a8 100644 --- a/zokrates_core/Cargo.toml +++ b/zokrates_core/Cargo.toml @@ -63,6 +63,6 @@ pretty_assertions = "0.6.1" zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver"} [build-dependencies] -cc = { version = "1.0", features = ["parallel"], optional = true } +cc = { version = "1.0", optional = true } cmake = { version = "0.1.31", optional = true } git2 = { version = "0.13.1", optional = true } From 2d7b32f97d954f1bd1d41d3bdb6d311e2564ceb3 Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 12 Oct 2021 22:05:09 +0300 Subject: [PATCH 58/83] print cmake version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b766ebcd3..c01470106 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Version information - command: rustc --version; cargo --version; rustup --version + command: rustc --version; cargo --version; rustup --version; cmake --version - run: name: Calculate dependencies command: cargo generate-lockfile From 4fe021dcb339e8970c1f4db1a8454e0fc8a28b77 Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 12 Oct 2021 22:45:23 +0200 Subject: [PATCH 59/83] update rust version --- Dockerfile.env | 6 ++++-- rust-toolchain | 1 - rust-toolchain.toml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 rust-toolchain diff --git a/Dockerfile.env b/Dockerfile.env index 167b0bd80..58b7c8fa0 100644 --- a/Dockerfile.env +++ b/Dockerfile.env @@ -1,6 +1,8 @@ FROM ubuntu:18.04 SHELL ["/bin/bash", "-c"] +ARG RUST_VERSION=nightly + ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH @@ -19,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libprocps-dev \ libssl-dev \ pkg-config \ - clang-format \ + clang-format-6.0 \ python3 \ python-markdown \ && add-apt-repository ppa:mozillateam/ppa \ @@ -29,7 +31,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y \ - && rustup toolchain install nightly --allow-downgrade --profile minimal --component rustfmt clippy \ + && rustup toolchain install $RUST_VERSION --allow-downgrade --profile minimal --component rustfmt clippy \ && cargo install --git https://github.com/rustwasm/wasm-pack \ && rm -rf /usr/local/cargo/registry \ && curl -sL https://deb.nodesource.com/setup_lts.x | bash - && apt-get install -y nodejs && npm i -g solc \ diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 1cfd57a1d..000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2021-04-25 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 41d688e55..47d8ceee2 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2021-04-25" \ No newline at end of file +channel = "nightly-2021-08-01" \ No newline at end of file From b4c390315009560c7e57adc8c45218f480dad21f Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 12 Oct 2021 22:56:59 +0200 Subject: [PATCH 60/83] change cmake version --- zokrates_core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_core/Cargo.toml b/zokrates_core/Cargo.toml index 35435b1a8..615e64832 100644 --- a/zokrates_core/Cargo.toml +++ b/zokrates_core/Cargo.toml @@ -64,5 +64,5 @@ zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver"} [build-dependencies] cc = { version = "1.0", optional = true } -cmake = { version = "0.1.31", optional = true } +cmake = { version = "=0.1.45", optional = true } git2 = { version = "0.13.1", optional = true } From 0a22a23bbb8c00f7a26d78aa398ff91af2bf8ea4 Mon Sep 17 00:00:00 2001 From: dark64 Date: Tue, 12 Oct 2021 23:08:24 +0200 Subject: [PATCH 61/83] reverting --- Dockerfile.env | 2 +- zokrates_core/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.env b/Dockerfile.env index 58b7c8fa0..72fc52fe9 100644 --- a/Dockerfile.env +++ b/Dockerfile.env @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libprocps-dev \ libssl-dev \ pkg-config \ - clang-format-6.0 \ + clang-format \ python3 \ python-markdown \ && add-apt-repository ppa:mozillateam/ppa \ diff --git a/zokrates_core/Cargo.toml b/zokrates_core/Cargo.toml index 615e64832..182be457b 100644 --- a/zokrates_core/Cargo.toml +++ b/zokrates_core/Cargo.toml @@ -63,6 +63,6 @@ pretty_assertions = "0.6.1" zokrates_fs_resolver = { version = "0.5", path = "../zokrates_fs_resolver"} [build-dependencies] -cc = { version = "1.0", optional = true } +cc = { version = "1.0", features = ["parallel"], optional = true } cmake = { version = "=0.1.45", optional = true } git2 = { version = "0.13.1", optional = true } From 71708eac4d05cc0294481cad4092c780994ffb0e Mon Sep 17 00:00:00 2001 From: Darko Macesic Date: Tue, 12 Oct 2021 23:57:40 +0200 Subject: [PATCH 62/83] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c01470106..866d8fa81 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Version information - command: rustc --version; cargo --version; rustup --version; cmake --version + command: rustc --version; cargo --version; rustup --version - run: name: Calculate dependencies command: cargo generate-lockfile @@ -305,4 +305,4 @@ workflows: - wasm_test - integration_test - zokrates_js_build - - zokrates_js_test \ No newline at end of file + - zokrates_js_test From bca349e35ba993ede245139d10c0a8070c176024 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 00:58:00 +0300 Subject: [PATCH 63/83] revert ci change --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c01470106..b766ebcd3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Version information - command: rustc --version; cargo --version; rustup --version; cmake --version + command: rustc --version; cargo --version; rustup --version - run: name: Calculate dependencies command: cargo generate-lockfile From 31409d15487e99cf81ca7a84537b66641b265197 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 01:50:40 +0300 Subject: [PATCH 64/83] merge dev, add changelog --- changelogs/unreleased/1032-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1032-schaeff diff --git a/changelogs/unreleased/1032-schaeff b/changelogs/unreleased/1032-schaeff new file mode 100644 index 000000000..3ee328454 --- /dev/null +++ b/changelogs/unreleased/1032-schaeff @@ -0,0 +1 @@ +Fail at compile time when complex types are known not to be equal \ No newline at end of file From e42033241e57e8a1f05f95af3b69ac1d77b08bdc Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 11:45:55 +0300 Subject: [PATCH 65/83] add marlin to backend table --- zokrates_book/src/toolbox/proving_schemes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_book/src/toolbox/proving_schemes.md b/zokrates_book/src/toolbox/proving_schemes.md index 3629c5ee2..f1b580631 100644 --- a/zokrates_book/src/toolbox/proving_schemes.md +++ b/zokrates_book/src/toolbox/proving_schemes.md @@ -49,7 +49,7 @@ ZoKrates supports multiple backends. The options are the following: | ---- | -------- | --------------- | ------ | | Bellman | `--backend bellman` | G16 | ALTBN_128, BLS12_381 | | Libsnark | `--backend libsnark` | GM17, PGHR13 | ALTBN_128 | -| Ark | `--backend ark` | GM17 | ALTBN_128, BLS12_377, BW6_761 | +| Ark | `--backend ark` | GM17, MARLIN | ALTBN_128, BLS12_377, BW6_761 | Default: `bellman` From e97826719f4e4d7bed92687c547a7ad6f47aa3ee Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 11:47:59 +0300 Subject: [PATCH 66/83] changelog --- changelogs/unreleased/1034-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1034-schaeff diff --git a/changelogs/unreleased/1034-schaeff b/changelogs/unreleased/1034-schaeff new file mode 100644 index 000000000..cc4498d13 --- /dev/null +++ b/changelogs/unreleased/1034-schaeff @@ -0,0 +1 @@ +Add Marlin proving scheme to the backend table in the book \ No newline at end of file From 37940bb067887ac704af03d6c732583a0c795ccb Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 13 Oct 2021 12:07:28 +0200 Subject: [PATCH 67/83] introduce assertion type --- zokrates_core/src/flat_absy/mod.rs | 7 ++-- zokrates_core/src/flatten/mod.rs | 32 +++++++++++-------- zokrates_core/src/parser/tokenize/position.rs | 2 +- zokrates_core/src/semantics.rs | 2 +- .../static_analysis/flatten_complex_types.rs | 10 ++++-- .../src/static_analysis/propagation.rs | 14 +++----- .../static_analysis/variable_write_remover.rs | 2 +- zokrates_core/src/typed_absy/folder.rs | 4 +-- zokrates_core/src/typed_absy/mod.rs | 31 ++++++++++++++---- zokrates_core/src/typed_absy/result_folder.rs | 4 +-- zokrates_core/src/zir/folder.rs | 2 +- zokrates_core/src/zir/mod.rs | 28 +++++++++++----- zokrates_core/src/zir/result_folder.rs | 4 ++- 13 files changed, 88 insertions(+), 54 deletions(-) diff --git a/zokrates_core/src/flat_absy/mod.rs b/zokrates_core/src/flat_absy/mod.rs index 96cdab83e..cd5ed9156 100644 --- a/zokrates_core/src/flat_absy/mod.rs +++ b/zokrates_core/src/flat_absy/mod.rs @@ -43,7 +43,7 @@ pub enum RuntimeError { Euclidean, ShaXor, Division, - Source(Option), + Source(String), ArgumentBitness, SelectRangeCheck, } @@ -87,10 +87,7 @@ impl fmt::Display for RuntimeError { Euclidean => "Euclidean check failed", ShaXor => "Internal Sha check failed", Division => "Division check failed", - Source(m) => m - .as_ref() - .map(|s| s.as_str()) - .unwrap_or("User assertion failed"), + Source(m) => m.as_str(), ArgumentBitness => "Argument bitness check failed", SelectRangeCheck => "Out of bounds array access", }; diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index 58846f805..d1dd4bae8 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -14,7 +14,6 @@ use crate::compile::CompileConfig; use crate::embed::FlatEmbed; use crate::flat_absy::*; use crate::solvers::Solver; -use crate::typed_absy::AssertionMetadata; use crate::zir::types::{Type, UBitwidth}; use crate::zir::*; use std::collections::hash_map::Entry; @@ -147,6 +146,15 @@ impl FlatUExpression { } } +impl From for RuntimeError { + fn from(ty: AssertionType) -> Self { + match ty { + AssertionType::Source(s) => RuntimeError::Source(s), + AssertionType::SelectRangeCheck => RuntimeError::SelectRangeCheck, + } + } +} + impl<'ast, T: Field> Flattener<'ast, T> { pub fn flatten(p: ZirProgram<'ast, T>, config: &CompileConfig) -> FlatProg { Flattener::new(config).flatten_program(p) @@ -2371,13 +2379,13 @@ impl<'ast, T: Field> Flattener<'ast, T> { .insert(FlatExpression::Identifier(var), bits); } } - ZirStatement::Assertion(e, metadata) => { + ZirStatement::Assertion(e, ty) => { match e { BooleanExpression::And(..) => { for boolean in e.into_conjunction_iterator() { self.flatten_statement( statements_flattened, - ZirStatement::Assertion(boolean, metadata.clone()), + ZirStatement::Assertion(boolean, ty.clone()), ) } } @@ -2385,7 +2393,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { let lhs = self.flatten_field_expression(statements_flattened, lhs); let rhs = self.flatten_field_expression(statements_flattened, rhs); - self.flatten_equality_assertion(statements_flattened, lhs, rhs, metadata) + self.flatten_equality_assertion(statements_flattened, lhs, rhs, ty) } BooleanExpression::UintEq(box lhs, box rhs) => { let lhs = self @@ -2395,13 +2403,13 @@ impl<'ast, T: Field> Flattener<'ast, T> { .flatten_uint_expression(statements_flattened, rhs) .get_field_unchecked(); - self.flatten_equality_assertion(statements_flattened, lhs, rhs, metadata) + self.flatten_equality_assertion(statements_flattened, lhs, rhs, ty) } BooleanExpression::BoolEq(box lhs, box rhs) => { let lhs = self.flatten_boolean_expression(statements_flattened, lhs); let rhs = self.flatten_boolean_expression(statements_flattened, rhs); - self.flatten_equality_assertion(statements_flattened, lhs, rhs, metadata) + self.flatten_equality_assertion(statements_flattened, lhs, rhs, ty) } _ => { // naive approach: flatten the boolean to a single field element and constrain it to 1 @@ -2411,14 +2419,14 @@ impl<'ast, T: Field> Flattener<'ast, T> { statements_flattened.push(FlatStatement::Condition( e, FlatExpression::Number(T::from(1)), - RuntimeError::Source(metadata.map(|m| m.to_string())), + ty.into(), )); } else { // swap so that left side is linear statements_flattened.push(FlatStatement::Condition( FlatExpression::Number(T::from(1)), e, - RuntimeError::Source(metadata.map(|m| m.to_string())), + ty.into(), )); } } @@ -2530,7 +2538,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { statements_flattened: &mut FlatStatements, lhs: FlatExpression, rhs: FlatExpression, - metadata: Option, + assertion_type: AssertionType, ) { let (lhs, rhs) = match (lhs, rhs) { (FlatExpression::Mult(box x, box y), z) | (z, FlatExpression::Mult(box x, box y)) => ( @@ -2548,11 +2556,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { ), ), }; - statements_flattened.push(FlatStatement::Condition( - lhs, - rhs, - RuntimeError::Source(metadata.map(|m| m.to_string())), - )); + statements_flattened.push(FlatStatement::Condition(lhs, rhs, assertion_type.into())); } /// Identifies a non-linear expression by assigning it to a new identifier. diff --git a/zokrates_core/src/parser/tokenize/position.rs b/zokrates_core/src/parser/tokenize/position.rs index a37b2a4bb..12394209a 100644 --- a/zokrates_core/src/parser/tokenize/position.rs +++ b/zokrates_core/src/parser/tokenize/position.rs @@ -1,6 +1,6 @@ use std::fmt; -#[derive(Clone, PartialEq, Eq, Copy, Hash, Default)] +#[derive(Clone, PartialEq, Eq, Copy, Hash, Default, PartialOrd, Ord)] pub struct Position { pub line: usize, pub col: usize, diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 6f787be85..0a5b3c929 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1741,7 +1741,7 @@ impl<'ast, T: Field> Checker<'ast, T> { match e { TypedExpression::Boolean(e) => Ok(TypedStatement::Assertion( e, - Some(AssertionMetadata { + AssertionType::Source(AssertionMetadata { file: module_id.display().to_string(), position: pos.0, message, diff --git a/zokrates_core/src/static_analysis/flatten_complex_types.rs b/zokrates_core/src/static_analysis/flatten_complex_types.rs index e6522fc19..2f1435e7e 100644 --- a/zokrates_core/src/static_analysis/flatten_complex_types.rs +++ b/zokrates_core/src/static_analysis/flatten_complex_types.rs @@ -379,9 +379,15 @@ fn fold_statement<'ast, T: Field>( typed_absy::TypedStatement::Declaration(..) => { unreachable!() } - typed_absy::TypedStatement::Assertion(e, m) => { + typed_absy::TypedStatement::Assertion(e, ty) => { let e = f.fold_boolean_expression(statements_buffer, e); - vec![zir::ZirStatement::Assertion(e, m)] + let ty = match ty { + typed_absy::AssertionType::Source(metadata) => { + zir::AssertionType::Source(metadata.to_string()) + } + typed_absy::AssertionType::SelectRangeCheck => zir::AssertionType::SelectRangeCheck, + }; + vec![zir::ZirStatement::Assertion(e, ty)] } typed_absy::TypedStatement::For(..) => unreachable!(), typed_absy::TypedStatement::MultipleDefinition(variables, elist) => { diff --git a/zokrates_core/src/static_analysis/propagation.rs b/zokrates_core/src/static_analysis/propagation.rs index c4339c5e9..8c9c6e8a3 100644 --- a/zokrates_core/src/static_analysis/propagation.rs +++ b/zokrates_core/src/static_analysis/propagation.rs @@ -620,18 +620,14 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> { Ok(statements) } - TypedStatement::Assertion(e, metadata) => { + TypedStatement::Assertion(e, ty) => { let e_str = e.to_string(); let expr = self.fold_boolean_expression(e)?; match expr { - BooleanExpression::Value(v) if !v => Err(Error::AssertionFailed(format!( - "{}: ({})", - metadata - .map(|m| m.to_string()) - .unwrap_or_else(|| "Assertion failed".to_string()), - e_str, - ))), - _ => Ok(vec![TypedStatement::Assertion(expr, metadata)]), + BooleanExpression::Value(v) if !v => { + Err(Error::AssertionFailed(format!("{}: ({})", ty, e_str))) + } + _ => Ok(vec![TypedStatement::Assertion(expr, ty)]), } } s @ TypedStatement::PushCallLog(..) => Ok(vec![s]), diff --git a/zokrates_core/src/static_analysis/variable_write_remover.rs b/zokrates_core/src/static_analysis/variable_write_remover.rs index c99459fd3..614e5b28e 100644 --- a/zokrates_core/src/static_analysis/variable_write_remover.rs +++ b/zokrates_core/src/static_analysis/variable_write_remover.rs @@ -49,7 +49,7 @@ impl<'ast> VariableWriteRemover { Access::Select(head) => { statements.insert(TypedStatement::Assertion( BooleanExpression::UintLt(box head.clone(), box size.into()), - None, + AssertionType::SelectRangeCheck, )); ArrayExpressionInner::Value( diff --git a/zokrates_core/src/typed_absy/folder.rs b/zokrates_core/src/typed_absy/folder.rs index 4fa9e820d..ef91db57e 100644 --- a/zokrates_core/src/typed_absy/folder.rs +++ b/zokrates_core/src/typed_absy/folder.rs @@ -461,8 +461,8 @@ pub fn fold_statement<'ast, T: Field, F: Folder<'ast, T>>( TypedStatement::Definition(f.fold_assignee(a), f.fold_expression(e)) } TypedStatement::Declaration(v) => TypedStatement::Declaration(f.fold_variable(v)), - TypedStatement::Assertion(e, m) => { - TypedStatement::Assertion(f.fold_boolean_expression(e), m) + TypedStatement::Assertion(e, ty) => { + TypedStatement::Assertion(f.fold_boolean_expression(e), ty) } TypedStatement::For(v, from, to, statements) => TypedStatement::For( f.fold_variable(v), diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index 8b8b75bbb..de7dc6e93 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -576,7 +576,7 @@ impl<'ast, T: fmt::Display> fmt::Display for TypedAssignee<'ast, T> { } } -#[derive(Clone, Debug, PartialEq, Hash, Eq, Default)] +#[derive(Clone, Debug, PartialEq, Hash, Eq, Default, PartialOrd, Ord)] pub struct AssertionMetadata { pub file: String, pub position: Position, @@ -593,6 +593,21 @@ impl fmt::Display for AssertionMetadata { } } +#[derive(Debug, Clone, PartialEq, Hash, Eq, PartialOrd, Ord)] +pub enum AssertionType { + Source(AssertionMetadata), + SelectRangeCheck, +} + +impl fmt::Display for AssertionType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + AssertionType::Source(metadata) => write!(f, "{}", metadata), + AssertionType::SelectRangeCheck => write!(f, "Range check on array access"), + } + } +} + /// A statement in a `TypedFunction` #[allow(clippy::large_enum_variant)] #[derive(Clone, PartialEq, Debug, Hash, Eq, PartialOrd, Ord)] @@ -600,7 +615,7 @@ pub enum TypedStatement<'ast, T> { Return(Vec>), Definition(TypedAssignee<'ast, T>, TypedExpression<'ast, T>), Declaration(Variable<'ast, T>), - Assertion(BooleanExpression<'ast, T>, Option), + Assertion(BooleanExpression<'ast, T>, AssertionType), For( Variable<'ast, T>, UExpression<'ast, T>, @@ -648,12 +663,14 @@ impl<'ast, T: fmt::Display> fmt::Display for TypedStatement<'ast, T> { } TypedStatement::Declaration(ref var) => write!(f, "{}", var), TypedStatement::Definition(ref lhs, ref rhs) => write!(f, "{} = {}", lhs, rhs), - TypedStatement::Assertion(ref e, ref metadata) => { + TypedStatement::Assertion(ref e, ref ty) => { write!(f, "assert({}", e)?; - let metadata = metadata.as_ref().unwrap(); - match &metadata.message { - Some(m) => write!(f, ", \"{}\")", m), - None => write!(f, ")"), + match ty { + AssertionType::Source(metadata) => match &metadata.message { + Some(m) => write!(f, ", \"{}\")", m), + None => write!(f, ")"), + }, + internal => write!(f, ") // {}", internal), } } TypedStatement::For(ref var, ref start, ref stop, ref list) => { diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index 0dfdf909a..b173a668d 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -458,8 +458,8 @@ pub fn fold_statement<'ast, T: Field, F: ResultFolder<'ast, T>>( TypedStatement::Definition(f.fold_assignee(a)?, f.fold_expression(e)?) } TypedStatement::Declaration(v) => TypedStatement::Declaration(f.fold_variable(v)?), - TypedStatement::Assertion(e, m) => { - TypedStatement::Assertion(f.fold_boolean_expression(e)?, m) + TypedStatement::Assertion(e, ty) => { + TypedStatement::Assertion(f.fold_boolean_expression(e)?, ty) } TypedStatement::For(v, from, to, statements) => TypedStatement::For( f.fold_variable(v)?, diff --git a/zokrates_core/src/zir/folder.rs b/zokrates_core/src/zir/folder.rs index dbf6011fc..88d0eb4e7 100644 --- a/zokrates_core/src/zir/folder.rs +++ b/zokrates_core/src/zir/folder.rs @@ -115,7 +115,7 @@ pub fn fold_statement<'ast, T: Field, F: Folder<'ast, T>>( .flat_map(|e| f.fold_statement(e)) .collect(), ), - ZirStatement::Assertion(e, m) => ZirStatement::Assertion(f.fold_boolean_expression(e), m), + ZirStatement::Assertion(e, ty) => ZirStatement::Assertion(f.fold_boolean_expression(e), ty), ZirStatement::MultipleDefinition(variables, elist) => ZirStatement::MultipleDefinition( variables.into_iter().map(|v| f.fold_variable(v)).collect(), f.fold_expression_list(elist), diff --git a/zokrates_core/src/zir/mod.rs b/zokrates_core/src/zir/mod.rs index 01abcaa66..2d0fded6a 100644 --- a/zokrates_core/src/zir/mod.rs +++ b/zokrates_core/src/zir/mod.rs @@ -19,9 +19,7 @@ use std::fmt; use zokrates_field::Field; pub use self::folder::Folder; - pub use self::identifier::{Identifier, SourceIdentifier}; -use crate::typed_absy::AssertionMetadata; /// A typed program as a collection of modules, one of them being the main #[derive(PartialEq, Debug)] @@ -87,6 +85,21 @@ impl<'ast, T: fmt::Debug> fmt::Debug for ZirFunction<'ast, T> { pub type ZirAssignee<'ast> = Variable<'ast>; +#[derive(Debug, Clone, PartialEq, Hash, Eq)] +pub enum AssertionType { + Source(String), + SelectRangeCheck, +} + +impl fmt::Display for AssertionType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + AssertionType::Source(message) => write!(f, "{}", message), + AssertionType::SelectRangeCheck => write!(f, "Range check on array access"), + } + } +} + /// A statement in a `ZirFunction` #[derive(Clone, PartialEq, Hash, Eq, Debug)] pub enum ZirStatement<'ast, T> { @@ -97,7 +110,7 @@ pub enum ZirStatement<'ast, T> { Vec>, Vec>, ), - Assertion(BooleanExpression<'ast, T>, Option), + Assertion(BooleanExpression<'ast, T>, AssertionType), MultipleDefinition(Vec>, ZirExpressionList<'ast, T>), } @@ -132,12 +145,11 @@ impl<'ast, T: fmt::Display> fmt::Display for ZirStatement<'ast, T> { .join("\n") ) } - ZirStatement::Assertion(ref e, ref metadata) => { + ZirStatement::Assertion(ref e, ref ty) => { write!(f, "assert({}", e)?; - let metadata = metadata.as_ref().unwrap(); - match &metadata.message { - Some(m) => write!(f, ", \"{}\")", m), - None => write!(f, ")"), + match ty { + AssertionType::Source(message) => write!(f, ", \"{}\")", message), + internal => write!(f, ") // {}", internal), } } ZirStatement::MultipleDefinition(ref ids, ref rhs) => { diff --git a/zokrates_core/src/zir/result_folder.rs b/zokrates_core/src/zir/result_folder.rs index 0b566c9c8..47462c2fb 100644 --- a/zokrates_core/src/zir/result_folder.rs +++ b/zokrates_core/src/zir/result_folder.rs @@ -137,7 +137,9 @@ pub fn fold_statement<'ast, T: Field, F: ResultFolder<'ast, T>>( .flatten() .collect(), ), - ZirStatement::Assertion(e, m) => ZirStatement::Assertion(f.fold_boolean_expression(e)?, m), + ZirStatement::Assertion(e, ty) => { + ZirStatement::Assertion(f.fold_boolean_expression(e)?, ty) + } ZirStatement::MultipleDefinition(variables, elist) => ZirStatement::MultipleDefinition( variables .into_iter() From 9474406aaf7362d8405215382948b59decfac682 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 13 Oct 2021 12:43:49 +0200 Subject: [PATCH 68/83] make tests pass --- zokrates_core/src/flatten/mod.rs | 28 +++++++++---------- .../src/static_analysis/zir_propagation.rs | 5 ++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index d1dd4bae8..011fcfa34 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -2694,7 +2694,7 @@ mod tests { box BooleanExpression::Identifier("x".into()), box BooleanExpression::Identifier("y".into()), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -2724,7 +2724,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; @@ -2762,7 +2762,7 @@ mod tests { ), box FieldElementExpression::Identifier("y".into()), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -2795,7 +2795,7 @@ mod tests { ), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; @@ -2834,7 +2834,7 @@ mod tests { .metadata(metadata.clone()), box UExpressionInner::Value(42).annotate(32).metadata(metadata), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -2860,7 +2860,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; @@ -2895,7 +2895,7 @@ mod tests { box FieldElementExpression::Identifier("x".into()), box FieldElementExpression::Identifier("y".into()), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -2925,7 +2925,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; @@ -2969,7 +2969,7 @@ mod tests { ), box FieldElementExpression::Identifier("z".into()), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -3003,7 +3003,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; @@ -3047,7 +3047,7 @@ mod tests { box FieldElementExpression::Identifier("y".into()), ), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -3081,7 +3081,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; @@ -3135,7 +3135,7 @@ mod tests { box FieldElementExpression::Identifier("t".into()), ), ), - None, + AssertionType::Source("".to_string()), ), ], signature: Signature { @@ -3180,7 +3180,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source(None), + RuntimeError::Source("".to_string()), ), ], }; diff --git a/zokrates_core/src/static_analysis/zir_propagation.rs b/zokrates_core/src/static_analysis/zir_propagation.rs index 8e0b77140..7699ce231 100644 --- a/zokrates_core/src/static_analysis/zir_propagation.rs +++ b/zokrates_core/src/static_analysis/zir_propagation.rs @@ -654,6 +654,7 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ZirPropagator<'ast, T> { #[cfg(test)] mod tests { use super::*; + use crate::zir::AssertionType; use zokrates_field::Bn128Field; #[test] @@ -670,7 +671,7 @@ mod tests { box FieldElementExpression::Number(Bn128Field::from(1)), ), ), - None, + AssertionType::Source("".to_string()), )]; let mut propagator = ZirPropagator::default(); @@ -690,7 +691,7 @@ mod tests { box FieldElementExpression::Identifier("x".into()), box FieldElementExpression::Identifier("y".into()), ), - None + AssertionType::Source("".to_string()) )] ); } From 99424faa27cde1c781605b8f16fd0961ce51518f Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 19:35:55 +0300 Subject: [PATCH 69/83] factor code, implement for uint --- zokrates_core/src/flatten/mod.rs | 250 +++++++++++++------------------ 1 file changed, 103 insertions(+), 147 deletions(-) diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index f5767110d..4f65518d8 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -632,6 +632,88 @@ impl<'ast, T: Field> Flattener<'ast, T> { ) } + fn lt_check( + &mut self, + statements_flattened: &mut FlatStatements, + lhs_flattened: FlatExpression, + rhs_flattened: FlatExpression, + bit_width: usize, + ) -> FlatExpression { + match (lhs_flattened, rhs_flattened) { + (x, FlatExpression::Number(constant)) => { + self.constant_lt_check(statements_flattened, x, constant) + } + // (c < x <= p - 1) <=> (0 <= p - 1 - x < p - 1 - c) + (FlatExpression::Number(constant), x) => self.constant_lt_check( + statements_flattened, + FlatExpression::Sub(box T::max_value().into(), box x), + T::max_value() - constant, + ), + (lhs_flattened, rhs_flattened) => { + let lhs_id = self.define(lhs_flattened, statements_flattened); + let rhs_id = self.define(rhs_flattened, statements_flattened); + + // shifted_sub := 2**safe_width + lhs - rhs + let shifted_sub = FlatExpression::Add( + box FlatExpression::Number(T::from(2).pow(bit_width)), + box FlatExpression::Sub( + box FlatExpression::Identifier(lhs_id), + box FlatExpression::Identifier(rhs_id), + ), + ); + + let sub_width = bit_width + 1; + + // define variables for the bits + let shifted_sub_bits_be: Vec = + (0..sub_width).map(|_| self.use_sym()).collect(); + + // add a directive to get the bits + statements_flattened.push(FlatStatement::Directive(FlatDirective::new( + shifted_sub_bits_be.clone(), + Solver::bits(sub_width), + vec![shifted_sub.clone()], + ))); + + // bitness checks + for bit in shifted_sub_bits_be.iter() { + statements_flattened.push(FlatStatement::Condition( + FlatExpression::Identifier(*bit), + FlatExpression::Mult( + box FlatExpression::Identifier(*bit), + box FlatExpression::Identifier(*bit), + ), + RuntimeError::LtFinalBitness, + )); + } + + // sum(sym_b{i} * 2**i) + let mut expr = FlatExpression::Number(T::from(0)); + + for (i, bit) in shifted_sub_bits_be.iter().take(sub_width).enumerate() { + expr = FlatExpression::Add( + box expr, + box FlatExpression::Mult( + box FlatExpression::Identifier(*bit), + box FlatExpression::Number(T::from(2).pow(sub_width - i - 1)), + ), + ); + } + + statements_flattened.push(FlatStatement::Condition( + shifted_sub, + expr, + RuntimeError::LtFinalSum, + )); + + FlatExpression::Sub( + box FlatExpression::Number(T::one()), + box FlatExpression::Identifier(shifted_sub_bits_be[0]), + ) + } + } + } + /// Flattens a boolean expression /// /// # Arguments @@ -664,87 +746,17 @@ impl<'ast, T: Field> Flattener<'ast, T> { // Get the bit width to know the size of the binary decompositions for this Field let bit_width = T::get_required_bits(); - // We know from semantic checking that lhs and rhs have the same type - // What the expression will flatten to depends on that type + let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies to field elements whose difference is strictly smaller than 2**(bitwidth - 2) let lhs_flattened = self.flatten_field_expression(statements_flattened, lhs); let rhs_flattened = self.flatten_field_expression(statements_flattened, rhs); - match (lhs_flattened, rhs_flattened) { - (x, FlatExpression::Number(constant)) => { - self.constant_lt_check(statements_flattened, x, constant) - } - // (c < x <= p - 1) <=> (0 <= p - 1 - x < p - 1 - c) - (FlatExpression::Number(constant), x) => self.constant_lt_check( - statements_flattened, - FlatExpression::Sub(box T::max_value().into(), box x), - T::max_value() - constant, - ), - (lhs_flattened, rhs_flattened) => { - let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies field elements whose difference is strictly smaller than 2**(bitwidth - 2) - - let lhs_id = self.define(lhs_flattened, statements_flattened); - let rhs_id = self.define(rhs_flattened, statements_flattened); - - // shifted_sub := 2**safe_width + lhs - rhs - let shifted_sub = FlatExpression::Add( - box FlatExpression::Number(T::from(2).pow(safe_width)), - box FlatExpression::Sub( - box FlatExpression::Identifier(lhs_id), - box FlatExpression::Identifier(rhs_id), - ), - ); - - let sub_width = safe_width + 1; - - // define variables for the bits - let shifted_sub_bits_be: Vec = - (0..sub_width).map(|_| self.use_sym()).collect(); - - // add a directive to get the bits - statements_flattened.push(FlatStatement::Directive(FlatDirective::new( - shifted_sub_bits_be.clone(), - Solver::bits(sub_width), - vec![shifted_sub.clone()], - ))); - - // bitness checks - for bit in shifted_sub_bits_be.iter() { - statements_flattened.push(FlatStatement::Condition( - FlatExpression::Identifier(*bit), - FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Identifier(*bit), - ), - RuntimeError::LtFinalBitness, - )); - } - - // sum(sym_b{i} * 2**i) - let mut expr = FlatExpression::Number(T::from(0)); - - for (i, bit) in shifted_sub_bits_be.iter().take(sub_width).enumerate() { - expr = FlatExpression::Add( - box expr, - box FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Number(T::from(2).pow(sub_width - i - 1)), - ), - ); - } - - statements_flattened.push(FlatStatement::Condition( - shifted_sub, - expr, - RuntimeError::LtFinalSum, - )); - - FlatExpression::Sub( - box FlatExpression::Number(T::one()), - box FlatExpression::Identifier(shifted_sub_bits_be[0]), - ) - } - } + self.lt_check( + statements_flattened, + lhs_flattened, + rhs_flattened, + safe_width, + ) } BooleanExpression::BoolEq(box lhs, box rhs) => { // lhs and rhs are booleans, they flatten to 0 or 1 @@ -827,79 +839,23 @@ impl<'ast, T: Field> Flattener<'ast, T> { BooleanExpression::FieldLe(rhs, lhs), ), BooleanExpression::UintLt(box lhs, box rhs) => { - let lhs_flattened = self.flatten_uint_expression(statements_flattened, lhs); - let rhs_flattened = self.flatten_uint_expression(statements_flattened, rhs); - - // Get the bit width to know the size of the binary decompositions for this Field - // This is not this uint bitwidth - let bit_width = T::get_required_bits(); - - // lhs - let lhs_id = self.define(lhs_flattened.get_field_unchecked(), statements_flattened); - let rhs_id = self.define(rhs_flattened.get_field_unchecked(), statements_flattened); - - // sym := (lhs * 2) - (rhs * 2) - let subtraction_result = FlatExpression::Sub( - box FlatExpression::Mult( - box FlatExpression::Number(T::from(2)), - box FlatExpression::Identifier(lhs_id), - ), - box FlatExpression::Mult( - box FlatExpression::Number(T::from(2)), - box FlatExpression::Identifier(rhs_id), - ), - ); - - // define variables for the bits - let sub_bits_be: Vec = - (0..bit_width).map(|_| self.use_sym()).collect(); - - // add a directive to get the bits - statements_flattened.push(FlatStatement::Directive(FlatDirective::new( - sub_bits_be.clone(), - Solver::bits(bit_width), - vec![subtraction_result.clone()], - ))); + let bit_width = lhs.bitwidth.to_usize(); + assert!(lhs.metadata.as_ref().unwrap().should_reduce.to_bool()); + assert!(rhs.metadata.as_ref().unwrap().should_reduce.to_bool()); - // bitness checks - for bit in sub_bits_be.iter().take(bit_width) { - statements_flattened.push(FlatStatement::Condition( - FlatExpression::Identifier(*bit), - FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Identifier(*bit), - ), - RuntimeError::LtFinalBitness, - )); - } + let lhs_flattened = self + .flatten_uint_expression(statements_flattened, lhs) + .get_field_unchecked(); + let rhs_flattened = self + .flatten_uint_expression(statements_flattened, rhs) + .get_field_unchecked(); - // check that the decomposition is in the field with a strict `< p` checks - self.enforce_constant_le_check( + self.lt_check( statements_flattened, - &sub_bits_be, - &T::max_value().bit_vector_be(), - ); - - // sum(sym_b{i} * 2**i) - let mut expr = FlatExpression::Number(T::from(0)); - - for (i, bit) in sub_bits_be.iter().enumerate().take(bit_width) { - expr = FlatExpression::Add( - box expr, - box FlatExpression::Mult( - box FlatExpression::Identifier(*bit), - box FlatExpression::Number(T::from(2).pow(bit_width - i - 1)), - ), - ); - } - - statements_flattened.push(FlatStatement::Condition( - subtraction_result, - expr, - RuntimeError::LtFinalSum, - )); - - FlatExpression::Identifier(sub_bits_be[bit_width - 1]) + lhs_flattened, + rhs_flattened, + bit_width, + ) } BooleanExpression::UintLe(box lhs, box rhs) => { let lt = self.flatten_boolean_expression( From feb7fb7689db1c6e869beaf04fab3df48088d2ff Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 19:38:06 +0300 Subject: [PATCH 70/83] changelog --- changelogs/unreleased/1025-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1025-schaeff diff --git a/changelogs/unreleased/1025-schaeff b/changelogs/unreleased/1025-schaeff new file mode 100644 index 000000000..f30fe42d2 --- /dev/null +++ b/changelogs/unreleased/1025-schaeff @@ -0,0 +1 @@ +Reduce cost of dynamic comparison \ No newline at end of file From 035a193f58d7d330352c3ac050878f7daae780fb Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 13 Oct 2021 18:48:18 +0200 Subject: [PATCH 71/83] apply suggestions --- zokrates_core/src/flat_absy/mod.rs | 6 +- zokrates_core/src/flatten/mod.rs | 74 +++++++++++-------- zokrates_core/src/semantics.rs | 2 +- .../static_analysis/flatten_complex_types.rs | 12 +-- .../static_analysis/variable_write_remover.rs | 2 +- .../src/static_analysis/zir_propagation.rs | 16 ++-- zokrates_core/src/typed_absy/folder.rs | 4 +- zokrates_core/src/typed_absy/mod.rs | 20 ++--- zokrates_core/src/typed_absy/result_folder.rs | 4 +- zokrates_core/src/zir/folder.rs | 4 +- zokrates_core/src/zir/mod.rs | 20 ++--- zokrates_core/src/zir/result_folder.rs | 4 +- 12 files changed, 96 insertions(+), 72 deletions(-) diff --git a/zokrates_core/src/flat_absy/mod.rs b/zokrates_core/src/flat_absy/mod.rs index cd5ed9156..4f73c126b 100644 --- a/zokrates_core/src/flat_absy/mod.rs +++ b/zokrates_core/src/flat_absy/mod.rs @@ -43,7 +43,7 @@ pub enum RuntimeError { Euclidean, ShaXor, Division, - Source(String), + SourceAssertion(String), ArgumentBitness, SelectRangeCheck, } @@ -54,7 +54,7 @@ impl RuntimeError { !matches!( self, - Source(_) | Inverse | LtSum | SelectRangeCheck | ArgumentBitness + SourceAssertion(_) | Inverse | LtSum | SelectRangeCheck | ArgumentBitness ) } } @@ -87,7 +87,7 @@ impl fmt::Display for RuntimeError { Euclidean => "Euclidean check failed", ShaXor => "Internal Sha check failed", Division => "Division check failed", - Source(m) => m.as_str(), + SourceAssertion(m) => m.as_str(), ArgumentBitness => "Argument bitness check failed", SelectRangeCheck => "Out of bounds array access", }; diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index 011fcfa34..ba73cc415 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -12,7 +12,7 @@ use crate::ir::Interpreter; use crate::compile::CompileConfig; use crate::embed::FlatEmbed; -use crate::flat_absy::*; +use crate::flat_absy::{RuntimeError, *}; use crate::solvers::Solver; use crate::zir::types::{Type, UBitwidth}; use crate::zir::*; @@ -146,11 +146,11 @@ impl FlatUExpression { } } -impl From for RuntimeError { - fn from(ty: AssertionType) -> Self { - match ty { - AssertionType::Source(s) => RuntimeError::Source(s), - AssertionType::SelectRangeCheck => RuntimeError::SelectRangeCheck, +impl From for RuntimeError { + fn from(error: crate::zir::RuntimeError) -> Self { + match error { + crate::zir::RuntimeError::SourceAssertion(s) => RuntimeError::SourceAssertion(s), + crate::zir::RuntimeError::SelectRangeCheck => RuntimeError::SelectRangeCheck, } } } @@ -2379,13 +2379,13 @@ impl<'ast, T: Field> Flattener<'ast, T> { .insert(FlatExpression::Identifier(var), bits); } } - ZirStatement::Assertion(e, ty) => { + ZirStatement::Assertion(e, error) => { match e { BooleanExpression::And(..) => { for boolean in e.into_conjunction_iterator() { self.flatten_statement( statements_flattened, - ZirStatement::Assertion(boolean, ty.clone()), + ZirStatement::Assertion(boolean, error.clone()), ) } } @@ -2393,7 +2393,12 @@ impl<'ast, T: Field> Flattener<'ast, T> { let lhs = self.flatten_field_expression(statements_flattened, lhs); let rhs = self.flatten_field_expression(statements_flattened, rhs); - self.flatten_equality_assertion(statements_flattened, lhs, rhs, ty) + self.flatten_equality_assertion( + statements_flattened, + lhs, + rhs, + error.into(), + ) } BooleanExpression::UintEq(box lhs, box rhs) => { let lhs = self @@ -2403,13 +2408,23 @@ impl<'ast, T: Field> Flattener<'ast, T> { .flatten_uint_expression(statements_flattened, rhs) .get_field_unchecked(); - self.flatten_equality_assertion(statements_flattened, lhs, rhs, ty) + self.flatten_equality_assertion( + statements_flattened, + lhs, + rhs, + error.into(), + ) } BooleanExpression::BoolEq(box lhs, box rhs) => { let lhs = self.flatten_boolean_expression(statements_flattened, lhs); let rhs = self.flatten_boolean_expression(statements_flattened, rhs); - self.flatten_equality_assertion(statements_flattened, lhs, rhs, ty) + self.flatten_equality_assertion( + statements_flattened, + lhs, + rhs, + error.into(), + ) } _ => { // naive approach: flatten the boolean to a single field element and constrain it to 1 @@ -2419,14 +2434,14 @@ impl<'ast, T: Field> Flattener<'ast, T> { statements_flattened.push(FlatStatement::Condition( e, FlatExpression::Number(T::from(1)), - ty.into(), + error.into(), )); } else { // swap so that left side is linear statements_flattened.push(FlatStatement::Condition( FlatExpression::Number(T::from(1)), e, - ty.into(), + error.into(), )); } } @@ -2538,7 +2553,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { statements_flattened: &mut FlatStatements, lhs: FlatExpression, rhs: FlatExpression, - assertion_type: AssertionType, + error: RuntimeError, ) { let (lhs, rhs) = match (lhs, rhs) { (FlatExpression::Mult(box x, box y), z) | (z, FlatExpression::Mult(box x, box y)) => ( @@ -2556,7 +2571,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { ), ), }; - statements_flattened.push(FlatStatement::Condition(lhs, rhs, assertion_type.into())); + statements_flattened.push(FlatStatement::Condition(lhs, rhs, error)); } /// Identifies a non-linear expression by assigning it to a new identifier. @@ -2663,6 +2678,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { #[cfg(test)] mod tests { use super::*; + use crate::zir; use crate::zir::types::Signature; use crate::zir::types::Type; use zokrates_field::Bn128Field; @@ -2694,7 +2710,7 @@ mod tests { box BooleanExpression::Identifier("x".into()), box BooleanExpression::Identifier("y".into()), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -2724,7 +2740,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; @@ -2762,7 +2778,7 @@ mod tests { ), box FieldElementExpression::Identifier("y".into()), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -2795,7 +2811,7 @@ mod tests { ), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; @@ -2834,7 +2850,7 @@ mod tests { .metadata(metadata.clone()), box UExpressionInner::Value(42).annotate(32).metadata(metadata), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -2860,7 +2876,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; @@ -2895,7 +2911,7 @@ mod tests { box FieldElementExpression::Identifier("x".into()), box FieldElementExpression::Identifier("y".into()), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -2925,7 +2941,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Number(Bn128Field::from(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; @@ -2969,7 +2985,7 @@ mod tests { ), box FieldElementExpression::Identifier("z".into()), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -3003,7 +3019,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; @@ -3047,7 +3063,7 @@ mod tests { box FieldElementExpression::Identifier("y".into()), ), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -3081,7 +3097,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; @@ -3135,7 +3151,7 @@ mod tests { box FieldElementExpression::Identifier("t".into()), ), ), - AssertionType::Source("".to_string()), + zir::RuntimeError::mock(), ), ], signature: Signature { @@ -3180,7 +3196,7 @@ mod tests { box FlatExpression::Identifier(FlatVariable::new(0)), box FlatExpression::Identifier(FlatVariable::new(1)), ), - RuntimeError::Source("".to_string()), + zir::RuntimeError::mock().into(), ), ], }; diff --git a/zokrates_core/src/semantics.rs b/zokrates_core/src/semantics.rs index 0a5b3c929..0cbd7eaf0 100644 --- a/zokrates_core/src/semantics.rs +++ b/zokrates_core/src/semantics.rs @@ -1741,7 +1741,7 @@ impl<'ast, T: Field> Checker<'ast, T> { match e { TypedExpression::Boolean(e) => Ok(TypedStatement::Assertion( e, - AssertionType::Source(AssertionMetadata { + RuntimeError::SourceAssertion(AssertionMetadata { file: module_id.display().to_string(), position: pos.0, message, diff --git a/zokrates_core/src/static_analysis/flatten_complex_types.rs b/zokrates_core/src/static_analysis/flatten_complex_types.rs index 2f1435e7e..1986efdea 100644 --- a/zokrates_core/src/static_analysis/flatten_complex_types.rs +++ b/zokrates_core/src/static_analysis/flatten_complex_types.rs @@ -379,15 +379,15 @@ fn fold_statement<'ast, T: Field>( typed_absy::TypedStatement::Declaration(..) => { unreachable!() } - typed_absy::TypedStatement::Assertion(e, ty) => { + typed_absy::TypedStatement::Assertion(e, error) => { let e = f.fold_boolean_expression(statements_buffer, e); - let ty = match ty { - typed_absy::AssertionType::Source(metadata) => { - zir::AssertionType::Source(metadata.to_string()) + let error = match error { + typed_absy::RuntimeError::SourceAssertion(metadata) => { + zir::RuntimeError::SourceAssertion(metadata.to_string()) } - typed_absy::AssertionType::SelectRangeCheck => zir::AssertionType::SelectRangeCheck, + typed_absy::RuntimeError::SelectRangeCheck => zir::RuntimeError::SelectRangeCheck, }; - vec![zir::ZirStatement::Assertion(e, ty)] + vec![zir::ZirStatement::Assertion(e, error)] } typed_absy::TypedStatement::For(..) => unreachable!(), typed_absy::TypedStatement::MultipleDefinition(variables, elist) => { diff --git a/zokrates_core/src/static_analysis/variable_write_remover.rs b/zokrates_core/src/static_analysis/variable_write_remover.rs index 614e5b28e..bce07349c 100644 --- a/zokrates_core/src/static_analysis/variable_write_remover.rs +++ b/zokrates_core/src/static_analysis/variable_write_remover.rs @@ -49,7 +49,7 @@ impl<'ast> VariableWriteRemover { Access::Select(head) => { statements.insert(TypedStatement::Assertion( BooleanExpression::UintLt(box head.clone(), box size.into()), - AssertionType::SelectRangeCheck, + RuntimeError::SelectRangeCheck, )); ArrayExpressionInner::Value( diff --git a/zokrates_core/src/static_analysis/zir_propagation.rs b/zokrates_core/src/static_analysis/zir_propagation.rs index 7699ce231..138a9c219 100644 --- a/zokrates_core/src/static_analysis/zir_propagation.rs +++ b/zokrates_core/src/static_analysis/zir_propagation.rs @@ -51,9 +51,9 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ZirPropagator<'ast, T> { s: ZirStatement<'ast, T>, ) -> Result>, Self::Error> { match s { - ZirStatement::Assertion(e, m) => match self.fold_boolean_expression(e)? { + ZirStatement::Assertion(e, error) => match self.fold_boolean_expression(e)? { BooleanExpression::Value(true) => Ok(vec![]), - e => Ok(vec![ZirStatement::Assertion(e, m)]), + e => Ok(vec![ZirStatement::Assertion(e, error)]), }, ZirStatement::Definition(a, e) => { let e = self.fold_expression(e)?; @@ -654,9 +654,15 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ZirPropagator<'ast, T> { #[cfg(test)] mod tests { use super::*; - use crate::zir::AssertionType; + use crate::zir::RuntimeError; use zokrates_field::Bn128Field; + impl RuntimeError { + pub fn mock() -> Self { + RuntimeError::SourceAssertion(String::default()) + } + } + #[test] fn propagation() { // assert([x, 1] == [y, 1]) @@ -671,7 +677,7 @@ mod tests { box FieldElementExpression::Number(Bn128Field::from(1)), ), ), - AssertionType::Source("".to_string()), + RuntimeError::mock(), )]; let mut propagator = ZirPropagator::default(); @@ -691,7 +697,7 @@ mod tests { box FieldElementExpression::Identifier("x".into()), box FieldElementExpression::Identifier("y".into()), ), - AssertionType::Source("".to_string()) + RuntimeError::mock() )] ); } diff --git a/zokrates_core/src/typed_absy/folder.rs b/zokrates_core/src/typed_absy/folder.rs index ef91db57e..6a60e65ad 100644 --- a/zokrates_core/src/typed_absy/folder.rs +++ b/zokrates_core/src/typed_absy/folder.rs @@ -461,8 +461,8 @@ pub fn fold_statement<'ast, T: Field, F: Folder<'ast, T>>( TypedStatement::Definition(f.fold_assignee(a), f.fold_expression(e)) } TypedStatement::Declaration(v) => TypedStatement::Declaration(f.fold_variable(v)), - TypedStatement::Assertion(e, ty) => { - TypedStatement::Assertion(f.fold_boolean_expression(e), ty) + TypedStatement::Assertion(e, error) => { + TypedStatement::Assertion(f.fold_boolean_expression(e), error) } TypedStatement::For(v, from, to, statements) => TypedStatement::For( f.fold_variable(v), diff --git a/zokrates_core/src/typed_absy/mod.rs b/zokrates_core/src/typed_absy/mod.rs index de7dc6e93..6c970ff3d 100644 --- a/zokrates_core/src/typed_absy/mod.rs +++ b/zokrates_core/src/typed_absy/mod.rs @@ -594,16 +594,16 @@ impl fmt::Display for AssertionMetadata { } #[derive(Debug, Clone, PartialEq, Hash, Eq, PartialOrd, Ord)] -pub enum AssertionType { - Source(AssertionMetadata), +pub enum RuntimeError { + SourceAssertion(AssertionMetadata), SelectRangeCheck, } -impl fmt::Display for AssertionType { +impl fmt::Display for RuntimeError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - AssertionType::Source(metadata) => write!(f, "{}", metadata), - AssertionType::SelectRangeCheck => write!(f, "Range check on array access"), + RuntimeError::SourceAssertion(metadata) => write!(f, "{}", metadata), + RuntimeError::SelectRangeCheck => write!(f, "Range check on array access"), } } } @@ -615,7 +615,7 @@ pub enum TypedStatement<'ast, T> { Return(Vec>), Definition(TypedAssignee<'ast, T>, TypedExpression<'ast, T>), Declaration(Variable<'ast, T>), - Assertion(BooleanExpression<'ast, T>, AssertionType), + Assertion(BooleanExpression<'ast, T>, RuntimeError), For( Variable<'ast, T>, UExpression<'ast, T>, @@ -663,14 +663,14 @@ impl<'ast, T: fmt::Display> fmt::Display for TypedStatement<'ast, T> { } TypedStatement::Declaration(ref var) => write!(f, "{}", var), TypedStatement::Definition(ref lhs, ref rhs) => write!(f, "{} = {}", lhs, rhs), - TypedStatement::Assertion(ref e, ref ty) => { + TypedStatement::Assertion(ref e, ref error) => { write!(f, "assert({}", e)?; - match ty { - AssertionType::Source(metadata) => match &metadata.message { + match error { + RuntimeError::SourceAssertion(metadata) => match &metadata.message { Some(m) => write!(f, ", \"{}\")", m), None => write!(f, ")"), }, - internal => write!(f, ") // {}", internal), + error => write!(f, ") // {}", error), } } TypedStatement::For(ref var, ref start, ref stop, ref list) => { diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index b173a668d..62a745af8 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -458,8 +458,8 @@ pub fn fold_statement<'ast, T: Field, F: ResultFolder<'ast, T>>( TypedStatement::Definition(f.fold_assignee(a)?, f.fold_expression(e)?) } TypedStatement::Declaration(v) => TypedStatement::Declaration(f.fold_variable(v)?), - TypedStatement::Assertion(e, ty) => { - TypedStatement::Assertion(f.fold_boolean_expression(e)?, ty) + TypedStatement::Assertion(e, error) => { + TypedStatement::Assertion(f.fold_boolean_expression(e)?, error) } TypedStatement::For(v, from, to, statements) => TypedStatement::For( f.fold_variable(v)?, diff --git a/zokrates_core/src/zir/folder.rs b/zokrates_core/src/zir/folder.rs index 88d0eb4e7..cdd4534af 100644 --- a/zokrates_core/src/zir/folder.rs +++ b/zokrates_core/src/zir/folder.rs @@ -115,7 +115,9 @@ pub fn fold_statement<'ast, T: Field, F: Folder<'ast, T>>( .flat_map(|e| f.fold_statement(e)) .collect(), ), - ZirStatement::Assertion(e, ty) => ZirStatement::Assertion(f.fold_boolean_expression(e), ty), + ZirStatement::Assertion(e, error) => { + ZirStatement::Assertion(f.fold_boolean_expression(e), error) + } ZirStatement::MultipleDefinition(variables, elist) => ZirStatement::MultipleDefinition( variables.into_iter().map(|v| f.fold_variable(v)).collect(), f.fold_expression_list(elist), diff --git a/zokrates_core/src/zir/mod.rs b/zokrates_core/src/zir/mod.rs index 2d0fded6a..9978ed148 100644 --- a/zokrates_core/src/zir/mod.rs +++ b/zokrates_core/src/zir/mod.rs @@ -86,16 +86,16 @@ impl<'ast, T: fmt::Debug> fmt::Debug for ZirFunction<'ast, T> { pub type ZirAssignee<'ast> = Variable<'ast>; #[derive(Debug, Clone, PartialEq, Hash, Eq)] -pub enum AssertionType { - Source(String), +pub enum RuntimeError { + SourceAssertion(String), SelectRangeCheck, } -impl fmt::Display for AssertionType { +impl fmt::Display for RuntimeError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - AssertionType::Source(message) => write!(f, "{}", message), - AssertionType::SelectRangeCheck => write!(f, "Range check on array access"), + RuntimeError::SourceAssertion(message) => write!(f, "{}", message), + RuntimeError::SelectRangeCheck => write!(f, "Range check on array access"), } } } @@ -110,7 +110,7 @@ pub enum ZirStatement<'ast, T> { Vec>, Vec>, ), - Assertion(BooleanExpression<'ast, T>, AssertionType), + Assertion(BooleanExpression<'ast, T>, RuntimeError), MultipleDefinition(Vec>, ZirExpressionList<'ast, T>), } @@ -145,11 +145,11 @@ impl<'ast, T: fmt::Display> fmt::Display for ZirStatement<'ast, T> { .join("\n") ) } - ZirStatement::Assertion(ref e, ref ty) => { + ZirStatement::Assertion(ref e, ref error) => { write!(f, "assert({}", e)?; - match ty { - AssertionType::Source(message) => write!(f, ", \"{}\")", message), - internal => write!(f, ") // {}", internal), + match error { + RuntimeError::SourceAssertion(message) => write!(f, ", \"{}\")", message), + error => write!(f, ") // {}", error), } } ZirStatement::MultipleDefinition(ref ids, ref rhs) => { diff --git a/zokrates_core/src/zir/result_folder.rs b/zokrates_core/src/zir/result_folder.rs index 47462c2fb..d36c7c96c 100644 --- a/zokrates_core/src/zir/result_folder.rs +++ b/zokrates_core/src/zir/result_folder.rs @@ -137,8 +137,8 @@ pub fn fold_statement<'ast, T: Field, F: ResultFolder<'ast, T>>( .flatten() .collect(), ), - ZirStatement::Assertion(e, ty) => { - ZirStatement::Assertion(f.fold_boolean_expression(e)?, ty) + ZirStatement::Assertion(e, error) => { + ZirStatement::Assertion(f.fold_boolean_expression(e)?, error) } ZirStatement::MultipleDefinition(variables, elist) => ZirStatement::MultipleDefinition( variables From 1e04d56a7b8ef0e3ec5d903a7f71edc22a78dad1 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 13 Oct 2021 19:48:52 +0300 Subject: [PATCH 72/83] fix smt test --- zokrates_cli/tests/code/taxation.smt2 | 1531 +------------------------ 1 file changed, 5 insertions(+), 1526 deletions(-) diff --git a/zokrates_cli/tests/code/taxation.smt2 b/zokrates_cli/tests/code/taxation.smt2 index 011224744..f7e409027 100644 --- a/zokrates_cli/tests/code/taxation.smt2 +++ b/zokrates_cli/tests/code/taxation.smt2 @@ -1,6 +1,6 @@ ; Auto generated by ZoKrates -; Number of circuit variables: 1016 -; Number of equalities: 1020 +; Number of circuit variables: 258 +; Number of equalities: 257 (declare-const |~prime| Int) (declare-const |~out_0| Int) (declare-const |~one| Int) @@ -259,765 +259,7 @@ (declare-const |_252| Int) (declare-const |_253| Int) (declare-const |_254| Int) -(declare-const |_255| Int) -(declare-const |_256| Int) -(declare-const |_257| Int) -(declare-const |_258| Int) (declare-const |_259| Int) -(declare-const |_260| Int) -(declare-const |_261| Int) -(declare-const |_262| Int) -(declare-const |_263| Int) -(declare-const |_264| Int) -(declare-const |_265| Int) -(declare-const |_266| Int) -(declare-const |_267| Int) -(declare-const |_268| Int) -(declare-const |_269| Int) -(declare-const |_270| Int) -(declare-const |_271| Int) -(declare-const |_272| Int) -(declare-const |_273| Int) -(declare-const |_274| Int) -(declare-const |_275| Int) -(declare-const |_276| Int) -(declare-const |_277| Int) -(declare-const |_278| Int) -(declare-const |_279| Int) -(declare-const |_280| Int) -(declare-const |_281| Int) -(declare-const |_282| Int) -(declare-const |_283| Int) -(declare-const |_284| Int) -(declare-const |_285| Int) -(declare-const |_286| Int) -(declare-const |_287| Int) -(declare-const |_288| Int) -(declare-const |_289| Int) -(declare-const |_290| Int) -(declare-const |_291| Int) -(declare-const |_292| Int) -(declare-const |_293| Int) -(declare-const |_294| Int) -(declare-const |_295| Int) -(declare-const |_296| Int) -(declare-const |_297| Int) -(declare-const |_298| Int) -(declare-const |_299| Int) -(declare-const |_300| Int) -(declare-const |_301| Int) -(declare-const |_302| Int) -(declare-const |_303| Int) -(declare-const |_304| Int) -(declare-const |_305| Int) -(declare-const |_306| Int) -(declare-const |_307| Int) -(declare-const |_308| Int) -(declare-const |_309| Int) -(declare-const |_310| Int) -(declare-const |_311| Int) -(declare-const |_312| Int) -(declare-const |_313| Int) -(declare-const |_314| Int) -(declare-const |_315| Int) -(declare-const |_316| Int) -(declare-const |_317| Int) -(declare-const |_318| Int) -(declare-const |_319| Int) -(declare-const |_320| Int) -(declare-const |_321| Int) -(declare-const |_322| Int) -(declare-const |_323| Int) -(declare-const |_324| Int) -(declare-const |_325| Int) -(declare-const |_326| Int) -(declare-const |_327| Int) -(declare-const |_328| Int) -(declare-const |_329| Int) -(declare-const |_330| Int) -(declare-const |_331| Int) -(declare-const |_332| Int) -(declare-const |_333| Int) -(declare-const |_334| Int) -(declare-const |_335| Int) -(declare-const |_336| Int) -(declare-const |_337| Int) -(declare-const |_338| Int) -(declare-const |_339| Int) -(declare-const |_340| Int) -(declare-const |_341| Int) -(declare-const |_342| Int) -(declare-const |_343| Int) -(declare-const |_344| Int) -(declare-const |_345| Int) -(declare-const |_346| Int) -(declare-const |_347| Int) -(declare-const |_348| Int) -(declare-const |_349| Int) -(declare-const |_350| Int) -(declare-const |_351| Int) -(declare-const |_352| Int) -(declare-const |_353| Int) -(declare-const |_354| Int) -(declare-const |_355| Int) -(declare-const |_356| Int) -(declare-const |_357| Int) -(declare-const |_358| Int) -(declare-const |_359| Int) -(declare-const |_360| Int) -(declare-const |_361| Int) -(declare-const |_362| Int) -(declare-const |_363| Int) -(declare-const |_364| Int) -(declare-const |_365| Int) -(declare-const |_366| Int) -(declare-const |_367| Int) -(declare-const |_368| Int) -(declare-const |_369| Int) -(declare-const |_370| Int) -(declare-const |_371| Int) -(declare-const |_372| Int) -(declare-const |_373| Int) -(declare-const |_374| Int) -(declare-const |_375| Int) -(declare-const |_376| Int) -(declare-const |_377| Int) -(declare-const |_378| Int) -(declare-const |_379| Int) -(declare-const |_380| Int) -(declare-const |_381| Int) -(declare-const |_382| Int) -(declare-const |_383| Int) -(declare-const |_384| Int) -(declare-const |_385| Int) -(declare-const |_386| Int) -(declare-const |_387| Int) -(declare-const |_388| Int) -(declare-const |_389| Int) -(declare-const |_390| Int) -(declare-const |_391| Int) -(declare-const |_392| Int) -(declare-const |_393| Int) -(declare-const |_394| Int) -(declare-const |_395| Int) -(declare-const |_396| Int) -(declare-const |_397| Int) -(declare-const |_398| Int) -(declare-const |_399| Int) -(declare-const |_400| Int) -(declare-const |_401| Int) -(declare-const |_402| Int) -(declare-const |_403| Int) -(declare-const |_404| Int) -(declare-const |_405| Int) -(declare-const |_406| Int) -(declare-const |_407| Int) -(declare-const |_408| Int) -(declare-const |_409| Int) -(declare-const |_410| Int) -(declare-const |_411| Int) -(declare-const |_412| Int) -(declare-const |_413| Int) -(declare-const |_414| Int) -(declare-const |_415| Int) -(declare-const |_416| Int) -(declare-const |_417| Int) -(declare-const |_418| Int) -(declare-const |_419| Int) -(declare-const |_420| Int) -(declare-const |_421| Int) -(declare-const |_422| Int) -(declare-const |_423| Int) -(declare-const |_424| Int) -(declare-const |_425| Int) -(declare-const |_426| Int) -(declare-const |_427| Int) -(declare-const |_428| Int) -(declare-const |_429| Int) -(declare-const |_430| Int) -(declare-const |_431| Int) -(declare-const |_432| Int) -(declare-const |_433| Int) -(declare-const |_434| Int) -(declare-const |_435| Int) -(declare-const |_436| Int) -(declare-const |_437| Int) -(declare-const |_438| Int) -(declare-const |_439| Int) -(declare-const |_440| Int) -(declare-const |_441| Int) -(declare-const |_442| Int) -(declare-const |_443| Int) -(declare-const |_444| Int) -(declare-const |_445| Int) -(declare-const |_446| Int) -(declare-const |_447| Int) -(declare-const |_448| Int) -(declare-const |_449| Int) -(declare-const |_450| Int) -(declare-const |_451| Int) -(declare-const |_452| Int) -(declare-const |_453| Int) -(declare-const |_454| Int) -(declare-const |_455| Int) -(declare-const |_456| Int) -(declare-const |_457| Int) -(declare-const |_458| Int) -(declare-const |_459| Int) -(declare-const |_460| Int) -(declare-const |_461| Int) -(declare-const |_462| Int) -(declare-const |_463| Int) -(declare-const |_464| Int) -(declare-const |_465| Int) -(declare-const |_466| Int) -(declare-const |_467| Int) -(declare-const |_468| Int) -(declare-const |_469| Int) -(declare-const |_470| Int) -(declare-const |_471| Int) -(declare-const |_472| Int) -(declare-const |_473| Int) -(declare-const |_474| Int) -(declare-const |_475| Int) -(declare-const |_476| Int) -(declare-const |_477| Int) -(declare-const |_478| Int) -(declare-const |_479| Int) -(declare-const |_480| Int) -(declare-const |_481| Int) -(declare-const |_482| Int) -(declare-const |_483| Int) -(declare-const |_484| Int) -(declare-const |_485| Int) -(declare-const |_486| Int) -(declare-const |_487| Int) -(declare-const |_488| Int) -(declare-const |_489| Int) -(declare-const |_490| Int) -(declare-const |_491| Int) -(declare-const |_492| Int) -(declare-const |_493| Int) -(declare-const |_494| Int) -(declare-const |_495| Int) -(declare-const |_496| Int) -(declare-const |_497| Int) -(declare-const |_498| Int) -(declare-const |_499| Int) -(declare-const |_500| Int) -(declare-const |_501| Int) -(declare-const |_502| Int) -(declare-const |_503| Int) -(declare-const |_504| Int) -(declare-const |_505| Int) -(declare-const |_506| Int) -(declare-const |_507| Int) -(declare-const |_508| Int) -(declare-const |_509| Int) -(declare-const |_510| Int) -(declare-const |_511| Int) -(declare-const |_512| Int) -(declare-const |_513| Int) -(declare-const |_514| Int) -(declare-const |_515| Int) -(declare-const |_516| Int) -(declare-const |_517| Int) -(declare-const |_518| Int) -(declare-const |_519| Int) -(declare-const |_520| Int) -(declare-const |_521| Int) -(declare-const |_522| Int) -(declare-const |_523| Int) -(declare-const |_524| Int) -(declare-const |_525| Int) -(declare-const |_526| Int) -(declare-const |_527| Int) -(declare-const |_528| Int) -(declare-const |_529| Int) -(declare-const |_530| Int) -(declare-const |_531| Int) -(declare-const |_532| Int) -(declare-const |_533| Int) -(declare-const |_534| Int) -(declare-const |_535| Int) -(declare-const |_536| Int) -(declare-const |_537| Int) -(declare-const |_538| Int) -(declare-const |_539| Int) -(declare-const |_540| Int) -(declare-const |_541| Int) -(declare-const |_542| Int) -(declare-const |_543| Int) -(declare-const |_544| Int) -(declare-const |_545| Int) -(declare-const |_546| Int) -(declare-const |_547| Int) -(declare-const |_548| Int) -(declare-const |_549| Int) -(declare-const |_550| Int) -(declare-const |_551| Int) -(declare-const |_552| Int) -(declare-const |_553| Int) -(declare-const |_554| Int) -(declare-const |_555| Int) -(declare-const |_556| Int) -(declare-const |_557| Int) -(declare-const |_558| Int) -(declare-const |_559| Int) -(declare-const |_560| Int) -(declare-const |_561| Int) -(declare-const |_562| Int) -(declare-const |_563| Int) -(declare-const |_564| Int) -(declare-const |_565| Int) -(declare-const |_566| Int) -(declare-const |_567| Int) -(declare-const |_568| Int) -(declare-const |_569| Int) -(declare-const |_570| Int) -(declare-const |_571| Int) -(declare-const |_572| Int) -(declare-const |_573| Int) -(declare-const |_574| Int) -(declare-const |_575| Int) -(declare-const |_576| Int) -(declare-const |_577| Int) -(declare-const |_578| Int) -(declare-const |_579| Int) -(declare-const |_580| Int) -(declare-const |_581| Int) -(declare-const |_582| Int) -(declare-const |_583| Int) -(declare-const |_584| Int) -(declare-const |_585| Int) -(declare-const |_586| Int) -(declare-const |_587| Int) -(declare-const |_588| Int) -(declare-const |_589| Int) -(declare-const |_590| Int) -(declare-const |_591| Int) -(declare-const |_592| Int) -(declare-const |_593| Int) -(declare-const |_594| Int) -(declare-const |_595| Int) -(declare-const |_596| Int) -(declare-const |_597| Int) -(declare-const |_598| Int) -(declare-const |_599| Int) -(declare-const |_600| Int) -(declare-const |_601| Int) -(declare-const |_602| Int) -(declare-const |_603| Int) -(declare-const |_604| Int) -(declare-const |_605| Int) -(declare-const |_606| Int) -(declare-const |_607| Int) -(declare-const |_608| Int) -(declare-const |_609| Int) -(declare-const |_610| Int) -(declare-const |_611| Int) -(declare-const |_612| Int) -(declare-const |_613| Int) -(declare-const |_614| Int) -(declare-const |_615| Int) -(declare-const |_616| Int) -(declare-const |_617| Int) -(declare-const |_618| Int) -(declare-const |_619| Int) -(declare-const |_620| Int) -(declare-const |_621| Int) -(declare-const |_622| Int) -(declare-const |_623| Int) -(declare-const |_624| Int) -(declare-const |_625| Int) -(declare-const |_626| Int) -(declare-const |_627| Int) -(declare-const |_628| Int) -(declare-const |_629| Int) -(declare-const |_630| Int) -(declare-const |_631| Int) -(declare-const |_632| Int) -(declare-const |_633| Int) -(declare-const |_634| Int) -(declare-const |_635| Int) -(declare-const |_636| Int) -(declare-const |_637| Int) -(declare-const |_638| Int) -(declare-const |_639| Int) -(declare-const |_640| Int) -(declare-const |_641| Int) -(declare-const |_642| Int) -(declare-const |_643| Int) -(declare-const |_644| Int) -(declare-const |_645| Int) -(declare-const |_646| Int) -(declare-const |_647| Int) -(declare-const |_648| Int) -(declare-const |_649| Int) -(declare-const |_650| Int) -(declare-const |_651| Int) -(declare-const |_652| Int) -(declare-const |_653| Int) -(declare-const |_654| Int) -(declare-const |_655| Int) -(declare-const |_656| Int) -(declare-const |_657| Int) -(declare-const |_658| Int) -(declare-const |_659| Int) -(declare-const |_660| Int) -(declare-const |_661| Int) -(declare-const |_662| Int) -(declare-const |_663| Int) -(declare-const |_664| Int) -(declare-const |_665| Int) -(declare-const |_666| Int) -(declare-const |_667| Int) -(declare-const |_668| Int) -(declare-const |_669| Int) -(declare-const |_670| Int) -(declare-const |_671| Int) -(declare-const |_672| Int) -(declare-const |_673| Int) -(declare-const |_674| Int) -(declare-const |_675| Int) -(declare-const |_676| Int) -(declare-const |_677| Int) -(declare-const |_678| Int) -(declare-const |_679| Int) -(declare-const |_680| Int) -(declare-const |_681| Int) -(declare-const |_682| Int) -(declare-const |_683| Int) -(declare-const |_684| Int) -(declare-const |_685| Int) -(declare-const |_686| Int) -(declare-const |_687| Int) -(declare-const |_688| Int) -(declare-const |_689| Int) -(declare-const |_690| Int) -(declare-const |_691| Int) -(declare-const |_692| Int) -(declare-const |_693| Int) -(declare-const |_694| Int) -(declare-const |_695| Int) -(declare-const |_696| Int) -(declare-const |_697| Int) -(declare-const |_698| Int) -(declare-const |_699| Int) -(declare-const |_700| Int) -(declare-const |_701| Int) -(declare-const |_702| Int) -(declare-const |_703| Int) -(declare-const |_704| Int) -(declare-const |_705| Int) -(declare-const |_706| Int) -(declare-const |_707| Int) -(declare-const |_708| Int) -(declare-const |_709| Int) -(declare-const |_710| Int) -(declare-const |_711| Int) -(declare-const |_712| Int) -(declare-const |_713| Int) -(declare-const |_714| Int) -(declare-const |_715| Int) -(declare-const |_716| Int) -(declare-const |_717| Int) -(declare-const |_718| Int) -(declare-const |_719| Int) -(declare-const |_720| Int) -(declare-const |_721| Int) -(declare-const |_722| Int) -(declare-const |_723| Int) -(declare-const |_724| Int) -(declare-const |_725| Int) -(declare-const |_726| Int) -(declare-const |_727| Int) -(declare-const |_728| Int) -(declare-const |_729| Int) -(declare-const |_730| Int) -(declare-const |_731| Int) -(declare-const |_732| Int) -(declare-const |_733| Int) -(declare-const |_734| Int) -(declare-const |_735| Int) -(declare-const |_736| Int) -(declare-const |_737| Int) -(declare-const |_738| Int) -(declare-const |_739| Int) -(declare-const |_740| Int) -(declare-const |_741| Int) -(declare-const |_742| Int) -(declare-const |_743| Int) -(declare-const |_744| Int) -(declare-const |_745| Int) -(declare-const |_746| Int) -(declare-const |_747| Int) -(declare-const |_748| Int) -(declare-const |_749| Int) -(declare-const |_750| Int) -(declare-const |_751| Int) -(declare-const |_752| Int) -(declare-const |_753| Int) -(declare-const |_754| Int) -(declare-const |_755| Int) -(declare-const |_756| Int) -(declare-const |_757| Int) -(declare-const |_758| Int) -(declare-const |_759| Int) -(declare-const |_765| Int) -(declare-const |_777| Int) -(declare-const |_779| Int) -(declare-const |_785| Int) -(declare-const |_793| Int) -(declare-const |_799| Int) -(declare-const |_801| Int) -(declare-const |_803| Int) -(declare-const |_809| Int) -(declare-const |_811| Int) -(declare-const |_813| Int) -(declare-const |_819| Int) -(declare-const |_823| Int) -(declare-const |_825| Int) -(declare-const |_827| Int) -(declare-const |_837| Int) -(declare-const |_843| Int) -(declare-const |_845| Int) -(declare-const |_853| Int) -(declare-const |_855| Int) -(declare-const |_859| Int) -(declare-const |_875| Int) -(declare-const |_879| Int) -(declare-const |_885| Int) -(declare-const |_887| Int) -(declare-const |_891| Int) -(declare-const |_893| Int) -(declare-const |_895| Int) -(declare-const |_905| Int) -(declare-const |_909| Int) -(declare-const |_921| Int) -(declare-const |_929| Int) -(declare-const |_933| Int) -(declare-const |_935| Int) -(declare-const |_939| Int) -(declare-const |_941| Int) -(declare-const |_945| Int) -(declare-const |_947| Int) -(declare-const |_951| Int) -(declare-const |_965| Int) -(declare-const |_967| Int) -(declare-const |_981| Int) -(declare-const |_985| Int) -(declare-const |_989| Int) -(declare-const |_991| Int) -(declare-const |_1001| Int) -(declare-const |_1005| Int) -(declare-const |_1007| Int) -(declare-const |_1009| Int) -(declare-const |_1013| Int) -(declare-const |_1019| Int) -(declare-const |_1023| Int) -(declare-const |_1035| Int) -(declare-const |_1037| Int) -(declare-const |_1043| Int) -(declare-const |_1045| Int) -(declare-const |_1047| Int) -(declare-const |_1049| Int) -(declare-const |_1051| Int) -(declare-const |_1055| Int) -(declare-const |_1065| Int) -(declare-const |_1071| Int) -(declare-const |_1081| Int) -(declare-const |_1083| Int) -(declare-const |_1085| Int) -(declare-const |_1087| Int) -(declare-const |_1093| Int) -(declare-const |_1095| Int) -(declare-const |_1099| Int) -(declare-const |_1101| Int) -(declare-const |_1103| Int) -(declare-const |_1109| Int) -(declare-const |_1113| Int) -(declare-const |_1115| Int) -(declare-const |_1117| Int) -(declare-const |_1127| Int) -(declare-const |_1133| Int) -(declare-const |_1141| Int) -(declare-const |_1145| Int) -(declare-const |_1155| Int) -(declare-const |_1157| Int) -(declare-const |_1159| Int) -(declare-const |_1161| Int) -(declare-const |_1163| Int) -(declare-const |_1173| Int) -(declare-const |_1175| Int) -(declare-const |_1177| Int) -(declare-const |_1179| Int) -(declare-const |_1181| Int) -(declare-const |_1185| Int) -(declare-const |_1189| Int) -(declare-const |_1191| Int) -(declare-const |_1197| Int) -(declare-const |_1203| Int) -(declare-const |_1205| Int) -(declare-const |_1207| Int) -(declare-const |_1209| Int) -(declare-const |_1211| Int) -(declare-const |_1213| Int) -(declare-const |_1268| Int) -(declare-const |_1269| Int) -(declare-const |_1270| Int) -(declare-const |_1271| Int) -(declare-const |_1272| Int) -(declare-const |_1273| Int) -(declare-const |_1274| Int) -(declare-const |_1275| Int) -(declare-const |_1276| Int) -(declare-const |_1277| Int) -(declare-const |_1278| Int) -(declare-const |_1279| Int) -(declare-const |_1280| Int) -(declare-const |_1281| Int) -(declare-const |_1282| Int) -(declare-const |_1283| Int) -(declare-const |_1284| Int) -(declare-const |_1285| Int) -(declare-const |_1286| Int) -(declare-const |_1287| Int) -(declare-const |_1288| Int) -(declare-const |_1289| Int) -(declare-const |_1290| Int) -(declare-const |_1291| Int) -(declare-const |_1292| Int) -(declare-const |_1293| Int) -(declare-const |_1294| Int) -(declare-const |_1295| Int) -(declare-const |_1296| Int) -(declare-const |_1297| Int) -(declare-const |_1298| Int) -(declare-const |_1299| Int) -(declare-const |_1300| Int) -(declare-const |_1301| Int) -(declare-const |_1302| Int) -(declare-const |_1303| Int) -(declare-const |_1304| Int) -(declare-const |_1305| Int) -(declare-const |_1306| Int) -(declare-const |_1307| Int) -(declare-const |_1308| Int) -(declare-const |_1309| Int) -(declare-const |_1310| Int) -(declare-const |_1311| Int) -(declare-const |_1312| Int) -(declare-const |_1313| Int) -(declare-const |_1314| Int) -(declare-const |_1315| Int) -(declare-const |_1316| Int) -(declare-const |_1317| Int) -(declare-const |_1318| Int) -(declare-const |_1319| Int) -(declare-const |_1320| Int) -(declare-const |_1321| Int) -(declare-const |_1322| Int) -(declare-const |_1323| Int) -(declare-const |_1324| Int) -(declare-const |_1325| Int) -(declare-const |_1326| Int) -(declare-const |_1327| Int) -(declare-const |_1328| Int) -(declare-const |_1329| Int) -(declare-const |_1330| Int) -(declare-const |_1331| Int) -(declare-const |_1332| Int) -(declare-const |_1333| Int) -(declare-const |_1334| Int) -(declare-const |_1335| Int) -(declare-const |_1336| Int) -(declare-const |_1337| Int) -(declare-const |_1338| Int) -(declare-const |_1339| Int) -(declare-const |_1340| Int) -(declare-const |_1341| Int) -(declare-const |_1342| Int) -(declare-const |_1343| Int) -(declare-const |_1344| Int) -(declare-const |_1345| Int) -(declare-const |_1346| Int) -(declare-const |_1347| Int) -(declare-const |_1348| Int) -(declare-const |_1349| Int) -(declare-const |_1350| Int) -(declare-const |_1351| Int) -(declare-const |_1352| Int) -(declare-const |_1353| Int) -(declare-const |_1354| Int) -(declare-const |_1355| Int) -(declare-const |_1356| Int) -(declare-const |_1357| Int) -(declare-const |_1358| Int) -(declare-const |_1359| Int) -(declare-const |_1360| Int) -(declare-const |_1361| Int) -(declare-const |_1362| Int) -(declare-const |_1363| Int) -(declare-const |_1364| Int) -(declare-const |_1365| Int) -(declare-const |_1366| Int) -(declare-const |_1367| Int) -(declare-const |_1368| Int) -(declare-const |_1369| Int) -(declare-const |_1370| Int) -(declare-const |_1371| Int) -(declare-const |_1372| Int) -(declare-const |_1373| Int) -(declare-const |_1374| Int) -(declare-const |_1375| Int) -(declare-const |_1376| Int) -(declare-const |_1377| Int) -(declare-const |_1378| Int) -(declare-const |_1379| Int) -(declare-const |_1380| Int) -(declare-const |_1381| Int) -(declare-const |_1382| Int) -(declare-const |_1383| Int) -(declare-const |_1384| Int) -(declare-const |_1385| Int) -(declare-const |_1386| Int) -(declare-const |_1387| Int) -(declare-const |_1388| Int) -(declare-const |_1389| Int) -(declare-const |_1390| Int) -(declare-const |_1391| Int) -(declare-const |_1392| Int) -(declare-const |_1393| Int) -(declare-const |_1394| Int) -(declare-const |_1395| Int) -(declare-const |_1396| Int) -(declare-const |_1397| Int) -(declare-const |_1398| Int) -(declare-const |_1399| Int) -(declare-const |_1400| Int) -(declare-const |_1401| Int) -(declare-const |_1402| Int) -(declare-const |_1403| Int) -(declare-const |_1404| Int) -(declare-const |_1405| Int) -(declare-const |_1406| Int) -(declare-const |_1407| Int) -(declare-const |_1408| Int) -(declare-const |_1409| Int) -(declare-const |_1410| Int) -(declare-const |_1411| Int) -(declare-const |_1412| Int) -(declare-const |_1413| Int) -(declare-const |_1414| Int) -(declare-const |_1415| Int) -(declare-const |_1416| Int) -(declare-const |_1417| Int) -(declare-const |_1418| Int) -(declare-const |_1419| Int) -(declare-const |_1420| Int) -(declare-const |_1421| Int) -(declare-const |_1426| Int) (assert (and (= |~prime| 21888242871839275222246405745257275088548364400416034343698204186575808495617) (= |~one| 1) @@ -1274,771 +516,8 @@ (= (mod (* (* |_251| 1) (* |_251| 1)) |~prime|) (mod (* |_251| 1) |~prime|)) (= (mod (* (* |_252| 1) (* |_252| 1)) |~prime|) (mod (* |_252| 1) |~prime|)) (= (mod (* (* |_253| 1) (* |_253| 1)) |~prime|) (mod (* |_253| 1) |~prime|)) -(= (mod (* (* |~one| 1) (+ (* |_2| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_3| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_4| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_5| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_6| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_7| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_8| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_9| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_10| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_11| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_12| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_13| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_14| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_15| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_16| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_17| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_18| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_19| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_20| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_21| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_22| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_23| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_24| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_25| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_26| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_27| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_28| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_29| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_30| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_31| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_32| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_33| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_34| 842498333348457493583344221469363458551160763204392890034487820288) (* |_35| 421249166674228746791672110734681729275580381602196445017243910144) (* |_36| 210624583337114373395836055367340864637790190801098222508621955072) (* |_37| 105312291668557186697918027683670432318895095400549111254310977536) (* |_38| 52656145834278593348959013841835216159447547700274555627155488768) (* |_39| 26328072917139296674479506920917608079723773850137277813577744384) (* |_40| 13164036458569648337239753460458804039861886925068638906788872192) (* |_41| 6582018229284824168619876730229402019930943462534319453394436096) (* |_42| 3291009114642412084309938365114701009965471731267159726697218048) (* |_43| 1645504557321206042154969182557350504982735865633579863348609024) (* |_44| 822752278660603021077484591278675252491367932816789931674304512) (* |_45| 411376139330301510538742295639337626245683966408394965837152256) (* |_46| 205688069665150755269371147819668813122841983204197482918576128) (* |_47| 102844034832575377634685573909834406561420991602098741459288064) (* |_48| 51422017416287688817342786954917203280710495801049370729644032) (* |_49| 25711008708143844408671393477458601640355247900524685364822016) (* |_50| 12855504354071922204335696738729300820177623950262342682411008) (* |_51| 6427752177035961102167848369364650410088811975131171341205504) (* |_52| 3213876088517980551083924184682325205044405987565585670602752) (* |_53| 1606938044258990275541962092341162602522202993782792835301376) (* |_54| 803469022129495137770981046170581301261101496891396417650688) (* |_55| 401734511064747568885490523085290650630550748445698208825344) (* |_56| 200867255532373784442745261542645325315275374222849104412672) (* |_57| 100433627766186892221372630771322662657637687111424552206336) (* |_58| 50216813883093446110686315385661331328818843555712276103168) (* |_59| 25108406941546723055343157692830665664409421777856138051584) (* |_60| 12554203470773361527671578846415332832204710888928069025792) (* |_61| 6277101735386680763835789423207666416102355444464034512896) (* |_62| 3138550867693340381917894711603833208051177722232017256448) (* |_63| 1569275433846670190958947355801916604025588861116008628224) (* |_64| 784637716923335095479473677900958302012794430558004314112) (* |_65| 392318858461667547739736838950479151006397215279002157056) (* |_66| 196159429230833773869868419475239575503198607639501078528) (* |_67| 98079714615416886934934209737619787751599303819750539264) (* |_68| 49039857307708443467467104868809893875799651909875269632) (* |_69| 24519928653854221733733552434404946937899825954937634816) (* |_70| 12259964326927110866866776217202473468949912977468817408) (* |_71| 6129982163463555433433388108601236734474956488734408704) (* |_72| 3064991081731777716716694054300618367237478244367204352) (* |_73| 1532495540865888858358347027150309183618739122183602176) (* |_74| 766247770432944429179173513575154591809369561091801088) (* |_75| 383123885216472214589586756787577295904684780545900544) (* |_76| 191561942608236107294793378393788647952342390272950272) (* |_77| 95780971304118053647396689196894323976171195136475136) (* |_78| 47890485652059026823698344598447161988085597568237568) (* |_79| 23945242826029513411849172299223580994042798784118784) (* |_80| 11972621413014756705924586149611790497021399392059392) (* |_81| 5986310706507378352962293074805895248510699696029696) (* |_82| 2993155353253689176481146537402947624255349848014848) (* |_83| 1496577676626844588240573268701473812127674924007424) (* |_84| 748288838313422294120286634350736906063837462003712) (* |_85| 374144419156711147060143317175368453031918731001856) (* |_86| 187072209578355573530071658587684226515959365500928) (* |_87| 93536104789177786765035829293842113257979682750464) (* |_88| 46768052394588893382517914646921056628989841375232) (* |_89| 23384026197294446691258957323460528314494920687616) (* |_90| 11692013098647223345629478661730264157247460343808) (* |_91| 5846006549323611672814739330865132078623730171904) (* |_92| 2923003274661805836407369665432566039311865085952) (* |_93| 1461501637330902918203684832716283019655932542976) (* |_94| 730750818665451459101842416358141509827966271488) (* |_95| 365375409332725729550921208179070754913983135744) (* |_96| 182687704666362864775460604089535377456991567872) (* |_97| 91343852333181432387730302044767688728495783936) (* |_98| 45671926166590716193865151022383844364247891968) (* |_99| 22835963083295358096932575511191922182123945984) (* |_100| 11417981541647679048466287755595961091061972992) (* |_101| 5708990770823839524233143877797980545530986496) (* |_102| 2854495385411919762116571938898990272765493248) (* |_103| 1427247692705959881058285969449495136382746624) (* |_104| 713623846352979940529142984724747568191373312) (* |_105| 356811923176489970264571492362373784095686656) (* |_106| 178405961588244985132285746181186892047843328) (* |_107| 89202980794122492566142873090593446023921664) (* |_108| 44601490397061246283071436545296723011960832) (* |_109| 22300745198530623141535718272648361505980416) (* |_110| 11150372599265311570767859136324180752990208) (* |_111| 5575186299632655785383929568162090376495104) (* |_112| 2787593149816327892691964784081045188247552) (* |_113| 1393796574908163946345982392040522594123776) (* |_114| 696898287454081973172991196020261297061888) (* |_115| 348449143727040986586495598010130648530944) (* |_116| 174224571863520493293247799005065324265472) (* |_117| 87112285931760246646623899502532662132736) (* |_118| 43556142965880123323311949751266331066368) (* |_119| 21778071482940061661655974875633165533184) (* |_120| 10889035741470030830827987437816582766592) (* |_121| 5444517870735015415413993718908291383296) (* |_122| 2722258935367507707706996859454145691648) (* |_123| 1361129467683753853853498429727072845824) (* |_124| 680564733841876926926749214863536422912) (* |_125| 340282366920938463463374607431768211456) (* |_126| 170141183460469231731687303715884105728) (* |_127| 85070591730234615865843651857942052864) (* |_128| 42535295865117307932921825928971026432) (* |_129| 21267647932558653966460912964485513216) (* |_130| 10633823966279326983230456482242756608) (* |_131| 5316911983139663491615228241121378304) (* |_132| 2658455991569831745807614120560689152) (* |_133| 1329227995784915872903807060280344576) (* |_134| 664613997892457936451903530140172288) (* |_135| 332306998946228968225951765070086144) (* |_136| 166153499473114484112975882535043072) (* |_137| 83076749736557242056487941267521536) (* |_138| 41538374868278621028243970633760768) (* |_139| 20769187434139310514121985316880384) (* |_140| 10384593717069655257060992658440192) (* |_141| 5192296858534827628530496329220096) (* |_142| 2596148429267413814265248164610048) (* |_143| 1298074214633706907132624082305024) (* |_144| 649037107316853453566312041152512) (* |_145| 324518553658426726783156020576256) (* |_146| 162259276829213363391578010288128) (* |_147| 81129638414606681695789005144064) (* |_148| 40564819207303340847894502572032) (* |_149| 20282409603651670423947251286016) (* |_150| 10141204801825835211973625643008) (* |_151| 5070602400912917605986812821504) (* |_152| 2535301200456458802993406410752) (* |_153| 1267650600228229401496703205376) (* |_154| 633825300114114700748351602688) (* |_155| 316912650057057350374175801344) (* |_156| 158456325028528675187087900672) (* |_157| 79228162514264337593543950336) (* |_158| 39614081257132168796771975168) (* |_159| 19807040628566084398385987584) (* |_160| 9903520314283042199192993792) (* |_161| 4951760157141521099596496896) (* |_162| 2475880078570760549798248448) (* |_163| 1237940039285380274899124224) (* |_164| 618970019642690137449562112) (* |_165| 309485009821345068724781056) (* |_166| 154742504910672534362390528) (* |_167| 77371252455336267181195264) (* |_168| 38685626227668133590597632) (* |_169| 19342813113834066795298816) (* |_170| 9671406556917033397649408) (* |_171| 4835703278458516698824704) (* |_172| 2417851639229258349412352) (* |_173| 1208925819614629174706176) (* |_174| 604462909807314587353088) (* |_175| 302231454903657293676544) (* |_176| 151115727451828646838272) (* |_177| 75557863725914323419136) (* |_178| 37778931862957161709568) (* |_179| 18889465931478580854784) (* |_180| 9444732965739290427392) (* |_181| 4722366482869645213696) (* |_182| 2361183241434822606848) (* |_183| 1180591620717411303424) (* |_184| 590295810358705651712) (* |_185| 295147905179352825856) (* |_186| 147573952589676412928) (* |_187| 73786976294838206464) (* |_188| 36893488147419103232) (* |_189| 18446744073709551616) (* |_190| 9223372036854775808) (* |_191| 4611686018427387904) (* |_192| 2305843009213693952) (* |_193| 1152921504606846976) (* |_194| 576460752303423488) (* |_195| 288230376151711744) (* |_196| 144115188075855872) (* |_197| 72057594037927936) (* |_198| 36028797018963968) (* |_199| 18014398509481984) (* |_200| 9007199254740992) (* |_201| 4503599627370496) (* |_202| 2251799813685248) (* |_203| 1125899906842624) (* |_204| 562949953421312) (* |_205| 281474976710656) (* |_206| 140737488355328) (* |_207| 70368744177664) (* |_208| 35184372088832) (* |_209| 17592186044416) (* |_210| 8796093022208) (* |_211| 4398046511104) (* |_212| 2199023255552) (* |_213| 1099511627776) (* |_214| 549755813888) (* |_215| 274877906944) (* |_216| 137438953472) (* |_217| 68719476736) (* |_218| 34359738368) (* |_219| 17179869184) (* |_220| 8589934592) (* |_221| 4294967296) (* |_222| 2147483648) (* |_223| 1073741824) (* |_224| 536870912) (* |_225| 268435456) (* |_226| 134217728) (* |_227| 67108864) (* |_228| 33554432) (* |_229| 16777216) (* |_230| 8388608) (* |_231| 4194304) (* |_232| 2097152) (* |_233| 1048576) (* |_234| 524288) (* |_235| 262144) (* |_236| 131072) (* |_237| 65536) (* |_238| 32768) (* |_239| 16384) (* |_240| 8192) (* |_241| 4096) (* |_242| 2048) (* |_243| 1024) (* |_244| 512) (* |_245| 256) (* |_246| 128) (* |_247| 64) (* |_248| 32) (* |_249| 16) (* |_250| 8) (* |_251| 4) (* |_252| 2) (* |_253| 1))) |~prime|) (mod (* |_1| 1) |~prime|)) - (= (mod (* (* |_254| 1) (* |_254| 1)) |~prime|) (mod (* |_254| 1) |~prime|)) -(= (mod (* (* |_255| 1) (* |_255| 1)) |~prime|) (mod (* |_255| 1) |~prime|)) -(= (mod (* (* |_256| 1) (* |_256| 1)) |~prime|) (mod (* |_256| 1) |~prime|)) -(= (mod (* (* |_257| 1) (* |_257| 1)) |~prime|) (mod (* |_257| 1) |~prime|)) -(= (mod (* (* |_258| 1) (* |_258| 1)) |~prime|) (mod (* |_258| 1) |~prime|)) -(= (mod (* (* |_259| 1) (* |_259| 1)) |~prime|) (mod (* |_259| 1) |~prime|)) -(= (mod (* (* |_260| 1) (* |_260| 1)) |~prime|) (mod (* |_260| 1) |~prime|)) -(= (mod (* (* |_261| 1) (* |_261| 1)) |~prime|) (mod (* |_261| 1) |~prime|)) -(= (mod (* (* |_262| 1) (* |_262| 1)) |~prime|) (mod (* |_262| 1) |~prime|)) -(= (mod (* (* |_263| 1) (* |_263| 1)) |~prime|) (mod (* |_263| 1) |~prime|)) -(= (mod (* (* |_264| 1) (* |_264| 1)) |~prime|) (mod (* |_264| 1) |~prime|)) -(= (mod (* (* |_265| 1) (* |_265| 1)) |~prime|) (mod (* |_265| 1) |~prime|)) -(= (mod (* (* |_266| 1) (* |_266| 1)) |~prime|) (mod (* |_266| 1) |~prime|)) -(= (mod (* (* |_267| 1) (* |_267| 1)) |~prime|) (mod (* |_267| 1) |~prime|)) -(= (mod (* (* |_268| 1) (* |_268| 1)) |~prime|) (mod (* |_268| 1) |~prime|)) -(= (mod (* (* |_269| 1) (* |_269| 1)) |~prime|) (mod (* |_269| 1) |~prime|)) -(= (mod (* (* |_270| 1) (* |_270| 1)) |~prime|) (mod (* |_270| 1) |~prime|)) -(= (mod (* (* |_271| 1) (* |_271| 1)) |~prime|) (mod (* |_271| 1) |~prime|)) -(= (mod (* (* |_272| 1) (* |_272| 1)) |~prime|) (mod (* |_272| 1) |~prime|)) -(= (mod (* (* |_273| 1) (* |_273| 1)) |~prime|) (mod (* |_273| 1) |~prime|)) -(= (mod (* (* |_274| 1) (* |_274| 1)) |~prime|) (mod (* |_274| 1) |~prime|)) -(= (mod (* (* |_275| 1) (* |_275| 1)) |~prime|) (mod (* |_275| 1) |~prime|)) -(= (mod (* (* |_276| 1) (* |_276| 1)) |~prime|) (mod (* |_276| 1) |~prime|)) -(= (mod (* (* |_277| 1) (* |_277| 1)) |~prime|) (mod (* |_277| 1) |~prime|)) -(= (mod (* (* |_278| 1) (* |_278| 1)) |~prime|) (mod (* |_278| 1) |~prime|)) -(= (mod (* (* |_279| 1) (* |_279| 1)) |~prime|) (mod (* |_279| 1) |~prime|)) -(= (mod (* (* |_280| 1) (* |_280| 1)) |~prime|) (mod (* |_280| 1) |~prime|)) -(= (mod (* (* |_281| 1) (* |_281| 1)) |~prime|) (mod (* |_281| 1) |~prime|)) -(= (mod (* (* |_282| 1) (* |_282| 1)) |~prime|) (mod (* |_282| 1) |~prime|)) -(= (mod (* (* |_283| 1) (* |_283| 1)) |~prime|) (mod (* |_283| 1) |~prime|)) -(= (mod (* (* |_284| 1) (* |_284| 1)) |~prime|) (mod (* |_284| 1) |~prime|)) -(= (mod (* (* |_285| 1) (* |_285| 1)) |~prime|) (mod (* |_285| 1) |~prime|)) -(= (mod (* (* |_286| 1) (* |_286| 1)) |~prime|) (mod (* |_286| 1) |~prime|)) -(= (mod (* (* |_287| 1) (* |_287| 1)) |~prime|) (mod (* |_287| 1) |~prime|)) -(= (mod (* (* |_288| 1) (* |_288| 1)) |~prime|) (mod (* |_288| 1) |~prime|)) -(= (mod (* (* |_289| 1) (* |_289| 1)) |~prime|) (mod (* |_289| 1) |~prime|)) -(= (mod (* (* |_290| 1) (* |_290| 1)) |~prime|) (mod (* |_290| 1) |~prime|)) -(= (mod (* (* |_291| 1) (* |_291| 1)) |~prime|) (mod (* |_291| 1) |~prime|)) -(= (mod (* (* |_292| 1) (* |_292| 1)) |~prime|) (mod (* |_292| 1) |~prime|)) -(= (mod (* (* |_293| 1) (* |_293| 1)) |~prime|) (mod (* |_293| 1) |~prime|)) -(= (mod (* (* |_294| 1) (* |_294| 1)) |~prime|) (mod (* |_294| 1) |~prime|)) -(= (mod (* (* |_295| 1) (* |_295| 1)) |~prime|) (mod (* |_295| 1) |~prime|)) -(= (mod (* (* |_296| 1) (* |_296| 1)) |~prime|) (mod (* |_296| 1) |~prime|)) -(= (mod (* (* |_297| 1) (* |_297| 1)) |~prime|) (mod (* |_297| 1) |~prime|)) -(= (mod (* (* |_298| 1) (* |_298| 1)) |~prime|) (mod (* |_298| 1) |~prime|)) -(= (mod (* (* |_299| 1) (* |_299| 1)) |~prime|) (mod (* |_299| 1) |~prime|)) -(= (mod (* (* |_300| 1) (* |_300| 1)) |~prime|) (mod (* |_300| 1) |~prime|)) -(= (mod (* (* |_301| 1) (* |_301| 1)) |~prime|) (mod (* |_301| 1) |~prime|)) -(= (mod (* (* |_302| 1) (* |_302| 1)) |~prime|) (mod (* |_302| 1) |~prime|)) -(= (mod (* (* |_303| 1) (* |_303| 1)) |~prime|) (mod (* |_303| 1) |~prime|)) -(= (mod (* (* |_304| 1) (* |_304| 1)) |~prime|) (mod (* |_304| 1) |~prime|)) -(= (mod (* (* |_305| 1) (* |_305| 1)) |~prime|) (mod (* |_305| 1) |~prime|)) -(= (mod (* (* |_306| 1) (* |_306| 1)) |~prime|) (mod (* |_306| 1) |~prime|)) -(= (mod (* (* |_307| 1) (* |_307| 1)) |~prime|) (mod (* |_307| 1) |~prime|)) -(= (mod (* (* |_308| 1) (* |_308| 1)) |~prime|) (mod (* |_308| 1) |~prime|)) -(= (mod (* (* |_309| 1) (* |_309| 1)) |~prime|) (mod (* |_309| 1) |~prime|)) -(= (mod (* (* |_310| 1) (* |_310| 1)) |~prime|) (mod (* |_310| 1) |~prime|)) -(= (mod (* (* |_311| 1) (* |_311| 1)) |~prime|) (mod (* |_311| 1) |~prime|)) -(= (mod (* (* |_312| 1) (* |_312| 1)) |~prime|) (mod (* |_312| 1) |~prime|)) -(= (mod (* (* |_313| 1) (* |_313| 1)) |~prime|) (mod (* |_313| 1) |~prime|)) -(= (mod (* (* |_314| 1) (* |_314| 1)) |~prime|) (mod (* |_314| 1) |~prime|)) -(= (mod (* (* |_315| 1) (* |_315| 1)) |~prime|) (mod (* |_315| 1) |~prime|)) -(= (mod (* (* |_316| 1) (* |_316| 1)) |~prime|) (mod (* |_316| 1) |~prime|)) -(= (mod (* (* |_317| 1) (* |_317| 1)) |~prime|) (mod (* |_317| 1) |~prime|)) -(= (mod (* (* |_318| 1) (* |_318| 1)) |~prime|) (mod (* |_318| 1) |~prime|)) -(= (mod (* (* |_319| 1) (* |_319| 1)) |~prime|) (mod (* |_319| 1) |~prime|)) -(= (mod (* (* |_320| 1) (* |_320| 1)) |~prime|) (mod (* |_320| 1) |~prime|)) -(= (mod (* (* |_321| 1) (* |_321| 1)) |~prime|) (mod (* |_321| 1) |~prime|)) -(= (mod (* (* |_322| 1) (* |_322| 1)) |~prime|) (mod (* |_322| 1) |~prime|)) -(= (mod (* (* |_323| 1) (* |_323| 1)) |~prime|) (mod (* |_323| 1) |~prime|)) -(= (mod (* (* |_324| 1) (* |_324| 1)) |~prime|) (mod (* |_324| 1) |~prime|)) -(= (mod (* (* |_325| 1) (* |_325| 1)) |~prime|) (mod (* |_325| 1) |~prime|)) -(= (mod (* (* |_326| 1) (* |_326| 1)) |~prime|) (mod (* |_326| 1) |~prime|)) -(= (mod (* (* |_327| 1) (* |_327| 1)) |~prime|) (mod (* |_327| 1) |~prime|)) -(= (mod (* (* |_328| 1) (* |_328| 1)) |~prime|) (mod (* |_328| 1) |~prime|)) -(= (mod (* (* |_329| 1) (* |_329| 1)) |~prime|) (mod (* |_329| 1) |~prime|)) -(= (mod (* (* |_330| 1) (* |_330| 1)) |~prime|) (mod (* |_330| 1) |~prime|)) -(= (mod (* (* |_331| 1) (* |_331| 1)) |~prime|) (mod (* |_331| 1) |~prime|)) -(= (mod (* (* |_332| 1) (* |_332| 1)) |~prime|) (mod (* |_332| 1) |~prime|)) -(= (mod (* (* |_333| 1) (* |_333| 1)) |~prime|) (mod (* |_333| 1) |~prime|)) -(= (mod (* (* |_334| 1) (* |_334| 1)) |~prime|) (mod (* |_334| 1) |~prime|)) -(= (mod (* (* |_335| 1) (* |_335| 1)) |~prime|) (mod (* |_335| 1) |~prime|)) -(= (mod (* (* |_336| 1) (* |_336| 1)) |~prime|) (mod (* |_336| 1) |~prime|)) -(= (mod (* (* |_337| 1) (* |_337| 1)) |~prime|) (mod (* |_337| 1) |~prime|)) -(= (mod (* (* |_338| 1) (* |_338| 1)) |~prime|) (mod (* |_338| 1) |~prime|)) -(= (mod (* (* |_339| 1) (* |_339| 1)) |~prime|) (mod (* |_339| 1) |~prime|)) -(= (mod (* (* |_340| 1) (* |_340| 1)) |~prime|) (mod (* |_340| 1) |~prime|)) -(= (mod (* (* |_341| 1) (* |_341| 1)) |~prime|) (mod (* |_341| 1) |~prime|)) -(= (mod (* (* |_342| 1) (* |_342| 1)) |~prime|) (mod (* |_342| 1) |~prime|)) -(= (mod (* (* |_343| 1) (* |_343| 1)) |~prime|) (mod (* |_343| 1) |~prime|)) -(= (mod (* (* |_344| 1) (* |_344| 1)) |~prime|) (mod (* |_344| 1) |~prime|)) -(= (mod (* (* |_345| 1) (* |_345| 1)) |~prime|) (mod (* |_345| 1) |~prime|)) -(= (mod (* (* |_346| 1) (* |_346| 1)) |~prime|) (mod (* |_346| 1) |~prime|)) -(= (mod (* (* |_347| 1) (* |_347| 1)) |~prime|) (mod (* |_347| 1) |~prime|)) -(= (mod (* (* |_348| 1) (* |_348| 1)) |~prime|) (mod (* |_348| 1) |~prime|)) -(= (mod (* (* |_349| 1) (* |_349| 1)) |~prime|) (mod (* |_349| 1) |~prime|)) -(= (mod (* (* |_350| 1) (* |_350| 1)) |~prime|) (mod (* |_350| 1) |~prime|)) -(= (mod (* (* |_351| 1) (* |_351| 1)) |~prime|) (mod (* |_351| 1) |~prime|)) -(= (mod (* (* |_352| 1) (* |_352| 1)) |~prime|) (mod (* |_352| 1) |~prime|)) -(= (mod (* (* |_353| 1) (* |_353| 1)) |~prime|) (mod (* |_353| 1) |~prime|)) -(= (mod (* (* |_354| 1) (* |_354| 1)) |~prime|) (mod (* |_354| 1) |~prime|)) -(= (mod (* (* |_355| 1) (* |_355| 1)) |~prime|) (mod (* |_355| 1) |~prime|)) -(= (mod (* (* |_356| 1) (* |_356| 1)) |~prime|) (mod (* |_356| 1) |~prime|)) -(= (mod (* (* |_357| 1) (* |_357| 1)) |~prime|) (mod (* |_357| 1) |~prime|)) -(= (mod (* (* |_358| 1) (* |_358| 1)) |~prime|) (mod (* |_358| 1) |~prime|)) -(= (mod (* (* |_359| 1) (* |_359| 1)) |~prime|) (mod (* |_359| 1) |~prime|)) -(= (mod (* (* |_360| 1) (* |_360| 1)) |~prime|) (mod (* |_360| 1) |~prime|)) -(= (mod (* (* |_361| 1) (* |_361| 1)) |~prime|) (mod (* |_361| 1) |~prime|)) -(= (mod (* (* |_362| 1) (* |_362| 1)) |~prime|) (mod (* |_362| 1) |~prime|)) -(= (mod (* (* |_363| 1) (* |_363| 1)) |~prime|) (mod (* |_363| 1) |~prime|)) -(= (mod (* (* |_364| 1) (* |_364| 1)) |~prime|) (mod (* |_364| 1) |~prime|)) -(= (mod (* (* |_365| 1) (* |_365| 1)) |~prime|) (mod (* |_365| 1) |~prime|)) -(= (mod (* (* |_366| 1) (* |_366| 1)) |~prime|) (mod (* |_366| 1) |~prime|)) -(= (mod (* (* |_367| 1) (* |_367| 1)) |~prime|) (mod (* |_367| 1) |~prime|)) -(= (mod (* (* |_368| 1) (* |_368| 1)) |~prime|) (mod (* |_368| 1) |~prime|)) -(= (mod (* (* |_369| 1) (* |_369| 1)) |~prime|) (mod (* |_369| 1) |~prime|)) -(= (mod (* (* |_370| 1) (* |_370| 1)) |~prime|) (mod (* |_370| 1) |~prime|)) -(= (mod (* (* |_371| 1) (* |_371| 1)) |~prime|) (mod (* |_371| 1) |~prime|)) -(= (mod (* (* |_372| 1) (* |_372| 1)) |~prime|) (mod (* |_372| 1) |~prime|)) -(= (mod (* (* |_373| 1) (* |_373| 1)) |~prime|) (mod (* |_373| 1) |~prime|)) -(= (mod (* (* |_374| 1) (* |_374| 1)) |~prime|) (mod (* |_374| 1) |~prime|)) -(= (mod (* (* |_375| 1) (* |_375| 1)) |~prime|) (mod (* |_375| 1) |~prime|)) -(= (mod (* (* |_376| 1) (* |_376| 1)) |~prime|) (mod (* |_376| 1) |~prime|)) -(= (mod (* (* |_377| 1) (* |_377| 1)) |~prime|) (mod (* |_377| 1) |~prime|)) -(= (mod (* (* |_378| 1) (* |_378| 1)) |~prime|) (mod (* |_378| 1) |~prime|)) -(= (mod (* (* |_379| 1) (* |_379| 1)) |~prime|) (mod (* |_379| 1) |~prime|)) -(= (mod (* (* |_380| 1) (* |_380| 1)) |~prime|) (mod (* |_380| 1) |~prime|)) -(= (mod (* (* |_381| 1) (* |_381| 1)) |~prime|) (mod (* |_381| 1) |~prime|)) -(= (mod (* (* |_382| 1) (* |_382| 1)) |~prime|) (mod (* |_382| 1) |~prime|)) -(= (mod (* (* |_383| 1) (* |_383| 1)) |~prime|) (mod (* |_383| 1) |~prime|)) -(= (mod (* (* |_384| 1) (* |_384| 1)) |~prime|) (mod (* |_384| 1) |~prime|)) -(= (mod (* (* |_385| 1) (* |_385| 1)) |~prime|) (mod (* |_385| 1) |~prime|)) -(= (mod (* (* |_386| 1) (* |_386| 1)) |~prime|) (mod (* |_386| 1) |~prime|)) -(= (mod (* (* |_387| 1) (* |_387| 1)) |~prime|) (mod (* |_387| 1) |~prime|)) -(= (mod (* (* |_388| 1) (* |_388| 1)) |~prime|) (mod (* |_388| 1) |~prime|)) -(= (mod (* (* |_389| 1) (* |_389| 1)) |~prime|) (mod (* |_389| 1) |~prime|)) -(= (mod (* (* |_390| 1) (* |_390| 1)) |~prime|) (mod (* |_390| 1) |~prime|)) -(= (mod (* (* |_391| 1) (* |_391| 1)) |~prime|) (mod (* |_391| 1) |~prime|)) -(= (mod (* (* |_392| 1) (* |_392| 1)) |~prime|) (mod (* |_392| 1) |~prime|)) -(= (mod (* (* |_393| 1) (* |_393| 1)) |~prime|) (mod (* |_393| 1) |~prime|)) -(= (mod (* (* |_394| 1) (* |_394| 1)) |~prime|) (mod (* |_394| 1) |~prime|)) -(= (mod (* (* |_395| 1) (* |_395| 1)) |~prime|) (mod (* |_395| 1) |~prime|)) -(= (mod (* (* |_396| 1) (* |_396| 1)) |~prime|) (mod (* |_396| 1) |~prime|)) -(= (mod (* (* |_397| 1) (* |_397| 1)) |~prime|) (mod (* |_397| 1) |~prime|)) -(= (mod (* (* |_398| 1) (* |_398| 1)) |~prime|) (mod (* |_398| 1) |~prime|)) -(= (mod (* (* |_399| 1) (* |_399| 1)) |~prime|) (mod (* |_399| 1) |~prime|)) -(= (mod (* (* |_400| 1) (* |_400| 1)) |~prime|) (mod (* |_400| 1) |~prime|)) -(= (mod (* (* |_401| 1) (* |_401| 1)) |~prime|) (mod (* |_401| 1) |~prime|)) -(= (mod (* (* |_402| 1) (* |_402| 1)) |~prime|) (mod (* |_402| 1) |~prime|)) -(= (mod (* (* |_403| 1) (* |_403| 1)) |~prime|) (mod (* |_403| 1) |~prime|)) -(= (mod (* (* |_404| 1) (* |_404| 1)) |~prime|) (mod (* |_404| 1) |~prime|)) -(= (mod (* (* |_405| 1) (* |_405| 1)) |~prime|) (mod (* |_405| 1) |~prime|)) -(= (mod (* (* |_406| 1) (* |_406| 1)) |~prime|) (mod (* |_406| 1) |~prime|)) -(= (mod (* (* |_407| 1) (* |_407| 1)) |~prime|) (mod (* |_407| 1) |~prime|)) -(= (mod (* (* |_408| 1) (* |_408| 1)) |~prime|) (mod (* |_408| 1) |~prime|)) -(= (mod (* (* |_409| 1) (* |_409| 1)) |~prime|) (mod (* |_409| 1) |~prime|)) -(= (mod (* (* |_410| 1) (* |_410| 1)) |~prime|) (mod (* |_410| 1) |~prime|)) -(= (mod (* (* |_411| 1) (* |_411| 1)) |~prime|) (mod (* |_411| 1) |~prime|)) -(= (mod (* (* |_412| 1) (* |_412| 1)) |~prime|) (mod (* |_412| 1) |~prime|)) -(= (mod (* (* |_413| 1) (* |_413| 1)) |~prime|) (mod (* |_413| 1) |~prime|)) -(= (mod (* (* |_414| 1) (* |_414| 1)) |~prime|) (mod (* |_414| 1) |~prime|)) -(= (mod (* (* |_415| 1) (* |_415| 1)) |~prime|) (mod (* |_415| 1) |~prime|)) -(= (mod (* (* |_416| 1) (* |_416| 1)) |~prime|) (mod (* |_416| 1) |~prime|)) -(= (mod (* (* |_417| 1) (* |_417| 1)) |~prime|) (mod (* |_417| 1) |~prime|)) -(= (mod (* (* |_418| 1) (* |_418| 1)) |~prime|) (mod (* |_418| 1) |~prime|)) -(= (mod (* (* |_419| 1) (* |_419| 1)) |~prime|) (mod (* |_419| 1) |~prime|)) -(= (mod (* (* |_420| 1) (* |_420| 1)) |~prime|) (mod (* |_420| 1) |~prime|)) -(= (mod (* (* |_421| 1) (* |_421| 1)) |~prime|) (mod (* |_421| 1) |~prime|)) -(= (mod (* (* |_422| 1) (* |_422| 1)) |~prime|) (mod (* |_422| 1) |~prime|)) -(= (mod (* (* |_423| 1) (* |_423| 1)) |~prime|) (mod (* |_423| 1) |~prime|)) -(= (mod (* (* |_424| 1) (* |_424| 1)) |~prime|) (mod (* |_424| 1) |~prime|)) -(= (mod (* (* |_425| 1) (* |_425| 1)) |~prime|) (mod (* |_425| 1) |~prime|)) -(= (mod (* (* |_426| 1) (* |_426| 1)) |~prime|) (mod (* |_426| 1) |~prime|)) -(= (mod (* (* |_427| 1) (* |_427| 1)) |~prime|) (mod (* |_427| 1) |~prime|)) -(= (mod (* (* |_428| 1) (* |_428| 1)) |~prime|) (mod (* |_428| 1) |~prime|)) -(= (mod (* (* |_429| 1) (* |_429| 1)) |~prime|) (mod (* |_429| 1) |~prime|)) -(= (mod (* (* |_430| 1) (* |_430| 1)) |~prime|) (mod (* |_430| 1) |~prime|)) -(= (mod (* (* |_431| 1) (* |_431| 1)) |~prime|) (mod (* |_431| 1) |~prime|)) -(= (mod (* (* |_432| 1) (* |_432| 1)) |~prime|) (mod (* |_432| 1) |~prime|)) -(= (mod (* (* |_433| 1) (* |_433| 1)) |~prime|) (mod (* |_433| 1) |~prime|)) -(= (mod (* (* |_434| 1) (* |_434| 1)) |~prime|) (mod (* |_434| 1) |~prime|)) -(= (mod (* (* |_435| 1) (* |_435| 1)) |~prime|) (mod (* |_435| 1) |~prime|)) -(= (mod (* (* |_436| 1) (* |_436| 1)) |~prime|) (mod (* |_436| 1) |~prime|)) -(= (mod (* (* |_437| 1) (* |_437| 1)) |~prime|) (mod (* |_437| 1) |~prime|)) -(= (mod (* (* |_438| 1) (* |_438| 1)) |~prime|) (mod (* |_438| 1) |~prime|)) -(= (mod (* (* |_439| 1) (* |_439| 1)) |~prime|) (mod (* |_439| 1) |~prime|)) -(= (mod (* (* |_440| 1) (* |_440| 1)) |~prime|) (mod (* |_440| 1) |~prime|)) -(= (mod (* (* |_441| 1) (* |_441| 1)) |~prime|) (mod (* |_441| 1) |~prime|)) -(= (mod (* (* |_442| 1) (* |_442| 1)) |~prime|) (mod (* |_442| 1) |~prime|)) -(= (mod (* (* |_443| 1) (* |_443| 1)) |~prime|) (mod (* |_443| 1) |~prime|)) -(= (mod (* (* |_444| 1) (* |_444| 1)) |~prime|) (mod (* |_444| 1) |~prime|)) -(= (mod (* (* |_445| 1) (* |_445| 1)) |~prime|) (mod (* |_445| 1) |~prime|)) -(= (mod (* (* |_446| 1) (* |_446| 1)) |~prime|) (mod (* |_446| 1) |~prime|)) -(= (mod (* (* |_447| 1) (* |_447| 1)) |~prime|) (mod (* |_447| 1) |~prime|)) -(= (mod (* (* |_448| 1) (* |_448| 1)) |~prime|) (mod (* |_448| 1) |~prime|)) -(= (mod (* (* |_449| 1) (* |_449| 1)) |~prime|) (mod (* |_449| 1) |~prime|)) -(= (mod (* (* |_450| 1) (* |_450| 1)) |~prime|) (mod (* |_450| 1) |~prime|)) -(= (mod (* (* |_451| 1) (* |_451| 1)) |~prime|) (mod (* |_451| 1) |~prime|)) -(= (mod (* (* |_452| 1) (* |_452| 1)) |~prime|) (mod (* |_452| 1) |~prime|)) -(= (mod (* (* |_453| 1) (* |_453| 1)) |~prime|) (mod (* |_453| 1) |~prime|)) -(= (mod (* (* |_454| 1) (* |_454| 1)) |~prime|) (mod (* |_454| 1) |~prime|)) -(= (mod (* (* |_455| 1) (* |_455| 1)) |~prime|) (mod (* |_455| 1) |~prime|)) -(= (mod (* (* |_456| 1) (* |_456| 1)) |~prime|) (mod (* |_456| 1) |~prime|)) -(= (mod (* (* |_457| 1) (* |_457| 1)) |~prime|) (mod (* |_457| 1) |~prime|)) -(= (mod (* (* |_458| 1) (* |_458| 1)) |~prime|) (mod (* |_458| 1) |~prime|)) -(= (mod (* (* |_459| 1) (* |_459| 1)) |~prime|) (mod (* |_459| 1) |~prime|)) -(= (mod (* (* |_460| 1) (* |_460| 1)) |~prime|) (mod (* |_460| 1) |~prime|)) -(= (mod (* (* |_461| 1) (* |_461| 1)) |~prime|) (mod (* |_461| 1) |~prime|)) -(= (mod (* (* |_462| 1) (* |_462| 1)) |~prime|) (mod (* |_462| 1) |~prime|)) -(= (mod (* (* |_463| 1) (* |_463| 1)) |~prime|) (mod (* |_463| 1) |~prime|)) -(= (mod (* (* |_464| 1) (* |_464| 1)) |~prime|) (mod (* |_464| 1) |~prime|)) -(= (mod (* (* |_465| 1) (* |_465| 1)) |~prime|) (mod (* |_465| 1) |~prime|)) -(= (mod (* (* |_466| 1) (* |_466| 1)) |~prime|) (mod (* |_466| 1) |~prime|)) -(= (mod (* (* |_467| 1) (* |_467| 1)) |~prime|) (mod (* |_467| 1) |~prime|)) -(= (mod (* (* |_468| 1) (* |_468| 1)) |~prime|) (mod (* |_468| 1) |~prime|)) -(= (mod (* (* |_469| 1) (* |_469| 1)) |~prime|) (mod (* |_469| 1) |~prime|)) -(= (mod (* (* |_470| 1) (* |_470| 1)) |~prime|) (mod (* |_470| 1) |~prime|)) -(= (mod (* (* |_471| 1) (* |_471| 1)) |~prime|) (mod (* |_471| 1) |~prime|)) -(= (mod (* (* |_472| 1) (* |_472| 1)) |~prime|) (mod (* |_472| 1) |~prime|)) -(= (mod (* (* |_473| 1) (* |_473| 1)) |~prime|) (mod (* |_473| 1) |~prime|)) -(= (mod (* (* |_474| 1) (* |_474| 1)) |~prime|) (mod (* |_474| 1) |~prime|)) -(= (mod (* (* |_475| 1) (* |_475| 1)) |~prime|) (mod (* |_475| 1) |~prime|)) -(= (mod (* (* |_476| 1) (* |_476| 1)) |~prime|) (mod (* |_476| 1) |~prime|)) -(= (mod (* (* |_477| 1) (* |_477| 1)) |~prime|) (mod (* |_477| 1) |~prime|)) -(= (mod (* (* |_478| 1) (* |_478| 1)) |~prime|) (mod (* |_478| 1) |~prime|)) -(= (mod (* (* |_479| 1) (* |_479| 1)) |~prime|) (mod (* |_479| 1) |~prime|)) -(= (mod (* (* |_480| 1) (* |_480| 1)) |~prime|) (mod (* |_480| 1) |~prime|)) -(= (mod (* (* |_481| 1) (* |_481| 1)) |~prime|) (mod (* |_481| 1) |~prime|)) -(= (mod (* (* |_482| 1) (* |_482| 1)) |~prime|) (mod (* |_482| 1) |~prime|)) -(= (mod (* (* |_483| 1) (* |_483| 1)) |~prime|) (mod (* |_483| 1) |~prime|)) -(= (mod (* (* |_484| 1) (* |_484| 1)) |~prime|) (mod (* |_484| 1) |~prime|)) -(= (mod (* (* |_485| 1) (* |_485| 1)) |~prime|) (mod (* |_485| 1) |~prime|)) -(= (mod (* (* |_486| 1) (* |_486| 1)) |~prime|) (mod (* |_486| 1) |~prime|)) -(= (mod (* (* |_487| 1) (* |_487| 1)) |~prime|) (mod (* |_487| 1) |~prime|)) -(= (mod (* (* |_488| 1) (* |_488| 1)) |~prime|) (mod (* |_488| 1) |~prime|)) -(= (mod (* (* |_489| 1) (* |_489| 1)) |~prime|) (mod (* |_489| 1) |~prime|)) -(= (mod (* (* |_490| 1) (* |_490| 1)) |~prime|) (mod (* |_490| 1) |~prime|)) -(= (mod (* (* |_491| 1) (* |_491| 1)) |~prime|) (mod (* |_491| 1) |~prime|)) -(= (mod (* (* |_492| 1) (* |_492| 1)) |~prime|) (mod (* |_492| 1) |~prime|)) -(= (mod (* (* |_493| 1) (* |_493| 1)) |~prime|) (mod (* |_493| 1) |~prime|)) -(= (mod (* (* |_494| 1) (* |_494| 1)) |~prime|) (mod (* |_494| 1) |~prime|)) -(= (mod (* (* |_495| 1) (* |_495| 1)) |~prime|) (mod (* |_495| 1) |~prime|)) -(= (mod (* (* |_496| 1) (* |_496| 1)) |~prime|) (mod (* |_496| 1) |~prime|)) -(= (mod (* (* |_497| 1) (* |_497| 1)) |~prime|) (mod (* |_497| 1) |~prime|)) -(= (mod (* (* |_498| 1) (* |_498| 1)) |~prime|) (mod (* |_498| 1) |~prime|)) -(= (mod (* (* |_499| 1) (* |_499| 1)) |~prime|) (mod (* |_499| 1) |~prime|)) -(= (mod (* (* |_500| 1) (* |_500| 1)) |~prime|) (mod (* |_500| 1) |~prime|)) -(= (mod (* (* |_501| 1) (* |_501| 1)) |~prime|) (mod (* |_501| 1) |~prime|)) -(= (mod (* (* |_502| 1) (* |_502| 1)) |~prime|) (mod (* |_502| 1) |~prime|)) -(= (mod (* (* |_503| 1) (* |_503| 1)) |~prime|) (mod (* |_503| 1) |~prime|)) -(= (mod (* (* |_504| 1) (* |_504| 1)) |~prime|) (mod (* |_504| 1) |~prime|)) -(= (mod (* (* |_505| 1) (* |_505| 1)) |~prime|) (mod (* |_505| 1) |~prime|)) -(= (mod (* (* |~one| 1) (+ (* |_254| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_255| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_256| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_257| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_258| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_259| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_260| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_261| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_262| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_263| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_264| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_265| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_266| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_267| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_268| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_269| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_270| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_271| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_272| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_273| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_274| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_275| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_276| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_277| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_278| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_279| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_280| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_281| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_282| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_283| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_284| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_285| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_286| 842498333348457493583344221469363458551160763204392890034487820288) (* |_287| 421249166674228746791672110734681729275580381602196445017243910144) (* |_288| 210624583337114373395836055367340864637790190801098222508621955072) (* |_289| 105312291668557186697918027683670432318895095400549111254310977536) (* |_290| 52656145834278593348959013841835216159447547700274555627155488768) (* |_291| 26328072917139296674479506920917608079723773850137277813577744384) (* |_292| 13164036458569648337239753460458804039861886925068638906788872192) (* |_293| 6582018229284824168619876730229402019930943462534319453394436096) (* |_294| 3291009114642412084309938365114701009965471731267159726697218048) (* |_295| 1645504557321206042154969182557350504982735865633579863348609024) (* |_296| 822752278660603021077484591278675252491367932816789931674304512) (* |_297| 411376139330301510538742295639337626245683966408394965837152256) (* |_298| 205688069665150755269371147819668813122841983204197482918576128) (* |_299| 102844034832575377634685573909834406561420991602098741459288064) (* |_300| 51422017416287688817342786954917203280710495801049370729644032) (* |_301| 25711008708143844408671393477458601640355247900524685364822016) (* |_302| 12855504354071922204335696738729300820177623950262342682411008) (* |_303| 6427752177035961102167848369364650410088811975131171341205504) (* |_304| 3213876088517980551083924184682325205044405987565585670602752) (* |_305| 1606938044258990275541962092341162602522202993782792835301376) (* |_306| 803469022129495137770981046170581301261101496891396417650688) (* |_307| 401734511064747568885490523085290650630550748445698208825344) (* |_308| 200867255532373784442745261542645325315275374222849104412672) (* |_309| 100433627766186892221372630771322662657637687111424552206336) (* |_310| 50216813883093446110686315385661331328818843555712276103168) (* |_311| 25108406941546723055343157692830665664409421777856138051584) (* |_312| 12554203470773361527671578846415332832204710888928069025792) (* |_313| 6277101735386680763835789423207666416102355444464034512896) (* |_314| 3138550867693340381917894711603833208051177722232017256448) (* |_315| 1569275433846670190958947355801916604025588861116008628224) (* |_316| 784637716923335095479473677900958302012794430558004314112) (* |_317| 392318858461667547739736838950479151006397215279002157056) (* |_318| 196159429230833773869868419475239575503198607639501078528) (* |_319| 98079714615416886934934209737619787751599303819750539264) (* |_320| 49039857307708443467467104868809893875799651909875269632) (* |_321| 24519928653854221733733552434404946937899825954937634816) (* |_322| 12259964326927110866866776217202473468949912977468817408) (* |_323| 6129982163463555433433388108601236734474956488734408704) (* |_324| 3064991081731777716716694054300618367237478244367204352) (* |_325| 1532495540865888858358347027150309183618739122183602176) (* |_326| 766247770432944429179173513575154591809369561091801088) (* |_327| 383123885216472214589586756787577295904684780545900544) (* |_328| 191561942608236107294793378393788647952342390272950272) (* |_329| 95780971304118053647396689196894323976171195136475136) (* |_330| 47890485652059026823698344598447161988085597568237568) (* |_331| 23945242826029513411849172299223580994042798784118784) (* |_332| 11972621413014756705924586149611790497021399392059392) (* |_333| 5986310706507378352962293074805895248510699696029696) (* |_334| 2993155353253689176481146537402947624255349848014848) (* |_335| 1496577676626844588240573268701473812127674924007424) (* |_336| 748288838313422294120286634350736906063837462003712) (* |_337| 374144419156711147060143317175368453031918731001856) (* |_338| 187072209578355573530071658587684226515959365500928) (* |_339| 93536104789177786765035829293842113257979682750464) (* |_340| 46768052394588893382517914646921056628989841375232) (* |_341| 23384026197294446691258957323460528314494920687616) (* |_342| 11692013098647223345629478661730264157247460343808) (* |_343| 5846006549323611672814739330865132078623730171904) (* |_344| 2923003274661805836407369665432566039311865085952) (* |_345| 1461501637330902918203684832716283019655932542976) (* |_346| 730750818665451459101842416358141509827966271488) (* |_347| 365375409332725729550921208179070754913983135744) (* |_348| 182687704666362864775460604089535377456991567872) (* |_349| 91343852333181432387730302044767688728495783936) (* |_350| 45671926166590716193865151022383844364247891968) (* |_351| 22835963083295358096932575511191922182123945984) (* |_352| 11417981541647679048466287755595961091061972992) (* |_353| 5708990770823839524233143877797980545530986496) (* |_354| 2854495385411919762116571938898990272765493248) (* |_355| 1427247692705959881058285969449495136382746624) (* |_356| 713623846352979940529142984724747568191373312) (* |_357| 356811923176489970264571492362373784095686656) (* |_358| 178405961588244985132285746181186892047843328) (* |_359| 89202980794122492566142873090593446023921664) (* |_360| 44601490397061246283071436545296723011960832) (* |_361| 22300745198530623141535718272648361505980416) (* |_362| 11150372599265311570767859136324180752990208) (* |_363| 5575186299632655785383929568162090376495104) (* |_364| 2787593149816327892691964784081045188247552) (* |_365| 1393796574908163946345982392040522594123776) (* |_366| 696898287454081973172991196020261297061888) (* |_367| 348449143727040986586495598010130648530944) (* |_368| 174224571863520493293247799005065324265472) (* |_369| 87112285931760246646623899502532662132736) (* |_370| 43556142965880123323311949751266331066368) (* |_371| 21778071482940061661655974875633165533184) (* |_372| 10889035741470030830827987437816582766592) (* |_373| 5444517870735015415413993718908291383296) (* |_374| 2722258935367507707706996859454145691648) (* |_375| 1361129467683753853853498429727072845824) (* |_376| 680564733841876926926749214863536422912) (* |_377| 340282366920938463463374607431768211456) (* |_378| 170141183460469231731687303715884105728) (* |_379| 85070591730234615865843651857942052864) (* |_380| 42535295865117307932921825928971026432) (* |_381| 21267647932558653966460912964485513216) (* |_382| 10633823966279326983230456482242756608) (* |_383| 5316911983139663491615228241121378304) (* |_384| 2658455991569831745807614120560689152) (* |_385| 1329227995784915872903807060280344576) (* |_386| 664613997892457936451903530140172288) (* |_387| 332306998946228968225951765070086144) (* |_388| 166153499473114484112975882535043072) (* |_389| 83076749736557242056487941267521536) (* |_390| 41538374868278621028243970633760768) (* |_391| 20769187434139310514121985316880384) (* |_392| 10384593717069655257060992658440192) (* |_393| 5192296858534827628530496329220096) (* |_394| 2596148429267413814265248164610048) (* |_395| 1298074214633706907132624082305024) (* |_396| 649037107316853453566312041152512) (* |_397| 324518553658426726783156020576256) (* |_398| 162259276829213363391578010288128) (* |_399| 81129638414606681695789005144064) (* |_400| 40564819207303340847894502572032) (* |_401| 20282409603651670423947251286016) (* |_402| 10141204801825835211973625643008) (* |_403| 5070602400912917605986812821504) (* |_404| 2535301200456458802993406410752) (* |_405| 1267650600228229401496703205376) (* |_406| 633825300114114700748351602688) (* |_407| 316912650057057350374175801344) (* |_408| 158456325028528675187087900672) (* |_409| 79228162514264337593543950336) (* |_410| 39614081257132168796771975168) (* |_411| 19807040628566084398385987584) (* |_412| 9903520314283042199192993792) (* |_413| 4951760157141521099596496896) (* |_414| 2475880078570760549798248448) (* |_415| 1237940039285380274899124224) (* |_416| 618970019642690137449562112) (* |_417| 309485009821345068724781056) (* |_418| 154742504910672534362390528) (* |_419| 77371252455336267181195264) (* |_420| 38685626227668133590597632) (* |_421| 19342813113834066795298816) (* |_422| 9671406556917033397649408) (* |_423| 4835703278458516698824704) (* |_424| 2417851639229258349412352) (* |_425| 1208925819614629174706176) (* |_426| 604462909807314587353088) (* |_427| 302231454903657293676544) (* |_428| 151115727451828646838272) (* |_429| 75557863725914323419136) (* |_430| 37778931862957161709568) (* |_431| 18889465931478580854784) (* |_432| 9444732965739290427392) (* |_433| 4722366482869645213696) (* |_434| 2361183241434822606848) (* |_435| 1180591620717411303424) (* |_436| 590295810358705651712) (* |_437| 295147905179352825856) (* |_438| 147573952589676412928) (* |_439| 73786976294838206464) (* |_440| 36893488147419103232) (* |_441| 18446744073709551616) (* |_442| 9223372036854775808) (* |_443| 4611686018427387904) (* |_444| 2305843009213693952) (* |_445| 1152921504606846976) (* |_446| 576460752303423488) (* |_447| 288230376151711744) (* |_448| 144115188075855872) (* |_449| 72057594037927936) (* |_450| 36028797018963968) (* |_451| 18014398509481984) (* |_452| 9007199254740992) (* |_453| 4503599627370496) (* |_454| 2251799813685248) (* |_455| 1125899906842624) (* |_456| 562949953421312) (* |_457| 281474976710656) (* |_458| 140737488355328) (* |_459| 70368744177664) (* |_460| 35184372088832) (* |_461| 17592186044416) (* |_462| 8796093022208) (* |_463| 4398046511104) (* |_464| 2199023255552) (* |_465| 1099511627776) (* |_466| 549755813888) (* |_467| 274877906944) (* |_468| 137438953472) (* |_469| 68719476736) (* |_470| 34359738368) (* |_471| 17179869184) (* |_472| 8589934592) (* |_473| 4294967296) (* |_474| 2147483648) (* |_475| 1073741824) (* |_476| 536870912) (* |_477| 268435456) (* |_478| 134217728) (* |_479| 67108864) (* |_480| 33554432) (* |_481| 16777216) (* |_482| 8388608) (* |_483| 4194304) (* |_484| 2097152) (* |_485| 1048576) (* |_486| 524288) (* |_487| 262144) (* |_488| 131072) (* |_489| 65536) (* |_490| 32768) (* |_491| 16384) (* |_492| 8192) (* |_493| 4096) (* |_494| 2048) (* |_495| 1024) (* |_496| 512) (* |_497| 256) (* |_498| 128) (* |_499| 64) (* |_500| 32) (* |_501| 16) (* |_502| 8) (* |_503| 4) (* |_504| 2) (* |_505| 1))) |~prime|) (mod (* |_0| 1) |~prime|)) - -(= (mod (* (* |_506| 1) (* |_506| 1)) |~prime|) (mod (* |_506| 1) |~prime|)) -(= (mod (* (* |_507| 1) (* |_507| 1)) |~prime|) (mod (* |_507| 1) |~prime|)) -(= (mod (* (* |_508| 1) (* |_508| 1)) |~prime|) (mod (* |_508| 1) |~prime|)) -(= (mod (* (* |_509| 1) (* |_509| 1)) |~prime|) (mod (* |_509| 1) |~prime|)) -(= (mod (* (* |_510| 1) (* |_510| 1)) |~prime|) (mod (* |_510| 1) |~prime|)) -(= (mod (* (* |_511| 1) (* |_511| 1)) |~prime|) (mod (* |_511| 1) |~prime|)) -(= (mod (* (* |_512| 1) (* |_512| 1)) |~prime|) (mod (* |_512| 1) |~prime|)) -(= (mod (* (* |_513| 1) (* |_513| 1)) |~prime|) (mod (* |_513| 1) |~prime|)) -(= (mod (* (* |_514| 1) (* |_514| 1)) |~prime|) (mod (* |_514| 1) |~prime|)) -(= (mod (* (* |_515| 1) (* |_515| 1)) |~prime|) (mod (* |_515| 1) |~prime|)) -(= (mod (* (* |_516| 1) (* |_516| 1)) |~prime|) (mod (* |_516| 1) |~prime|)) -(= (mod (* (* |_517| 1) (* |_517| 1)) |~prime|) (mod (* |_517| 1) |~prime|)) -(= (mod (* (* |_518| 1) (* |_518| 1)) |~prime|) (mod (* |_518| 1) |~prime|)) -(= (mod (* (* |_519| 1) (* |_519| 1)) |~prime|) (mod (* |_519| 1) |~prime|)) -(= (mod (* (* |_520| 1) (* |_520| 1)) |~prime|) (mod (* |_520| 1) |~prime|)) -(= (mod (* (* |_521| 1) (* |_521| 1)) |~prime|) (mod (* |_521| 1) |~prime|)) -(= (mod (* (* |_522| 1) (* |_522| 1)) |~prime|) (mod (* |_522| 1) |~prime|)) -(= (mod (* (* |_523| 1) (* |_523| 1)) |~prime|) (mod (* |_523| 1) |~prime|)) -(= (mod (* (* |_524| 1) (* |_524| 1)) |~prime|) (mod (* |_524| 1) |~prime|)) -(= (mod (* (* |_525| 1) (* |_525| 1)) |~prime|) (mod (* |_525| 1) |~prime|)) -(= (mod (* (* |_526| 1) (* |_526| 1)) |~prime|) (mod (* |_526| 1) |~prime|)) -(= (mod (* (* |_527| 1) (* |_527| 1)) |~prime|) (mod (* |_527| 1) |~prime|)) -(= (mod (* (* |_528| 1) (* |_528| 1)) |~prime|) (mod (* |_528| 1) |~prime|)) -(= (mod (* (* |_529| 1) (* |_529| 1)) |~prime|) (mod (* |_529| 1) |~prime|)) -(= (mod (* (* |_530| 1) (* |_530| 1)) |~prime|) (mod (* |_530| 1) |~prime|)) -(= (mod (* (* |_531| 1) (* |_531| 1)) |~prime|) (mod (* |_531| 1) |~prime|)) -(= (mod (* (* |_532| 1) (* |_532| 1)) |~prime|) (mod (* |_532| 1) |~prime|)) -(= (mod (* (* |_533| 1) (* |_533| 1)) |~prime|) (mod (* |_533| 1) |~prime|)) -(= (mod (* (* |_534| 1) (* |_534| 1)) |~prime|) (mod (* |_534| 1) |~prime|)) -(= (mod (* (* |_535| 1) (* |_535| 1)) |~prime|) (mod (* |_535| 1) |~prime|)) -(= (mod (* (* |_536| 1) (* |_536| 1)) |~prime|) (mod (* |_536| 1) |~prime|)) -(= (mod (* (* |_537| 1) (* |_537| 1)) |~prime|) (mod (* |_537| 1) |~prime|)) -(= (mod (* (* |_538| 1) (* |_538| 1)) |~prime|) (mod (* |_538| 1) |~prime|)) -(= (mod (* (* |_539| 1) (* |_539| 1)) |~prime|) (mod (* |_539| 1) |~prime|)) -(= (mod (* (* |_540| 1) (* |_540| 1)) |~prime|) (mod (* |_540| 1) |~prime|)) -(= (mod (* (* |_541| 1) (* |_541| 1)) |~prime|) (mod (* |_541| 1) |~prime|)) -(= (mod (* (* |_542| 1) (* |_542| 1)) |~prime|) (mod (* |_542| 1) |~prime|)) -(= (mod (* (* |_543| 1) (* |_543| 1)) |~prime|) (mod (* |_543| 1) |~prime|)) -(= (mod (* (* |_544| 1) (* |_544| 1)) |~prime|) (mod (* |_544| 1) |~prime|)) -(= (mod (* (* |_545| 1) (* |_545| 1)) |~prime|) (mod (* |_545| 1) |~prime|)) -(= (mod (* (* |_546| 1) (* |_546| 1)) |~prime|) (mod (* |_546| 1) |~prime|)) -(= (mod (* (* |_547| 1) (* |_547| 1)) |~prime|) (mod (* |_547| 1) |~prime|)) -(= (mod (* (* |_548| 1) (* |_548| 1)) |~prime|) (mod (* |_548| 1) |~prime|)) -(= (mod (* (* |_549| 1) (* |_549| 1)) |~prime|) (mod (* |_549| 1) |~prime|)) -(= (mod (* (* |_550| 1) (* |_550| 1)) |~prime|) (mod (* |_550| 1) |~prime|)) -(= (mod (* (* |_551| 1) (* |_551| 1)) |~prime|) (mod (* |_551| 1) |~prime|)) -(= (mod (* (* |_552| 1) (* |_552| 1)) |~prime|) (mod (* |_552| 1) |~prime|)) -(= (mod (* (* |_553| 1) (* |_553| 1)) |~prime|) (mod (* |_553| 1) |~prime|)) -(= (mod (* (* |_554| 1) (* |_554| 1)) |~prime|) (mod (* |_554| 1) |~prime|)) -(= (mod (* (* |_555| 1) (* |_555| 1)) |~prime|) (mod (* |_555| 1) |~prime|)) -(= (mod (* (* |_556| 1) (* |_556| 1)) |~prime|) (mod (* |_556| 1) |~prime|)) -(= (mod (* (* |_557| 1) (* |_557| 1)) |~prime|) (mod (* |_557| 1) |~prime|)) -(= (mod (* (* |_558| 1) (* |_558| 1)) |~prime|) (mod (* |_558| 1) |~prime|)) -(= (mod (* (* |_559| 1) (* |_559| 1)) |~prime|) (mod (* |_559| 1) |~prime|)) -(= (mod (* (* |_560| 1) (* |_560| 1)) |~prime|) (mod (* |_560| 1) |~prime|)) -(= (mod (* (* |_561| 1) (* |_561| 1)) |~prime|) (mod (* |_561| 1) |~prime|)) -(= (mod (* (* |_562| 1) (* |_562| 1)) |~prime|) (mod (* |_562| 1) |~prime|)) -(= (mod (* (* |_563| 1) (* |_563| 1)) |~prime|) (mod (* |_563| 1) |~prime|)) -(= (mod (* (* |_564| 1) (* |_564| 1)) |~prime|) (mod (* |_564| 1) |~prime|)) -(= (mod (* (* |_565| 1) (* |_565| 1)) |~prime|) (mod (* |_565| 1) |~prime|)) -(= (mod (* (* |_566| 1) (* |_566| 1)) |~prime|) (mod (* |_566| 1) |~prime|)) -(= (mod (* (* |_567| 1) (* |_567| 1)) |~prime|) (mod (* |_567| 1) |~prime|)) -(= (mod (* (* |_568| 1) (* |_568| 1)) |~prime|) (mod (* |_568| 1) |~prime|)) -(= (mod (* (* |_569| 1) (* |_569| 1)) |~prime|) (mod (* |_569| 1) |~prime|)) -(= (mod (* (* |_570| 1) (* |_570| 1)) |~prime|) (mod (* |_570| 1) |~prime|)) -(= (mod (* (* |_571| 1) (* |_571| 1)) |~prime|) (mod (* |_571| 1) |~prime|)) -(= (mod (* (* |_572| 1) (* |_572| 1)) |~prime|) (mod (* |_572| 1) |~prime|)) -(= (mod (* (* |_573| 1) (* |_573| 1)) |~prime|) (mod (* |_573| 1) |~prime|)) -(= (mod (* (* |_574| 1) (* |_574| 1)) |~prime|) (mod (* |_574| 1) |~prime|)) -(= (mod (* (* |_575| 1) (* |_575| 1)) |~prime|) (mod (* |_575| 1) |~prime|)) -(= (mod (* (* |_576| 1) (* |_576| 1)) |~prime|) (mod (* |_576| 1) |~prime|)) -(= (mod (* (* |_577| 1) (* |_577| 1)) |~prime|) (mod (* |_577| 1) |~prime|)) -(= (mod (* (* |_578| 1) (* |_578| 1)) |~prime|) (mod (* |_578| 1) |~prime|)) -(= (mod (* (* |_579| 1) (* |_579| 1)) |~prime|) (mod (* |_579| 1) |~prime|)) -(= (mod (* (* |_580| 1) (* |_580| 1)) |~prime|) (mod (* |_580| 1) |~prime|)) -(= (mod (* (* |_581| 1) (* |_581| 1)) |~prime|) (mod (* |_581| 1) |~prime|)) -(= (mod (* (* |_582| 1) (* |_582| 1)) |~prime|) (mod (* |_582| 1) |~prime|)) -(= (mod (* (* |_583| 1) (* |_583| 1)) |~prime|) (mod (* |_583| 1) |~prime|)) -(= (mod (* (* |_584| 1) (* |_584| 1)) |~prime|) (mod (* |_584| 1) |~prime|)) -(= (mod (* (* |_585| 1) (* |_585| 1)) |~prime|) (mod (* |_585| 1) |~prime|)) -(= (mod (* (* |_586| 1) (* |_586| 1)) |~prime|) (mod (* |_586| 1) |~prime|)) -(= (mod (* (* |_587| 1) (* |_587| 1)) |~prime|) (mod (* |_587| 1) |~prime|)) -(= (mod (* (* |_588| 1) (* |_588| 1)) |~prime|) (mod (* |_588| 1) |~prime|)) -(= (mod (* (* |_589| 1) (* |_589| 1)) |~prime|) (mod (* |_589| 1) |~prime|)) -(= (mod (* (* |_590| 1) (* |_590| 1)) |~prime|) (mod (* |_590| 1) |~prime|)) -(= (mod (* (* |_591| 1) (* |_591| 1)) |~prime|) (mod (* |_591| 1) |~prime|)) -(= (mod (* (* |_592| 1) (* |_592| 1)) |~prime|) (mod (* |_592| 1) |~prime|)) -(= (mod (* (* |_593| 1) (* |_593| 1)) |~prime|) (mod (* |_593| 1) |~prime|)) -(= (mod (* (* |_594| 1) (* |_594| 1)) |~prime|) (mod (* |_594| 1) |~prime|)) -(= (mod (* (* |_595| 1) (* |_595| 1)) |~prime|) (mod (* |_595| 1) |~prime|)) -(= (mod (* (* |_596| 1) (* |_596| 1)) |~prime|) (mod (* |_596| 1) |~prime|)) -(= (mod (* (* |_597| 1) (* |_597| 1)) |~prime|) (mod (* |_597| 1) |~prime|)) -(= (mod (* (* |_598| 1) (* |_598| 1)) |~prime|) (mod (* |_598| 1) |~prime|)) -(= (mod (* (* |_599| 1) (* |_599| 1)) |~prime|) (mod (* |_599| 1) |~prime|)) -(= (mod (* (* |_600| 1) (* |_600| 1)) |~prime|) (mod (* |_600| 1) |~prime|)) -(= (mod (* (* |_601| 1) (* |_601| 1)) |~prime|) (mod (* |_601| 1) |~prime|)) -(= (mod (* (* |_602| 1) (* |_602| 1)) |~prime|) (mod (* |_602| 1) |~prime|)) -(= (mod (* (* |_603| 1) (* |_603| 1)) |~prime|) (mod (* |_603| 1) |~prime|)) -(= (mod (* (* |_604| 1) (* |_604| 1)) |~prime|) (mod (* |_604| 1) |~prime|)) -(= (mod (* (* |_605| 1) (* |_605| 1)) |~prime|) (mod (* |_605| 1) |~prime|)) -(= (mod (* (* |_606| 1) (* |_606| 1)) |~prime|) (mod (* |_606| 1) |~prime|)) -(= (mod (* (* |_607| 1) (* |_607| 1)) |~prime|) (mod (* |_607| 1) |~prime|)) -(= (mod (* (* |_608| 1) (* |_608| 1)) |~prime|) (mod (* |_608| 1) |~prime|)) -(= (mod (* (* |_609| 1) (* |_609| 1)) |~prime|) (mod (* |_609| 1) |~prime|)) -(= (mod (* (* |_610| 1) (* |_610| 1)) |~prime|) (mod (* |_610| 1) |~prime|)) -(= (mod (* (* |_611| 1) (* |_611| 1)) |~prime|) (mod (* |_611| 1) |~prime|)) -(= (mod (* (* |_612| 1) (* |_612| 1)) |~prime|) (mod (* |_612| 1) |~prime|)) -(= (mod (* (* |_613| 1) (* |_613| 1)) |~prime|) (mod (* |_613| 1) |~prime|)) -(= (mod (* (* |_614| 1) (* |_614| 1)) |~prime|) (mod (* |_614| 1) |~prime|)) -(= (mod (* (* |_615| 1) (* |_615| 1)) |~prime|) (mod (* |_615| 1) |~prime|)) -(= (mod (* (* |_616| 1) (* |_616| 1)) |~prime|) (mod (* |_616| 1) |~prime|)) -(= (mod (* (* |_617| 1) (* |_617| 1)) |~prime|) (mod (* |_617| 1) |~prime|)) -(= (mod (* (* |_618| 1) (* |_618| 1)) |~prime|) (mod (* |_618| 1) |~prime|)) -(= (mod (* (* |_619| 1) (* |_619| 1)) |~prime|) (mod (* |_619| 1) |~prime|)) -(= (mod (* (* |_620| 1) (* |_620| 1)) |~prime|) (mod (* |_620| 1) |~prime|)) -(= (mod (* (* |_621| 1) (* |_621| 1)) |~prime|) (mod (* |_621| 1) |~prime|)) -(= (mod (* (* |_622| 1) (* |_622| 1)) |~prime|) (mod (* |_622| 1) |~prime|)) -(= (mod (* (* |_623| 1) (* |_623| 1)) |~prime|) (mod (* |_623| 1) |~prime|)) -(= (mod (* (* |_624| 1) (* |_624| 1)) |~prime|) (mod (* |_624| 1) |~prime|)) -(= (mod (* (* |_625| 1) (* |_625| 1)) |~prime|) (mod (* |_625| 1) |~prime|)) -(= (mod (* (* |_626| 1) (* |_626| 1)) |~prime|) (mod (* |_626| 1) |~prime|)) -(= (mod (* (* |_627| 1) (* |_627| 1)) |~prime|) (mod (* |_627| 1) |~prime|)) -(= (mod (* (* |_628| 1) (* |_628| 1)) |~prime|) (mod (* |_628| 1) |~prime|)) -(= (mod (* (* |_629| 1) (* |_629| 1)) |~prime|) (mod (* |_629| 1) |~prime|)) -(= (mod (* (* |_630| 1) (* |_630| 1)) |~prime|) (mod (* |_630| 1) |~prime|)) -(= (mod (* (* |_631| 1) (* |_631| 1)) |~prime|) (mod (* |_631| 1) |~prime|)) -(= (mod (* (* |_632| 1) (* |_632| 1)) |~prime|) (mod (* |_632| 1) |~prime|)) -(= (mod (* (* |_633| 1) (* |_633| 1)) |~prime|) (mod (* |_633| 1) |~prime|)) -(= (mod (* (* |_634| 1) (* |_634| 1)) |~prime|) (mod (* |_634| 1) |~prime|)) -(= (mod (* (* |_635| 1) (* |_635| 1)) |~prime|) (mod (* |_635| 1) |~prime|)) -(= (mod (* (* |_636| 1) (* |_636| 1)) |~prime|) (mod (* |_636| 1) |~prime|)) -(= (mod (* (* |_637| 1) (* |_637| 1)) |~prime|) (mod (* |_637| 1) |~prime|)) -(= (mod (* (* |_638| 1) (* |_638| 1)) |~prime|) (mod (* |_638| 1) |~prime|)) -(= (mod (* (* |_639| 1) (* |_639| 1)) |~prime|) (mod (* |_639| 1) |~prime|)) -(= (mod (* (* |_640| 1) (* |_640| 1)) |~prime|) (mod (* |_640| 1) |~prime|)) -(= (mod (* (* |_641| 1) (* |_641| 1)) |~prime|) (mod (* |_641| 1) |~prime|)) -(= (mod (* (* |_642| 1) (* |_642| 1)) |~prime|) (mod (* |_642| 1) |~prime|)) -(= (mod (* (* |_643| 1) (* |_643| 1)) |~prime|) (mod (* |_643| 1) |~prime|)) -(= (mod (* (* |_644| 1) (* |_644| 1)) |~prime|) (mod (* |_644| 1) |~prime|)) -(= (mod (* (* |_645| 1) (* |_645| 1)) |~prime|) (mod (* |_645| 1) |~prime|)) -(= (mod (* (* |_646| 1) (* |_646| 1)) |~prime|) (mod (* |_646| 1) |~prime|)) -(= (mod (* (* |_647| 1) (* |_647| 1)) |~prime|) (mod (* |_647| 1) |~prime|)) -(= (mod (* (* |_648| 1) (* |_648| 1)) |~prime|) (mod (* |_648| 1) |~prime|)) -(= (mod (* (* |_649| 1) (* |_649| 1)) |~prime|) (mod (* |_649| 1) |~prime|)) -(= (mod (* (* |_650| 1) (* |_650| 1)) |~prime|) (mod (* |_650| 1) |~prime|)) -(= (mod (* (* |_651| 1) (* |_651| 1)) |~prime|) (mod (* |_651| 1) |~prime|)) -(= (mod (* (* |_652| 1) (* |_652| 1)) |~prime|) (mod (* |_652| 1) |~prime|)) -(= (mod (* (* |_653| 1) (* |_653| 1)) |~prime|) (mod (* |_653| 1) |~prime|)) -(= (mod (* (* |_654| 1) (* |_654| 1)) |~prime|) (mod (* |_654| 1) |~prime|)) -(= (mod (* (* |_655| 1) (* |_655| 1)) |~prime|) (mod (* |_655| 1) |~prime|)) -(= (mod (* (* |_656| 1) (* |_656| 1)) |~prime|) (mod (* |_656| 1) |~prime|)) -(= (mod (* (* |_657| 1) (* |_657| 1)) |~prime|) (mod (* |_657| 1) |~prime|)) -(= (mod (* (* |_658| 1) (* |_658| 1)) |~prime|) (mod (* |_658| 1) |~prime|)) -(= (mod (* (* |_659| 1) (* |_659| 1)) |~prime|) (mod (* |_659| 1) |~prime|)) -(= (mod (* (* |_660| 1) (* |_660| 1)) |~prime|) (mod (* |_660| 1) |~prime|)) -(= (mod (* (* |_661| 1) (* |_661| 1)) |~prime|) (mod (* |_661| 1) |~prime|)) -(= (mod (* (* |_662| 1) (* |_662| 1)) |~prime|) (mod (* |_662| 1) |~prime|)) -(= (mod (* (* |_663| 1) (* |_663| 1)) |~prime|) (mod (* |_663| 1) |~prime|)) -(= (mod (* (* |_664| 1) (* |_664| 1)) |~prime|) (mod (* |_664| 1) |~prime|)) -(= (mod (* (* |_665| 1) (* |_665| 1)) |~prime|) (mod (* |_665| 1) |~prime|)) -(= (mod (* (* |_666| 1) (* |_666| 1)) |~prime|) (mod (* |_666| 1) |~prime|)) -(= (mod (* (* |_667| 1) (* |_667| 1)) |~prime|) (mod (* |_667| 1) |~prime|)) -(= (mod (* (* |_668| 1) (* |_668| 1)) |~prime|) (mod (* |_668| 1) |~prime|)) -(= (mod (* (* |_669| 1) (* |_669| 1)) |~prime|) (mod (* |_669| 1) |~prime|)) -(= (mod (* (* |_670| 1) (* |_670| 1)) |~prime|) (mod (* |_670| 1) |~prime|)) -(= (mod (* (* |_671| 1) (* |_671| 1)) |~prime|) (mod (* |_671| 1) |~prime|)) -(= (mod (* (* |_672| 1) (* |_672| 1)) |~prime|) (mod (* |_672| 1) |~prime|)) -(= (mod (* (* |_673| 1) (* |_673| 1)) |~prime|) (mod (* |_673| 1) |~prime|)) -(= (mod (* (* |_674| 1) (* |_674| 1)) |~prime|) (mod (* |_674| 1) |~prime|)) -(= (mod (* (* |_675| 1) (* |_675| 1)) |~prime|) (mod (* |_675| 1) |~prime|)) -(= (mod (* (* |_676| 1) (* |_676| 1)) |~prime|) (mod (* |_676| 1) |~prime|)) -(= (mod (* (* |_677| 1) (* |_677| 1)) |~prime|) (mod (* |_677| 1) |~prime|)) -(= (mod (* (* |_678| 1) (* |_678| 1)) |~prime|) (mod (* |_678| 1) |~prime|)) -(= (mod (* (* |_679| 1) (* |_679| 1)) |~prime|) (mod (* |_679| 1) |~prime|)) -(= (mod (* (* |_680| 1) (* |_680| 1)) |~prime|) (mod (* |_680| 1) |~prime|)) -(= (mod (* (* |_681| 1) (* |_681| 1)) |~prime|) (mod (* |_681| 1) |~prime|)) -(= (mod (* (* |_682| 1) (* |_682| 1)) |~prime|) (mod (* |_682| 1) |~prime|)) -(= (mod (* (* |_683| 1) (* |_683| 1)) |~prime|) (mod (* |_683| 1) |~prime|)) -(= (mod (* (* |_684| 1) (* |_684| 1)) |~prime|) (mod (* |_684| 1) |~prime|)) -(= (mod (* (* |_685| 1) (* |_685| 1)) |~prime|) (mod (* |_685| 1) |~prime|)) -(= (mod (* (* |_686| 1) (* |_686| 1)) |~prime|) (mod (* |_686| 1) |~prime|)) -(= (mod (* (* |_687| 1) (* |_687| 1)) |~prime|) (mod (* |_687| 1) |~prime|)) -(= (mod (* (* |_688| 1) (* |_688| 1)) |~prime|) (mod (* |_688| 1) |~prime|)) -(= (mod (* (* |_689| 1) (* |_689| 1)) |~prime|) (mod (* |_689| 1) |~prime|)) -(= (mod (* (* |_690| 1) (* |_690| 1)) |~prime|) (mod (* |_690| 1) |~prime|)) -(= (mod (* (* |_691| 1) (* |_691| 1)) |~prime|) (mod (* |_691| 1) |~prime|)) -(= (mod (* (* |_692| 1) (* |_692| 1)) |~prime|) (mod (* |_692| 1) |~prime|)) -(= (mod (* (* |_693| 1) (* |_693| 1)) |~prime|) (mod (* |_693| 1) |~prime|)) -(= (mod (* (* |_694| 1) (* |_694| 1)) |~prime|) (mod (* |_694| 1) |~prime|)) -(= (mod (* (* |_695| 1) (* |_695| 1)) |~prime|) (mod (* |_695| 1) |~prime|)) -(= (mod (* (* |_696| 1) (* |_696| 1)) |~prime|) (mod (* |_696| 1) |~prime|)) -(= (mod (* (* |_697| 1) (* |_697| 1)) |~prime|) (mod (* |_697| 1) |~prime|)) -(= (mod (* (* |_698| 1) (* |_698| 1)) |~prime|) (mod (* |_698| 1) |~prime|)) -(= (mod (* (* |_699| 1) (* |_699| 1)) |~prime|) (mod (* |_699| 1) |~prime|)) -(= (mod (* (* |_700| 1) (* |_700| 1)) |~prime|) (mod (* |_700| 1) |~prime|)) -(= (mod (* (* |_701| 1) (* |_701| 1)) |~prime|) (mod (* |_701| 1) |~prime|)) -(= (mod (* (* |_702| 1) (* |_702| 1)) |~prime|) (mod (* |_702| 1) |~prime|)) -(= (mod (* (* |_703| 1) (* |_703| 1)) |~prime|) (mod (* |_703| 1) |~prime|)) -(= (mod (* (* |_704| 1) (* |_704| 1)) |~prime|) (mod (* |_704| 1) |~prime|)) -(= (mod (* (* |_705| 1) (* |_705| 1)) |~prime|) (mod (* |_705| 1) |~prime|)) -(= (mod (* (* |_706| 1) (* |_706| 1)) |~prime|) (mod (* |_706| 1) |~prime|)) -(= (mod (* (* |_707| 1) (* |_707| 1)) |~prime|) (mod (* |_707| 1) |~prime|)) -(= (mod (* (* |_708| 1) (* |_708| 1)) |~prime|) (mod (* |_708| 1) |~prime|)) -(= (mod (* (* |_709| 1) (* |_709| 1)) |~prime|) (mod (* |_709| 1) |~prime|)) -(= (mod (* (* |_710| 1) (* |_710| 1)) |~prime|) (mod (* |_710| 1) |~prime|)) -(= (mod (* (* |_711| 1) (* |_711| 1)) |~prime|) (mod (* |_711| 1) |~prime|)) -(= (mod (* (* |_712| 1) (* |_712| 1)) |~prime|) (mod (* |_712| 1) |~prime|)) -(= (mod (* (* |_713| 1) (* |_713| 1)) |~prime|) (mod (* |_713| 1) |~prime|)) -(= (mod (* (* |_714| 1) (* |_714| 1)) |~prime|) (mod (* |_714| 1) |~prime|)) -(= (mod (* (* |_715| 1) (* |_715| 1)) |~prime|) (mod (* |_715| 1) |~prime|)) -(= (mod (* (* |_716| 1) (* |_716| 1)) |~prime|) (mod (* |_716| 1) |~prime|)) -(= (mod (* (* |_717| 1) (* |_717| 1)) |~prime|) (mod (* |_717| 1) |~prime|)) -(= (mod (* (* |_718| 1) (* |_718| 1)) |~prime|) (mod (* |_718| 1) |~prime|)) -(= (mod (* (* |_719| 1) (* |_719| 1)) |~prime|) (mod (* |_719| 1) |~prime|)) -(= (mod (* (* |_720| 1) (* |_720| 1)) |~prime|) (mod (* |_720| 1) |~prime|)) -(= (mod (* (* |_721| 1) (* |_721| 1)) |~prime|) (mod (* |_721| 1) |~prime|)) -(= (mod (* (* |_722| 1) (* |_722| 1)) |~prime|) (mod (* |_722| 1) |~prime|)) -(= (mod (* (* |_723| 1) (* |_723| 1)) |~prime|) (mod (* |_723| 1) |~prime|)) -(= (mod (* (* |_724| 1) (* |_724| 1)) |~prime|) (mod (* |_724| 1) |~prime|)) -(= (mod (* (* |_725| 1) (* |_725| 1)) |~prime|) (mod (* |_725| 1) |~prime|)) -(= (mod (* (* |_726| 1) (* |_726| 1)) |~prime|) (mod (* |_726| 1) |~prime|)) -(= (mod (* (* |_727| 1) (* |_727| 1)) |~prime|) (mod (* |_727| 1) |~prime|)) -(= (mod (* (* |_728| 1) (* |_728| 1)) |~prime|) (mod (* |_728| 1) |~prime|)) -(= (mod (* (* |_729| 1) (* |_729| 1)) |~prime|) (mod (* |_729| 1) |~prime|)) -(= (mod (* (* |_730| 1) (* |_730| 1)) |~prime|) (mod (* |_730| 1) |~prime|)) -(= (mod (* (* |_731| 1) (* |_731| 1)) |~prime|) (mod (* |_731| 1) |~prime|)) -(= (mod (* (* |_732| 1) (* |_732| 1)) |~prime|) (mod (* |_732| 1) |~prime|)) -(= (mod (* (* |_733| 1) (* |_733| 1)) |~prime|) (mod (* |_733| 1) |~prime|)) -(= (mod (* (* |_734| 1) (* |_734| 1)) |~prime|) (mod (* |_734| 1) |~prime|)) -(= (mod (* (* |_735| 1) (* |_735| 1)) |~prime|) (mod (* |_735| 1) |~prime|)) -(= (mod (* (* |_736| 1) (* |_736| 1)) |~prime|) (mod (* |_736| 1) |~prime|)) -(= (mod (* (* |_737| 1) (* |_737| 1)) |~prime|) (mod (* |_737| 1) |~prime|)) -(= (mod (* (* |_738| 1) (* |_738| 1)) |~prime|) (mod (* |_738| 1) |~prime|)) -(= (mod (* (* |_739| 1) (* |_739| 1)) |~prime|) (mod (* |_739| 1) |~prime|)) -(= (mod (* (* |_740| 1) (* |_740| 1)) |~prime|) (mod (* |_740| 1) |~prime|)) -(= (mod (* (* |_741| 1) (* |_741| 1)) |~prime|) (mod (* |_741| 1) |~prime|)) -(= (mod (* (* |_742| 1) (* |_742| 1)) |~prime|) (mod (* |_742| 1) |~prime|)) -(= (mod (* (* |_743| 1) (* |_743| 1)) |~prime|) (mod (* |_743| 1) |~prime|)) -(= (mod (* (* |_744| 1) (* |_744| 1)) |~prime|) (mod (* |_744| 1) |~prime|)) -(= (mod (* (* |_745| 1) (* |_745| 1)) |~prime|) (mod (* |_745| 1) |~prime|)) -(= (mod (* (* |_746| 1) (* |_746| 1)) |~prime|) (mod (* |_746| 1) |~prime|)) -(= (mod (* (* |_747| 1) (* |_747| 1)) |~prime|) (mod (* |_747| 1) |~prime|)) -(= (mod (* (* |_748| 1) (* |_748| 1)) |~prime|) (mod (* |_748| 1) |~prime|)) -(= (mod (* (* |_749| 1) (* |_749| 1)) |~prime|) (mod (* |_749| 1) |~prime|)) -(= (mod (* (* |_750| 1) (* |_750| 1)) |~prime|) (mod (* |_750| 1) |~prime|)) -(= (mod (* (* |_751| 1) (* |_751| 1)) |~prime|) (mod (* |_751| 1) |~prime|)) -(= (mod (* (* |_752| 1) (* |_752| 1)) |~prime|) (mod (* |_752| 1) |~prime|)) -(= (mod (* (* |_753| 1) (* |_753| 1)) |~prime|) (mod (* |_753| 1) |~prime|)) -(= (mod (* (* |_754| 1) (* |_754| 1)) |~prime|) (mod (* |_754| 1) |~prime|)) -(= (mod (* (* |_755| 1) (* |_755| 1)) |~prime|) (mod (* |_755| 1) |~prime|)) -(= (mod (* (* |_756| 1) (* |_756| 1)) |~prime|) (mod (* |_756| 1) |~prime|)) -(= (mod (* (* |_757| 1) (* |_757| 1)) |~prime|) (mod (* |_757| 1) |~prime|)) -(= (mod (* (* |_758| 1) (* |_758| 1)) |~prime|) (mod (* |_758| 1) |~prime|)) -(= (mod (* (* |_759| 1) (* |_759| 1)) |~prime|) (mod (* |_759| 1) |~prime|)) -(= (mod (* (* |_506| 1) (* |_507| 1)) |~prime|) (mod (* |_765| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_765| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_508| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1268| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_765| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_509| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1269| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_765| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_510| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1270| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_765| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_511| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1271| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_765| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_512| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1272| 1) |~prime|)) -(= (mod (* (* |_765| 1) (* |_513| 1)) |~prime|) (mod (* |_777| 1) |~prime|)) -(= (mod (* (* |_777| 1) (* |_514| 1)) |~prime|) (mod (* |_779| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_779| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_515| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1273| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_779| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_516| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1274| 1) |~prime|)) -(= (mod (* (* |_779| 1) (* |_517| 1)) |~prime|) (mod (* |_785| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_785| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_518| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1275| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_785| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_519| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1276| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_785| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_520| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1277| 1) |~prime|)) -(= (mod (* (* |_785| 1) (* |_521| 1)) |~prime|) (mod (* |_793| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_793| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_522| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1278| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_793| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_523| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1279| 1) |~prime|)) -(= (mod (* (* |_793| 1) (* |_524| 1)) |~prime|) (mod (* |_799| 1) |~prime|)) -(= (mod (* (* |_799| 1) (* |_525| 1)) |~prime|) (mod (* |_801| 1) |~prime|)) -(= (mod (* (* |_801| 1) (* |_526| 1)) |~prime|) (mod (* |_803| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_803| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_527| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1280| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_803| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_528| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1281| 1) |~prime|)) -(= (mod (* (* |_803| 1) (* |_529| 1)) |~prime|) (mod (* |_809| 1) |~prime|)) -(= (mod (* (* |_809| 1) (* |_530| 1)) |~prime|) (mod (* |_811| 1) |~prime|)) -(= (mod (* (* |_811| 1) (* |_531| 1)) |~prime|) (mod (* |_813| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_813| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_532| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1282| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_813| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_533| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1283| 1) |~prime|)) -(= (mod (* (* |_813| 1) (* |_534| 1)) |~prime|) (mod (* |_819| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_819| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_535| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1284| 1) |~prime|)) -(= (mod (* (* |_819| 1) (* |_536| 1)) |~prime|) (mod (* |_823| 1) |~prime|)) -(= (mod (* (* |_823| 1) (* |_537| 1)) |~prime|) (mod (* |_825| 1) |~prime|)) -(= (mod (* (* |_825| 1) (* |_538| 1)) |~prime|) (mod (* |_827| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_827| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_539| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1285| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_827| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_540| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1286| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_827| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_541| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1287| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_827| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_542| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1288| 1) |~prime|)) -(= (mod (* (* |_827| 1) (* |_543| 1)) |~prime|) (mod (* |_837| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_837| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_544| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1289| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_837| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_545| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1290| 1) |~prime|)) -(= (mod (* (* |_837| 1) (* |_546| 1)) |~prime|) (mod (* |_843| 1) |~prime|)) -(= (mod (* (* |_843| 1) (* |_547| 1)) |~prime|) (mod (* |_845| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_845| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_548| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1291| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_845| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_549| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1292| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_845| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_550| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1293| 1) |~prime|)) -(= (mod (* (* |_845| 1) (* |_551| 1)) |~prime|) (mod (* |_853| 1) |~prime|)) -(= (mod (* (* |_853| 1) (* |_552| 1)) |~prime|) (mod (* |_855| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_855| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_553| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1294| 1) |~prime|)) -(= (mod (* (* |_855| 1) (* |_554| 1)) |~prime|) (mod (* |_859| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_555| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1295| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_556| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1296| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_557| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1297| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_558| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1298| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_559| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1299| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_560| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1300| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_561| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1301| 1) |~prime|)) -(= (mod (* (* |_859| 1) (* |_562| 1)) |~prime|) (mod (* |_875| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_875| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_563| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1302| 1) |~prime|)) -(= (mod (* (* |_875| 1) (* |_564| 1)) |~prime|) (mod (* |_879| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_879| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_565| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1303| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_879| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_566| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1304| 1) |~prime|)) -(= (mod (* (* |_879| 1) (* |_567| 1)) |~prime|) (mod (* |_885| 1) |~prime|)) -(= (mod (* (* |_885| 1) (* |_568| 1)) |~prime|) (mod (* |_887| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_887| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_569| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1305| 1) |~prime|)) -(= (mod (* (* |_887| 1) (* |_570| 1)) |~prime|) (mod (* |_891| 1) |~prime|)) -(= (mod (* (* |_891| 1) (* |_571| 1)) |~prime|) (mod (* |_893| 1) |~prime|)) -(= (mod (* (* |_893| 1) (* |_572| 1)) |~prime|) (mod (* |_895| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_895| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_573| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1306| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_895| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_574| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1307| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_895| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_575| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1308| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_895| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_576| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1309| 1) |~prime|)) -(= (mod (* (* |_895| 1) (* |_577| 1)) |~prime|) (mod (* |_905| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_905| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_578| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1310| 1) |~prime|)) -(= (mod (* (* |_905| 1) (* |_579| 1)) |~prime|) (mod (* |_909| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_909| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_580| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1311| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_909| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_581| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1312| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_909| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_582| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1313| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_909| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_583| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1314| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_909| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_584| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1315| 1) |~prime|)) -(= (mod (* (* |_909| 1) (* |_585| 1)) |~prime|) (mod (* |_921| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_921| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_586| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1316| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_921| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_587| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1317| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_921| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_588| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1318| 1) |~prime|)) -(= (mod (* (* |_921| 1) (* |_589| 1)) |~prime|) (mod (* |_929| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_929| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_590| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1319| 1) |~prime|)) -(= (mod (* (* |_929| 1) (* |_591| 1)) |~prime|) (mod (* |_933| 1) |~prime|)) -(= (mod (* (* |_933| 1) (* |_592| 1)) |~prime|) (mod (* |_935| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_935| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_593| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1320| 1) |~prime|)) -(= (mod (* (* |_935| 1) (* |_594| 1)) |~prime|) (mod (* |_939| 1) |~prime|)) -(= (mod (* (* |_939| 1) (* |_595| 1)) |~prime|) (mod (* |_941| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_941| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_596| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1321| 1) |~prime|)) -(= (mod (* (* |_941| 1) (* |_597| 1)) |~prime|) (mod (* |_945| 1) |~prime|)) -(= (mod (* (* |_945| 1) (* |_598| 1)) |~prime|) (mod (* |_947| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_947| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_599| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1322| 1) |~prime|)) -(= (mod (* (* |_947| 1) (* |_600| 1)) |~prime|) (mod (* |_951| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_601| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1323| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_602| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1324| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_603| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1325| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_604| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1326| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_605| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1327| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_606| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1328| 1) |~prime|)) -(= (mod (* (* |_951| 1) (* |_607| 1)) |~prime|) (mod (* |_965| 1) |~prime|)) -(= (mod (* (* |_965| 1) (* |_608| 1)) |~prime|) (mod (* |_967| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_609| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1329| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_610| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1330| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_611| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1331| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_612| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1332| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_613| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1333| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_614| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1334| 1) |~prime|)) -(= (mod (* (* |_967| 1) (* |_615| 1)) |~prime|) (mod (* |_981| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_981| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_616| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1335| 1) |~prime|)) -(= (mod (* (* |_981| 1) (* |_617| 1)) |~prime|) (mod (* |_985| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_985| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_618| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1336| 1) |~prime|)) -(= (mod (* (* |_985| 1) (* |_619| 1)) |~prime|) (mod (* |_989| 1) |~prime|)) -(= (mod (* (* |_989| 1) (* |_620| 1)) |~prime|) (mod (* |_991| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_991| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_621| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1337| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_991| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_622| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1338| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_991| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_623| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1339| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_991| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_624| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1340| 1) |~prime|)) -(= (mod (* (* |_991| 1) (* |_625| 1)) |~prime|) (mod (* |_1001| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1001| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_626| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1341| 1) |~prime|)) -(= (mod (* (* |_1001| 1) (* |_627| 1)) |~prime|) (mod (* |_1005| 1) |~prime|)) -(= (mod (* (* |_1005| 1) (* |_628| 1)) |~prime|) (mod (* |_1007| 1) |~prime|)) -(= (mod (* (* |_1007| 1) (* |_629| 1)) |~prime|) (mod (* |_1009| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1009| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_630| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1342| 1) |~prime|)) -(= (mod (* (* |_1009| 1) (* |_631| 1)) |~prime|) (mod (* |_1013| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1013| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_632| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1343| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1013| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_633| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1344| 1) |~prime|)) -(= (mod (* (* |_1013| 1) (* |_634| 1)) |~prime|) (mod (* |_1019| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1019| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_635| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1345| 1) |~prime|)) -(= (mod (* (* |_1019| 1) (* |_636| 1)) |~prime|) (mod (* |_1023| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1023| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_637| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1346| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1023| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_638| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1347| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1023| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_639| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1348| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1023| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_640| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1349| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1023| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_641| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1350| 1) |~prime|)) -(= (mod (* (* |_1023| 1) (* |_642| 1)) |~prime|) (mod (* |_1035| 1) |~prime|)) -(= (mod (* (* |_1035| 1) (* |_643| 1)) |~prime|) (mod (* |_1037| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1037| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_644| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1351| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1037| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_645| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1352| 1) |~prime|)) -(= (mod (* (* |_1037| 1) (* |_646| 1)) |~prime|) (mod (* |_1043| 1) |~prime|)) -(= (mod (* (* |_1043| 1) (* |_647| 1)) |~prime|) (mod (* |_1045| 1) |~prime|)) -(= (mod (* (* |_1045| 1) (* |_648| 1)) |~prime|) (mod (* |_1047| 1) |~prime|)) -(= (mod (* (* |_1047| 1) (* |_649| 1)) |~prime|) (mod (* |_1049| 1) |~prime|)) -(= (mod (* (* |_1049| 1) (* |_650| 1)) |~prime|) (mod (* |_1051| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1051| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_651| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1353| 1) |~prime|)) -(= (mod (* (* |_1051| 1) (* |_652| 1)) |~prime|) (mod (* |_1055| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1055| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_653| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1354| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1055| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_654| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1355| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1055| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_655| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1356| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1055| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_656| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1357| 1) |~prime|)) -(= (mod (* (* |_1055| 1) (* |_657| 1)) |~prime|) (mod (* |_1065| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1065| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_658| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1358| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1065| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_659| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1359| 1) |~prime|)) -(= (mod (* (* |_1065| 1) (* |_660| 1)) |~prime|) (mod (* |_1071| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1071| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_661| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1360| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1071| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_662| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1361| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1071| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_663| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1362| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1071| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_664| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1363| 1) |~prime|)) -(= (mod (* (* |_1071| 1) (* |_665| 1)) |~prime|) (mod (* |_1081| 1) |~prime|)) -(= (mod (* (* |_1081| 1) (* |_666| 1)) |~prime|) (mod (* |_1083| 1) |~prime|)) -(= (mod (* (* |_1083| 1) (* |_667| 1)) |~prime|) (mod (* |_1085| 1) |~prime|)) -(= (mod (* (* |_1085| 1) (* |_668| 1)) |~prime|) (mod (* |_1087| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1087| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_669| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1364| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1087| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_670| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1365| 1) |~prime|)) -(= (mod (* (* |_1087| 1) (* |_671| 1)) |~prime|) (mod (* |_1093| 1) |~prime|)) -(= (mod (* (* |_1093| 1) (* |_672| 1)) |~prime|) (mod (* |_1095| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1095| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_673| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1366| 1) |~prime|)) -(= (mod (* (* |_1095| 1) (* |_674| 1)) |~prime|) (mod (* |_1099| 1) |~prime|)) -(= (mod (* (* |_1099| 1) (* |_675| 1)) |~prime|) (mod (* |_1101| 1) |~prime|)) -(= (mod (* (* |_1101| 1) (* |_676| 1)) |~prime|) (mod (* |_1103| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1103| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_677| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1367| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1103| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_678| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1368| 1) |~prime|)) -(= (mod (* (* |_1103| 1) (* |_679| 1)) |~prime|) (mod (* |_1109| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1109| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_680| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1369| 1) |~prime|)) -(= (mod (* (* |_1109| 1) (* |_681| 1)) |~prime|) (mod (* |_1113| 1) |~prime|)) -(= (mod (* (* |_1113| 1) (* |_682| 1)) |~prime|) (mod (* |_1115| 1) |~prime|)) -(= (mod (* (* |_1115| 1) (* |_683| 1)) |~prime|) (mod (* |_1117| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1117| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_684| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1370| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1117| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_685| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1371| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1117| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_686| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1372| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1117| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_687| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1373| 1) |~prime|)) -(= (mod (* (* |_1117| 1) (* |_688| 1)) |~prime|) (mod (* |_1127| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1127| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_689| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1374| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1127| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_690| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1375| 1) |~prime|)) -(= (mod (* (* |_1127| 1) (* |_691| 1)) |~prime|) (mod (* |_1133| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1133| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_692| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1376| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1133| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_693| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1377| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1133| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_694| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1378| 1) |~prime|)) -(= (mod (* (* |_1133| 1) (* |_695| 1)) |~prime|) (mod (* |_1141| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1141| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_696| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1379| 1) |~prime|)) -(= (mod (* (* |_1141| 1) (* |_697| 1)) |~prime|) (mod (* |_1145| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1145| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_698| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1380| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1145| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_699| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1381| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1145| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_700| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1382| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1145| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_701| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1383| 1) |~prime|)) -(= (mod (* (* |_1145| 1) (* |_702| 1)) |~prime|) (mod (* |_1155| 1) |~prime|)) -(= (mod (* (* |_1155| 1) (* |_703| 1)) |~prime|) (mod (* |_1157| 1) |~prime|)) -(= (mod (* (* |_1157| 1) (* |_704| 1)) |~prime|) (mod (* |_1159| 1) |~prime|)) -(= (mod (* (* |_1159| 1) (* |_705| 1)) |~prime|) (mod (* |_1161| 1) |~prime|)) -(= (mod (* (* |_1161| 1) (* |_706| 1)) |~prime|) (mod (* |_1163| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1163| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_707| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1384| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1163| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_708| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1385| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1163| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_709| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1386| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1163| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_710| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1387| 1) |~prime|)) -(= (mod (* (* |_1163| 1) (* |_711| 1)) |~prime|) (mod (* |_1173| 1) |~prime|)) -(= (mod (* (* |_1173| 1) (* |_712| 1)) |~prime|) (mod (* |_1175| 1) |~prime|)) -(= (mod (* (* |_1175| 1) (* |_713| 1)) |~prime|) (mod (* |_1177| 1) |~prime|)) -(= (mod (* (* |_1177| 1) (* |_714| 1)) |~prime|) (mod (* |_1179| 1) |~prime|)) -(= (mod (* (* |_1179| 1) (* |_715| 1)) |~prime|) (mod (* |_1181| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1181| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_716| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1388| 1) |~prime|)) -(= (mod (* (* |_1181| 1) (* |_717| 1)) |~prime|) (mod (* |_1185| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1185| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_718| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1389| 1) |~prime|)) -(= (mod (* (* |_1185| 1) (* |_719| 1)) |~prime|) (mod (* |_1189| 1) |~prime|)) -(= (mod (* (* |_1189| 1) (* |_720| 1)) |~prime|) (mod (* |_1191| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1191| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_721| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1390| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1191| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_722| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1391| 1) |~prime|)) -(= (mod (* (* |_1191| 1) (* |_723| 1)) |~prime|) (mod (* |_1197| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1197| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_724| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1392| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1197| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_725| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1393| 1) |~prime|)) -(= (mod (* (* |_1197| 1) (* |_726| 1)) |~prime|) (mod (* |_1203| 1) |~prime|)) -(= (mod (* (* |_1203| 1) (* |_727| 1)) |~prime|) (mod (* |_1205| 1) |~prime|)) -(= (mod (* (* |_1205| 1) (* |_728| 1)) |~prime|) (mod (* |_1207| 1) |~prime|)) -(= (mod (* (* |_1207| 1) (* |_729| 1)) |~prime|) (mod (* |_1209| 1) |~prime|)) -(= (mod (* (* |_1209| 1) (* |_730| 1)) |~prime|) (mod (* |_1211| 1) |~prime|)) -(= (mod (* (* |_1211| 1) (* |_731| 1)) |~prime|) (mod (* |_1213| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_732| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1394| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_733| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1395| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_734| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1396| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_735| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1397| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_736| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1398| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_737| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1399| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_738| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1400| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_739| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1401| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_740| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1402| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_741| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1403| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_742| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1404| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_743| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1405| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_744| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1406| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_745| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1407| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_746| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1408| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_747| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1409| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_748| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1410| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_749| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1411| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_750| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1412| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_751| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1413| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_752| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1414| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_753| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1415| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_754| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1416| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_755| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1417| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_756| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1418| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_757| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1419| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_758| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1420| 1) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 1) (* |_759| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod (* |_1421| 1) |~prime|)) -(= (mod (* (* |~one| 1) (+ (* |~one| 154) (* |_508| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_509| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_510| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_511| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_512| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_515| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_516| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_518| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_519| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_520| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_522| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_523| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_527| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_528| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_532| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_533| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_535| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_539| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_540| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_541| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_542| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_544| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_545| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_548| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_549| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_550| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_553| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_555| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_556| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_557| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_558| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_559| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_560| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_561| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_563| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_565| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_566| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_569| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_573| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_574| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_575| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_576| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_578| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_580| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_581| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_582| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_583| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_584| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_586| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_587| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_588| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_590| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_593| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_596| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_599| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_601| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_602| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_603| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_604| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_605| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_606| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_609| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_610| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_611| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_612| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_613| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_614| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_616| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_618| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_621| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_622| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_623| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_624| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_626| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_630| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_632| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_633| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_635| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_637| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_638| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_639| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_640| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_641| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_644| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_645| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_651| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_653| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_654| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_655| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_656| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_658| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_659| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_661| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_662| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_663| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_664| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_669| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_670| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_673| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_677| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_678| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_680| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_684| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_685| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_686| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_687| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_689| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_690| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_692| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_693| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_694| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_696| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_698| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_699| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_700| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_701| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_707| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_708| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_709| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_710| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_716| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_718| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_721| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_722| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_724| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_725| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_732| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_733| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_734| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_735| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_736| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_737| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_738| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_739| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_740| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_741| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_742| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_743| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_744| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_745| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_746| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_747| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_748| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_749| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_750| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_751| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_752| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_753| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_754| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_755| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_756| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_757| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_758| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_759| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_765| 21888242871839275222246405745257275088548364400416034343698204186575808495612) (* |_779| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_785| 21888242871839275222246405745257275088548364400416034343698204186575808495614) (* |_793| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_803| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_813| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_819| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_827| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_837| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_845| 21888242871839275222246405745257275088548364400416034343698204186575808495614) (* |_855| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_859| 21888242871839275222246405745257275088548364400416034343698204186575808495610) (* |_875| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_879| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_887| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_895| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_905| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_909| 21888242871839275222246405745257275088548364400416034343698204186575808495612) (* |_921| 21888242871839275222246405745257275088548364400416034343698204186575808495614) (* |_929| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_935| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_941| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_947| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_951| 21888242871839275222246405745257275088548364400416034343698204186575808495611) (* |_967| 21888242871839275222246405745257275088548364400416034343698204186575808495611) (* |_981| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_985| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_991| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_1001| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1009| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1013| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1019| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1023| 21888242871839275222246405745257275088548364400416034343698204186575808495612) (* |_1037| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1051| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1055| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_1065| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1071| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_1087| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1095| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1103| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1109| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1117| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_1127| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1133| 21888242871839275222246405745257275088548364400416034343698204186575808495614) (* |_1141| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1145| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_1163| 21888242871839275222246405745257275088548364400416034343698204186575808495613) (* |_1181| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1185| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1191| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1197| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1213| 21888242871839275222246405745257275088548364400416034343698204186575808495589) (* |_1268| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1269| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1270| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1271| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1272| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1273| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1274| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1275| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1276| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1277| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1278| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1279| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1280| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1281| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1282| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1283| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1284| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1285| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1286| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1287| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1288| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1289| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1290| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1291| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1292| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1293| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1294| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1295| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1296| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1297| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1298| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1299| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1300| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1301| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1302| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1303| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1304| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1305| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1306| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1307| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1308| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1309| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1310| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1311| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1312| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1313| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1314| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1315| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1316| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1317| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1318| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1319| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1320| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1321| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1322| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1323| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1324| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1325| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1326| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1327| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1328| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1329| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1330| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1331| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1332| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1333| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1334| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1335| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1336| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1337| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1338| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1339| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1340| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1341| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1342| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1343| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1344| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1345| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1346| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1347| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1348| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1349| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1350| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1351| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1352| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1353| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1354| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1355| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1356| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1357| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1358| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1359| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1360| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1361| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1362| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1363| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1364| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1365| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1366| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1367| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1368| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1369| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1370| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1371| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1372| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1373| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1374| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1375| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1376| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1377| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1378| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1379| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1380| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1381| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1382| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1383| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1384| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1385| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1386| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1387| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1388| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1389| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1390| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1391| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1392| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1393| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1394| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1395| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1396| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1397| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1398| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1399| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1400| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1401| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1402| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1403| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1404| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1405| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1406| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1407| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1408| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1409| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1410| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1411| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1412| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1413| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1414| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1415| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1416| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1417| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1418| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1419| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1420| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1421| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod 0 |~prime|)) -(= (mod (* (* |~one| 1) (+ (* |_506| 14474011154664524427946373126085988481658748083205070504932198000989141204992) (* |_507| 7237005577332262213973186563042994240829374041602535252466099000494570602496) (* |_508| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_509| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_510| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_511| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_512| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_513| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_514| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_515| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_516| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_517| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_518| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_519| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_520| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_521| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_522| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_523| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_524| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_525| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_526| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_527| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_528| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_529| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_530| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_531| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_532| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_533| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_534| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_535| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_536| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_537| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_538| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_539| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_540| 842498333348457493583344221469363458551160763204392890034487820288) (* |_541| 421249166674228746791672110734681729275580381602196445017243910144) (* |_542| 210624583337114373395836055367340864637790190801098222508621955072) (* |_543| 105312291668557186697918027683670432318895095400549111254310977536) (* |_544| 52656145834278593348959013841835216159447547700274555627155488768) (* |_545| 26328072917139296674479506920917608079723773850137277813577744384) (* |_546| 13164036458569648337239753460458804039861886925068638906788872192) (* |_547| 6582018229284824168619876730229402019930943462534319453394436096) (* |_548| 3291009114642412084309938365114701009965471731267159726697218048) (* |_549| 1645504557321206042154969182557350504982735865633579863348609024) (* |_550| 822752278660603021077484591278675252491367932816789931674304512) (* |_551| 411376139330301510538742295639337626245683966408394965837152256) (* |_552| 205688069665150755269371147819668813122841983204197482918576128) (* |_553| 102844034832575377634685573909834406561420991602098741459288064) (* |_554| 51422017416287688817342786954917203280710495801049370729644032) (* |_555| 25711008708143844408671393477458601640355247900524685364822016) (* |_556| 12855504354071922204335696738729300820177623950262342682411008) (* |_557| 6427752177035961102167848369364650410088811975131171341205504) (* |_558| 3213876088517980551083924184682325205044405987565585670602752) (* |_559| 1606938044258990275541962092341162602522202993782792835301376) (* |_560| 803469022129495137770981046170581301261101496891396417650688) (* |_561| 401734511064747568885490523085290650630550748445698208825344) (* |_562| 200867255532373784442745261542645325315275374222849104412672) (* |_563| 100433627766186892221372630771322662657637687111424552206336) (* |_564| 50216813883093446110686315385661331328818843555712276103168) (* |_565| 25108406941546723055343157692830665664409421777856138051584) (* |_566| 12554203470773361527671578846415332832204710888928069025792) (* |_567| 6277101735386680763835789423207666416102355444464034512896) (* |_568| 3138550867693340381917894711603833208051177722232017256448) (* |_569| 1569275433846670190958947355801916604025588861116008628224) (* |_570| 784637716923335095479473677900958302012794430558004314112) (* |_571| 392318858461667547739736838950479151006397215279002157056) (* |_572| 196159429230833773869868419475239575503198607639501078528) (* |_573| 98079714615416886934934209737619787751599303819750539264) (* |_574| 49039857307708443467467104868809893875799651909875269632) (* |_575| 24519928653854221733733552434404946937899825954937634816) (* |_576| 12259964326927110866866776217202473468949912977468817408) (* |_577| 6129982163463555433433388108601236734474956488734408704) (* |_578| 3064991081731777716716694054300618367237478244367204352) (* |_579| 1532495540865888858358347027150309183618739122183602176) (* |_580| 766247770432944429179173513575154591809369561091801088) (* |_581| 383123885216472214589586756787577295904684780545900544) (* |_582| 191561942608236107294793378393788647952342390272950272) (* |_583| 95780971304118053647396689196894323976171195136475136) (* |_584| 47890485652059026823698344598447161988085597568237568) (* |_585| 23945242826029513411849172299223580994042798784118784) (* |_586| 11972621413014756705924586149611790497021399392059392) (* |_587| 5986310706507378352962293074805895248510699696029696) (* |_588| 2993155353253689176481146537402947624255349848014848) (* |_589| 1496577676626844588240573268701473812127674924007424) (* |_590| 748288838313422294120286634350736906063837462003712) (* |_591| 374144419156711147060143317175368453031918731001856) (* |_592| 187072209578355573530071658587684226515959365500928) (* |_593| 93536104789177786765035829293842113257979682750464) (* |_594| 46768052394588893382517914646921056628989841375232) (* |_595| 23384026197294446691258957323460528314494920687616) (* |_596| 11692013098647223345629478661730264157247460343808) (* |_597| 5846006549323611672814739330865132078623730171904) (* |_598| 2923003274661805836407369665432566039311865085952) (* |_599| 1461501637330902918203684832716283019655932542976) (* |_600| 730750818665451459101842416358141509827966271488) (* |_601| 365375409332725729550921208179070754913983135744) (* |_602| 182687704666362864775460604089535377456991567872) (* |_603| 91343852333181432387730302044767688728495783936) (* |_604| 45671926166590716193865151022383844364247891968) (* |_605| 22835963083295358096932575511191922182123945984) (* |_606| 11417981541647679048466287755595961091061972992) (* |_607| 5708990770823839524233143877797980545530986496) (* |_608| 2854495385411919762116571938898990272765493248) (* |_609| 1427247692705959881058285969449495136382746624) (* |_610| 713623846352979940529142984724747568191373312) (* |_611| 356811923176489970264571492362373784095686656) (* |_612| 178405961588244985132285746181186892047843328) (* |_613| 89202980794122492566142873090593446023921664) (* |_614| 44601490397061246283071436545296723011960832) (* |_615| 22300745198530623141535718272648361505980416) (* |_616| 11150372599265311570767859136324180752990208) (* |_617| 5575186299632655785383929568162090376495104) (* |_618| 2787593149816327892691964784081045188247552) (* |_619| 1393796574908163946345982392040522594123776) (* |_620| 696898287454081973172991196020261297061888) (* |_621| 348449143727040986586495598010130648530944) (* |_622| 174224571863520493293247799005065324265472) (* |_623| 87112285931760246646623899502532662132736) (* |_624| 43556142965880123323311949751266331066368) (* |_625| 21778071482940061661655974875633165533184) (* |_626| 10889035741470030830827987437816582766592) (* |_627| 5444517870735015415413993718908291383296) (* |_628| 2722258935367507707706996859454145691648) (* |_629| 1361129467683753853853498429727072845824) (* |_630| 680564733841876926926749214863536422912) (* |_631| 340282366920938463463374607431768211456) (* |_632| 170141183460469231731687303715884105728) (* |_633| 85070591730234615865843651857942052864) (* |_634| 42535295865117307932921825928971026432) (* |_635| 21267647932558653966460912964485513216) (* |_636| 10633823966279326983230456482242756608) (* |_637| 5316911983139663491615228241121378304) (* |_638| 2658455991569831745807614120560689152) (* |_639| 1329227995784915872903807060280344576) (* |_640| 664613997892457936451903530140172288) (* |_641| 332306998946228968225951765070086144) (* |_642| 166153499473114484112975882535043072) (* |_643| 83076749736557242056487941267521536) (* |_644| 41538374868278621028243970633760768) (* |_645| 20769187434139310514121985316880384) (* |_646| 10384593717069655257060992658440192) (* |_647| 5192296858534827628530496329220096) (* |_648| 2596148429267413814265248164610048) (* |_649| 1298074214633706907132624082305024) (* |_650| 649037107316853453566312041152512) (* |_651| 324518553658426726783156020576256) (* |_652| 162259276829213363391578010288128) (* |_653| 81129638414606681695789005144064) (* |_654| 40564819207303340847894502572032) (* |_655| 20282409603651670423947251286016) (* |_656| 10141204801825835211973625643008) (* |_657| 5070602400912917605986812821504) (* |_658| 2535301200456458802993406410752) (* |_659| 1267650600228229401496703205376) (* |_660| 633825300114114700748351602688) (* |_661| 316912650057057350374175801344) (* |_662| 158456325028528675187087900672) (* |_663| 79228162514264337593543950336) (* |_664| 39614081257132168796771975168) (* |_665| 19807040628566084398385987584) (* |_666| 9903520314283042199192993792) (* |_667| 4951760157141521099596496896) (* |_668| 2475880078570760549798248448) (* |_669| 1237940039285380274899124224) (* |_670| 618970019642690137449562112) (* |_671| 309485009821345068724781056) (* |_672| 154742504910672534362390528) (* |_673| 77371252455336267181195264) (* |_674| 38685626227668133590597632) (* |_675| 19342813113834066795298816) (* |_676| 9671406556917033397649408) (* |_677| 4835703278458516698824704) (* |_678| 2417851639229258349412352) (* |_679| 1208925819614629174706176) (* |_680| 604462909807314587353088) (* |_681| 302231454903657293676544) (* |_682| 151115727451828646838272) (* |_683| 75557863725914323419136) (* |_684| 37778931862957161709568) (* |_685| 18889465931478580854784) (* |_686| 9444732965739290427392) (* |_687| 4722366482869645213696) (* |_688| 2361183241434822606848) (* |_689| 1180591620717411303424) (* |_690| 590295810358705651712) (* |_691| 295147905179352825856) (* |_692| 147573952589676412928) (* |_693| 73786976294838206464) (* |_694| 36893488147419103232) (* |_695| 18446744073709551616) (* |_696| 9223372036854775808) (* |_697| 4611686018427387904) (* |_698| 2305843009213693952) (* |_699| 1152921504606846976) (* |_700| 576460752303423488) (* |_701| 288230376151711744) (* |_702| 144115188075855872) (* |_703| 72057594037927936) (* |_704| 36028797018963968) (* |_705| 18014398509481984) (* |_706| 9007199254740992) (* |_707| 4503599627370496) (* |_708| 2251799813685248) (* |_709| 1125899906842624) (* |_710| 562949953421312) (* |_711| 281474976710656) (* |_712| 140737488355328) (* |_713| 70368744177664) (* |_714| 35184372088832) (* |_715| 17592186044416) (* |_716| 8796093022208) (* |_717| 4398046511104) (* |_718| 2199023255552) (* |_719| 1099511627776) (* |_720| 549755813888) (* |_721| 274877906944) (* |_722| 137438953472) (* |_723| 68719476736) (* |_724| 34359738368) (* |_725| 17179869184) (* |_726| 8589934592) (* |_727| 4294967296) (* |_728| 2147483648) (* |_729| 1073741824) (* |_730| 536870912) (* |_731| 268435456) (* |_732| 134217728) (* |_733| 67108864) (* |_734| 33554432) (* |_735| 16777216) (* |_736| 8388608) (* |_737| 4194304) (* |_738| 2097152) (* |_739| 1048576) (* |_740| 524288) (* |_741| 262144) (* |_742| 131072) (* |_743| 65536) (* |_744| 32768) (* |_745| 16384) (* |_746| 8192) (* |_747| 4096) (* |_748| 2048) (* |_749| 1024) (* |_750| 512) (* |_751| 256) (* |_752| 128) (* |_753| 64) (* |_754| 32) (* |_755| 16) (* |_756| 8) (* |_757| 4) (* |_758| 2) (* |_759| 1))) |~prime|) (mod (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495615) (* |_1| 2)) |~prime|)) -(= (mod (* (+ (* |~one| 1) (* |_759| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1))) |~prime|) (mod (* |_1426| 1) |~prime|)) -(= (mod (* (* |~one| 1) (* |_1426| 1)) |~prime|) (mod (* |~out_0| 1) |~prime|)) +(= (mod (* (* |~one| 1) (+ (* |_2| 7237005577332262213973186563042994240829374041602535252466099000494570602496) (* |_3| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_4| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_5| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_6| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_7| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_8| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_9| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_10| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_11| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_12| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_13| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_14| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_15| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_16| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_17| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_18| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_19| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_20| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_21| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_22| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_23| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_24| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_25| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_26| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_27| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_28| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_29| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_30| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_31| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_32| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_33| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_34| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_35| 842498333348457493583344221469363458551160763204392890034487820288) (* |_36| 421249166674228746791672110734681729275580381602196445017243910144) (* |_37| 210624583337114373395836055367340864637790190801098222508621955072) (* |_38| 105312291668557186697918027683670432318895095400549111254310977536) (* |_39| 52656145834278593348959013841835216159447547700274555627155488768) (* |_40| 26328072917139296674479506920917608079723773850137277813577744384) (* |_41| 13164036458569648337239753460458804039861886925068638906788872192) (* |_42| 6582018229284824168619876730229402019930943462534319453394436096) (* |_43| 3291009114642412084309938365114701009965471731267159726697218048) (* |_44| 1645504557321206042154969182557350504982735865633579863348609024) (* |_45| 822752278660603021077484591278675252491367932816789931674304512) (* |_46| 411376139330301510538742295639337626245683966408394965837152256) (* |_47| 205688069665150755269371147819668813122841983204197482918576128) (* |_48| 102844034832575377634685573909834406561420991602098741459288064) (* |_49| 51422017416287688817342786954917203280710495801049370729644032) (* |_50| 25711008708143844408671393477458601640355247900524685364822016) (* |_51| 12855504354071922204335696738729300820177623950262342682411008) (* |_52| 6427752177035961102167848369364650410088811975131171341205504) (* |_53| 3213876088517980551083924184682325205044405987565585670602752) (* |_54| 1606938044258990275541962092341162602522202993782792835301376) (* |_55| 803469022129495137770981046170581301261101496891396417650688) (* |_56| 401734511064747568885490523085290650630550748445698208825344) (* |_57| 200867255532373784442745261542645325315275374222849104412672) (* |_58| 100433627766186892221372630771322662657637687111424552206336) (* |_59| 50216813883093446110686315385661331328818843555712276103168) (* |_60| 25108406941546723055343157692830665664409421777856138051584) (* |_61| 12554203470773361527671578846415332832204710888928069025792) (* |_62| 6277101735386680763835789423207666416102355444464034512896) (* |_63| 3138550867693340381917894711603833208051177722232017256448) (* |_64| 1569275433846670190958947355801916604025588861116008628224) (* |_65| 784637716923335095479473677900958302012794430558004314112) (* |_66| 392318858461667547739736838950479151006397215279002157056) (* |_67| 196159429230833773869868419475239575503198607639501078528) (* |_68| 98079714615416886934934209737619787751599303819750539264) (* |_69| 49039857307708443467467104868809893875799651909875269632) (* |_70| 24519928653854221733733552434404946937899825954937634816) (* |_71| 12259964326927110866866776217202473468949912977468817408) (* |_72| 6129982163463555433433388108601236734474956488734408704) (* |_73| 3064991081731777716716694054300618367237478244367204352) (* |_74| 1532495540865888858358347027150309183618739122183602176) (* |_75| 766247770432944429179173513575154591809369561091801088) (* |_76| 383123885216472214589586756787577295904684780545900544) (* |_77| 191561942608236107294793378393788647952342390272950272) (* |_78| 95780971304118053647396689196894323976171195136475136) (* |_79| 47890485652059026823698344598447161988085597568237568) (* |_80| 23945242826029513411849172299223580994042798784118784) (* |_81| 11972621413014756705924586149611790497021399392059392) (* |_82| 5986310706507378352962293074805895248510699696029696) (* |_83| 2993155353253689176481146537402947624255349848014848) (* |_84| 1496577676626844588240573268701473812127674924007424) (* |_85| 748288838313422294120286634350736906063837462003712) (* |_86| 374144419156711147060143317175368453031918731001856) (* |_87| 187072209578355573530071658587684226515959365500928) (* |_88| 93536104789177786765035829293842113257979682750464) (* |_89| 46768052394588893382517914646921056628989841375232) (* |_90| 23384026197294446691258957323460528314494920687616) (* |_91| 11692013098647223345629478661730264157247460343808) (* |_92| 5846006549323611672814739330865132078623730171904) (* |_93| 2923003274661805836407369665432566039311865085952) (* |_94| 1461501637330902918203684832716283019655932542976) (* |_95| 730750818665451459101842416358141509827966271488) (* |_96| 365375409332725729550921208179070754913983135744) (* |_97| 182687704666362864775460604089535377456991567872) (* |_98| 91343852333181432387730302044767688728495783936) (* |_99| 45671926166590716193865151022383844364247891968) (* |_100| 22835963083295358096932575511191922182123945984) (* |_101| 11417981541647679048466287755595961091061972992) (* |_102| 5708990770823839524233143877797980545530986496) (* |_103| 2854495385411919762116571938898990272765493248) (* |_104| 1427247692705959881058285969449495136382746624) (* |_105| 713623846352979940529142984724747568191373312) (* |_106| 356811923176489970264571492362373784095686656) (* |_107| 178405961588244985132285746181186892047843328) (* |_108| 89202980794122492566142873090593446023921664) (* |_109| 44601490397061246283071436545296723011960832) (* |_110| 22300745198530623141535718272648361505980416) (* |_111| 11150372599265311570767859136324180752990208) (* |_112| 5575186299632655785383929568162090376495104) (* |_113| 2787593149816327892691964784081045188247552) (* |_114| 1393796574908163946345982392040522594123776) (* |_115| 696898287454081973172991196020261297061888) (* |_116| 348449143727040986586495598010130648530944) (* |_117| 174224571863520493293247799005065324265472) (* |_118| 87112285931760246646623899502532662132736) (* |_119| 43556142965880123323311949751266331066368) (* |_120| 21778071482940061661655974875633165533184) (* |_121| 10889035741470030830827987437816582766592) (* |_122| 5444517870735015415413993718908291383296) (* |_123| 2722258935367507707706996859454145691648) (* |_124| 1361129467683753853853498429727072845824) (* |_125| 680564733841876926926749214863536422912) (* |_126| 340282366920938463463374607431768211456) (* |_127| 170141183460469231731687303715884105728) (* |_128| 85070591730234615865843651857942052864) (* |_129| 42535295865117307932921825928971026432) (* |_130| 21267647932558653966460912964485513216) (* |_131| 10633823966279326983230456482242756608) (* |_132| 5316911983139663491615228241121378304) (* |_133| 2658455991569831745807614120560689152) (* |_134| 1329227995784915872903807060280344576) (* |_135| 664613997892457936451903530140172288) (* |_136| 332306998946228968225951765070086144) (* |_137| 166153499473114484112975882535043072) (* |_138| 83076749736557242056487941267521536) (* |_139| 41538374868278621028243970633760768) (* |_140| 20769187434139310514121985316880384) (* |_141| 10384593717069655257060992658440192) (* |_142| 5192296858534827628530496329220096) (* |_143| 2596148429267413814265248164610048) (* |_144| 1298074214633706907132624082305024) (* |_145| 649037107316853453566312041152512) (* |_146| 324518553658426726783156020576256) (* |_147| 162259276829213363391578010288128) (* |_148| 81129638414606681695789005144064) (* |_149| 40564819207303340847894502572032) (* |_150| 20282409603651670423947251286016) (* |_151| 10141204801825835211973625643008) (* |_152| 5070602400912917605986812821504) (* |_153| 2535301200456458802993406410752) (* |_154| 1267650600228229401496703205376) (* |_155| 633825300114114700748351602688) (* |_156| 316912650057057350374175801344) (* |_157| 158456325028528675187087900672) (* |_158| 79228162514264337593543950336) (* |_159| 39614081257132168796771975168) (* |_160| 19807040628566084398385987584) (* |_161| 9903520314283042199192993792) (* |_162| 4951760157141521099596496896) (* |_163| 2475880078570760549798248448) (* |_164| 1237940039285380274899124224) (* |_165| 618970019642690137449562112) (* |_166| 309485009821345068724781056) (* |_167| 154742504910672534362390528) (* |_168| 77371252455336267181195264) (* |_169| 38685626227668133590597632) (* |_170| 19342813113834066795298816) (* |_171| 9671406556917033397649408) (* |_172| 4835703278458516698824704) (* |_173| 2417851639229258349412352) (* |_174| 1208925819614629174706176) (* |_175| 604462909807314587353088) (* |_176| 302231454903657293676544) (* |_177| 151115727451828646838272) (* |_178| 75557863725914323419136) (* |_179| 37778931862957161709568) (* |_180| 18889465931478580854784) (* |_181| 9444732965739290427392) (* |_182| 4722366482869645213696) (* |_183| 2361183241434822606848) (* |_184| 1180591620717411303424) (* |_185| 590295810358705651712) (* |_186| 295147905179352825856) (* |_187| 147573952589676412928) (* |_188| 73786976294838206464) (* |_189| 36893488147419103232) (* |_190| 18446744073709551616) (* |_191| 9223372036854775808) (* |_192| 4611686018427387904) (* |_193| 2305843009213693952) (* |_194| 1152921504606846976) (* |_195| 576460752303423488) (* |_196| 288230376151711744) (* |_197| 144115188075855872) (* |_198| 72057594037927936) (* |_199| 36028797018963968) (* |_200| 18014398509481984) (* |_201| 9007199254740992) (* |_202| 4503599627370496) (* |_203| 2251799813685248) (* |_204| 1125899906842624) (* |_205| 562949953421312) (* |_206| 281474976710656) (* |_207| 140737488355328) (* |_208| 70368744177664) (* |_209| 35184372088832) (* |_210| 17592186044416) (* |_211| 8796093022208) (* |_212| 4398046511104) (* |_213| 2199023255552) (* |_214| 1099511627776) (* |_215| 549755813888) (* |_216| 274877906944) (* |_217| 137438953472) (* |_218| 68719476736) (* |_219| 34359738368) (* |_220| 17179869184) (* |_221| 8589934592) (* |_222| 4294967296) (* |_223| 2147483648) (* |_224| 1073741824) (* |_225| 536870912) (* |_226| 268435456) (* |_227| 134217728) (* |_228| 67108864) (* |_229| 33554432) (* |_230| 16777216) (* |_231| 8388608) (* |_232| 4194304) (* |_233| 2097152) (* |_234| 1048576) (* |_235| 524288) (* |_236| 262144) (* |_237| 131072) (* |_238| 65536) (* |_239| 32768) (* |_240| 16384) (* |_241| 8192) (* |_242| 4096) (* |_243| 2048) (* |_244| 1024) (* |_245| 512) (* |_246| 256) (* |_247| 128) (* |_248| 64) (* |_249| 32) (* |_250| 16) (* |_251| 8) (* |_252| 4) (* |_253| 2) (* |_254| 1))) |~prime|) (mod (+ (* |~one| 7237005577332262213973186563042994240829374041602535252466099000494570602496) (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1)) |~prime|)) +(= (mod (* (* |_2| 1) (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1))) |~prime|) (mod (* |_259| 1) |~prime|)) +(= (mod (* (* |~one| 1) (* |_259| 1)) |~prime|) (mod (* |~out_0| 1) |~prime|)) )) \ No newline at end of file From c3288b93c59a9e19e0fb99e50ca37d01b49eaa11 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 13 Oct 2021 19:03:06 +0200 Subject: [PATCH 73/83] fix tests --- zokrates_core_test/tests/tests/assert_one.json | 2 +- .../tests/panics/conditional_bound_throw_no_isolation.json | 6 +++--- .../tests/tests/panics/deep_branch_no_isolation.json | 2 +- zokrates_core_test/tests/tests/panics/loop_bound.json | 2 +- zokrates_core_test/tests/tests/panics/panic_isolation.json | 2 +- .../tests/tests/panics/panic_no_isolation.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zokrates_core_test/tests/tests/assert_one.json b/zokrates_core_test/tests/tests/assert_one.json index 7791e6bb8..ef7fd1da1 100644 --- a/zokrates_core_test/tests/tests/assert_one.json +++ b/zokrates_core_test/tests/tests/assert_one.json @@ -12,7 +12,7 @@ "left": "0", "right": "1", "error": { - "Source": "Assertion failed at ./tests/tests/assert_one.zok:2:2" + "SourceAssertion": "Assertion failed at ./tests/tests/assert_one.zok:2:2" } } } diff --git a/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json b/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json index 4402beb1f..a709d9168 100644 --- a/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/conditional_bound_throw_no_isolation.json @@ -14,7 +14,7 @@ "left": "0", "right": "1", "error": { - "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" } } } @@ -32,7 +32,7 @@ "left": "1", "right": "0", "error": { - "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" } } } @@ -50,7 +50,7 @@ "left": "2", "right": "0", "error": { - "Source": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/conditional_bound_throw.zok:2:5" } } } diff --git a/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json b/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json index d89b6a1df..51a747613 100644 --- a/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/deep_branch_no_isolation.json @@ -14,7 +14,7 @@ "left": "0", "right": "1", "error": { - "Source": "Assertion failed at ./tests/tests/panics/deep_branch.zok:2:5" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/deep_branch.zok:2:5" } } } diff --git a/zokrates_core_test/tests/tests/panics/loop_bound.json b/zokrates_core_test/tests/tests/panics/loop_bound.json index a3599f3ba..2891415ef 100644 --- a/zokrates_core_test/tests/tests/panics/loop_bound.json +++ b/zokrates_core_test/tests/tests/panics/loop_bound.json @@ -14,7 +14,7 @@ "left": "0", "right": "1", "error": { - "Source": "Assertion failed at ./tests/tests/panics/loop_bound.zok:2:3" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/loop_bound.zok:2:3" } } } diff --git a/zokrates_core_test/tests/tests/panics/panic_isolation.json b/zokrates_core_test/tests/tests/panics/panic_isolation.json index 703b0deaa..573da7005 100644 --- a/zokrates_core_test/tests/tests/panics/panic_isolation.json +++ b/zokrates_core_test/tests/tests/panics/panic_isolation.json @@ -21,7 +21,7 @@ "left": "1", "right": "21888242871839275222246405745257275088548364400416034343698204186575808495577", "error": { - "Source": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:18:5" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:18:5" } } } diff --git a/zokrates_core_test/tests/tests/panics/panic_no_isolation.json b/zokrates_core_test/tests/tests/panics/panic_no_isolation.json index f2b562e80..c0a9bab0e 100644 --- a/zokrates_core_test/tests/tests/panics/panic_no_isolation.json +++ b/zokrates_core_test/tests/tests/panics/panic_no_isolation.json @@ -21,7 +21,7 @@ "left": "1", "right": "0", "error": { - "Source": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:14:5" + "SourceAssertion": "Assertion failed at ./tests/tests/panics/panic_isolation.zok:14:5" } } } From f98585b7844fbdf48d5223c4cbaae6c7ce3381e5 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 15 Oct 2021 13:00:48 +0300 Subject: [PATCH 74/83] revert to original impl, add symetric check, add logs --- .../runtime_errors/lt_overflow_max_plus_1.zok | 4 ++-- .../lt_overflow_max_plus_1_sym.zok | 11 +++++++++++ zokrates_core/src/compile.rs | 3 +++ zokrates_core/src/flat_absy/mod.rs | 2 ++ zokrates_core/src/flatten/mod.rs | 15 +++++++++++++++ zokrates_core/src/optimizer/mod.rs | 8 ++++---- .../tests/tests/compare_min_to_max.json | 16 ++++++++++++++++ .../tests/tests/compare_min_to_max.zok | 2 +- 8 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1_sym.zok create mode 100644 zokrates_core_test/tests/tests/compare_min_to_max.json rename zokrates_cli/examples/runtime_errors/lt_overflow_p_minus_one.zok => zokrates_core_test/tests/tests/compare_min_to_max.zok (76%) diff --git a/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1.zok b/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1.zok index 5011c2112..4cc497c73 100644 --- a/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1.zok +++ b/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1.zok @@ -1,6 +1,6 @@ from "field" import FIELD_SIZE_IN_BITS -// we can compare numbers up to 2^(pbits - 2) - 1, ie any number which fits in (pbits - 2) bits +// we can compare numbers whose difference fits in (pbits - 2) bits // It should not work for the maxvalue = 2^(pbits - 2) - 1 augmented by one // /!\ should be called with a = 0 @@ -8,4 +8,4 @@ def main(field a) -> bool: u32 pbits = FIELD_SIZE_IN_BITS // we added a = 0 to prevent the condition to be evaluated at compile time field maxvalue = a + (2**(pbits - 2) - 1) - return a < (maxvalue + 1) \ No newline at end of file + return a < maxvalue + 1 \ No newline at end of file diff --git a/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1_sym.zok b/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1_sym.zok new file mode 100644 index 000000000..fb6e71c56 --- /dev/null +++ b/zokrates_cli/examples/runtime_errors/lt_overflow_max_plus_1_sym.zok @@ -0,0 +1,11 @@ +from "field" import FIELD_SIZE_IN_BITS + +// we can compare numbers whose difference fits in (pbits - 2) bits +// It should not work for the maxvalue = 2^(pbits - 2) - 1 augmented by one +// /!\ should be called with a = 0 + +def main(field a) -> bool: + u32 pbits = FIELD_SIZE_IN_BITS + // we added a = 0 to prevent the condition to be evaluated at compile time + field maxvalue = a + (2**(pbits - 2) - 1) + return maxvalue + 1 < a \ No newline at end of file diff --git a/zokrates_core/src/compile.rs b/zokrates_core/src/compile.rs index 86a9943e9..9dff8fe42 100644 --- a/zokrates_core/src/compile.rs +++ b/zokrates_core/src/compile.rs @@ -196,14 +196,17 @@ pub fn compile>( // flatten input program log::debug!("Flatten"); let program_flattened = Flattener::flatten(typed_ast, config); + log::trace!("\n{}", program_flattened); // constant propagation after call resolution log::debug!("Propagate flat program"); let program_flattened = program_flattened.propagate(); + log::trace!("\n{}", program_flattened); // convert to ir log::debug!("Convert to IR"); let ir_prog = ir::Prog::from(program_flattened); + log::trace!("\n{}", ir_prog); // optimize log::debug!("Optimise IR"); diff --git a/zokrates_core/src/flat_absy/mod.rs b/zokrates_core/src/flat_absy/mod.rs index 9da11f490..f5338bb02 100644 --- a/zokrates_core/src/flat_absy/mod.rs +++ b/zokrates_core/src/flat_absy/mod.rs @@ -37,6 +37,7 @@ pub enum RuntimeError { LtSum, LtFinalBitness, LtFinalSum, + LtSymetric, Or, Xor, Inverse, @@ -81,6 +82,7 @@ impl fmt::Display for RuntimeError { LtSum => "Sum check failed in Lt check", LtFinalBitness => "Bitness check failed in final Lt check", LtFinalSum => "Sum check failed in final Lt check", + LtSymetric => "Symetrical check failed in Lt check", Or => "Or check failed", Xor => "Xor check failed", Inverse => "Division by zero", diff --git a/zokrates_core/src/flatten/mod.rs b/zokrates_core/src/flatten/mod.rs index 4f65518d8..39c2a6c44 100644 --- a/zokrates_core/src/flatten/mod.rs +++ b/zokrates_core/src/flatten/mod.rs @@ -706,6 +706,21 @@ impl<'ast, T: Field> Flattener<'ast, T> { RuntimeError::LtFinalSum, )); + // to make this check symetric, we ban the value `a - b == -2**N`, as the value `a - b == 2**N` is already banned + let fail = self.eq_check( + statements_flattened, + FlatExpression::Sub( + box FlatExpression::Identifier(rhs_id), + box FlatExpression::Identifier(lhs_id), + ), + FlatExpression::Number(T::from(2).pow(bit_width)), + ); + statements_flattened.push(FlatStatement::Condition( + fail, + FlatExpression::Number(T::from(0)), + RuntimeError::LtSymetric, + )); + FlatExpression::Sub( box FlatExpression::Number(T::one()), box FlatExpression::Identifier(shifted_sub_bits_be[0]), diff --git a/zokrates_core/src/optimizer/mod.rs b/zokrates_core/src/optimizer/mod.rs index 3f2c064a8..e99c7444d 100644 --- a/zokrates_core/src/optimizer/mod.rs +++ b/zokrates_core/src/optimizer/mod.rs @@ -24,25 +24,25 @@ impl Prog { log::debug!("Constraints: {}", self.constraint_count()); log::debug!("Optimizer: Remove redefinitions"); let r = RedefinitionOptimizer::optimize(self); - log::debug!("Done"); + log::trace!("\n{}\n", r); // remove constraints that are always satisfied log::debug!("Constraints: {}", r.constraint_count()); log::debug!("Optimizer: Remove tautologies"); let r = TautologyOptimizer::optimize(r); - log::debug!("Done"); + log::trace!("\n{}\n", r); // deduplicate directives which take the same input log::debug!("Constraints: {}", r.constraint_count()); log::debug!("Optimizer: Remove duplicate directive"); let r = DirectiveOptimizer::optimize(r); - log::debug!("Done"); + log::trace!("\n{}\n", r); // remove duplicate constraints log::debug!("Constraints: {}", r.constraint_count()); log::debug!("Optimizer: Remove duplicate constraints"); let r = DuplicateOptimizer::optimize(r); - log::debug!("Done"); + log::trace!("\n{}\n", r); log::debug!("Constraints: {}", r.constraint_count()); r diff --git a/zokrates_core_test/tests/tests/compare_min_to_max.json b/zokrates_core_test/tests/tests/compare_min_to_max.json new file mode 100644 index 000000000..8f8264d77 --- /dev/null +++ b/zokrates_core_test/tests/tests/compare_min_to_max.json @@ -0,0 +1,16 @@ +{ + "entry_point": "./tests/tests/compare_min_to_max.zok", + "curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"], + "tests": [ + { + "input": { + "values": ["0"] + }, + "output": { + "Ok": { + "values": ["0"] + } + } + } + ] +} diff --git a/zokrates_cli/examples/runtime_errors/lt_overflow_p_minus_one.zok b/zokrates_core_test/tests/tests/compare_min_to_max.zok similarity index 76% rename from zokrates_cli/examples/runtime_errors/lt_overflow_p_minus_one.zok rename to zokrates_core_test/tests/tests/compare_min_to_max.zok index 6703cecc4..11500061f 100644 --- a/zokrates_cli/examples/runtime_errors/lt_overflow_p_minus_one.zok +++ b/zokrates_core_test/tests/tests/compare_min_to_max.zok @@ -1,7 +1,7 @@ from "field" import FIELD_MAX -// as p - 1 is greater than p/2, comparing to it should fail // /!\ should be called with a = 0 +// as `|a - FIELD_MAX| < 2**(N-2)` the comparison should succeed def main(field a) -> bool: field p = FIELD_MAX + a From b73de66e8770dff4abe5376ea3103f27a6033452 Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 15 Oct 2021 13:20:31 +0300 Subject: [PATCH 75/83] adjust book --- zokrates_book/src/language/operators.md | 33 +++++++++++++------------ 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/zokrates_book/src/language/operators.md b/zokrates_book/src/language/operators.md index b82d59b78..362f514fe 100644 --- a/zokrates_book/src/language/operators.md +++ b/zokrates_book/src/language/operators.md @@ -2,24 +2,25 @@ The following table lists the precedence and associativity of all operators. Operators are listed top to bottom, in ascending precedence. Operators in the same cell have the same precedence. Operators are binary, unless the syntax is provided. -| Operator | Description | `field` | `u8/u16` `u32/u64` | `bool` | Associativity | Remarks | -|----------------------------|------------------------------------------------------------|------------------------------|-------------------------------|-----------------------------|---------------|---------| -| `**`
| Power | ✓ |   |   | Left | [^1] | -| `+x`
`-x`
`!x`
| Positive
Negative
Negation
| ✓

  | ✓

  |  
 
✓ | Right | | -| `*`
`/`
`%`
| Multiplication
Division
Remainder
| ✓

  | ✓

✓ |  
 
  | Left | | -| `+`
`-`
| Addition
Subtraction
| ✓ | ✓ |   | Left | | -| `<<`
`>>`
| Left shift
Right shift
|   | ✓ |   | Left | [^2] | -| `&` | Bitwise AND |   | ✓ |   | Left | | -| | | Bitwise OR |   | ✓ |   | Left | | -| `^` | Bitwise XOR |   | ✓ |   | Left | | -| `>=`
`>`
`<=`
`<` | Greater or equal
Greater
Lower or equal
Lower
| ✓ | ✓ |   | Left | [^3] | -| `!=`
`==`
| Not Equal
Equal
| ✓ | ✓ | ✓ | Left | | -| `&&` | Boolean AND |   |   | ✓ | Left | | -| || | Boolean OR |   |   | ✓ | Left | | -| `if c then x else y fi` | Conditional expression | ✓ | ✓ | ✓ | Right | | +| Operator | Description | `field` | `u8/u16` `u32/u64` | `bool` | Associativity | +|----------------------------|------------------------------------------------------------|------------------------------|-------------------------------|-----------------------------|---------------| +| `**`
| Power | ✓[^1] |   |   | Left | +| `+x`
`-x`
`!x`
| Positive
Negative
Negation
| ✓

  | ✓

  |  
 
✓ | Right | +| `*`
`/`
`%`
| Multiplication
Division
Remainder
| ✓

  | ✓

✓ |  
 
  | Left | +| `+`
`-`
| Addition
Subtraction
| ✓ | ✓ |   | Left | +| `<<`
`>>`
| Left shift
Right shift
|   | ✓[^2] |   | Left | +| `&` | Bitwise AND |   | ✓ |   | Left | +| | | Bitwise OR |   | ✓ |   | Left | +| `^` | Bitwise XOR |   | ✓ |   | Left | +| `>=`
`>`
`<=`
`<` | Greater or equal
Greater
Lower or equal
Lower
| ✓[^3] | ✓ |   | Left | +| `!=`
`==`
| Not Equal
Equal
| ✓ | ✓ | ✓ | Left | +| `&&` | Boolean AND |   |   | ✓ | Left | +| || | Boolean OR |   |   | ✓ | Left | +| `if c then x else y fi` | Conditional expression | ✓ | ✓ | ✓ | Right | [^1]: The exponent must be a compile-time constant of type `u32` [^2]: The right operand must be a compile time constant of type `u32` -[^3]: Both operands are asserted to be strictly lower than the biggest power of 2 lower than `p/2`, unless one of them can be determined to be a compile-time constant \ No newline at end of file +[^3]: If neither of the operands can be determined to be a compile-time constant, then we have a restriction: for the check `a < b`, if the field prime `p` is represented on `N` bits, `|a - b|` must fit in `N - 2` bits. +Failing to respect this condition will lead to a runtime error. \ No newline at end of file From aba1309ea4ba245e53dfbbd2b1eafe1a56c0f14b Mon Sep 17 00:00:00 2001 From: schaeff Date: Fri, 15 Oct 2021 13:16:27 +0200 Subject: [PATCH 76/83] fix smt test --- zokrates_cli/tests/code/taxation.smt2 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/zokrates_cli/tests/code/taxation.smt2 b/zokrates_cli/tests/code/taxation.smt2 index f7e409027..cc66ac8e2 100644 --- a/zokrates_cli/tests/code/taxation.smt2 +++ b/zokrates_cli/tests/code/taxation.smt2 @@ -1,6 +1,6 @@ ; Auto generated by ZoKrates -; Number of circuit variables: 258 -; Number of equalities: 257 +; Number of circuit variables: 260 +; Number of equalities: 261 (declare-const |~prime| Int) (declare-const |~out_0| Int) (declare-const |~one| Int) @@ -259,7 +259,9 @@ (declare-const |_252| Int) (declare-const |_253| Int) (declare-const |_254| Int) -(declare-const |_259| Int) +(declare-const |_257| Int) +(declare-const |_258| Int) +(declare-const |_263| Int) (assert (and (= |~prime| 21888242871839275222246405745257275088548364400416034343698204186575808495617) (= |~one| 1) @@ -518,6 +520,10 @@ (= (mod (* (* |_253| 1) (* |_253| 1)) |~prime|) (mod (* |_253| 1) |~prime|)) (= (mod (* (* |_254| 1) (* |_254| 1)) |~prime|) (mod (* |_254| 1) |~prime|)) (= (mod (* (* |~one| 1) (+ (* |_2| 7237005577332262213973186563042994240829374041602535252466099000494570602496) (* |_3| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_4| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_5| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_6| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_7| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_8| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_9| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_10| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_11| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_12| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_13| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_14| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_15| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_16| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_17| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_18| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_19| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_20| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_21| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_22| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_23| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_24| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_25| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_26| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_27| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_28| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_29| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_30| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_31| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_32| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_33| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_34| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_35| 842498333348457493583344221469363458551160763204392890034487820288) (* |_36| 421249166674228746791672110734681729275580381602196445017243910144) (* |_37| 210624583337114373395836055367340864637790190801098222508621955072) (* |_38| 105312291668557186697918027683670432318895095400549111254310977536) (* |_39| 52656145834278593348959013841835216159447547700274555627155488768) (* |_40| 26328072917139296674479506920917608079723773850137277813577744384) (* |_41| 13164036458569648337239753460458804039861886925068638906788872192) (* |_42| 6582018229284824168619876730229402019930943462534319453394436096) (* |_43| 3291009114642412084309938365114701009965471731267159726697218048) (* |_44| 1645504557321206042154969182557350504982735865633579863348609024) (* |_45| 822752278660603021077484591278675252491367932816789931674304512) (* |_46| 411376139330301510538742295639337626245683966408394965837152256) (* |_47| 205688069665150755269371147819668813122841983204197482918576128) (* |_48| 102844034832575377634685573909834406561420991602098741459288064) (* |_49| 51422017416287688817342786954917203280710495801049370729644032) (* |_50| 25711008708143844408671393477458601640355247900524685364822016) (* |_51| 12855504354071922204335696738729300820177623950262342682411008) (* |_52| 6427752177035961102167848369364650410088811975131171341205504) (* |_53| 3213876088517980551083924184682325205044405987565585670602752) (* |_54| 1606938044258990275541962092341162602522202993782792835301376) (* |_55| 803469022129495137770981046170581301261101496891396417650688) (* |_56| 401734511064747568885490523085290650630550748445698208825344) (* |_57| 200867255532373784442745261542645325315275374222849104412672) (* |_58| 100433627766186892221372630771322662657637687111424552206336) (* |_59| 50216813883093446110686315385661331328818843555712276103168) (* |_60| 25108406941546723055343157692830665664409421777856138051584) (* |_61| 12554203470773361527671578846415332832204710888928069025792) (* |_62| 6277101735386680763835789423207666416102355444464034512896) (* |_63| 3138550867693340381917894711603833208051177722232017256448) (* |_64| 1569275433846670190958947355801916604025588861116008628224) (* |_65| 784637716923335095479473677900958302012794430558004314112) (* |_66| 392318858461667547739736838950479151006397215279002157056) (* |_67| 196159429230833773869868419475239575503198607639501078528) (* |_68| 98079714615416886934934209737619787751599303819750539264) (* |_69| 49039857307708443467467104868809893875799651909875269632) (* |_70| 24519928653854221733733552434404946937899825954937634816) (* |_71| 12259964326927110866866776217202473468949912977468817408) (* |_72| 6129982163463555433433388108601236734474956488734408704) (* |_73| 3064991081731777716716694054300618367237478244367204352) (* |_74| 1532495540865888858358347027150309183618739122183602176) (* |_75| 766247770432944429179173513575154591809369561091801088) (* |_76| 383123885216472214589586756787577295904684780545900544) (* |_77| 191561942608236107294793378393788647952342390272950272) (* |_78| 95780971304118053647396689196894323976171195136475136) (* |_79| 47890485652059026823698344598447161988085597568237568) (* |_80| 23945242826029513411849172299223580994042798784118784) (* |_81| 11972621413014756705924586149611790497021399392059392) (* |_82| 5986310706507378352962293074805895248510699696029696) (* |_83| 2993155353253689176481146537402947624255349848014848) (* |_84| 1496577676626844588240573268701473812127674924007424) (* |_85| 748288838313422294120286634350736906063837462003712) (* |_86| 374144419156711147060143317175368453031918731001856) (* |_87| 187072209578355573530071658587684226515959365500928) (* |_88| 93536104789177786765035829293842113257979682750464) (* |_89| 46768052394588893382517914646921056628989841375232) (* |_90| 23384026197294446691258957323460528314494920687616) (* |_91| 11692013098647223345629478661730264157247460343808) (* |_92| 5846006549323611672814739330865132078623730171904) (* |_93| 2923003274661805836407369665432566039311865085952) (* |_94| 1461501637330902918203684832716283019655932542976) (* |_95| 730750818665451459101842416358141509827966271488) (* |_96| 365375409332725729550921208179070754913983135744) (* |_97| 182687704666362864775460604089535377456991567872) (* |_98| 91343852333181432387730302044767688728495783936) (* |_99| 45671926166590716193865151022383844364247891968) (* |_100| 22835963083295358096932575511191922182123945984) (* |_101| 11417981541647679048466287755595961091061972992) (* |_102| 5708990770823839524233143877797980545530986496) (* |_103| 2854495385411919762116571938898990272765493248) (* |_104| 1427247692705959881058285969449495136382746624) (* |_105| 713623846352979940529142984724747568191373312) (* |_106| 356811923176489970264571492362373784095686656) (* |_107| 178405961588244985132285746181186892047843328) (* |_108| 89202980794122492566142873090593446023921664) (* |_109| 44601490397061246283071436545296723011960832) (* |_110| 22300745198530623141535718272648361505980416) (* |_111| 11150372599265311570767859136324180752990208) (* |_112| 5575186299632655785383929568162090376495104) (* |_113| 2787593149816327892691964784081045188247552) (* |_114| 1393796574908163946345982392040522594123776) (* |_115| 696898287454081973172991196020261297061888) (* |_116| 348449143727040986586495598010130648530944) (* |_117| 174224571863520493293247799005065324265472) (* |_118| 87112285931760246646623899502532662132736) (* |_119| 43556142965880123323311949751266331066368) (* |_120| 21778071482940061661655974875633165533184) (* |_121| 10889035741470030830827987437816582766592) (* |_122| 5444517870735015415413993718908291383296) (* |_123| 2722258935367507707706996859454145691648) (* |_124| 1361129467683753853853498429727072845824) (* |_125| 680564733841876926926749214863536422912) (* |_126| 340282366920938463463374607431768211456) (* |_127| 170141183460469231731687303715884105728) (* |_128| 85070591730234615865843651857942052864) (* |_129| 42535295865117307932921825928971026432) (* |_130| 21267647932558653966460912964485513216) (* |_131| 10633823966279326983230456482242756608) (* |_132| 5316911983139663491615228241121378304) (* |_133| 2658455991569831745807614120560689152) (* |_134| 1329227995784915872903807060280344576) (* |_135| 664613997892457936451903530140172288) (* |_136| 332306998946228968225951765070086144) (* |_137| 166153499473114484112975882535043072) (* |_138| 83076749736557242056487941267521536) (* |_139| 41538374868278621028243970633760768) (* |_140| 20769187434139310514121985316880384) (* |_141| 10384593717069655257060992658440192) (* |_142| 5192296858534827628530496329220096) (* |_143| 2596148429267413814265248164610048) (* |_144| 1298074214633706907132624082305024) (* |_145| 649037107316853453566312041152512) (* |_146| 324518553658426726783156020576256) (* |_147| 162259276829213363391578010288128) (* |_148| 81129638414606681695789005144064) (* |_149| 40564819207303340847894502572032) (* |_150| 20282409603651670423947251286016) (* |_151| 10141204801825835211973625643008) (* |_152| 5070602400912917605986812821504) (* |_153| 2535301200456458802993406410752) (* |_154| 1267650600228229401496703205376) (* |_155| 633825300114114700748351602688) (* |_156| 316912650057057350374175801344) (* |_157| 158456325028528675187087900672) (* |_158| 79228162514264337593543950336) (* |_159| 39614081257132168796771975168) (* |_160| 19807040628566084398385987584) (* |_161| 9903520314283042199192993792) (* |_162| 4951760157141521099596496896) (* |_163| 2475880078570760549798248448) (* |_164| 1237940039285380274899124224) (* |_165| 618970019642690137449562112) (* |_166| 309485009821345068724781056) (* |_167| 154742504910672534362390528) (* |_168| 77371252455336267181195264) (* |_169| 38685626227668133590597632) (* |_170| 19342813113834066795298816) (* |_171| 9671406556917033397649408) (* |_172| 4835703278458516698824704) (* |_173| 2417851639229258349412352) (* |_174| 1208925819614629174706176) (* |_175| 604462909807314587353088) (* |_176| 302231454903657293676544) (* |_177| 151115727451828646838272) (* |_178| 75557863725914323419136) (* |_179| 37778931862957161709568) (* |_180| 18889465931478580854784) (* |_181| 9444732965739290427392) (* |_182| 4722366482869645213696) (* |_183| 2361183241434822606848) (* |_184| 1180591620717411303424) (* |_185| 590295810358705651712) (* |_186| 295147905179352825856) (* |_187| 147573952589676412928) (* |_188| 73786976294838206464) (* |_189| 36893488147419103232) (* |_190| 18446744073709551616) (* |_191| 9223372036854775808) (* |_192| 4611686018427387904) (* |_193| 2305843009213693952) (* |_194| 1152921504606846976) (* |_195| 576460752303423488) (* |_196| 288230376151711744) (* |_197| 144115188075855872) (* |_198| 72057594037927936) (* |_199| 36028797018963968) (* |_200| 18014398509481984) (* |_201| 9007199254740992) (* |_202| 4503599627370496) (* |_203| 2251799813685248) (* |_204| 1125899906842624) (* |_205| 562949953421312) (* |_206| 281474976710656) (* |_207| 140737488355328) (* |_208| 70368744177664) (* |_209| 35184372088832) (* |_210| 17592186044416) (* |_211| 8796093022208) (* |_212| 4398046511104) (* |_213| 2199023255552) (* |_214| 1099511627776) (* |_215| 549755813888) (* |_216| 274877906944) (* |_217| 137438953472) (* |_218| 68719476736) (* |_219| 34359738368) (* |_220| 17179869184) (* |_221| 8589934592) (* |_222| 4294967296) (* |_223| 2147483648) (* |_224| 1073741824) (* |_225| 536870912) (* |_226| 268435456) (* |_227| 134217728) (* |_228| 67108864) (* |_229| 33554432) (* |_230| 16777216) (* |_231| 8388608) (* |_232| 4194304) (* |_233| 2097152) (* |_234| 1048576) (* |_235| 524288) (* |_236| 262144) (* |_237| 131072) (* |_238| 65536) (* |_239| 32768) (* |_240| 16384) (* |_241| 8192) (* |_242| 4096) (* |_243| 2048) (* |_244| 1024) (* |_245| 512) (* |_246| 256) (* |_247| 128) (* |_248| 64) (* |_249| 32) (* |_250| 16) (* |_251| 8) (* |_252| 4) (* |_253| 2) (* |_254| 1))) |~prime|) (mod (+ (* |~one| 7237005577332262213973186563042994240829374041602535252466099000494570602496) (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1)) |~prime|)) -(= (mod (* (* |_2| 1) (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1))) |~prime|) (mod (* |_259| 1) |~prime|)) -(= (mod (* (* |~one| 1) (* |_259| 1)) |~prime|) (mod (* |~out_0| 1) |~prime|)) + +(= (mod (* (+ (* |~one| 14651237294507013008273219182214280847718990358813499091232105186081237893121) (* |_0| 1) (* |_1| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (* |_258| 1)) |~prime|) (mod (* |_257| 1) |~prime|)) +(= (mod (* (+ (* |~one| 1) (* |_257| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 14651237294507013008273219182214280847718990358813499091232105186081237893121) (* |_0| 1) (* |_1| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod 0 |~prime|)) +(= (mod (* (* |~one| 1) 0) |~prime|) (mod (+ (* |~one| 1) (* |_257| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) |~prime|)) +(= (mod (* (* |_2| 1) (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1))) |~prime|) (mod (* |_263| 1) |~prime|)) +(= (mod (* (* |~one| 1) (* |_263| 1)) |~prime|) (mod (* |~out_0| 1) |~prime|)) )) \ No newline at end of file From 5ff16b25f81237e210390e279f2147f7838c7255 Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 18 Oct 2021 16:54:38 +0200 Subject: [PATCH 77/83] change gettingstarted example to assert --- zokrates_cli/examples/book/factorize.zok | 5 +++-- zokrates_cli/examples/book/multi_def.zok | 4 ++-- zokrates_cli/examples/compile_errors/shadowing.zok | 4 ++-- zokrates_core/tests/out_of_range.rs | 4 ++-- zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.json | 2 +- zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.zok | 4 ++-- zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.json | 2 +- zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.zok | 4 ++-- .../tests/tests/hashes/sha256/embed/1024bitPadded.json | 2 +- .../tests/tests/hashes/sha256/embed/1024bitPadded.zok | 4 ++-- .../tests/tests/hashes/sha256/embed/256bitPadded.json | 2 +- .../tests/tests/hashes/sha256/embed/256bitPadded.zok | 4 ++-- zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.json | 2 +- zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.zok | 4 ++-- .../tests/tests/hashes/sha256/embed/512bitPacked.json | 2 +- .../tests/tests/hashes/sha256/embed/512bitPacked.zok | 4 ++-- .../tests/tests/hashes/sha256/embed/512bitPadded.json | 2 +- .../tests/tests/hashes/sha256/embed/512bitPadded.zok | 4 ++-- 18 files changed, 30 insertions(+), 29 deletions(-) diff --git a/zokrates_cli/examples/book/factorize.zok b/zokrates_cli/examples/book/factorize.zok index 98d3fbe0a..32defecfb 100644 --- a/zokrates_cli/examples/book/factorize.zok +++ b/zokrates_cli/examples/book/factorize.zok @@ -1,2 +1,3 @@ -def main(private field a, field b) -> bool: - return a * a == b \ No newline at end of file +def main(private field a, field b): + assert(a * a == b) + return \ No newline at end of file diff --git a/zokrates_cli/examples/book/multi_def.zok b/zokrates_cli/examples/book/multi_def.zok index ca85cf2d9..54838395a 100644 --- a/zokrates_cli/examples/book/multi_def.zok +++ b/zokrates_cli/examples/book/multi_def.zok @@ -1,9 +1,9 @@ def foo() -> (field, field): return 21, 42 -def main() -> field: +def main(): // a is declared here field a = 1 // b is declared here a, field b = foo() - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_cli/examples/compile_errors/shadowing.zok b/zokrates_cli/examples/compile_errors/shadowing.zok index 805203a34..701f40503 100644 --- a/zokrates_cli/examples/compile_errors/shadowing.zok +++ b/zokrates_cli/examples/compile_errors/shadowing.zok @@ -1,7 +1,7 @@ def foo() -> field: return 1 -def main() -> field: +def main(): field a = 2 field a = foo() - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_core/tests/out_of_range.rs b/zokrates_core/tests/out_of_range.rs index 2e44a031c..14b619cba 100644 --- a/zokrates_core/tests/out_of_range.rs +++ b/zokrates_core/tests/out_of_range.rs @@ -15,10 +15,10 @@ use zokrates_fs_resolver::FileSystemResolver; #[test] fn lt_field() { let source = r#" - def main(private field a, private field b) -> field: + def main(private field a, private field b): field x = if a < b then 3333 else 4444 fi assert(x == 3333) - return 1 + return "# .to_string(); diff --git a/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.json b/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.json index 535a38d19..bfa287ae4 100644 --- a/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.json +++ b/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.json @@ -7,7 +7,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } }] diff --git a/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.zok b/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.zok index 6ed7809da..6454d79bf 100644 --- a/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.zok +++ b/zokrates_stdlib/tests/tests/hashes/pedersen/512bitBool.zok @@ -1,7 +1,7 @@ import "hashes/pedersen/512bitBool" as pedersen -def main() -> (field): +def main(): bool[512] input = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true] bool[256] res = [true,false,true,false,true,true,true,false,true,false,false,false,true,true,false,true,false,true,false,false,true,false,false,true,true,false,true,false,true,true,true,false,false,true,true,false,true,true,false,false,false,true,false,false,false,true,false,false,false,true,false,true,false,true,true,false,true,false,false,false,false,false,true,true,false,true,true,true,true,false,true,true,false,true,false,false,true,false,true,false,true,true,true,true,true,true,false,true,false,false,true,true,false,true,true,false,true,false,false,false,true,true,false,true,false,true,false,true,true,false,true,true,true,true,true,false,true,true,true,false,true,false,true,false,false,true,false,true,false,false,false,true,true,true,false,true,true,true,true,true,false,true,false,false,true,false,false,true,true,false,false,true,false,true,false,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,true,true,false,false,true,false,true,false,true,true,false,true,true,true,false,true,true,true,false,true,true,true,true,false,false,false,true,true,false,true,true,false,false,false,false,true,false,false,false,false,true,true,true,false,true,false,true,false,false,false,false,true,true,false,false,true,false,true,true,false,false,true,false,true,true,false,true,false,true,true,true,true,false,true,true,true,true,true,true,true,true,true,true] assert(pedersen(input) == res) - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.json b/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.json index 30735c5d8..37db7b234 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.json +++ b/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.json @@ -7,7 +7,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } }] diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.zok b/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.zok index 3e646764a..65953a8b5 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha256/256bitPadded.zok @@ -1,7 +1,7 @@ import "hashes/sha256/256bitPadded" as sha256 -def main() -> (field): +def main(): u32[8] a = [0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89] u32[8] digest = sha256(a) assert(digest == [0x16d947ca, 0x4831aee7, 0x6999aa28, 0x20e5c3b4, 0x8171bf49, 0x27241da9, 0xebe644df, 0x9b690df0]) - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.json b/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.json index fe3a97b7d..b8d1e376f 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.json +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.json @@ -7,7 +7,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } } diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.zok b/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.zok index 93140849b..3e5ff508b 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/1024bitPadded.zok @@ -1,5 +1,5 @@ import "hashes/sha256/embed/1024bitPadded" as sha256 -def main() -> (field): +def main(): bool[256] a = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false] bool[256] b = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false] @@ -10,4 +10,4 @@ def main() -> (field): assert(digest == [true, true, true, false, true, true, true, true, true, false, true, false, false, true, false, false, false, false, false, true, true, true, false, false, true, false, true, false, false, true, false, false, true, false, true, false, false, true, false, true, true, true, false, false, false, true, true, true, false, true, true, false, true, false, true, true, false, true, false, false, true, false, false, true, false, true, false, true, true, true, false, true, false, true, false, true, false, true, false, true, true, true, false, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, false, false, true, false, false, false, true, false, true, true, true, false, true, false, true, false, false, true, true, false, false, true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false, true, false, true, true, false, false, true, true, true, true, false, false, true, false, false, false, false, false, false, false, false, true, false, false, true, false, false, false, true, false, true, true, false, false, true, true, true, false, false, false, true, true, true, false, true, false, true, true, false, false, false, true, true, false, false, false, false, true, true, true, false, false, true, true, true, false, true, false, true, false, true, false, false, true, true, false, false, true, true, false, false, false, true, true, false, false, true, true, true, false, true, false, false, false, true, true, false, true, true, false, false, false, true, true, true, false, false, false, true, false, false, false, false, false, true, true]) - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.json b/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.json index 43209caf0..87520567f 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.json +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.json @@ -7,7 +7,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } }] diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.zok b/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.zok index 966bcce56..a584e16e2 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/256bitPadded.zok @@ -1,8 +1,8 @@ import "hashes/sha256/embed/256bitPadded" as sha256 -def main() -> (field): +def main(): bool[256] a = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false] bool[256] digest = sha256(a) assert(digest == [false,true,true,false,false,true,true,false,false,true,true,false,true,false,false,false,false,true,true,true,true,false,true,false,true,false,true,false,true,true,false,true,true,true,true,true,true,false,false,false,false,true,true,false,false,false,true,false,true,false,true,true,true,true,false,true,false,true,true,true,false,true,true,true,false,true,true,false,true,true,false,false,true,false,false,false,true,true,true,true,true,true,false,false,false,false,false,true,true,false,false,false,true,false,true,true,true,false,false,false,true,true,true,false,true,false,false,true,true,true,true,true,true,false,false,false,true,true,true,false,false,false,true,false,false,false,false,false,false,false,false,false,true,false,false,false,true,false,false,true,false,true,true,true,false,false,false,true,false,true,false,false,true,false,false,false,false,true,false,true,false,true,true,false,true,true,true,false,true,true,true,false,false,false,true,false,false,false,true,true,false,false,true,true,true,false,true,true,false,false,true,true,true,false,false,true,false,false,false,false,false,false,true,false,true,false,true,false,false,true,false,true,true,false,false,true,false,false,false,true,true,true,false,true,false,false,false,false,true,true,false,true,false,true,false,true,true,true,true,true,false,false,true,false,true,false,false,true,false,false,true,false,false,true,false,true]) - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.json b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.json index c342bcb32..f12b66cb1 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.json +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.json @@ -8,7 +8,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } } diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.zok b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.zok index e9d54af4e..ade19dc02 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bit.zok @@ -1,5 +1,5 @@ import "hashes/sha256/embed/512bit" as sha256 -def main() -> (field): +def main(): bool[256] a = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false] bool[256] b = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true] @@ -8,4 +8,4 @@ def main() -> (field): assert(digest == [false, false, false, true, true, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, true, false, true, true, true, false, false, true, true, false, false, false, true, true, false, false, false, false, true, false, false, false, false, true, true, true, true, false, true, false, true, true, true, false, false, false, true, false, false, true, false, true, false, false, false, false, true, true, true, true, false, false, true, false, false, false, true, true, true, false, true, true, true, false, false, false, true, true, false, false, true, true, false, false, true, false, false, false, true, false, true, true, false, false, false, false, false, true, false, true, false, false, false, false, false, true, false, true, false, false, true, false, true, true, false, true, true, false, false, false, false, true, false, false, false, false, false, true, false, true, false, true, false, true, false, true, true, false, false, false, true, false, false, true, true, false, false, false, false, true, false, true, false, false, true, true, true, false, false, true, true, true, false, false, true, true, true, false, false, false, true, true, true, true, false, false, true, true, false, true, false, true, true, true, true, false, true, true, true, true, false, false, false, true, false, false, true, true, true, false, true, false, false, false, false, false, false, true, true, true, true, false, true, true, true, true, true, false, true, false, true, false, true, true, false, false, true, true, false, false, false, false, true, true, true, true, false, true, false, false, true, false, true, true, false, true]) - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.json b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.json index 9c61e9e73..d446289ca 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.json +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.json @@ -8,7 +8,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } } diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.zok b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.zok index b87bf9d14..86b6a23fb 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPacked.zok @@ -1,5 +1,5 @@ import "hashes/sha256/embed/512bitPacked" as sha256packed -def main() -> (field): +def main(): field a = 0 field b = 0 @@ -11,4 +11,4 @@ def main() -> (field): assert(h[0] == 263561599766550617289250058199814760685) assert(h[1] == 65303172752238645975888084098459749904) - return 1 \ No newline at end of file + return \ No newline at end of file diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.json b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.json index a0e762bee..2f8780ae9 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.json +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.json @@ -8,7 +8,7 @@ }, "output": { "Ok": { - "values": ["1"] + "values": [] } } } diff --git a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.zok b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.zok index a042da12d..4554db099 100644 --- a/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.zok +++ b/zokrates_stdlib/tests/tests/hashes/sha256/embed/512bitPadded.zok @@ -1,5 +1,5 @@ import "hashes/sha256/embed/512bitPadded" as sha256 -def main() -> (field): +def main(): bool[256] a = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false] bool[256] b = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true] @@ -8,4 +8,4 @@ def main() -> (field): assert(digest == [true, true, false, false, false, true, true, false, false, true, false, false, true, false, false, false, false, false, false, true, true, true, true, false, false, false, true, false, false, false, true, false, true, true, false, false, false, true, false, true, true, true, true, true, true, true, true, true, false, true, false, false, false, false, false, true, false, true, true, false, false, true, false, false, true, false, true, false, true, true, true, true, false, true, true, false, true, false, false, false, false, false, false, false, true, false, true, true, true, false, false, false, true, true, false, false, true, true, true, true, true, false, true, false, true, false, true, false, false, true, false, true, true, true, true, false, true, false, false, false, true, true, true, false, true, true, false, true, false, false, true, true, false, false, false, true, false, false, true, false, false, false, false, false, true, true, true, false, true, true, true, false, true, true, true, true, true, true, true, true, true, false, false, false, true, false, false, true, true, true, false, false, false, true, false, false, true, true, true, true, false, false, true, true, false, false, false, false, false, true, true, true, true, true, false, false, false, true, false, false, true, false, true, false, false, true, true, false, true, true, true, true, true, false, true, false, true, false, true, false, true, false, true, false, true, true, true, false, false, false, false, false, false, true, false, true, true, false, false, true, true, true, false, false, true, true, true, false, false, false, false, true, false, false, false, false]) - return 1 \ No newline at end of file + return \ No newline at end of file From 79798764ea191aa449da44584eb4657f3e1c0406 Mon Sep 17 00:00:00 2001 From: Thibaut Schaeffer Date: Mon, 18 Oct 2021 17:54:34 +0200 Subject: [PATCH 78/83] Create 1037-schaeff --- changelogs/unreleased/1037-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1037-schaeff diff --git a/changelogs/unreleased/1037-schaeff b/changelogs/unreleased/1037-schaeff new file mode 100644 index 000000000..be5eb166b --- /dev/null +++ b/changelogs/unreleased/1037-schaeff @@ -0,0 +1 @@ +Remove confusing returns From 61bbc44abcdb8de7307042f1de627e6545111273 Mon Sep 17 00:00:00 2001 From: Pete Hunt Date: Fri, 22 Oct 2021 00:23:47 -0700 Subject: [PATCH 79/83] Update lockfiles --- Cargo.lock | 60 +- zokrates_js/Cargo.lock | 412 +- zokrates_js/package-lock.json | 6626 ++++++++++++++++++++++++++++++++- 3 files changed, 6770 insertions(+), 328 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 871121e22..48b537036 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991984e3fd003e7ba02eb724f87a0f997b78677c46c0e91f8424ad7394c9886a" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom 0.2.3", "once_cell", @@ -286,7 +286,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ac3d78c750b01f5df5b2e76d106ed31487a93b3868f14a7f0eb3a74f45e1d8a" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", ] @@ -354,9 +354,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" +checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" dependencies = [ "addr2line", "cc", @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byte-tools" @@ -724,7 +724,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", ] @@ -838,7 +838,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", "synstructure", @@ -882,7 +882,7 @@ dependencies = [ "num-bigint 0.2.6", "num-integer", "num-traits 0.2.14", - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", ] @@ -1156,9 +1156,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.103" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" +checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" [[package]] name = "libgit2-sys" @@ -1343,9 +1343,9 @@ dependencies = [ [[package]] name = "object" -version = "0.26.2" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" +checksum = "c821014c18301591b89b843809ef953af9e3df0496c232d5c0611b0a52aac363" dependencies = [ "memchr", ] @@ -1453,7 +1453,7 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", ] @@ -1489,9 +1489,9 @@ checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" [[package]] name = "pretty_assertions" @@ -1516,9 +1516,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" dependencies = [ "unicode-xid 0.2.2", ] @@ -1549,7 +1549,7 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", ] [[package]] @@ -1851,7 +1851,7 @@ version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", ] @@ -1930,9 +1930,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "strsim" @@ -1963,7 +1963,7 @@ version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "unicode-xid 0.2.2", ] @@ -1974,7 +1974,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", "unicode-xid 0.2.2", @@ -2073,7 +2073,7 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", ] @@ -2234,7 +2234,7 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", "wasm-bindgen-shared", @@ -2268,7 +2268,7 @@ version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", "wasm-bindgen-backend", @@ -2301,7 +2301,7 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", ] @@ -2361,7 +2361,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.30", "quote 1.0.10", "syn 1.0.80", "synstructure", diff --git a/zokrates_js/Cargo.lock b/zokrates_js/Cargo.lock index ccf4d6742..adbe48e4a 100644 --- a/zokrates_js/Cargo.lock +++ b/zokrates_js/Cargo.lock @@ -4,26 +4,26 @@ version = 3 [[package]] name = "addr2line" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" dependencies = [ "gimli", ] [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.3", "once_cell", "version_check", ] @@ -90,7 +90,7 @@ dependencies = [ "ark-serialize", "ark-std", "derivative", - "num-traits 0.2.12", + "num-traits 0.2.14", "zeroize", ] @@ -105,7 +105,7 @@ dependencies = [ "ark-serialize", "ark-std", "derivative", - "num-traits 0.2.12", + "num-traits 0.2.14", "rustc_version", "zeroize", ] @@ -116,8 +116,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e8cb28c2137af1ef058aa59616db3f7df67dbb70bf2be4ee6920008cc30d98c" dependencies = [ - "quote 1.0.7", - "syn 1.0.34", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -127,9 +127,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b9c256a93a10ed9708c16a517d6dcfaba3d215c0d7fab44d29a9affefb5eeb8" dependencies = [ "num-bigint 0.4.2", - "num-traits 0.2.12", - "quote 1.0.7", - "syn 1.0.34", + "num-traits 0.2.14", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -164,7 +164,7 @@ dependencies = [ "derivative", "num-bigint 0.4.2", "num-integer", - "num-traits 0.2.12", + "num-traits 0.2.14", "tracing", ] @@ -193,7 +193,7 @@ dependencies = [ "ark-std", "derivative", "num-bigint 0.4.2", - "num-traits 0.2.12", + "num-traits 0.2.14", "tracing", ] @@ -224,9 +224,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ac3d78c750b01f5df5b2e76d106ed31487a93b3868f14a7f0eb3a74f45e1d8a" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -261,18 +261,19 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" +checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" dependencies = [ "addr2line", - "cfg-if 0.1.10", + "cc", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -308,9 +309,9 @@ dependencies = [ [[package]] name = "bit-vec" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "blake2" @@ -343,7 +344,7 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array 0.12.3", + "generic-array 0.12.4", ] [[package]] @@ -357,9 +358,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.13" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static", "memchr", @@ -369,9 +370,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byte-tools" @@ -381,9 +382,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -399,11 +406,11 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "console_error_panic_hook" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "wasm-bindgen", ] @@ -431,9 +438,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.3" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", @@ -457,9 +464,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -468,7 +475,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array 0.12.3", + "generic-array 0.12.4", ] [[package]] @@ -482,9 +489,9 @@ dependencies = [ [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "failure" @@ -502,9 +509,9 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", "synstructure", ] @@ -545,10 +552,10 @@ checksum = "50c052fa6d4c2f12305ec364bfb8ef884836f3f61ea015b202372ff996d1ac4b" dependencies = [ "num-bigint 0.2.6", "num-integer", - "num-traits 0.2.12", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "num-traits 0.2.14", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -569,9 +576,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" dependencies = [ "futures-channel", "futures-core", @@ -584,9 +591,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" dependencies = [ "futures-core", "futures-sink", @@ -594,15 +601,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" [[package]] name = "futures-executor" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" dependencies = [ "futures-core", "futures-task", @@ -611,47 +618,45 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" [[package]] name = "futures-sink" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" +checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" [[package]] name = "futures-task" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" -dependencies = [ - "once_cell", -] +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" [[package]] name = "futures-util" -version = "0.3.5" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" dependencies = [ + "autocfg", "futures-channel", "futures-core", "futures-io", "futures-sink", "futures-task", "memchr", - "pin-project", + "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] @@ -668,20 +673,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -692,9 +697,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "hashbrown" @@ -707,18 +712,18 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.15" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "itertools" @@ -731,15 +736,15 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "js-sys" -version = "0.3.42" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52732a3d3ad72c58ad2dc70624f9c17b46ecd0943b9a4f1ee37c4c18c5d983e2" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -752,17 +757,17 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.72" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701" +checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" [[package]] name = "log" -version = "0.4.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -773,17 +778,18 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "memchr" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "miniz_oxide" -version = "0.4.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", + "autocfg", ] [[package]] @@ -800,7 +806,7 @@ checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" dependencies = [ "num-integer", "num-iter", - "num-traits 0.2.12", + "num-traits 0.2.14", ] [[package]] @@ -811,7 +817,7 @@ checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.12", + "num-traits 0.2.14", "serde", ] @@ -823,7 +829,7 @@ checksum = "74e768dff5fb39a41b3bcd30bb25cf989706c90d028d1ad71971987aa309d535" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.12", + "num-traits 0.2.14", ] [[package]] @@ -833,18 +839,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", - "num-traits 0.2.12", + "num-traits 0.2.14", ] [[package]] name = "num-iter" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.12", + "num-traits 0.2.14", ] [[package]] @@ -853,14 +859,14 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.12", + "num-traits 0.2.14", ] [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", ] @@ -877,9 +883,12 @@ dependencies = [ [[package]] name = "object" -version = "0.20.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "c821014c18301591b89b843809ef953af9e3df0496c232d5c0611b0a52aac363" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" @@ -950,9 +959,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] @@ -966,26 +975,6 @@ dependencies = [ "sha-1", ] -[[package]] -name = "pin-project" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", -] - [[package]] name = "pin-project-lite" version = "0.2.7" @@ -1000,9 +989,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" [[package]] name = "proc-macro2" @@ -1015,11 +1004,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.18" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" dependencies = [ - "unicode-xid 0.2.1", + "unicode-xid 0.2.2", ] [[package]] @@ -1033,11 +1022,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.30", ] [[package]] @@ -1059,7 +1048,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", "libc", "rand_chacha", "rand_core 0.5.1", @@ -1097,7 +1086,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", ] [[package]] @@ -1129,9 +1118,9 @@ dependencies = [ [[package]] name = "reduce" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c8549eb79c1fc8c449cb18a2d9b7873a7cb1bf2fcbfe8a3ad8812320544341" +checksum = "16d2dc47b68ac15ea328cd7ebe01d7d512ed29787f7d534ad2a3c341328b35d7" [[package]] name = "regex" @@ -1148,12 +1137,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -dependencies = [ - "byteorder", -] +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" @@ -1166,9 +1152,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_version" @@ -1222,29 +1208,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.114" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] name = "serde_json" -version = "1.0.56" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -1286,9 +1272,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "subtle" @@ -1309,25 +1295,25 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.34" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cae2873c940d92e697597c5eee105fb570cd5689c695806f672883653349b" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "unicode-xid 0.2.1", + "proc-macro2 1.0.30", + "quote 1.0.10", + "unicode-xid 0.2.2", ] [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", - "unicode-xid 0.2.1", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", + "unicode-xid 0.2.2", ] [[package]] @@ -1350,9 +1336,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -1362,20 +1348,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", ] [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" [[package]] name = "typed-arena" @@ -1385,9 +1371,9 @@ checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d" [[package]] name = "typenum" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "ucd-trie" @@ -1409,9 +1395,9 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "utf8-ranges" @@ -1445,11 +1431,11 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.65" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3edbcc9536ab7eababcc6d2374a0b7bfe13a2b6d562c5e07f370456b1a8f33d" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "serde", "serde_json", "wasm-bindgen-macro", @@ -1457,53 +1443,53 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.65" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ed2fb8c84bfad20ea66b26a3743f3e7ba8735a69fe7d95118c33ec8fc1244d" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.65" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb071268b031a64d92fc6cf691715ca5a40950694d8f683c5bb43db7c730929e" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ - "quote 1.0.7", + "quote 1.0.10", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.65" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf592c807080719d1ff2f245a687cbadb3ed28b2077ed7084b47aba8b691f2c6" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.65" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b6c0220ded549d63860c78c38f3bcc558d1ca3f4efa74942c536ddbbb55e87" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "web-sys" -version = "0.3.42" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be2398f326b7ba09815d0b403095f34dd708579220d099caae89be0b32137b2" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -1546,9 +1532,9 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", + "proc-macro2 1.0.30", + "quote 1.0.10", + "syn 1.0.80", "synstructure", ] @@ -1569,14 +1555,14 @@ version = "0.1.0" [[package]] name = "zokrates_core" -version = "0.6.6" +version = "0.6.7" dependencies = [ "bellman_ce", "bincode", "cfg-if 0.1.10", "csv", "ff_ce 0.9.0", - "getrandom 0.2.2", + "getrandom 0.2.3", "hex", "lazy_static", "log", @@ -1623,7 +1609,7 @@ dependencies = [ "lazy_static", "num-bigint 0.2.6", "num-integer", - "num-traits 0.2.12", + "num-traits 0.2.14", "serde", "serde_derive", "serde_json", @@ -1632,7 +1618,7 @@ dependencies = [ [[package]] name = "zokrates_js" -version = "1.0.35" +version = "1.0.36" dependencies = [ "console_error_panic_hook", "js-sys", diff --git a/zokrates_js/package-lock.json b/zokrates_js/package-lock.json index 1f5a38c26..919deb47a 100644 --- a/zokrates_js/package-lock.json +++ b/zokrates_js/package-lock.json @@ -1,8 +1,6463 @@ { "name": "zokrates-js", - "version": "1.0.35", - "lockfileVersion": 1, + "version": "1.0.36", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "zokrates-js", + "version": "1.0.36", + "license": "GPLv3", + "devDependencies": { + "dree": "^2.6.1", + "esm": "^3.2.25", + "gulp": "^4.0.2", + "gulp-cli": "^2.3.0", + "mocha": "^7.2.0", + "rimraf": "^3.0.2", + "serve": "^11.3.2", + "text-encoding": "^0.7.0", + "toml": "^3.0.0" + } + }, + "node_modules/@zeit/schemas": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.6.0.tgz", + "integrity": "sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "node_modules/ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "dependencies": { + "string-width": "^2.0.0" + } + }, + "node_modules/ansi-align/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-align/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-align/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "dependencies": { + "ansi-wrap": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "dependencies": { + "ansi-wrap": "0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "dependencies": { + "buffer-equal": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arch": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.2.tgz", + "integrity": "sha512-NTBIIbAfkJeIletyABbVtdPgeKfDafR+1mZV/AyyfC1UkVkp9iUjV+wwmqtUgphHYajbI86jejBJp5e+jkGTiQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "node_modules/arg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-2.0.0.tgz", + "integrity": "sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==", + "dev": true + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "dev": true, + "dependencies": { + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "dev": true, + "dependencies": { + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-initial": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "dev": true, + "dependencies": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-initial/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "dependencies": { + "is-number": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-last/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", + "dev": true, + "dependencies": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-sort/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "node_modules/async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "dev": true, + "dependencies": { + "async-done": "^1.2.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "dev": true, + "dependencies": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "dependencies": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/boxen/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "dev": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "optionalDependencies": { + "fsevents": "^1.2.7" + } + }, + "node_modules/chokidar/node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clipboardy": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-1.2.3.tgz", + "integrity": "sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA==", + "dev": true, + "dependencies": { + "arch": "^2.1.0", + "execa": "^0.8.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/clipboardy/node_modules/execa": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", + "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", + "dev": true, + "dependencies": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "node_modules/cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "dev": true, + "dependencies": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", + "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "dev": true, + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.14", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/copy-props": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", + "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", + "dev": true, + "dependencies": { + "each-props": "^1.3.0", + "is-plain-object": "^2.0.1" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, + "dependencies": { + "kind-of": "^5.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-compare/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dree": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/dree/-/dree-2.6.1.tgz", + "integrity": "sha512-AbMdXr5SUA7Bt8V5U3d9dCFGUIr+ZSQfgVVG6dh6eQe2duKqq7i4qXdIvQ0uR3PcBft0qBs3CFJrdfdh84H/Lw==", + "dev": true, + "dependencies": { + "yargs": "^16.2.0" + }, + "bin": { + "dree": "bundled/bin/index.js" + } + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-abstract/node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "dependencies": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "node_modules/es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "dependencies": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "dependencies": { + "type": "^2.0.0" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend-shallow/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "dev": true, + "dependencies": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=", + "dev": true, + "dependencies": { + "punycode": "^1.3.2" + } + }, + "node_modules/fast-url-parser/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "dependencies": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/flat": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", + "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "dev": true, + "dependencies": { + "is-buffer": "~2.0.3" + }, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat/node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", + "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", + "bundleDependencies": [ + "node-pre-gyp" + ], + "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1", + "node-pre-gyp": "*" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/fsevents/node_modules/abbrev": { + "version": "1.1.1", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/ansi-regex": { + "version": "2.1.1", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/aproba": { + "version": "1.2.0", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/are-we-there-yet": { + "version": "1.1.5", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/fsevents/node_modules/balanced-match": { + "version": "1.0.0", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/brace-expansion": { + "version": "1.1.11", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/fsevents/node_modules/chownr": { + "version": "1.1.4", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/code-point-at": { + "version": "1.1.0", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/concat-map": { + "version": "0.0.1", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/console-control-strings": { + "version": "1.1.0", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/core-util-is": { + "version": "1.0.2", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/debug": { + "version": "3.2.6", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/fsevents/node_modules/deep-extend": { + "version": "0.6.0", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/fsevents/node_modules/delegates": { + "version": "1.0.0", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/detect-libc": { + "version": "1.0.3", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "inBundle": true, + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/fsevents/node_modules/fs-minipass": { + "version": "1.2.7", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "minipass": "^2.6.0" + } + }, + "node_modules/fsevents/node_modules/fs.realpath": { + "version": "1.0.0", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/gauge": { + "version": "2.7.4", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/fsevents/node_modules/glob": { + "version": "7.1.6", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fsevents/node_modules/has-unicode": { + "version": "2.0.1", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/iconv-lite": { + "version": "0.4.24", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/ignore-walk": { + "version": "3.0.3", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "minimatch": "^3.0.4" + } + }, + "node_modules/fsevents/node_modules/inflight": { + "version": "1.0.6", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/fsevents/node_modules/inherits": { + "version": "2.0.4", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "deprecated": "Please update to ini >=1.3.6 to avoid a prototype pollution issue", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/fsevents/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/isarray": { + "version": "1.0.0", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/minimatch": { + "version": "3.0.4", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/fsevents/node_modules/minimist": { + "version": "1.2.5", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/minipass": { + "version": "2.9.0", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "node_modules/fsevents/node_modules/minizlib": { + "version": "1.3.3", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "minipass": "^2.9.0" + } + }, + "node_modules/fsevents/node_modules/mkdirp": { + "version": "0.5.3", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/fsevents/node_modules/ms": { + "version": "2.1.2", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/needle": { + "version": "2.3.3", + "integrity": "sha512-EkY0GeSq87rWp1hoq/sH/wnTWgFVhYlnIkbJ0YJFfRgEFlz2RraCjBpFQ+vrEgEdp0ThfyHADmkChEhcb7PKyw==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/fsevents/node_modules/node-pre-gyp": { + "version": "0.14.0", + "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", + "deprecated": "Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/fsevents/node_modules/nopt": { + "version": "4.0.3", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/fsevents/node_modules/npm-bundled": { + "version": "1.1.1", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/fsevents/node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/npm-packlist": { + "version": "1.4.8", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/fsevents/node_modules/npmlog": { + "version": "4.1.2", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/fsevents/node_modules/number-is-nan": { + "version": "1.0.1", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/object-assign": { + "version": "4.1.1", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/once": { + "version": "1.4.0", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/fsevents/node_modules/os-homedir": { + "version": "1.0.2", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/os-tmpdir": { + "version": "1.0.2", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/osenv": { + "version": "0.1.5", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "node_modules/fsevents/node_modules/path-is-absolute": { + "version": "1.0.1", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/process-nextick-args": { + "version": "2.0.1", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/rc": { + "version": "1.2.8", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/fsevents/node_modules/readable-stream": { + "version": "2.3.7", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/fsevents/node_modules/rimraf": { + "version": "2.7.1", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/fsevents/node_modules/safe-buffer": { + "version": "5.1.2", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/safer-buffer": { + "version": "2.1.2", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/sax": { + "version": "1.2.4", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/semver": { + "version": "5.7.1", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "inBundle": true, + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/fsevents/node_modules/set-blocking": { + "version": "2.0.0", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/signal-exit": { + "version": "3.0.2", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/string_decoder": { + "version": "1.1.1", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/fsevents/node_modules/string-width": { + "version": "1.0.2", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/strip-ansi": { + "version": "3.0.1", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/strip-json-comments": { + "version": "2.0.1", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "inBundle": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/tar": { + "version": "4.4.13", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "engines": { + "node": ">=4.5" + } + }, + "node_modules/fsevents/node_modules/util-deprecate": { + "version": "1.0.2", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/wide-align": { + "version": "1.1.3", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "inBundle": true, + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "node_modules/fsevents/node_modules/wrappy": { + "version": "1.0.2", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/fsevents/node_modules/yallist": { + "version": "3.1.1", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "inBundle": true, + "optional": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "dev": true, + "dependencies": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/glob-watcher": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", + "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "dev": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "object.defaults": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glogg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "dev": true, + "dependencies": { + "sparkles": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "engines": { + "node": ">=4.x" + } + }, + "node_modules/gulp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "dev": true, + "dependencies": { + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", + "vinyl-fs": "^3.0.0" + }, + "bin": { + "gulp": "bin/gulp.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-cli": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", + "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", + "dev": true, + "dependencies": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.4.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.2.0", + "yargs": "^7.1.0" + }, + "bin": { + "gulp": "bin/gulp.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gulp-cli/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "node_modules/gulp-cli/node_modules/get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/yargs": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.1.tgz", + "integrity": "sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g==", + "dev": true, + "dependencies": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "5.0.0-security.0" + } + }, + "node_modules/gulp-cli/node_modules/yargs-parser": { + "version": "5.0.0-security.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz", + "integrity": "sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ==", + "dev": true, + "dependencies": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "node_modules/gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "dependencies": { + "glogg": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", + "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "node_modules/is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/just-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", + "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "dev": true, + "dependencies": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "dependencies": { + "flush-write-stream": "^1.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/liftoff": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "dev": true, + "dependencies": { + "extend": "^3.0.0", + "findup-sync": "^3.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-path/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", + "dev": true, + "dependencies": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/matchdep/node_modules/findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/matchdep/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "dependencies": { + "mime-db": "1.44.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-deep/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mocha": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", + "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "dev": true, + "dependencies": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "chokidar": "3.3.0", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.5", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mocha/node_modules/anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mocha/node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.1.1" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/mocha/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/mocha/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/mocha/node_modules/debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/mocha/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/mocha/node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "deprecated": "\"Please update to latest v2.3 or v2.2\"", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha/node_modules/glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mocha/node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/mocha/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "node_modules/mocha/node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mocha/node_modules/readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "dependencies": { + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mocha/node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/mocha/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/mocha/node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "node_modules/mocha/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/mute-stdout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "node_modules/node-environment-flags": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", + "dev": true, + "dependencies": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "dependencies": { + "once": "^1.3.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "dependencies": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.getownpropertydescriptors": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz", + "integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "dev": true, + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.1" + } + }, + "node_modules/os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "dependencies": { + "lcid": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "dependencies": { + "error-ex": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "node_modules/path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "dependencies": { + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "node_modules/path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "dependencies": { + "path-root-regex": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", + "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==", + "dev": true + }, + "node_modules/path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "dependencies": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "dependencies": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "dev": true, + "dependencies": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "dependencies": { + "rc": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "dependencies": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "dependencies": { + "value-or-function": "^3.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", + "dev": true, + "dependencies": { + "sver-compat": "^1.5.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/serve": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/serve/-/serve-11.3.2.tgz", + "integrity": "sha512-yKWQfI3xbj/f7X1lTBg91fXBP0FqjJ4TEi+ilES5yzH0iKJpN5LjNb1YzIfQg9Rqn4ECUS2SOf2+Kmepogoa5w==", + "dev": true, + "dependencies": { + "@zeit/schemas": "2.6.0", + "ajv": "6.5.3", + "arg": "2.0.0", + "boxen": "1.3.0", + "chalk": "2.4.1", + "clipboardy": "1.2.3", + "compression": "1.7.3", + "serve-handler": "6.1.3", + "update-check": "1.5.2" + }, + "bin": { + "serve": "bin/serve.js" + } + }, + "node_modules/serve-handler": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.3.tgz", + "integrity": "sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==", + "dev": true, + "dependencies": { + "bytes": "3.0.0", + "content-disposition": "0.5.2", + "fast-url-parser": "1.1.3", + "mime-types": "2.1.18", + "minimatch": "3.0.4", + "path-is-inside": "1.0.2", + "path-to-regexp": "2.2.1", + "range-parser": "1.2.0" + } + }, + "node_modules/serve-handler/node_modules/mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-handler/node_modules/mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "dependencies": { + "mime-db": "~1.33.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve/node_modules/chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/serve/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/serve/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "node_modules/sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "dependencies": { + "is-utf8": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", + "dev": true, + "dependencies": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "dependencies": { + "execa": "^0.7.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/text-encoding": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz", + "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==", + "deprecated": "no longer maintained", + "dev": true + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "dependencies": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "node_modules/time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "dependencies": { + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "dev": true + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/undertaker": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "dependencies": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/update-check": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/update-check/-/update-check-1.5.2.tgz", + "integrity": "sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ==", + "dev": true, + "dependencies": { + "registry-auth-token": "3.3.2", + "registry-url": "3.1.0" + } + }, + "node_modules/uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vinyl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "dependencies": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "dependencies": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "node_modules/wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "node_modules/wide-align/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/wide-align/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/wide-align/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/wide-align/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "dev": true, + "dependencies": { + "string-width": "^2.1.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.6", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.6.tgz", + "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "dependencies": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/yargs-unparser/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/yargs-unparser/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/yargs-unparser/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/yargs-unparser/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/yargs-unparser/node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/yargs-unparser/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/yargs-unparser/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs-unparser/node_modules/y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "node_modules/yargs-unparser/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "node_modules/yargs-unparser/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + }, "dependencies": { "@zeit/schemas": { "version": "2.6.0", @@ -1517,29 +7972,29 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "bundled": true, "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "bundled": true, "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "bundled": true, "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": false, "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1549,15 +8004,15 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "bundled": true, "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1567,43 +8022,43 @@ }, "chownr": { "version": "1.1.4", - "resolved": false, "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "bundled": true, "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "bundled": true, "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "bundled": true, "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "bundled": true, "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "bundled": true, "dev": true, "optional": true }, "debug": { "version": "3.2.6", - "resolved": false, "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1612,29 +8067,29 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": false, "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "bundled": true, "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "bundled": true, "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "bundled": true, "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.7", - "resolved": false, "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1643,15 +8098,15 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "bundled": true, "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1667,8 +8122,8 @@ }, "glob": { "version": "7.1.6", - "resolved": false, "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1682,15 +8137,15 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "bundled": true, "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": false, "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1699,8 +8154,8 @@ }, "ignore-walk": { "version": "3.0.3", - "resolved": false, "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1709,8 +8164,8 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1720,8 +8175,8 @@ }, "inherits": { "version": "2.0.4", - "resolved": false, "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "bundled": true, "dev": true, "optional": true }, @@ -1729,13 +8184,14 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "bundled": true, "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1744,15 +8200,15 @@ }, "isarray": { "version": "1.0.0", - "resolved": false, "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "bundled": true, "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1761,15 +8217,15 @@ }, "minimist": { "version": "1.2.5", - "resolved": false, "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "bundled": true, "dev": true, "optional": true }, "minipass": { "version": "2.9.0", - "resolved": false, "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1779,8 +8235,8 @@ }, "minizlib": { "version": "1.3.3", - "resolved": false, "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1789,8 +8245,8 @@ }, "mkdirp": { "version": "0.5.3", - "resolved": false, "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1799,15 +8255,15 @@ }, "ms": { "version": "2.1.2", - "resolved": false, "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "bundled": true, "dev": true, "optional": true }, "needle": { "version": "2.3.3", - "resolved": false, "integrity": "sha512-EkY0GeSq87rWp1hoq/sH/wnTWgFVhYlnIkbJ0YJFfRgEFlz2RraCjBpFQ+vrEgEdp0ThfyHADmkChEhcb7PKyw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1818,8 +8274,8 @@ }, "node-pre-gyp": { "version": "0.14.0", - "resolved": false, "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1837,8 +8293,8 @@ }, "nopt": { "version": "4.0.3", - "resolved": false, "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1848,8 +8304,8 @@ }, "npm-bundled": { "version": "1.1.1", - "resolved": false, "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1858,15 +8314,15 @@ }, "npm-normalize-package-bin": { "version": "1.0.1", - "resolved": false, "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "bundled": true, "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.8", - "resolved": false, "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1877,8 +8333,8 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1890,22 +8346,22 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "bundled": true, "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "bundled": true, "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1914,22 +8370,22 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": false, "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "bundled": true, "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "bundled": true, "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1939,22 +8395,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.1", - "resolved": false, "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "bundled": true, "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": false, "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1966,8 +8422,8 @@ }, "readable-stream": { "version": "2.3.7", - "resolved": false, "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1982,8 +8438,8 @@ }, "rimraf": { "version": "2.7.1", - "resolved": false, "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -1992,50 +8448,60 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": false, "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "bundled": true, "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "bundled": true, "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "bundled": true, "dev": true, "optional": true }, "semver": { "version": "5.7.1", - "resolved": false, "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bundled": true, "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "bundled": true, "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "bundled": true, "dev": true, "optional": true }, + "string_decoder": { + "version": "1.1.1", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-width": { "version": "1.0.2", - "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2044,20 +8510,10 @@ "strip-ansi": "^3.0.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "3.0.1", - "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2066,15 +8522,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "bundled": true, "dev": true, "optional": true }, "tar": { "version": "4.4.13", - "resolved": false, "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2089,15 +8545,15 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "bundled": true, "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": false, "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -2106,15 +8562,15 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, "dev": true, "optional": true }, "yallist": { "version": "3.1.1", - "resolved": false, "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "bundled": true, "dev": true, "optional": true } @@ -4475,6 +10931,15 @@ "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -4506,15 +10971,6 @@ "define-properties": "^1.1.3" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", From 993bdbfa0e8c2139198cc2c640417e575080da78 Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 15 Nov 2021 19:41:33 +0100 Subject: [PATCH 80/83] implement missing cases in folder, read constants into new constant definition --- .../reducer/constants_writer.rs | 8 +++++++- .../src/static_analysis/reducer/mod.rs | 2 +- zokrates_core/src/typed_absy/folder.rs | 12 +++++++++++- zokrates_core/src/typed_absy/result_folder.rs | 19 ++++++++++++++++--- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/zokrates_core/src/static_analysis/reducer/constants_writer.rs b/zokrates_core/src/static_analysis/reducer/constants_writer.rs index 8b6f645a8..f84c24b0c 100644 --- a/zokrates_core/src/static_analysis/reducer/constants_writer.rs +++ b/zokrates_core/src/static_analysis/reducer/constants_writer.rs @@ -84,7 +84,7 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ConstantsWriter<'ast, T> { &mut self, s: TypedSymbolDeclaration<'ast, T>, ) -> Result, Self::Error> { - // before we treat the symbol, propagate the constants into it, as may be using constants defined earlier in this module. + // before we treat the symbol, propagate the constants into it, as it may be using constants defined earlier in this module. let s = self.update_symbol_declaration(s); let s = fold_symbol_declaration(self, s)?; @@ -103,6 +103,12 @@ impl<'ast, T: Field> ResultFolder<'ast, T> for ConstantsWriter<'ast, T> { TypedConstantSymbol::Here(c) => { let c = self.fold_constant(c)?; + // if constants were used in the rhs, they are now defined in the map + // replace them in the expression + use crate::typed_absy::folder::Folder; + + let c = ConstantsReader::with_constants(&self.constants).fold_constant(c); + use crate::typed_absy::{DeclarationSignature, TypedFunction, TypedStatement}; // wrap this expression in a function diff --git a/zokrates_core/src/static_analysis/reducer/mod.rs b/zokrates_core/src/static_analysis/reducer/mod.rs index f90afdc8c..83341a925 100644 --- a/zokrates_core/src/static_analysis/reducer/mod.rs +++ b/zokrates_core/src/static_analysis/reducer/mod.rs @@ -508,7 +508,7 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Reducer<'ast, 'a, T> { } pub fn reduce_program(p: TypedProgram) -> Result, Error> { - // inline all constants and replace them in the program + // inline all constants and replace them in the program let mut constants_writer = ConstantsWriter::with_program(p.clone()); diff --git a/zokrates_core/src/typed_absy/folder.rs b/zokrates_core/src/typed_absy/folder.rs index 3447f6645..6ff31e28f 100644 --- a/zokrates_core/src/typed_absy/folder.rs +++ b/zokrates_core/src/typed_absy/folder.rs @@ -122,7 +122,14 @@ pub trait Folder<'ast, T: Field>: Sized { } fn fold_name(&mut self, n: Identifier<'ast>) -> Identifier<'ast> { - n + let id = match n.id { + CoreIdentifier::Constant(c) => { + CoreIdentifier::Constant(self.fold_canonical_constant_identifier(c)) + } + id => id, + }; + + Identifier { id, ..n } } fn fold_variable(&mut self, v: Variable<'ast, T>) -> Variable<'ast, T> { @@ -1027,6 +1034,9 @@ pub fn fold_declaration_constant<'ast, T: Field, F: Folder<'ast, T>>( ) -> DeclarationConstant<'ast, T> { match c { DeclarationConstant::Expression(e) => DeclarationConstant::Expression(f.fold_expression(e)), + DeclarationConstant::Constant(c) => { + DeclarationConstant::Constant(f.fold_canonical_constant_identifier(c)) + } c => c, } } diff --git a/zokrates_core/src/typed_absy/result_folder.rs b/zokrates_core/src/typed_absy/result_folder.rs index 2ca66c838..34f4bf785 100644 --- a/zokrates_core/src/typed_absy/result_folder.rs +++ b/zokrates_core/src/typed_absy/result_folder.rs @@ -150,7 +150,14 @@ pub trait ResultFolder<'ast, T: Field>: Sized { } fn fold_name(&mut self, n: Identifier<'ast>) -> Result, Self::Error> { - Ok(n) + let id = match n.id { + CoreIdentifier::Constant(c) => { + CoreIdentifier::Constant(self.fold_canonical_constant_identifier(c)?) + } + id => id, + }; + + Ok(Identifier { id, ..n }) } fn fold_variable(&mut self, v: Variable<'ast, T>) -> Result, Self::Error> { @@ -1072,6 +1079,9 @@ pub fn fold_declaration_constant<'ast, T: Field, F: ResultFolder<'ast, T>>( DeclarationConstant::Expression(e) => { Ok(DeclarationConstant::Expression(f.fold_expression(e)?)) } + DeclarationConstant::Constant(c) => Ok(DeclarationConstant::Constant( + f.fold_canonical_constant_identifier(c)?, + )), c => Ok(c), } } @@ -1238,11 +1248,14 @@ pub fn fold_program<'ast, T: Field, F: ResultFolder<'ast, T>>( p: TypedProgram<'ast, T>, ) -> Result, F::Error> { Ok(TypedProgram { + main: f.fold_module_id(p.main)?, modules: p .modules .into_iter() - .map(|(module_id, module)| f.fold_module(module).map(|m| (module_id, m))) + .map(|(module_id, module)| { + let module_id = f.fold_module_id(module_id)?; + f.fold_module(module).map(|m| (module_id, m)) + }) .collect::>()?, - main: f.fold_module_id(p.main)?, }) } From 0d046691eff039843766bcd924c3eb1902fa9083 Mon Sep 17 00:00:00 2001 From: schaeff Date: Mon, 15 Nov 2021 19:49:31 +0100 Subject: [PATCH 81/83] add changelog --- changelogs/unreleased/1050-schaeff | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1050-schaeff diff --git a/changelogs/unreleased/1050-schaeff b/changelogs/unreleased/1050-schaeff new file mode 100644 index 000000000..29240f273 --- /dev/null +++ b/changelogs/unreleased/1050-schaeff @@ -0,0 +1 @@ +Fix reduction of constants \ No newline at end of file From 765a2b236bdf65a202df05d9cae6eaa44730e2d8 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 17 Nov 2021 12:24:01 +0100 Subject: [PATCH 82/83] add tests --- zokrates_core_test/tests/tests/constants/issue_1038/a.json | 4 ++++ zokrates_core_test/tests/tests/constants/issue_1038/a.zok | 5 +++++ zokrates_core_test/tests/tests/constants/issue_1038/b.zok | 2 ++ .../tests/tests/constants/issue_1038/reversed/a.zok | 2 ++ .../tests/tests/constants/issue_1038/reversed/b.json | 4 ++++ .../tests/tests/constants/issue_1038/reversed/b.zok | 5 +++++ zokrates_core_test/tests/tests/constants/issue_1047/a.json | 4 ++++ zokrates_core_test/tests/tests/constants/issue_1047/a.zok | 4 ++++ zokrates_core_test/tests/tests/constants/issue_1047/b.zok | 2 ++ .../tests/tests/constants/issue_1047/reversed/a.zok | 2 ++ .../tests/tests/constants/issue_1047/reversed/b.json | 4 ++++ .../tests/tests/constants/issue_1047/reversed/b.zok | 4 ++++ 12 files changed, 42 insertions(+) create mode 100644 zokrates_core_test/tests/tests/constants/issue_1038/a.json create mode 100644 zokrates_core_test/tests/tests/constants/issue_1038/a.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1038/b.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1038/reversed/a.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.json create mode 100644 zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1047/a.json create mode 100644 zokrates_core_test/tests/tests/constants/issue_1047/a.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1047/b.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1047/reversed/a.zok create mode 100644 zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.json create mode 100644 zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.zok diff --git a/zokrates_core_test/tests/tests/constants/issue_1038/a.json b/zokrates_core_test/tests/tests/constants/issue_1038/a.json new file mode 100644 index 000000000..754485877 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1038/a.json @@ -0,0 +1,4 @@ +{ + "entry_point": "./tests/tests/constants/issue_1038/a.zok", + "tests": [] +} diff --git a/zokrates_core_test/tests/tests/constants/issue_1038/a.zok b/zokrates_core_test/tests/tests/constants/issue_1038/a.zok new file mode 100644 index 000000000..5ddebadca --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1038/a.zok @@ -0,0 +1,5 @@ +from "./b" import SIZE_WORDS + +def main(field[SIZE_WORDS] a): + assert(a == [0; SIZE_WORDS]) + return \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1038/b.zok b/zokrates_core_test/tests/tests/constants/issue_1038/b.zok new file mode 100644 index 000000000..864eeef55 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1038/b.zok @@ -0,0 +1,2 @@ +const u32 SIZE_BYTES = 136 +const u32 SIZE_WORDS = SIZE_BYTES/8 \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1038/reversed/a.zok b/zokrates_core_test/tests/tests/constants/issue_1038/reversed/a.zok new file mode 100644 index 000000000..864eeef55 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1038/reversed/a.zok @@ -0,0 +1,2 @@ +const u32 SIZE_BYTES = 136 +const u32 SIZE_WORDS = SIZE_BYTES/8 \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.json b/zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.json new file mode 100644 index 000000000..0de904eb9 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.json @@ -0,0 +1,4 @@ +{ + "entry_point": "./tests/tests/constants/issue_1038/reversed/b.zok", + "tests": [] +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.zok b/zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.zok new file mode 100644 index 000000000..78e0375f1 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1038/reversed/b.zok @@ -0,0 +1,5 @@ +from "./a" import SIZE_WORDS + +def main(field[SIZE_WORDS] a): + assert(a == [0; SIZE_WORDS]) + return \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1047/a.json b/zokrates_core_test/tests/tests/constants/issue_1047/a.json new file mode 100644 index 000000000..f7bab70f0 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1047/a.json @@ -0,0 +1,4 @@ +{ + "entry_point": "./tests/tests/constants/issue_1047/a.zok", + "tests": [] +} diff --git a/zokrates_core_test/tests/tests/constants/issue_1047/a.zok b/zokrates_core_test/tests/tests/constants/issue_1047/a.zok new file mode 100644 index 000000000..6c03c962b --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1047/a.zok @@ -0,0 +1,4 @@ +from "./b" import B + +def main(): + return \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1047/b.zok b/zokrates_core_test/tests/tests/constants/issue_1047/b.zok new file mode 100644 index 000000000..c9063cad6 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1047/b.zok @@ -0,0 +1,2 @@ +const field A = 1 +const field B = A + 1 \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1047/reversed/a.zok b/zokrates_core_test/tests/tests/constants/issue_1047/reversed/a.zok new file mode 100644 index 000000000..c9063cad6 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1047/reversed/a.zok @@ -0,0 +1,2 @@ +const field A = 1 +const field B = A + 1 \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.json b/zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.json new file mode 100644 index 000000000..579bfe1b7 --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.json @@ -0,0 +1,4 @@ +{ + "entry_point": "./tests/tests/constants/issue_1047/reversed/b.zok", + "tests": [] +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.zok b/zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.zok new file mode 100644 index 000000000..83f8a4e6f --- /dev/null +++ b/zokrates_core_test/tests/tests/constants/issue_1047/reversed/b.zok @@ -0,0 +1,4 @@ +from "./a" import B + +def main(): + return \ No newline at end of file From a5ca49f98c670036fb4850a86894d655e2a8a3bd Mon Sep 17 00:00:00 2001 From: schaeff Date: Tue, 23 Nov 2021 19:34:10 +0100 Subject: [PATCH 83/83] bump versions, changelog --- CHANGELOG.md | 18 ++++++++++++++++++ Cargo.lock | 16 ++++++++-------- changelogs/unreleased/1010-dark64 | 1 - changelogs/unreleased/1012-dark64 | 1 - changelogs/unreleased/1016-schaeff | 1 - changelogs/unreleased/1025-schaeff | 1 - changelogs/unreleased/1030-schaeff | 1 - changelogs/unreleased/1032-schaeff | 1 - changelogs/unreleased/1034-schaeff | 1 - changelogs/unreleased/1037-schaeff | 1 - changelogs/unreleased/1050-schaeff | 1 - changelogs/unreleased/982-dark64 | 1 - changelogs/unreleased/997-dark64 | 1 - zokrates_cli/Cargo.toml | 2 +- zokrates_core/Cargo.toml | 2 +- zokrates_core_test/Cargo.toml | 2 +- zokrates_embed/Cargo.toml | 2 +- zokrates_js/Cargo.toml | 2 +- zokrates_js/package.json | 2 +- zokrates_parser/Cargo.toml | 2 +- zokrates_pest_ast/Cargo.toml | 2 +- zokrates_stdlib/Cargo.toml | 2 +- zokrates_test/Cargo.toml | 2 +- 23 files changed, 36 insertions(+), 29 deletions(-) delete mode 100644 changelogs/unreleased/1010-dark64 delete mode 100644 changelogs/unreleased/1012-dark64 delete mode 100644 changelogs/unreleased/1016-schaeff delete mode 100644 changelogs/unreleased/1025-schaeff delete mode 100644 changelogs/unreleased/1030-schaeff delete mode 100644 changelogs/unreleased/1032-schaeff delete mode 100644 changelogs/unreleased/1034-schaeff delete mode 100644 changelogs/unreleased/1037-schaeff delete mode 100644 changelogs/unreleased/1050-schaeff delete mode 100644 changelogs/unreleased/982-dark64 delete mode 100644 changelogs/unreleased/997-dark64 diff --git a/CHANGELOG.md b/CHANGELOG.md index 94623389a..cc9ce6447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. ## [Unreleased] https://github.com/Zokrates/ZoKrates/compare/latest...develop +## [0.7.8] - 2021-11-23 + +### Release +- https://github.com/Zokrates/ZoKrates/releases/tag/0.7.8 + +### Changes +- Fix reduction of constants (#1050, @schaeff) +- Implement type aliasing (#982, @dark64) +- Remove confusing returns (#1037, @schaeff) +- Reduce cost of dynamic comparison (#1025, @schaeff) +- Fix false positives and false negatives in struct generic inference (#1016, @schaeff) +- Make field to uint casts truncate values bigger than uint max (#997, @dark64) +- Add Marlin proving scheme to the backend table in the book (#1034, @schaeff) +- Fail at compile time when complex types are known not to be equal (#1032, @schaeff) +- Allow more postfix expressions, exit gracefully when trying to call anything else than an identifier (#1030, @schaeff) +- Add optional message to assert statement (#1012, @dark64) +- Introduce ternary operator (#1010, @dark64) + ## [0.7.7] - 2021-10-04 ### Release diff --git a/Cargo.lock b/Cargo.lock index 48b537036..41db65de2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2380,7 +2380,7 @@ dependencies = [ [[package]] name = "zokrates_cli" -version = "0.7.7" +version = "0.7.8" dependencies = [ "assert_cli", "bincode", @@ -2407,7 +2407,7 @@ version = "0.1.0" [[package]] name = "zokrates_core" -version = "0.6.7" +version = "0.6.8" dependencies = [ "ark-bls12-377", "ark-bn254", @@ -2454,7 +2454,7 @@ dependencies = [ [[package]] name = "zokrates_core_test" -version = "0.2.4" +version = "0.2.5" dependencies = [ "zokrates_test", "zokrates_test_derive", @@ -2462,7 +2462,7 @@ dependencies = [ [[package]] name = "zokrates_embed" -version = "0.1.4" +version = "0.1.5" dependencies = [ "ark-bls12-377", "ark-bw6-761", @@ -2510,7 +2510,7 @@ dependencies = [ [[package]] name = "zokrates_parser" -version = "0.2.4" +version = "0.2.5" dependencies = [ "glob 0.2.11", "pest", @@ -2519,7 +2519,7 @@ dependencies = [ [[package]] name = "zokrates_pest_ast" -version = "0.2.3" +version = "0.2.4" dependencies = [ "from-pest", "glob 0.2.11", @@ -2531,7 +2531,7 @@ dependencies = [ [[package]] name = "zokrates_stdlib" -version = "0.2.4" +version = "0.2.5" dependencies = [ "fs_extra", "zokrates_test", @@ -2540,7 +2540,7 @@ dependencies = [ [[package]] name = "zokrates_test" -version = "0.1.7" +version = "0.1.8" dependencies = [ "serde", "serde_derive", diff --git a/changelogs/unreleased/1010-dark64 b/changelogs/unreleased/1010-dark64 deleted file mode 100644 index 6aa232ca5..000000000 --- a/changelogs/unreleased/1010-dark64 +++ /dev/null @@ -1 +0,0 @@ -Introduce ternary operator \ No newline at end of file diff --git a/changelogs/unreleased/1012-dark64 b/changelogs/unreleased/1012-dark64 deleted file mode 100644 index 7c55ef914..000000000 --- a/changelogs/unreleased/1012-dark64 +++ /dev/null @@ -1 +0,0 @@ -Add optional message to assert statement \ No newline at end of file diff --git a/changelogs/unreleased/1016-schaeff b/changelogs/unreleased/1016-schaeff deleted file mode 100644 index d944de965..000000000 --- a/changelogs/unreleased/1016-schaeff +++ /dev/null @@ -1 +0,0 @@ -Fix false positives and false negatives in struct generic inference diff --git a/changelogs/unreleased/1025-schaeff b/changelogs/unreleased/1025-schaeff deleted file mode 100644 index f30fe42d2..000000000 --- a/changelogs/unreleased/1025-schaeff +++ /dev/null @@ -1 +0,0 @@ -Reduce cost of dynamic comparison \ No newline at end of file diff --git a/changelogs/unreleased/1030-schaeff b/changelogs/unreleased/1030-schaeff deleted file mode 100644 index bfeaa2d0b..000000000 --- a/changelogs/unreleased/1030-schaeff +++ /dev/null @@ -1 +0,0 @@ -Allow more postfix expressions, exit gracefully when trying to call anything else than an identifier diff --git a/changelogs/unreleased/1032-schaeff b/changelogs/unreleased/1032-schaeff deleted file mode 100644 index 3ee328454..000000000 --- a/changelogs/unreleased/1032-schaeff +++ /dev/null @@ -1 +0,0 @@ -Fail at compile time when complex types are known not to be equal \ No newline at end of file diff --git a/changelogs/unreleased/1034-schaeff b/changelogs/unreleased/1034-schaeff deleted file mode 100644 index cc4498d13..000000000 --- a/changelogs/unreleased/1034-schaeff +++ /dev/null @@ -1 +0,0 @@ -Add Marlin proving scheme to the backend table in the book \ No newline at end of file diff --git a/changelogs/unreleased/1037-schaeff b/changelogs/unreleased/1037-schaeff deleted file mode 100644 index be5eb166b..000000000 --- a/changelogs/unreleased/1037-schaeff +++ /dev/null @@ -1 +0,0 @@ -Remove confusing returns diff --git a/changelogs/unreleased/1050-schaeff b/changelogs/unreleased/1050-schaeff deleted file mode 100644 index 29240f273..000000000 --- a/changelogs/unreleased/1050-schaeff +++ /dev/null @@ -1 +0,0 @@ -Fix reduction of constants \ No newline at end of file diff --git a/changelogs/unreleased/982-dark64 b/changelogs/unreleased/982-dark64 deleted file mode 100644 index 689198008..000000000 --- a/changelogs/unreleased/982-dark64 +++ /dev/null @@ -1 +0,0 @@ -Implement type aliasing \ No newline at end of file diff --git a/changelogs/unreleased/997-dark64 b/changelogs/unreleased/997-dark64 deleted file mode 100644 index 95d5971be..000000000 --- a/changelogs/unreleased/997-dark64 +++ /dev/null @@ -1 +0,0 @@ -Make field to uint casts truncate values bigger than uint max \ No newline at end of file diff --git a/zokrates_cli/Cargo.toml b/zokrates_cli/Cargo.toml index 5c2b04cca..9764c6907 100644 --- a/zokrates_cli/Cargo.toml +++ b/zokrates_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_cli" -version = "0.7.7" +version = "0.7.8" authors = ["Jacob Eberhardt ", "Dennis Kuhnert ", "Thibaut Schaeffer "] repository = "https://github.com/Zokrates/ZoKrates.git" edition = "2018" diff --git a/zokrates_core/Cargo.toml b/zokrates_core/Cargo.toml index 182be457b..d78d1ecdf 100644 --- a/zokrates_core/Cargo.toml +++ b/zokrates_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_core" -version = "0.6.7" +version = "0.6.8" edition = "2018" authors = ["Jacob Eberhardt ", "Dennis Kuhnert "] repository = "https://github.com/Zokrates/ZoKrates" diff --git a/zokrates_core_test/Cargo.toml b/zokrates_core_test/Cargo.toml index c7ee35856..2c77daf62 100644 --- a/zokrates_core_test/Cargo.toml +++ b/zokrates_core_test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_core_test" -version = "0.2.4" +version = "0.2.5" authors = ["schaeff "] edition = "2018" diff --git a/zokrates_embed/Cargo.toml b/zokrates_embed/Cargo.toml index 15cda3ee8..14cfd4a8b 100644 --- a/zokrates_embed/Cargo.toml +++ b/zokrates_embed/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_embed" -version = "0.1.4" +version = "0.1.5" authors = ["schaeff "] edition = "2018" diff --git a/zokrates_js/Cargo.toml b/zokrates_js/Cargo.toml index ef021eb03..0b29f4a24 100644 --- a/zokrates_js/Cargo.toml +++ b/zokrates_js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_js" -version = "1.0.36" +version = "1.0.37" authors = ["Darko Macesic"] edition = "2018" diff --git a/zokrates_js/package.json b/zokrates_js/package.json index 456a23e01..14b8d3d57 100644 --- a/zokrates_js/package.json +++ b/zokrates_js/package.json @@ -2,7 +2,7 @@ "name": "zokrates-js", "main": "index.js", "author": "Darko Macesic ", - "version": "1.0.36", + "version": "1.0.37", "keywords": [ "zokrates", "wasm-bindgen", diff --git a/zokrates_parser/Cargo.toml b/zokrates_parser/Cargo.toml index fbfd76d8b..065729457 100644 --- a/zokrates_parser/Cargo.toml +++ b/zokrates_parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_parser" -version = "0.2.4" +version = "0.2.5" authors = ["JacobEberhardt "] edition = "2018" diff --git a/zokrates_pest_ast/Cargo.toml b/zokrates_pest_ast/Cargo.toml index 6b476c83e..36670964f 100644 --- a/zokrates_pest_ast/Cargo.toml +++ b/zokrates_pest_ast/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_pest_ast" -version = "0.2.3" +version = "0.2.4" authors = ["schaeff "] edition = "2018" diff --git a/zokrates_stdlib/Cargo.toml b/zokrates_stdlib/Cargo.toml index 57116d409..09ac12dfe 100644 --- a/zokrates_stdlib/Cargo.toml +++ b/zokrates_stdlib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_stdlib" -version = "0.2.4" +version = "0.2.5" authors = ["Stefan Deml ", "schaeff "] edition = "2018" diff --git a/zokrates_test/Cargo.toml b/zokrates_test/Cargo.toml index 7444ff2a0..40999ce50 100644 --- a/zokrates_test/Cargo.toml +++ b/zokrates_test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zokrates_test" -version = "0.1.7" +version = "0.1.8" authors = ["schaeff "] edition = "2018"