Rewrite "(Xc) M b" as "b & X(b U c)", plus three similar rules.
* src/ltlvisit/simplify.hh (ltl_simplifier_options): New option reduce_size_stricly. * src/ltlvisit/simplify.cc (simplify_visitor): Implement these rules. * src/ltltest/reduc.cc: Check with reduce_size_strictly unset or set, but only use the latter result to check sizes. * src/ltltest/reduccmp.test: Test them. * doc/tl/tl.tex: Document them.
This commit is contained in:
parent
c9b34d684a
commit
bb56c26d1c
5 changed files with 122 additions and 48 deletions
|
|
@ -1747,6 +1747,24 @@ namespace spot
|
|||
}
|
||||
}
|
||||
}
|
||||
// If b is Boolean:
|
||||
// (Xc) U b = b | X(b M c)
|
||||
// (Xc) W b = b | X(b R c)
|
||||
if (!opt_.reduce_size_strictly
|
||||
&& fu1 && fu1->op() == unop::X && b->is_boolean())
|
||||
{
|
||||
formula* c = fu1->child()->clone();;
|
||||
fu1->destroy();
|
||||
formula* x =
|
||||
unop::instance(unop::X,
|
||||
binop::instance(op == binop::U
|
||||
? binop::M
|
||||
: binop::R,
|
||||
b->clone(), c));
|
||||
result_ =
|
||||
recurse_destroy(multop::instance(multop::Or, b, x));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (op == binop::M || op == binop::R)
|
||||
{
|
||||
|
|
@ -1791,6 +1809,25 @@ namespace spot
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If b is Boolean:
|
||||
// (Xc) R b = b & X(b W c)
|
||||
// (Xc) M b = b & X(b U c)
|
||||
if (!opt_.reduce_size_strictly
|
||||
&& fu1 && fu1->op() == unop::X && b->is_boolean())
|
||||
{
|
||||
formula* c = fu1->child()->clone();;
|
||||
fu1->destroy();
|
||||
formula* x =
|
||||
unop::instance(unop::X,
|
||||
binop::instance(op == binop::M
|
||||
? binop::U
|
||||
: binop::W,
|
||||
b->clone(), c));
|
||||
result_ =
|
||||
recurse_destroy(multop::instance(multop::And, b, x));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
case binop::Xor:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue