|
72000
|
1 |
(* Author: Jeremy Dawson, NICTA
|
|
|
2 |
*)
|
|
|
3 |
|
|
|
4 |
section \<open>Operation variants with traditional syntax\<close>
|
|
|
5 |
|
|
|
6 |
theory Traditional_Syntax
|
|
|
7 |
imports Main
|
|
|
8 |
begin
|
|
|
9 |
|
|
|
10 |
class semiring_bit_syntax = semiring_bit_shifts +
|
|
|
11 |
fixes test_bit :: \<open>'a \<Rightarrow> nat \<Rightarrow> bool\<close> (infixl "!!" 100)
|
|
|
12 |
and shiftl :: \<open>'a \<Rightarrow> nat \<Rightarrow> 'a\<close> (infixl "<<" 55)
|
|
|
13 |
and shiftr :: \<open>'a \<Rightarrow> nat \<Rightarrow> 'a\<close> (infixl ">>" 55)
|
|
|
14 |
assumes test_bit_eq_bit: \<open>test_bit = bit\<close>
|
|
|
15 |
and shiftl_eq_push_bit: \<open>a << n = push_bit n a\<close>
|
|
|
16 |
and shiftr_eq_drop_bit: \<open>a >> n = drop_bit n a\<close>
|
|
|
17 |
|
|
|
18 |
end
|