Record funspec (B:Type) :=
{ fs_A  : B -> Type
; fs_t  : B -> termMeas
; fs_P  : forall b, fs_A b -> pred world
; fs_Q  : forall b, fs_A b -> pred world
}.
Definition funspec_assumptions B b n (fss:list (label*funspec B) ) : pred prog :=
ALL l:_, ALL fs:_, !!(In (l,fs) fss) -->
let P' a := fs_P B fs b a &&
store_op (fun r => exists n', proj1_sig (fs_t B fs b) r n' /\ n' < n)
in funptr l (fs_A B fs b) (fs_t B fs b) P' (fs_Q B fs b).

Lemma verify_clique : forall psi G B (fss:list (label * funspec B)),
(forall l fs,
In (l,fs) fss ->
exists i, psi#l = Some i /\
forall b a n,
let Pr := fs_P B fs b a && store_op (fun r' => proj1_sig (fs_t B fs b) r' n) in
hoare n (funspec_assumptions B b n fss && G) (fs_Q B fs b a) Pr i FF) ->
verify_prog psi G ->
verify_prog
psi
((ALL b:B, ALL l:_, ALL fs:_,
!!(In (l,fs) fss) -->
funptr l (fs_A B fs b) (fs_t B fs b)
(fs_P B fs b) (fs_Q B fs b)) && G).