-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSmallstepTest.v
239 lines (202 loc) · 6.47 KB
/
SmallstepTest.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Set Warnings "-notation-overridden,-parsing".
From Coq Require Export String.
From PLF Require Import Smallstep.
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 Smallstep.
Import Check.
Goal True.
idtac "------------------- test_step_2 --------------------".
idtac " ".
idtac "#> SimpleArith1.test_step_2".
idtac "Possible points: 1".
check_type @SimpleArith1.test_step_2 (
(SimpleArith1.step (P (C 0) (P (C 2) (P (C 1) (C 3))))
(P (C 0) (P (C 2) (C 4))))).
idtac "Assumptions:".
Abort.
Print Assumptions SimpleArith1.test_step_2.
Goal True.
idtac " ".
idtac "------------------- redo_determinism --------------------".
idtac " ".
idtac "#> step_deterministic".
idtac "Possible points: 3".
check_type @step_deterministic ((@deterministic tm step)).
idtac "Assumptions:".
Abort.
Print Assumptions step_deterministic.
Goal True.
idtac " ".
idtac "------------------- smallstep_bools --------------------".
idtac " ".
idtac "#> Manually graded: Temp4.smallstep_bools".
idtac "Possible points: 1".
print_manual_grade Temp4.manual_grade_for_smallstep_bools.
idtac " ".
idtac "------------------- smallstep_bool_shortcut --------------------".
idtac " ".
idtac "#> Temp4.Temp5.bool_step_prop4_holds".
idtac "Possible points: 2".
check_type @Temp4.Temp5.bool_step_prop4_holds (Temp4.Temp5.bool_step_prop4).
idtac "Assumptions:".
Abort.
Print Assumptions Temp4.Temp5.bool_step_prop4_holds.
Goal True.
idtac " ".
idtac "------------------- test_multistep_4 --------------------".
idtac " ".
idtac "#> test_multistep_4".
idtac "Possible points: 2".
check_type @test_multistep_4 (
(P (C 0) (P (C 2) (P (C 0) (C 3))) -->* P (C 0) (C (2 + (0 + 3))))).
idtac "Assumptions:".
Abort.
Print Assumptions test_multistep_4.
Goal True.
idtac " ".
idtac "------------------- multistep_congr_2 --------------------".
idtac " ".
idtac "#> multistep_congr_2".
idtac "Possible points: 2".
check_type @multistep_congr_2 (
(forall t1 t2 t2' : tm, value t1 -> t2 -->* t2' -> P t1 t2 -->* P t1 t2')).
idtac "Assumptions:".
Abort.
Print Assumptions multistep_congr_2.
Goal True.
idtac " ".
idtac "------------------- eval__multistep --------------------".
idtac " ".
idtac "#> eval__multistep".
idtac "Possible points: 3".
check_type @eval__multistep ((forall (t : tm) (n : nat), t ==> n -> t -->* C n)).
idtac "Assumptions:".
Abort.
Print Assumptions eval__multistep.
Goal True.
idtac " ".
idtac "------------------- eval__multistep_inf --------------------".
idtac " ".
idtac "#> Manually graded: eval__multistep_inf".
idtac "Advanced".
idtac "Possible points: 3".
print_manual_grade manual_grade_for_eval__multistep_inf.
idtac " ".
idtac "------------------- step__eval --------------------".
idtac " ".
idtac "#> step__eval".
idtac "Possible points: 3".
check_type @step__eval ((forall (t t' : tm) (n : nat), t --> t' -> t' ==> n -> t ==> n)).
idtac "Assumptions:".
Abort.
Print Assumptions step__eval.
Goal True.
idtac " ".
idtac "------------------- multistep__eval --------------------".
idtac " ".
idtac "#> multistep__eval".
idtac "Possible points: 3".
check_type @multistep__eval (
(forall t t' : tm, normal_form_of t t' -> exists n : nat, t' = C n /\ t ==> n)).
idtac "Assumptions:".
Abort.
Print Assumptions multistep__eval.
Goal True.
idtac " ".
idtac "------------------- combined_properties --------------------".
idtac " ".
idtac "#> Manually graded: combined_properties".
idtac "Possible points: 6".
print_manual_grade manual_grade_for_combined_properties.
idtac " ".
idtac "------------------- compiler_is_correct --------------------".
idtac " ".
idtac "#> compiler_is_correct".
idtac "Advanced".
idtac "Possible points: 3".
check_type @compiler_is_correct (compiler_is_correct_statement).
idtac "Assumptions:".
Abort.
Print Assumptions compiler_is_correct.
Goal True.
idtac " ".
idtac "------------------- normalize_ex --------------------".
idtac " ".
idtac "#> normalize_ex".
idtac "Possible points: 1".
check_type @normalize_ex ((exists e' : tm, P (C 3) (P (C 2) (C 1)) -->* e' /\ value e')).
idtac "Assumptions:".
Abort.
Print Assumptions normalize_ex.
Goal True.
idtac " ".
idtac " ".
idtac "Max points - standard: 27".
idtac "Max points - advanced: 33".
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 "---------- SimpleArith1.test_step_2 ---------".
Print Assumptions SimpleArith1.test_step_2.
idtac "---------- step_deterministic ---------".
Print Assumptions step_deterministic.
idtac "---------- smallstep_bools ---------".
idtac "MANUAL".
idtac "---------- Temp4.Temp5.bool_step_prop4_holds ---------".
Print Assumptions Temp4.Temp5.bool_step_prop4_holds.
idtac "---------- test_multistep_4 ---------".
Print Assumptions test_multistep_4.
idtac "---------- multistep_congr_2 ---------".
Print Assumptions multistep_congr_2.
idtac "---------- eval__multistep ---------".
Print Assumptions eval__multistep.
idtac "---------- step__eval ---------".
Print Assumptions step__eval.
idtac "---------- multistep__eval ---------".
Print Assumptions multistep__eval.
idtac "---------- combined_properties ---------".
idtac "MANUAL".
idtac "---------- normalize_ex ---------".
Print Assumptions normalize_ex.
idtac "".
idtac "********** Advanced **********".
idtac "---------- eval__multistep_inf ---------".
idtac "MANUAL".
idtac "---------- compiler_is_correct ---------".
Print Assumptions compiler_is_correct.
Abort.
(* 2021-08-11 15:11 *)
(* 2021-08-11 15:11 *)