Sort comutative binops like we sort multops.
* src/ltlast/formula.hh (is_literal): Rename as... (get_literal): ... this. (is_literal): New method. (formula_ptr_less_than_multop): Rename as... (formula_ptr_less_than_bool_first): ... this. * src/ltlast/binop.cc: Use formula_ptr_less_than_bool_first. * src/ltlast/multop.cc, src/ltlast/formula.cc: Adjust to renamings.
This commit is contained in:
parent
228121c963
commit
c01909e3ff
4 changed files with 45 additions and 22 deletions
|
|
@ -339,9 +339,9 @@ namespace spot
|
|||
case Xor:
|
||||
{
|
||||
// Xor is commutative: sort operands.
|
||||
formula_ptr_less_than cmp;
|
||||
if (cmp(second, first) > 0)
|
||||
std::swap(first, second);
|
||||
formula_ptr_less_than_bool_first cmp;
|
||||
if (cmp(second, first))
|
||||
std::swap(second, first);
|
||||
}
|
||||
// - (1 ^ Exp) = !Exp
|
||||
// - (0 ^ Exp) = Exp
|
||||
|
|
@ -363,9 +363,9 @@ namespace spot
|
|||
case Equiv:
|
||||
{
|
||||
// Equiv is commutative: sort operands.
|
||||
formula_ptr_less_than cmp;
|
||||
if (cmp(second, first) > 0)
|
||||
std::swap(first, second);
|
||||
formula_ptr_less_than_bool_first cmp;
|
||||
if (cmp(second, first))
|
||||
std::swap(second, first);
|
||||
}
|
||||
// - (0 <=> Exp) = !Exp
|
||||
// - (1 <=> Exp) = Exp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue