-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathRuleSets1.lean
128 lines (93 loc) · 2.37 KB
/
RuleSets1.lean
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
/-
Copyright (c) 2022-2023 Jannis Limperg. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jannis Limperg
-/
import AesopTest.RuleSets0
set_option aesop.check.all true
set_option aesop.smallErrorMessages true
@[aesop safe (rule_sets := [test_A])]
inductive A : Prop where
| intro
@[aesop safe (rule_sets := [test_B])]
inductive B : Prop where
| intro
@[aesop safe]
inductive C : Prop where
| intro
inductive D : Prop where
| intro
/--
error: tactic 'aesop' failed, failed to prove the goal after exhaustive search.
-/
#guard_msgs in
example : A := by
aesop (config := { terminal := true })
example : A := by
aesop (rule_sets := [test_A])
example : B := by
aesop (rule_sets := [test_A, test_B])
/--
error: tactic 'aesop' failed, failed to prove the goal after exhaustive search.
-/
#guard_msgs in
example : C := by
aesop (rule_sets := [-default]) (config := { terminal := true })
example : C := by
aesop
attribute [aesop safe (rule_sets := [test_C])] C
-- Removing the attribute removes all rules associated with C from all rule
-- sets.
attribute [-aesop] C
/--
error: tactic 'aesop' failed, failed to prove the goal after exhaustive search.
-/
#guard_msgs in
example : C := by
aesop (rule_sets := [test_C]) (config := { terminal := true })
example : C := by
aesop (add safe C)
@[aesop norm simp]
theorem ad : D ↔ A :=
⟨λ _ => A.intro, λ _ => D.intro⟩
example : D := by
aesop (rule_sets := [test_A])
attribute [-aesop] ad
/--
error: tactic 'aesop' failed, failed to prove the goal after exhaustive search.
-/
#guard_msgs in
example : D := by
aesop (rule_sets := [test_A]) (config := { terminal := true })
example : D := by
aesop (add norm ad) (rule_sets := [test_A])
-- Rules can also be local.
inductive E : Prop where
| intro
section
attribute [local aesop safe] E
example : E := by
aesop
end
/--
error: tactic 'aesop' failed, failed to prove the goal after exhaustive search.
-/
#guard_msgs in
example : E := by
aesop (config := { terminal := true })
example : E := by
constructor
-- Rules can also be scoped.
namespace EScope
attribute [scoped aesop safe] E
example : E := by
aesop
end EScope
/--
error: tactic 'aesop' failed, failed to prove the goal after exhaustive search.
-/
#guard_msgs in
example : E := by
aesop (config := { terminal := true })
example : E := by
open EScope in aesop