Skip to content

Commit

Permalink
Change symbols rappresentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mroik committed May 9, 2024
1 parent d915f99 commit 51843b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/fitch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 51843b8

Please sign in to comment.