Skip to content

Commit 9f6cbe3

Browse files
minor cleanup
1 parent ca1f6ba commit 9f6cbe3

6 files changed

Lines changed: 11 additions & 17 deletions

File tree

examples/blocking.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ fn main() {
2424
println!("{}", runner_1.report());
2525

2626
let root_mm = runner_1.egraph.find(runner_1.roots[0]);
27-
let split_guide_sketch = rise::sketchify(SPLIT_GUIDE, true);
28-
println!("Sketch:\n{}", split_guide_sketch.pretty(50));
27+
let split_guide_sketch = rise::sketchify(SPLIT_GUIDE, false);
2928
let (_, sketch_extracted_split_guide) =
3029
sketch::eclass_extract(&split_guide_sketch, AstSize, &runner_1.egraph, root_mm).unwrap();
3130

src/rewrite_system/rise/func.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use egg::{Applier, EGraph, Id, Language, Pattern, PatternAst, RecExpr, Subst, Symbol, Var};
22
use hashbrown::HashSet;
33

4-
use crate::rewrite_system::rise::kind::Kindable;
5-
6-
use super::{Index, Kind, Rise, RiseAnalysis};
4+
use super::{Index, Kind, Kindable, Rise, RiseAnalysis};
75

86
pub fn pat(pat: &str) -> impl Applier<Rise, RiseAnalysis> {
97
pat.parse::<Pattern<Rise>>().unwrap()

src/rewrite_system/rise/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use kind::{Kind, Kindable};
1515

1616
pub use analysis::RiseAnalysis;
1717
pub use lang::Rise;
18-
use num::Integer;
1918
pub use pp::PrettyPrint;
2019

2120
use crate::sketch::{Sketch, SketchLang};

src/rewrite_system/rise/nat/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ fn check_equivalence<'a, 'b: 'a>(
3535
if cache.check_cache_equiv(lhs, rhs) {
3636
return true;
3737
}
38-
println!();
39-
println!("{lhs}");
40-
println!("{rhs}");
38+
// println!();
39+
// println!("{lhs}");
40+
// println!("{rhs}");
4141

4242
let rf_lhs: RationalFunction = lhs.try_into().unwrap();
4343
let rf_rhs: RationalFunction = rhs.try_into().unwrap();
4444

45-
println!("{rf_lhs}");
46-
println!("{rf_rhs}");
47-
println!("{}", rf_lhs == rf_rhs);
45+
// println!("{rf_lhs}");
46+
// println!("{rf_rhs}");
47+
// println!("{}", rf_lhs == rf_rhs);
4848

4949
if rf_lhs == rf_rhs {
5050
cache.add_pair_to_cache(lhs, rhs);

src/rewrite_system/rise/pp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn get_rise_style(node: &Rise) -> (ColoredString, bool) {
6666
| Rise::ReduceSeqUnroll
6767
| Rise::Float(_) => (node.to_string().yellow(), false),
6868

69-
Rise::Integer(i) => (format!("{i}i").cyan(), false),
69+
Rise::Integer(i) => (format!("{i}int").cyan(), false),
7070
}
7171
}
7272

@@ -96,7 +96,7 @@ fn fmt_ty_node(node: &Rise, children: &[String], fn_brackets: bool) -> ColoredSt
9696
Rise::NatMul(_) => format!("({} * {})", children[0], children[1]).white(),
9797
Rise::NatDiv(_) => format!("({} / {})", children[0], children[1]).white(),
9898
Rise::NatPow(_) => format!("({} ^ {})", children[0], children[1]).white(),
99-
Rise::Integer(i) => format!("{i}i").cyan(),
99+
Rise::Integer(i) => format!("{i}int").cyan(),
100100

101101
_ => panic!("Expected type node but found {node}"),
102102
}

src/rewrite_system/rise/shifted.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ impl<A: Applier<Rise, RiseAnalysis>> Applier<Rise, RiseAnalysis> for ShiftedChec
8585
searcher_ast: Option<&PatternAst<Rise>>,
8686
rule_name: Symbol,
8787
) -> Vec<Id> {
88+
let expected = &egraph[subst[self.new_var]].data.beta_extract;
8889
let extract = &egraph[subst[self.var]].data.beta_extract;
89-
// dbg!(extract);
9090
let shifted = shift_copy(extract, self.shift, self.cutoff);
9191

92-
// dbg!(&shifted);
93-
let expected = &egraph[subst[self.new_var]].data.beta_extract;
9492
if shifted == *expected {
9593
self.applier
9694
.apply_one(egraph, eclass, subst, searcher_ast, rule_name)

0 commit comments

Comments
 (0)