Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROSA - Formally Proven Schedulability Analysis
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
Environments
Terraform modules
Monitor
Incidents
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
Lasse Blaauwbroek
PROSA - Formally Proven Schedulability Analysis
Commits
e4012a4d
Commit
e4012a4d
authored
7 years ago
by
Felipe Cerqueira
Browse files
Options
Downloads
Patches
Plain Diff
Add tactic for splitting conjunction
parent
b6c93d38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util/tactics.v
+36
-4
36 additions, 4 deletions
util/tactics.v
with
36 additions
and
4 deletions
util/tactics.v
+
36
−
4
View file @
e4012a4d
...
...
@@ -403,8 +403,16 @@ Ltac exploit x :=
||
refine
((
fun
x
y
=>
y
x
)
(
x
_
_)
_)
||
refine
((
fun
x
y
=>
y
x
)
(
x
_)
_)
.
(* Feed tactic -- exploit with multiple arguments.
(taken from http://comments.gmane.org/gmane.science.mathematics.logic.coq.club/7013) *)
(* This tactic feeds the precondition of an implication in order to derive the conclusion
(taken from http://comments.gmane.org/gmane.science.mathematics.logic.coq.club/7013).
Usage: feed H.
H: P -> Q ==becomes==> H: P
____
Q
After completing this proof, Q becomes a hypothesis in the context. *)
Ltac
feed
H
:=
match
type
of
H
with
|
?foo
->
_
=>
...
...
@@ -412,15 +420,39 @@ Ltac feed H :=
assert
foo
as
FOO
;
[|
specialize
(
H
FOO
);
clear
FOO
]
end
.
(* Generalization of feed for multiple hypotheses.
feed_n is useful for accessing conclusions of long implications.
Usage: feed_n 3 H.
H: P1 -> P2 -> P3 -> Q.
We'll be asked to prove P1, P2 and P3, so that Q can be inferred. *)
Ltac
feed_n
n
H
:=
match
constr
:(
n
)
with
|
O
=>
idtac
|
(
S
?m
)
=>
feed
H
;
[|
feed_n
m
H
]
end
.
end
.
(* ************************************************************************** *)
(** * New tactics for ssreflect *)
(* ************************************************************************** *)
(* Tactic for simplifying a sum with constant term.
Usage: simpl_sum_const in H.
H: \sum_(2 <= x < 4) 5 > 0 ==becomes==> H: 5 * (4 - 2) > 0 *)
Ltac
simpl_sum_const
:=
rewrite
?big_const_nat
?big_const_ord
?big_const_seq
iter_addn
?muln1
?mul1n
?mul0n
?muln0
?addn0
?add0n
.
\ No newline at end of file
?muln0
?addn0
?add0n
.
(* Tactic for splitting all conjunctions in a hypothesis.
Usage: split_conj H.
H: A /\ (B /\ C) ==becomes==> H1: A
H2: B
H3: C *)
Ltac
split_conj
X
:=
hnf
in
X
;
repeat
match
goal
with
|
H
:
?p
/\
?q
|
-
_
=>
let
x'
:=
H
in
let
y'
:=
fresh
H
in
destruct
H
as
[
x'
y'
]
end
.
\ No newline at end of file
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