Skip to content

Commit badb8c2

Browse files
committed
coq automation ftw
1 parent b1f0b65 commit badb8c2

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

CheckWF.v

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ From Equations Require Import Equations.
77
Import ListNotations.
88
Import EnvMap.
99

10-
1110
#[global] Obligation Tactic := idtac.
1211
#[global] Set Equations Transparent.
1312
#[global] Set Equations With UIP.
@@ -22,36 +21,24 @@ Definition dec_fresh_global
2221
: decidable (fresh_global k decls).
2322
Admitted.
2423

25-
Equations dec_wf_glob {efl : EEnvFlags} (decls : global_declarations)
24+
#[local] Obligation Tactic :=
25+
try intro wf_decls;
26+
try dependent elimination wf_decls;
27+
try auto.
28+
29+
Equations? dec_wf_glob {efl : EEnvFlags} (decls : global_declarations)
2630
: decidable (wf_glob decls) :=
2731
dec_wf_glob [] := or_introl wf_glob_nil;
2832
dec_wf_glob ((k,d)::ds) with dec_wf_glob ds := {
2933
| or_introl wf_ds with inspect (wf_global_decl ds d), dec_fresh_global k ds := {
30-
| true eqn: wf_d | or_introl fresh_k := or_introl (wf_glob_cons k d ds wf_ds wf_d fresh_k);
31-
| true eqn: wf_d | or_intror rotten_k := or_intror _;
32-
| false eqn: wf_d | _ := or_intror _;
34+
| true eqn: wf_d | or_introl fresh_k := or_introl _;
35+
| true eqn: wf_d | or_intror rotten_k := or_intror _;
36+
| false eqn: not_wf_d | _ := or_intror _;
3337
};
34-
| or_intror p := or_intror _
38+
| or_intror not_wf_ds := or_intror _
3539
}.
36-
Next Obligation.
37-
intros dec_wf_glob efl k d ds fresh_k not_wf_d _ _ wf_decls.
38-
dependent elimination wf_decls.
39-
simpl in not_wf_d.
40+
- apply wf_glob_cons; auto.
41+
- simpl in not_wf_d.
4042
rewrite not_wf_d in i.
41-
discriminate i.
42-
Qed.
43-
Next Obligation.
44-
intros dec_wf_glob efl k d ds rotten_k _ _ wf_decls.
45-
dependent elimination wf_decls.
46-
apply (rotten_k f).
47-
Qed.
48-
Next Obligation.
49-
intros dec_wf_glob efl k d ds rotten_k _ _ _ wf_decls.
50-
dependent elimination wf_decls.
51-
apply (rotten_k f).
52-
Qed.
53-
Next Obligation.
54-
intros dec_wf_glob efl k d ds not_wf_ds wf_decls.
55-
dependent elimination wf_decls.
56-
apply (not_wf_ds w).
43+
auto.
5744
Defined.

0 commit comments

Comments
 (0)