equal
deleted
inserted
replaced
192 may include recursion over the syntactic structure of types. |
192 may include recursion over the syntactic structure of types. |
193 As a canonical example, we model product semigroups |
193 As a canonical example, we model product semigroups |
194 using our simple algebra: |
194 using our simple algebra: |
195 *} |
195 *} |
196 |
196 |
197 instantiation %quote * :: (semigroup, semigroup) semigroup |
197 instantiation %quote prod :: (semigroup, semigroup) semigroup |
198 begin |
198 begin |
199 |
199 |
200 definition %quote |
200 definition %quote |
201 mult_prod_def: "p\<^isub>1 \<otimes> p\<^isub>2 = (fst p\<^isub>1 \<otimes> fst p\<^isub>2, snd p\<^isub>1 \<otimes> snd p\<^isub>2)" |
201 mult_prod_def: "p\<^isub>1 \<otimes> p\<^isub>2 = (fst p\<^isub>1 \<otimes> fst p\<^isub>2, snd p\<^isub>1 \<otimes> snd p\<^isub>2)" |
202 |
202 |
258 unfolding neutral_int_def mult_int_def by simp |
258 unfolding neutral_int_def mult_int_def by simp |
259 qed |
259 qed |
260 |
260 |
261 end %quote |
261 end %quote |
262 |
262 |
263 instantiation %quote * :: (monoidl, monoidl) monoidl |
263 instantiation %quote prod :: (monoidl, monoidl) monoidl |
264 begin |
264 begin |
265 |
265 |
266 definition %quote |
266 definition %quote |
267 neutral_prod_def: "\<one> = (\<one>, \<one>)" |
267 neutral_prod_def: "\<one> = (\<one>, \<one>)" |
268 |
268 |
295 unfolding neutral_int_def mult_int_def by simp |
295 unfolding neutral_int_def mult_int_def by simp |
296 qed |
296 qed |
297 |
297 |
298 end %quote |
298 end %quote |
299 |
299 |
300 instantiation %quote * :: (monoid, monoid) monoid |
300 instantiation %quote prod :: (monoid, monoid) monoid |
301 begin |
301 begin |
302 |
302 |
303 instance %quote proof |
303 instance %quote proof |
304 fix p :: "\<alpha>\<Colon>monoid \<times> \<beta>\<Colon>monoid" |
304 fix p :: "\<alpha>\<Colon>monoid \<times> \<beta>\<Colon>monoid" |
305 show "p \<otimes> \<one> = p" |
305 show "p \<otimes> \<one> = p" |