#

Logic Tracer

[

](https://github.com/Yrrrrrf/logic_tracer)
[

](https://crates.io/crates/logic_tracer)
[

](https://docs.rs/logic_tracer)
Logic Traces is a simple crate that reads a logical proposition and interprets it to **build the truth table and the AST of the proposition**.
Makes use of regular expressions are used to validate the input and to tokenize the proposition.
Also implements the [Shunting Yard Algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm) (not yet) to build the AST.
s
## Examples
Check the [examples](./examples/) direcotry to see how to use the crate.
```bash
cargo run --example

```
## Roadmap
- [x] Validate Input Tokens (only valid tokens)
- [x] Variables (only letters)
- [x] Logical Operators (and, or, not, implies, iff)
- [x] Mathematical Operators (add, sub, mul, div, pow)
- [ ] Terms (only numbers, variables, variable with subindex)
- [x] Read a logical proposition
- [x] Tokenize the proposition
- [ ] Parse the proposition (make sure it is valid)
- [ ] Build the AST (Shunting Yard Algorithm) (use postfix notation)
- [ ] **Solve proposition** (evaluate the AST)
- [ ] Add good looking output (truth table, ast, function, etc.)
- [ ] Reduce a proposition to its simplest form (boolean algebra)
### Bonus (if I have time)
- [ ] Validate mathematical operators (add, sub, mul, div, pow)
- [ ] Add MathPropositions support (examples, tests, etc.)
----
## License
This project is licensed under the terms of the [MIT license](./LICENSE)