logic_tracer

namelogic_tracer
created_at2023-12-25 22:48:03.592246
updated_at2023-12-31 01:14:31.518411
downloads128
descriptionRecognize a logic proposition and trace its truth value, also generate a truth table (still in development)
homepage
repositoryhttps://github.com/Yrrrrrf/logic_tracer
max_upload_size
id1080526
Fernando Bryan Reza Campos

documentation

readme

Algorithm
Logic Tracer

[github](https://github.com/Yrrrrrf/logic_tracer) [crates.io](https://crates.io/crates/logic_tracer) [docs.rs](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)
Commit count: 35

cargo fmt