-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.makam
48 lines (39 loc) · 1.03 KB
/
tests.makam
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
39
40
41
42
43
44
45
46
47
48
%use "init".
categorical : testsuite.
%testsuite categorical.
(* Check Basic Numbers Work *)
>> eval << 1 >> Dom Cod Result ?
>> Yes:
>> Result := "5 ",
>> Cod := "Z ",
>> Dom := "* ".
(* Check Basic Addition Works *)
>> eval << (add lift 4) lift 8 >> Dom Cod Result ?
>> Yes:
>> Result := "12 ",
>> Range := "Z ",
>> Domain := "* ".
(* Check Identity Works *)
>> eval << lam "a" : * -> Set => lam "x" : * -> "a" => "x" >> Dom Cod Result ?
>> Yes:
>> Cod := "exists \"x1\" : * -> Set , exists \"x2\" : * -> \"x1\" , \"x1\" ",
>> Dom := "* ".
(* Check Axioms Work *)
>> eval {
>> Let "myaxiom" := axiom "myaxiom" : Z -> Z .
>> "myaxiom"
>> } Dom Cod Result ?
>> Yes:
>> Cod := "Z ",
>> Dom := "Z ".
>> eval << 1 >> Dom Cod Result ?
>> Yes:
>> Result := "1 ".
>> eval << lam "a" : * -> Set => "a" >> Dom Cod Result ?
>> Yes:
>> Result := "lam \"x1\" : * -> Set => \"x1\" ∘ ! term ".
>> eval << id Z ∘ 1 >> Dom Cod Result ?
>> Yes:
>> Result := "1 ".
(* FIXME demonstrate more forall/exists stuff *)
(* FIXME experiment with coforall/coexists *)