Commit e69199a0 authored by Julien Lopez's avatar Julien Lopez
Browse files

Truely fix decompose_rec

parent 429bfc9a
......@@ -2368,9 +2368,6 @@ struct
|`Arrow of v * v
|`Times of v * v
|`Xml of v * v
(* The following is unused at the moment (since
decompose_rec is a no-op). It should work properly once
records are ok at the type/bdd level *)
|`Record of bool * (bool * Ns.Label.t * v) list
]
and v = { mutable def : rhs; mutable node : node option }
......@@ -2450,23 +2447,13 @@ struct
(decompose_type x)
(decompose_type y)
) (Pair.get bdd) [])) dnf acc
and aux2 acc = function
| (l, (b, t)) :: rest -> aux2 (acc @ [b, l, decompose_type t]) rest
| _ -> assert false
and aux acc make = function
| (l, _(*???*), b) :: rest -> aux (acc @ [make b (aux2 [] l)]) make rest
| [] -> acc
and _format_dnf acc = function
| (`Atm a) :: rest -> _format_dnf (acc @ [`Atm a]) rest
| (`Var x) :: rest -> _format_dnf (acc @ [`Var x]) rest
| [] -> acc
and format_dnf acc = function
| (l1, l2) :: rest -> format_dnf acc [_format_dnf [] l1, _format_dnf []l2]
and format_rec b acc = function
| (l, t) :: rest -> format_rec b (acc @ [b, l, decompose_type (descr t)]) rest
| [] -> acc
and decompose_rec any make dnf acc =
let dnf = format_dnf [] dnf in
decompose_kind any (fun bdd ->
cup (aux [] make (Record.get bdd))) dnf acc
cup (decompose_dnf (ty any) (fun (b, l) ->
make b (format_rec b [] l)) (Rec.get bdd) [])) dnf acc
and decompose_type t =
try
DescrHash.find memo t
......
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