Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/phl/ecPhlCall.ml
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,22 @@ let mk_inv_spec (_pf : proofenv) env inv fl fr =
let defl = EcEnv.Fun.by_xpath fl env in
let defr = EcEnv.Fun.by_xpath fr env in
let sigl, sigr = defl.f_sig, defr.f_sig in
let testty =
EcReduction.EqTest.for_type env sigl.fs_arg sigr.fs_arg
&& EcReduction.EqTest.for_type env sigl.fs_ret sigr.fs_ret
in
let ppe = EcPrinting.PPEnv.ofenv env in

if not (EcReduction.EqTest.for_type env sigl.fs_arg sigr.fs_arg)
then tc_error _pf "@[<v 2>the procedures do not have the same argument types:@,\
Left side: @[<h>%a@]@,\
Right side: @[<h>%a@]@]"
(EcPrinting.pp_type ppe) sigl.fs_arg
(EcPrinting.pp_type ppe) sigr.fs_arg;

if not (EcReduction.EqTest.for_type env sigl.fs_ret sigr.fs_ret)
then tc_error _pf "@[<v 2>the procedures do not have the same return types:@,\
Left side: @[<h>%a@]@,\
Right side: @[<h>%a@]@]"
(EcPrinting.pp_type ppe) sigl.fs_ret
(EcPrinting.pp_type ppe) sigr.fs_ret;

if not testty then raise EqObsInError;
let eq_params =
ts_inv_eqparams
sigl.fs_arg sigl.fs_anames ml
Expand Down
Loading