forked from Coq-zh/SF-zh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReferencesTest.v
138 lines (115 loc) · 4.06 KB
/
ReferencesTest.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
Set Warnings "-notation-overridden,-parsing".
From Coq Require Export String.
From PLF Require Import References.
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 References.
Import Check.
Goal True.
idtac "------------------- compact_update --------------------".
idtac " ".
idtac "#> Manually graded: STLCRef.compact_update".
idtac "Possible points: 2".
print_manual_grade STLCRef.manual_grade_for_compact_update.
idtac " ".
idtac "------------------- type_safety_violation --------------------".
idtac " ".
idtac "#> Manually graded: STLCRef.type_safety_violation".
idtac "Possible points: 2".
print_manual_grade STLCRef.manual_grade_for_type_safety_violation.
idtac " ".
idtac "------------------- cyclic_store --------------------".
idtac " ".
idtac "#> Manually graded: STLCRef.cyclic_store".
idtac "Possible points: 2".
print_manual_grade STLCRef.manual_grade_for_cyclic_store.
idtac " ".
idtac "------------------- store_not_unique --------------------".
idtac " ".
idtac "#> Manually graded: STLCRef.store_not_unique".
idtac "Possible points: 2".
print_manual_grade STLCRef.manual_grade_for_store_not_unique.
idtac " ".
idtac "------------------- preservation_informal --------------------".
idtac " ".
idtac "#> Manually graded: STLCRef.preservation_informal".
idtac "Possible points: 3".
print_manual_grade STLCRef.manual_grade_for_preservation_informal.
idtac " ".
idtac "------------------- factorial_ref --------------------".
idtac " ".
idtac "#> STLCRef.RefsAndNontermination.factorial".
idtac "Possible points: 3".
check_type @STLCRef.RefsAndNontermination.factorial (STLCRef.tm).
idtac "Assumptions:".
Abort.
Print Assumptions STLCRef.RefsAndNontermination.factorial.
Goal True.
idtac " ".
idtac "#> STLCRef.RefsAndNontermination.factorial_type".
idtac "Possible points: 3".
check_type @STLCRef.RefsAndNontermination.factorial_type (
(STLCRef.has_type (@Maps.empty STLCRef.ty) (@nil STLCRef.ty)
STLCRef.RefsAndNontermination.factorial
(STLCRef.Arrow STLCRef.Nat STLCRef.Nat))).
idtac "Assumptions:".
Abort.
Print Assumptions STLCRef.RefsAndNontermination.factorial_type.
Goal True.
idtac " ".
idtac " ".
idtac "Max points - standard: 17".
idtac "Max points - advanced: 17".
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 "---------- compact_update ---------".
idtac "MANUAL".
idtac "---------- type_safety_violation ---------".
idtac "MANUAL".
idtac "---------- cyclic_store ---------".
idtac "MANUAL".
idtac "---------- store_not_unique ---------".
idtac "MANUAL".
idtac "---------- preservation_informal ---------".
idtac "MANUAL".
idtac "---------- STLCRef.RefsAndNontermination.factorial ---------".
Print Assumptions STLCRef.RefsAndNontermination.factorial.
idtac "---------- STLCRef.RefsAndNontermination.factorial_type ---------".
Print Assumptions STLCRef.RefsAndNontermination.factorial_type.
idtac "".
idtac "********** Advanced **********".
Abort.
(* 2020-06-08 10:50:37 (UTC+00) *)