From e9c5fbd8d9f611209e53ea8295066da2d3afc6d1 Mon Sep 17 00:00:00 2001 From: Khaled Hosseini Date: Sun, 27 Oct 2024 13:52:16 +0330 Subject: [PATCH] Update readme --- Cargo.toml | 2 +- Readme.md | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c8ee651..59ec504 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" authors = ["Khaled Hosseini"] homepage = "https://github.com/KhaledHosseini/propositional-logic" repository = "https://github.com/KhaledHosseini/propositional-logic" -documentation = "https://docs.rs/crate/bool-logic/" +documentation = "https://docs.rs/crate/boolean-logic/" description = "propositional logic evaluator that creates truth tables for propositional expressions" license = "MIT" keywords = ["boolean-logic","bool-logic", "propositional-logic", "boolean-expression", "truth-table"] diff --git a/Readme.md b/Readme.md index 9c43ccc..19e7283 100644 --- a/Readme.md +++ b/Readme.md @@ -20,15 +20,32 @@ Supported operators and symbols: Example:
- Truth table for `P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)` or `P or (Q and R) == (P or Q) and (P or R)` -![truth table 1](files/tt1.png) +| P | Q | R | (Q ∧ R) | (P ∨ (Q ∧ R)) | (P ∨ Q) | (P ∨ R) | ((P ∨ Q) ∧ (P ∨ R)) | ((P ∨ (Q ∧ R)) ≡ ((P ∨ Q) ∧ (P ∨ R))) | +|-------|-------|-------|---------|---------------|---------|---------|---------------------|---------------------------------------| +| true | true | true | true | true | true | true | true | true | +| true | true | false | false | true | true | true | true | true | +| true | false | true | false | true | true | true | true | true | +| true | false | false | false | true | true | true | true | true | +| false | true | true | true | true | true | true | true | true | +| false | true | false | false | false | true | false | false | true | +| false | false | true | false | false | false | true | false | true | +| false | false | false | false | false | false | false | false | true | + - Truth table for `(P ∧ (∼ Q)) ⇔ (P ⇒ Q)` or `(P and (not Q) <-> (P -> Q))` -![truth table 2](files/tt2.png) +| P | Q | ¬Q | (P ∧ ¬Q) | (P → Q) | ((P ∧ ¬Q) ↔ (P → Q)) | +|-------|-------|-------|----------|---------|---------------------- +| true | true | false | false | true | false | +| true | false | true | true | false | false | +| false | true | false | false | true | false | +| false | false | true | false | true | false | - Truth table for `not true or not false` -![alt text](files/tt3.png) +| P | Q | ¬P | ¬Q | (¬P ∨ ¬Q) | +|-------|------|------|-------|----------- +| false | true | true | false | true | # How to run 1. install `rust`. see [here](https://www.rust-lang.org/tools/install) for the instructions.