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
ab41726d
Commit
ab41726d
authored
3 years ago
by
Nathan Koskas de Diego
Browse files
Options
Downloads
Patches
Plain Diff
[qed] optimization of Qed.Term.bind_xs
parent
5ec2bee1
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/qed/term.ml
+22
-2
22 additions, 2 deletions
src/plugins/qed/term.ml
with
22 additions
and
2 deletions
src/plugins/qed/term.ml
+
22
−
2
View file @
ab41726d
...
@@ -2160,6 +2160,21 @@ struct
...
@@ -2160,6 +2160,21 @@ struct
set
mu
(
e_var
x
)
(
c_bvar
k
t
)
;
set
mu
(
e_var
x
)
(
c_bvar
k
t
)
;
walk
mu
x
lc
walk
mu
x
lc
(* Alpha-convert free-variables in xs with the top-most bound variables *)
let
lc_close_xs
xs
(
lc
:
lc_term
)
:
lc_term
=
let
mu
=
cache
()
in
let
i
=
ref
(
Bvars
.
order
lc
.
bind
)
in
xs
|>
List
.
iter
(
fun
x
->
set
mu
(
e_var
x
)
(
c_bvar
!
i
(
tau_of_var
x
));
i
:=
!
i
-
1
);
let
xs
=
List
.
fold_left
(
fun
xs
x
->
Vars
.
add
x
xs
)
Vars
.
empty
xs
in
let
rec
walk
mu
lc
=
if
Vars
.
intersect
xs
lc
.
vars
then
get
mu
(
lc_alpha
(
walk
mu
))
lc
else
lc
in
walk
mu
lc
(* Alpha-convert top-most bound variable with free-variable x *)
(* Alpha-convert top-most bound variable with free-variable x *)
let
lc_open
x
(
lc
:
lc_term
)
:
lc_term
=
let
lc_open
x
(
lc
:
lc_term
)
:
lc_term
=
let
rec
walk
mu
k
lc
=
let
rec
walk
mu
k
lc
=
...
@@ -2521,8 +2536,13 @@ struct
...
@@ -2521,8 +2536,13 @@ struct
let
e_close
qs
a
=
List
.
fold_left
(
fun
b
(
q
,
x
)
->
e_bind
q
x
b
)
a
qs
let
e_close
qs
a
=
List
.
fold_left
(
fun
b
(
q
,
x
)
->
e_bind
q
x
b
)
a
qs
let
rec
bind_xs
q
xs
e
=
let
bind_xs
q
xs
e
=
match
xs
with
[]
->
e
|
x
::
xs
->
e_bind
q
x
(
bind_xs
q
xs
e
)
let
xs
=
match
q
with
|
Lambda
->
xs
|
Forall
|
Exists
->
List
.
filter
(
fun
x
->
Vars
.
mem
x
e
.
vars
)
xs
in
let
e
=
lc_close_xs
xs
e
in
List
.
fold_right
(
fun
x
e
->
c_bind
q
(
tau_of_var
x
)
e
)
xs
e
let
e_forall
=
bind_xs
Forall
let
e_forall
=
bind_xs
Forall
let
e_exists
=
bind_xs
Exists
let
e_exists
=
bind_xs
Exists
...
...
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