simplify '(x || 1)' to '1'
commita0886db12307d2633b04ec44342099a2955794a5
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Wed, 7 Dec 2016 16:13:24 +0000 (7 17:13 +0100)
committerChristopher Li <sparse@chrisli.org>
Mon, 13 Feb 2017 01:34:46 +0000 (13 09:34 +0800)
treec18df7caf796801fb1109dc1165622f00b2ee92e
parent5425db10d4d35895ba3ca390478c624233ec027d
simplify '(x || 1)' to '1'

There is simplifications for:
(x && 0) => 0
(x && 1) => x
(x || 0) => x
but the fourth case '(x || 1)' is missing.

This patch add the missing simplification and a small test case.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
simplify.c
validation/optim/bool-simplify.c [new file with mode: 0644]