Skip to content

Commit

Permalink
Use instantiateCtxVar
Browse files Browse the repository at this point in the history
  • Loading branch information
MartyO256 committed Dec 21, 2023
1 parent 8a74a07 commit e16cc7b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/core/unify.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3154,7 +3154,8 @@ let rec blockdeclInDctx =
in
(* why do we drop the constraints here ? -je *)
let i = CInst (mmvar2', Whnf.mcomp theta2 mtt1) in
mmvar1.instantiation := Some (ICtx (CtxVar i))
let cPsi = CtxVar i in
instantiateCtxVar (mmvar1.instantiation, cPsi)
end
else
Error.raise_violation
Expand All @@ -3164,26 +3165,30 @@ let rec blockdeclInDctx =

| (Some c_var, d') ->
if d = d'
then mmvar1.instantiation := Some (ICtx (CtxVar (c_var)))
then
let cPsi = CtxVar c_var in
instantiateCtxVar (mmvar1.instantiation, cPsi)
else if d' < d
then fail "Hat Context's do not unify"
else
begin
let cPsi = Context.hatToDCtx (Some c_var, d' - d) in
mmvar1.instantiation := Some (ICtx cPsi)
instantiateCtxVar (mmvar1.instantiation, cPsi)
end

| (None, d') ->
if d = d'
then mmvar1.instantiation := Some (ICtx Null)
then
let cPsi = Null in
instantiateCtxVar (mmvar1.instantiation, cPsi)
else if d' < d
then
(* (Some (cref), d) == (None, d') d' = d0 + d *)
fail "Hat Context's do not unify"
else
begin
let cPsi = Context.hatToDCtx (None, d' - d) in
mmvar1.instantiation := Some (ICtx cPsi)
instantiateCtxVar (mmvar1.instantiation, cPsi)
end
end

Expand Down

0 comments on commit e16cc7b

Please sign in to comment.