# This file contains false negatives: filters that in theory prove implication
# of the corresponding predicates, but in practice the Implicator cannot prove.
#
# False negatives are acceptable because in the worst case, they lead to
# sub-optimal query plans. They prevent the optimizer from considering a scan
# over a partial index when it is theoretically guaranteed that the partial
# index contains the result rows.
#
# False positives are not acceptable because they could produce incorrect query
# results. A false positive would allow the optimizer to consider a scan over a
# partial index when it is not guaranteed that the partial index contains all
# result rows. The effect would be only returning a subset of all rows that
# should be returned.

predtest vars=(a int, b int)
a IN (1, 2, b)
=>
a IN (1, 2) OR a = b
----
false

predtest vars=(a int, b int)
a IN (1, 2, b)
=>
a IN (1, 2) OR b = a
----
false

predtest vars=(a int, b int)
a IN (1, 2) OR b = 20
=>
a = 1 OR b = 20 OR a = 2
----
false

predtest vars=(a int, b int)
1 IN (a, b)
=>
a = 1 OR b = 1
----
false

# To handle this case we'd have to create constraints at each AndExpr in the
# filter and check for containment, which would add complexity for a case which
# is unlikely to occur in the real-world.
predtest vars=(a int, b int)
a >= 2 AND b > 0
=>
(a, b) > (2, 0)
----
false

# We do not prove implication in this case because a + 10 > 4 is normalized to
# a > -6 before a + 10 can be replaced with b.
predtest vars=(a int, b int as (a + 10) virtual)
a + 10 > 4
=>
a + 10 IS NOT NULL
----
false
