From 8d4e48944c0c6ed76ebec4620d8bfead07ab24bb Mon Sep 17 00:00:00 2001 From: clararod9 Date: Tue, 17 May 2022 16:55:27 +0200 Subject: [PATCH] determinizing code generation --- constraint_generation/src/execute.rs | 4 ++-- constraint_generation/src/execution_data/type_definitions.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/constraint_generation/src/execute.rs b/constraint_generation/src/execute.rs index 82d447577..89228c22e 100644 --- a/constraint_generation/src/execute.rs +++ b/constraint_generation/src/execute.rs @@ -16,7 +16,7 @@ use super::{ UsefulConstants, }; use circom_algebra::num_bigint::BigInt; -use std::collections::HashMap; +use std::collections::BTreeMap; type AExpr = ArithmeticExpressionGen; #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)] @@ -986,7 +986,7 @@ fn execute_template_call( let is_parallel = program_archive.get_template_data(id).is_parallel(); let args_names = program_archive.get_template_data(id).get_name_of_params(); let template_body = program_archive.get_template_data(id).get_body_as_vec(); - let mut args_to_values = HashMap::new(); + let mut args_to_values = BTreeMap::new(); debug_assert_eq!(args_names.len(), parameter_values.len()); let mut instantiation_name = format!("{}(", id); for (name, value) in args_names.iter().zip(parameter_values) { diff --git a/constraint_generation/src/execution_data/type_definitions.rs b/constraint_generation/src/execution_data/type_definitions.rs index e3372062f..60cffcf44 100644 --- a/constraint_generation/src/execution_data/type_definitions.rs +++ b/constraint_generation/src/execution_data/type_definitions.rs @@ -1,10 +1,10 @@ use super::AExpressionSlice; use super::Constraint as ConstraintGen; -use std::collections::HashMap; +use std::collections::BTreeMap; pub type NodePointer = usize; pub type Constraint = ConstraintGen; -pub type ParameterContext = HashMap; +pub type ParameterContext = BTreeMap; pub type SignalCollector = Vec<(String, Vec)>; pub type ComponentCollector = Vec<(String, Vec)>; pub struct SubComponentData {