primcorec bind_gpv :: "('a, 'out, 'in) gpv \ ('a \ ('b, 'out, 'in) gpv) \ ('b, 'out, 'in) gpv" where "bind_gpv r f = GPV (map_spmf (map_generat id id ((\) (case_sum id (\r. bind_gpv r f))))
(bind_spmf (the_gpv r)
(case_generat
(\<lambda>x. map_spmf (map_generat id id ((\<circ>) Inl)) (the_gpv (f x)))
(\<lambda>out c. return_spmf (IO out (\<lambda>input. Inr (c input)))))))"
contextincludes lifting_syntax begin
lemma bind_gpv_parametric [transfer_rule]: "(rel_gpv A C ===> (A ===> rel_gpv B C) ===> rel_gpv B C) bind_gpv bind_gpv" unfolding bind_gpv_def by transfer_prover
end
lemma [friend_of_corec_simps]: "map_spmf f (bind_spmf x h) = bind_spmf x (map_spmf f o h)" by (cases x) auto
lemma [friend_of_corec_simps]: "bind_spmf (map_spmf f x) h = bind_spmf x (h o f)" by (cases x) auto
friend_of_corec bind_gpv :: "('a, 'out, 'in) gpv \ ('a \ ('a, 'out, 'in) gpv) \ ('a, 'out, 'in) gpv" where"bind_gpv r f = GPV (map_spmf (map_generat id id ((\) (case_sum id (\r. bind_gpv r f))))
(bind_spmf (the_gpv r)
(case_generat
(\<lambda>x. map_spmf (map_generat id id ((\<circ>) Inl)) (the_gpv (f x)))
(\<lambda>out c. return_spmf (IO out (\<lambda>input. Inr (c input)))))))" apply(rule bind_gpv.ctr) apply transfer_prover apply transfer_prover done
end
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.