definition
valterm_update :: "'key :: typerep \ (unit \ Code_Evaluation.term) \ 'value :: typerep \ (unit \ Code_Evaluation.term) \
('key, 'value) alist × (unit ==> Code_Evaluation.term) ==>
('key, 'value) alist × (unit ==> Code_Evaluation.term)" where
[code_unfold]: "valterm_update k v a = Code_Evaluation.valtermify update {\} k {\} v {\}a"
fun random_aux_alist where "random_aux_alist i j =
(if i = 0 then Pair valterm_empty
else Quickcheck_Random.collapse
(Random.select_weight
[(i, Quickcheck_Random.random j ∘→ (λk. Quickcheck_Random.random j ∘→
(λv. random_aux_alist (i - 1) j ∘→ (λa. Pair (valterm_update k v a))))),
(1, Pair valterm_empty)]))"
end
instantiation alist :: (random, random) random begin
definition random_alist where "random_alist i = random_aux_alist i i"
instance ..
end
instantiation alist :: (exhaustive, exhaustive) exhaustive begin
fun exhaustive_alist :: "(('a, 'b) alist \ (bool \ term list) option) \ natural \ (bool \ term list) option" where "exhaustive_alist f i =
(if i = 0 then None
else case f empty of
Some ts ==> Some ts
| None ==>
exhaustive_alist
(λa. Quickcheck_Exhaustive.exhaustive
(λk. Quickcheck_Exhaustive.exhaustive (λv. f (update k v a)) (i - 1)) (i - 1))
(i - 1))"
instance ..
end
instantiation alist :: (full_exhaustive, full_exhaustive) full_exhaustive begin
fun full_exhaustive_alist :: "(('a, 'b) alist \ (unit \ term) \ (bool \ term list) option) \ natural \
(bool ×term list) option" where "full_exhaustive_alist f i =
(if i = 0 then None
else case f valterm_empty of
Some ts ==> Some ts
| None ==>
full_exhaustive_alist
(λa.
Quickcheck_Exhaustive.full_exhaustive
(λk. Quickcheck_Exhaustive.full_exhaustive (λv. f (valterm_update k v a)) (i - 1))
(i - 1))
(i - 1))"
instance ..
end
section‹alist is a BNF›
lift_bnf (dead 'k, set: 'v) alist [wits: "[] :: ('k \ 'v) list"] for map: map rel: rel by auto
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.