Skip to content

Commit a3a4306

Browse files
committed
stats
1 parent fb6401e commit a3a4306

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ mod set_cost;
3434
pub use set_cost::*;
3535
mod size;
3636
pub use size::*;
37+
mod stats;
38+
pub use stats::*;
3739

3840
pub fn new_experimental_egraph() -> EGraph {
3941
let mut egraph = EGraph::default();
@@ -48,4 +50,7 @@ pub fn new_experimental_egraph() -> EGraph {
4850
.add_command("run-schedule".into(), Arc::new(RunExtendedSchedule))
4951
.unwrap();
5052
egraph
53+
.add_command("egraph-detailed-stats".into(), Arc::new(EgraphDetailedStats))
54+
.unwrap();
55+
egraph
5156
}

tests/herbie-rational.egg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,4 +567,8 @@
567567
(let tgt (Div one sqrt5))
568568
(run 6)
569569
(check (= e14 tgt))
570+
571+
; Get detailed statistics
572+
(egraph-detailed-stats)
573+
570574
(pop)

tests/web-demo/detailed-stats.egg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; Test the egraph-detailed-stats command
2+
3+
(datatype Math)
4+
(constructor add (Math Math) Math)
5+
(constructor mul (Math Math) Math)
6+
(constructor num (i64) Math)
7+
8+
; Add some terms
9+
(num 1)
10+
(num 2)
11+
(add (num 1) (num 2))
12+
(mul (num 1) (num 2))
13+
14+
; Create some equality classes
15+
(union (num 1) (num 2))
16+
17+
(run-schedule (saturate (run)))
18+
19+
; Get detailed statistics
20+
(egraph-detailed-stats)

0 commit comments

Comments
 (0)