https://github.com/codx-dev/truthful
A logical expression parser, optimizer and evaluator.
https://github.com/codx-dev/truthful
Last synced: 10 months ago
JSON representation
A logical expression parser, optimizer and evaluator.
- Host: GitHub
- URL: https://github.com/codx-dev/truthful
- Owner: codx-dev
- License: apache-2.0
- Created: 2022-12-17T03:09:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-17T23:45:35.000Z (over 3 years ago)
- Last Synced: 2025-05-18T22:34:34.011Z (11 months ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Truthful
[](https://crates.io/crates/truthful)
[](https://docs.rs/truthful/)
[]()
A logical expression parser, optimizer and evaluator.
```shell
$ cargo run
welcome! enter ? for help
> a or (a and b)
evaluating "a"
a eval
0 0
1 1
> !a v b
evaluating (!"a" v "b")
a b eval
0 0 1
0 1 1
1 0 0
1 1 1
> q
bye!
```
# TODO
* Grammar operator precedence.
* Actual optimization (the current one is a bunch of NAND + DeMorgan naive transformations).