@@ -18,25 +18,25 @@ definition id2 :: "'A \<Rightarrow> 'A" where
1818fun add_one :: "nat list \<Rightarrow> nat list" where
1919 "add_one [] = []" |
2020 (* hello! *)
21- "add_one (x # xs) = ((x + 1) # add_one xs)"
21+ "add_one (x' # xs) = ((x' + 1) # add_one xs)"
2222
2323fun sum :: "nat list \<Rightarrow> nat" where
2424 "sum [] = 0" |
25- "sum (x # xs) = (x + sum xs)"
25+ "sum (x' # xs) = (x' + sum xs)"
2626
2727fun 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)"
2929
3030fun 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)"
3232
3333fun inc :: "nat \<Rightarrow> nat" where
34- "inc x = (Suc x)"
34+ "inc x' = (Suc x' )"
3535
3636(* dec function *)
3737fun dec :: "nat \<Rightarrow> nat" where
3838 "dec 0 = 0" |
39- "dec (Suc x) = x"
39+ "dec (Suc x' ) = x' "
4040
4141(* dec' function *)
4242fun dec' :: "nat \<Rightarrow> nat" where
@@ -45,23 +45,23 @@ fun dec' :: "nat \<Rightarrow> nat" where
4545 (* the zero case *)
4646 (* return zero *)
4747 (* the suc case *)
48- "dec' x =
49- (case x of
48+ "dec' x' =
49+ (case x' of
5050 0 \<Rightarrow> 0 |
5151 (Suc y) \<Rightarrow> y)"
5252
5353fun optmap :: "('A \<Rightarrow> 'A) \<Rightarrow> 'A option \<Rightarrow> 'A option" where
5454 "optmap f' None = None" |
55- "optmap f' (Some x) = (Some (f' x))"
55+ "optmap f' (Some x' ) = (Some (f' x' ))"
5656
5757fun 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)"
5959
6060fun 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))"
6262
6363fun 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)"
6565
6666(* Queues *)
6767text \<open>
@@ -71,7 +71,7 @@ datatype 'A Queue
7171 = queue "'A list" "'A list"
7272
7373fun qfst :: "'A Queue \<Rightarrow> 'A list" where
74- "qfst (queue x v') = x"
74+ "qfst (queue x' v') = x' "
7575
7676fun qsnd :: "'A Queue \<Rightarrow> 'A list" where
7777 "qsnd (queue v' v'0) = v'0"
@@ -85,10 +85,10 @@ fun pop_front :: "'A Queue \<Rightarrow> 'A Queue" where
8585 v' \<Rightarrow> q')"
8686
8787fun push_back :: "'A Queue \<Rightarrow> 'A \<Rightarrow> 'A Queue" where
88- "push_back q x =
88+ "push_back q x' =
8989 (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))"
9292
9393text \<open>
9494Checks if the queue is empty
@@ -294,11 +294,26 @@ fun getMessageFromTrigger :: "('M, 'H) Trigger \<Rightarrow> 'M option" where
294294 v'1 \<Rightarrow> None)"
295295
296296fun getMessageFromTrigger' :: "('M, 'H) Trigger \<Rightarrow> 'M option" where
297- "getMessageFromTrigger' t =
298- (case t of
297+ "getMessageFromTrigger' t' =
298+ (case t' of
299299 (MessageArrived v') \<Rightarrow>
300300 (case (EnvelopedMessage.packet v') of
301301 (v'0) \<Rightarrow> Some (MessagePacket.message v'0)) |
302302 v'2 \<Rightarrow> None)"
303303
304+ (* Syntax aliases *)
305+ type_synonym Name = nat
306+
307+ fun idT :: "nat \<Rightarrow> Name" where
308+ "idT x' = x'"
309+
310+ definition t :: Name where
311+ "t = 0"
312+
313+ record RR =
314+ x :: nat
315+
316+ fun x :: "RR \<Rightarrow> Name" where
317+ "x (| RR.x = x' |) = x'"
318+
304319end
0 commit comments