Skip to content

Commit

Permalink
Removed old, unused debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Myocardinal committed Aug 30, 2024
1 parent 51386e1 commit de4105d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checking out repository
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
Expand Down
16 changes: 8 additions & 8 deletions src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,10 @@ pub fn rules<A: Analysis<TnsrLang>>() -> Vec<Rewrite<TnsrLang, TnsrAnalysis>> {
// rewrite!("div-mul-comm-r"; "(Div (Mul ?x ?y) ?z)" => "(Mul ?x (Div ?y ?z))"),
]}

struct FMulApplier {
foo: Var,
bar: Var,
}
// struct FMulApplier {
// foo: Var,
// bar: Var,
// }

impl Applier<TnsrLang, TnsrAnalysis> for FMulApplier {

Check failure on line 529 in src/language.rs

View workflow job for this annotation

GitHub Actions / Build eggwrap

cannot find type `FMulApplier` in this scope
fn apply_one(&self, egraph: &mut EGraph<TnsrLang, TnsrAnalysis>, matched_id: Id, subst: &Subst, _: Option<&PatternAst<TnsrLang>>, _: Symbol) -> Vec<Id> {
Expand All @@ -541,10 +541,10 @@ impl Applier<TnsrLang, TnsrAnalysis> for FMulApplier {
}
}

struct FAddApplier {
foo: Var,
bar: Var,
}
// struct FAddApplier {
// foo: Var,
// bar: Var,
// }

impl Applier<TnsrLang, TnsrAnalysis> for FAddApplier {

Check failure on line 549 in src/language.rs

View workflow job for this annotation

GitHub Actions / Build eggwrap

cannot find type `FAddApplier` in this scope
fn apply_one(&self, egraph: &mut EGraph<TnsrLang, TnsrAnalysis>, matched_id: Id, subst: &Subst, _: Option<&PatternAst<TnsrLang>>, _: Symbol) -> Vec<Id> {
Expand Down
38 changes: 19 additions & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn lp_optimize(program: String, n_sec: i32) -> String {
.with_expr(&program_expr);
let runner = runner.run(&rules::<TnsrAnalysis>());

let num_iter_sat = runner.iterations.len() - 1;
// let num_iter_sat = runner.iterations.len() - 1;

// Print equality saturation stats
// COMMENT THIS OUT LATER
Expand Down Expand Up @@ -67,21 +67,21 @@ fn eggwrap(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
Ok(())
}

fn get_stats(egraph: &EGraph<TnsrLang, TnsrAnalysis>) -> (usize, usize, f32, usize, f32) {
let num_enodes = egraph.total_size();
let num_classes = egraph.number_of_classes();
let avg_nodes_per_class = num_enodes as f32 / (num_classes as f32);
let num_edges = egraph
.classes()
.fold(0, |acc, c| c.iter().fold(0, |sum, n| n.len() + sum) + acc);
let num_programs = egraph
.classes()
.fold(0.0, |acc, c| acc + (c.len() as f32).log2());
(
num_enodes,
num_classes,
avg_nodes_per_class,
num_edges,
num_programs,
)
}
// fn get_stats(egraph: &EGraph<TnsrLang, TnsrAnalysis>) -> (usize, usize, f32, usize, f32) {
// let num_enodes = egraph.total_size();
// let num_classes = egraph.number_of_classes();
// let avg_nodes_per_class = num_enodes as f32 / (num_classes as f32);
// let num_edges = egraph
// .classes()
// .fold(0, |acc, c| c.iter().fold(0, |sum, n| n.len() + sum) + acc);
// let num_programs = egraph
// .classes()
// .fold(0.0, |acc, c| acc + (c.len() as f32).log2());
// (
// num_enodes,
// num_classes,
// avg_nodes_per_class,
// num_edges,
// num_programs,
// )
// }

0 comments on commit de4105d

Please sign in to comment.