[Data] Replace error-prone [is_leaf] with its opposite [has_structure].

This commit is contained in:
Olivier 2023-04-18 21:50:10 +02:00
parent 595b1c8295
commit 1dca2ed8e6
1 changed files with 4 additions and 4 deletions

View File

@ -587,10 +587,10 @@ let iter f data =
let fold f data accu =
S.fold f data.structure accu
let is_leaf data =
let has_structure data =
match data.structure with
| None | Some (Abs.Abstract _) -> true
| Some (Abs.User _) -> false
| None | Some (Abs.Abstract _) -> false
| Some (Abs.User _) -> true
let project data =
data.structure
@ -1282,7 +1282,7 @@ let update_ranks generation =
it must now be [k]. *)
assert (data.rank = k);
(* If [v] carries some structure, ... *)
if not (Data.is_leaf data) then begin
if Data.has_structure data then begin
(* Update the rank and scope of all children. *)
Data.iter traverse data;
(* On the way back up, compute the maximum of their