#constraints added to compilation output
This commit is contained in:
parent
93cf48b296
commit
4f86e8f321
1 changed files with 9 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
@ -213,6 +213,12 @@ fn main() {
|
||||||
let program_flattened =
|
let program_flattened =
|
||||||
Flattener::new(FieldPrime::get_required_bits()).flatten_program(program_ast);
|
Flattener::new(FieldPrime::get_required_bits()).flatten_program(program_ast);
|
||||||
|
|
||||||
|
// number of constraints the flattened program will translate to.
|
||||||
|
let num_constraints = &program_flattened.functions
|
||||||
|
.iter()
|
||||||
|
.find(|x| x.id == "main")
|
||||||
|
.unwrap().statements.len();
|
||||||
|
|
||||||
// serialize flattened program and write to binary file
|
// serialize flattened program and write to binary file
|
||||||
let bin_output_path = Path::new(sub_matches.value_of("output").unwrap());
|
let bin_output_path = Path::new(sub_matches.value_of("output").unwrap());
|
||||||
let mut bin_output_file = match File::create(&bin_output_path) {
|
let mut bin_output_file = match File::create(&bin_output_path) {
|
||||||
|
@ -237,10 +243,12 @@ fn main() {
|
||||||
// debugging output
|
// debugging output
|
||||||
//println!("Compiled program:\n{}", program_flattened);
|
//println!("Compiled program:\n{}", program_flattened);
|
||||||
|
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"Compiled code written to '{}', \nHuman readable code to '{}'",
|
"Compiled code written to '{}', \nHuman readable code to '{}'. \nNumber of constraints: {}",
|
||||||
bin_output_path.display(),
|
bin_output_path.display(),
|
||||||
hr_output_path.display(),
|
hr_output_path.display(),
|
||||||
|
num_constraints
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
("compute-witness", Some(sub_matches)) => {
|
("compute-witness", Some(sub_matches)) => {
|
||||||
|
|
Loading…
Reference in a new issue