Support n-ary biconditionals
For convenience, support biconditionals with more than one argument. An n-ary “if and only if” statement F_1 <-> F_2 <-> ... <-> F_n is to be interpreted as F_1 <-> F_2 and F2 <-> F3 and ... and F_(n - 1) <-> F_n
This commit is contained in:
@@ -160,9 +160,19 @@ impl<'formula> std::fmt::Debug for FormulaDisplay<'formula>
|
||||
direction: crate::ImplicationDirection::RightToLeft, antecedent, implication})
|
||||
=> write!(format, "{:?} <- {:?}", display_formula(implication, precedence),
|
||||
display_formula(antecedent, precedence))?,
|
||||
crate::Formula::IfAndOnlyIf(crate::IfAndOnlyIf{left, right})
|
||||
=> write!(format, "{:?} <-> {:?}", display_formula(left, precedence),
|
||||
display_formula(right, precedence))?,
|
||||
crate::Formula::IfAndOnlyIf(arguments) =>
|
||||
{
|
||||
let mut separator = "";
|
||||
|
||||
assert!(!arguments.is_empty());
|
||||
|
||||
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