Skip to content

Commit c9b6a10

Browse files
committed
Lattices are bi-heyting
1 parent 3f2428c commit c9b6a10

File tree

4 files changed

+353
-227
lines changed

4 files changed

+353
-227
lines changed

ocaml/typing/ctype.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,8 +1584,8 @@ let prim_mode mvar = function
15841584
let with_locality locality m =
15851585
let m' = Alloc.newvar () in
15861586
Locality.equate_exn (Alloc.locality m') locality;
1587-
Alloc.submode_exn m' (Alloc.set_locality_max m);
1588-
Alloc.submode_exn (Alloc.set_locality_min m) m';
1587+
Alloc.submode_exn m' (Alloc.join_with_locality Locality.Const.max m);
1588+
Alloc.submode_exn (Alloc.meet_with_locality Locality.Const.min m) m';
15891589
m'
15901590

15911591
let rec instance_prim_locals locals mvar macc finalret ty =
@@ -5574,17 +5574,17 @@ let mode_cross_left env ty mode =
55745574
let mode = Alloc.disallow_right mode in
55755575
let mode =
55765576
if Locality.Const.le upper_bounds.locality Locality.Const.min
5577-
then Alloc.set_locality_min mode
5577+
then Alloc.meet_with_locality Locality.Const.min mode
55785578
else mode
55795579
in
55805580
let mode =
55815581
if Linearity.Const.le upper_bounds.linearity Linearity.Const.min
5582-
then Alloc.set_linearity_min mode
5582+
then Alloc.meet_with_linearity Linearity.Const.min mode
55835583
else mode
55845584
in
55855585
let mode =
55865586
if Uniqueness.Const.le upper_bounds.uniqueness Uniqueness.Const.min
5587-
then Alloc.set_uniqueness_min mode
5587+
then Alloc.meet_with_uniqueness Uniqueness.Const.min mode
55885588
else mode
55895589
in
55905590
mode
@@ -5600,17 +5600,17 @@ let mode_cross_right env ty mode =
56005600
let mode = Alloc.disallow_left mode in
56015601
let mode =
56025602
if Locality.Const.le upper_bounds.locality Locality.Const.min
5603-
then Alloc.set_locality_max mode
5603+
then Alloc.join_with_locality Locality.Const.max mode
56045604
else mode
56055605
in
56065606
let mode =
56075607
if Linearity.Const.le upper_bounds.linearity Linearity.Const.min
5608-
then Alloc.set_linearity_max mode
5608+
then Alloc.join_with_linearity Linearity.Const.max mode
56095609
else mode
56105610
in
56115611
let mode =
56125612
if Uniqueness.Const.le upper_bounds.uniqueness Uniqueness.Const.min
5613-
then Alloc.set_uniqueness_max mode
5613+
then Alloc.join_with_uniqueness Uniqueness.Const.max mode
56145614
else mode
56155615
in
56165616
mode

0 commit comments

Comments
 (0)