@@ -464,31 +464,38 @@ module Core = struct
464464 let goal = f_forall_simpl [(a_id, GTty tyL); (b_id, GTty tyR)] goal in
465465 f_and iscoupling_pred goal
466466 | Some `Left ->
467- (* Goal: dmap d1 g = d2 => forall a, psi[x -> a, y -> g(a) ] *)
467+ (* 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
470470 let dmap_pred = f_eq (f_app (f_op dmap_op [tyL; tyR] dmap_ty) [muL; g] tyR) muR in
471471
472472 let a_id = EcIdent. create " a" in
473+ let b_id = EcIdent. create " b" in
473474 let a = f_local a_id tyL in
475+ let b = f_local b_id tyR in
474476 let post = es.es_po in
475477 let post_subst = subst_form_lv env (EcMemory. memory es.es_ml) lvL a post in
476- let post_subst = subst_form_lv env (EcMemory. memory es.es_mr) lvR (f_app_simpl g [a] tyR) post_subst in
478+ let post_subst = subst_form_lv env (EcMemory. memory es.es_mr) lvR b post_subst in
477479
478- let goal = f_forall_simpl [(a_id, GTty tyL)] post_subst in
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
479482 f_and dmap_pred goal
480483 | Some `Right ->
481- (* Goal: dmap d2 g = d1 => forall b, psi[y -> b , y -> g(b) ] *)
484+ (* Goal: dmap d2 g = d1 /\ forall a b, a = g(b) => psi[x -> a , y -> b ] *)
482485 let dmap_op = EcPath. extend EcCoreLib. p_top [" Distr" ; " dmap" ] in
483486 let dmap_ty = tfun (tdistr tyR) (tfun (tfun tyR tyL) (tdistr tyL)) in
484487 let dmap_pred = f_eq (f_app (f_op dmap_op [tyR; tyL] dmap_ty) [muR; g] tyL) muL in
485488
489+ let a_id = EcIdent. create " a" in
486490 let b_id = EcIdent. create " b" in
491+ let a = f_local a_id tyL in
487492 let b = f_local b_id tyR in
488493 let post = es.es_po in
489- let post_subst = subst_form_lv env (EcMemory. memory es.es_ml) lvL (f_app_simpl g [b] tyL) post in
494+ let post_subst = subst_form_lv env (EcMemory. memory es.es_ml) lvL a post in
490495 let post_subst = subst_form_lv env (EcMemory. memory es.es_mr) lvR b post_subst in
491- let goal = f_forall_simpl [(b_id, GTty tyR)] post_subst in
496+
497+ let goal = f_imp (f_eq a (f_app_simpl g [b] tyL)) post_subst in
498+ let goal = f_forall_simpl [(a_id, GTty tyL); (b_id, GTty tyR)] goal in
492499 f_and dmap_pred goal
493500 in
494501 let goal = f_equivS_r { es with es_sl= sl'; es_sr= sr'; es_po= goal; } in
0 commit comments