Continue parsing formulas
This commit is contained in:
@@ -389,12 +389,28 @@ impl<'formula> std::fmt::Debug for FormulaDisplay<'formula>
|
||||
separator = " or "
|
||||
}
|
||||
},
|
||||
crate::Formula::Implies(crate::Implies{antecedent, implication})
|
||||
=> write!(format, "{:?} -> {:?}", display_formula(antecedent, precedence),
|
||||
display_formula(implication, precedence))?,
|
||||
crate::Formula::IfAndOnlyIf(crate::IfAndOnlyIf{left, right})
|
||||
=> write!(format, "{:?} <-> {:?}", display_formula(left, precedence),
|
||||
display_formula(right, precedence))?,
|
||||
crate::Formula::Implies(crate::Implies{direction, antecedent, implication}) =>
|
||||
{
|
||||
let operator_symbol = match direction
|
||||
{
|
||||
crate::ImplicationDirection::LeftToRight => "->",
|
||||
crate::ImplicationDirection::RightToLeft => "<-",
|
||||
};
|
||||
|
||||
write!(format, "{:?} {} {:?}", display_formula(antecedent, precedence),
|
||||
operator_symbol, display_formula(implication, precedence))?;
|
||||
},
|
||||
crate::Formula::IfAndOnlyIf(arguments) =>
|
||||
{
|
||||
let mut separator = "";
|
||||
|
||||
for argument in arguments
|
||||
{
|
||||
write!(format, "{}{:?}", separator, display_formula(argument, precedence))?;
|
||||
|
||||
separator = " <-> ";
|
||||
}
|
||||
},
|
||||
crate::Formula::Compare(
|
||||
crate::Compare{operator: crate::ComparisonOperator::Less, left, right})
|
||||
=> write!(format, "{:?} < {:?}", display_term(left, None),
|
||||
|
Reference in New Issue
Block a user