From de4105dce3ca16941d6cbd3b0627c799aeaf2960 Mon Sep 17 00:00:00 2001 From: Myocardinal Date: Thu, 29 Aug 2024 20:02:51 -0400 Subject: [PATCH] Removed old, unused debug code --- .github/workflows/publish-pypi.yml | 2 +- src/language.rs | 16 ++++++------- src/lib.rs | 38 +++++++++++++++--------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 8e62cc2..f17073e 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -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 diff --git a/src/language.rs b/src/language.rs index 85aa575..0a033f9 100644 --- a/src/language.rs +++ b/src/language.rs @@ -521,10 +521,10 @@ pub fn rules>() -> Vec> { // 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 for FMulApplier { fn apply_one(&self, egraph: &mut EGraph, matched_id: Id, subst: &Subst, _: Option<&PatternAst>, _: Symbol) -> Vec { @@ -541,10 +541,10 @@ impl Applier for FMulApplier { } } -struct FAddApplier { - foo: Var, - bar: Var, -} +// struct FAddApplier { +// foo: Var, +// bar: Var, +// } impl Applier for FAddApplier { fn apply_one(&self, egraph: &mut EGraph, matched_id: Id, subst: &Subst, _: Option<&PatternAst>, _: Symbol) -> Vec { diff --git a/src/lib.rs b/src/lib.rs index 20d0bb1..0d1d386 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,7 +34,7 @@ fn lp_optimize(program: String, n_sec: i32) -> String { .with_expr(&program_expr); let runner = runner.run(&rules::()); - let num_iter_sat = runner.iterations.len() - 1; + // let num_iter_sat = runner.iterations.len() - 1; // Print equality saturation stats // COMMENT THIS OUT LATER @@ -67,21 +67,21 @@ fn eggwrap(_py: Python<'_>, m: &PyModule) -> PyResult<()> { Ok(()) } -fn get_stats(egraph: &EGraph) -> (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, - ) -} \ No newline at end of file +// fn get_stats(egraph: &EGraph) -> (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, +// ) +// } \ No newline at end of file