Skip to content

Commit 25f0da2

Browse files
committed
Fix all paths
1 parent 662e5f1 commit 25f0da2

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

lib/elixir/lib/module/types/descr.ex

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4458,14 +4458,17 @@ defmodule Module.Types.Descr do
44584458
{:gt, bdd1, {lit2, c2, u2, d2}} ->
44594459
{lit2, c2, bdd_union(bdd1, u2), d2}
44604460

4461-
{:eq, {_, _}, bdd2} ->
4462-
bdd2
4463-
4464-
{:eq, bdd1, {_, _}} ->
4465-
bdd1
4466-
44674461
{:eq, {lit, c1, u1, d1}, {_, c2, u2, d2}} ->
44684462
{lit, bdd_union(c1, c2), bdd_union(u1, u2), bdd_union(d1, d2)}
4463+
4464+
{:eq, {lit, _, u1, d1}, _} ->
4465+
{lit, :bdd_top, u1, d1}
4466+
4467+
{:eq, _, {lit, _, u2, d2}} ->
4468+
{lit, :bdd_top, u2, d2}
4469+
4470+
{:eq, _, _} ->
4471+
bdd1
44694472
end
44704473
end
44714474
end
@@ -4508,14 +4511,14 @@ defmodule Module.Types.Descr do
45084511
bdd_difference(bdd_union(d1, u1), bdd_union(d2, u2))}
45094512
end
45104513

4511-
{:eq, {_, _}, {_, _}} ->
4512-
:bdd_bot
4513-
45144514
{:eq, _, {lit, c2, u2, _d2}} ->
45154515
{lit, bdd_negation(bdd_union(c2, u2)), :bdd_bot, :bdd_bot}
45164516

45174517
{:eq, {lit, _c1, u1, d1}, _} ->
45184518
{lit, :bdd_bot, :bdd_bot, bdd_union(d1, u1)}
4519+
4520+
{:eq, _, _} ->
4521+
:bdd_bot
45194522
end
45204523
end
45214524
end
@@ -4559,12 +4562,6 @@ defmodule Module.Types.Descr do
45594562
{lit2, bdd_intersection(bdd1, c2), bdd_intersection(bdd1, u2),
45604563
bdd_intersection(bdd1, d2)}
45614564

4562-
{:eq, {_, _} = bdd1, _} ->
4563-
bdd1
4564-
4565-
{:eq, _, {_, _} = bdd2} ->
4566-
bdd2
4567-
45684565
# Notice that (l ? c1, u1, d1) and (l ? c2, u2, d2) is, on paper, equivalent to
45694566
# [(l /\ c1) \/ u1 \/ (not l /\ d1)] and [(l /\ c2) \/ u2 \/ (not l /\ d2)]
45704567
# which is equivalent, by distributivity of intersection over union, to
@@ -4580,6 +4577,15 @@ defmodule Module.Types.Descr do
45804577
{lit, bdd_union(bdd_intersection_union(c1, c2, u2), bdd_intersection(u1, c2)),
45814578
bdd_intersection(u1, u2),
45824579
bdd_union(bdd_intersection_union(d1, u2, d2), bdd_intersection(u1, d2))}
4580+
4581+
{:eq, {lit, c1, u1, _}, _} ->
4582+
{lit, bdd_union(c1, u1), :bdd_bot, :bdd_bot}
4583+
4584+
{:eq, _, {lit, c2, u2, _}} ->
4585+
{lit, bdd_union(c2, u2), :bdd_bot, :bdd_bot}
4586+
4587+
{:eq, bdd, _} ->
4588+
bdd
45834589
end
45844590
end
45854591
end

0 commit comments

Comments
 (0)