equal
deleted
inserted
replaced
64 |
64 |
65 lemma valuesum_rec_Mapping: |
65 lemma valuesum_rec_Mapping: |
66 shows [code]: "valuesum (Mapping []) = 0" |
66 shows [code]: "valuesum (Mapping []) = 0" |
67 and "valuesum (Mapping (x # xs)) = (let l = (SOME l. l \<in> Mapping.keys (Mapping (x # xs))) in |
67 and "valuesum (Mapping (x # xs)) = (let l = (SOME l. l \<in> Mapping.keys (Mapping (x # xs))) in |
68 the (Mapping.lookup (Mapping (x # xs)) l) + valuesum (Mapping.delete l (Mapping (x # xs))))" |
68 the (Mapping.lookup (Mapping (x # xs)) l) + valuesum (Mapping.delete l (Mapping (x # xs))))" |
69 by (simp_all add: valuesum_rec finite_dom_map_of is_empty_Mapping) |
69 by (simp_all add: valuesum_rec finite_dom_map_of is_empty_Mapping null_def) |
70 |
70 |
71 text {* |
71 text {* |
72 As a side effect the precondition disappears (but note this has nothing to do with choice!). |
72 As a side effect the precondition disappears (but note this has nothing to do with choice!). |
73 The first equation deals with the uncritical empty case and can already be used for code generation. |
73 The first equation deals with the uncritical empty case and can already be used for code generation. |
74 |
74 |