48 lines
1 KiB
Coq
48 lines
1 KiB
Coq
|
Set Warnings "-notation-overridden,-parsing".
|
||
|
From Coq Require Export String.
|
||
|
From LF Require Import IndPrinciples.
|
||
|
|
||
|
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 LF Require Import IndPrinciples.
|
||
|
Import Check.
|
||
|
|
||
|
Goal True.
|
||
|
|
||
|
idtac " ".
|
||
|
|
||
|
idtac "Max points - standard: 0".
|
||
|
idtac "Max points - advanced: 0".
|
||
|
idtac "".
|
||
|
idtac "********** Summary **********".
|
||
|
idtac "".
|
||
|
idtac "********** Standard **********".
|
||
|
idtac "".
|
||
|
idtac "********** Advanced **********".
|
||
|
Abort.
|
||
|
|
||
|
(* Wed Jan 9 12:02:19 EST 2019 *)
|