From 51843b840dec44d588ef6318fc8c5ce03e100761 Mon Sep 17 00:00:00 2001 From: Mroik Date: Thu, 9 May 2024 05:24:00 +0200 Subject: [PATCH] Change symbols rappresentation --- src/fitch.rs | 6 +++--- src/parser.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fitch.rs b/src/fitch.rs index 09f5fe6..ee748a2 100644 --- a/src/fitch.rs +++ b/src/fitch.rs @@ -16,9 +16,9 @@ impl Display for Proposition { match self { Self::Absurdum => write!(f, "⊥"), Self::Term(name) => write!(f, "{}", name), - Self::And(left, right) => write!(f, "({} ^ {})", left, right), - Self::Or(left, right) => write!(f, "({} v {})", left, right), - Self::Not(t) => write!(f, "(!{})", t), + Self::And(left, right) => write!(f, "({} & {})", left, right), + Self::Or(left, right) => write!(f, "({} | {})", left, right), + Self::Not(t) => write!(f, "(~{})", t), Self::Implies(left, right) => write!(f, "({} => {})", left, right), Self::Iff(left, right) => write!(f, "({} <=> {})", left, right), } diff --git a/src/parser.rs b/src/parser.rs index 7bebe6b..924a58e 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -51,7 +51,7 @@ fn parse_and(queue: &str) -> Result { Result::Failure => Result::Failure, Result::Success(left, rest) => { queue = rest.trim_start(); - if queue.is_empty() || queue.chars().nth(0).unwrap() != '^' { + if queue.is_empty() || queue.chars().nth(0).unwrap() != '&' { return Result::Failure; } queue = queue[1..].trim_start(); @@ -83,7 +83,7 @@ fn parse_or(queue: &str) -> Result { Result::Failure => Result::Failure, Result::Success(left, rest) => { queue = rest.trim_start(); - if queue.is_empty() || queue.chars().nth(0).unwrap() != 'v' { + if queue.is_empty() || queue.chars().nth(0).unwrap() != '|' { return Result::Failure; } queue = queue[1..].trim_start();