Patrick Lühne
551c35ed75
The precedence rules of binary operations are a bit trickier than expected. The fact that a parent and a child term have the same precedence level doesn’t automatically mean that parentheses can be omitted. This is the case, for example, with a - (b + c) While addition and subtraction have the same precedence level, the parenthesis cannot be omitted. In general, this happens on the right- hand side of the subtraction, division, and modulo operators if the right-hand side has the same precedence level. This patch fixes the output of binary operations accordingly. |
||
---|---|---|
src | ||
.gitignore | ||
Cargo.toml | ||
LICENSE.md | ||
README.md |
foliage
First-order logic with integer arithmetics in Rust
This Rust crate provides an abstract syntax tree for first-order formulas with integer arithmetics.
Supported Formulas
- Booleans values (
true
andfalse
) - predicates
- negated formulas
- comparisons of terms (<, ≤, >, ≥, =, ≠)
- implications and biconditionals
- conjunctions and disjunctions of formulas
- existentially and universally quantified formulas
Supported Terms
- Boolean values (
true
andfalse
) - integers
- strings
- special integers (infimum and supremum)
- symbolic functions
- variables
- binary operations (addition, subtraction, multiplication, division, modulo, exponentiation)
- unary operations (absolute value, numeric negation)