Compare commits
No commits in common. "master" and "v0.1.0" have entirely different histories.
@ -1,4 +1,4 @@
|
||||
# foliage [](https://crates.io/crates/foliage)
|
||||
# foliage [](https://github.com/potassco/foliage/releases) [](https://crates.io/crates/foliage)
|
||||
|
||||
> First-order logic with integer arithmetics in Rust
|
||||
|
||||
|
@ -67,26 +67,6 @@ impl Precedence for crate::Formula
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for crate::SpecialInteger
|
||||
{
|
||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
{
|
||||
match &self
|
||||
{
|
||||
crate::SpecialInteger::Infimum => write!(format, "#inf"),
|
||||
crate::SpecialInteger::Supremum => write!(format, "#sup"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for crate::SpecialInteger
|
||||
{
|
||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
{
|
||||
write!(format, "{:?}", &self)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for crate::FunctionDeclaration
|
||||
{
|
||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
@ -141,7 +121,8 @@ struct TermDisplay<'term>
|
||||
term: &'term crate::Term,
|
||||
}
|
||||
|
||||
fn display_term(term: &crate::Term, parent_precedence: Option<i32>) -> TermDisplay
|
||||
fn display_term<'term>(term: &'term crate::Term, parent_precedence: Option<i32>)
|
||||
-> TermDisplay<'term>
|
||||
{
|
||||
TermDisplay
|
||||
{
|
||||
@ -171,7 +152,8 @@ impl<'term> std::fmt::Debug for TermDisplay<'term>
|
||||
{
|
||||
crate::Term::Boolean(true) => write!(format, "true"),
|
||||
crate::Term::Boolean(false) => write!(format, "false"),
|
||||
crate::Term::SpecialInteger(value) => write!(format, "{:?}", value),
|
||||
crate::Term::SpecialInteger(crate::SpecialInteger::Infimum) => write!(format, "#inf"),
|
||||
crate::Term::SpecialInteger(crate::SpecialInteger::Supremum) => write!(format, "#sup"),
|
||||
crate::Term::Integer(value) => write!(format, "{}", value),
|
||||
crate::Term::String(value) => write!(format, "\"{}\"", value),
|
||||
crate::Term::Variable(variable) => write!(format, "{:?}", variable.declaration),
|
||||
@ -183,9 +165,9 @@ impl<'term> std::fmt::Debug for TermDisplay<'term>
|
||||
"number of function arguments differs from declaration (expected {}, got {})",
|
||||
function.declaration.arity, function.arguments.len());
|
||||
|
||||
if !function.arguments.is_empty()
|
||||
if function.arguments.len() > 0
|
||||
{
|
||||
write!(format, "(")?;
|
||||
write!(format, "{}(", function.declaration.name)?;
|
||||
|
||||
let mut separator = "";
|
||||
|
||||
@ -256,7 +238,8 @@ struct FormulaDisplay<'formula>
|
||||
formula: &'formula crate::Formula,
|
||||
}
|
||||
|
||||
fn display_formula(formula: &crate::Formula, parent_precedence: Option<i32>) -> FormulaDisplay
|
||||
fn display_formula<'formula>(formula: &'formula crate::Formula, parent_precedence: Option<i32>)
|
||||
-> FormulaDisplay<'formula>
|
||||
{
|
||||
FormulaDisplay
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user