Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
aa590968
Commit
aa590968
authored
3 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[WP] adds comments in the tactics dedicated to sequences
parent
6de1f210
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
src/plugins/wp/TacSequence.ml
+6
-0
6 additions, 0 deletions
src/plugins/wp/TacSequence.ml
with
6 additions
and
0 deletions
src/plugins/wp/TacSequence.ml
+
6
−
0
View file @
aa590968
...
...
@@ -63,12 +63,16 @@ class sequence =
begin
match
self
#
get_field
vmode
with
|
`Sum
->
(* n1>=0 && n2>=0 && ... |- (a *^ (n1 + n2 + ...)) -+-> ((a *^ n1) ^ (a *^ n2) ^ ...) *)
let
ns
=
sum
n
in
(* NB. the term is rewriten in itself when the initial term is not a sum *)
let
pos
=
F
.
p_all
positive
ns
in
let
cat
=
concat
~
result
(
List
.
map
(
repeat
~
result
a
)
ns
)
in
Tactical
.
condition
"Positive"
pos
@@
Tactical
.
rewrite
?
at
[
"Unroll"
,
pos
,
value
,
cat
]
|
`Left
->
(* n<=0 |- (a *^ n) -+-> [] *)
(* n-1>=0 |- (a *^ n) -+-> (a ^ (a *^ (n-1))) *)
let
p
=
F
.
e_add
n
F
.
e_minus_one
in
let
unroll
=
concat
~
result
[
a
;
repeat
~
result
a
p
]
in
Tactical
.
rewrite
?
at
[
...
...
@@ -76,6 +80,8 @@ class sequence =
"Unroll"
,
positive
p
,
value
,
unroll
;
]
|
`Right
->
(* n<=0 |- (a *^ n) -+-> [] *)
(* n-1>=0 |- (a *^ n) -+-> ((a *^ (n-1)) ^ a) *)
let
p
=
F
.
e_add
n
F
.
e_minus_one
in
let
unroll
=
concat
~
result
[
repeat
~
result
a
p
;
a
]
in
Tactical
.
rewrite
?
at
[
...
...
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