Add trivial identity {b}=b and !{b}=!b for any Boolean formula b.
* src/ltlast/unop.cc: Perform the simplification. * src/ltlast/unop.hh, doc/tl/tl.tex: Document it. * src/ltltest/equals.test: Adjust test cases.
This commit is contained in:
parent
98f67973eb
commit
77d704ea9e
4 changed files with 28 additions and 18 deletions
|
|
@ -295,19 +295,25 @@ namespace spot
|
|||
break;
|
||||
|
||||
case Closure:
|
||||
if (child == constant::true_instance()
|
||||
|| child == constant::empty_word_instance())
|
||||
return constant::true_instance();
|
||||
if (child == constant::false_instance())
|
||||
// {0} = 0, {1} = 1, {b} = b
|
||||
if (child->is_boolean())
|
||||
return child;
|
||||
// {[*0]} = 1
|
||||
if (child == constant::empty_word_instance())
|
||||
return constant::true_instance();
|
||||
break;
|
||||
|
||||
case NegClosure:
|
||||
// {1} = 0, {[*0]} = 0
|
||||
if (child == constant::true_instance()
|
||||
|| child == constant::empty_word_instance())
|
||||
return constant::false_instance();
|
||||
// {0} = 1
|
||||
if (child == constant::false_instance())
|
||||
return constant::true_instance();
|
||||
// {b} = !b
|
||||
if (child->is_boolean())
|
||||
return unop::instance(Not, child);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue