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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
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
RT-PROOFS
PROSA - Formally Proven Schedulability Analysis
Commits
2a5d60be
Commit
2a5d60be
authored
4 years ago
by
Marco Maida
Committed by
Björn Brandenburg
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
comment on ssrlia tactic
parent
f13d14fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!124
Ssrlia refactoring
Pipeline
#41163
passed
4 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util/ssrlia.v
+23
-19
23 additions, 19 deletions
util/ssrlia.v
with
23 additions
and
19 deletions
util/ssrlia.v
+
23
−
19
View file @
2a5d60be
...
...
@@ -3,32 +3,36 @@ Require Import Lia.
(* Adopted from http://github.com/pi8027/formalized-postscript/blob/master/stdlib_ext.v *)
(** This tactic matches over the hypotheses, searching for expressions that can
be converted from [ssreflect] arithmetic to Coq arithmetic. *)
Ltac
arith_hypo_ssrnat2coqnat
:=
match
goal
with
|
H
:
context
[
andb
_
_]
|
-
_
=>
let
H0
:=
fresh
in
case
/
andP
:
H
=>
H
H0
|
H
:
context
[
orb
_
_]
|
-
_
=>
case
/
orP
:
H
=>
H
|
H
:
context
[
?L
<=
?R
]
|
-
_
=>
move
/
leP
:
H
=>
H
|
H
:
context
[
?L
<
?R
]
|
-
_
=>
move
/
ltP
:
H
=>
H
|
H
:
context
[
?L
==
?R
]
|
-
_
=>
move
/
eqP
:
H
=>
H
|
H
:
context
[
addn
?L
?R
]
|
-
_
=>
rewrite
-
plusE
in
H
|
H
:
context
[
muln
?L
?R
]
|
-
_
=>
rewrite
-
multE
in
H
|
H
:
context
[
subn
?L
?R
]
|
-
_
=>
rewrite
-
minusE
in
H
|
H
:
context
[
andb
_
_]
|
-
_
=>
let
H0
:=
fresh
in
case
/
andP
:
H
=>
H
H0
|
H
:
context
[
orb
_
_]
|
-
_
=>
case
/
orP
:
H
=>
H
|
H
:
context
[
?L
<=
?R
]
|
-
_
=>
move
/
leP
:
H
=>
H
|
H
:
context
[
?L
<
?R
]
|
-
_
=>
move
/
ltP
:
H
=>
H
|
H
:
context
[
?L
==
?R
]
|
-
_
=>
move
/
eqP
:
H
=>
H
|
H
:
context
[
addn
?L
?R
]
|
-
_
=>
rewrite
-
plusE
in
H
|
H
:
context
[
muln
?L
?R
]
|
-
_
=>
rewrite
-
multE
in
H
|
H
:
context
[
subn
?L
?R
]
|
-
_
=>
rewrite
-
minusE
in
H
end
.
(** This tactic matches the goal, searching for expressions that can be
converted from [ssreflect] arithmetic to Coq arithmetic. *)
Ltac
arith_goal_ssrnat2coqnat
:=
rewrite
?NatTrec
.
trecE
-
?plusE
-
?minusE
-
?multE
-
?leqNgt
-
?ltnNge
;
repeat
match
goal
with
|
|
-
is_true
(
andb
_
_)
=>
apply
/
andP
;
split
|
|
-
is_true
(
orb
_
_)
=>
try
apply
/
orP
|
|
-
is_true
(_
<=
_)
=>
try
apply
/
leP
|
|
-
is_true
(_
<
_)
=>
try
apply
/
ltP
end
.
(** Solve arithmetic goals.
This tactic first rewrites the context to replace operations from ssreflect
to the corresponding operations in the Coq library, then calls [lia]. *)
|
|
-
is_true
(
andb
_
_)
=>
apply
/
andP
;
split
|
|
-
is_true
(
orb
_
_)
=>
try
apply
/
orP
|
|
-
is_true
(_
<=
_)
=>
try
apply
/
leP
|
|
-
is_true
(_
<
_)
=>
try
apply
/
ltP
end
.
(** Solves linear integer arithmetic goals containing [ssreflect] expressions.
This tactic first rewrites the context to replace operations from [ssreflect]
to the corresponding operations in the Coq library, then calls [lia]. *)
Ltac
ssrlia
:=
repeat
arith_hypo_ssrnat2coqnat
;
arith_goal_ssrnat2coqnat
;
simpl
;
repeat
arith_hypo_ssrnat2coqnat
;
arith_goal_ssrnat2coqnat
;
simpl
;
lia
.
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