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
c039726b
Commit
c039726b
authored
5 years ago
by
Loïc Correnson
Committed by
Patrick Baudin
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[qed] introduction of e_open and e_close
parent
015e5c4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/qed/logic.ml
+6
-5
6 additions, 5 deletions
src/plugins/qed/logic.ml
src/plugins/qed/term.ml
+20
-9
20 additions, 9 deletions
src/plugins/qed/term.ml
src/plugins/wp/Lang.mli
+9
-1
9 additions, 1 deletion
src/plugins/wp/Lang.mli
with
35 additions
and
15 deletions
src/plugins/qed/logic.ml
+
6
−
5
View file @
c039726b
...
@@ -306,11 +306,12 @@ sig
...
@@ -306,11 +306,12 @@ sig
(** Bind the given variable if it appears free in the term,
(** Bind the given variable if it appears free in the term,
or return the term unchanged. *)
or return the term unchanged. *)
val
e_open
:
var
->
term
->
term
val
e_open
:
?
pool
:
pool
->
?
forall
:
bool
->
?
exists
:
bool
->
?
lambda
:
bool
->
(** Open the top-most binder with the given variable, or
term
->
(
binder
*
var
)
list
*
term
return the term unchanged.
(** Open all the specified binders *)
@raise Invalid_argument if the variable is not free and
has not the right type. *)
val
e_close
:
(
binder
*
var
)
list
->
term
->
term
(** Closes all specified binders *)
(** {3 Local Caches} *)
(** {3 Local Caches} *)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qed/term.ml
+
20
−
9
View file @
c039726b
...
@@ -2285,15 +2285,6 @@ struct
...
@@ -2285,15 +2285,6 @@ struct
|
_
->
is_eq
e
|
_
->
is_eq
e
in
ignore
(
exists_case
a
);
!
res
in
ignore
(
exists_case
a
);
!
res
let
e_open
x
(
e
:
term
)
=
assert
(
lc_closed
e
)
;
match
e
.
repr
with
|
Bind
(
_
,
t
,
a
)
->
if
not
(
Tau
.
equal
t
(
tau_of_var
x
)
||
Vars
.
mem
x
e
.
vars
)
then
lc_open
x
a
else
raise
(
Invalid_argument
"Qed.e_open"
)
|
_
->
e
let
e_bind
q
x
(
e
:
term
)
=
let
e_bind
q
x
(
e
:
term
)
=
assert
(
lc_closed
e
)
;
assert
(
lc_closed
e
)
;
let
do_bind
=
let
do_bind
=
...
@@ -2311,6 +2302,26 @@ struct
...
@@ -2311,6 +2302,26 @@ struct
let
e_exists
=
bind_xs
Exists
let
e_exists
=
bind_xs
Exists
let
e_lambda
=
bind_xs
Lambda
let
e_lambda
=
bind_xs
Lambda
let
e_open
?
pool
?
(
forall
=
true
)
?
(
exists
=
true
)
?
(
lambda
=
true
)
a
=
match
a
.
repr
with
|
Bind
_
->
let
pool
=
match
pool
with
Some
p
->
p
|
None
->
let
p
=
POOL
.
create
()
in
Vars
.
iter
(
POOL
.
add
p
)
a
.
vars
;
p
in
let
filter
=
function
|
Forall
->
forall
|
Exists
->
exists
|
Lambda
->
lambda
in
let
rec
walk
qs
a
=
match
a
.
repr
with
|
Bind
(
q
,
t
,
b
)
when
filter
q
->
let
x
=
fresh
pool
t
in
walk
((
q
,
x
)
::
qs
)
(
lc_open
x
b
)
|
_
->
qs
,
a
in
walk
[]
a
|
_
->
[]
,
a
let
e_close
qs
a
=
List
.
fold_left
(
fun
b
(
q
,
x
)
->
e_bind
q
x
b
)
a
qs
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(* --- Iterators --- *)
(* --- Iterators --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/Lang.mli
+
9
−
1
View file @
c039726b
...
@@ -293,6 +293,14 @@ sig
...
@@ -293,6 +293,14 @@ sig
val
e_fun
:
Fun
.
t
->
term
list
->
term
val
e_fun
:
Fun
.
t
->
term
list
->
term
val
e_bind
:
binder
->
var
->
term
->
term
val
e_bind
:
binder
->
var
->
term
->
term
val
e_open
:
pool
:
pool
->
?
forall
:
bool
->
?
exists
:
bool
->
?
lambda
:
bool
->
term
->
(
binder
*
var
)
list
*
term
(** Open all the specified binders
The pool must contain all free variables of the term. *)
val
e_close
:
(
binder
*
var
)
list
->
term
->
term
(** Closes all specified binders *)
(** {3 Predicates} *)
(** {3 Predicates} *)
type
pred
type
pred
...
@@ -398,7 +406,7 @@ sig
...
@@ -398,7 +406,7 @@ sig
(** {3 Binders} *)
(** {3 Binders} *)
val
lc_closed
:
term
->
bool
val
lc_closed
:
term
->
bool
val
lc_iter
:
(
term
->
unit
)
->
term
->
unit
val
lc_iter
:
(
term
->
unit
)
->
term
->
unit
(* TODO: to remove *)
(** {3 Utilities} *)
(** {3 Utilities} *)
...
...
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