Skip to content

Commit

Permalink
Minimal change.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFangWJ committed Nov 22, 2024
1 parent 2a7c517 commit 8bab67e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/haz3lcore/dynamics/Elaborator.re
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ let rec elaborate_pattern =
DHPat.Tuple(ps') |> rewrap |> cast_from(Typ.Prod(tys) |> Typ.temp);
| Ap(p1, p2) =>
let (p1', ty1) = elaborate_pattern(m, p1);
// print_endline("p1' = " ++ DHPat.show(p1'));
// print_endline("ty1 = " ++ Typ.show(ty1));
let (p2', ty2) = elaborate_pattern(m, p2);
let (ty1l, ty1r) = Typ.matched_arrow(ctx, ty1);
let p1'' = fresh_pat_cast(p1', ty1, Arrow(ty1l, ty1r) |> Typ.temp);
Expand Down Expand Up @@ -295,14 +297,16 @@ let rec elaborate = (m: Statics.Map.t, uexp: UExp.t): (DHExp.t, Typ.t) => {
};
}
);
print_endline("ELA p(1) = " ++ UPat.show(p));
print_endline("ELA m = " ++ Statics.Map.show(m));
let (p, ty1) = elaborate_pattern(m, p);
let is_recursive =
Statics.is_recursive(ctx, p, def, ty1)
&& Pat.get_bindings(p)
|> Option.get
|> List.exists(f => VarMap.lookup(co_ctx, f) != None);
if (!is_recursive) {
print_endline("ELA p = " ++ DHPat.show(p));
print_endline("ELA p(2) = " ++ DHPat.show(p));
let def = add_name(Pat.get_var(p), def);
print_endline("ELA def = " ++ DHExp.show(def));
let (def, ty2) = elaborate(m, def);
Expand Down
7 changes: 4 additions & 3 deletions src/haz3lcore/statics/Statics.re
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ and uexp_to_info_map =
term:
UPat.Cast(
{ids, term: UPat.Var(f_name), copied: false},
Typ.temp(Unknown(Internal)),
f_type,
Typ.temp(Unknown(Internal)),
),
copied: false,
};
Expand All @@ -469,8 +469,8 @@ and uexp_to_info_map =
(def, p, p_syn);
| None => (def, p, p_syn) // Use the original code
};
print_endline("STA def = " ++ UExp.show(def));
print_endline("STA p = " ++ UPat.show(p));
// print_endline("STA def = " ++ UExp.show(def));
// print_endline("STA p = " ++ UPat.show(p));
// print_endline("STA p_syn = " ++ Info.show_pat(p_syn));
let (def, m) = go(~mode=Ana(p_syn.ty), def, m);
let ty_p_ana = def.ty;
Expand All @@ -483,6 +483,7 @@ and uexp_to_info_map =
p,
m,
);
// print_endline("STA p_ana'.ctx = " ++ Ctx.show(p_ana'.ctx));
(def, p_ana'.ctx, m, ty_p_ana);
} else {
let (def_base, _) =
Expand Down

0 comments on commit 8bab67e

Please sign in to comment.