Skip to content

Commit 8057bfa

Browse files
oskgoCopilot
andcommitted
Check equality of expressions up to convertibility
Co-authored-by: Copilot <copilot@github.com>
1 parent dd9bd93 commit 8057bfa

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

src/ecReduction.ml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,26 +1864,28 @@ let hs_inv_alpha_eq hyps (inv1 : hs_inv) (inv2 : hs_inv) =
18641864
module EqTest = struct
18651865
include EqTest_base
18661866
1867-
include EqMod_base(struct
1868-
let for_expr env ~norm:_ alpha e1 e2 =
1869-
let convert e =
1870-
let f = (ss_inv_of_expr (EcIdent.create "&dummy") e).inv in
1867+
let for_expr env ~norm:_ alpha e1 e2 =
1868+
let convert e =
1869+
let f = (ss_inv_of_expr (EcIdent.create "&dummy") e).inv in
1870+
1871+
if Mid.is_empty alpha then f else
18711872
1872-
if Mid.is_empty alpha then f else
1873+
let subst =
1874+
Mid.fold
1875+
(fun x (y, ty) subst ->
1876+
Fsubst.f_bind_local subst x (f_local y ty))
1877+
alpha Fsubst.f_subst_id
18731878
1874-
let subst =
1875-
Mid.fold
1876-
(fun x (y, ty) subst ->
1877-
Fsubst.f_bind_local subst x (f_local y ty))
1878-
alpha Fsubst.f_subst_id
1879+
in Fsubst.f_subst subst f in
18791880
1880-
in Fsubst.f_subst subst f in
1881+
let f1 = convert e1 in
1882+
let f2 = convert e2 in
18811883
1882-
let f1 = convert e1 in
1883-
let f2 = convert e2 in
1884+
is_conv (LDecl.init env []) f1 f2
18841885
1885-
is_conv (LDecl.init env []) f1 f2
1886-
end)
1886+
include EqMod_base(struct
1887+
let for_expr = for_expr
1888+
end)
18871889
18881890
let for_pv = fun env ?(norm = true) -> for_pv env ~norm
18891891
let for_lv = fun env ?(norm = true) -> for_lv env ~norm

0 commit comments

Comments
 (0)