Commit cb63b921 authored by Julien Lopez's avatar Julien Lopez

Minor changes in patterns.ml to add a fresh variable for Cap

parent 95544e70
......@@ -181,8 +181,7 @@ and compile_branches env (brs : Typed.branches) =
(* p_i / t_i -> br.Typed.br_pat / br.Typed.br_type
* p_i / t_i is used here to add elements to env.gamma *)
and compile_branch env br =
(* We add a fresh variable "pat<nb>:x" for each pattern
TODO: Add a fresh variable for cap too. *)
(* We add a fresh variable "pat<nb>:x" for each pattern (except Constr) *)
let t, _, d = br.Typed.br_pat.Patterns.descr in
let fv, d = match d with
| Patterns.Constr(_) -> Patterns.fv br.Typed.br_pat, d
......
......@@ -338,7 +338,7 @@ and filter_node t p : Types.Positive.v id_map =
let res = IdMap.map_from_slist (fun _ -> Types.Positive.forward ()) fv in
memo_filter := MemoFilter.add (t,p) res !memo_filter;
let r = filter_descr t (descr p) in
IdMap.collide Types.Positive.define res r;
(* IdMap.collide Types.Positive.define res r;*) (* Had to comment this to add fresh variables for patterns *)
r
let filter t p =
......@@ -391,6 +391,7 @@ x=(1,2)
(approx_var_node seen q1 (pi1 ~kind:`XML t) xs)
(approx_var_node seen q2 (pi2 ~kind:`XML t) xs)
| Record _ -> IdSet.empty
| Constr _ -> xs (* Needed to add fresh variables to patterns *)
| _ -> assert false
and approx_var_node seen q t xs =
......
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