@@ -463,7 +463,7 @@ module Core = struct
463463 let goal = f_imp (f_in_supp ab g_app) post_subst in
464464 let goal = f_forall_simpl [(a_id, GTty tyL); (b_id, GTty tyR)] goal in
465465 f_and iscoupling_pred goal
466- | Some `Left ->
466+ | Some side ->
467467 (* Goal: dmap d1 g = d2 /\ forall a b, b = g(a) => psi[x -> a, y -> b] *)
468468 let dmap_op = EcPath. extend EcCoreLib. p_top [" Distr" ; " dmap" ] in
469469 let dmap_ty = tfun (tdistr tyL) (tfun (tfun tyL tyR) (tdistr tyR)) in
@@ -477,24 +477,12 @@ module Core = struct
477477 let post_subst = subst_form_lv env (EcMemory. memory es.es_ml) lvL a post in
478478 let post_subst = subst_form_lv env (EcMemory. memory es.es_mr) lvR b post_subst in
479479
480- let goal = f_imp (f_eq (f_app_simpl g [a] tyR) b) post_subst in
481- let goal = f_forall_simpl [(a_id, GTty tyL); (b_id, GTty tyR)] goal in
482- f_and dmap_pred goal
483- | Some `Right ->
484- (* Goal: dmap d2 g = d1 /\ forall a b, a = g(b) => psi[x -> a, y -> b] *)
485- let dmap_op = EcPath. extend EcCoreLib. p_top [" Distr" ; " dmap" ] in
486- let dmap_ty = tfun (tdistr tyR) (tfun (tfun tyR tyL) (tdistr tyL)) in
487- let dmap_pred = f_eq (f_app (f_op dmap_op [tyR; tyL] dmap_ty) [muR; g] tyL) muL in
488-
489- let a_id = EcIdent. create " a" in
490- let b_id = EcIdent. create " b" in
491- let a = f_local a_id tyL in
492- let b = f_local b_id tyR in
493- let post = es.es_po in
494- let post_subst = subst_form_lv env (EcMemory. memory es.es_ml) lvL a post in
495- let post_subst = subst_form_lv env (EcMemory. memory es.es_mr) lvR b post_subst in
480+ let eq_condition =
481+ match side with
482+ | `Left -> f_eq (f_app_simpl g [a] tyR) b
483+ | `Right -> f_eq a (f_app_simpl g [b] tyL) in
496484
497- let goal = f_imp (f_eq a (f_app_simpl g [b] tyL)) post_subst in
485+ let goal = f_imp eq_condition post_subst in
498486 let goal = f_forall_simpl [(a_id, GTty tyL); (b_id, GTty tyR)] goal in
499487 f_and dmap_pred goal
500488 in
0 commit comments