Commit 8a032b4e authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Fix issue #20. When the Top of a kind is present without variables, we

distribute it (redudantly) under all variables to simplify their pretty-printing.

Hence, instead of having e.g. :

('a \ (Int)) | Char | Int | Atom)

we have
('a | Char | Int | Atom)
parent 3b1b248d
......@@ -1849,6 +1849,31 @@ struct
fill_line (module BoolPair) h (fun t -> t.arrow) (fun t u -> {t with arrow = u }) d;
fill_line (module BoolRec) h (fun t -> t.record) (fun t u -> {t with record = u }) d;
fill_line (module BoolAbstracts) h (fun t -> t.abstract) (fun t u -> {t with abstract = u }) d;
let h =
try
let no_var = VarTable.find h Var.Set.(empty,empty) in
let update_field (type s) (module BV : BoolVar.S with type t = s) get set d1 d2 =
let bdd = get d1 in
if BV.(is_empty (diff full bdd)) then set d2 bdd else d2
in
let h' = VarTable.create 17 in
VarTable.iter (fun ((v1, v2) as k) t ->
let t =
if Var.Set.(is_empty v1 && is_empty v2) then t
else
let t = update_field (module BoolIntervals) (fun t -> t.ints) (fun t u -> {t with ints = u }) no_var t in
let t = update_field (module BoolChars) (fun t -> t.chars) (fun t u -> {t with chars = u }) no_var t in
let t = update_field (module BoolAtoms) (fun t -> t.atoms) (fun t u -> {t with atoms = u }) no_var t in
let t = update_field (module BoolPair) (fun t -> t.times) (fun t u -> {t with times = u }) no_var t in
let t = update_field (module BoolPair) (fun t -> t.xml) (fun t u -> {t with xml = u }) no_var t in
let t = update_field (module BoolPair) (fun t -> t.arrow) (fun t u -> {t with arrow = u }) no_var t in
let t = update_field (module BoolRec) (fun t -> t.record) (fun t u -> {t with record = u }) no_var t in
let t = update_field (module BoolAbstracts) (fun t -> t.abstract) (fun t u -> {t with abstract = u }) no_var t in t
in
VarTable.replace h' k t
) h; h'
with Not_found -> h
in
let found_any, all_descrs =
try
let res =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment