-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypesTest.v
209 lines (174 loc) · 5.49 KB
/
TypesTest.v
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Set Warnings "-notation-overridden,-parsing".
From Coq Require Export String.
From PLF Require Import Types.
Parameter MISSING: Type.
Module Check.
Ltac check_type A B :=
match type of A with
| context[MISSING] => idtac "Missing:" A
| ?T => first [unify T B; idtac "Type: ok" | idtac "Type: wrong - should be (" B ")"]
end.
Ltac print_manual_grade A :=
match eval compute in A with
| Some (_ ?S ?C) =>
idtac "Score:" S;
match eval compute in C with
| ""%string => idtac "Comment: None"
| _ => idtac "Comment:" C
end
| None =>
idtac "Score: Ungraded";
idtac "Comment: None"
end.
End Check.
From PLF Require Import Types.
Import Check.
Goal True.
idtac "------------------- some_term_is_stuck --------------------".
idtac " ".
idtac "#> some_term_is_stuck".
idtac "Possible points: 2".
check_type @some_term_is_stuck ((exists t : tm, stuck t)).
idtac "Assumptions:".
Abort.
Print Assumptions some_term_is_stuck.
Goal True.
idtac " ".
idtac "------------------- value_is_nf --------------------".
idtac " ".
idtac "#> value_is_nf".
idtac "Possible points: 3".
check_type @value_is_nf ((forall t : tm, value t -> step_normal_form t)).
idtac "Assumptions:".
Abort.
Print Assumptions value_is_nf.
Goal True.
idtac " ".
idtac "------------------- finish_progress --------------------".
idtac " ".
idtac "#> progress".
idtac "Possible points: 3".
check_type @progress (
(forall (t : tm) (T : ty),
|- t \in T -> value t \/ (exists t' : tm, t --> t'))).
idtac "Assumptions:".
Abort.
Print Assumptions progress.
Goal True.
idtac " ".
idtac "------------------- finish_progress_informal --------------------".
idtac " ".
idtac "#> Manually graded: finish_progress_informal".
idtac "Advanced".
idtac "Possible points: 3".
print_manual_grade manual_grade_for_finish_progress_informal.
idtac " ".
idtac "------------------- finish_preservation --------------------".
idtac " ".
idtac "#> preservation".
idtac "Possible points: 2".
check_type @preservation (
(forall (t t' : tm) (T : ty), |- t \in T -> t --> t' -> |- t' \in T)).
idtac "Assumptions:".
Abort.
Print Assumptions preservation.
Goal True.
idtac " ".
idtac "------------------- finish_preservation_informal --------------------".
idtac " ".
idtac "#> Manually graded: finish_preservation_informal".
idtac "Advanced".
idtac "Possible points: 3".
print_manual_grade manual_grade_for_finish_preservation_informal.
idtac " ".
idtac "------------------- preservation_alternate_proof --------------------".
idtac " ".
idtac "#> preservation'".
idtac "Possible points: 3".
check_type @preservation' (
(forall (t t' : tm) (T : ty), |- t \in T -> t --> t' -> |- t' \in T)).
idtac "Assumptions:".
Abort.
Print Assumptions preservation'.
Goal True.
idtac " ".
idtac "------------------- subject_expansion --------------------".
idtac " ".
idtac "#> Manually graded: subject_expansion".
idtac "Possible points: 2".
print_manual_grade manual_grade_for_subject_expansion.
idtac " ".
idtac "------------------- variation1 --------------------".
idtac " ".
idtac "#> Manually graded: variation1".
idtac "Possible points: 2".
print_manual_grade manual_grade_for_variation1.
idtac " ".
idtac "------------------- variation2 --------------------".
idtac " ".
idtac "#> Manually graded: variation2".
idtac "Possible points: 2".
print_manual_grade manual_grade_for_variation2.
idtac " ".
idtac "------------------- remove_prdzro --------------------".
idtac " ".
idtac "#> Manually graded: remove_predzro".
idtac "Possible points: 1".
print_manual_grade manual_grade_for_remove_predzro.
idtac " ".
idtac "------------------- prog_pres_bigstep --------------------".
idtac " ".
idtac "#> Manually graded: prog_pres_bigstep".
idtac "Advanced".
idtac "Possible points: 6".
print_manual_grade manual_grade_for_prog_pres_bigstep.
idtac " ".
idtac " ".
idtac "Max points - standard: 20".
idtac "Max points - advanced: 32".
idtac "".
idtac "Allowed Axioms:".
idtac "functional_extensionality".
idtac "FunctionalExtensionality.functional_extensionality_dep".
idtac "".
idtac "".
idtac "********** Summary **********".
idtac "".
idtac "Below is a summary of the automatically graded exercises that are incomplete.".
idtac "".
idtac "The output for each exercise can be any of the following:".
idtac " - 'Closed under the global context', if it is complete".
idtac " - 'MANUAL', if it is manually graded".
idtac " - A list of pending axioms, containing unproven assumptions. In this case".
idtac " the exercise is considered complete, if the axioms are all allowed.".
idtac "".
idtac "********** Standard **********".
idtac "---------- some_term_is_stuck ---------".
Print Assumptions some_term_is_stuck.
idtac "---------- value_is_nf ---------".
Print Assumptions value_is_nf.
idtac "---------- progress ---------".
Print Assumptions progress.
idtac "---------- preservation ---------".
Print Assumptions preservation.
idtac "---------- preservation' ---------".
Print Assumptions preservation'.
idtac "---------- subject_expansion ---------".
idtac "MANUAL".
idtac "---------- variation1 ---------".
idtac "MANUAL".
idtac "---------- variation2 ---------".
idtac "MANUAL".
idtac "---------- remove_predzro ---------".
idtac "MANUAL".
idtac "".
idtac "********** Advanced **********".
idtac "---------- finish_progress_informal ---------".
idtac "MANUAL".
idtac "---------- finish_preservation_informal ---------".
idtac "MANUAL".
idtac "---------- prog_pres_bigstep ---------".
idtac "MANUAL".
Abort.
(* 2021-08-11 15:11 *)
(* 2021-08-11 15:11 *)