Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/phl/ecPhlWhile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ let t_bdhoare_while_rev_r inv tc =
(* -------------------------------------------------------------------- *)
(* Rule for = or >= *)

let t_bdhoare_while_rev_geq_r inv vrnt k (eps: ss_inv) tc =
let t_bdhoare_while_rev_geq_r inv vrnt (k: ss_inv) (eps: ss_inv) tc =
let env, hyps, _ = FApi.tc1_eflat tc in

let bhs = tc1_as_bdhoareS tc in
Expand All @@ -221,6 +221,11 @@ let t_bdhoare_while_rev_geq_r inv vrnt k (eps: ss_inv) tc =
"The variant decreasing rate lower-bound cannot "
"depend on variables written by the loop body";

if not (PV.indep env (s_write env lp_body) (PV.fv env (EcMemory.memory mem) k.inv)) then
tc_error !!tc
"The variant upper bound cannot depend on "
"variables written by the loop body";

check_single_stmt tc rem_s;

let lp_guard = ss_inv_of_expr m lp_guard_exp in
Expand Down
Loading