-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMainHC.thy
38 lines (30 loc) · 992 Bytes
/
MainHC.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
theory MainHC = Main:
consts app :: "('a => 'b option) option => 'a option => 'b option"
primrec
"app None a = None"
"app (Some f) x = (case x of
None => None
| Some x' => f x')"
consts apt :: "('a => 'b) option => 'a option => 'b option"
primrec
"apt None a = None"
"apt (Some f) x = (case x of
None => None
| Some x' => Some (f x'))"
consts pApp :: "('a => bool) option => 'a option => bool"
primrec
"pApp None a = False"
"pApp (Some f) x = (case x of
None => False
| Some x' => True)"
consts defOp :: "'a option => bool"
primrec
"defOp (Some x) = True"
"defOp None = False"
consts pair :: "'a option => 'b option => ('a * 'b) option"
primrec
"pair None a = None"
"pair (Some x) z = (case z of
None => None
| Some y => Some (x,y))"
end