Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adam
stdpp
Commits
52ac9252
Commit
52ac9252
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make naive_solver a bit more robust.
parent
05c5d5fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/tactics.v
+11
-8
11 additions, 8 deletions
theories/tactics.v
with
11 additions
and
8 deletions
theories/tactics.v
+
11
−
8
View file @
52ac9252
...
@@ -320,6 +320,12 @@ Lemma forall_and_distr (A : Type) (P Q : A → Prop) :
...
@@ -320,6 +320,12 @@ Lemma forall_and_distr (A : Type) (P Q : A → Prop) :
(
∀
x
,
P
x
∧
Q
x
)
↔
(
∀
x
,
P
x
)
∧
(
∀
x
,
Q
x
)
.
(
∀
x
,
P
x
∧
Q
x
)
↔
(
∀
x
,
P
x
)
∧
(
∀
x
,
Q
x
)
.
Proof
.
firstorder
.
Qed
.
Proof
.
firstorder
.
Qed
.
(** The tactic [no_new_unsolved_evars tac] executes [tac] and fails if it
creates any new evars. This trick is by Jonathan Leivent, see:
https://coq.inria.fr/bugs/show_bug.cgi?id=3872 *)
Ltac
no_new_unsolved_evars
tac
:=
exact
ltac
:(
tac
)
.
Tactic
Notation
"naive_solver"
tactic
(
tac
)
:=
Tactic
Notation
"naive_solver"
tactic
(
tac
)
:=
unfold
iff
,
not
in
*
;
unfold
iff
,
not
in
*
;
repeat
match
goal
with
repeat
match
goal
with
...
@@ -353,23 +359,20 @@ Tactic Notation "naive_solver" tactic(tac) :=
...
@@ -353,23 +359,20 @@ Tactic Notation "naive_solver" tactic(tac) :=
(**i use recursion to enable backtracking on the following clauses. *)
(**i use recursion to enable backtracking on the following clauses. *)
match
goal
with
match
goal
with
(**i instantiation of the conclusion *)
(**i instantiation of the conclusion *)
|
|
-
∃
x
,
_
=>
eexists
;
go
n
|
|
-
∃
x
,
_
=>
no_new_unsolved_evars
ltac
:(
eexists
;
go
n
)
|
|
-
_
∨
_
=>
first
[
left
;
go
n
|
right
;
go
n
]
|
|
-
_
∨
_
=>
first
[
left
;
go
n
|
right
;
go
n
]
|
_
=>
|
_
=>
(**i instantiations of assumptions. *)
(**i instantiations of assumptions. *)
lazymatch
n
with
lazymatch
n
with
|
S
?n'
=>
|
S
?n'
=>
(**i we give priority to assumptions that fit on the conclusion. *)
(**i we give priority to assumptions that fit on the conclusion. *)
match
goal
with
match
goal
with
|
H
:
_
→
_
|
-
_
=>
is_non_dependent
H
;
eapply
H
;
clear
H
;
go
n'
|
H
:
_
→
_
|
-
_
=>
|
H
:
_
→
_
|
-
_
=>
is_non_dependent
H
;
is_non_dependent
H
;
try
(
eapply
H
;
fail
2
);
no_new_unsolved_evars
efeed
pose
proof
H
;
clear
H
;
go
n'
ltac
:(
first
[
eapply
H
|
efeed
pose
proof
H
]
;
clear
H
;
go
n'
)
end
end
end
end
end
end
in
iter
(
fun
n'
=>
go
n'
)
(
eval
compute
in
(
seq
0
6
))
.
in
iter
(
fun
n'
=>
go
n'
)
(
eval
compute
in
(
seq
1
6
))
.
Tactic
Notation
"naive_solver"
:=
naive_solver
eauto
.
Tactic
Notation
"naive_solver"
:=
naive_solver
eauto
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment