@@ -18,25 +18,25 @@ definition id2 :: "'A \<Rightarrow> 'A" where
18
18
fun add_one :: "nat list \<Rightarrow> nat list" where
19
19
"add_one [] = []" |
20
20
(* hello! *)
21
- "add_one (x # xs) = ((x + 1) # add_one xs)"
21
+ "add_one (x' # xs) = ((x' + 1) # add_one xs)"
22
22
23
23
fun sum :: "nat list \<Rightarrow> nat" where
24
24
"sum [] = 0" |
25
- "sum (x # xs) = (x + sum xs)"
25
+ "sum (x' # xs) = (x' + sum xs)"
26
26
27
27
fun f :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat" where
28
- "f x y z = ((z + 1) * x + y)"
28
+ "f x' y z = ((z + 1) * x' + y)"
29
29
30
30
fun g :: "nat \<Rightarrow> nat \<Rightarrow> bool" where
31
- "g x y = (if x = f x (N.g y) (M_N.g (M_Main.f y)) then False else True)"
31
+ "g x' y = (if x' = f x' (N.g y) (M_N.g (M_Main.f y)) then False else True)"
32
32
33
33
fun inc :: "nat \<Rightarrow> nat" where
34
- "inc x = (Suc x)"
34
+ "inc x' = (Suc x' )"
35
35
36
36
(* dec function *)
37
37
fun dec :: "nat \<Rightarrow> nat" where
38
38
"dec 0 = 0" |
39
- "dec (Suc x) = x"
39
+ "dec (Suc x' ) = x' "
40
40
41
41
(* dec' function *)
42
42
fun dec' :: "nat \<Rightarrow> nat" where
@@ -45,23 +45,23 @@ fun dec' :: "nat \<Rightarrow> nat" where
45
45
(* the zero case *)
46
46
(* return zero *)
47
47
(* the suc case *)
48
- "dec' x =
49
- (case x of
48
+ "dec' x' =
49
+ (case x' of
50
50
0 \<Rightarrow> 0 |
51
51
(Suc y) \<Rightarrow> y)"
52
52
53
53
fun optmap :: "('A \<Rightarrow> 'A) \<Rightarrow> 'A option \<Rightarrow> 'A option" where
54
54
"optmap f' None = None" |
55
- "optmap f' (Some x) = (Some (f' x))"
55
+ "optmap f' (Some x' ) = (Some (f' x' ))"
56
56
57
57
fun pboth :: "('A \<Rightarrow> 'A') \<Rightarrow> ('B \<Rightarrow> 'B') \<Rightarrow> 'A \<times> 'B \<Rightarrow> 'A' \<times> 'B'" where
58
- "pboth f' g' (x, y) = (f' x, g' y)"
58
+ "pboth f' g' (x' , y) = (f' x' , g' y)"
59
59
60
60
fun bool_fun :: "bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool" where
61
- "bool_fun x y z = (x \<and> (y \<or> z))"
61
+ "bool_fun x' y z = (x' \<and> (y \<or> z))"
62
62
63
63
fun bool_fun' :: "bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool" where
64
- "bool_fun' x y z = (x \<and> y \<or> z)"
64
+ "bool_fun' x' y z = (x' \<and> y \<or> z)"
65
65
66
66
(* Queues *)
67
67
text \<open>
@@ -71,7 +71,7 @@ datatype 'A Queue
71
71
= queue "'A list" "'A list"
72
72
73
73
fun qfst :: "'A Queue \<Rightarrow> 'A list" where
74
- "qfst (queue x v') = x"
74
+ "qfst (queue x' v') = x' "
75
75
76
76
fun qsnd :: "'A Queue \<Rightarrow> 'A list" where
77
77
"qsnd (queue v' v'0) = v'0"
@@ -85,10 +85,10 @@ fun pop_front :: "'A Queue \<Rightarrow> 'A Queue" where
85
85
v' \<Rightarrow> q')"
86
86
87
87
fun push_back :: "'A Queue \<Rightarrow> 'A \<Rightarrow> 'A Queue" where
88
- "push_back q x =
88
+ "push_back q x' =
89
89
(case qfst q of
90
- [] \<Rightarrow> queue [x] (qsnd q) |
91
- q' \<Rightarrow> queue q' (x # qsnd q))"
90
+ [] \<Rightarrow> queue [x' ] (qsnd q) |
91
+ q' \<Rightarrow> queue q' (x' # qsnd q))"
92
92
93
93
text \<open>
94
94
Checks if the queue is empty
@@ -291,11 +291,26 @@ fun getMessageFromTrigger :: "('M, 'H) Trigger \<Rightarrow> 'M option" where
291
291
v'1 \<Rightarrow> None)"
292
292
293
293
fun getMessageFromTrigger' :: "('M, 'H) Trigger \<Rightarrow> 'M option" where
294
- "getMessageFromTrigger' t =
295
- (case t of
294
+ "getMessageFromTrigger' t' =
295
+ (case t' of
296
296
(MessageArrived v') \<Rightarrow>
297
297
(case (EnvelopedMessage.packet v') of
298
298
(v'0) \<Rightarrow> Some (MessagePacket.message v'0)) |
299
299
v'2 \<Rightarrow> None)"
300
300
301
+ (* Syntax aliases *)
302
+ type_synonym Name = nat
303
+
304
+ fun idT :: "nat \<Rightarrow> Name" where
305
+ "idT x' = x'"
306
+
307
+ definition t :: Name where
308
+ "t = 0"
309
+
310
+ record RR =
311
+ x :: nat
312
+
313
+ fun x :: "RR \<Rightarrow> Name" where
314
+ "x (| RR.x = x' |) = x'"
315
+
301
316
end
0 commit comments