(* Title: HOL/Corec_Examples/Tests/GPV_Bare_Bones.thy Author: Andreas Lochbihler, ETH Zuerich Author: Jasmin Blanchette, Inria, LORIA, MPII Copyright 2016 A bare bones version of generative probabilistic values (GPVs). *)
section‹A Bare Bones Version of Generative Probabilistic Values (GPVs)›
theory GPV_Bare_Bones imports"HOL-Library.BNF_Corec" begin
datatype 'a pmf = return_pmf 'a
type_synonym 'a spmf = "'a option pmf"
abbreviation map_spmf :: "('a ==> 'b) ==> 'a spmf ==> 'b spmf" where"map_spmf f ≡ map_pmf (map_option f)"
abbreviation return_spmf :: "'a ==> 'a spmf" where"return_spmf x ≡ return_pmf (Some x)"
definition bind_spmf :: "'a spmf ==> ('a ==> 'b spmf) ==> 'b spmf" where"bind_spmf x f = undefined x (λa. case a of None ==> return_pmf None | Some a' ==> f a')"
friend_of_corec bind_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 (λx. map_spmf (map_generat id id ((∘) Inl)) (the_gpv' (f x))) (λout c. return_spmf (IO out (λinput. Inr (c input)))))))" sorry
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-04-26)
¤
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 und die Messung sind noch experimentell.