Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Move use chiquito::dsl::cb::* to circuit lambda #124

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions examples/fibonacci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ use std::hash::Hash;

use chiquito::{
ast::expr::*,
frontend::dsl::{
cb::*, // functions for constraint building
circuit, // main function for constructing an AST circuit
},
frontend::dsl::circuit, // main function for constructing an AST circuit
plonkish::backend::halo2::{chiquito2Halo2, ChiquitoHalo2Circuit}, /* compiles to
* Chiquito Halo2
* backend,
* which can be
* integrated into
* Halo2
* circuit */
* Chiquito Halo2
* backend,
* which can be
* integrated into
* Halo2
* circuit */
plonkish::compiler::{
cell_manager::SingleRowCellManager, // input for constructing the compiler
compile, // input for constructing the compiler
Expand All @@ -36,6 +33,9 @@ fn fibo_circuit<F: Field + From<u64> + Hash>() -> (Circuit<F>, Option<Assignment
// | 2 | 3 | 5 |
// | 3 | 5 | 8 |
// ...

use chiquito::frontend::dsl::cb::*; // functions for constraint building

let fibo = circuit::<F, (), _>("fibonacci", |ctx| {
// the following objects (forward signals, steptypes) are defined on the circuit-level

Expand Down Expand Up @@ -151,7 +151,7 @@ fn main() {

let result_plaf = prover_plaf.verify_par();

println!("result = {:#?}", result);
println!("result = {:#?}", result_plaf);

if let Err(failures) = &result_plaf {
for failure in failures.iter() {
Expand Down