Skip to content

Commit

Permalink
refactor: Remove stale functions and dependencies
Browse files Browse the repository at this point in the history
The library `triton-constraint-builder` was still defining methods for
code generation that were never used, and should not be used.

Additionally, some of the now-split-up crates were declaring
dependencies they did not use anymore.

changelog: ignore
  • Loading branch information
jan-ferdinand committed Sep 12, 2024
1 parent 5a52154 commit 358c67f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
1 change: 0 additions & 1 deletion triton-constraint-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ repository.workspace = true

[dependencies]
air.workspace = true
arbitrary.workspace = true
constraint-circuit.workspace = true
isa.workspace = true
itertools.workspace = true
Expand Down
27 changes: 0 additions & 27 deletions triton-constraint-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,13 @@ use constraint_circuit::DualRowIndicator;
use constraint_circuit::InputIndicator;
use constraint_circuit::SingleRowIndicator;
use itertools::Itertools;
use proc_macro2::TokenStream;
use std::fs::write;

use crate::codegen::Codegen;
use crate::codegen::RustBackend;
use crate::codegen::TasmBackend;
use crate::substitutions::AllSubstitutions;
use crate::substitutions::Substitutions;

pub mod codegen;
mod substitutions;

pub fn gen(mut constraints: Constraints, info: DegreeLoweringInfo) {
let substitutions = constraints.lower_to_target_degree_through_substitutions(info);
let degree_lowering_table_code = substitutions.generate_degree_lowering_table_code();

let constraints = constraints.combine_with_substitution_induced_constraints(substitutions);
let rust = RustBackend::constraint_evaluation_code(&constraints);
let tasm = TasmBackend::constraint_evaluation_code(&constraints);

write_code_to_file(
degree_lowering_table_code,
"triton-vm/src/table/degree_lowering_table.rs",
);
write_code_to_file(rust, "triton-vm/src/table/constraints.rs");
write_code_to_file(tasm, "triton-vm/src/air/tasm_air_constraints.rs");
}

fn write_code_to_file(code: TokenStream, file_name: &str) {
let syntax_tree = syn::parse2(code).unwrap();
let code = prettyplease::unparse(&syntax_tree);
write(file_name, code).unwrap();
}

#[derive(Debug, Clone)]
pub struct Constraints {
pub init: Vec<ConstraintCircuitMonad<SingleRowIndicator>>,
Expand Down
6 changes: 0 additions & 6 deletions triton-vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ isa.workspace = true
itertools.workspace = true
lazy_static.workspace = true
ndarray.workspace = true
nom.workspace = true
num-traits.workspace = true
prettyplease.workspace = true
proc-macro2.workspace = true
quote.workspace = true
rand.workspace = true
rand_core.workspace = true
rayon.workspace = true
serde.workspace = true
strum.workspace = true
syn.workspace = true
thiserror.workspace = true
twenty-first.workspace = true
unicode-width.workspace = true
Expand All @@ -49,7 +44,6 @@ assert2.workspace = true
cargo-husky.workspace = true
constraint-circuit.workspace = true
fs-err.workspace = true
pretty_assertions.workspace = true
prettyplease.workspace = true
proptest.workspace = true
proptest-arbitrary-interop.workspace = true
Expand Down

0 comments on commit 358c67f

Please sign in to comment.