Skip to content

Commit

Permalink
Fixing the n>1 bug by re-ordering atom and comparison within the fol …
Browse files Browse the repository at this point in the history
…grammar
  • Loading branch information
ZachJHansen authored and teiesti committed Nov 30, 2023
1 parent 2573625 commit e408732
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parsing/fol/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ relation = { greater_equal | less_equal | greater | less | not_equal | equal }

guard = { relation ~ general_term }

atomic_formula = { truth | falsity | atom | comparison }
atomic_formula = { truth | falsity | comparison | atom }
truth = { "#true" }
falsity = { "#false" }
comparison = { general_term ~ guard+ }
Expand Down
12 changes: 12 additions & 0 deletions src/parsing/fol/pest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,18 @@ mod tests {
}],
}),
),
(
"n > 1",
AtomicFormula::Comparison(Comparison {
term: GeneralTerm::Symbol("n".to_string()),
guards: vec![Guard {
relation: Relation::Greater,
term: GeneralTerm::IntegerTerm(IntegerTerm::BasicIntegerTerm(
BasicIntegerTerm::Numeral(1),
)),
}],
}),
),
(
"1 <= N$g > 3 < X$i",
AtomicFormula::Comparison(Comparison {
Expand Down

0 comments on commit e408732

Please sign in to comment.