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

Commit

Permalink
Rutefig/231 applying cse to compiler (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
rutefig authored Aug 22, 2024
1 parent c07f98d commit 9c08b6d
Show file tree
Hide file tree
Showing 18 changed files with 882 additions and 288 deletions.
13 changes: 4 additions & 9 deletions src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,14 @@ impl<F: Field + Hash> Compiler<F> {
sbpir.without_trace()
}

#[allow(dead_code)]
fn cse(mut _circuit: SBPIR<F, NullTraceGenerator>) -> SBPIR<F, NullTraceGenerator> {
todo!()
}

/// Translate the queries to constraints
fn queries_into_constraints(
&mut self,
symbols: &SymTable,
setup: &MachineSetup<F>,
machine_name: &str,
state_id: &str,
) -> Vec<Constraint<F>> {
) -> Vec<Constraint<F, ()>> {
let exprs = setup.get_poly_constraints(state_id).unwrap();

exprs
Expand Down Expand Up @@ -433,10 +428,10 @@ impl<F: Field + Hash> Compiler<F> {
machine_name: &str,
machine_setup: &MachineSetup<F>,
state_id: &str,
) -> StepType<F> {
) -> StepType<F, ()> {
let handler = self.mapping.get_step_type_handler(machine_name, state_id);

let mut step_type: StepType<F> =
let mut step_type: StepType<F, ()> =
StepType::new(handler.uuid(), handler.annotation.to_string());

self.add_internal_signals(symbols, machine_name, &mut step_type, state_id);
Expand All @@ -453,7 +448,7 @@ impl<F: Field + Hash> Compiler<F> {
&mut self,
symbols: &SymTable,
machine_name: &str,
step_type: &mut StepType<F>,
step_type: &mut StepType<F, ()>,
state_id: &str,
) {
let internal_ids = self.get_all_internals(symbols, machine_name, state_id);
Expand Down
Loading

0 comments on commit 9c08b6d

Please sign in to comment.