# logic

**structural logic based on equivalence graphs**
[](https://github.com/logic-lang/logic/blob/master/LICENSE)
[](https://crates.io/crates/logic-lang)
[](https://docs.rs/logic-lang)
[](https://github.com/logic-lang/logic/actions)
Logic is a modern structural logic library based on equivalence graphs.
It allows defining a (term-based) language as a generic abstract syntax tree (AST) associated with rewriting rules expressing equivalence relations.
Lowering expressions to index-based hir then allows for matching and substituting the current representation using equality saturation.
Minimizing rule sets or determining if a rewriting system is terminating through graph algorithms might be investigated in the future.
Note: this is an exploratory project.
Current state
- The public API is constantly evolving and substantial changes are expected prior to stable releases (x.0.0).
- Feel free to suggest problems that could help to improve the library and provide realistic use cases.
- Help is welcomed.
Getting started
An extensive tutorial is currently under construction, but you can still read the documentation for the latest version or browse the sources.
Try the web demo running on WebAssembly.