Module Import Prog := Syn.MkProg (PlusProg).
Definition rank : function -> nat := ltac:(autorank function_beq ranklist).
Fixpoint quote_value (n : nat) : value :=
match n with
| 0    => c_capply zero []
| S n' => c_capply succ [quote_value n']
end.
(* QI *)
Definition cs (c : constructor) := 1. (* same for all *)

(* P-criterion *)
Theorem plus_polytime: forall i s p c f lv d v,
let t := fapply f lv in
let pi := cbv_update i s p c t d v in
cbv_wf pi -> cache_bounded qic qif c ->
cbv_size pi <= global_bound mcs qif f lv c.