equal
deleted
inserted
replaced
177 undefined |
177 undefined |
178 |
178 |
179 |
179 |
180 subsubsection {* Generic algebraic operations *} |
180 subsubsection {* Generic algebraic operations *} |
181 |
181 |
182 class zero = |
182 class zero = type + |
183 fixes zero :: "'a" ("\<^loc>0") |
183 fixes zero :: "'a" ("\<^loc>0") |
184 |
184 |
185 class one = |
185 class one = type + |
186 fixes one :: "'a" ("\<^loc>1") |
186 fixes one :: "'a" ("\<^loc>1") |
187 |
187 |
188 hide (open) const zero one |
188 hide (open) const zero one |
189 |
189 |
190 class plus = |
190 class plus = type + |
191 fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>+" 65) |
191 fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>+" 65) |
192 |
192 |
193 class minus = |
193 class minus = type + |
194 fixes uminus :: "'a \<Rightarrow> 'a" |
194 fixes uminus :: "'a \<Rightarrow> 'a" |
195 and minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>-" 65) |
195 and minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>-" 65) |
196 and abs :: "'a \<Rightarrow> 'a" |
196 and abs :: "'a \<Rightarrow> 'a" |
197 |
197 |
198 class times = |
198 class times = type + |
199 fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>*" 70) |
199 fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>*" 70) |
200 |
200 |
201 class inverse = |
201 class inverse = type + |
202 fixes inverse :: "'a \<Rightarrow> 'a" |
202 fixes inverse :: "'a \<Rightarrow> 'a" |
203 and divide :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>'/" 70) |
203 and divide :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<^loc>'/" 70) |
204 |
204 |
205 notation |
205 notation |
206 uminus ("- _" [81] 80) |
206 uminus ("- _" [81] 80) |