Skip to content

MilkeeyCat/expr_simplifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expr_simplifier

Simple maffs expression simplifier(simplificator?) using e-graphs.

In case you don't know what e-graphs are, checkout:

Example of usage

To use this puppy you need 2 things:

  • file with rewrite rules(in a format pattern => rewrite, for example a + 0 => a), each rule has to be on a separate line.
  • you need only the file really.

Run go run ./cmd/main.go -rules ./your/path/to/rewrite.rules "the expression you want to simplify".

There's also a way to produce a resulting e-graph in SVG format, to do that, pass -viz flag.

Note on produced visualization

It's not quite correct. The nodes that have edges to other nodes in the same cluster(grey box) actually point the the box itself, but graphviz doesn't allow such edges. So is actually

About

Maffs expression simplifier using e-graphs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages